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bdea","webpack://Dobbies.Commerce/./src/modules/iframe/iframe.tsx?65fe","webpack://Dobbies.Commerce/./src/modules/iframe/iframe.view.tsx?a7d6","webpack://Dobbies.Commerce/external var \"React\"?0d3b","webpack://Dobbies.Commerce/external var \"ReactDOM\"?853b"],"sourcesContent":["const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['iframe'] = {\n c: () => require('@msdyn365-commerce-modules/iframe/dist/lib/modules/iframe/iframe'),\n $type: 'contentModule',\n da: [],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'iframe',\n p: 'iframe',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/iframe/dist/lib/modules/iframe'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['@msdyn365-commerce-modules|iframe|modules|iframe|iframe'] = {\n c: () => require('@msdyn365-commerce-modules/iframe/dist/lib/modules/iframe/iframe.view.js'),\n cn: '@msdyn365-commerce-modules-iframe-iframe'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Heading, IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IHeadingData, IIframeConfig, IIframeProps } from './iframe.props.autogenerated';\n\nexport interface IIframeViewProps extends IIframeProps {\n Heading: React.ReactNode;\n IframeContainer: IModuleProps;\n IFrame: React.ReactNode;\n alert?: React.ReactNode;\n cookieConsentAccepted?: boolean;\n}\n\n/**\n *\n * Iframe component.\n * @extends {React.PureComponent}\n */\nclass Iframe extends React.PureComponent> {\n private readonly iframeRef: React.RefObject;\n\n constructor(props: IIframeProps) {\n super(props);\n this.iframeRef = React.createRef();\n }\n\n public render(): JSX.Element | null {\n const { config, resources } = this.props;\n const isConsentGiven =\n this.props.context.request &&\n this.props.context.request.cookies &&\n this.props.context.request.cookies.isConsentGiven &&\n this.props.context.request.cookies.isConsentGiven();\n\n if (!(config && config.target && config.target.destinationUrl)) {\n return null;\n }\n\n let srcURL;\n try {\n srcURL = new URL(config.target.destinationUrl);\n } catch (error) {\n this.props.telemetry.exception(error);\n return null;\n }\n\n if (srcURL && srcURL.protocol && srcURL.protocol.toLocaleLowerCase() !== 'https:') {\n return null;\n }\n const iframeClassName = classnames('ms-iframe', config.className);\n\n let viewProps: IIframeViewProps = {\n ...(this.props as IIframeProps),\n Heading: this._createHeading(config.heading!),\n IframeContainer: {\n moduleProps: this.props,\n className: iframeClassName\n },\n IFrame: this._createIframe()\n };\n\n if (!isConsentGiven) {\n viewProps = {\n ...viewProps,\n alert: this._renderAlert(resources.cookieConsentRequiredMessage)\n };\n } else {\n viewProps = {\n ...viewProps,\n cookieConsentAccepted: true\n };\n }\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _createHeading(heading: IHeadingData): React.ReactNode | null {\n if (!heading || !heading.text || heading.text.length === 0) {\n return null;\n }\n\n return ;\n }\n\n private _renderAlert(message: string): React.ReactNode | null {\n return (\n

\n {message}\n

\n );\n }\n\n private _createIframe(): React.ReactNode | null {\n const { config } = this.props;\n const targetURL = config.target.destinationUrl;\n\n return (\n \n );\n }\n}\n\nexport default Iframe;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IIframeViewProps } from './iframe';\n\n/**\n *\n * IFrameView component.\n * @extends {React.PureComponent}\n */\nexport class IFrameView extends React.PureComponent {\n public render(): JSX.Element | null {\n const { Heading, IframeContainer, IFrame, alert, cookieConsentAccepted } = this.props;\n\n return (\n \n {alert}\n {cookieConsentAccepted && cookieConsentAccepted ? (\n <>\n {Heading}\n {IFrame}\n \n ) : null}\n \n );\n }\n}\nexport default IFrameView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","viewDictionary","cn","Iframe","React","constructor","props","super","this","iframeRef","render","config","resources","isConsentGiven","context","request","cookies","target","destinationUrl","srcURL","URL","error","telemetry","exception","protocol","toLocaleLowerCase","iframeClassName","classnames","className","viewProps","Heading","_createHeading","heading","IframeContainer","moduleProps","IFrame","_createIframe","cookieConsentAccepted","alert","_renderAlert","cookieConsentRequiredMessage","renderView","text","length","Object","assign","message","role","targetURL","src","height","iframeAriaLabel","ref","IFrameView","Module","module","exports","ReactDOM"],"sourceRoot":""}