import { a as a$3, j as j$1, g, q } from './chunk-PEG6YMOL.js';
import { a as a$1 } from './chunk-XWAVWJ7F.js';
import { a as a$2 } from './chunk-TI72QGO3.js';
import { a, c } from './chunk-ONOOT4BC.js';

var _=a(u=>{var y=a$1();u.createRoot=y.createRoot,u.hydrateRoot=y.hydrateRoot;});var e=c(a$2(),1),k=c(_(),1),h=c(a$3(),1);var n=c(a$2(),1);var U=({children:o})=>{let[a,i]=(0, n.useState)(),s=(0, n.useRef)(),[,l]=(0, n.useReducer)(d=>d+1,0);return (0, n.useEffect)(()=>{let d=sessionStorage.getItem("aesirx-analytics-uuid");d&&i(d);},[]),n.default.createElement(q.Provider,{value:{visitor_uuid:a,setUUID:i,ref:s,forceUpdate:l}},o)},f=U;var G=(0, e.lazy)(()=>import('./ConsentCustomSimple-W6DFUYRD.js')),L=(0, e.lazy)(()=>import('./OptInConsent-LOVTDRRQ.js')),j=(0, e.lazy)(()=>import('./dist-K3AO2NQA.js').then(o=>({default:o.AnalyticsContextProvider})));window.aesirxBuffer=h.Buffer;window["aesirx-consent-enable"]="true";var C=()=>{window.process={env:""};let[o,a]=(0, e.useState)(window.consentLayout??"simple-consent-mode"),[i,s]=(0, e.useState)(window.analyticsGtagId),[l,d]=(0, e.useState)(window.analyticsGtmId),[S,v]=(0, e.useState)(window.analyticsConsentText),[I,b]=(0, e.useState)(window.analyticsCookieText),[D,T]=(0, e.useState)(window.analyticsDetailText),[P,E]=(0, e.useState)(window.analyticsRejectText),[B,O]=(0, e.useState)(window.disabledBlockJSDomains);return (0, e.useEffect)(()=>{(async()=>{let t=await g(window.aesirx1stparty??"",window.location.host);if(t?.data?.gpc_support&&(window.disableGPCsupport=t?.data?.disable_gpc_support),t?.data?.gpc_consent==="opt-out"&&(window.aesirxOptOutMode="true"),t?.data?.gpc_consent_donotsell==="yes"&&(window.aesirxOptOutDoNotSell="true"),t?.data?.age_check&&(window.ageCheck=t?.data?.age_check),t?.data?.country_check&&(window.countryCheck=t?.data?.country_check),t?.data?.maximum_age&&(window.minimumAge=t?.data?.minimum_age),t?.data?.minimum_age&&(window.maximumAge=t?.data?.maximum_age),t?.data?.allowed_countries?.length&&(window.allowedCountries=t?.data?.allowed_countries),t?.data?.disallowed_countries?.length&&(window.disallowedCountries=t?.data?.disallowed_countries),t?.data?.geo_handling==="yes"){let A=t?.data?.geo_rules?.length?t?.data?.geo_rules?.map(r=>({geo_rules_language:r?.language,geo_rules_logic:r?.logic,geo_rules_consent_mode:r?.consent_mode,geo_rules_timezone:r?.timezone,geo_rules_override:r?.override_field})):[];window.geoRules=A;}a(t?.data?.template??window.consentLayout),s(t?.data?.gtag_id??window.analyticsGtagId),d(t?.data?.gtm_id??window.analyticsGtmId),v(t?.data?.consent_text??window.analyticsConsentText),b(t?.data?.cookie_text??window.analyticsCookieText),T(t?.data?.detail_text??window.analyticsDetailText),E(t?.data?.reject_text??window.analyticsRejectText),O(t?.data?.disabled_block_domains??window.disabledBlockJSDomains);})();},[]),e.default.createElement(f,null,e.default.createElement(e.Suspense,{fallback:null},e.default.createElement(G,{endpoint:window.aesirx1stparty??"",networkEnv:window.concordiumNetwork??"",aesirXEndpoint:window.aesirxEndpoint??"https://api.aesirx.io",languageSwitcher:window.languageSwitcher??"",modeSwitcher:window.modeSwitcher??"",gtagId:i,gtmId:l,layout:o,customConsentText:S,customCookieText:I,customDetailText:D,customRejectText:P,disabledBlockDomains:B})))},x={},z=()=>{let o=async()=>{if(document.readyState==="complete"){navigator?.globalPrivacyControl&&window.disableGPCsupport!=="true"&&window?.__uspapi&&window?.__uspapi("setGPCSignal",1,function(s){console.log("GPC signal registered in IAB USP API:",s);});let a=document.body?.appendChild(document.createElement("DIV"));x=(0, k.createRoot)(a);let i=window.optInConsentData?JSON.parse(window?.optInConsentData)?.some(s=>Object.keys(s).includes("replaceAnalyticsConsent")):!1;window.disableAnalyticsConsent!=="true"&&x?.render(e.default.createElement(e.default.Fragment,null,i?e.default.createElement(e.default.Fragment,null):e.default.createElement(e.default.Fragment,null,window["aesirx-analytics-enable"]==="true"?e.default.createElement(j,null,e.default.createElement(C,null)):e.default.createElement(C,null)),window.optInConsentData&&e.default.createElement(e.Suspense,{fallback:null},e.default.createElement(L,null))));}};document.addEventListener("readystatechange",o,!0),o();};z();var F={_providersToBlock:[...window.aesirxBlockJSDomains?.length?[...window.aesirxBlockJSDomains?.filter(o=>o)?.map(o=>({re:o?.domain,categories:[o?.category]}))]:[]],categories:[],_shortCodes:[{key:"video_placeholder",content:'<div class="video-placeholder-normal" data-aesirx-tag="video-placeholder" id="[UNIQUEID]"><p class="video-placeholder-text-normal" data-aesirx-tag="placeholder-title">Please accept consent to access this content</p></div>',tag:"",status:!0,attributes:[]}],_backupNodes:[]};window.configBlockJS=F;var M=new MutationObserver(j$1);M.observe(document.documentElement,{childList:!0,subtree:!0});
/*
 * @copyright   Copyright (C) 2022 AesirX. All rights reserved.
 * @license     GNU General Public License version 3, see LICENSE.
 */
