var CpexPackage=function(){"use strict";("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"3.7.4"};let e=Date.now();function t(){return window.cpexPackage||window.cpexPackageFormats}function i(e){(e=[].slice.call(e)).unshift("display: inline-block; color: #fff; background: #555; padding: 1px 4px; border-radius: 3px;");e.unshift("%cCPEx Package");return e}function s(e){return e?JSON.parse(JSON.stringify(e)):e}function n(){if(t().debugMode){const t=Date.now();Array.prototype.push.call(arguments,t-e);e=t;console.log.apply(this,i(arguments))}}function d(e){console.log("%cCPEx Package%c "+e,"display: inline-block; color: #fff; background: #555; padding: 1px 4px; border-radius: 3px;","font-size: 15px; padding-top: 10px; font-weight: bold; border-bottom: none")}function a(){console.warn.apply(this,i(arguments))}function r(e,s){s instanceof Error?s.message=e+", reason: "+s.message:s=new Error(e||"missing error message");const n=t();window.Sentry&&!0===n.settingsLoaded&&window.Sentry.captureException(s);console.error.apply(this,i(arguments));return s}function o(e){return"object"==typeof e&&null!==e&&!1===Array.isArray(e)}function c(e){return Array.isArray(e)&&e.length>0}function l(e){return!!o(e)&&o(e.ball)}function h(e,t){const i=new RegExp(t+"=(?[^a-zA-Z]+)(/| )","gm").exec(e);if(i&&i.groups)return i.groups.value}function g(e){const t=e.match(//m);if(t&&t.groups)return t.groups.value}function p(e,t){return new Promise(((i,s)=>{if("string"!=typeof e){n("LoadScript: URL for "+t+" not given, is it intentional?");return i()}const d=document.createElement("script");d.onload=()=>{i()};d.onerror=e=>{s(e)};d.src=e;document.head.appendChild(d)}))}function m(e){const t=document.createElement("style");t.innerHTML=e;document.head.appendChild(t);return t}function u(e,t){if("object"!=typeof e||"object"!=typeof t)return!1;for(const i in t)I(t[i])?e[i]=t[i]:t.hasOwnProperty(i)&&(i in e?"object"!=typeof e[i]||"object"!=typeof t[i]||e[i].concat&&t[i].concat?e[i]=t[i]:e[i]=u(e[i],t[i]):e[i]=t[i]);return e}function f(){window.gdprAppliesGlobally=!0;!function(e,t,i,s,n){function d(e,i,s,d){if("function"!=typeof s)return;window[t]||(window[t]=[]);let a=!1;n&&(a=n(e,d,s));a||window[t].push({command:e,version:i,callback:s,parameter:d})}d.stub=!0;d.stubVersion=2;function a(t){if(!window[e]||!0!==window[e].stub)return;if(!t.data)return;const n="string"==typeof t.data;let d;try{d=n?JSON.parse(t.data):t.data}catch(a){return}if(d[i]){const r=d[i];function o(e,i){const d={};d[s]={returnValue:e,success:i,callId:r.callId};t.source.postMessage(n?JSON.stringify(d):d,"*")}window[e](r.command,r.version,o,r.parameter)}}if("function"!=typeof window[e]){window[e]=d;window.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)}}("__tcfapi","__tcfapiBuffer","__tcfapiCall","__tcfapiReturn");!function e(t){if(!window.frames[t])if(document.body&&document.body.firstChild){const e=document.createElement("iframe");e.style.display="none";e.name=t;e.title=t;document.body.insertBefore(e,document.body.firstChild)}else setTimeout((function(){e(t)}),5)}("__tcfapiLocator")}function w(e,t){let i=document.getElementById(e);if(!i)return a("Element not found",i);const s=i.getAttribute("data-target-id-moved");document.getElementById(s)&&(i=document.getElementById(s));if(i){let e,s,n,d=i.getElementsByClassName("debugTags")[0];if(d){e=d.children[0];s=i.getElementsByClassName("regularTags")[0];n=i.getElementsByClassName("extraTags")[0]}else{d=document.createElement("div");d.classList.add("debugTags");d.style.cssText="position: relative; display: block; height: 0px";i.prepend(d);e=document.createElement("div");e.style.cssText="position: absolute; top: 0px; left: 0px; padding: 10px; z-index: 214748365";d.appendChild(e);s=document.createElement("span");s.classList.add("regularTags");e.appendChild(s);n=document.createElement("span");n.classList.add("extraTags");e.appendChild(n)}for(const[e,i]of Object.entries(t)){const t=document.createElement("span");switch(e){case"hb":t.innerHTML="HB, bidder: "+i.bidder+", cpm: "+Math.round(100*i.cpm)/100+", size: "+i.size+"";i.hbkey&&(t.innerHTML+=", hbKey: "+i.hbkey);t.style.cssText="color: black; font-size: 8px; display: inline-block; padding: 4px; margin: 1px; border-radius: 3px; background: #1a73e8; color: #fff; box-shadow: 0px 0px 2px #888A";n.appendChild(t);break;case"json":t.innerHTML="JSON";t.style.cssText="color: black; font-size: 8px; display: inline-block; padding: 4px; margin: 1px; border-radius: 3px; background: #8fe81a; color: #fff; box-shadow: 0px 0px 2px #888A";n.appendChild(t);break;case"customType":if(!n.querySelector(".customType")){t.innerHTML="CPEx Format: "+i+"";t.style.cssText="color: black; font-size: 8px; display: inline-block; padding: 4px; margin: 1px; border-radius: 3px; background: #ee2024; color: #fff; box-shadow: 0px 0px 2px #888A";t.classList.add("customType");n.appendChild(t)}break;default:t.innerHTML=e+": "+i+"";t.style.cssText="color: black; font-size: 8px; display: inline-block; padding: 4px; margin: 1px; border-radius: 3px; background: #eee; box-shadow: 0px 0px 2px #888A";s.appendChild(t)}}}}function b(){return navigator.userAgent.match(/Mobi/)}function v(){return new Promise((e=>"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e))).catch((e=>r("DOM loaded failed",e)))}function y(e,t,i){const s=document.createElement("iframe");s.style.cssText="border:none; display:block; overflow:hidden; border:none; margin:auto;";e.appendChild(s);"function"==typeof i&&(s.onload=()=>{i(s)});Object.assign(s,t);s.setAttribute("scrolling","no");s.setAttribute("marginwidth","0");s.setAttribute("marginheight","0");return s}function A(e,t){e.open("text/html","replace");e.write(t);e.close()}function x(e){if(document.getElementById(e)){const t=document.getElementById(e).children;for(const e of t)e.classList.contains("debugTags")||(e.style.display="none")}}function I(e){return e instanceof Element}function S(e){const t=document.createElement("img");t.setAttribute("src",e);t.style.width="1px";t.style.height="1px";t.style.position="absolute";t.style.bottom="0px";t.style.right="0px";t.style.border="none";document.body.appendChild(t)}function C(e){return decodeURIComponent(window.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}function k(e,t){return e.replace(/\${(.*?)}/g,((e,i)=>t[i]))}function E(e,t){return e.length>t?e.substring(0,t)+"...":e}function T(e,t,i){return k(t,{link:e.link.url,title:E(e.assets[0].title.text,i?.titleLength||45),desc:E(e.assets[1].data.value,i?.descLength||90),img:e.assets[2].img.url,sponsor:""})}function L(e){function t(e){e&&(Array.isArray(e)?e.forEach((e=>{S(e)})):"string"==typeof e&&S(e))}e.measurePixel&&t(e.measurePixel);if(e.data.native){e.data.native.impressionTrackers&&t(e.data.native.impressionTrackers);e.data.native.javascriptTrackers&&t(e.data.native.javascriptTrackers)}}function B(){return!("object"!=typeof window.pbjs||!window.pbjs.version)}function P(e,t,i){const s=document.createElement(e);Object.assign(s,i);void 0!==i&&i.class&&s.setAttribute("class",i.class);return t.appendChild(s)}class j{constructor(e){this.main=e;this.loaded=!1;this.main.settings.cmp.enabled?this.addDidomi():window.__tcfapi||f()}addDidomi(){if(window.Didomi){a("CMP: Didomi already present");this.loaded=!0}else if(window.__tcfapi){a("CMP: Generic CMP already present");this.loaded=!0}else{f();p("https://sdk.privacy-center.org/"+"9a8e2159-3781-4da1-9590-fbf86806f86e"+"/loader.js?target="+(this.main.localhost?"cpex.cz":document.location.hostname),"Didomi loader for SDK");window.didomiOnReady=window.didomiOnReady||[];window.didomiOnReady.push((()=>{this.loaded=!0;n("CMP: Didomi loaded");!1===window.Didomi.isTCFEnabled()&&r("TCF compliance disabled in Didomi console");this.fireConsentPixels();this.addCloseButton()}))}}fireConsentPixels(e){window.didomiEventListeners.push({event:"consent.changed",listener:()=>{this.fireConsentPixels(!0)}});const t=window.localStorage.getItem("pixelsLastFired")||0,i=Date.now();i-864e5>t||e?Array.isArray(this.main.settings.cmp.pixelList)&&window.__tcfapi("addEventListener",2,((e,t)=>{if(!1!==t&&e.vendor.consents)if(Object.keys(e.vendor.consents).length>0){this.main.settings.cmp.pixelList.forEach((t=>{S(t.replace("%CONSENT%",e.tcString))}));window.localStorage.setItem("pixelsLastFired",i);n("CMP: Added consent pixels")}else a("CMP: Missing consent for calling pixels")})):n("CMP: 24 hours have not yet passed, based on pixelsLastFired in local storage")}addCloseButton(){if(void 0!==window.cpexCmpAllowCloseButton||-1!==window.location.href.indexOf("cpexCmpAllowCloseButton")){const e=document.getElementById("didomi-notice")||document.getElementsByClassName("didomi-popup-notice-logo-container")[0];if(e){const t=document.createElement("div");t.textContent="×";t.style.cssText="position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; cursor: pointer; font-size: 20pt; text-align: center; line-height: 40px;";t.addEventListener("click",(function(){window.Didomi.notice.hide()}));e.appendChild(t)}}}}class M{constructor(e){this.main=e;this.dependenciesLoading=!1;this.adapter="googletag";this.displayed=!1;this.slots=[]}load(){n("Adserver: GoogleTag adapter loading");this.pubAdsReady=new Promise((e=>{const t=setInterval((()=>{if(window.googletag.pubadsReady){clearInterval(t);e()}}),100)}));const e=[this.pubAdsReady];window.googletag=window.googletag||{cmd:[]};if(this.main.settings.adserver.loadPrerequisites&&!0!==this.dependenciesLoading){this.dependenciesLoading=!0;if(window.googletag&&"function"==typeof window.googletag.getVersion)a("Adserver: GPT already present, version: ",window.googletag.getVersion());else{const t=p("https://securepubads.g.doubleclick.net/tag/js/gpt.js","GPT").then((()=>{window.googletag.cmd.unshift((()=>{window.googletag.pubads().disableInitialLoad()}))}));e.push(t)}e.push(new Promise(((e,t)=>{window.googletag.cmd.push((()=>{window.googletag.pubads().disableInitialLoad();window.googletag.pubads().enableSingleRequest();window.googletag.pubads().enableAsyncRendering();window.googletag.enableServices();this.dependenciesLoading=!1;e()}))})).catch((e=>r("Googletag que init failed",e))))}if(this.main.settings.adserver.defineSlots){window.googletag.cmd.push((()=>{window.googletag.destroySlots()}));this.slotsDefined=new Promise(((e,t)=>{this.main.settings.adserver.defineSlots.forEach((e=>{document.getElementById(e.elementId)?window.googletag.cmd.push((()=>{window.googletag.defineSlot(e.path,e.sizes,e.elementId).addService(window.googletag.pubads())})):n(e.elementId+" not found in the page, probably intended")}));window.googletag.cmd.push((()=>{e()}))}));e.push(this.slotsDefined)}this.loading=Promise.all(e).then((()=>{n("Adserver: Googletag adapter loaded")})).catch((e=>r("Googletag failed to load",e)));return this.loading}async getAdsList(){await this.loading;return window.googletag.pubads().getSlots().map((e=>e.getSlotElementId()))}async call(){await this.loading;this.main.debugMode&&this.logSlotTable();this.eventHandler&&window.googletag.pubads().removeEventListener("slotRenderEnded",this.eventHandler);window.googletag.pubads().getSlots().forEach((e=>{const t=e.getSlotElementId();!1===this.displayed&&window.googletag.display(t);this.main.headerbidding&&B()&&this.addBid(t,e);this.main.regularAds[t]={element:document.getElementById(t),slot:e};this.slots[e.getAdUnitPath()]=e}));this.eventHandler=e=>this.adRenderDebug(e);window.googletag.pubads().addEventListener("slotRenderEnded",this.eventHandler);n("Adserver: GoogleTag display/refresh called");window.googletag.pubads().refresh();this.displayed=!0}async getElementId(e){return(await this.getAdsList()).includes(e)?e:null}adRenderDebug(e){if(this.main.debugMode){const t=e.slot.getSlotElementId();n("AdServer: googletag rendered into elementId "+t,e);setTimeout((()=>{this.prepareMetaData(t,e)}),1e3)}}addBid(e,t){const i=window.pbjs.getHighestCpmBids(e)[0];if(i){t.setTargeting("hb_pb_"+i.bidder,i.adserverTargeting.hb_pb.toString());t.setTargeting("pos",t.getAdUnitPath())}}gamReRender(e){const t=e.split("/");2===t.length&&r("GAM returns only id part of path, this suggests that defineSlot names dont match. First slot will be used");const i=t[t.length-1],s=Object.keys(this.slots).filter((e=>-1!==e.indexOf(i)));if(s.length>0){const e=this.slots[s[0]];e.fromHB=!0;const t=e.getSlotElementId();this.main.headerbidding.reRender(t)}else r("Adserver: Slot not found")}prepareMetaData(e,t){const i={adapter:this.adapter,id:e,size:t.size,creativeId:t.creativeId};this.main.customAds[e]&&(i.customType=this.main.customAds[e].type);w(e,i)}logSlotTable(){const e=window.googletag.pubads().getSlots();if(e.length>0){d("Adserver: Found these GAM slots:");const t=[];e.forEach((e=>{let i="";e.getSizes().forEach((e=>{i+=`[${e.width},${e.height}], `}));t.push({path:e.getAdUnitPath(),element:e.getSlotElementId(),sizes:i.slice(0,-2)})}));console.table(t)}else a("Adserver: No GAM slots found")}}class R{constructor(e){this.adapter="sastracker";this.main=e;this.dependenciesLoading=!1;this.areaKey=e.settings.adserver.areaKey||"area";this.debugRenderAttempts=0;window.top.sasTracker=window.top.sasTracker||{};window.top.sasTracker.que=window.top.sasTracker.que||[]}load(){n("AdServer: SAStracker adapter loading");this.domLoaded=v();"vlm"===this.main.settings.publisher.code&&window.addEventListener("cpexAdRendered",(e=>{e.detail.element.dataset.loaded=!0}));if(this.main.settings.adserver.loadPrerequisites&&!0!==this.dependenciesLoading){this.dependenciesLoading=!0;if(window.postscribe){a("Adserver: Postscribe already present");this.postscribeLoaded=Promise.resolve()}else this.postscribeLoaded=p("https://cdn.cpex.cz/package/prerequisites/postscribe.min.js","Postscribe").then((()=>{this.dependenciesLoading=!1}));this.loading=Promise.all([this.domLoaded,this.postscribeLoaded]).catch((e=>r("Loading requirements failed",e)))}else this.loading=this.domLoaded;this.loading.then((()=>{n("AdServer: SAStracker adapter loaded")}));return this.loading}async getAdsList(){const e=[];for(const t in window.AdsObject)"ball"!==t&&e.push(window.AdsObject[t][this.areaKey]);return e}async call(e){await this.loading;if(this.main.settings.adserver.delayCall){n("AdServer: Adserver call delayed by "+this.main.settings.adserver.delayCall);await new Promise((e=>setTimeout(e,this.main.settings.adserver.delayCall))).catch((e=>r("Delay timeout failed",e)))}if(!l(window.AdsObject))return r("AdServer: Missing window.AdsObject or ball property on it, call will fail");let t;if(c(e)){t=s(window.AdsObject);window.AdsObject=Object.fromEntries(Object.entries(window.AdsObject).filter((([t,i])=>e.includes(i[this.areaKey]))));window.AdsObject.ball=t.ball}this.main.settings.adserver.addConsent&&await this.addConsent();if(this.main.headerbidding&&B()){this.addBids();window.dispatchEvent(new window.Event("cpexBidsAdded"))}if(window.iinfo)window.iinfo.adverts.sas.sas.onCpexSasTrackerTrack();else if("echo"!==this.main.settings.publisher.code){"function"==typeof window.top.sasTracker.track?window.top.sasTracker.track():window.top.sasTracker.que.push((()=>{window.top.sasTracker.track()}));n("AdServer: SAS called with this AdsObject: ",window.AdsObject)}t&&(window.AdsObject=t)}async getElementId(e){return(await this.getAdsList()).includes(e)?e:null}adRenderDebug(e,t){if(this.main.debugMode)if(window.top.sasTracker.rr&&window.top.sasTracker.rr[e]&&document.getElementById(e)){const i=window.top.sasTracker.rr[e];n("AdServer: SAS rendered this ad:",i);"{"===i.res[0]&&(t.json=!0);const s=document.getElementById(e).getAttribute("data-target-id-moved");document.getElementById(s)&&(e=s);this.prepareMetaData(e,t,i.res)}else if(this.debugRenderAttempts<=5){this.debugRenderAttempts++;setTimeout((()=>{this.adRenderDebug(e,t)}),250)}}async refresh(e){if(!l(window.AdsObject)){r("AdServer: Missing window.AdsObject or ball property on it, call will fail");return!1}this.main.headerbidding&&await this.main.headerbidding.refresh(e);this.call(e);n("AdServer: SAS refreshed with this AdsObject: ",window.AdsObject);return!0}isFromHB(e){return g(e)?.includes("HB")}render(e,t,i,s){n(`AdServer: SAStracker returned creative for ${e}, size: ${i}x${s}`);i=parseInt(i);s=parseInt(s);const d=this.isFromHB(t),a=parseInt(h(t,"SASF_ADVERTISERID"));try{setTimeout((()=>{this.adRenderDebug(e,{width:i,height:s,fromHB:d,sspId:a})}),250)}catch(e){console.error("Debug tags failed to render",e)}const r=!Object.values(this.main.settings.adserver.allowedSSPs).map((e=>parseInt(e))).includes(a);if(d||r){this.main.regularAds[e]={element:document.getElementById(e)};return!1}return this.main.render(e,t,i,s)}addBids(){for(const e in window.AdsObject){if("ball"===e)continue;const t=window.AdsObject[e],i=window.pbjs.getHighestCpmBids(t[this.areaKey])[0];if(i){t.hbid=i.cpm;t.bidTier=i.adserverTargeting.hb_pb;t.hbid_v=this.main.settings.adserver.bidderTable[i.bidderCode]||"unknown";t.bidderCode=i.bidderCode;i.size&&(t.bidderSize=i.size);i.dealId&&(t.bidDealId=i.dealId)}else["hbid","bidTier","hbid_v","bidderCode","bidderSize","bidDealId"].forEach((e=>delete t[e]))}const e=window.pbjs.getUserIds();e.pubcid&&(window.AdsObject.ball.pcid=e.pubcid);e.id5id&&(window.AdsObject.ball.id5=e.id5id.uid);this.main.ab.group&&this.main.ab.sasKey&&(window.AdsObject.ball[this.main.ab.sasKey]=this.main.ab.group)}addConsent(){return new Promise(((e,t)=>{try{window.__tcfapi("addEventListener",2,((i,s)=>{if(s&&i&&i.tcString){window.AdsObject.ball.gdpr="1";window.AdsObject.ball.consent=i.tcString;e()}else t()}))}catch(e){r("AdServer: CMP not responding properly",e);t(e)}}))}prepareMetaData(e,t,i){const s={adapter:"sasTracker "+window.sasTracker.version?.substring(0,3),id:e+", fcid: "+h(i,"SASF_FCID"),size:t.width+"x"+t.height,sspId:t.sspId};t.json&&(s.json=!0);this.main.customAds[e]&&(s.customType=this.main.customAds[e].type);w(e,s)}}class O{constructor(e){this.main=e;this.adapter="sasic"}load(){n("Adserver: Sasic adapter loading");this.loading=v();this.loading.then((()=>{n("Adserver: Sasic adapter loaded")}));window._sasic_queue.push(["customRender",e=>{const t=h(e.code,"SASF_WIDTH"),i=h(e.code,"SASF_HEIGHT");return this.render(e.elementId,e.code,t,i)}]);return this.loading}async getAdsList(){return window._sasic.getAllPositions().map((e=>e.options.hb_key)).filter((e=>!!e))}async call(){await this.loading;const e={};if(B())for(const t of await this.getAdsList()){const i=window.pbjs.getHighestCpmBids(t)[0];i&&(e[i.adUnitCode]={hbid:i.cpm,hbid_v:this.main.settings.adserver.bidderTable[i.bidderCode]||"unknown"})}window._sasic_queue.push(["loadAllHb",e]);n("AdServer: SAS called with these AdUnits: ",e)}async getElementId(e){return Object.values(window._sasic.get(["groups"])).map((e=>Object.values(e.positions))).flat().filter((e=>!!e)).find((t=>t.options.hb_key===e))?.elementId}async sasicReRender(e){this.main.headerbidding.reRender(await this.getElementId(e),e)}getElementsList(){return window._sasic.getAllPositions().map((e=>e.elementId))}isFromHB(e){return g(e).includes("HB")}render(e,t,i,s){n(`AdServer: Sashic returned creative for ${e}, size: ${i}x${s}`);i=parseInt(i);s=parseInt(s);const d=this.isFromHB(t),a=parseInt(h(t,"ADVID"));if(this.main.debugMode)try{n("AdServer: SAS rendered this ad: ",e);const r=h(t,"FCID"),o=t.match(/hb_key: (?\S+)/m)?.groups?.value;setTimeout((()=>{this.prepareMetaData(e,{width:i,height:s,fromHB:d,sspId:a,fcId:r,hbKey:o})}),1e3)}catch(e){console.error("Debug tags failed to render",e)}const r=!Object.values(this.main.settings.adserver.allowedSSPs).includes(a);if(d||r){this.main.regularAds[e]={element:document.getElementById(e)};return!1}return this.main.render(e,t,i,s)}prepareMetaData(e,t){const i={adapter:"sasic",id:e+", fcid: "+t.fcId,size:t.width+"x"+t.height,advid:t.sspId};this.main.customAds[e]&&(i.customType=this.main.customAds[e].type);w(e,i)}}class H{constructor(e){this.main=e;this.adapter="paticka";this.loading=!0}load(){n("Adserver: Paticka adapter loading");this.loading=v();this.loading.then((()=>{n("Adserver: Paticka adapter loaded")}));return this.loading}async getAdsList(){return Object.keys(window.Unidata.biddingData[0])}async call(){await this.loading;if(window.Unidata?.biddingData){window.sasBidding=window.sasBidding||{};if(this.main.headerbidding&&B())for(const e of await this.getAdsList()){const t=window.pbjs.getHighestCpmBids(e)[0];t&&(window.sasBidding[e]={bidTier:t.adserverTargeting.hb_pb,hbid:t.cpm,hbid_v:this.main.settings.adserver.bidderTable[t.bidderCode]||"unknown"})}}else r("Missing Unidata.biddingData");"function"==typeof window.sasBiddingDone?window.sasBiddingDone():r("sasBiddingDone function not present");n("AdServer: SAS called with these AdUnits: ",window.sasBidding)}async getElementId(e){return(await this.getAdsList()).includes(e)?e:null}patickaReRender(e){this.main.regularAds[e]={element:document.getElementById(e)};this.main.headerbidding.reRender(e);this.main.debugMode&&setTimeout((()=>{this.prepareMetaData(e)}),250)}prepareMetaData(e){const t={adapter:"paticka",id:e};this.main.customAds[e]&&(t.customType=this.main.customAds[e].type);w(e,t)}}class D{constructor(e){this.main=e;this.adapter="test";this.creatives={banner:"",interscroller:"",skin:"",native:"