UNPKG

@m10s/cmp

Version:

Package containing scripts used by Schibsteds' sites to integrate with Sourcepoint CMP

2 lines (1 loc) 21.7 kB
!function(){var e=["jsSdkVersion","id","realm","clientId","pulseTracker","referrer","state","pulseObjectName","showInWebview","identityObject","identityObjectName","disableSentry","disableNativeConsentCheck","enableUserCentric","groupId"],n=["jsSdkVersion","id","realm","clientId","pulseTracker","referrer","state","pulseObjectName","showInWebview","identityObject","identityObjectName","disableSentry","disableNativeConsentCheck","enableUserCentric","groupId"];function t(){var e=c(),n=e.m(t),u=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function p(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===u||"GeneratorFunction"===(n.displayName||n.name))}var f={throw:1,return:2,break:3,continue:3};function d(e){var n,t;return function(o){n||(n={stop:function(){return t(o.a,2)},catch:function(){return o.v},abrupt:function(e,n){return t(o.a,f[e],n)},delegateYield:function(e,i,a){return n.resultName=i,t(o.d,r(e),a)},finish:function(e){return t(o.f,e)}},t=function(e,t,r){o.p=n.prev,o.n=n.next;try{return e(t,r)}finally{n.next=o.n}}),n.resultName&&(n[n.resultName]=o.v,n.resultName=void 0),n.sent=o.v,n.next=o.n;try{return e.call(this,n)}finally{o.p=n.prev,o.n=n.next}}}return(t=function(){return{wrap:function(n,t,r,o){return e.w(d(n),t,r,o&&o.reverse())},isGeneratorFunction:p,mark:e.m,awrap:function(e,n){return new l(e,n)},AsyncIterator:s,async:function(e,n,t,r,o){return(p(n)?a:i)(d(e),n,t,r,o)},keys:o,values:r}})()}function r(e){if(null!=e){var n=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],t=0;if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function o(e){var n=Object(e),t=[];for(var r in n)t.unshift(r);return function e(){for(;t.length;)if((r=t.pop())in n)return e.value=r,e.done=!1,e;return e.done=!0,e}}function i(e,n,t,r,o){var i=a(e,n,t,r,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function a(e,n,t,r,o){return new s(c().w(e,n,t,r),o||Promise)}function s(e,n){function t(r,o,i,a){try{var s=e[r](o),c=s.value;return c instanceof l?n.resolve(c.v).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):n.resolve(c).then((function(e){s.value=e,i(s)}),(function(e){return t("throw",e,i,a)}))}catch(e){a(e)}}var r;this.next||(u(s.prototype),u(s.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),u(this,"_invoke",(function(e,o,i){function a(){return new n((function(n,r){t(e,i,n,r)}))}return r=r?r.then(a,a):a()}),!0)}function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return u(l,"_invoke",function(t,r,o){var i,s,c,u=0,l=o||[],p=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(n,t){return i=n,s=0,c=e,f.n=t,a}};function d(t,r){for(s=t,c=r,n=0;!p&&u&&!o&&n<l.length;n++){var o,i=l[n],d=f.p,y=i[2];t>3?(o=y===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=t<2&&d<i[1])?(s=0,f.v=r,f.n=i[1]):d<y&&(o=t<3||i[0]>r||r>y)&&(i[4]=t,i[5]=r,f.n=y,s=0))}if(o||t>1)return a;throw p=!0,r}return function(o,l,y){if(u>1)throw TypeError("Generator is already running");for(p&&1===l&&d(l,y),s=l,c=y;(n=s<2?e:c)||!p;){i||(s?s<3?(s>1&&(f.n=-1),d(s,c)):f.n=c:f.v=c);try{if(u=2,i){if(s||(o="next"),n=i[o]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,s<2&&(s=0)}else 1===s&&(n=i.return)&&n.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((n=(p=f.n<0)?c:t.call(r,f))!==a)break}catch(n){i=e,s=1,c=n}finally{u=1}}return{value:n,done:p}}}(t,o,i),!0),l}var a={};function s(){}function l(){}function p(){}n=Object.getPrototypeOf;var f=[][r]?n(n([][r]())):(u(n={},r,(function(){return this})),n),d=p.prototype=s.prototype=Object.create(f);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=p,u(d,"constructor",p),u(p,"constructor",l),l.displayName="GeneratorFunction",u(p,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,r,(function(){return this})),u(d,"toString",(function(){return"[object Generator]"})),(c=function(){return{w:i,m:y}})()}function u(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,n,t,r){function i(n,t){u(e,n,(function(e){return this._invoke(n,t,e)}))}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))},u(e,n,t,r)}function l(e,n){this.v=e,this.k=n}function p(e,n,t,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void t(e)}s.done?n(c):Promise.resolve(c).then(r,o)}function f(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function a(e){p(i,r,o,a,s,"next",e)}function s(e){p(i,r,o,a,s,"throw",e)}a(void 0)}))}}function d(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}function y(){var e;"undefined"!=typeof document&&document.location.href.indexOf("sp_debug=1")>0&&(e=console).debug.apply(e,["[CMP]"].concat(Array.prototype.slice.call(arguments)))}function v(e,n,t,r,o){var i=new URL(e);i.searchParams.append("utm_source","cmp"),i.searchParams.append("utm_medium","psi"),i.searchParams.append("referrer",r||window.location.href),t&&i.searchParams.append("client_id",t),n&&i.searchParams.append("environment_id",n),o&&i.searchParams.append("state",o),window.location.href=i.href}function g(e){return null===e?null:Boolean(parseInt(e))}var m=function(e,n){return Object.keys(n).filter((function(n){return void 0!==e[n]})).forEach((function(t){return"object"==typeof n[t]?Object.keys(n[t]).forEach((function(r){return e[t][r]=n[t][r]})):e[t]=n[t]}))};function b(e,n,t){var r=new Date;r.setTime(r.getTime()+24*t*60*60*1e3);var o="expires="+r.toUTCString();document.cookie=e+"="+n+";"+o+";path=/"}function h(e){for(var n=e+"=",t=decodeURIComponent(document.cookie).split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return""}function w(e){document.cookie=e+"=; Max-Age=-99999999;"}function _(e){var n=e.createElement("script");n.innerHTML='"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",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&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()}();',e.head.appendChild(n)}var C="__CONFIGURATION_PLACEHOLDER__",P=["Mixed","PSI","SCC","TCF","PMC"],I="default",O="cmp",S="cache",j="accepted",M="rejected",k="unknown",T=Object.freeze({purposes:{CMP_ANALYTICS:{optIn:!1,status:k},CMP_MARKETING:{optIn:!1,status:k},CMP_ADVERTISING:{optIn:!1,status:k},CMP_PERSONALIZATION:{optIn:!1,status:k}},source:I});function N(e,n,t,r){y("Pulse: "+t+"(actor, data):",n,r),E(e,(function(e){e&&"function"==typeof e.track&&e.track(t,{schema:"http://schema.schibsted.com/events/tracker-event.json/348.json",object:Object.assign({},r,N.pulseCommonData),provider:{component:"CMP-Marketplaces"},actor:n})}))}function E(e,n){if(e.psi.pulseTracker)return n(e.psi.pulseTracker);var t=e.psi.pulseObjectName||"pulse";return"function"!=typeof e[t]?console.error("No Pulse integration detected. Aborting."):e[t]((function(e){"function"==typeof n&&n(e)}))}function x(){var e,n=null==(e=N.pulseCommonData)?void 0:e.messageName;if(n)return P.find((function(e){return n.includes(e)}))}function A(e){return"CMP_"+("personalisation"===e?"personalization":e).toUpperCase()}function L(e,n,t){var r=Object.keys(U(e)).filter((function(n){return U(e)[n]})),o=Object.keys(U(e)).filter((function(n){return!U(e)[n]}));return r.map((function(e){var t=n.purposes[A(e)];t.optIn=!0,t.status=j})),o.map((function(e){n.purposes[A(e)].status=M})),n.source=t,n}function U(e){var n,t=g((e._scc_||e._tcf_).getPermissionSync("CMP:advertising")),r=g((e._scc_||e._tcf_).getPermissionSync("CMP:analytics")),o=g((e._scc_||e._tcf_).getPermissionSync("CMP:marketing")),i=g((e._scc_||e._tcf_).getPermissionSync("CMP:personalisation"));return n={advertising:t,analytics:r,marketing:o,personalisation:i},Object.entries(n).filter((function(e){return e[0],null!=e[1]})).reduce((function(e,n){var t,r=n[0],o=n[1];return Object.assign({},e,((t={})[r]=o,t))}),{})}function R(e,n){var t=n.performance.now();return e?Math.round((t-e)/1e3):null}var D="CMP:retrieveMessage";function F(e){e.enableUserCentric&&h("CMP:isLoggedIn")&&!h(D)&&(b(D,!0,400),function(e){var n,t,r,o,i=document.createElement("script");i.src="https://static.dev.cmp.m10s.io/dist/retrieve.js",document.body.appendChild(i);var a=document.createElement("retrieve-message");s=a,c=Object.assign({isWeb:!0,lang:e.consentLanguage},(null==(n=e.consentStatusMessage)?void 0:n.verticalPosition)&&{verticalPosition:null==(t=e.consentStatusMessage)?void 0:t.verticalPosition},(null==(r=e.consentStatusMessage)?void 0:r.horizontalPosition)&&{horizontalPosition:null==(o=e.consentStatusMessage)?void 0:o.horizontalPosition}),Object.entries(c).forEach((function(e){return s.setAttribute.apply(s,e)})),document.body.appendChild(a);var s,c}(e))}var G=null,W=!1,J=!1;function V(e,n){if(n&&("object"!=typeof(t=n)||t.constructor!==Object))return console.error("Provided object is incorrect");var t;if(0===Object.keys(U(e)).length){if(!n)return T;var r=JSON.parse(JSON.stringify(n));return r.source=I,r}return L(e,JSON.parse(JSON.stringify(n||T)),S)}function H(e,n){n.events=n.events||{};var t,r=n.events.onMessageReceiveData,o=n.events.onMessageChoiceSelect,i=n.events.onMessageReady,a=n.events.onPrivacyManagerAction,s=n.events.onConsentReady,c=!0,u={id:n.userId,realm:n.realm};n.events.onMessageReceiveData=function(e,t){y("Sourcepoint: onMessageReceiveData(data)",t),G=!0,N.pulseCommonData={"@id":"sdrn:privacy:cmp:"+(t.messageId||""),"@type":"CMP",messageName:t.msgDescription||"",propertyId:n.propertyId,messageId:t.messageId||void 0,bucket:t.bucket||void 0,jsSdkVersion:n.jsSdkVersion,partitionId:t.prtnUUID||"",language:n.consentLanguage},"function"==typeof r&&r(t)},n.events.onMessageReady=function(){var n,r;null==(n=window._tcf_)||null==(r=n.TCFCallbacks)||r.map((function(e){e()})),y("Sourcepoint: onMessageReady()");var o=x();if(y("Pulse: Detected message type: "+o),!G)return N(e,u,"View",{name:"CMP: Privacy Manager displayed",messageType:x()});t=e.performance.now(),N(e,u,"View",{name:"CMP: Message displayed",messageType:o}),"function"==typeof i&&i()},n.events.onMessageChoiceSelect=function(n,r,i){if(y("Sourcepoint: onMessageReady(choice_id="+r+", choice_type_id="+i+")"),5===i){var a=R(t,e);N(e,u,"engagementEvent",Object.assign({name:"CMP: Link to Privacy / Cookie Policy clicked",elementType:"anchor",isFirstLayer:G,messageType:x()},a&&{duration:a})),G=null}if(9===i){c=!1,G=null;var s=R(t,e);N(e,u,"engagementEvent",Object.assign({name:"CMP: Open Privacy Settings",elementType:"button",messageType:x()},s&&{duration:s}))}if(11===i&&(c=!0),12===i&&(G=!1),15===i){var l=R(t,e);N(e,u,"engagementEvent",Object.assign({name:"CMP: Dismiss message",elementType:"button",messageType:x()},l&&{duration:l}))}"function"==typeof o&&o(r,i)},n.events.onPrivacyManagerAction=function(e,n){y("Sourcepoint: onPrivacyManagerAction()"),W=!0,G=!1,"none"===n.purposeConsent?(J=!0,c=!1):(J=!1,c=!0),"function"==typeof a&&a()},n.events.onConsentReady=function(r,o,i,a){var l,p,f,d;F(n),null==(l=window._tcf_)||null==(p=l.consentedCallback)||p.map((function(e){e(a.consentedToAll)})),null==(f=window._tcf_)||null==(d=f.TCFCallbacks)||d.map((function(e){e()})),y("Sourcepoint: onConsentReady(message_type="+r+", consentUUID="+o+", euconsent)",i),y("Sourcepoint: getMessageType() "+x());var v=R(t,e);if(void 0!==x()||W){var g="PSI"===x()?null:U(e);if(function(e){var n=JSON.parse(JSON.stringify(T));E(e,(function(t){try{t.setConsents(L(e,n,O))}catch(e){console.error("Consents couldn't be set. The provided version of Pulse SDK does not support the setConsents event")}}))}(e),J&&N(e,u,"engagementEvent",Object.assign({name:"CMP: Reject all",elementType:"button",messageType:x()},v&&{duration:v})),!c)return!1;N(e,u,"engagementEvent",Object.assign({name:"CMP: Accept",elementType:"button",messageType:x(),consentedToAll:null==a?void 0:a.consentedToAll,isFirstLayer:G||!!G},g&&{consents:g},v&&{duration:v})),G=null,W=!1,J=!1,"function"==typeof s&&s(r,o,i,a)}}}function z(e,n,t){var r;if(!n||!n.groupPmId)throw new Error("groupPmId is required");var o="CMP:advertising",i="CMP:analytics",a="CMP:marketing",s="CMP:personalisation",c="CMP:performance_marketing",u={};function l(n){return y(t+": getPermissionFromCache(category="+n+")"),e.localStorage.getItem(n)}u[o]=[],u[i]=[],u[a]=[],u[s]=[],u[c]=[];var p,f={subscribers:u,consentedCallback:[],TCFCallbacks:[],showPrivacyManager:function(){y("${type}: showPrivacyManager()"),N.pulseCommonData.messageName="",W=!0,G=!1,e._sp_.gdpr.loadPrivacyManagerModal()},getPermissionSync:function(e){return y(t+": getPermissionSync(category="+e+")"),l(e)},getPermission:function(e,n){y(t+": getPermission(category="+e+")");var r,o=f.subscribe(e,(r=!1,function(e){r?"function"==typeof o&&o():(r=!0,n(e),n=function(){})}))},notify:(r={},r[o]=l(o),r[i]=l(i),r[a]=l(a),r[s]=l(s),r[c]=l(c),p=r,function(e,n){if(p[e]!==n){y(t+": notify(category="+e+", value="+n+")"),p[e]=n;for(var r=f.subscribers[e],o=0;o<r.length;o++)r[o](n)}else y(t+": notify(category="+e+", value="+n+") - IGNORED")}),subscribe:function(e,n){if(y(t+": subscribe(category="+e+")"),f.subscribers[e]){f.subscribers[e].push(n);var r=l(e);return null!==r&&n(r),function(){f.subscribers[e]=f.subscribers[e].filter((function(e){return e!==n}))}}console.error("Unable to subscribe - undefined consent category!")},getCachedOrDefaultConsentsForPulse:function(n){return V(e,n)},isConsentedToAll:function(e){f.consentedCallback.push(e)},getConsentedToAllSync:function(){var e=l("_sp_user_consent_"+n.propertyId);try{var t,r;if(0===Object.keys(localStorage).filter((function(e){return e.startsWith("CMP:")})).length)return null;var o=null==(t=JSON.parse(e))||null==(r=t.gdpr)?void 0:r.consentStatus;if((null==o?void 0:o.vendorListAdditions)||(null==o?void 0:o.legalBasisChanges))return null;var i=null==o?void 0:o.consentedAll;return void 0===i?null:i}catch(e){return null}},onTcfReady:function(e){f.TCFCallbacks.push(e)}};return e._SourcePoint_Consent_Callback=f.notify,f}function B(e,n){var t,r;if(null!=(t=e.psi)&&t.identityObject)return e.psi.identityObject;if(null!=n&&n.identityObject)return n.identityObject;var o=(null==(r=e.psi)?void 0:r.identityObjectName)||(null==n?void 0:n.identityObjectName)||"Identity";return e[o]?e[o]:console.warn("No Schibsted Account integration detected.")}function K(e){var n=Array.from({length:20},(function(){return String.fromCharCode(Math.floor(25*Math.random()+97))})).join(""),t=btoa(JSON.stringify(n));B(e)&&B(e).login({state:t})}var Y=function(e){if("number"==typeof e||void 0===e)return config.userId=e;throw new Error("Id value "+e+" is invalid")},q=function(e){return function(e){try{return Boolean(new URL(e))}catch(e){return!1}}(e)?window.psi.isLoggedInUser?v(e,null,window.psi.clientId,window.psi.referrer,window.psi.state):E(window,(function(n){n.getEnvironmentId().then((function(n){v(e,n,window.psi.clientId,window.psi.referrer,window.psi.state)}))})):console.error("The URL passed to the configuration is invalid. Please, correct it.")},Z=function(){return K(window)},$=function(e,n,t){e.targetingParams=e.targetingParams||{},e.targetingParams[n]=t};var Q=["Hermes","_app_","tv.nu","FinnApp","Omni"];function X(e){return Q.some((function(n){return e.userAgent.includes(n)}))}function ee(e,n,t){return!new URLSearchParams(null==(r=e.location)?void 0:r.search).has("_sp_pass_consent")&&X(n)&&!t.disableNativeConsentCheck;var r}function ne(){return(ne=f(t().mark((function e(r,o,i,a,s){var c,u,l,p,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(te(r,o,i,a,s),a.jsSdkVersion,a.id,a.realm,a.clientId,a.pulseTracker,a.referrer,a.state,a.pulseObjectName,a.showInWebview,a.identityObject,a.identityObjectName,a.disableSentry,a.disableNativeConsentCheck,a.enableUserCentric,a.groupId,c=d(a,n),e.prev=2,u=B(r),e.t0=h("CMP:isLoggedIn"),e.t0){e.next=9;break}return e.next=8,u.isLoggedIn();case 8:e.t0=e.sent;case 9:if(e.t0){e.next=12;break}return e.abrupt("return",re(r,c));case 12:return u.on("logout",(function(){w("CMP:isLoggedIn")})),h("CMP:isLoggedIn")||b("CMP:isLoggedIn",!0),$(a,"loggedin",!0),l={externalParty:"sourcepoint",optionalSuffix:a.groupId},e.next=18,u.getExternalId(l.externalParty,l.optionalSuffix);case 18:p=e.sent,f=$(a,"enableUserCentric",!0),re(r,Object.assign({authId:p,targetingParams:f},c)),e.next=27;break;case 23:e.prev=23,e.t1=e.catch(2),console.error("Identity: ",e.t1),re(r,c);case 27:case"end":return e.stop()}}),e,null,[[2,23]])})))).apply(this,arguments)}function te(e,n,t,r,o){var i,a,s;if(!(r&&r.baseEndpoint&&r.propertyId&&r.consentLanguage))throw new Error("One of missing: baseEndpoint, propertyId, consentLanguage");H(e,r),function(e){e.events=e.events||{},e.events.onError=function(n,t,r){try{n&&window._cmp_.sentry.setTag("message_type",n),t&&window._cmp_.sentry.setTag("errorCode",t),window._cmp_.sentry.setTag("propertyId",e.propertyId),window._cmp_.sentry.captureException(r)}catch(e){console.error("Can not send the error to Sentry, "+e)}},e.events.onMessageChoiceError=function(e,n){try{e&&window._cmp_.sentry.setTag("message_type",e),window._cmp_.sentry.captureException(n)}catch(n){console.error("Can not send the error to Sentry, "+n)}}}(r),r.accountId=r.accountId||1960,r.custom={},"psi"!==o&&(r.gdpr={includeTcfApi:"tcf"===o}),r.propertyHref&&(r.joinHref=!0);var c=r.userId||(null==(i=B(e,r))?void 0:i._session.userId);c&&$(r,"loggedin","true");var u=r.clientId||(null==(a=B(window,r))?void 0:a.clientId);X(t)&&$(r,"mobile-webview",!r.showInWebview||r.showInWebview);var l,p=null==n||null==(s=n.referrer)?void 0:s.split("/")[2];p&&$(r,"referrer-hostname",p),l=/(_sch_cmp_[_a-z0-9]+)=(.+)/i,n.cookie.split(";").filter((function(e){return l.test(e)})).map((function(e){return e.split("=").map((function(e){return e.trim()}))})).forEach((function(e){var n=e[0],t=e[1];return $(r,n,t)})),r.propertyHref&&n.location.search&&-1===r.propertyHref.indexOf("?")&&(r.propertyHref+=n.location.search);var f=r.pulseTracker,d=r.referrer,y=r.state,v=r.pulseObjectName,g=r.showInWebview,m=r.identityObject,b=r.identityObjectName,h=r.enableUserCentric,w=r.groupId;e.psi=e.psi||{},e.psi.isLoggedInUser=!!c,e.psi.setUserId=Y,e.psi.openPrivacySettings=q,e.psi.pulseTracker=f,e.psi.clientId=u,e.psi.referrer=d,e.psi.state=y,e.psi.pulseObjectName=v,e.psi.showInWebview=g,e.psi.identityObject=m,e.psi.identityObjectName=b,e.psi.triggerLogin=Z,e.psi.enableUserCentric=h,e.psi.groupId=w}function re(e,n){e._sp_=e._sp_||{},e._sp_.config=n,y("Sourcepoint initiated with config: ",n)}ee(window,navigator,C)?(console.warn("CMP: Native consent is not passed. Sourcepoint will not be initialized."),window._sp_={config:{accountId:1960,baseEndpoint:"https://cdn.privacy-mgmt.com"}}):(_(document),function(e,n){if(!n.disableSentry){var t=e.createElement("script");m(t,{async:!0,type:"module",src:"https://static.pro.cmp.m10s.io/dist/index.js",fetchPriority:"low"}),e.head.appendChild(t)}}(document,C),function(e,n){e._tcf_=z(e,n)}(window,C),C.enableUserCentric?function(e,n,t,r,o){ne.apply(this,arguments)}(window,document,navigator,C,"tcf"):function(n,t,r,o,i){te(n,t,r,o,i),o.jsSdkVersion,o.id,o.realm,o.clientId,o.pulseTracker,o.referrer,o.state,o.pulseObjectName,o.showInWebview,o.identityObject,o.identityObjectName,o.disableSentry,o.disableNativeConsentCheck,o.enableUserCentric,o.groupId,re(n,d(o,e))}(window,document,navigator,C,"tcf")),ee(window,navigator,C)||(_(document),function(e,n){var t=e.baseEndpoint+"/unified/wrapperMessagingWithoutDetection.js",r=n.getElementsByTagName("script"),o=r[r.length-1],i=n.createElement("link");m(i,{rel:"preload",as:"script",crossorigin:"crossorigin",href:t}),n.head.appendChild(i);var a=n.createElement("script");m(a,{async:!0,src:t}),o.insertAdjacentElement("afterend",a)}(C,document))}();