class ABTestJS{constructor(e,t=[]){this.COOKIE_PREFIX="hyper-exp",this.experiments={},this.newExperiments={},this.callbacks={set:[],setNew:[]},this.set(e,t)}push(e){e()}cookies(){let e=document.cookie.split("; "),t={};for(let i=0;i<e.length;i++){let o=e[i].split(/=(.+)/);t[o[0]]=o[1]}return{all:t,get:e=>t[e]?t[e]:null,set:(e,t)=>{document.cookie=`${e}=${t};path=/;SameSite=strict;`+("https:"===window.location.protocol?"secure;":"")}}}onSet(e){Object.values(this.experiments).forEach((t=>{e(t)})),this.callbacks.set.push(e)}onSetNew(e){Object.values(this.newExperiments).forEach((t=>{e(t)})),this.callbacks.setNew.push(e)}execCallbacks(e,t){for(const i of this.callbacks[e])i(t)}set(e,t=[]){if(!this.validate(e))throw new Error("Invalid experiment configuration!");const i=[];for(const o of e){if(o.tags&&!1===o.tags.some((e=>t.includes(e))))continue;let e=this.get(o.id),s={id:o.id,...o};const n=`${this.COOKIE_PREFIX}-${o.id}`;if(e)e={id:o.id,version:e,...o},localStorage.setItem(n,JSON.stringify(e.version)),this.execCallbacks("set",e);else{const t=this.chooseVersion(o.versions);localStorage.setItem(n,JSON.stringify(t)),this.cookies().set(n,JSON.stringify(t)),e={id:o.id,version:t,...s},this.execCallbacks("set",e),this.execCallbacks("setNew",e),this.newExperiments[o.id]=e}this.experiments[o.id]||(this.experiments[o.id]=e),i.push(e)}return i}get(e=null){if(null===e)return Object.values(this.experiments);const t=`${this.COOKIE_PREFIX}-${e}`,i=localStorage.getItem(t)||this.cookies().get(t);return i?JSON.parse(i):null}chooseVersion(e){const t=e.reduce(((e,t)=>e+t.weight),0),i=Math.random()*t;let o=0;for(const t of e)if(o+=t.weight,i<o)return t;return e[e.length-1]}validate(e){if(!Array.isArray(e))return!1;for(const t of e){if("object"!=typeof t||!t.id||"string"!=typeof t.id)return!1;if(!Array.isArray(t.versions)||0===t.versions.length)return!1;for(const e of t.versions)if("object"!=typeof e||!e.id||"string"!=typeof e.id||e.weight<1||e.weight>100)return!1}return!0}}!function(){"use strict";if(!window.ab_test_js||void 0===ab_test_js.experiments){let e=window.ab_test_js||[];window.ab_test_js=new ABTestJS([]),e.forEach((e=>{e()}))}}();class HyperCMP{constructor(e){this.TYPE_NONE=0,this.TYPE_FC=1,this.TYPE_DIDOMI=2,this.TYPE_DIDOMI_V2=3,this.TYPE_FC_V2=4,this.configs={},this.AB_TEST_NAME="cookie_consent",this.AB_VERSIONS={0:"none",1:"fc",2:"didomi",3:"didomi_v2",4:"fc_v2"},window.googlefc=window.googlefc||{},window.hyper_cmp=this,this.showFc=!0,e.forEach((e=>{e()}))}initFCMessage(){this.cmfPromise=new Promise((e=>{hyper_cmp.onload=e})),googlefc.controlledMessagingFunction=async function(e){await hyper_cmp.cmfPromise,e.proceed(hyper_cmp.showFc)}}push(e){e()}cookies(){let e=document.cookie.split("; "),t={};for(let i=0;i<e.length;i++){let o=e[i].split(/=(.+)/);t[o[0]]=o[1]}return{all:t,get:e=>t[e]?t[e]:null,set:(e,t)=>{document.cookie=`${e}=${t};path=/;SameSite=strict;`+("https:"===window.location.protocol?"secure;":"")}}}loadWinner(e){let t=localStorage.getItem(e)||this.cookies().get(e);return!!t&&JSON.parse(t)}run(e){if(this.initFCMessage(),this.configs={},e.forEach((e=>{this.configs[e.type]=e})),e.length>1)this.ab(e);else if(e.length>0){let t,i=0,o=100*Math.random(),s="cmp";e.forEach((e=>{i+=e.weight,s+=`|${e.type}_${e.weight}`,i>o&&(t=e)}));let n=this.loadWinner(s);t||(t={type:this.TYPE_NONE}),n&&(t=n),localStorage.setItem(s,JSON.stringify(t)),this.cookies().set(s,JSON.stringify(t)),this.execWinner(t)}}execWinner(e){switch(window.googletag=window.googletag||{cmd:[]},this.timeout&&clearTimeout(this.timeout),e.type){case this.TYPE_NONE:this.showFc=!1,this.timeout=setTimeout((()=>{this.onload&&this.onload()}),100);break;case this.TYPE_FC:case this.TYPE_FC_V2:this.showFc=!0,googletag.cmd.push((()=>{googletag.pubads().setTargeting("cp","v1f")}));let t=new MutationObserver((function(i){i.forEach((i=>{i.addedNodes.forEach((i=>{if(i.classList&&i.classList.contains("fc-consent-root")){t.disconnect(),t=null,e.config&&e.config.delay&&(()=>{let t=document.querySelectorAll(".fc-confirm-choices")[0];t&&t.click(),setTimeout((()=>{let e=setInterval((()=>{googlefc.showRevocationMessage&&(googlefc.showRevocationMessage(),clearInterval(e))}),10)}),1e3*e.config.delay)})();let i=document.querySelector(".fc-data-preferences-accept-all");i&&i.classList.replace("fc-secondary-button","fc-primary-button");let o=document.querySelector(".fc-confirm-choices");o&&o.classList.replace("fc-primary-button","fc-secondary-button");let s=document.querySelector("img.fc-header-image");hyper_cmp.switchLogo(s)}}))}))}));t.observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0}),this.onload&&this.onload();break;case this.TYPE_DIDOMI:case this.TYPE_DIDOMI_V2:if(this.showFc=!1,void 0===e.config||void 0===e.config.message_id)console.log("Bad CMP config");else{window.didomiOnReady=window.didomiOnReady||[],e.config.consent_on_scroll&&window.didomiOnReady.push((function(){window.addEventListener("scroll",(function e(){setTimeout((function(){var t=document.getElementById("didomi-notice-agree-button");t&&t.click(),window.removeEventListener("scroll",e)}),0)}))})),googletag.cmd.push((()=>{googletag.pubads().setTargeting("cp","v2d")})),window.gdprAppliesGlobally=!1,!function(e,t,i,o,s){function n(e,i,o,n){if("function"==typeof o){window[t]||(window[t]=[]);var c=!1;s&&(c=s(e,n,o)),c||window[t].push({command:e,version:i,callback:o,parameter:n})}}function c(t){if(window[e]&&!0===window[e].stub&&t.data){var s,n="string"==typeof t.data;try{s=n?JSON.parse(t.data):t.data}catch(e){return}if(s[i]){var c=s[i];window[e](c.command,c.version,(function(e,i){var s={};s[o]={returnValue:e,success:i,callId:c.callId},t.source.postMessage(n?JSON.stringify(s):s,"*")}),c.parameter)}}}n.stub=!0,n.stubVersion=2,"function"!=typeof window[e]&&(window[e]=n,window.addEventListener?window.addEventListener("message",c,!1):window.attachEvent("onmessage",c))}("__tcfapi","__tcfapiBuffer","__tcfapiCall","__tcfapiReturn"),function e(t){if(!window.frames[t])if(document.body&&document.body.firstChild){var i=document.body,o=document.createElement("iframe");o.style.display="none",o.name=t,o.title=t,i.insertBefore(o,i.firstChild)}else setTimeout((function(){e(t)}),5)}("__tcfapiLocator"),function(e,t){var i=document.createElement("link");i.rel="preconnect",i.as="script";var o=document.createElement("link");o.rel="dns-prefetch",o.as="script";var s=document.createElement("link");s.rel="preload",s.as="script";var n=document.createElement("script");n.id="spcloader",n.type="text/javascript",n.async=!0,n.charset="utf-8";var c="https://sdk.privacy-center.org/b6b98167-c5e2-4cff-a092-528bb1341d5f/loader.js?target_type=notice&target="+t;if(window.didomiConfig&&window.didomiConfig.user){var r=window.didomiConfig.user,a=r.country,l=r.region;a&&(c=c+"&country="+a,l&&(c=c+"&region="+l))}i.href="https://sdk.privacy-center.org/",o.href="https://sdk.privacy-center.org/",s.href=c,n.src=c;var d=document.getElementsByTagName("script")[0];d.parentNode.insertBefore(i,d),d.parentNode.insertBefore(o,d),d.parentNode.insertBefore(s,d),d.parentNode.insertBefore(n,d)}(0,e.config.message_id);let t=new MutationObserver((function(e){e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.classList&&e.classList.contains("didomi-notice-popup")){t.disconnect(),t=null;let e=document.querySelector("img.didomi-popup-notice-logo");hyper_cmp.switchLogo(e)}}))}))}));t.observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}this.onload&&this.onload()}}switchLogo(e){let t=document.querySelector(".shop-logo img, .detail-brochure-container__info-shop-img");if(t){let i=t.getAttribute("src")||t.getAttribute("data-src");if(e)e.setAttribute("src",i),e.style="object-fit:contain !important;";else{let e=document.querySelector(".fc-header h2");e&&(e.innerHTML='<div class="fc-site-macro-logo fc-header-image-container"><img class="fc-header-image" alt="'+e.innerText+'" src="'+i+'" style="object-fit:contain !important;"></div>')}}}ab(e){let t={id:this.AB_TEST_NAME,versions:[]},i=0;e.forEach((e=>{let o={id:this.AB_VERSIONS[e.type],weight:e.weight};t.id+="_"+e.weight,i+=e.weight,t.versions.push(o)})),i<100&&(this.configs[0]={type:0,weight:100-i},t.versions.push({id:this.AB_VERSIONS[0],weight:100-i})),window.ab_test_js=window.ab_test_js||[],ab_test_js.push((()=>{let e=ab_test_js.set([t])[0].version,i=this.configs[Object.keys(this.AB_VERSIONS)[Object.values(this.AB_VERSIONS).indexOf(e.id)]];this.execWinner(i)}))}}!function(){"use strict";if(!window.hyper_cmp||void 0===hyper_cmp.run){let e=window.hyper_cmp||[];window.hyper_cmp=new HyperCMP(e)}}();