!function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,s=arguments.length;n0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]t)throw new TypeError;for(var s=Math.floor(Math.random()*(t+1-e))+e,i="",o=0;o2&&"string"==typeof e[2]&&e[2].length>0?e[2]:null)+"-disqus"}}catch(e){t=c.location.hostname}return 0===t.indexOf("www.")&&(t=t.replace("www.","")),t}(),y=!1,0!==Object.keys(L).length)return[3,5];(_=new URL("https://"+h+"/websiteconfig")).searchParams.set("bt_env",O.bt_env||"prod"),_.searchParams.set("o",p),_.searchParams.set("w",w),s.label=1;case 1:return s.trys.push([1,4,,5]),[4,fetch(_.toString())];case 2:if(!(C=s.sent()).ok)throw new Error;return[4,C.json()];case 3:return A=s.sent(),n.websiteID=A.tagData.w,n.contentEnabled=A.tagData.ce,n.mobileContentEnabled=A.tagData.me,n.widget=null!==(e=A.tagData.widget)&&void 0!==e&&e,[2,{siteInfo:n,bundleData:A.bundleData,rlSettings:A.messageWall,checksum:A.checksum}];case 4:return s.sent(),[3,5];case 5:return w&&w in L?(R=L[w],n.websiteID=null!==(t=R.w)&&void 0!==t?t:R.website_id,n.contentEnabled=null!==(i=R.ce)&&void 0!==i?i:R.content_enabled,n.mobileContentEnabled=null!==(r=R.me)&&void 0!==r?r:R.mobile_content_enabled,n.widget=null!==(o=R.widget)&&void 0!==o&&o,y=!0):(D=Object.keys(L).reduce((function(e,t){var n=t.toLowerCase(),s=w.indexOf(n)>-1?w.indexOf(n):c.location.hostname.indexOf(n);return s>-1&&(!e||se.site.length)?{site:t,indexInHostname:s}:e}),null))&&(y=!0,R=L[D.site],n.websiteID=null!==(a=R.w)&&void 0!==a?a:R.website_id,n.contentEnabled=null!==(l=R.ce)&&void 0!==l?l:R.content_enabled,n.mobileContentEnabled=null!==(u=R.me)&&void 0!==u?u:R.mobile_content_enabled,n.widget=null!==(d=R.widget)&&void 0!==d&&d),y?(T=function(e){var t;return(null===(t=null==f?void 0:f.websites)||void 0===t?void 0:t[e])||(null==f?void 0:f.org)}(n.websiteID),[2,{siteInfo:n,rlSettings:T}]):(I(1)&&(V={domain:w,orgID:parseInt(p)},function(e,t){new Promise((function(n,s){var i=new window.XMLHttpRequest;i.open("POST",e,!0),i.onerror=function(){s("Error in get request")},i.onload=function(){n(i.responseText)},i.send(t)}))}("https://"+v+"/events/unknown_domains?upapi=true&tid="+encodeURIComponent(P.traceID)+"&cv="+encodeURIComponent(g),E(V))),[2,{siteInfo:n}])}}))}))}();function F(){return B}B.then((function(e){window.__bt_tag_d={orgID:p,domain:h,siteInfo:e.siteInfo,apiDomain:v,version:g,websitesData:L}}));class M extends Error{constructor(e){super(e),this.name="DecodingError"}}class j extends Error{constructor(e){super(e),this.name="EncodingError"}}class H extends Error{constructor(e){super(e),this.name="GVLError"}}class G extends Error{constructor(e,t){super(`invalid value ${t} passed for ${e} ${arguments.length>2&&void 0!==arguments[2]?arguments[2]:""}`),this.name="TCModelError"}}class z{static DICT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";static REVERSE_DICT=new Map([["A",0],["B",1],["C",2],["D",3],["E",4],["F",5],["G",6],["H",7],["I",8],["J",9],["K",10],["L",11],["M",12],["N",13],["O",14],["P",15],["Q",16],["R",17],["S",18],["T",19],["U",20],["V",21],["W",22],["X",23],["Y",24],["Z",25],["a",26],["b",27],["c",28],["d",29],["e",30],["f",31],["g",32],["h",33],["i",34],["j",35],["k",36],["l",37],["m",38],["n",39],["o",40],["p",41],["q",42],["r",43],["s",44],["t",45],["u",46],["v",47],["w",48],["x",49],["y",50],["z",51],["0",52],["1",53],["2",54],["3",55],["4",56],["5",57],["6",58],["7",59],["8",60],["9",61],["-",62],["_",63]]);static BASIS=6;static LCM=24;static encode(e){if(!/^[0-1]+$/.test(e))throw new j("Invalid bitField");const t=e.length%this.LCM;e+=t?"0".repeat(this.LCM-t):"";let n="";for(let t=0;t{const n=this.deepClone(this[t]);void 0!==n&&(e[t]=n)})),e}deepClone(e){const t=typeof e;if("number"===t||"string"===t||"boolean"===t)return e;if(null!==e&&"object"===t){if("function"==typeof e.clone)return e.clone();if(e instanceof Date)return new Date(e.getTime());if(void 0!==e[Symbol.iterator]){const t=[];for(const n of e)t.push(this.deepClone(n));return e instanceof Array?t:new e.constructor(t)}{const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n]=this.deepClone(e[n]));return t}}}}class $ extends W{root=null;getRoot(){return this.root}isEmpty(){return!this.root}add(e){const t={value:e,left:null,right:null};let n;if(this.isEmpty())this.root=t;else for(n=this.root;;)if(en.value))break;if(null===n.right){n.right=t;break}n=n.right}}get(){const e=[];let t=this.root;for(;t;)if(t.left){let n=t.left;for(;n.right&&n.right!=t;)n=n.right;n.right==t?(n.right=null,e.push(t.value),t=t.right):(n.right=t,t=t.left)}else e.push(t.value),t=t.right;return e}contains(e){let t=!1,n=this.root;for(;n;){if(n.value===e){t=!0;break}e>n.value?n=n.right:e0&&void 0!==arguments[0]?arguments[0]:this.root;for(;t;)t.left?t=t.left:(e=t.value,t=null);return e}max(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.root;for(;t;)t.right?t=t.right:(e=t.value,t=null);return e}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.root,n=null,s="left";for(;t;)if(et.value)n=t,t=t.right,s="right";else{if(t.left||t.right)if(t.left)if(t.right){const e=this.min(t.right);this.remove(e,t.right),t.value=e}else n?n[s]=t.left:this.root=t.left;else n?n[s]=t.right:this.root=t.right;else n?n[s]=null:this.root=null;t=null}}static build(e){if(e&&0!==e.length){if(1===e.length){const t=new $;return t.add(e[0]),t}{const t=e.length>>1,n=new $;n.add(e[t]);const s=n.getRoot();if(s){if(t+10){const n=$.build(e.slice(0,t-1));s.left=n?n.getRoot():null}}return n}}return null}}class q{static langSet=new Set(["BG","CA","CS","DA","DE","EL","EN","ES","ET","FI","FR","HR","HU","IT","JA","LT","LV","MT","NL","NO","PL","PT","RO","RU","SK","SL","SV","TR","ZH"]);has(e){return q.langSet.has(e)}forEach(e){q.langSet.forEach(e)}get size(){return q.langSet.size}}class J{static cmpId="cmpId";static cmpVersion="cmpVersion";static consentLanguage="consentLanguage";static consentScreen="consentScreen";static created="created";static supportOOB="supportOOB";static isServiceSpecific="isServiceSpecific";static lastUpdated="lastUpdated";static numCustomPurposes="numCustomPurposes";static policyVersion="policyVersion";static publisherCountryCode="publisherCountryCode";static publisherCustomConsents="publisherCustomConsents";static publisherCustomLegitimateInterests="publisherCustomLegitimateInterests";static publisherLegitimateInterests="publisherLegitimateInterests";static publisherConsents="publisherConsents";static publisherRestrictions="publisherRestrictions";static purposeConsents="purposeConsents";static purposeLegitimateInterests="purposeLegitimateInterests";static purposeOneTreatment="purposeOneTreatment";static specialFeatureOptins="specialFeatureOptins";static useNonStandardStacks="useNonStandardStacks";static vendorConsents="vendorConsents";static vendorLegitimateInterests="vendorLegitimateInterests";static vendorListVersion="vendorListVersion";static vendorsAllowed="vendorsAllowed";static vendorsDisclosed="vendorsDisclosed";static version="version"}!function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(T||(T={}));class K extends W{static hashSeparator="-";purposeId_;restrictionType;constructor(e,t){super(),void 0!==e&&(this.purposeId=e),void 0!==t&&(this.restrictionType=t)}static unHash(e){const t=e.split(this.hashSeparator),n=new K;if(2!==t.length)throw new G("hash",e);return n.purposeId=parseInt(t[0],10),n.restrictionType=parseInt(t[1],10),n}get hash(){if(!this.isValid())throw new Error("cannot hash invalid PurposeRestriction");return`${this.purposeId}${K.hashSeparator}${this.restrictionType}`}get purposeId(){return this.purposeId_}set purposeId(e){this.purposeId_=e}isValid(){return Number.isInteger(this.purposeId)&&this.purposeId>0&&(this.restrictionType===T.NOT_ALLOWED||this.restrictionType===T.REQUIRE_CONSENT||this.restrictionType===T.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class Q extends W{bitLength=0;map=new Map;gvl_;has(e){return this.map.has(e)}isOkToHave(e,t,n){let s=!0;if(this.gvl?.vendors){const i=this.gvl.vendors[n];if(i)if(e===T.NOT_ALLOWED)s=i.legIntPurposes.includes(t)||i.purposes.includes(t);else if(i.flexiblePurposes.length)switch(e){case T.REQUIRE_CONSENT:s=i.flexiblePurposes.includes(t)&&i.legIntPurposes.includes(t);break;case T.REQUIRE_LI:s=i.flexiblePurposes.includes(t)&&i.purposes.includes(t)}else s=!1;else s=!1}return s}add(e,t){if(this.isOkToHave(t.restrictionType,t.purposeId,e)){const n=t.hash;this.has(n)||(this.map.set(n,new $),this.bitLength=0),this.map.get(n).add(e)}}restrictPurposeToLegalBasis(e){const t=this.gvl.vendorIds,n=e.hash,s=function(){let e;for(e of t);return e}(),i=[...Array(s).keys()].map((e=>e+1));for(let e=1;e<=s;e++)this.has(n)||(this.map.set(n,$.build(i)),this.bitLength=0),this.map.get(n).add(e)}getVendors(e){let t=[];if(e){const n=e.hash;this.has(n)&&(t=this.map.get(n).get())}else{const e=new Set;this.map.forEach((t=>{t.get().forEach((t=>{e.add(t)}))})),t=Array.from(e)}return t}getRestrictionType(e,t){let n;return this.getRestrictions(e).forEach((e=>{e.purposeId===t&&(void 0===n||n>e.restrictionType)&&(n=e.restrictionType)})),n}vendorHasRestriction(e,t){let n=!1;const s=this.getRestrictions(e);for(let e=0;e{e=Math.max(t.max(),e)})),e}getRestrictions(e){const t=[];return this.map.forEach(((n,s)=>{e?n.contains(e)&&t.push(K.unHash(s)):t.push(K.unHash(s))})),t}getPurposes(){const e=new Set;return this.map.forEach(((t,n)=>{e.add(K.unHash(n).purposeId)})),Array.from(e)}remove(e,t){const n=t.hash,s=this.map.get(n);s&&(s.remove(e),s.isEmpty()&&(this.map.delete(n),this.bitLength=0))}set gvl(e){this.gvl_||(this.gvl_=e,this.map.forEach(((e,t)=>{const n=K.unHash(t);e.get().forEach((t=>{this.isOkToHave(n.restrictionType,n.purposeId,t)||e.remove(t)}))})))}get gvl(){return this.gvl_}isEmpty(){return 0===this.map.size}get numRestrictions(){return this.map.size}}!function(e){e.COOKIE="cookie",e.WEB="web",e.APP="app"}(V||(V={})),function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(k||(k={}));class Y{static ID_TO_KEY=[k.CORE,k.VENDORS_DISCLOSED,k.VENDORS_ALLOWED,k.PUBLISHER_TC];static KEY_TO_ID={[k.CORE]:0,[k.VENDORS_DISCLOSED]:1,[k.VENDORS_ALLOWED]:2,[k.PUBLISHER_TC]:3}}class X extends W{bitLength=0;maxId_=0;set_=new Set;*[Symbol.iterator](){for(let e=1;e<=this.maxId;e++)yield[e,this.has(e)]}values(){return this.set_.values()}get maxId(){return this.maxId_}has(e){return this.set_.has(e)}unset(e){Array.isArray(e)?e.forEach((e=>this.unset(e))):"object"==typeof e?this.unset(Object.keys(e).map((e=>Number(e)))):(this.set_.delete(Number(e)),this.bitLength=0,e===this.maxId&&(this.maxId_=0,this.set_.forEach((e=>{this.maxId_=Math.max(this.maxId,e)}))))}isIntMap(e){let t="object"==typeof e;return t=t&&Object.keys(e).every((t=>{let n=Number.isInteger(parseInt(t,10));return n=n&&this.isValidNumber(e[t].id),n=n&&void 0!==e[t].name,n})),t}isValidNumber(e){return parseInt(e,10)>0}isSet(e){let t=!1;return e instanceof Set&&(t=Array.from(e).every(this.isValidNumber)),t}set(e){if(Array.isArray(e))e.forEach((e=>this.set(e)));else if(this.isSet(e))this.set(Array.from(e));else if(this.isIntMap(e))this.set(Object.keys(e).map((e=>Number(e))));else{if(!this.isValidNumber(e))throw new G("set()",e,"must be positive integer array, positive integer, Set, or IntMap");this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0}}empty(){this.set_=new Set}forEach(e){for(let t=1;t<=this.maxId;t++)e(this.has(t),t)}get size(){return this.set_.size}setAll(e){this.set(e)}}class Z{static[J.cmpId]=12;static[J.cmpVersion]=12;static[J.consentLanguage]=12;static[J.consentScreen]=6;static[J.created]=36;static[J.isServiceSpecific]=1;static[J.lastUpdated]=36;static[J.policyVersion]=6;static[J.publisherCountryCode]=12;static[J.publisherLegitimateInterests]=24;static[J.publisherConsents]=24;static[J.purposeConsents]=24;static[J.purposeLegitimateInterests]=24;static[J.purposeOneTreatment]=1;static[J.specialFeatureOptins]=12;static[J.useNonStandardStacks]=1;static[J.vendorListVersion]=12;static[J.version]=6;static anyBoolean=1;static encodingType=1;static maxId=16;static numCustomPurposes=6;static numEntries=12;static numRestrictions=12;static purposeId=6;static restrictionType=2;static segmentType=3;static singleOrRange=1;static vendorId=16}class ee{static encode(e){return String(Number(e))}static decode(e){return"1"===e}}class te{static encode(e,t){let n;if("string"==typeof e&&(e=parseInt(e,10)),n=e.toString(2),n.length>t||e<0)throw new j(`${e} too large to encode into ${t}`);return n.length25||s<0||s>25)throw new j(`invalid language code: ${e}`);if(t%2==1)throw new j(`numBits must be even, ${t} is not valid`);t/=2;return te.encode(n,t)+te.encode(s,t)}static decode(e,t){let n;if(t!==e.length||e.length%2)throw new M("invalid bit length for language");{const t=65,s=e.length/2,i=te.decode(e.slice(0,s),s)+t,r=te.decode(e.slice(s),s)+t;n=String.fromCharCode(i)+String.fromCharCode(r)}return n}}class re{static encode(e){let t=te.encode(e.numRestrictions,Z.numRestrictions);return e.isEmpty()||e.getRestrictions().forEach((n=>{t+=te.encode(n.purposeId,Z.purposeId),t+=te.encode(n.restrictionType,Z.restrictionType);const s=e.getVendors(n),i=s.length;let r=0,o=0,a="";for(let t=0;t{for(;++e<=c&&!l.has(e););return e};if(t===i-1||s[t+1]>u(n)){const e=!(n===o);a+=ee.encode(e),a+=te.encode(o,Z.vendorId),e&&(a+=te.encode(n,Z.vendorId)),o=0}}t+=te.encode(r,Z.numEntries),t+=a})),t}static decode(e){let t=0;const n=new Q,s=te.decode(e.substr(t,Z.numRestrictions),Z.numRestrictions);t+=Z.numRestrictions;for(let i=0;i{if(r+=ee.encode(i),n=e.maxId>c&&l{const t=1===e.length;n+=ee.encode(!t),n+=te.encode(e[0],Z.vendorId),t||(n+=te.encode(e[1],Z.vendorId))})),n}}function ae(){return{[J.version]:te,[J.created]:ne,[J.lastUpdated]:ne,[J.cmpId]:te,[J.cmpVersion]:te,[J.consentScreen]:te,[J.consentLanguage]:ie,[J.vendorListVersion]:te,[J.policyVersion]:te,[J.isServiceSpecific]:ee,[J.useNonStandardStacks]:ee,[J.specialFeatureOptins]:se,[J.purposeConsents]:se,[J.purposeLegitimateInterests]:se,[J.purposeOneTreatment]:ee,[J.publisherCountryCode]:ie,[J.vendorConsents]:oe,[J.vendorLegitimateInterests]:oe,[J.publisherRestrictions]:re,segmentType:te,[J.vendorsDisclosed]:oe,[J.vendorsAllowed]:oe,[J.publisherConsents]:se,[J.publisherLegitimateInterests]:se,[J.numCustomPurposes]:te,[J.publisherCustomConsents]:se,[J.publisherCustomLegitimateInterests]:se}}class ce{1={[k.CORE]:[J.version,J.created,J.lastUpdated,J.cmpId,J.cmpVersion,J.consentScreen,J.consentLanguage,J.vendorListVersion,J.purposeConsents,J.vendorConsents]};2={[k.CORE]:[J.version,J.created,J.lastUpdated,J.cmpId,J.cmpVersion,J.consentScreen,J.consentLanguage,J.vendorListVersion,J.policyVersion,J.isServiceSpecific,J.useNonStandardStacks,J.specialFeatureOptins,J.purposeConsents,J.purposeLegitimateInterests,J.purposeOneTreatment,J.publisherCountryCode,J.vendorConsents,J.vendorLegitimateInterests,J.publisherRestrictions],[k.PUBLISHER_TC]:[J.publisherConsents,J.publisherLegitimateInterests,J.numCustomPurposes,J.publisherCustomConsents,J.publisherCustomLegitimateInterests],[k.VENDORS_ALLOWED]:[J.vendorsAllowed],[k.VENDORS_DISCLOSED]:[J.vendorsDisclosed]}}class le{1=[k.CORE];2=[k.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this[2].push(k.PUBLISHER_TC);else{const n=!(!t||!t.isForVendors);n&&!0!==e[J.supportOOB]||this[2].push(k.VENDORS_DISCLOSED),n&&(e[J.supportOOB]&&e[J.vendorsAllowed].size>0&&this[2].push(k.VENDORS_ALLOWED),this[2].push(k.PUBLISHER_TC))}}}class ue{static fieldSequence=new ce;static encode(e,t){let n;try{n=this.fieldSequence[String(e.version)][t]}catch(n){throw new j(`Unable to encode version: ${e.version}, segment: ${t}`)}let s="";t!==k.CORE&&(s=te.encode(Y.KEY_TO_ID[t],Z.segmentType));const i=ae();return n.forEach((n=>{const r=e[n],o=i[n];let a=Z[n];void 0===a&&this.isPublisherCustom(n)&&(a=Number(e[J.numCustomPurposes]));try{s+=o.encode(r,a)}catch(e){throw new j(`Error encoding ${t}->${n}: ${e.message}`)}})),z.encode(s)}static decode(e,t,n){const s=z.decode(e);let i=0;n===k.CORE&&(t.version=te.decode(s.substr(i,Z[J.version]),Z[J.version])),n!==k.CORE&&(i+=Z.segmentType);const r=this.fieldSequence[String(t.version)][n],o=ae();return r.forEach((e=>{const n=o[e];let r=Z[e];if(void 0===r&&this.isPublisherCustom(e)&&(r=Number(t[J.numCustomPurposes])),0!==r){const o=s.substr(i,r);if(t[e]=n===oe?n.decode(o,t.version):n.decode(o,r),Number.isInteger(r))i+=r;else{if(!Number.isInteger(t[e].bitLength))throw new M(e);i+=t[e].bitLength}}})),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class de{static processor=[e=>e,(e,t)=>{e.publisherRestrictions.gvl=t,e.purposeLegitimateInterests.unset(1);const n=new Map;return n.set("legIntPurposes",e.vendorLegitimateInterests),n.set("purposes",e.vendorConsents),n.forEach(((n,s)=>{n.forEach(((i,r)=>{if(i){const i=t.vendors[r];if(!i||i.deletedDate)n.unset(r);else if(0===i[s].length)if("legIntPurposes"===s&&0===i.purposes.length&&0===i.legIntPurposes.length&&i.specialPurposes.length>0);else if(e.isServiceSpecific)if(0===i.flexiblePurposes.length)n.unset(r);else{const t=e.publisherRestrictions.getRestrictions(r);let i=!1;for(let e=0,n=t.length;e0&&t?.version<=this.processor.length?e.version=t.version:e.version=this.processor.length;const s=e.version-1;if(!this.processor[s])throw new j(`Invalid version: ${e.version}`);return this.processor[s](e,n)}}class pe{static absCall(e,t,n,s){return new Promise(((i,r)=>{const o=new XMLHttpRequest;o.withCredentials=n,o.addEventListener("load",(()=>{if(o.readyState==XMLHttpRequest.DONE)if(o.status>=200&&o.status<300){let e=o.response;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}i(e)}else r(new Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))})),o.addEventListener("error",(()=>{r(new Error("error"))})),o.addEventListener("abort",(()=>{r(new Error("aborted"))})),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=s,o.ontimeout=()=>{r(new Error("Timeout "+s+"ms "+e))},o.send(t)}))}static post(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.absCall(e,JSON.stringify(t),n,s)}static fetch(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.absCall(e,null,t,n)}}class he extends W{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new q;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new H("Invalid baseUrl! You may not pull directly from vendorlist.consensu.org and must provide your own cache");e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.baseUrl_=e}static get baseUrl(){return this.baseUrl_}static latestFilename="vendor-list.json";static versionedFilename="archives/vendor-list-v[VERSION].json";static languageFilename="purposes-[LANG].json";readyPromise;gvlSpecificationVersion;vendorListVersion;tcfPolicyVersion;lastUpdated;purposes;specialPurposes;features;specialFeatures;isReady_=!1;vendors_;vendorIds;fullVendorList;byPurposeVendorMap;bySpecialPurposeVendorMap;byFeatureVendorMap;bySpecialFeatureVendorMap;stacks;lang_;isLatest=!1;constructor(e){super();let t=he.baseUrl;if(this.lang_=he.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!t)throw new H("must specify GVL.baseUrl before loading GVL json");if(e>0){const n=e;he.CACHE.has(n)?(this.populate(he.CACHE.get(n)),this.readyPromise=Promise.resolve()):(t+=he.versionedFilename.replace("[VERSION]",String(n)),this.readyPromise=this.fetchJson(t))}else he.CACHE.has(he.LATEST_CACHE_KEY)?(this.populate(he.CACHE.get(he.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(t+he.latestFilename))}}static emptyLanguageCache(e){let t=!1;return void 0===e&&he.LANGUAGE_CACHE.size>0?(he.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(he.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(he.CACHE.delete(e),t=!0):void 0===e&&(he.CACHE=new Map,t=!0),t}cacheLanguage(){he.LANGUAGE_CACHE.has(this.lang_)||he.LANGUAGE_CACHE.set(this.lang_,{purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks})}async fetchJson(e){try{this.populate(await pe.fetch(e))}catch(e){throw new H(e.message)}}getJson(){return JSON.parse(JSON.stringify({gvlSpecificationVersion:this.gvlSpecificationVersion,vendorListVersion:this.vendorListVersion,tcfPolicyVersion:this.tcfPolicyVersion,lastUpdated:this.lastUpdated,purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks,vendors:this.fullVendorList}))}async changeLanguage(e){const t=e.toUpperCase();if(!he.consentLanguages.has(t))throw new H(`unsupported language ${e}`);if(t!==this.lang_)if(this.lang_=t,he.LANGUAGE_CACHE.has(t)){const e=he.LANGUAGE_CACHE.get(t);for(const t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{const t=he.baseUrl+he.languageFilename.replace("[LANG]",e);try{await this.fetchJson(t),this.cacheLanguage()}catch(e){throw new H("unable to load language: "+e.message)}}}get language(){return this.lang_}isVendorList(e){return void 0!==e&&void 0!==e.vendors}populate(e){this.purposes=e.purposes,this.specialPurposes=e.specialPurposes,this.features=e.features,this.specialFeatures=e.specialFeatures,this.stacks=e.stacks,this.isVendorList(e)&&(this.gvlSpecificationVersion=e.gvlSpecificationVersion,this.tcfPolicyVersion=e.tcfPolicyVersion,this.vendorListVersion=e.vendorListVersion,this.lastUpdated=e.lastUpdated,"string"==typeof this.lastUpdated&&(this.lastUpdated=new Date(this.lastUpdated)),this.vendors_=e.vendors,this.fullVendorList=e.vendors,this.mapVendors(),this.isReady_=!0,this.isLatest&&he.CACHE.set(he.LATEST_CACHE_KEY,this.getJson()),he.CACHE.has(this.vendorListVersion)||he.CACHE.set(this.vendorListVersion,this.getJson())),this.cacheLanguage()}mapVendors(e){this.byPurposeVendorMap={},this.bySpecialPurposeVendorMap={},this.byFeatureVendorMap={},this.bySpecialFeatureVendorMap={},Object.keys(this.purposes).forEach((e=>{this.byPurposeVendorMap[e]={legInt:new Set,consent:new Set,flexible:new Set}})),Object.keys(this.specialPurposes).forEach((e=>{this.bySpecialPurposeVendorMap[e]=new Set})),Object.keys(this.features).forEach((e=>{this.byFeatureVendorMap[e]=new Set})),Object.keys(this.specialFeatures).forEach((e=>{this.bySpecialFeatureVendorMap[e]=new Set})),Array.isArray(e)||(e=Object.keys(this.fullVendorList).map((e=>+e))),this.vendorIds=new Set(e),this.vendors_=e.reduce(((e,t)=>{const n=this.vendors_[String(t)];return n&&void 0===n.deletedDate&&(n.purposes.forEach((e=>{this.byPurposeVendorMap[String(e)].consent.add(t)})),n.specialPurposes.forEach((e=>{this.bySpecialPurposeVendorMap[String(e)].add(t)})),n.legIntPurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].legInt.add(t)})),n.flexiblePurposes&&n.flexiblePurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].flexible.add(t)})),n.features.forEach((e=>{this.byFeatureVendorMap[String(e)].add(t)})),n.specialFeatures.forEach((e=>{this.bySpecialFeatureVendorMap[String(e)].add(t)})),e[t]=n),e}),{})}getFilteredVendors(e,t,n,s){const i=e.charAt(0).toUpperCase()+e.slice(1);let r;const o={};return r="purpose"===e&&n?this["by"+i+"VendorMap"][String(t)][n]:this["by"+(s?"Special":"")+i+"VendorMap"][String(t)],r.forEach((e=>{o[String(e)]=this.vendors[String(e)]})),o}getVendorsWithConsentPurpose(e){return this.getFilteredVendors("purpose",e,"consent")}getVendorsWithLegIntPurpose(e){return this.getFilteredVendors("purpose",e,"legInt")}getVendorsWithFlexiblePurpose(e){return this.getFilteredVendors("purpose",e,"flexible")}getVendorsWithSpecialPurpose(e){return this.getFilteredVendors("purpose",e,void 0,!0)}getVendorsWithFeature(e){return this.getFilteredVendors("feature",e)}getVendorsWithSpecialFeature(e){return this.getFilteredVendors("feature",e,void 0,!0)}get vendors(){return this.vendors_}narrowVendorsTo(e){this.mapVendors(e)}get isReady(){return this.isReady_}clone(){const e=new he(this.getJson());return this.lang_!==he.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class ve extends W{static consentLanguages=he.consentLanguages;isServiceSpecific_=!1;supportOOB_=!0;useNonStandardStacks_=!1;purposeOneTreatment_=!1;publisherCountryCode_="AA";version_=2;consentScreen_=0;policyVersion_=2;consentLanguage_="EN";cmpId_=0;cmpVersion_=0;vendorListVersion_=0;numCustomPurposes_=0;gvl_;created;lastUpdated;specialFeatureOptins=new X;purposeConsents=new X;purposeLegitimateInterests=new X;publisherConsents=new X;publisherLegitimateInterests=new X;publisherCustomConsents=new X;publisherCustomLegitimateInterests=new X;customPurposes;vendorConsents=new X;vendorLegitimateInterests=new X;vendorsDisclosed=new X;vendorsAllowed=new X;publisherRestrictions=new Q;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){he.isInstanceOf(e)||(e=new he(e)),this.gvl_=e,this.publisherRestrictions.gvl=e}get gvl(){return this.gvl_}set cmpId(e){if(e=Number(e),!(Number.isInteger(e)&&e>1))throw new G("cmpId",e);this.cmpId_=e}get cmpId(){return this.cmpId_}set cmpVersion(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new G("cmpVersion",e);this.cmpVersion_=e}get cmpVersion(){return this.cmpVersion_}set consentScreen(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new G("consentScreen",e);this.consentScreen_=e}get consentScreen(){return this.consentScreen_}set consentLanguage(e){this.consentLanguage_=e}get consentLanguage(){return this.consentLanguage_}set publisherCountryCode(e){if(!/^([A-z]){2}$/.test(e))throw new G("publisherCountryCode",e);this.publisherCountryCode_=e.toUpperCase()}get publisherCountryCode(){return this.publisherCountryCode_}set vendorListVersion(e){if((e=Number(e)>>0)<0)throw new G("vendorListVersion",e);this.vendorListVersion_=e}get vendorListVersion(){return this.gvl?this.gvl.vendorListVersion:this.vendorListVersion_}set policyVersion(e){if(this.policyVersion_=parseInt(e,10),this.policyVersion_<0)throw new G("policyVersion",e)}get policyVersion(){return this.gvl?this.gvl.tcfPolicyVersion:this.policyVersion_}set version(e){this.version_=parseInt(e,10)}get version(){return this.version_}set isServiceSpecific(e){this.isServiceSpecific_=e}get isServiceSpecific(){return this.isServiceSpecific_}set useNonStandardStacks(e){this.useNonStandardStacks_=e}get useNonStandardStacks(){return this.useNonStandardStacks_}set supportOOB(e){this.supportOOB_=e}get supportOOB(){return this.supportOOB_}set purposeOneTreatment(e){this.purposeOneTreatment_=e}get purposeOneTreatment(){return this.purposeOneTreatment_}setAllVendorConsents(){this.vendorConsents.set(this.gvl.vendors)}unsetAllVendorConsents(){this.vendorConsents.empty()}setAllVendorsDisclosed(){this.vendorsDisclosed.set(this.gvl.vendors)}unsetAllVendorsDisclosed(){this.vendorsDisclosed.empty()}setAllVendorsAllowed(){this.vendorsAllowed.set(this.gvl.vendors)}unsetAllVendorsAllowed(){this.vendorsAllowed.empty()}setAllVendorLegitimateInterests(){this.vendorLegitimateInterests.set(this.gvl.vendors)}unsetAllVendorLegitimateInterests(){this.vendorLegitimateInterests.empty()}setAllPurposeConsents(){this.purposeConsents.set(this.gvl.purposes)}unsetAllPurposeConsents(){this.purposeConsents.empty()}setAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.set(this.gvl.purposes)}unsetAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.empty()}setAllSpecialFeatureOptins(){this.specialFeatureOptins.set(this.gvl.specialFeatures)}unsetAllSpecialFeatureOptins(){this.specialFeatureOptins.empty()}setAll(){this.setAllVendorConsents(),this.setAllPurposeLegitimateInterests(),this.setAllSpecialFeatureOptins(),this.setAllPurposeConsents(),this.setAllVendorLegitimateInterests()}unsetAll(){this.unsetAllVendorConsents(),this.unsetAllPurposeLegitimateInterests(),this.unsetAllSpecialFeatureOptins(),this.unsetAllPurposeConsents(),this.unsetAllVendorLegitimateInterests()}get numCustomPurposes(){let e=this.numCustomPurposes_;if("object"==typeof this.customPurposes){const t=Object.keys(this.customPurposes).sort(((e,t)=>Number(e)-Number(t)));e=parseInt(t.pop(),10)}return e}set numCustomPurposes(e){if(this.numCustomPurposes_=parseInt(e,10),this.numCustomPurposes_<0)throw new G("numCustomPurposes",e)}updated(){const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));this.created=t,this.lastUpdated=t}}class ge{static encode(e,t){let n,s="";return e=de.process(e,t),n=Array.isArray(t?.segments)?t.segments:new le(e,t)[""+e.version],n.forEach(((t,i)=>{let r="";it&&(t=s)}return t/100}function ot(e,t){if(void 0===t&&(t={}),!e)return null;var n=0,s=1,i=rt(t);return 1===i||(Object.values(t).length&&i<1&&(n=i,s=1-i),Object.keys(e).sort().forEach((function(i){var r=e[i];t[i]={min:Math.trunc(100*n),max:Math.trunc(100*(n+r*s))},n+=r*s}))),t}function at(){return n(this,void 0,void 0,(function(){var e,t,n,i,r,o,a,l,u,d,p;return s(this,(function(s){switch(s.label){case 0:return e="latest",[4,F()];case 1:return t=s.sent(),n=t.siteInfo,i=t.bundleData,r="BT_BUNDLE_VERSION_"+n.websiteID,o="BT_DIGEST_VERSION_"+n.websiteID,!tt[n.websiteID]&&(null==i?void 0:i.bundles)&&(tt[n.websiteID]=i),a=function(e,t,n){if(void 0===n&&(n="latest"),!e)return null;if(!t||"object"!=typeof t||Object.keys(t).length<=0)return null;var s={},i=t[e],r=t[0],o=t.global;if((null==i?void 0:i.bundles)&&(s=ot(i.bundles)),(null==r?void 0:r.bundles)&&(s=ot(r.bundles,s)),(null==o?void 0:o.bundles)&&(s=ot(o.bundles,s)),Object.keys(s).length<=0)return null;var a=rt(s);return a<1&&(s[n]={min:Math.trunc(100*a),max:100}),s}(n.websiteID,tt,e),window.__bt_tag_d&&(window.__bt_tag_d.probabilities=a),!a||Object.keys(a).length<=0?[2,void 0]:(l=tt[n.websiteID]||tt[0]||tt.global)?(u=l.digest,c.localStorage.getItem(o)!=String(u)&&(c.localStorage.setItem(o,String(u)),c.localStorage.removeItem(r)),(d=c.localStorage.getItem(r))||(p=_(100),d=function(e,t){if("number"!=typeof e||e<0||e>100)return null;if(!t||"object"!=typeof t)return null;for(var n=Object.keys(t),s=0;se)return i}return null}(p,a)||e,c.localStorage.setItem(r,d)),[2,d===e?void 0:d]):[2]}}))}))}tt={};var ct=function(){function e(e,t,n,s,r){void 0===e&&(e={enabled:!1,script_loading_mode:"inject_from_tag_script",wall_mode:i.soft,allow_render_to_aa_users:!0}),this.rlinkSettings=e,this.scriptSrc=t,this.insertScript=n,this.widget=s,this.isAAEnabled=r}return e.prototype.load=function(){this.shouldLoadRLinkScript()&&(this.cacheRLinkSettings(),this.insertScript(this.scriptSrc,{type:"module"}),window.__bt_rlink_loaded_from_tag=!0)},e.prototype.preventRecovery=function(){var e=!this.rlinkSettings.allow_render_to_aa_users&&this.isAAEnabled,t=this.rlinkSettings.wall_mode===i.hard;return this.rlinkSettings.enabled&&t&&!e},e.prototype.isRecoveryAttributionValid=function(){var e=localStorage.getItem("BT_AM_ATTRIBUTION_EXPIRY");return!!e&&Date.now()v?h.substring(0,v):h)):(a=[10,13,25,28,32,52,69,76,91,755,815],o.cmpVersion=r.cmpVersion,o.gdprApplies=r.gdprApplies,o.tcfPolicyVersion=r.tcfPolicyVersion,o.tcString=r.tcString,r.gdprApplies&&(c={},Object.entries((null===(t=r.vendor)||void 0===t?void 0:t.consents)||{}).forEach((function(e){var t=e[0],n=e[1];a.includes(Number(t))&&(c[t]=n)})),Object.keys(c).length&&(o.vendor={consents:c}),o.purpose=r.purpose)),(d={})[xe]=!!i,l=d,u={tcData:o,pageURL:m.href,organizationID:parseInt(p),websiteID:parseInt(n.websiteID),clientVersion:g},[2,fetch(Ne("/ce",l),{method:"POST",body:E(u)})]}var h,v}))}))}({siteInfo:O,nlfDetected:x}),function(){try{history.pushState=(e=history.pushState,function(){var t=e.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationChange")),t}),history.replaceState=function(e){return function(){var t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationChange")),t}}(history.replaceState),window.addEventListener("popstate",(function(){window.dispatchEvent(new Event("locationChange"))}))}catch(e){}var e}(),c.addEventListener("locationChange",(function(){var e,t=u();t.search="";var n=t.toString().split("#")[0];(null===(e=c.__bt_intrnl.pageURL)||void 0===e?void 0:e.split("#")[0])!==n&&(c.__bt_intrnl.pageURL=t.toString(),D=a(),c.__bt_intrnl.traceID=D,w("BT_traceID",D),P={traceID:D,sessionID:R},Be({config:{siteInfo:O,checksum:T},bundleIDToLoad:M,isSPAViewChange:!0,aaDetectionResults:_,baitResults:L}))}))),j=function(e,t,n,s){var i=new URL("https://"+e);return i.pathname="recovery",i.searchParams.append("w",t),s&&i.searchParams.append("b",s),n&&n.split("&").forEach((function(e){var t=e.split("=");2==t.length&&t[0]&&t[1]&&i.searchParams.append(t[0],t[1])})),i.searchParams.append("upapi","true"),i.toString()}(h,O.websiteID,"",M),(H=new ct(V,f.script,dt,O.widget,U)).load(),G=H.preventRecovery(),!B||G?[3,5]:[4,Re(!1)];case 4:return(z=q.sent())||null===z?dt(j):(((null===(i=m.href)||void 0===i?void 0:i.includes("bt_debug=true"))||"true"===c.localStorage.getItem("bt_debug"))&&window.console&&(W=["%c[Blockthrough - WRN] %c[tag.js] %cConsentless user - do not load %crecovery %cscript","color: #000000; background-color: #FFE0B2","font-weight: bold;","color: #000000; background-color: inherit","font-weight: bold;","color: #000000; background-color: inherit"],window.console.info.apply(window.console,W)),(null===(o=null===(r=null==C?void 0:C.settings)||void 0===r?void 0:r.monetizeConsentlessUsers)||void 0===o?void 0:o._enabled)&&window===window.top&&($=function(e){var t=S()||c.location.href;return"https://brwsrfrm.com/i/script/"+e+"?ref="+new URL(t).origin}(O.websiteID),dt($,{crossOrigin:null}))),[3,6];case 5:pt({eventName:"AcceptableAdsInit",payload:{detail:!1}}),pt({eventName:"uponitInit",payload:{detail:!1}}),q.label=6;case 6:return[2]}}))}))})(),e.SAFE_TIMEOUT=lt,Object.defineProperty(e,"__esModule",{value:!0})}({});