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,aAAejB,OAAOiB,cAAgB,GAC7CjB,OAAOiB,aAAaZ,QAAOa,EAAAA,EAAA,GACpBlB,OAAOiB,aAAaZ,SAAW,IAC/BD,EAAQC,SAGXL,OAAOiB,aAAaX,YAAWY,EAAAA,EAAA,GAC5BlB,OAAOiB,aAAaX,aAAe,IACnCF,EAAQE,aAEY,MAAMa,EAAiB,GAC9BA,EAAe,2CAA6C,CACpEZ,EAAGA,IAAMC,EAAQ,MACjBY,GAAI,6BAEpBpB,OAAOiB,aAAejB,OAAOiB,cAAgB,GAC7CjB,OAAOiB,aAAaE,eAAcD,EAAAA,EAAA,GACPlB,OAAOiB,aAAaE,gBAAkB,IACtCA,I,MCtC3BE,EAAOC,QAAU1C,O,OCAjByC,EAAOC,QAAUC,W","sources":["webpack://henrys-ecommerce/./src/modules/flipp/flipp.tsx?a576","webpack://henrys-ecommerce/./src/modules/flipp/flipp.view.tsx?1f20","webpack://henrys-ecommerce/./lib/flipp/module-registration.js?aa05","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["import { IFlippData } from './flipp.data';\r\nimport { IFlippProps } from './flipp.props.autogenerated';\r\n\r\nexport interface IFlippViewProps extends IFlippProps {}\r\n\r\nconst Flipp = (props: IFlippProps) => {\r\n return props.renderView(props);\r\n};\r\n\r\nexport default Flipp;\r\n","import * as React from 'react';\r\nimport { IFlippViewProps } from './flipp';\r\nimport classnames from 'classnames';\r\nimport Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport default ({ config, context, id }: IFlippViewProps) => {\r\n const { merchantId, accessToken, merchantNameIdentifier, className } = config;\r\n const divRef = React.useRef(null);\r\n const [initialized, setInitialized] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n const div = divRef.current;\r\n if (!initialized && Msdyn365.isBrowser && div) {\r\n setInitialized(true);\r\n\r\n const childDiv = document.createElement('div');\r\n childDiv.id = `flipp-container-${id}`;\r\n div.appendChild(childDiv);\r\n\r\n const flippScript = `\r\n function initFlipp() {\r\n var flippContainer = document.querySelector(\"#flipp-container-${id}\");\r\n var storefront = new Flipp.Storefront({\r\n accessToken: \"${accessToken}\",\r\n merchantId: \"${merchantId}\",\r\n merchantNameIdentifier: \"${merchantNameIdentifier}\",\r\n locale: \"${context.request.locale || 'en-CA'}\"\r\n });\r\n storefront.renderStorefront(flippContainer);\r\n };\r\n `.replace(/\\s+/g, ' ');\r\n\r\n let script = document.createElement('script');\r\n script.innerHTML = flippScript;\r\n div.appendChild(script);\r\n\r\n script = document.createElement('script');\r\n script.src = `https://aq.flippenterprise.net/${merchantId}/iframe.js`;\r\n script.id = 'flipp-storefront-script';\r\n script.onload = () => {\r\n const win = window as any;\r\n if (win.initFlipp) {\r\n win.initFlipp();\r\n }\r\n };\r\n div.appendChild(script);\r\n }\r\n }, [initialized, merchantId, accessToken, merchantNameIdentifier, divRef]);\r\n\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['flipp'] = {\n c: () => require('partner/modules/flipp/flipp.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'flipp',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/flipp'\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['__local__|__local__|modules|flipp|flipp'] = {\n c: () => require('partner/modules/flipp/flipp.view.tsx'),\n cn: '__local__-__local__-flipp'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["props","renderView","_ref","config","context","id","merchantId","accessToken","merchantNameIdentifier","className","divRef","React","initialized","setInitialized","div","current","Msdyn365","isBrowser","childDiv","document","createElement","appendChild","flippScript","request","locale","replace","script","innerHTML","src","onload","win","window","initFlipp","classnames","ref","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","__bindings__","_objectSpread","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}