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ElBD,EAAEC,SAAQ,EAElB,GACJ,EAKAR,OAAOC,YAAYC,SAASG,QAAU,WAClCL,OAAOS,oBAAoB,UAAWT,OAAOC,YAAYC,SAASQ,gBAAgB,GAClFV,OAAOS,oBAAoB,gBAAiBT,OAAOC,YAAYC,SAASQ,gBAAgB,EAC5F,EAWAV,OAAOC,YAAYC,SAASQ,eAAiB,SAAS7B,GAClD,GAAIA,GACW,kBAAXA,EAAE8B,KACFX,OAAOC,YAAYC,SAASC,kBACzB,GAAItB,GACa,sCAAbA,EAAE+B,OAAgD,CAC7C,IAAIC,EAAWpC,KAAKO,MAAMH,EAAEE,MACxB8B,GACoB,uBAApBA,EAASC,QACTD,EAAS9B,MACY,uBAArB8B,EAASE,WAC+B,IAAhCF,EAAS9B,KAAKiC,QAAQ,KACtBhB,OAAOC,YAAYC,SAASC,aAE5BH,OAAOC,YAAYC,SAASG,UAGxD,CACJ,EAaA,IAAIY,EAAgBvB,EAAqB,wBACrCwB,EAAmBxB,EAAqB,mBACxCuB,IACgC,IAAhCA,EAAcD,QAAQ,MACtBE,IACqC,GAArCA,EAAiBF,QAAQ,QACzBhB,OAAOC,YAAYC,SAASC,cAE5BH,OAAOpB,iBAAiB,UAAWoB,OAAOC,YAAYC,SAASQ,gBAAgB,GAC/EV,OAAOpB,iBAAiB,gBAAiBoB,OAAOC,YAAYC,SAASQ,gBAAgB,GAE5F,CAvGD,E","sources":["webpack://advanced-web/./UI/js/core/modules/trustarc.js"],"sourcesContent":["/**\r\n * TrustArc Event Generation - See GTM Integration Guide for details.\r\n **/\r\n\r\n/**\r\n * Map of previously dispatched preference levels\r\n **/\r\nvar __dispatched__ = {};\r\n\r\n/** \r\n * First step is to register with the CM API to receive callbacks when a preference update occurs.\r\n * You must wait for the CM API (PrivacyManagerAPI object) to exist on the page before registering. \r\n **/\r\nvar __i__ = self.postMessage &&\r\n setInterval(function () {\r\n if (self.PrivacyManagerAPI && __i__) { \r\n var apiObject = {\r\n PrivacyManagerAPI: {\r\n action: \"getConsentDecision\", \r\n timestamp: new Date().getTime(),\r\n self: self.location.host\r\n }\r\n }; \r\n self.top.postMessage(JSON.stringify(apiObject), \"*\");\r\n __i__ = clearInterval(__i__);\r\n }\r\n }, 50);\r\n\r\n/**\r\n * Callbacks will occur in the form of a PostMessage event.\r\n * This code listens for the appropriately formatted PostMessage event,\r\n * gets the new consent decision, and then pushes the events into the GTM framework.\r\n * Once the event is submitted, that consent decision is marked in the 'dispatched' map so it does not occur more than once. \r\n **/\r\nself.addEventListener(\"message\", function (e, d) {\r\n try {\r\n if (e.data && (d = JSON.parse(e.data)) &&\r\n (d = d.PrivacyManagerAPI) && d.capabilities &&\r\n d.action == \"getConsentDecision\") {\r\n var newDecision =\r\n self.PrivacyManagerAPI.callApi(\"getGDPRConsentDecision\", self.location.host).consentDecision;\r\n newDecision && newDecision.forEach(function (label) {\r\n if (!__dispatched__[label]) {\r\n self.dataLayer && self.dataLayer.push({ \"event\": \"GDPR Pref Allows \" + label });\r\n __dispatched__[label] = 1;\r\n }\r\n });\r\n }\r\n }\r\n catch (xx) {/* not a cm api message */}\r\n}); \r\n\r\n(function () {\r\n window.oneadvanced = window.oneadvanced || {};\r\n window.oneadvanced.trustarc = window.oneadvanced.trustarc || {};\r\n\r\n ///\r\n // Run once code which uses functional cookies\r\n // to work has been approved by TrustArc.\r\n // also cleans up by removing event listeners.\r\n // if user has changed their preferences they\r\n // will need to reload the page in order\r\n // for it to take effect\r\n ///\r\n window.oneadvanced.trustarc.launchCode = function () {\r\n window.oneadvanced.trustarc.enableWistiaTracking();\r\n window.oneadvanced.trustarc.cleanUp();\r\n }\r\n\r\n ///\r\n // getCookieValue: - https://stackoverflow.com/questions/10730362/get-cookie-by-name\r\n // Searches by cookie name\r\n // @param: string name\r\n // @return: cookie value if found, otherwise returns null\r\n ///\r\n function getCookieValueByName(name) {\r\n var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\r\n return match ? match[2] : null;\r\n }\r\n\r\n ///\r\n // handle Wistia - GDPR is enabled by default\r\n // as per our account settings\r\n // here we provide extra configuration if a user has consented\r\n // to functional tracking\r\n ///\r\n window.oneadvanced.trustarc.enableWistiaTracking = function () {\r\n window._wq = window._wq || [];\r\n window._wq.push(function (W) {\r\n var inPrivacyMode = W.consent();\r\n if (inPrivacyMode) {\r\n W.consent(true);\r\n }\r\n });\r\n }\r\n\r\n ///\r\n // Clean up by removing event listeners\r\n ///\r\n window.oneadvanced.trustarc.cleanUp = function () {\r\n window.removeEventListener(\"message\", window.oneadvanced.trustarc.messageHandler, false);\r\n window.removeEventListener(\"unprovisioned\", window.oneadvanced.trustarc.messageHandler, false);\r\n }\r\n\r\n ///\r\n // handle any and all messages recieved\r\n // checks event.type and handles either 'message' or 'unprovisioned'\r\n // 'unprovisioned': user is from country excempt from Cookie Policy\r\n // 'message': check origin for security purposes, if from TrustArc listen for\r\n // the user submitting their preferences. If the preference contains the value of '1'\r\n // then the user has accepted functional cookies and code using these can be called.\r\n // if not then clean up the event listeners and do not call launchCode()\r\n ///\r\n window.oneadvanced.trustarc.messageHandler = function(e) {\r\n if (e &&\r\n e.type === \"unprovisioned\") {\r\n window.oneadvanced.trustarc.launchCode();\r\n } else if (e &&\r\n e.origin === \"https://consent-pref.trustarc.com\") {\r\n var response = JSON.parse(e.data);\r\n if (response &&\r\n response.source === \"preference_manager\" &&\r\n response.data &&\r\n response.message === \"submit_preferences\") {\r\n if (response.data.indexOf(\"1\") !== -1) {\r\n window.oneadvanced.trustarc.launchCode();\r\n } else {\r\n window.oneadvanced.trustarc.cleanUp();\r\n }\r\n }\r\n }\r\n }\r\n\r\n ///\r\n // Main Logic:\r\n // check to see if consent has already been given\r\n // by way of the cmapi_cookie_privacy cookie being present and\r\n // the value containing the string \"2\"\r\n // which indicates functional cookies\r\n // or if notice_behaviour cookie is present and is none which indicates that the\r\n // user is from an excempt country\r\n // if so, call launchCode(), otherwise hook up eventListeners to \r\n // handle messages from TrustArc local API\r\n ///\r\n var consent_level = getCookieValueByName(\"cmapi_cookie_privacy\");\r\n var notice_behaviour = getCookieValueByName(\"notice_behavior\");\r\n if (consent_level &&\r\n consent_level.indexOf(\"2\") !== -1 &&\r\n notice_behaviour &&\r\n notice_behaviour.indexOf(\"none\") == -1) {\r\n window.oneadvanced.trustarc.launchCode();\r\n } else {\r\n window.addEventListener(\"message\", window.oneadvanced.trustarc.messageHandler, false);\r\n window.addEventListener(\"unprovisioned\", window.oneadvanced.trustarc.messageHandler, false);\r\n }\r\n})();"],"names":["__dispatched__","__i__","self","postMessage","setInterval","PrivacyManagerAPI","apiObject","action","timestamp","Date","getTime","location","host","top","JSON","stringify","clearInterval","addEventListener","e","d","data","parse","capabilities","newDecision","callApi","consentDecision","forEach","label","dataLayer","push","xx","getCookieValueByName","name","match","document","cookie","RegExp","window","oneadvanced","trustarc","launchCode","enableWistiaTracking","cleanUp","_wq","W","consent","removeEventListener","messageHandler","type","origin","response","source","message","indexOf","consent_level","notice_behaviour"],"sourceRoot":""}