var l=Object.defineProperty;var g=(c,i,e)=>i in c?l(c,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[i]=e;var a=(c,i,e)=>g(c,typeof i!="symbol"?i+"":i,e);const u="borlabs-cookie";class f{constructor(){a(this,"_pluginCookie",{consents:{essential:[]},domainPath:"",expires:"",uid:"",v3:!0,version:0});a(this,"_config",null);a(this,"fragments",document.createDocumentFragment())}init(i){let e=!1;this._config=i;const n=document.createEvent("Event");n.initEvent("borlabs-cookie-prioritized-code-unblocked",!0,!0);const t=this.getPluginCookie();t.version===this._config.settings.cookieVersion&&(e=!0),this._config.settings.cookiesForBots&&/bot|googlebot|crawler|spider|robot|crawling|lighthouse/i.test(navigator.userAgent.toLowerCase())===!0&&(e=!0),e&&(Object.entries(t.consents).forEach(([o,r])=>{for(const s of r)this._config.serviceGroups[o]===void 0||this._config.serviceGroups[o]!==void 0&&Object.values(this._config.serviceGroups[o].serviceIds).indexOf(s)===-1||this._config.services[s].settings!==void 0&&this._config.services[s].settings.prioritize!==void 0&&this._config.services[s].settings.prioritize==="1"&&(this.createNodes(this.b64DecodeToUnicode(this._config.services[s].optInCode)),this._config.services[s].optInCode="")}),document.getElementsByTagName("head")[0].appendChild(this.fragments),document.dispatchEvent(n))}b64DecodeToUnicode(i){return decodeURIComponent(Array.prototype.map.call(window.atob(i),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}createNodes(i){const e=i.split("<script");e.forEach((n,t)=>{if(n.indexOf("script>")!==-1){e[t]="<script"+n;const o=document.createElement("div"),r=document.createRange();r.selectNodeContents(o);const s=r.createContextualFragment(e[t]);o.appendChild(s),this.fragments.appendChild(o.firstElementChild)}})}findCookies(i){const e=[];let n=[];return document.cookie.length&&(n=document.cookie.split(";"),n.forEach(function(t){try{t=decodeURIComponent(t);const o=t.split("="),r=o[0]!==void 0?o[0].trim():"",s=o[1]!==void 0?o[1].trim():"";i===r&&e.push({name:r,value:s})}catch(o){console.log(o)}})),e}getPluginCookie(){let i=[];i=this.findCookies(u);for(let e=0,n=i.length;e<n;++e){const t=i[e];try{const o=JSON.parse(t.value);o.domainPath!==void 0&&o.v3!==void 0&&o.domainPath===this._config.settings.cookieDomain+this._config.settings.cookiePath&&(typeof o.version=="string"&&(o.version=parseInt(o.version)),this._pluginCookie={consents:o.consents,domainPath:o.domainPath,expires:o.expires,uid:o.uid,v3:o.v3,version:o.version})}catch(o){console.log(o)}}return this._pluginCookie}}window.BorlabsCookie=window.BorlabsCookie||{};window.BorlabsCookie.Unblock=window.BorlabsCookie.Unblock||{};window.BorlabsCookie.Unblock.unblockScriptBlockerId=function(c){console.log(`%cThe method 'window.BorlabsCookie.Unblock.unblockScriptBlockerId('${c}')' cannot be called when the service has 'Prioritize' enabled.`,"color: #f00")};const d=new f;window.BorlabsCookiePrioritizeHandle=d;d.init(window.borlabsCookieConfig);
