(()=>{"use strict";function e(o){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(o)}function o(o){var n=function(o,n){if("object"!=e(o)||!o)return o;var t=o[Symbol.toPrimitive];if(void 0!==t){var r=t.call(o,n||"default");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(o)}(o,"string");return"symbol"==e(n)?n:n+""}function n(e,n,t){return(n=o(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}const t=["Registration is a free and easy way to support our truly independent journalism"];let r=function(e){return e.GDPR="gdpr",e.USNAT="usnat",e.IOS14="ios14",e.CUSTOM="custom",e}({}),i=function(e){return e[e.CONTINUE_WITHOUT_AGREEING=1]="CONTINUE_WITHOUT_AGREEING",e[e.OPT_IN=2]="OPT_IN",e[e.VIEW_IFRAME=4]="VIEW_IFRAME",e[e.REDIRECT=5]="REDIRECT",e[e.MICRO_PAYMENT=7]="MICRO_PAYMENT",e[e.CUSTOM_JS=9]="CUSTOM_JS",e[e.WELECT_VIDEO=10]="WELECT_VIDEO",e[e.ACCEPT_ALL=11]="ACCEPT_ALL",e[e.VIEW_PRIVACY_MANAGER=12]="VIEW_PRIVACY_MANAGER",e[e.REJECT_ALL=13]="REJECT_ALL",e[e.SAMBA_VIDEO=14]="SAMBA_VIDEO",e[e.DISMISS=15]="DISMISS",e}({});const c="uk",s=e=>{try{const o=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(o));return JSON.parse(n)}catch(e){return null}};const a=(e,o=null)=>{var n,t;const r=`; ${document.cookie}`.split(`; ${e}=`);return 2===r.length?decodeURIComponent(null!==(n=null===(t=r.pop())||void 0===t?void 0:t.split(";").shift())&&void 0!==n?n:""):o};let l=function(e){return e.ACCEPT_ALL="Accept All",e.REJECT_ALL="Reject All",e.LOG_IN="Log In",e.PRIVACY_POLICY="Privacy Policy",e.PRIVACY_MANAGER="Privacy Manager",e}({});const u="cmp-choice";function p(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function d(e){for(var o=1;o(((e,o={})=>{const n=JSON.stringify(o,null,2),t=n.split("\n").reduce((e,o)=>o.length>=e?o.length:e,0),r=e.length,i=Math.max(r,t),c=` ${e.padEnd(i)} `,s=n.split("\n").map(e=>` ${e.padEnd(i)} `),a=s.length>1?`%c${s.slice(0,1)}\n%c${s.slice(1,-1).join("\n")}\n%c${s.slice(-1)}\n`:`%c${s[0]}\n`,l=s.length>1?["font-family:monospace; background: #333; color: #eee; padding-top: 5px;","font-family:monospace; background: #333; color: #eee;","font-family:monospace; background: #333; color: #eee; padding-bottom: 10px; border-radius: 0 0 6px 6px"]:["font-family:monospace; background: #333; color: #eee; padding-top: 5px; padding-bottom: 10px; border-radius: 0 0 6px 6px"];console.log(`%c${c}\n${a}`,"font-family:monospace; background: #333; color: #eee; border-bottom: 1px solid #666; padding: 5px 0; border-radius: 6px 6px 0 0",...l)})(`CustomEvent: ${e}`,o),new CustomEvent("analytics-trigger",{detail:{data:d({},o),eventName:e}})),f=(e,o)=>{return n=_(e,o),void document.body.dispatchEvent(n);var n},E=(e={})=>f("sourcepoint_cmp_click",e),y=e=>{sessionStorage.setItem(u,`${e}`)},g=(e,o)=>{const n=sessionStorage.getItem(u)===`${e}`;return n&&(sessionStorage.removeItem(u),E(o)),n},m=(e,o,n)=>{const t=new Date;if(n){const e=n.days?24*n.days*60*60*1e3:60*n.hours*60*1e3;t.setTime(t.getTime()+e)}const r=[];r.push(`${e}=${encodeURIComponent(o)}`),r.push("path=/"),r.push("secure"),n&&r.push(`expires=${t.toGMTString()}`),document.cookie=r.join(";")};let w;const b=()=>{if("undefined"==typeof window)return"prod"!=={NODE_ENV:"production",npm_config_domain:""}.SERVER;if("undefined"!=typeof window&&void 0===w){var e;const o=new URLSearchParams(null===(e=window)||void 0===e||null===(e=e.location)||void 0===e?void 0:e.search);w=o.has("__DEBUG__")}return w||"true"===a("__DEBUG__")};var v,O,I;function P(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,t)}return n}function A(e){for(var o=1;o{var e;const o=null!==(e=a("esi_auth"))&&void 0!==e?e:"";return s(o)})())||void 0===O?void 0:O.isAdFreeUser)&&void 0!==v&&v,T=a("esi_puid");window.__SP_CONFIG__=window.__SP_CONFIG__||{},window.__SP_CONFIG__.propertyHref=`${document.location.protocol}//${document.location.host}`,window._sp_queue=[],window._sp_={config:A(A(A({},window.__SP_CONFIG__),S&&{authId:T}),{},{targetingParams:{ad_free:R,registered:S,premium:C}})},(null===(I=window._sp_)||void 0===I?void 0:I.config).events={onError(e,o){if(console.warn("CMP error",`code: ${o}`),console.warn("CMP error",`message: ${e}`),window.__SP_SCRIPT_TAG_ID__){const e=document.getElementById(window.__SP_SCRIPT_TAG_ID__);e&&(e.error=1)}window.__SP_EVENT_ERROR__&&window.dispatchEvent(new CustomEvent(window.__SP_EVENT_ERROR__))},onMessageReady(e){g(i.VIEW_PRIVACY_MANAGER,{label:l.PRIVACY_MANAGER})||((e={})=>{f("sourcepoint_cmp_impression",e)})()},onConsentReady(e,o,n,t){const s=document.getElementById("privacy-settings");if(s){if(e===r.GDPR&&t.applies){var l;const e=R?1141355:1171350;((...e)=>{b()&&console.log(...e)})("Consent Or Pay: consentUUID and euconsent ---\x3e",{consentUUID:o,euconsent:n});const t=(null!==(l=a("subscriber_origin"))&&void 0!==l?l:c)===c;s.innerHTML="Privacy settings",s.onclick=()=>{var o;y(i.VIEW_PRIVACY_MANAGER),null===(o=window._sp_)||void 0===o||null===(o=o.gdpr)||void 0===o||o.loadPrivacyManagerModal(t?e:559246)},m("gdprApplies","true",{hours:1})}if(e===r.USNAT){if(!t.applies)return void(s.style.display="none");s.innerHTML="Do Not Sell or Share My Information",s.onclick=()=>{var e;null===(e=window._sp_)||void 0===e||null===(e=e.usnat)||void 0===e||e.loadPrivacyManagerModal(1318285)},m("us_privacy_string",n,{hours:1})}}},onMessageChoiceSelect(e,o,n){switch(e===r.GDPR&&9===n&&window.localStorage.setItem("consent-to-pay-original-page-redirect-url",window.location.href),n){case i.REJECT_ALL:E({label:l.REJECT_ALL});break;case i.ACCEPT_ALL:E({label:l.ACCEPT_ALL});break;case i.CUSTOM_JS:y(i.CUSTOM_JS);break;case i.VIEW_PRIVACY_MANAGER:y(i.VIEW_PRIVACY_MANAGER)}}}})();