{"version":3,"file":"@sooro-io-DlMVbJiR.js","sources":["../../node_modules/@sooro-io/react-gtm-module/dist/utils/warn.js","../../node_modules/@sooro-io/react-gtm-module/dist/Snippets.js","../../node_modules/@sooro-io/react-gtm-module/dist/TagManager.js","../../node_modules/@sooro-io/react-gtm-module/dist/index.js"],"sourcesContent":["\"use strict\";\n\nconst warn = s => {\n console.warn('[react-gtm-module]', s);\n};\nmodule.exports = warn;","\"use strict\";\n\nvar _warn = _interopRequireDefault(require(\"./utils/warn\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\n// https://developers.google.com/tag-manager/quickstart\n\nconst Snippets = {\n tags: function ({\n id,\n events,\n dataLayer,\n dataLayerName,\n preview = undefined,\n auth = undefined,\n nonce = undefined,\n source\n }) {\n if (!id) (0, _warn.default)('GTM Id is required');\n const url = new URL(source);\n const environment = auth && preview ? `>m_auth=${auth}>m_preview=${preview}>m_cookies_win=x` : '';\n const iframe = `\n\t\t\t`;\n const script = `\n\t\t\t(function(w,d,s,l,i){w[l]=w[l]||[];\n\t\t\t\tw[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'}${events.length > 0 ? ',' + JSON.stringify(events).slice(1, -1) : ''});\n\t\t\t\tvar f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';\n\t\t\t\tj.async=true;\n\t\t\t\tj.src='${source}?id='+i+dl+'${environment}';\n\t\t\t\t${nonce ? `j.setAttribute('nonce','${nonce}');` : ''}\n\t\t\t\tf.parentNode.insertBefore(j,f);\n\t\t\t})(window,document,'script','${dataLayerName}','${id}');`;\n const dataLayerVar = this.dataLayer(dataLayer, dataLayerName);\n return {\n iframe,\n script,\n dataLayerVar\n };\n },\n dataLayer: function (dataLayer, dataLayerName) {\n return `\n\t\t\twindow.${dataLayerName} = window.${dataLayerName} || [];\n\t\t\twindow.${dataLayerName}.push(${JSON.stringify(dataLayer)})`;\n }\n};\nmodule.exports = Snippets;","\"use strict\";\n\nvar _Snippets = _interopRequireDefault(require(\"./Snippets\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nconst TagManager = {\n dataScript: function (dataLayer, dataLayerName, nonce) {\n const script = document.createElement('script');\n script.innerHTML = dataLayer;\n script.setAttribute('data-testid', dataLayerName);\n if (nonce) {\n script.setAttribute('nonce', nonce);\n }\n return script;\n },\n gtm: function (args) {\n const snippets = _Snippets.default.tags(args);\n const noScript = () => {\n const noscript = document.createElement('noscript');\n noscript.innerHTML = snippets.iframe;\n return noscript;\n };\n const script = () => {\n const script = document.createElement('script');\n script.innerHTML = snippets.script;\n if (args.nonce) {\n script.setAttribute('nonce', args.nonce);\n }\n return script;\n };\n const dataScript = this.dataScript(snippets.dataLayerVar, args.dataLayerName, args.nonce);\n return {\n noScript,\n script,\n dataScript\n };\n },\n initialize: function ({\n gtmId,\n events = [],\n dataLayer = undefined,\n dataLayerName = 'dataLayer',\n auth = undefined,\n preview = undefined,\n nonce = undefined,\n source = 'https://googletagmanager.com/gtm.js'\n }) {\n const gtm = this.gtm({\n id: gtmId,\n events,\n dataLayer,\n dataLayerName,\n auth,\n preview,\n nonce,\n source\n });\n if (dataLayer) document.head.appendChild(gtm.dataScript);\n document.head.insertBefore(gtm.script(), document.head.childNodes[0]);\n document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]);\n },\n dataLayer: function ({\n dataLayer,\n dataLayerName = 'dataLayer'\n }) {\n if (window[dataLayerName]) return window[dataLayerName].push(dataLayer);\n const snippets = _Snippets.default.dataLayer(dataLayer, dataLayerName);\n const dataScript = this.dataScript(snippets, dataLayerName);\n document.head.insertBefore(dataScript, document.head.childNodes[0]);\n }\n};\nmodule.exports = TagManager;","\"use strict\";\n\nvar _TagManager = _interopRequireDefault(require(\"./TagManager\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }\nmodule.exports = _TagManager.default;"],"names":["warn","s","warn_1","_warn","_interopRequireDefault","require$$0","e","Snippets","id","events","dataLayer","dataLayerName","preview","auth","nonce","source","url","environment","iframe","script","dataLayerVar","Snippets_1","_Snippets","TagManager","args","snippets","noScript","noscript","dataScript","gtmId","gtm","TagManager_1","_TagManager","dist"],"mappings":"kXAEA,MAAMA,EAAOC,GAAK,CAChB,QAAQ,KAAK,qBAAsBA,CAAC,CACtC,EACA,IAAAC,EAAiBF,ECHbG,EAAQC,EAAuBC,CAAuB,EAC1D,SAASD,EAAuBE,EAAG,CAAE,OAAOA,GAAKA,EAAE,WAAaA,EAAI,CAAE,QAASA,EAAI,CAGnF,MAAMC,EAAW,CACf,KAAM,SAAU,CACd,GAAAC,EACA,OAAAC,EACA,UAAAC,EACA,cAAAC,EACA,QAAAC,EAAU,OACV,KAAAC,EAAO,OACP,MAAAC,EAAQ,OACR,OAAAC,CACJ,EAAK,CACIP,MAAQL,EAAM,SAAS,oBAAoB,EAChD,MAAMa,EAAM,IAAI,IAAID,CAAM,EACpBE,EAAcJ,GAAQD,EAAU,aAAaC,CAAI,gBAAgBD,CAAO,qBAAuB,GAC/FM,EAAS;AAAA,kBACDF,EAAI,MAAM,eAAeR,CAAE,GAAGS,CAAW;AAAA,4FAEjDE,EAAS;AAAA;AAAA,kEAE+CV,EAAO,OAAS,EAAI,IAAM,KAAK,UAAUA,CAAM,EAAE,MAAM,EAAG,EAAE,EAAI,EAAE;AAAA;AAAA;AAAA,aAGvHM,CAAM,eAAeE,CAAW;AAAA,MACvCH,EAAQ,2BAA2BA,CAAK,MAAQ,EAAE;AAAA;AAAA,kCAEtBH,CAAa,MAAMH,CAAE,MAC7CY,EAAe,KAAK,UAAUV,EAAWC,CAAa,EAC5D,MAAO,CACL,OAAAO,EACA,OAAAC,EACA,aAAAC,CACD,CACF,EACD,UAAW,SAAUV,EAAWC,EAAe,CAC7C,MAAO;AAAA,YACCA,CAAa,aAAaA,CAAa;AAAA,YACvCA,CAAa,SAAS,KAAK,UAAUD,CAAS,CAAC,GAC3D,CACA,EACA,IAAAW,EAAiBd,EC3Cbe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