{"version":3,"sources":["webpack://specialist-tracking/./node_modules/@financial-times/cmp-client/dist/index.cjs","webpack://specialist-tracking/./src/entrypoints/cmp.ts","webpack://specialist-tracking/webpack/bootstrap","webpack://specialist-tracking/webpack/startup"],"names":["Object","defineProperty","exports","Symbol","toStringTag","value","events","onMessageChoiceSelect","args","console","log","onMessageReady","onMessageChoiceError","onPrivacyManagerAction","onPMCancel","onMessageReceiveData","onSPPMObjectReady","onConsentReady","async","legislation","consentUUID","consentString","consentMeta","onError","debug","freeze","__proto__","logCmpEvents","window","_sp_queue","push","_a","_b","eventId","eventHandler","entries","_sp_","addEventListener","call","defaults","joinhref","gdpr","ccpa","FT_DOTCOM_TEST","accountId","baseEndpoint","propertyhref","_clientOptions","privacyManagerId","manageCookiesLinkOverride","FT_DOTCOM_PROD","propertyId","rootDomain","SP_PWMNET","SP_FDI_INTELLIGENCE","SP_THE_BANKER","SP_BANKING_RR","SP_SUSTAINABLE_VIEWS","SP_FT_ADVISER","SP_INVESTORS_CHRONICLE","MM_IGNITES_ASIA","MM_IGNITES_EUROPE","SP_MANDATE_WIRE","properties","onDomReady","Promise","resolve","document","isReady","includes","readyState","onStateChange","removeEventListener","detailsCache","cache","name","Error","clear","requests","SOURCEPOINT_CONSENT_SOURCE","iabCustomCategories","permutiveAds","purposes","iabVendors","customVendors","specialFeatures","demographicAds","behaviouralAds","programmaticAds","personalisedMarketing","iabCategoryNames","keys","createContentScript","cmpScript","content","s","createElement","dataset","innerHTML","scriptContent","checkConsentFor","categoryName","purpose","vendor","specialFeatureOptins","customCategory","requiredPurposesConsented","every","requiredPurpose","consents","legitimateInterests","requiredIabVendorsConsented","requiredVendor","requiredSpecialFeaturesConsented","requiredFeature","consentReadyHandlerFn","props","_consentUUID","disableFTCookies","activeLegislation","applies","parsedConsent","userHasNotOptedOut","parseCCPAConsent","tcData","reject","__tcfapi","error","parseGDPRConsent","getParsedConsent","previousConsent","some","category","adaptedCategoryName","toLowerCase","hasConsentChanged","encodedValue","fromEntries","cookie","split","map","decodedValue","decodeURIComponent","consent","getConsentCookieValue","updateConsentStore","userId","useConsentStore","shouldUpdateConsentStore","consentEndpoint","consentProxyHost","cookieDomain","getConsentEndpoint","payload","formOfWordsId","data","reduce","onsite","status","lbi","source","fow","setConsentCookie","consentSource","getConsentPayload","response","fetch","method","headers","body","JSON","stringify","credentials","ok","saveConsent","dispatchEvent","CustomEvent","bubbles","COOKIE_MESSAGE","privateState","activeComponent","messageId","setState","newState","obj","constructor","prototype","toString","cookieToggleFlags","dispatchComponentEvent","trackingProps","action","triggerAction","componentId","state","product","app","flags","rootEl","event","cancelable","detail","track","component","id","type","subtype","trigger_action","custom","cookie_toggle_flag","url","location","href","trackingEventHandlers","_messageType","_choiceId","choiceTypeId","11","12","13","errorCode","initSourcepointCmp","propertyConfig","useFTSession","trackingContext","FT_CMP_CLIENT_VERSION","cachedUUID","uuid","sessionId","exec","getSessionId","useCorsProxy","then","json","text","catch","err","info","request","getUuid","authId","warn","config","spConfig","head","appendChild","fragment","createDocumentFragment","src","scriptSources","createSourceScript","getCmpScripts","bootstrapCmp","context","cmpBaseEndpoint","output","forEach","flagName","hasOwnProperty","extractRelevantFlags","origin","actionTypeMap","1","fromPM","actionType","setupPmTracking","initTracking","interceptManageCookiesLinks","loadPrivacyManagerModal","anchors","querySelectorAll","anchor","preventDefault","findAndUpdateLinks","spProps","property","cmp_client_1","require","hostname","hostNameParts","apexDomainPartsCount","slice","apexDomain","join","find","endsWith","_specialist_state","undefined","e","_c","_d","_e","_f","_g","_h","_j","_k","_l","_m","dataLayer","cmpBanner","banner_name","charAt","toUpperCase","banner_id","click_action","event_payload","schema","_specialist_manage_cookies","assign","__webpack_module_cache__","__webpack_require__","moduleId","module","__webpack_modules__"],"mappings":"sCACAA,OAAOC,eAAeC,EAASC,OAAOC,YAAa,CAAEC,MAAO,WAC5D,MAAMC,EAAS,CACbC,sBAAuB,IAAIC,KACzBC,QAAQC,IAAI,gCAAiCF,IAE/CG,eAAgB,IAAIH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toStringTag, { value: \"Module\" });\nconst events = {\n onMessageChoiceSelect: (...args) => {\n console.log(\"[debug] onMessageChoiceSelect\", args);\n },\n onMessageReady: (...args) => {\n console.log(\"[debug] onMessageReady\", args);\n },\n onMessageChoiceError: (...args) => {\n console.log(\"[debug] onMessageChoiceError\", args);\n },\n onPrivacyManagerAction: (...args) => {\n console.log(\"[debug] onPrivacyManagerAction\", args);\n },\n onPMCancel: (...args) => {\n console.log(\"[debug] onPMCancel\", args);\n },\n onMessageReceiveData: (...args) => {\n console.log(\"[debug] onMessageReceiveData\", args);\n },\n onSPPMObjectReady: (...args) => {\n console.log(\"[debug] onSPPMObjectReady\", args);\n },\n onConsentReady: async (...args) => {\n const [legislation, consentUUID, consentString, consentMeta] = args;\n console.log(\"[debug] onConsentReady\", { legislation, consentString, consentMeta, consentUUID });\n },\n onError: (...args) => {\n console.log(\"[debug] onError\", args);\n }\n};\nfunction logCmpEvents() {\n window._sp_queue = window._sp_queue ?? [];\n window._sp_queue.push(() => {\n var _a, _b;\n for (const [eventId, eventHandler] of Object.entries(events)) {\n (_b = (_a = window._sp_).addEventListener) == null ? void 0 : _b.call(_a, eventId, eventHandler);\n }\n });\n}\nconst debug = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n events,\n logCmpEvents\n}, Symbol.toStringTag, { value: \"Module\" }));\nconst defaults = {\n joinhref: true,\n gdpr: {},\n ccpa: {}\n};\nconst FT_DOTCOM_TEST = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.ft.com\",\n propertyhref: \"https://local.ft.com\",\n _clientOptions: {\n privacyManagerId: 827767,\n manageCookiesLinkOverride: \"ft.com/preferences/manage-cookies\"\n }\n};\nconst FT_DOTCOM_PROD = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.ft.com\",\n propertyId: 31642,\n _clientOptions: {\n privacyManagerId: 827767,\n manageCookiesLinkOverride: \"ft.com/preferences/manage-cookies\",\n rootDomain: \"ft.com\"\n }\n};\nconst SP_PWMNET = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.pwmnet.com\",\n propertyId: 33414,\n _clientOptions: {\n rootDomain: \"pwmnet.com\"\n }\n};\nconst SP_FDI_INTELLIGENCE = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.fdiintelligence.com\",\n propertyId: 34061,\n _clientOptions: {\n rootDomain: \"fdiintelligence.com\"\n }\n};\nconst SP_THE_BANKER = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.thebanker.com\",\n propertyId: 34060,\n _clientOptions: {\n rootDomain: \"thebanker.com\"\n }\n};\nconst SP_BANKING_RR = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.bankingriskandregulation.com\",\n propertyId: 34059,\n _clientOptions: {\n rootDomain: \"bankingriskandregulation.com\"\n }\n};\nconst SP_SUSTAINABLE_VIEWS = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.sustainableviews.com\",\n propertyId: 34058,\n _clientOptions: {\n rootDomain: \"sustainableviews.com\"\n }\n};\nconst SP_FT_ADVISER = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.ftadviser.com\",\n propertyId: 33416,\n _clientOptions: {\n rootDomain: \"ftadviser.com\"\n }\n};\nconst SP_INVESTORS_CHRONICLE = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.investorschronicle.co.uk\",\n propertyId: 33415,\n _clientOptions: {\n rootDomain: \"investorschronicle.co.uk\"\n }\n};\nconst MM_IGNITES_ASIA = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://cdn.privacy-mgmt.com\",\n propertyId: 33947,\n _clientOptions: {\n rootDomain: \"ignitesasia.com\"\n }\n};\nconst MM_IGNITES_EUROPE = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://cdn.privacy-mgmt.com\",\n propertyId: 33946,\n _clientOptions: {\n rootDomain: \"igniteseurope.com\"\n }\n};\nconst SP_MANDATE_WIRE = {\n ...defaults,\n accountId: 1906,\n baseEndpoint: \"https://consent-manager.mandatewire.com\",\n propertyId: 35490,\n _clientOptions: {\n rootDomain: \"mandatewire.com\"\n }\n};\nconst properties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n FT_DOTCOM_PROD,\n FT_DOTCOM_TEST,\n MM_IGNITES_ASIA,\n MM_IGNITES_EUROPE,\n SP_BANKING_RR,\n SP_FDI_INTELLIGENCE,\n SP_FT_ADVISER,\n SP_INVESTORS_CHRONICLE,\n SP_MANDATE_WIRE,\n SP_PWMNET,\n SP_SUSTAINABLE_VIEWS,\n SP_THE_BANKER\n}, Symbol.toStringTag, { value: \"Module\" }));\nconst onDomReady = new Promise((resolve) => {\n if (typeof document === \"undefined\")\n return resolve();\n const isReady = () => [\"interactive\", \"complete\"].includes(document.readyState);\n function onStateChange() {\n if (isReady()) {\n document.removeEventListener(\"readystatechange\", onStateChange);\n resolve();\n }\n }\n if (isReady())\n return resolve();\n document.addEventListener(\"readystatechange\", onStateChange);\n});\nfunction findAndUpdateLinks(_clientOptions, loadPrivacyManagerModal) {\n const { privacyManagerId, manageCookiesLinkOverride } = _clientOptions ?? {};\n if (!privacyManagerId || !manageCookiesLinkOverride) {\n return console.warn(\"_clientOptions is missing privacyManagerId or manageCookiesLinkOverride\");\n }\n const anchors = document.querySelectorAll(`a[href*=\"${manageCookiesLinkOverride}\"]`);\n for (const anchor of anchors) {\n anchor.addEventListener(\"click\", (event) => {\n event.preventDefault();\n loadPrivacyManagerModal == null ? void 0 : loadPrivacyManagerModal(+privacyManagerId);\n });\n }\n}\nfunction interceptManageCookiesLinks({ _clientOptions } = FT_DOTCOM_PROD) {\n onDomReady.then(() => {\n window._sp_queue ?? (window._sp_queue = []);\n window._sp_queue.push(() => {\n var _a, _b;\n findAndUpdateLinks(_clientOptions, (_b = (_a = window._sp_) == null ? void 0 : _a.gdpr) == null ? void 0 : _b.loadPrivacyManagerModal);\n });\n });\n}\nconst request = (url, { credentials = \"omit\" } = {}) => {\n return fetch(`https://session-next.ft.com${url}`, {\n credentials,\n useCorsProxy: true\n }).then((response) => {\n if (response.ok) {\n return response.json();\n } else {\n return response.text().then((text) => {\n throw new Error(`Next session responded with \"${text}\" (${response.status})`);\n });\n }\n }).catch((err) => {\n document.body.dispatchEvent(new CustomEvent(\"oErrors.log\", {\n bubbles: true,\n detail: {\n error: err,\n info: {\n component: \"next-session-client\"\n }\n }\n }));\n });\n};\nlet detailsCache = {};\nconst cache = (name, value) => {\n if (typeof name === \"object\") {\n detailsCache = name;\n return;\n }\n if (typeof name === \"string\" && typeof value === \"string\") {\n detailsCache[name] = value;\n return;\n }\n if (typeof name === \"string\" && typeof value === \"undefined\") {\n return detailsCache[name] || null;\n }\n if (typeof name === \"undefined\" && typeof value === \"undefined\") {\n return detailsCache;\n }\n throw new Error(\"Invalid arguments\");\n};\ncache.clear = () => {\n detailsCache = {};\n};\nconst requests = {};\nconst getSessionId = () => {\n const [, sessionId] = /FTSession_s=([^;]+)/.exec(document.cookie) || [];\n return sessionId;\n};\nconst getUuid = () => {\n const cachedUUID = cache(\"uuid\");\n if (cachedUUID) {\n return Promise.resolve({ uuid: cachedUUID });\n }\n const sessionId = getSessionId();\n if (!sessionId) {\n return Promise.resolve({ uuid: void 0 });\n }\n if (!requests.uuid) {\n requests.uuid = request(`/sessions/s/${sessionId}`).then(({ uuid } = {}) => {\n delete requests.uuid;\n if (uuid) {\n cache(\"uuid\", uuid);\n }\n return { uuid };\n });\n }\n return requests.uuid;\n};\nconst SOURCEPOINT_CONSENT_SOURCE = \"sourcepoint-cmp\";\nconst SOURCEPOINT_FOW_SCOPE = \"FTPINK\";\nconst CONSENT_COOKIE_NAME = \"FTConsent\";\nconst SOURCEPOINT_FOW_ID = \"sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk\";\nconst FT_COOKIE_DOMAIN = \".ft.com\";\nconst FT_CONSENT_PROXY_HOST = \"https://consent.ft.com\";\nconst iabCustomCategories = {\n permutiveAds: {\n purposes: [2, 4, 8, 9],\n iabVendors: [361],\n customVendors: [],\n specialFeatures: []\n },\n demographicAds: {\n purposes: [7, 9, 10],\n iabVendors: [],\n customVendors: [],\n specialFeatures: []\n },\n behaviouralAds: {\n purposes: [2, 4, 8, 9],\n iabVendors: [],\n customVendors: [],\n specialFeatures: []\n },\n programmaticAds: {\n purposes: [2],\n iabVendors: [],\n customVendors: [],\n specialFeatures: []\n },\n personalisedMarketing: {\n purposes: [2, 7, 8, 9, 10],\n iabVendors: [],\n customVendors: [],\n specialFeatures: []\n }\n};\nconst iabCategoryNames = Object.keys(iabCustomCategories);\nfunction createContentScript(cmpScript, content) {\n const s = document.createElement(\"script\");\n s.dataset.cmpScript = cmpScript;\n s.innerHTML = content;\n return s;\n}\nfunction createSourceScript(src) {\n const s = document.createElement(\"script\");\n s.src = src;\n return s;\n}\nconst scriptSources = {\n cmpFrames: \"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js\"\n};\nconst scriptContent = {\n tcfStub: `\"use strict\";function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement(\"iframe\");r.style.cssText=\"display:none\",r.name=\"__tcfapiLocator\",r.title = \"__tcfapiLocator\",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r3&&2===parseInt(n[1],10)&&\"boolean\"==typeof n[3]&&(e=n[3],\"function\"==typeof n[2]&&n[2](\"set\",!0)):\"ping\"===n[0]?\"function\"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:\"stub\"}):o.push(n)},n.addEventListener(\"message\",(function(t){var e=\"string\"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n=\"object\"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,\"*\")}),n.parameter)}),!1))};\"undefined\"!=typeof module?module.exports=t:t()}();`,\n uspStub: `\"use strict\";(function () { var e = false; var c = window; var t = document; function r() { if (!c.frames[\"__uspapiLocator\"]) { if (t.body) { var a = t.body; var e = t.createElement(\"iframe\"); e.style.cssText = \"display:none\"; e.name = \"__uspapiLocator\"; e.title = \"__uspapiLocator\";a.appendChild(e) } else { setTimeout(r, 5) } } } r(); function p() { var a = arguments; __uspapi.a = __uspapi.a || []; if (!a.length) { return __uspapi.a } else if (a[0] === \"ping\") { a[2]({ gdprAppliesGlobally: e, cmpLoaded: false }, true) } else { __uspapi.a.push([].slice.apply(a)) } } function l(t) { var r = typeof t.data === \"string\"; try { var a = r ? JSON.parse(t.data) : t.data; if (a.__cmpCall) { var n = a.__cmpCall; c.__uspapi(n.command, n.parameter, function (a, e) { var c = { __cmpReturn: { returnValue: a, success: e, callId: n.callId } }; t.source.postMessage(r ? JSON.stringify(c) : c, \"*\") }) } } catch (a) { } } if (typeof __uspapi !== \"function\") { c.__uspapi = p; __uspapi.msgHandler = l; c.addEventListener(\"message\", l, false) } })();`\n};\nfunction getCmpScripts() {\n const fragment = document.createDocumentFragment();\n fragment.appendChild(createContentScript(\"tcf\", scriptContent.tcfStub));\n fragment.appendChild(createContentScript(\"usp\", scriptContent.uspStub));\n fragment.appendChild(createSourceScript(scriptSources.cmpFrames));\n return fragment;\n}\nfunction bootstrapCmp(config) {\n const { _clientOptions, ...spConfig } = config;\n window._sp_ = { config: spConfig };\n window._sp_queue ?? (window._sp_queue = []);\n document.head.appendChild(getCmpScripts());\n}\nfunction getConsentPayload(parsedConsent, updateConsentStore, { formOfWordsId, cookieDomain }) {\n const categoryNames = Object.keys(parsedConsent);\n const data = categoryNames.reduce(\n (payload, categoryName) => {\n payload[categoryName] = {\n onsite: {\n status: parsedConsent[categoryName],\n lbi: false,\n source: SOURCEPOINT_CONSENT_SOURCE,\n fow: formOfWordsId\n }\n };\n return payload;\n },\n {}\n );\n if (updateConsentStore) {\n return {\n setConsentCookie: true,\n formOfWordsId,\n consentSource: SOURCEPOINT_CONSENT_SOURCE,\n cookieDomain,\n data\n };\n }\n return { data, cookieDomain };\n}\nfunction checkConsentFor(categoryName, { purpose, vendor, specialFeatureOptins }) {\n const customCategory = iabCustomCategories[categoryName];\n const requiredPurposesConsented = customCategory.purposes.every(\n (requiredPurpose) => (purpose == null ? void 0 : purpose.consents[requiredPurpose]) || (purpose == null ? void 0 : purpose.legitimateInterests[requiredPurpose])\n );\n const requiredIabVendorsConsented = customCategory.iabVendors.every(\n (requiredVendor) => (vendor == null ? void 0 : vendor.consents[requiredVendor]) || (vendor == null ? void 0 : vendor.legitimateInterests[requiredVendor])\n );\n const requiredSpecialFeaturesConsented = customCategory.specialFeatures.every(\n (requiredFeature) => (specialFeatureOptins == null ? void 0 : specialFeatureOptins[requiredFeature]) === true\n );\n return requiredPurposesConsented && requiredIabVendorsConsented && requiredSpecialFeaturesConsented;\n}\nfunction parseCCPAConsent(ccpa) {\n const userHasNotOptedOut = (ccpa == null ? void 0 : ccpa[2]) === \"N\";\n const parsedConsent = {};\n for (const categoryName of iabCategoryNames) {\n parsedConsent[categoryName] = userHasNotOptedOut;\n }\n return parsedConsent;\n}\nasync function parseGDPRConsent() {\n const tcData = await new Promise((resolve, reject) => {\n var _a;\n try {\n (_a = window.__tcfapi) == null ? void 0 : _a.call(window, \"addEventListener\", 2, resolve);\n } catch (error) {\n reject(error);\n }\n });\n const parsedConsent = {};\n for (const categoryName of iabCategoryNames) {\n parsedConsent[categoryName] = checkConsentFor(categoryName, tcData);\n }\n return parsedConsent;\n}\nasync function getParsedConsent(activeLegislation, consentString) {\n return activeLegislation === \"ccpa\" ? parseCCPAConsent(consentString) : await parseGDPRConsent();\n}\nfunction getConsentCookieValue() {\n const cookies = Object.fromEntries(\n document.cookie.split(\"; \").map((cookie) => cookie.split(\"=\"))\n );\n const encodedValue = cookies[CONSENT_COOKIE_NAME];\n if (!encodedValue)\n return {};\n const decodedValue = decodeURIComponent(encodedValue);\n return Object.fromEntries(\n decodedValue.split(\",\").map((consent) => {\n const [category, value] = consent.split(\":\");\n const booleanConsent = [category, value === \"on\" ? true : false];\n return booleanConsent;\n })\n );\n}\nfunction hasConsentChanged(parsedConsent, previousConsent) {\n const categories = Object.keys(parsedConsent);\n return categories.some((category) => {\n const adaptedCategoryName = `${category.toLowerCase()}Onsite`;\n return parsedConsent[category] !== previousConsent[adaptedCategoryName];\n });\n}\nfunction shouldUpdateConsentStore({ userId, useConsentStore }) {\n return !!userId && useConsentStore === true;\n}\nfunction getConsentEndpoint(updateConsentStore, props) {\n if (updateConsentStore) {\n return `${props.consentProxyHost}/__consent/consent-record/${SOURCEPOINT_FOW_SCOPE}/${props.userId}`;\n }\n return `${props.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${props.cookieDomain}`;\n}\nasync function saveConsent(consentEndpoint, payload) {\n try {\n const response = await fetch(consentEndpoint, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(payload),\n credentials: \"include\"\n });\n if (!response.ok) {\n console.error(\"Unable to save consent preferences\", response.status);\n }\n } catch (error) {\n console.error(\"An error occurred while saving consent\", error);\n }\n}\nfunction consentReadyHandlerFn(props) {\n return async function consentReadyHandler(legislation, _consentUUID, consentString, consentMeta) {\n if (props.disableFTCookies) {\n return;\n }\n const activeLegislation = consentMeta.applies ? legislation : \"gdpr\";\n if (activeLegislation !== legislation || !consentString) {\n return;\n }\n const parsedConsent = await getParsedConsent(activeLegislation, consentString);\n const consentHasChanged = hasConsentChanged(parsedConsent, getConsentCookieValue());\n if (!consentHasChanged) {\n return;\n }\n const updateConsentStore = shouldUpdateConsentStore(props);\n const consentEndpoint = getConsentEndpoint(updateConsentStore, props);\n const payload = getConsentPayload(parsedConsent, updateConsentStore, props);\n await saveConsent(consentEndpoint, payload);\n document.dispatchEvent(new CustomEvent(\"oCookieMessage.act\", { bubbles: true }));\n };\n}\nconst COOKIE_MESSAGE = \"cookie-message\";\nconst PRIVACY_MANAGER = \"manage-cookies\";\nconst INITIAL_STATE = Object.freeze({\n activeComponent: COOKIE_MESSAGE,\n messageId: 0,\n privacyManagerId: 0\n});\nlet privateState = INITIAL_STATE;\nfunction isPlainObject(obj) {\n return typeof obj === \"object\" && obj !== null && obj.constructor === Object && Object.prototype.toString.call(obj) === \"[object Object]\";\n}\nconst getState = () => ({ ...privateState });\nconst setState = (newState) => {\n if (!isPlainObject(newState)) {\n console.error(\"Invalid state changes\");\n return;\n }\n privateState = { ...privateState, ...newState };\n};\nconst cookieToggleFlags = [\"adsDisableInternalCMP\", \"pwm.cmp\", \"messageSlotBottom\"];\nfunction initTracking(context, cmpBaseEndpoint) {\n const flags = extractRelevantFlags(context.flags);\n window._sp_queue = window._sp_queue ?? [];\n window._sp_queue.push(() => {\n var _a, _b;\n for (const [eventId, eventHandler] of Object.entries(trackingEventHandlers)) {\n (_b = (_a = window._sp_).addEventListener) == null ? void 0 : _b.call(_a, eventId, eventHandler({ ...context, flags }));\n }\n });\n setupPmTracking({ ...context, flags }, cmpBaseEndpoint);\n}\nfunction extractRelevantFlags(flags) {\n const output = {};\n if (typeof flags === \"object\") {\n cookieToggleFlags.forEach((flagName) => {\n if (Object.prototype.hasOwnProperty.call(flags, flagName)) {\n output[flagName] = flags[flagName];\n }\n });\n }\n return output;\n}\nfunction track(payload) {\n if (!payload)\n return;\n const rootEl = document.body;\n const event = new CustomEvent(\"oTracking.event\", {\n bubbles: true,\n cancelable: true,\n detail: payload.detail\n });\n rootEl.dispatchEvent(event);\n}\nfunction dispatchComponentEvent({\n trackingProps,\n action,\n triggerAction\n}) {\n let componentId;\n const state = getState();\n const { product, app, flags } = trackingProps;\n if (state.activeComponent === COOKIE_MESSAGE) {\n componentId = state.messageId;\n } else {\n componentId = state.privacyManagerId;\n }\n const event = {\n detail: {\n component: {\n id: componentId,\n name: state.activeComponent,\n type: \"overlay\",\n subtype: \"cmp\"\n },\n category: \"component\",\n action,\n ...triggerAction && { trigger_action: triggerAction },\n ...product && { product },\n ...app && { app },\n custom: [\n {\n cookie_toggle_flag: flags\n }\n ],\n url: window.document.location.href || null\n }\n };\n track(event);\n}\nconst trackingEventHandlers = {\n onMessageChoiceSelect: (trackingProps) => (_messageType, _choiceId, choiceTypeId) => {\n const choiceTypeTriggerMap = {\n 11: \"accept_all\",\n 12: \"manage_cookies\",\n 13: \"reject_all\"\n };\n const triggerAction = choiceTypeTriggerMap[choiceTypeId];\n if (triggerAction) {\n dispatchComponentEvent({\n trackingProps,\n action: \"click\",\n triggerAction\n });\n }\n },\n onMessageReady: (trackingProps) => () => {\n dispatchComponentEvent({\n trackingProps,\n action: \"view\"\n });\n },\n onMessageReceiveData: () => (_messageType, data) => {\n const { messageId } = data;\n if (messageId) {\n setState({\n messageId\n });\n }\n },\n onError: (trackingProps) => (_messageType, errorCode) => {\n dispatchComponentEvent({\n trackingProps,\n action: \"error\",\n triggerAction: errorCode\n });\n },\n onPMCancel: () => () => {\n setState({\n activeComponent: COOKIE_MESSAGE\n });\n }\n};\nfunction setupPmTracking(trackingProps, cmpBaseEndpoint) {\n window.addEventListener(\n \"message\",\n function(event) {\n if (event.origin !== cmpBaseEndpoint)\n return;\n const actionTypeMap = {\n 1: \"save_and_close\",\n 11: \"accept_all\",\n 13: \"reject_all\"\n };\n const { data: { fromPM, actionType, messageId = \"0\" } = {} } = event;\n if (!fromPM)\n return;\n if (+messageId) {\n setState({\n activeComponent: PRIVACY_MANAGER,\n privacyManagerId: +messageId\n });\n }\n if (!actionType || !actionTypeMap[actionType])\n return;\n dispatchComponentEvent({\n trackingProps,\n action: \"click\",\n triggerAction: actionTypeMap[actionType]\n });\n },\n false\n );\n}\nconst version = \"4.1.0\";\nasync function initSourcepointCmp({\n propertyConfig = FT_DOTCOM_PROD,\n userId,\n useFTSession = true,\n consentProxyHost = FT_CONSENT_PROXY_HOST,\n cookieDomain = FT_COOKIE_DOMAIN,\n formOfWordsId = SOURCEPOINT_FOW_ID,\n useConsentStore = true,\n trackingContext = {},\n disableFTCookies = false\n} = {}) {\n if (typeof window === \"undefined\") {\n console.error(\"The CMP client can only be initialised in a browser context\");\n return;\n }\n window.FT_CMP_CLIENT_VERSION = version;\n if (!userId && useFTSession) {\n try {\n const response = await getUuid();\n userId = response == null ? void 0 : response.uuid;\n } catch (error) {\n console.error(error);\n }\n }\n if (!(propertyConfig == null ? void 0 : propertyConfig.accountId)) {\n throw new Error(\"Please pass a valid property config\");\n }\n if (userId) {\n propertyConfig.authId = userId;\n }\n if (propertyConfig.events) {\n console.warn(\n \"[cmp-client] Passing an events map in the config is not supported and will be ignored. Please use window._sp_.addEventListener() to listen for events\"\n );\n delete propertyConfig.events;\n }\n bootstrapCmp(propertyConfig);\n window._sp_queue.push(() => {\n var _a, _b;\n (_b = (_a = window._sp_) == null ? void 0 : _a.addEventListener) == null ? void 0 : _b.call(\n _a,\n \"onConsentReady\",\n consentReadyHandlerFn({\n userId,\n consentProxyHost,\n cookieDomain,\n formOfWordsId,\n useConsentStore,\n disableFTCookies\n })\n );\n });\n initTracking(trackingContext, propertyConfig.baseEndpoint);\n}\nexports.debug = debug;\nexports.initSourcepointCmp = initSourcepointCmp;\nexports.interceptManageCookiesLinks = interceptManageCookiesLinks;\nexports.properties = properties;\n","\"use strict\";\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cmp_client_1 = require(\"@financial-times/cmp-client\");\nconst localhosts = ['localhost', '0.0.0.0', '127.0.0.1'];\nlet spProps, property;\nif (localhosts.includes(window.location.hostname)) {\n spProps = {\n useConsentStore: false,\n cookieDomain: window.location.hostname,\n useFTSession: false\n };\n property = cmp_client_1.properties.FT_DOTCOM_TEST;\n}\nelse {\n const hostNameParts = window.location.hostname.split('.');\n const apexDomainPartsCount = hostNameParts.slice(-1)[0] === 'uk' ? 3 : 2;\n const apexDomain = hostNameParts.slice(-apexDomainPartsCount).join('.');\n property = (_a = Object.entries(cmp_client_1.properties)\n .find(([, property]) => property.baseEndpoint.endsWith(apexDomain))) === null || _a === void 0 ? void 0 : _a[1];\n if (!property) {\n console.error('Property ID not configured for: ', apexDomain);\n }\n const userId = window._specialist_state && window._specialist_state.userId || undefined;\n spProps = {\n useConsentStore: false,\n userId,\n cookieDomain: `.${apexDomain}`,\n consentProxyHost: `https://consent.${apexDomain}`,\n useFTSession: false\n };\n}\n// adapt info from the custom oTracking.event dispatched by the cmp-client package\n// and push it to Snowplow\nwindow.addEventListener(\"oTracking.event\", (e) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;\n if (((_b = (_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.component) === null || _b === void 0 ? void 0 : _b.subtype) === 'cmp') {\n window.dataLayer = window.dataLayer || [];\n //flush entities from previous event\n window.dataLayer.push({ 'event': 'flushEntities', 'event_payload': undefined });\n const cmpBanner = {\n category: 'CMP Banner',\n banner_name: (_d = (_c = e === null || e === void 0 ? void 0 : e.detail) === null || _c === void 0 ? void 0 : _c.component) === null || _d === void 0 ? void 0 : _d.name,\n action: ((_f = (_e = e === null || e === void 0 ? void 0 : e.detail) === null || _e === void 0 ? void 0 : _e.action.charAt(0)) === null || _f === void 0 ? void 0 : _f.toUpperCase()) + ((_h = (_g = e === null || e === void 0 ? void 0 : e.detail) === null || _g === void 0 ? void 0 : _g.action) === null || _h === void 0 ? void 0 : _h.slice(1)),\n banner_id: (_l = (_k = (_j = e === null || e === void 0 ? void 0 : e.detail) === null || _j === void 0 ? void 0 : _j.component) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.toString(),\n click_action: (_m = e === null || e === void 0 ? void 0 : e.detail) === null || _m === void 0 ? void 0 : _m.trigger_action\n };\n window.dataLayer.push({\n event: 'analytics_event',\n event_payload: {\n schema: 'iglu:com.financialtimes/cmp_banner/jsonschema/1-0-0',\n data: cmpBanner\n }\n });\n }\n}, false);\n// a wrapper for the code that would execute for the Manage Cookies link in the footers\nwindow._specialist_manage_cookies = () => {\n // @ts-ignore\n window._sp_.gdpr.loadPrivacyManagerModal(941275);\n};\ncmp_client_1.initSourcepointCmp(Object.assign({ propertyConfig: property }, spProps));\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module\n__webpack_require__(382);\n// This entry module used 'exports' so it can't be inlined\n"],"sourceRoot":""}