var e={456(e,t,i){i.d(t,{B:()=>o});class o{static arbitrageBids(e,t){var i,n,d,s;const a={};window.odT.log("Starting Bid Arbitrage...");for(const r of t){let l={cpm:null,source:null,bidObject:null},c=!0,u=!1;(window.odT.isGPTdisabledForSlot(r)||window.odT.setup.disableGPT)&&(c=!1);const p=null===(d=null===(n=null===(i=window.odT.finalAdSlotsConfig)||void 0===i?void 0:i.adSlotsDefinitions)||void 0===n?void 0:n[r])||void 0===d?void 0:d.divId;if(window.odpbjs&&"function"==typeof window.odpbjs.getHighestCpmBids){const e=window.odpbjs.getHighestCpmBids([p])||[];for(const t of e)(null===l.cpm||t.cpm>l.cpm)&&(l={cpm:t.cpm,source:"prebid",bidObject:t},u=!0)}const g=(e.apsResponse||[]).find(e=>e.slotID===p);g&&g.amznbid&&(u=!0);let w=null;const h=window.odT.bidsFromOe;for(const e of h)if((e.placementId===r||e.adUnitCode===p)&&(!w||e.cpm>w.cpm))if(!e.ttl||Date.now()-e.responseTimestamp<1e3*e.ttl)w=e;else{const t=window.odT.bidsFromOe.findIndex(t=>t.bidId===e.bidId);-1!==t&&window.odT.bidsFromOe.splice(t,1)}if(w&&(null===l.cpm||w.cpm>l.cpm)&&(l={cpm:w.cpm,source:"directCall",bidObject:w},u=!0),null!==l.source){const e=l.bidObject,i=r;if((window.odT.setup.minCpm||0===window.odT.setup.minCpm)&&null!==e.cpm&&e.cpm>window.odT.setup.minCpm||!c)o.directRenderAdRequest(e,i,t,!1);else if(c&&(a[r]=l,"directCall"===l.source||"prebid"===l.source)){const t=window.odpbjs;o.setAdManagerTargeting(r,(null===(s=null==t?void 0:t.getAdserverTargeting)||void 0===s?void 0:s.call(t))||{},e)}}else u?a[r]={cpm:null,source:"amazon",bidObject:null}:(window.odT.log(`Arbitrage - ${r} - No bids found`),c?a[r]={cpm:null,source:"unfilled",bidObject:null}:window.odT.isBackfillEnabled(r)?o.backfill(r):p&&o.sendUnfilledAdRequest(!1,r,p))}return a}static sendUnfilledAdRequest(e,t,i){const o=e?"Second Chance (backfill)":"First Chance";window.odT.log(`${o}: ${t} UNFILLED`),window.odT.triggerFallback(t),window.odT.callEventCallback("ADSLOT_UNFILLED",{adslot:{divId:i,name:t}}),window.odT.analytics.updateAdSlotLoad(i);const n=window.googletag&&"function"==typeof window.googletag.pubads?window.googletag.pubads().getSlots().find(e=>e.getSlotElementId()===i):null,{amznbid:d,od_pfg:s,od_pf_group:a,od_pf_pb:r}=window.odT.tools.checkSlotTargeting(n),l=window.odT.analytics.addBidderMetrics(i,null,null,d),c={divId:t,divIdFull:i,filled:!1,demandType:"unfilled",lineItemId:null,prebidWinner:null,amazonStatus:d,oyStatus:s,oyTestGroup:a,oyPb:r,prebidBid:null,nogam:!0,bidders:Object.keys(l||{}).length?l:null};window.odT.analytics.adRequestEvent(c,!0)}static setAdManagerTargeting(e,t,i){var o,n,d,s,a,r,l,c,u,p,g,w,h,f;if("string"!=typeof e)return;let m=window.odT.finalAdSlotsConfig.adSlotsDefinitions[e].divId,v=window.odT.finalAdSlotsConfig.adSlotsDefinitions[e];if(window.odT.setup.enableSendAllBids&&((()=>{var e;const i=(null===(e=window.odT.bidsFromOe)||void 0===e?void 0:e.filter(e=>e.adUnitCode===m))||[],o=new Map;i.forEach(e=>{const t=e.bidder||"optidigital";(!o.has(t)||e.cpm>o.get(t).cpm)&&o.set(t,e)});const n=Array.from(o.values()).sort((e,t)=>t.cpm-e.cpm);let d=!1;n.forEach(e=>{var i,o,n,s,a,r,l,c,u;if(window.odT.setup.enableSendAllBids){const p=`hb_adid_${e.adserverTargeting.hb_bidder}`.slice(0,20),g=`hb_bidder_${e.adserverTargeting.hb_bidder}`.slice(0,20),w=`hb_format_${e.adserverTargeting.hb_bidder}`.slice(0,20),h=`hb_pb_${e.adserverTargeting.hb_bidder}`.slice(0,20),f=`hb_size_${e.adserverTargeting.hb_bidder}`.slice(0,20);try{t[m]=t[m]||{},d||(t[m]=Object.assign(Object.assign({},t[m]),{hb_adid:e.adserverTargeting.hb_adid,hb_bidder:e.adserverTargeting.hb_bidder,hb_format:(null===(i=null==e?void 0:e.adserverTargeting)||void 0===i?void 0:i.hb_format)||"banner",hb_pb:Number(e.cpm).toFixed(2).toString(),hb_size:"native"==(null===(o=null==e?void 0:e.adserverTargeting)||void 0===o?void 0:o.hb_format)?`${null===(n=null==v?void 0:v.multiFormat)||void 0===n?void 0:n.nativeSize[0]}x${null===(s=null==v?void 0:v.multiFormat)||void 0===s?void 0:s.nativeSize[1]}`:`${e.adserverTargeting.hb_size}`,multi_format:Object.keys(null!==(a=null==v?void 0:v.multiFormat)&&void 0!==a?a:[]).length>0?"1":"0"}),d=!0),t[m][p]=e.adserverTargeting.hb_adid,t[m][g]=e.adserverTargeting.hb_bidder,t[m][w]=(null===(r=null==e?void 0:e.adserverTargeting)||void 0===r?void 0:r.hb_format)||"banner",t[m][h]=Number(e.cpm).toFixed(2).toString(),t[m][f]="native"==(null===(l=null==e?void 0:e.adserverTargeting)||void 0===l?void 0:l.hb_format)?`${null===(c=null==v?void 0:v.multiFormat)||void 0===c?void 0:c.nativeSize[0]}x${null===(u=null==v?void 0:v.multiFormat)||void 0===u?void 0:u.nativeSize[1]}`:`${e.adserverTargeting.hb_size}`}catch(e){console.error(e)}}})})(),t[m]&&Object.keys(t[m]).forEach(i=>{window.odT.gptAdSlots[e].setConfig({targeting:{[i]:t[m][i]}})})),!(null==i?void 0:i.adserverTargeting))return;const y="native"===i.hb_format?`${null===(o=null==v?void 0:v.multiFormat)||void 0===o?void 0:o.nativeSize[0]}x${null===(n=null==v?void 0:v.multiFormat)||void 0===n?void 0:n.nativeSize[1]}`:`${null===(d=null==i?void 0:i.adserverTargeting)||void 0===d?void 0:d.hb_size}`;window.odT.gptAdSlots[e].setConfig({targeting:{hb_pb:null===(s=null==i?void 0:i.adserverTargeting)||void 0===s?void 0:s.hb_pb}}),window.odT.gptAdSlots[e].setConfig({targeting:{hb_bidder:null===(a=null==i?void 0:i.adserverTargeting)||void 0===a?void 0:a.hb_bidder}}),window.odT.gptAdSlots[e].setConfig({targeting:{hb_adid:null===(r=null==i?void 0:i.adserverTargeting)||void 0===r?void 0:r.hb_adid}}),window.odT.gptAdSlots[e].setConfig({targeting:{hb_size:y}});try{window.odT.gptAdSlots[e].setConfig({targeting:{multi_format:Object.keys(null!==(l=null==v?void 0:v.multiFormat)&&void 0!==l?l:[]).length>0?"1":"0"}})}catch(e){console.error(e)}window.odT.gptAdSlots[e].setConfig({targeting:{hb_source:null===(c=null==i?void 0:i.adserverTargeting)||void 0===c?void 0:c.hb_source}}),"1800x1000"==y?window.odT.gptAdSlots[e].setConfig({targeting:{hb_format:"wallpaper"}}):window.odT.gptAdSlots[e].setConfig({targeting:{hb_format:null===(u=null==i?void 0:i.adserverTargeting)||void 0===u?void 0:u.hb_format}});let b=(null===(w=null===(g=null===(p=window.odT)||void 0===p?void 0:p.setup)||void 0===g?void 0:g.customTargeting)||void 0===w?void 0:w.hb_safeframe)||"hb_safeframe";try{"native"!=(null===(h=null==i?void 0:i.adserverTargeting)||void 0===h?void 0:h.hb_format)&&"video"!=(null===(f=null==i?void 0:i.adserverTargeting)||void 0===f?void 0:f.hb_format)&&window.odT.checkSafeFrameDelivery(e,null==i?void 0:i.adserverTargeting)?window.odT.isFlyingCarpetTallRenderedSize(v,y)?window.odT.gptAdSlots[e].setConfig({targeting:{[b]:"2"}}):window.odT.gptAdSlots[e].setConfig({targeting:{[b]:"1"}}):window.odT.gptAdSlots[e].setConfig({targeting:{[b]:"0"}})}catch(e){console.error(e)}let T=Object.keys((null==i?void 0:i.adserverTargeting)||{});for(let t in T)"string"==typeof T[t]&&-1!=T[t].indexOf("hb_deal_")&&window.odT.gptAdSlots[e].setConfig({targeting:{[T[t]]:null==i?void 0:i.adserverTargeting[T[t]]}});window.odT.log("Prebid Ad Server Targeting done")}static sendAdserverRequest(e,t,i,n=!1){var d,s;if(!0===e.adserverRequestSent)return;if(n){window.odT.auctionFailsafe=window.odT.auctionFailsafe||{},t.forEach(e=>{window.odT.auctionFailsafe[e]=!0});const o=[];e.aps||o.push("APS timeout"),e.prebid||o.push("Prebid timeout"),e.directCall||o.push("DirectCall timeout");const n=o.length>0?` - ${o.join(", ")}`:"";window.odT.log(`Failsafe timeout ${i}ms reached , sending adserver request${n}`)}const a=o.arbitrageBids(e,t);if(e.adserverRequestSent=!0,window.odT.log("Adserver request sent"),a&&Object.keys(a).length>0){const e=Object.keys(a).map(e=>{var t,i,n;const d=(null===(n=null===(i=null===(t=window.odT.finalAdSlotsConfig)||void 0===t?void 0:t.adSlotsDefinitions)||void 0===i?void 0:i[e])||void 0===n?void 0:n.divId)||e,s=o.fetchFromCPM(a[e].cpm,d),r={adUnitCode:d};return null!=s&&(r.cpm=s),r});null===(s=null===(d=window.optiyield)||void 0===d?void 0:d.cmd)||void 0===s||s.push(function(){window.optiyield.setGptFloors(e)}),window.googletag.cmd.push(function(){window.odT.log("Refreshing ad slots");const e=window.odT.getGPTSlots(Object.keys(a));"function"==typeof window.odT.clearRemoteCreativeResizeBySlots&&window.odT.clearRemoteCreativeResizeBySlots(e),window.googletag.pubads().refresh(e)})}}static fetchFromCPM(e,t){var i,o,n,d,s,a;const r=window.optidigitalPFconfig;if(null==e)return e;try{const t=window.odT.setup.adServerCurrency?window.odT.setup.adServerCurrency:"EUR";if(t&&(null===(o=null===(i=null==r?void 0:r.cur)||void 0===i?void 0:i.code)||void 0===o?void 0:o.gam)&&t!==(null===(d=null===(n=null==r?void 0:r.cur)||void 0===n?void 0:n.code)||void 0===d?void 0:d.gam)){const i=.95;return window.odT.convertCurrency(e,t,null===(a=null===(s=null==r?void 0:r.cur)||void 0===s?void 0:s.code)||void 0===a?void 0:a.gam)*i}return e}catch(t){return window.odT.log(`Error in fetchFromCPM: ${t}`),e}}static directRenderAdRequest(e,t,i,o=!1){window.odT.renderEngage(e.adUnitCode,e.ad,[Number(e.width),Number(e.height)],e),window.odT.analytics.handleFirstAdPerformanceTracking("without GAM"),window.odT.analytics.adSlotsLoadCount.hasOwnProperty(e.adUnitCode)&&window.odT.analytics.adSlotsLoadCount[e.adUnitCode]<2&&(!window.odT.stickyFormatLoaded.length||!window.odT.stickyFormatLoaded.includes(t))&&window.odT.finalAdSlotsConfig.adSlotsDefinitions.hasOwnProperty(t)&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].hasOwnProperty("anchor")&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].anchor&&1!==Number(e.width)&&1800!==Number(e.width)&&1e3!==Number(e.height)&&window.odT.stickyFormatClosed&&window.odT.setStickyFormat(t,Number(e.width),window.odT.setup.stickyFormatTimeout?window.odT.setup.stickyFormatTimeout:4e3);const n=o?"Second Chance (backfill)":"First Chance";window.odT.log(`${n}: ${t} FILLED (${e.width}x${e.height}) - bidder: ${e.bidder||"optidigital"} - cpm: ${e.cpm}`),window.odT.callEventCallback("ADSLOT_FILLED",{adslot:{divId:e.adUnitCode,size:`${e.width}x${e.height}`,name:t}}),window.odT.analytics.updateAdSlotLoad(e.adUnitCode);const d=window.googletag&&"function"==typeof window.googletag.pubads?window.googletag.pubads().getSlots().find(t=>t.getSlotElementId()===e.adUnitCode):null,{amznbid:s,od_pfg:a,od_pf_group:r,od_pf_pb:l}=window.odT.tools.checkSlotTargeting(d),c=window.odT.analytics.addBidderMetrics(e.adUnitCode,e.bidder,e.cpm,s),u={divId:t,divIdFull:e.adUnitCode,filled:!0,demandType:o?"backfill":"prebid",lineItemId:null,prebidWinner:e.bidder||"optidigital",amazonStatus:s,oyStatus:a,oyTestGroup:r,oyPb:l,size:`${e.width}x${e.height}`,prebidBid:e.cpm,nogam:!0,bidders:Object.keys(c||{}).length?c:null};if(window.odT.analytics.adRequestEvent(u,!0),window.odpbjs&&"function"==typeof window.odpbjs.markWinningBidAsUsed&&window.odpbjs.markWinningBidAsUsed(e),window.odT.bidsFromOe){const t=window.odT.bidsFromOe.findIndex(t=>t.bidId===e.bidId);-1!==t&&window.odT.bidsFromOe.splice(t,1)}}static requestHeaderBiding(e,t,i,o){const n=window.odpbjs,d=[];if(!window.odT.enablePrebid)return i.prebid=!0,void o(d);n.que.push(function(){window.odT.log("Requesting Prebid bids for slots"),n.addAdUnits(window.odTC.getPrebidAdUnits(t));const s=window.odTC.getPrebidAdUnitsFromSlotNames(t);s&&s.length>0?n.requestBids({timeout:e,adUnitCodes:s,bidsBackHandler:function(e){i.prebidResponse=e,window.odT.log(`initAdserver REFRESH CMP consent status: ${window.odT.consentStatus}`),window.odTC.setCustomRenderer(e),window.odT.log("Prebid callback done, adserver request will be sent"),i.prebid=!0,o(d)}}):(window.odT.log("No Prebid adUnitCodes found to request"),i.prebid=!0,o(d))})}static executeAPSAndPrebid(e,t,i){const n={adserverRequestSent:!1,directCall:!1,aps:!1,prebid:!1,apsResponse:null,prebidResponse:null,directCallResponse:null},d=(e=[])=>{var d;n.aps&&n.prebid&&n.directCall&&(window.odT.log("Prebid, APS and Direct Call requests completed, sending adserver request"),!0!==(null===(d=window.odT.setup)||void 0===d?void 0:d.disableGPT)?o.sendAdserverRequest(n,i,t):e.length>0&&e.forEach(e=>{window.odT.analytics.adRequestEvent(e,!0)}))};window.odT.enableAmazonAPS&&window.odT.setup.biddersSetup&&window.odT.setup.biddersSetup.hasOwnProperty("amazon")?(window.odT.log("Requesting APS bids for slots"),o.fetchAPSBids(i,n,d)):n.aps=!0,o.directCall(i,n,d),o.requestHeaderBiding(e,i,n,d),window.setTimeout(function(){var e;!0!==(null===(e=window.odT.setup)||void 0===e?void 0:e.disableGPT)&&o.sendAdserverRequest(n,i,t,!0)},t)}static fetchAPSBids(e,t,i){if(!window.odT.enableAmazonAPS)return t.aps=!0,void i();if(e.length>0){let o=[];for(const t of e)if(window.odT.finalAdSlotsConfig.adSlotsDefinitions.hasOwnProperty(t)&&window.odT.setup.biddersSetup.amazon.adSlots.hasOwnProperty(window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].adUnit)){let e={};e.slotID=window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].divId,e.slotName=window.odT.initConfig.adUnit+"/"+window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].name,e.sizes=window.odT.getAPSAdslotSizes(window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].dfpSizes),e.optiYield={adUnitPath:`${window.odT.initConfig.adUnit}${window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].customAdUnitCode?"/"+window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].customAdUnitCode:""}`,cd:{cd1:window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].cdValue?window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].cdValue:window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].adUnit}},o.push(e)}if(o.length>0){window.odT.oyStatus&&window.optiyield.cmd.push(function(){Object.keys(window.optidigitalPFconfig||{}).length>0&&!window.optiyield._init_ready&&window.odT.initOy(),o=window.optiyield.setAmazonFloors(o,window.odT.setA)});const e=Date.now();window.odT.initAPS=Date.now(),window.apstag.fetchBids({slots:o,timeout:window.odT.setup.biddersSetup.amazon.timeout},function(n){const d=Date.now();o.forEach(t=>{var i;window.odT.analytics.auctionMetrics.amazon=(null===(i=window.odT.analytics.auctionMetrics)||void 0===i?void 0:i.amazon)||{},window.odT.analytics.auctionMetrics.amazon[t.slotID]=d-e}),t.apsResponse=n,t.aps=!0,window.odT.log("Amazon bids received"),window.apstag.setDisplayBids(),i()})}else t.aps=!0,window.odT.log("No APS slots to request bids for"),t&&i&&i()}}static backfill(e){if(!e||0===e.length)return;const t={adserverRequestSent:!1,directCall:!1,aps:!1,prebid:!1,apsResponse:null,prebidResponse:null,directCallResponse:null};window.odT.log("Build Backfill payload"),o.directCallBuildPayload(!0,[e],t,()=>{var i,n,d;let s=null;if(t.directCallResponse&&t.directCallResponse.length>0){const t=window.odT.bidsFromOeBackfill;for(const i of t)if(i.placementId===e&&(!s||i.cpm>s.cpm))if(!i.ttl||Date.now()-i.responseTimestamp<1e3*i.ttl)s=i;else{const e=window.odT.bidsFromOeBackfill.findIndex(e=>e.bidId===i.bidId);-1!==e&&window.odT.bidsFromOeBackfill.splice(e,1)}s&&o.directRenderAdRequest(s,e,[e],!0)}if(null===s){const t=null===(d=null===(n=null===(i=window.odT.finalAdSlotsConfig)||void 0===i?void 0:i.adSlotsDefinitions)||void 0===n?void 0:n[e])||void 0===d?void 0:d.divId;o.sendUnfilledAdRequest(!0,e,t)}})}static directCall(e,t,i){e&&0!==e.length&&!window.odT.setup.disableDCWithPrebid?(window.odT.log("Build Direct Call payload"),o.directCallBuildPayload(!1,e,t,i)):t&&i&&(t.directCall=!0,i())}static directCallBuildPayload(e,t,i,o){var n,d,s,a;const r=this.buildImpressionsList(e,t);if(!r)return i&&(i.directCall=!0),void(o&&o());const l={referrer:window.location.href,pageTemplate:window.odT.initConfig.adUnit,hb_version:"optidigital/3.0.0",deviceWidth:document.documentElement.clientWidth,bidderRequestId:this.getUniqueIdentifierStr(),publisherId:"direct"===(null===(n=window.odT.setup)||void 0===n?void 0:n.schain)?`p${window.odT.setup.info.publisherId.toString()}`:`s${window.odT.setup.info.siteId.toString()}`,imp:r,badv:Array.isArray(null===(d=window.odT.setup)||void 0===d?void 0:d.badv)?[...window.odT.setup.badv]:[],bcat:Array.isArray(null===(s=window.odT.setup)||void 0===s?void 0:s.bcat)?[...window.odT.setup.bcat]:[],bapp:Array.isArray(null===(a=window.odT.setup)||void 0===a?void 0:a.bapp)?[...window.odT.setup.bapp]:[]};this.appendSchainAndDevice(l),this.appendSubids(l,e,t),this.appendGdprAndMetadata(l),this.executeIasTracking(e),this.appendUserIds(l),this.appendGlobalS2SConfig(l,e),this.waitForServicesAndSend(l,e,i,o),this.handleId5StorageRefresh()}static getUniqueIdentifierStr(){return this.uniqueIdentifierCounter++,this.uniqueIdentifierCounter+Math.random().toString(16).substr(2)}static formatSizesArray(e){const t=[];for(let i=0;i<e.length;i++)2===e[i].length&&t.push(window.odT.tools.formatSizeArrayToString(e[i]));return t}static getPlacementS2SInfo(e,t){const i={};return Object.entries(e).forEach(([o,n])=>{var d,s;if(!(null===(d=n.adSlots)||void 0===d?void 0:d[t]))return;const{countries:a,browsers:r,devices:l,callWithPrebid:c}=n;if((!a||a.includes(window.optidigitalToolboxCC))&&(!r||r.includes(window.odT.checkBrowser.toLowerCase()))&&(!l||l.includes(window.odT.deviceCategory.toLowerCase()))&&!0!==c){let d;if("outbrain"===o&&n.adSlots[t].hasOwnProperty("publisherId"))d={publisher:{id:n.adSlots[t].publisherId,name:window.location.host.replace("www.",""),domain:window.location.host},tagid:t};else if("optidigital"===o)try{if(!n.adSlots[t].hasOwnProperty("status")||"1"!=n.adSlots[t].status||1!==(null==e?void 0:e.optidigitalAdSlots))return;d=Object.assign({publisherId:"direct"===(null===(s=window.odT.setup)||void 0===s?void 0:s.schain)?`p${window.odT.setup.info.publisherId.toString()}`:`s${window.odT.setup.info.siteId.toString()}`,placementId:window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].adUnit,divId:""!==window.odT.divIdPrefix?window.odT.divIdPrefix+t:window.odT.finalAdSlotsConfig.adSlotsDefinitions[t].divId,pageTemplate:window.odT.initConfig.adUnit},Array.isArray(window.odT.setup.bapp)?{bapp:window.odT.setup.bapp}:{})}catch(e){}i[o]=d||n.adSlots[t]}}),0!==Object.keys(i).length&&i}static buildSingleAdSlotImp(e,t){var i,o,n,d,s,a,r;const l=null===(n=null===(o=null===(i=null===window||void 0===window?void 0:window.odT)||void 0===i?void 0:i.finalAdSlotsConfig)||void 0===o?void 0:o.adSlotsDefinitions)||void 0===n?void 0:n[e],c=(null==l?void 0:l.divId)||window.odT.divIdPrefix+e,u=t?(null==l?void 0:l.dfpSizes)||[]:(null==l?void 0:l.biddingSizes)||(null==l?void 0:l.dfpSizes)||[],p={sizes:this.formatSizesArray(window.odT.getPrebidAdUnitsSizes(u)),bidId:this.getUniqueIdentifierStr(),adUnitCode:c,placementId:t&&(null==l?void 0:l.cdValue)?l.cdValue:null==l?void 0:l.adUnit},g=document.getElementById(`${c}`);if(g&&(p.adContainerWidth=g.offsetWidth,p.adContainerHeight=g.offsetHeight),(null===(d=window.odT.setup)||void 0===d?void 0:d.disableDcMaxBids)||(null==l?void 0:l.disableDcMaxBids)||(p.maxBids=null!==(s=null==l?void 0:l.maxBids)&&void 0!==s?s:3),(null===(a=window.odT.initConfig)||void 0===a?void 0:a.adUnit)&&(null==l?void 0:l.adUnit)&&window.odT.enableGpid&&(p.gpid=`${window.odT.initConfig.adUnit}/${l.adUnit}`),!t&&(null===(r=window.odT.setup)||void 0===r?void 0:r.s2sConfig)){const e=this.getPlacementS2SInfo(window.odT.setup.s2sConfig,p.placementId);e&&(p.s2sConfig=e)}return p}static buildImpressionsList(e,t){let i=[];return t&&t.forEach(t=>{var o,n,d,s;if((e=>{var t,i,o,n,d,s,a,r,l,c;let u=null===(o=null===(i=null===(t=window.odT.finalAdSlotsConfig)||void 0===t?void 0:t.adSlotsDefinitions)||void 0===i?void 0:i[e])||void 0===o?void 0:o.loadType;if((null===(n=window.odT.adAdaptersFactory)||void 0===n?void 0:n.isSpecialAdSlot(e))||[6,7,8].includes(u))return!0;const p=(null===(a=null===(s=null===(d=window.odT.finalAdSlotsConfig)||void 0===d?void 0:d.adSlotsDefinitions)||void 0===s?void 0:s[e])||void 0===a?void 0:a.biddingSizes)||(null===(c=null===(l=null===(r=window.odT.finalAdSlotsConfig)||void 0===r?void 0:r.adSlotsDefinitions)||void 0===l?void 0:l[e])||void 0===c?void 0:c.dfpSizes);if(p&&p.length&&!window.odT.getPrebidAdUnitsSizes(p).length)return!0;return!1})(t))return;let a=this.buildSingleAdSlotImp(t,e);(null===(o=null==a?void 0:a.sizes)||void 0===o?void 0:o.length)>0&&(void 0===(null===(s=null===(d=null===(n=null===window||void 0===window?void 0:window.odT)||void 0===n?void 0:n.setup)||void 0===d?void 0:d.s2sConfig)||void 0===s?void 0:s.optidigitalAdSlots)||null!=(null==a?void 0:a.s2sConfig)&&Object.keys(null==a?void 0:a.s2sConfig).length>0)&&i.push(a)}),i}static appendSchainAndDevice(e){var t,i,o,n,d;window.odT.setup.schain&&"direct"===window.odT.setup.schain||(e.schain={complete:1,nodes:[{asi:"optidigital.com",hp:1,sid:(null===(o=null===(i=null===(t=window.odT)||void 0===t?void 0:t.setup)||void 0===i?void 0:i.info)||void 0===o?void 0:o.sellerId)?window.odT.setup.info.sellerId.toString():window.odT.odNetworkId?`p${window.odT.setup.info.publisherId.toString()}`:window.odT.setup.info.siteId.toString()}],ver:"1.0"}),e.device={w:window.screen.width,h:window.screen.height,dnt:navigator.doNotTrack?1:0,ua:navigator.userAgent,language:navigator.language,ext:{vpw:window.innerWidth,vph:window.innerHeight}},(null===(d=null===(n=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===n?void 0:n.brands)||void 0===d?void 0:d.length)&&(e.device.sua={source:navigator.userAgentData?1:0,platform:{brand:navigator.userAgentData.platform},browsers:navigator.userAgentData.brands.map(e=>({brand:e.brand,version:[e.version]})),mobile:navigator.userAgentData.mobile?1:0})}static appendSubids(e,t,i){var o,n,d,s;if(!t||!i||0===i.length)return;const a=i[0],r=(null===(n=null===(o=window.odT.finalAdSlotsConfig.adSlotsDefinitions)||void 0===o?void 0:o[a])||void 0===n?void 0:n.divId)||null,l=window.googletag&&"function"==typeof window.googletag.pubads?window.googletag.pubads().getSlots().find(e=>e.getSlotElementId()===r):null,{od_pf_group:c,od_pf_ta:u}=window.odT.tools.checkSlotTargeting(l);e.subids={sub1:"test"===window.odT.testGroup?"test":void 0,sub2:r&&(null===(d=window.odT.analytics.adSlotsLoadCount)||void 0===d?void 0:d[r])>0?"yes":void 0,sub3:window.odT.consentType?this.consentMap[window.odT.consentType]:void 0,sub4:c?"test":void 0,sub5:window.odT.customDNR?"1":"0",sub6:(null===(s=window.odT.finalAdSlotsConfig.adSlotsDefinitions)||void 0===s?void 0:s[a].cdValue)||a,sub7:u||void 0},Object.keys(e.subids).forEach(t=>void 0===e.subids[t]&&delete e.subids[t])}static appendGdprAndMetadata(e){var t,i,o,n;e.gdpr={consent:(null===(t=window.odT.consentV2TCData)||void 0===t?void 0:t.tcString)||"",required:!!window.optidigitalToolboxGdpr},(null===(o=null===(i=window.odT)||void 0===i?void 0:i.consentV2TCData)||void 0===o?void 0:o.addtlConsent)&&(e.gdpr.addtlConsent=window.odT.consentV2TCData.addtlConsent),-1!==window.location.href.indexOf("optidigitalTestMode=true")&&(e.testMode=!0);const d=document.querySelector('meta[name="keywords"]'),s=null===(n=null==d?void 0:d.content)||void 0===n?void 0:n.trim().replace(/\s+/g,"");s&&(e.site={keywords:s})}static appendUserIds(e){var t;const i={eids:[]};let o={criteoId:{source:"criteo.com",uids:[{id:"",atype:1}]},sharedId:{source:"pubcid.org",uids:[{atype:1}]},id5Id:{source:"id5-sync.com",uids:[{id:"",atype:1,ext:""}]},liverampId:{source:"liveramp.com",uids:[{id:"",atype:3}]},pairId:{source:"google.com",uids:[]}};(null===(t=window.odT.setup)||void 0===t?void 0:t.userids)&&Object.keys(window.odT.setup.userids).length&&(o=Object.keys(o).reduce((e,t)=>{var i;return 1===(null===(i=window.odT.setup.userids[t])||void 0===i?void 0:i.status)?Object.assign(Object.assign({},e),{[t]:o[t]}):e},{})),window.odT.setUserId(!0,o,i),i.eids.length&&(e.user=i),e._defaultUserIds=o}static executeIasTracking(e){try{let t={adUnits:[]};for(let e in window.odT.finalAdSlotsConfig.adSlotsDefinitions){const i=window.odT.finalAdSlotsConfig.adSlotsDefinitions[e].dfpSizes.filter(e=>Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]);i.length>0&&t.adUnits.push({code:window.odT.finalAdSlotsConfig.adSlotsDefinitions[e].divId,mediaTypes:{banner:{sizes:i}},bids:[]})}if(window.odT.iasModule&&window.odT.iasId&&!e&&!Object.keys(window.odT.analytics.adSlotsLoadCount).length&&!window.odT.iasModuleCalled){window.odT.iasModuleCalled=!0;let e={name:"ias",waitForIt:!1,params:{pubId:window.odT.iasId}};window.odT.log("IAS Initialization"),window.odT.iasModule.init(e),t=t||window.odpbjs.adUnits,window.odT.iasModule.getBidRequestData(t,()=>{window.odT.iasModule.getTargetingData(t.adUnits.map(e=>(window.odT.iasReady=!0,e.code)))},e)}}catch(e){window.odT.log("IAS Module failed")}}static appendGlobalS2SConfig(e,t){var i,o;if(!(null===(i=window.odT.setup)||void 0===i?void 0:i.s2sConfig))return;const n=Object.entries(window.odT.setup.s2sConfig).reduce((i,[o,n])=>{var d,s,a,r;if("aliasBidders"===o)Object.entries(n).forEach(([e,t])=>{i[e]={aliases:t}});else if(t||"optidigitalAdSlots"!==o||1!==n){if("directBidders"!==o&&(!n.countries||n.countries.includes(window.optidigitalToolboxCC))&&(!n.browsers||n.browsers.includes(window.odT.checkBrowser.toLowerCase()))&&(!n.devices||n.devices.includes(window.odT.deviceCategory.toLowerCase()))){if("optidigital"===o&&1!==(null==e?void 0:e.optidigitalAdSlots))return i;i[o]=Object.assign({discount:n.discount},i[o]||{});((null===(s=null===(d=window.odT.setup.s2sConfig)||void 0===d?void 0:d.directBidders)||void 0===s?void 0:s.includes(o))||(null===(r=null===(a=window.odT.setup)||void 0===a?void 0:a.directBidders)||void 0===r?void 0:r.length)&&window.odT.setup.directBidders.includes(o))&&(i[o].direct=!0)}}else e.optidigitalAdSlots=n;return i},{});Object.keys(n).length&&(null===(o=e.imp)||void 0===o?void 0:o.some(e=>e.hasOwnProperty("s2sConfig")))&&(e.s2sConfig=n)}static resolveProcess(e,t){var i,o,n,d;const s=e.user||{eids:[]},a=e._defaultUserIds;delete e._defaultUserIds;const r=null===(o=null===(i=window.odT)||void 0===i?void 0:i.getCookie)||void 0===o?void 0:o.call(i,"_lr_env");if(window.odT.id5Obj&&!s.eids.some(e=>Object.values(e).includes("id5-sync.com"))&&(null==a?void 0:a.id5Id)&&(a.id5Id.uids[0].id=window.odT.id5Obj.universal_uid,a.id5Id.uids[0].ext=window.odT.id5Obj.ext,s.eids.push(a.id5Id)),window.odT.liveRampObj&&!s.eids.some(e=>Object.values(e).includes("liveramp.com"))&&(null==a?void 0:a.liverampId)&&(a.liverampId.uids[0].id=r,s.eids.push(a.liverampId)),window.odT.pairIdObj&&r&&!s.eids.some(e=>Object.values(e).includes("google.com"))&&(null==a?void 0:a.pairId))try{let e=null===(n=JSON.parse(atob(decodeURIComponent(r))))||void 0===n?void 0:n.envelope;(null==e?void 0:e.length)&&(e.forEach(e=>a.pairId.uids.push({id:e,atype:571187})),s.eids.push(a.pairId))}catch(e){}s.eids.length&&(e.user=e.user||{},e.user.eids=s.eids),!t&&(null===(d=window.optiyield)||void 0===d?void 0:d._ready)&&window.optiyield.cmd.push(()=>{e.imp.forEach((t,i)=>{var o,n,d,s;let a={adUnitPath:`${window.odT.initConfig.adUnit}${(null===(n=null===(o=window.odT.finalAdSlotsConfig.adSlotsDefinitions)||void 0===o?void 0:o[t.placementId])||void 0===n?void 0:n.customAdUnitCode)?"/"+(null===(d=window.odT.finalAdSlotsConfig.adSlotsDefinitions[t.placementId])||void 0===d?void 0:d.customAdUnitCode):""}`,customDimensions:{cd1:t.placementId}},r=window.optiyield.getFloors(a,"prebid");if(r&&1===r.pfStatus&&(null===(s=r.pf)||void 0===s?void 0:s.prebid)){const t=(e,t)=>Math.ceil(parseFloat((parseFloat(e)*Math.pow(10,t)).toFixed(1)))/Math.pow(10,t),o=(e,t)=>{const i=Math.pow(10,10);return e*i/(t*i)*(e*i)/i},n=((e,i=.99)=>{if(e>0)return t(o(e,e*i),4)})(window.odT.convertToCurrency(Number(r.pf.prebid),"USD"));void 0===n||isNaN(n)||(e.imp[i].bidFloor=n)}})})}static waitForServicesAndSend(e,t,i,n){const d=window.odT.setup.processTimeout?window.odT.setup.processTimeout:300;let s=0;if(window.odT.checkServicesReady())window.odT.log("Services are ready without wait"),this.resolveProcess(e,t),o.directCallSendRequest("PresyncReady",e,t,i,n);else{let a=setInterval(()=>{window.odT.checkServicesReady()?(window.odT.log("Services are ready after some time"),clearInterval(a),this.resolveProcess(e,t),o.directCallSendRequest("PresyncReady",e,t,i,n)):s>=d?(clearInterval(a),window.odT.log("Some services might be skipped due to timeout"),this.resolveProcess(e,t),o.directCallSendRequest("PresyncTimeout",e,t,i,n)):s+=20},20)}}static handleId5StorageRefresh(){if(window.odT.id5Obj){const e=localStorage.getItem("id5id_last"),t=new Date(e||0),i=28800;Date.now()-t.getTime()>1e3*i&&window.odT.setId5Id()}}static directCallSendRequest(e,t,i=!1,o,n){if(!(null==t?void 0:t.imp)||0===t.imp.length)return o&&(o.directCall=!0),void(n&&n());const d=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{if("xmlhttprequest"===e.initiatorType&&e.name.includes("https://pbs.optidigital.com/bidder")){const i=parseInt(e.duration.toString());t.imp.forEach(e=>{window.odT.analytics.auctionMetrics[e.adUnitCode]=i}),d.disconnect()}})});if(d.observe({type:"resource",buffered:!0}),i||1!==(null==t?void 0:t.optidigitalAdSlots)||t.s2sConfig){(null==t?void 0:t.imp)&&t.imp.forEach(e=>{window.odT.analytics.auctionMetrics.firstCallConfig=window.odT.analytics.auctionMetrics.firstCallConfig||{},window.odT.analytics.auctionMetrics.firstCallConfig[e.adUnitCode]=Object.keys((null==e?void 0:e.s2sConfig)||{})}),window.odT.log("Send Engage request - "+e);(new Date).getTime();const d=i?`https://pbs.optidigital.com/bidder/backfill/${t.publisherId}`:`https://pbs.optidigital.com/bidder/${t.publisherId}`,s=new XMLHttpRequest;s.withCredentials=!0,s.open("POST",d,!0),s.timeout=window.odT.setup.timeouts&&window.odT.setup.timeouts.prebidDirect?window.odT.setup.timeouts.prebidDirect:1500,s.onerror=function(){window.odT.log("Direct Call request failed (error)."),(null==t?void 0:t.imp)&&window.odT.analyticsFromOe&&t.imp.forEach(e=>{delete window.odT.analyticsFromOe[e.adUnitCode]}),o&&(o.directCall=!0),n&&n()},s.ontimeout=function(){window.odT.log("Direct Call request failed (timeout)."),(null==t?void 0:t.imp)&&window.odT.analyticsFromOe&&t.imp.forEach(e=>{delete window.odT.analyticsFromOe[e.adUnitCode]}),o&&(o.directCall=!0),n&&n()},s.onreadystatechange=function(){var e;if(4==this.readyState){if(200==this.status){(new Date).getTime();let n;try{n=JSON.parse(this.responseText)}catch(e){}if((null===(e=null==n?void 0:n.analytics)||void 0===e?void 0:e.imps)&&(null==t?void 0:t.imp)&&(window.odT.analyticsFromOe=window.odT.analyticsFromOe||{},t.imp.forEach(e=>{var t,i;window.odT.analytics.auctionMetrics.firstCall=window.odT.analytics.auctionMetrics.firstCall||{},window.odT.analytics.auctionMetrics.firstCall[e.adUnitCode]=(null===(t=n.analytics.imps)||void 0===t?void 0:t[e.bidId])||{},(null===(i=n.analytics.imps[e.bidId])||void 0===i?void 0:i.dc)&&(window.odT.analyticsFromOe[e.adUnitCode]=n.analytics.imps[e.bidId].dc)})),n&&n.hasOwnProperty("bids")&&n.bids.length>0){let e=window.odT.setup.prebidPriceGranularity?window.odT.setup.prebidPriceGranularity:window.odT.defaultPriceGranularity;n.bids.forEach(t=>{let o=window.odT.convertBidCpm(t.cpm),n=window.odT.getCpmStringValue(o,e.buckets);t.cpm=o;let d={adUnitCode:t.creativeId,placementId:t.placementId,cpm:Number.parseFloat(o)||0,bidId:t.bidId,width:t.w,height:t.h,ad:t.adm,ttl:t.ttl,responseTimestamp:(new Date).getTime(),cur:window.odT.setup.adServerCurrency?window.odT.setup.adServerCurrency:"EUR",bidder:t.hb_bidder?t.hb_bidder:"optidigital",adserverTargeting:{hb_bidder:t.hb_bidder?t.hb_bidder:"optidigital",hb_adid:t.bidId,hb_pb:n,hb_size:`${t.w}x${t.h}`,hb_source:"server",hb_format:"banner"}};i?window.odT.bidsFromOeBackfill.push(d):window.odT.bidsFromOe.push(d)}),o&&(o.directCallResponse=n.bids)}}o&&(o.directCall=!0),n&&n()}},s.setRequestHeader("Content-type","text/plain"),s.send(JSON.stringify(t))}else o&&(o.directCall=!0),n&&n()}}o.uniqueIdentifierCounter=0,o.consentMap={ko:"1",li:"2",ok:"3",timeout_callback:"3",timeout_tcfapi:"3"}},764(e,t,i){i.r(t),i.d(t,{EmbeddedSafeFrame:()=>s,default:()=>a});var o=i(10),n=function(e,t,i,o){return new(i||(i=Promise))(function(n,d){function s(e){try{r(o.next(e))}catch(e){d(e)}}function a(e){try{r(o.throw(e))}catch(e){d(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}r((o=o.apply(e,t||[])).next())})};class s{constructor(){this.SAFEFRAME_LIBRARY_CONTENT=()=>{
/*! safeframe-wrapper v1.0.0 - 2025-10-07 */
window.safeFrameInit={config:[],setConfig:function(e){this.config=[...e]},init:function(){var e=!1;-1!=window.location.search.indexOf("optidigital_debug=true")&&(e=!0),this.config.length&&this.config.map(t=>{if(o=document.getElementById(t.id))if(t.hideElSiblings)for(var i of o.children)i.style.height="1px",i.style.visibility="hidden";else o.innerHTML="";else(o=document.createElement("div")).setAttribute("id",t.id),document.body.appendChild(o);var o=t.id+"-content",n=((o=(!document.getElementById(o)&&((n=document.createElement("div")).setAttribute("id",o),o=document.getElementById(t.id))&&o.appendChild(n),document.createElement("script"))).setAttribute("type","text/x-safeframe"),o.classList.add("sf_data"),o.setAttribute("id","sf_tag_"+t.id),t.renderHtml.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$").replace(/"/g,'\\"').replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"));n="{id: 'ad-"+t.id+"', html: `"+n+"`, conf: {'size': '"+t.size+"', dest: '"+t.id+"-content'}, meta: {id: '"+t.id+"', size: '"+t.size+"', debug: '"+e+"'}}";o.textContent=n,document.body.appendChild(o)}),this.baseSafeFrame(),this.hostSafeFrame(),this.renderTemplate()},renderTemplate:function(){this.config.length&&this.config.forEach(e=>{new $sf.host.Config({renderFile:e.renderFile})})},baseSafeFrame:function(){if(window.$sf)try{e.ver="1-1-1",e.specVersion="1.1"}catch(e){}else var e={ver:"1-1-1",specVersion:"1.1"};var t,i,o,n,d,s,a,r=window,l="object",c="function",u="string",p="number",g="replace",w="length",h="document",f=r&&r.Number,m=r&&r.Math,v=r&&r[h],y=r&&r.navigator,b=y&&y.userAgent||"",T="toLowerCase",S="getAttribute",C="setAttribute",A="removeAttribute",I="getElementsByTagName",k=r&&r.String,x=(e=k.fromCharCode(92))+e,_=k.fromCharCode(34),P=e+_,E=(e=k.fromCharCode(43),"scr"+_+e+_+"ipt"),L="about:blank",D="nodeType",M="iframe",O="CollectGarbage",R="",z=$,F=!0,$=!1,B=null,N={preventDefault:0,stopImmediatePropagation:0,stopPropagation:0,preventBubble:0},U=f&&f.MAX_VALUE,j=-1*U,V=(r&&r.escape,r&&r.unescape,!(!window.ActiveXObject&&"ActiveXObject"in window)&&r&&"ActiveXObject"in r),H=0,q=$,G=0,W=B,K=0,Y=B,X=0,Z=0,J=0,Q={},ee="",te="",ie=B,oe=B;function ne(e){var t=typeof e;return t==u?e:t!=p||e?t==l&&e&&e.join?e.join(""):!1===e?"false":!0===e?"true":e?k(e):"":"0"}function de(e){try{e=e&&typeof e==c&&e.toString()&&new e.constructor?e:B}catch(t){e=B}return!!e}function se(e,t,i,o,n){var d,s,a;if(t&&e)for(s in t)a=typeof(d=t[s]),i&&!t.hasOwnProperty(s)||n&&s in e||o&&a==c||(a==l&&(d=d&&(d.slice?se([],d):se({},d))),e[s]=d);return e}function ae(){return(new Date).getTime()}function re(){return m.round(100*m.random())}function le(e){return(e=ne(e))&&e[g](/^\s\s*/,"")[g](/\s\s*$/,"")}function ce(e,t,i,o){var n,d,s=i&&typeof i==l?i:r,a=0,c=B;if(e)if(e=ne(e),t=t&&typeof t==l?t:B,e.indexOf("."))for(n=e.split(".");d=n[a++];)d=le(d),c=a==n[w]?s[d]&&t?s[d]=se(s[d],t,$,B,o):o&&d in s?s[d]:s[d]=s[d]||t||{}:o&&d in s?s[d]:s[d]=s[d]||{},s=s[d];else c=s[e]&&t?s[e]=se(s[e],t,$,B,o):s[e]=s[e]||t||{};return c}function ue(){return x}function pe(){return P}function ge(){return"\\r"}function we(){return"\\n"}function he(e,t,i){return ne(["<",t,E,i,">"])}function fe(e){return escape(e)}function me(e){return unescape(e)}function ve(e,t,i){return i?e.lastIndexOf(t):e.indexOf(t)}function ye(e,t,i,o,n){var d,s,a,r,c,u,p,g,h,f,m,v,y=this,b=$;if(!(y instanceof ye))return new ye(e,t,i,o,n);if(!arguments[w])return y;if(e&&typeof e==l)return se(new ye("",t,i,o,n),e);if(e=ne(e),t=ne(t)||"&",i=ne(i)||"=",!e)return y;for(h=(c=(e=(e="?"!=t&&"?"!=i&&"?"==e.charAt(0)?e.substring(1):e).charAt(0)==t?e.substring(1):e).split(t))[w],d=0;h--;)if(s=c[d++],b=g=$,s){if(2<(m=(u=s.split(i))[w])){if(p=me(u[0]),u.shift(),n)if(f=ve(e,a=p+i),r=e.substring(f+(m=a[w])),v=(a=t+t)[w],-1!=(a=ve(r,a))){for(r in f=new ye(r=e.substr(f+m,a+v),t,i,o,n),r="",m=0,f)m++;0<m&&(d+=m-1),s=f}else s=me(u.join(i));else s=me(u.join(i));b=F}else 2==m&&(p=me(u[0]),s=me(u[1]),b=F);b&&(o&&p in y||(y[p]=s,g=F),n)&&g&&p&&s&&typeof s!=l&&(0<=ve(s,t)||0<=ve(s,i))&&(y[p]=new ye(s,t,i,o,n))}}function be(e){var t=0;return parseFloat(e.replace(/\./g,function(){return 1==t++?"":"."}))}function Te(e,t,i){return e=e&&e.match(t),i==B?e:e&&e[i]||B}function Se(e,t){return e.test(t)}function Ce(e){var i,o={},n=new Date;if(!e&&oe)return oe;o.ie=o.opera=o.gecko=o.webkit=o.safari=o.chrome=o.air=o.ipod=o.ipad=o.iphone=o.android=o.webos=o.silk=o.nodejs=o.phantomjs=0,o.mobile=o.ios=o.os=B,o.accel=!1,o.caja=y&&y.cajaVersion,o.cks=$,(e=e||b||"")&&(Se(/windows|win32/i,e)?o.os="windows":Se(/macintosh|mac_powerpc/i,e)?o.os="macintosh":Se(/android/i,e)?o.os="android":Se(/symbos/i,e)?o.os="symbos":Se(/linux/i,e)?o.os="linux":Se(/rhino/i,e)&&(o.os="rhino"),Se(/KHTML/,e)&&(o.webkit=1),Se(/IEMobile|XBLWP7/,e)&&(o.mobile="windows"),Se(/Fennec/,e)&&(o.mobile="gecko"),(i=Te(e,/AppleWebKit\/([^\s]*)/,1))&&(o.webkit=be(i),o.safari=o.webkit,Se(/PhantomJS/,e)&&(i=Te(e,/PhantomJS\/([^\s]*)/,1))&&(o.phantomjs=be(i)),Se(/ Mobile\//,e)||Se(/iPad|iPod|iPhone/,e)?(o.mobile="Apple",i=(i=Te(e,/OS ([^\s]*)/,1))&&be(i.replace("_",".")),o.ios=i,(i=Te(e,/iPad|iPod|iPhone/,o.ipad=o.ipod=o.iphone=0))&&(o[i[T]()]=o.ios)):((i=Te(e,/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/,0))&&(o.mobile=i),Se(/webOS/,e)&&(o.mobile="WebOS",i=Te(e,/webOS\/([^\s]*);/,1))&&(o.webos=be(i)),Se(/ Android/,e)&&(o.mobile="Android",i=Te(e,/Android ([^\s]*);/,1))&&(o.android=be(i)),Se(/Silk/,e)&&((i=Te(e,/Silk\/([^\s]*)\)/,1))&&(o.silk=be(i)),o.android||(o.android=2.34,o.os="Android"),Se(/Accelerated=true/,e))&&(o.accel=!0)),(i=e.match(/(Chrome|CrMo)\/([^\s]*)/))&&i[1]&&i[2]?(o.chrome=be(i[2]),o.safari=0,"CrMo"===i[1]&&(o.mobile="chrome")):(i=Te(e,/AdobeAIR\/([^\s]*)/))&&(o.air=i[0])),o.webkit||((i=Te(e,/Opera[\s\/]([^\s]*)/,1))?(o.opera=be(i),(i=Te(e,/Opera Mini[^;]*/,0))&&(o.mobile=i)):(i=Te(e,/MSIE\s([^;]*)/,1))?o.ie=be(i):(i=(i=Te(e,/Gecko\/([^\s]*)/))&&Te(e,/rv:([^\s\)]*)/,o.gecko=1))&&(o.gecko=be(i))));try{n.setTime(n.getTime()+1e3),v.cookie=t(["sf_ck_tst=test; expires=",n.toGMTString(),"; path=/"]),-1!=v.cookie.indexOf("sf_ck_tst")&&(o.cks=F)}catch(e){o.cks=$}try{typeof process==l&&process.versions&&process.versions.node&&(o.os=process.platform,o.nodejs=numberify(process.versions.node))}catch(e){o.nodejs=0}return o}function Ae(){Z&&(clearTimeout(Z),Z=0)}function Ie(e){Ue(r,"load",Ie),Ue(r,"DOMContentLoaded",Ie),W=F}function ke(){var e,t,i,o;if(Ae(),300<=X&&(Y=B,W=F),W===B){try{i=(t=(e=v&&v.body)&&Oe("*",e))&&t[w],o=e&&e.lastChild}catch(e){K=0,Y=B}K&&i==K&&o==Y?(Y=B,W=F):(K=i,Y=o,X+=1,Z=setTimeout(ke,50))}else Y=B}function xe(e){var t=ze(e,"id"),i=t&&Q[t];i&&(Ue(e,"load",i),Q[t]=B,delete Q[t])}function _e(e){return e&&typeof e==u&&De(e)||e}function Pe(e,t,i,o){try{ie=ie||n.msghost}catch(e){ie=B}if(r==top)return e&&ie&&ie[e]&&ie[e](t,i,o)}function Ee(e){var t=B;try{e&&(t=9==e[D]?e:e[h]||e.ownerDocument||B)}catch(e){t=B}return t}function Le(e){var t,i=B;try{e&&(i=(i=e.parentWindow||e.defaultView||B)||(t=Ee(e))&&(t.parentWindow||t.defaultView)||B)}catch(e){i=B}return i}function De(e){var t;return(t=1<(t=arguments)[w]?Ee(t[1]):v)&&t.getElementById(e)||B}function Me(e){return e&&1==e[D]&&e.tagName[T]()||""}function Oe(e,t){var i=[];try{i=t&&t[I]?t[I](e)||i:v[I](e)||i}catch(e){i=[]}return i}function Re(e){return e&&(e.parentNode||e.parentElement)}function ze(e,i,o){try{2<arguments[w]?o===B?q?e[A](i,0):e[A](i):(o=t(o),"class"==i[T]()?e.className=o:q?e[C](i,o,0):e[C](i,o)):o=t(q?e[S](i,0):e[S](i))}catch(e){o=""}return o}function Fe(e,i){var o;try{o=e.style,1<arguments[w]?o.cssText=t(i):i=o.cssText}catch(e){i=""}return i}function $e(e,t){return(1<arguments[w]&&Ee(t)||v).createElement(e)}function Be(e,t){var i=$;try{e&&(i=e.appendChild(t))}catch(e){i=$}return i}function Ne(e,t,i){try{z?e[R]("on"+t,i):e[R](t,i,$)}catch(e){}}function Ue(e,t,i){try{z?e.detachEvent("on"+t,i):e.removeEventListener(t,i,$)}catch(e){}}function je(){var e;return Ae(),W?(Y=B,F):((e=v.readyState)&&(Y=B,W="loaded"==e||"complete"==e||"interactive"==e?F:$),Y=B,X=K=0,ke(),!!W)}function Ve(e){var t=B;try{t=(e=e||r.event)?e[ee]||e[te]:B}catch(e){t=B}return t}function He(e,t,i,o,n){return qe(e,t,i,o,n)}function qe(e,o,n,d,s,a){var r,l,c,u,p,g=["<",M," "];if(a)u=e;else{if(Me(e=_e(e))!=M)return B;u=e.cloneNode($)}for(l in"src"in(o=o||{})?ze(u,"src",B):o.src=ze(e,"src")||L,"name"in o?ze(u,"name",B):o.name=ze(e,"name"),o.src||(o.src=L),r=s&&Pe("prep",o),a||(ze(u,"width",B),ze(u,"height",B)),n&&((c=Fe(u))&&";"!=c.charAt(c[w]-1)&&(c+=";"),Fe(u,[c,t(n)])),Be(c=$e("div"),u),a=c.innerHTML.replace(/<iframe(.*?)>(.*?)<\/iframe>/gim,"$1"),g.push('name="',o.name,'" ',a,"></",M,">"),delete o.name,c.innerHTML=t(g),p=c.firstChild,o)ze(p,l,o[l]);return ze(p,"id")||(ze(p,"id","sf_"+M+"_"+J),J++),ze(p,"FRAMEBORDER","no"),ze(p,"SCROLLING","no"),ze(p,"ALLOWTRANSPARENCY",F),ze(p,"HIDEFOCUS",F),ze(p,"TABINDEX",-1),ze(p,"MARGINWIDTH",0),ze(p,"MARGINHEIGHT",0),((e,t)=>{var o,n;i(t)&&(o=function(i){var d=Ve(i);if(xe(d),d&&t)try{t.call(d,i)}catch(e){}e=t=o=n=B},n=ze(e,"id"),xe(e),n&&(Q[n]=o),Ne(e,"load",o)),o=B})(p,d),r&&Pe("attach",p,r,s),s=u=d=e=c=null,p}function Ge(e,t,i,o){return qe($e(M),e,t,i,o,F)}(e=ye.prototype).toString=e.valueOf=function e(t,i,o,n){var d,s,a,r=[];for(d in t=t||"&",i=i||"=",this)s=typeof(a=this[d]),a&&s==c||(a&&s==l&&(a=a.tagName||a.nodeType?"#node":e.apply(a,[t,i,o,n])),o&&(d=fe(d)),n||(a=fe(a)),r.push(d,i,a,t));return r[w]&&(r[r[w]-1]=""),ne(r)},o=ce("$sf.lib.lang",{ParamHash:ye,cstr:ne,cnum:function(e,t,i,o){if(typeof e!=p)try{e=e?parseFloat(e):f.NaN}catch(t){e=f.NaN}return o==B&&(o=U),i==B&&(i=j),(isNaN(e)||e<i||o<e)&&t!=B?t:e},cbool:function(e){return e&&"0"!=e&&"false"!=e&&"no"!=e&&"undefined"!=e&&"null"!=e?F:$},noop:function(){},trim:le,callable:de,guid:function(e){return ne([e||"","_",ae(),"_",re(),"_",H++])},mix:se,time:ae,rand:re,def:ce,ns:function(e,t){var i,o,n=/\[(('|")?)((\s|.)*?)(('|")?)\]/gm,d=/\./gm,s=0,a=F,l=t=t||r;if(e)if(e=ne(e))if(i=(e=le(e)).match(/(\[(.{1,})\])|(\.\w+)/gm))for(t=e[g](/(\[.*)|(\..*)/g,""),i.unshift(t);o=i[s++];){if(!l[o=o[g](n,"$3")[g](d,"")]){a=$;break}l=l[o]}else l=l[o=e];else a=$;else a=$;return a&&l||$},jssafe_html:function(e){return(e=ne(e))&&(e=(e=(e=(e=(e=(e=(e=e.replace(/(<noscript[^>]*>)(\s*?|.*?)(<\/noscript>)/gim,"")).replace(/\\/g,ue)).replace(/\"/g,pe)).replace(/\n/g,we)).replace(/\r/g,ge)).replace(/<(\/)*script([^>]*)>/gi,he)).replace(/\t/gi," "),e=ne([_,e,_]),e=_+e+_),e},isArray:function(e){return null!=e&&"string"!=typeof e&&null!=e[w]&&e.constructor==Array}}),ce("$sf.env",{isIE:V}),t=ne,i=de,(oe=Ce()).parse=Ce,o.def("$sf.env.ua",oe,B,F),V?(ee="srcElement",te="target",ze(s=$e(M),"SCROLLING","no"),q="no"!=ze(s,"SCROLLING"),d=O in r?function(){G&&clearTimeout(G),G=setTimeout(function(){try{r[O]()}catch(e){}},3e3)}:_lang.noop):(ee="target",te="currentTarget"),r.addEventListener&&!V?R="addEventListener":V&&(z=F,R="attachEvent"),s=B;try{s=v.createEvent("UIEvent")}catch(e){s=B}if(!s)try{s=v.createEvent("UIEvents")}catch(e){s=B}if(s)for(a in N)s[a]&&(N[a]=1);s=B,Ne(r,"load",Ie),Ne(r,"DOMContentLoaded",Ie),n=o.def("$sf.lib.dom",{doc:Ee,view:Le,elt:De,tagName:Me,tags:Oe,par:Re,make:$e,css:Fe,attr:ze,gc:d,append:Be,purge:function(e){var t,i=$,o=Me(e)==M;o&&(Pe("detach",e),xe(e),V||ze(e,"src",L));try{(t=Re(e))&&(t.removeChild(e),i=F,V)&&o&&d()}catch(e){}return e=t=B,i},attach:Ne,detach:Ue,ready:je,wait:function e(t){if(je())try{o.callable(t)&&t()}catch(e){}else setTimeout(function(){e(t),t=B},51)},evtCncl:function(e){var t="";if(e=e||r.event){try{e.returnValue=$}catch(e){}try{e.cancelBubble=F}catch(e){}try{e.stopped=F}catch(e){}for(t in N)if(N[t])try{e[t]()}catch(e){}}return $},evtTgt:Ve},B,F),o.def("$sf.lib.dom.iframes",{make:Ge,clone:He,replace:function(e,i,o,n,d){var s,a,r,l,c=(r=Me(c=(a=(e=e||{}).id)&&_e(a)))?c:B;(r=r==M?c:B)?(Pe("detach",r),xe(r),l=Re(r),ze(s=He(r,e,i,n,d),"onload",B),ze(s,"onreadystatechange",B)):(!(l=o&&Me(o=_e(o))?o:l)&&c&&(l=Re(c)),s=Ge(e,i=t(i)||Fe(c)||"",n,d));try{l?r?l.replaceChild(s,r):c?l.replaceChild(s,c):Be(l,s):Be(v.body,s)}catch(e){}return s=e=l=n=B,De(a)},view:function(e){var t,i,o,n,d,s,a=0;try{if(!(t=e.contentWindow||B))for(n=(i=(o=Ee(e))&&Le(o))&&i.frames||[];d=n[a++];){try{s=d.frameElement}catch(e){s=B}if(s&&s==e){t=d;break}}}catch(e){t=B}return t}},B,F),o.def("$sf.lib.logger",{log:function(e){r.console&&console.log&&console.log(e)},error:function(e){r.console&&console.error?console.error(e):r.console&&console.log&&console.log(e)}},B,F),o.def("$sf.info",{errs:[],list:[]},B,F),k.prototype.trim||(k.prototype.trim=o.trim)},hostSafeFrame:function(){function e(i){var o,n,d,s,a,r=this;if(!arguments.length)return Ht?lt({},Ht):G;if(!(r instanceof e))return new e(i);if(!i)return Ht=G;if(a=!!Ht,r.auto="auto"in i?it(i.auto):W,r.cdn=nt(i.cdn),r.debug=it(i.debug),r.root=nt(i.root),r.renderFile=nt(i.renderFile),r.msgFile=nt(i.msgFile),r.to=ot(i.to,Y),r.ver=nt(i.ver)||Ye,r.onBeforePosMsg=dt(i.onBeforePosMsg)?i.onBeforePosMsg:at,r.onPosMsg=dt(i.onPosMsg)?i.onPosMsg:at,r.onStartPosRender=dt(i.onStartPosRender)?i.onStartPosRender:at,r.onEndPosRender=dt(i.onEndPosRender)?i.onEndPosRender:at,r.onFailure=dt(i.onFailure)?i.onFailure3:at,n=i.positions,r.positions=o={},n)for(d in n)(s=n[d])&&typeof s==pe&&(o[d||s.id||rt(X)]=new t(s));Ht=r,a=!!(a&&r.auto&&Qe&&Qe.ns("$sf.host.boot"));try{a&&Ke.host.boot()}catch(e){}return lt({},Ht)}function t(i,o,n){var d,s,a=this,r=i&&typeof i||"";return a instanceof t?(r==pe?(a.id=nt(i.id),a.dest=nt(i.dest||o),a.bg=nt(i.bg)||"transparent",a.tgt=nt(i.tgt)||"_top",a.css=nt(i.css),a.w=ot(i.w,0),a.h=ot(i.h,0),a.z=ot(i.z,0),a.supports=lt({},i.supports||oe,W,W,W),a.w&&a.h?a.size=a.w+"x"+a.h:(d=nt(i.size))?(s=d.split(/x/gi),a.w=ot(s[0],0),a.h=ot(s[1],0),a.size=d):a.size=""):"string"==r?(a.id=nt(i),a.dest=nt(i.dest)):(a.dest="",a.bg="transparent",a.tgt="_top",a.css="",a.w=0,a.h=0,a.size="",a.z=0,a.supports={}),a.id=a.id||rt(X),!Ht&&n&&e(n),Ht&&(Ht.positions[a.id]=a),lt({},a)):new t(i,o,n)}function i(e,t,o){var d,a;if(!(this instanceof i))return new i(key,o,pos);d={sf_ver:nt(Ke.ver),flash_ver:n(),ck_on:s()?"1":"0"},a={},e&&typeof e==pe&&(d=lt(d,e)),t&&typeof t==ge&&o&&typeof o==pe&&(a[t]=o),this.toString=function(){var e=new St;return e.shared=d,e.non_shared=a,e.toString()},this.value=function(e,t){var i="";return e&&typeof e==ge?"shared"==(t=t&&typeof t==ge?t:"shared")?d[e]||"":e in a&&a[prop_key]||"":i}}function o(e,t){var i,o;try{(Je=Je||Ke&&Ke.lib)&&Je.logger&&q==top?t?(Je.logger.error(e),Ke.info.errs.push(e)):Je.logger.log(e):(i=d.getElementsByTagName("head")[0],(o=d.createElement("script")).type="text/plain",o.text="\x3c!-- SafeFrame "+(t?"error":"log")+": "+(e||"unknown")+" --\x3e",i.appendChild(i,o))}catch(e){}}function n(){if(Vt===G||null==Vt)if(navigator.plugins&&0<navigator.plugins.length){var e=navigator.mimeTypes;e&&e[We]&&e[We].enabledPlugin&&e[We].enabledPlugin.description&&((e=e[We].enabledPlugin).version?Vt=e.version:e.description&&(Vt=e.description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]))}else if(Ke.env.isIE)for(var t,i,o=0;o<qt.length;o++)try{i=(t=new ActiveXObject(qt[o]).GetVariable("$version")).indexOf(" "),Vt=(-1<i?t.substr(i+1):t).replace(/,/gi,".");break}catch(e){Vt=0;continue}else Vt=0;return Vt}function s(){var e=!!navigator.cookieEnabled;return void 0!==navigator.cookieEnabled||e||(document.cookie="testcookie",e=-1!=document.cookie.indexOf("testcookie"),navigator&&(navigator.cookieEnabled=e)),e}function a(e){var t=(e=e&&gt(e)||Ct)[Me],i=e[Oe];return t&&!_t&&"CSS1Compat"!=t?e.body:i}function r(e){var t=G;try{e&&(t=9==u(e)?e:e[Re]||e.ownerDocument||G)}catch(e){t=G}return t}function l(e){return e&&(e[Ne]||e.parentElement)}function c(e){return 1===u(e)}function u(e){return ot(e&&e.nodeType,-1)}function p(e){return 1===u(e)&&e.tagName.toLowerCase()||""}function g(e){return((e=nt(e))&&-1==e.search(/\D+/g)||e&&-1!=e.search(/px/gi))&&W}function w(e,t,i){var o=0,n=0;return(i=i||y(e))&&(o=st.borderTopWidth,n=st.borderLeftWidth,o=g(o)?ot(o,0):0,n=g(n)?ot(n,0):0,xt)&&/^t(?:able|d|h|r|head|foot)$/i.test(wt(e))&&(o=n=0),(t=t||{t:0,l:0}).t+=o,t.l+=n,t}function h(e){var t={x:0,y:0,w:0,h:0},i={scrollLeft:0,scrollTop:0,scrollWidth:0,scrollHeight:0},o=0,n=0,d=(e=gt(e)||Ct)[Oe]||i;i=e.body||i;return(e=e.defaultView)&&(o=ot(e.pageXOffset,0),n=ot(e.pageYOffset,0)),t.x=yt(d.scrollLeft,i.scrollLeft,o),t.y=yt(d.scrollTop,i.scrollTop,n),t.w=yt(d.scrollWidth,i.scrollWidth,0),t.h=yt(d.scrollHeight,i.scrollHeight,0),t}function f(e){var t,i,n,d,s,l,u,g,f,m,v,b,T={t:0,l:0,r:0,b:0,w:0,h:0,z:0},S="getBoundingClientRect",C=0,A=0,I=(k=r(e)||q[Re])[Me],k=k.documentMode||0;if(c(e))try{if(g=y(e),d=a(e),s=h(e),T.l=e[xe]||0,T.t=e[ke]||0,u=G,n=xt||519<kt,(l=e)!==d&&e[S])At&&(!k||0<k&&k<8||"BackCompat"===I)&&(m=d.clientLeft,v=d.clientTop),b=e[S](),T.t=b.top,T.l=b.left,(m||v)&&(T.l-=m,T.t-=v),(s.y||s.x)&&(!Ze.ios||4.2<=Ze.ios)&&(T.l+=s.x,T.t+=s.y);else{for(;(l=l[Ie])&&c(l)&&u!==l;)m=l[xe],v=l[ke],T.t+=v,T.l+=m,n&&(T=w(l,T)),u=l;if("fixed"!=g.position)for(l=e,u=G;(l=l[Ne])&&c(l)&&u!==l&&l!=d;)t=l[Ce],i=l[Ae],xt&&"visible"!=(f=y(l))[je]&&(T=w(l,T,f)),(t||i)&&(T.l-=i,T.t-=t),u=l;T.l+=s.x,T.t+=s.y}C=e==d?(A=e[Le],e[Ee]):(A=e[Pe],e[_e]),T.b=T.t+A,T.r=T.l+C,T.w=yt(C,0),T.h=yt(A,0),T.z=g.zIndex}catch(t){t&&t[He]||(t={message:"null exception"}),o("sf Exception in rect calculation tag - "+p(e)+" : "+t[He],W),T={t:0,l:0,r:0,b:0,w:0,h:0,z:0}}return T}function m(e){var t=0,i=0;return(e=a(e))&&(t=e.scrollWidth||0,i=e.scrollHeight||0),{t:0,l:0,b:i,r:t,w:t,h:i}}function v(e,t){var i=K,o=e&&e[ze]||-1,n=t&&t[ze]||-1;if(1==o&&-1!=n)if(e[Fe])if(_t||1==n)i=e[Fe](t);else for(;t;){if(e===t){i=W;break}if((t=t.parentNode)==Ct[Oe])break}else e[$e]&&(i=e===t||!!(16&e[$e](t)));return i}function y(e,t){var i="",o="getComputedStyle";if(arguments[he]&&t)if(It)try{i=e.currentStyle[t]}catch(e){i=""}else try{i=ht(e)[o](e,G)[t]}catch(e){i=""}else if(It)try{i=e.currentStyle}catch(e){i=G}else try{i=ht(e)[o](e,G)}catch(e){i=G}return i}function b(e,t,i){var o,n,d,s,l,c,u,p,g,w,m,y,b,T,S,C=f(e),A=r(e),I=a(A),k=C.t,x=C.l,_=ee,P=[],E=0;if(t=ot(t,P.on=0,0),i=ot(i,0,0),k&&!C.h&&i&&(C.h=i,C.b=k+i),x&&!C.w&&t&&(C.w=t,elrect.r=x+t),o=C.w,n=C.h,l=d=Tt(o/_),c=s=Tt(n/_),!(o<=1||n<=1||d<1||s<1)&&(S=(i=h()).y,T=i.x,y=x+o,b=k+n,A)&&I&&A[Be]){for(;l<o;){for(c=s;c<n;)p=k+c,(u=x+l)<=y&&p<=b&&P.push({x:u,y:p,on:0}),c+=s;l+=d}for(;g=P[E++];)u=yt(g.x-T,0),u=bt(u,g.x),p=yt(g.y-S,0),p=bt(p,g.y),0==u?(g.on="!x-offscreen",P.on++):0==p?(g.on="!y-offscreen",P.on++):(m=A[Be](u,p))&&m!==I&&m!==e&&!v(m,e)&&((w=pt(m,"id"))||(w=rt("geom_inter"),pt(m,"id",w)),g.on=w,P.on++)}return P}function T(e,t,i,o){return jt=jt||et.msghost_fb,e&&jt&&jt[e]&&jt[e](t,i,o)}function S(e){var t=e&&e.data,i=e&&e.source,o=(o=(n=(t=t&&-1!=JSON.stringify(t).indexOf(Ge)&&St(t))&&t.id)&&ct(n))&&ft(o),n=n&&Dt[n],d=t&&t[Ge],s=n&&n[Ge],a=(n=n&&n._xmsgcb,K);if(s&&d&&d==s&&i&&o&&o==i)try{a=n(t.msg)}catch(e){a=K}return a&&et.evtCncl(e),a}function C(e,t){var i,o,n,d=e&&Dt[e],s=K;if(d)if((i=St()).msg=t,i.guid=d.guid,zt){n=ct(e),o=ft(n);try{o[qe](nt(i),d.srcHost||"*"),s=W}catch(e){s=K}}else s=T("send",e,t);else s=T("send",e,t);return i=o=n=G,s}function A(e){var t,i,o=[],n=arguments,d=n[he],s=0,a=K;if(Ht&&(t=Ht[e])){for(;d--;)(i=n[s++])!=e&&o.push(i);try{a=t.apply(G,o)}catch(e){a=K}}return a}function I(){Bt&&(clearTimeout(Bt),Bt=0)}function k(){Nt&&(clearTimeout(Nt),Nt=0)}function x(e){k(),Nt=setTimeout(function(){(e=>{var t,i,o,n;for(t in Lt)(o=(i=Lt[t])&&i.dest)&&ct(o)&&i&&(o=St(),n=St(),o.pos=t,o.cmd=n.cmd=le,o.value=e,A(ie,t,le,e),B(i,o));k()})(e)},2)}function _(e){I(),Bt=e?setTimeout(L,J):setTimeout(E,J)}function P(e){var t,i,o,n;for(t in Lt)e&&t in Rt||(n=(n=(i=Lt[t])&&i.dest)&&ct(n))&&i&&(n=j(t,n,W),(o=St()).pos=t,o.cmd=re,o.geom=mt(n),A(ie,t,re,n),B(i,o));I()}function E(){P()}function L(){P(W)}function D(e){x(W)}function M(e){x(q[Re].hasFocus())}function O(e){_(1)}function R(e){_()}function z(e){var t,i;I();try{for(t in et.detach(q,be,O),et.detach(q,"resize",R),et.detach(q,"unload",z),et.detach(q,"focus",D),et.detach(q,"blur",M),Rt)(i=Rt[t])&&(i.tID&&clearTimeout(i.tID),et.detach(Rt[t],be,i[De]),i[De]=i.node=G),Rt[t]=G,delete Rt[t];$t=K}catch(e){}}function F(e){var t,i=K,o=St(e,G,G,W,W);if(o&&o.pos&&(t=Lt[o.pos]))switch(o.cmd){case"exp-push":V(o,W),i=W;break;case"exp-ovr":V(o),i=W;break;case"collapse":(e=>{var t,i=e&&e.pos,o=i&&Lt[i],n=o&&o.conf,d=n&&n.dest,s=d&&ct(d),a=s&&ct(Z+"-"+i),r=s&&s[we],l=a&&a[we];i&&o&&s&&a&&o.expanded&&((t=Rt[i])&&t.tID&&clearTimeout(t.tID),I(),A(te,i,de,0,0)||(r.left=r.top="0px",l[fe]=r[fe]=n.w+ve,l[me]=r[me]=n.h+ve,r.zIndex=o.dx=o.dy=0,U(d),A(ie,i,de,0,0),e.cmd="collapse",e.geom=mt(j(i,s,W)),B(o,e),s=r=a=l=o=e=G))})(o),i=W;break;case ae:(e=>{var t=e&&e.pos,i=t&&Lt[t],o=i&&i.conf,n=(o=(o=o&&o.dest)&&ct(o))&&ct(Z+"-"+t);o&&o[we],n&&n[we],A(ie,e.pos,ce,e.msg),e.cmd="msg",e.geom=mt(j(t,o,W)),B(i,e)})(o),i=W;break;case se:(e=>{var t=e&&e.pos,i=t&&Lt[t],o=(i=(i=(i=i&&i.conf)&&i.dest)&&ct(i))&&ct(Z+"-"+t);i&&i[we],o&&o[we],Ke&&Ke.info&&Ke.info.errs&&Ke.info.errs.push(e),A(ie,t,se,e)})(o),i=W;break;case re:Ke.lib.logger.log("Geom update complete: "+o.pos),i=W;break;case"read-cookie":i=t.conf&&t.conf.supports&&t.conf.supports[o.cmd]&&"0"!=t.conf.supports[o.cmd]?((e=>{var t,i=e&&e.pos,o=i&&Lt[i],n=o&&o.conf,d=(d=n&&n.dest)&&ct(d),s="read-cookie";n.supports&&n.supports[s]&&"0"!=n.supports[s]&&i&&o&&d&&(n=e.cookie)&&(t=(()=>{var e,t,i,o={};for(t=(e=document.cookie.split("; ")).length-1;0<=t;t--)o[(i=e[t].split("="))[0]]=i[1];return o})(),A(ie,s,i,0,0),e.cmd=s,e.geom=mt(j(i,d,W)),e.value=t[n],B(o,e),d=o=e=G)})(o),W):K;break;case"write-cookie":i=t.conf&&t.conf.supports&&t.conf.supports[o.cmd]&&"0"!=t.conf.supports[o.cmd]?((e=>{var t,i,o=e&&e.pos,n=o&&Lt[o],d=n&&n.conf,s=(s=d&&d.dest)&&ct(s),a="write-cookie";d.supports&&d.supports[a]&&"0"!=d.supports[a]&&o&&n&&s&&(d=e.cookie)&&(t=escape(e.value),(i=new Date).setDate(i.getDate()+1),i=t+"; expires="+i.toUTCString(),document.cookie=d+"="+i,A(ie,a,o,0,0),e.cmd=a,e.geom=mt(j(o,s,W)),e.info=t,e.value="",B(n,e),s=n=e=G)})(o),W):K}return i}function $(){var e,t=W;for(e in Mt){t=K;break}return t}function B(e,t){Ut="sending-msg-down-"+t.cmd,setTimeout(function(){var i=e&&e.dest;i&&t&&C(i,t.toString()),Ut="",t=e=G},Q)}function N(){var e=this,t=pt(e,"_pos_id");Mt[t]&&(clearTimeout(Mt[t]),delete Mt[t],Ot[t]=t,pt(e,"_pos_id",G),pt(e,"name",G),e[we].visibility="inherit",e[we].display="block",A("onEndPosRender",t)),$()||(Ut="")}function U(e,t,i,o,n){var d,s;At&&(d=ct(e),s=ct(e="shm_"+e),t?s?s[we].visibility="visible":(s=tt.clone(d,{id:e,src:"",name:e},[fe,":",i,ve,";",me,":",o,ve,";z-index:",n-1,";filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0)"]),et.append(ut(d),s)):!t&&s&&(s[we].visibility="hidden"))}function j(e,t,i){var n,d,s,a,r=St(),l={};try{et.bounds(t,l,W),i||l.isRoot||!l.canScroll||((s=l.expRect).xs||s.ys)&&(n=Rt[e],d=l.refNode,n&&n.node!=d&&(n.tID&&clearTimeout(n.tID),et.detach(void 0,be,n[De]),n.node=n[De]=G,Rt[e]=G,delete Rt[e]),Rt[e]||((n={}).node=d,n[De]=function(t){(e=>{var t=Rt[e];t&&(t.tID&&(clearTimeout(t.tID),delete t.tID),t.tID=setTimeout(function(){var i,o,n=Lt[e];(o=(o=n&&n.dest)&&ct(o))&&n&&(o=j(e,o,W),(i=St()).pos=e,i.cmd=re,i.geom=mt(o),A(ie,e,re,o),B(n,i)),delete t.tID},J))})(e)},Rt[e]=n,et.attach(d,be,n[De])))}catch(e){r=G,o("Exception in build_geom: "+(e&&e[He]||"NULL"),W)}try{r&&(r.win=St(et.winRect()),r.par=St(l.clipRect),s=St(l.expRect),(a=St(l.rect)).iv=s.iv,a.xiv=s.xiv,a.yiv=s.yiv,delete s.iv,delete s.xiv,delete s.yiv,r.exp=s,r.self=a)}catch(e){r=G,o("build_geom info error: "+(e&&e[He]||"NULL"),W)}return r}function V(e,t){var i,o,n,d,s,a,r,l,c,u,p,g,w,h,f=K,m=K,v=e&&e.pos;v&&(a=(i=Lt[v])&&i.conf,i)&&a&&(u=i.dest,o=ct(u),d=ct(Z+"-"+v),o)&&d&&(n=o[we],d=d[we],n)&&((h=Rt[v])&&h.tID&&clearTimeout(h.tID),I(),h=e.exp_obj,s=a.w,a=a.h,h?(p=ot(h.t,0,0),g=ot(h.l,0,0),w=ot(h.r,0,0),h=ot(h.b,0,0),w=ot(s+g+w,0,0),c=ot(a+p+h,0,0),p?(l=-1*p,m=W):l=0,g?(r=-1*g,f=W):r=0):(w=(f=(r=i.dx=ot(e.dx))<0)?s+-1*r:s+r,c=(m=(l=i.dy=ot(e.dy))<0)?a+-1*l:a+l),w<=s&&c<=a||A(te,v,ne,r,l)||(n[fe]=w+ve,n[me]=c+ve,f&&(n.left=r+ve),m&&(n.top=l+ve),h=ot(i.z,0),n.zIndex=h=h||ue,U(u,W,w,c,h-1),t?(d[fe]=w+ve,d[me]=c+ve):(d[fe]=s+ve,d[me]=a+ve),i.expanded=W,e.dx=r,e.dy=l,e.w=w,e.h=c,e.cmd="expand",e.geom=mt(j(v,o,W)),A(ie,v,ne,r,l),B(i,e)))}function H(){var e,t,i,o,n,d,s,a=0,r=W,l=arguments;if(!l[he]||"*"==l[a])for(e in l=[],Lt)l.push(e);for(;e=l[a++];)if(t=Lt[e]){e in Mt&&(clearTimeout(Mt[e]),delete Mt[e]),e in Ot&&delete Ot[e],n=(i=(t=t.dest)&&ct(t))&&ut(i),-1!=et.attr(n,"id").indexOf(Z)&&(n=ut(o=n)),et.purge(i),o&&et.purge(o);for(s=$sf.info.list.length-1;0<=s;s--)if((d=$sf.info.list[s])&&d.id===e){$sf.info.list.splice(s,1);break}Lt[e]=G,delete Lt[e],i=et.make("div"),et.attr(i,"id",t),et.append(n,i)}for(e in e="",Lt){r=K;break}r&&(Ut="",z())}var q,G,W,K,Y,X,Z,J,Q,ee,te,ie,oe,ne,de,se,ae,re,le,ce,ue,pe,ge,we,he,fe,me,ve,ye,be,Te,Se,Ce,Ae,Ie,ke,xe,_e,Pe,Ee,Le,De,Me,Oe,Re,ze,Fe,$e,Be,Ne,Ue,je,Ve,He,qe,Ge,We,Ke,Ye,Xe,Ze,Je,Qe,et,tt,it,ot,nt,dt,at,rt,lt,ct,ut,pt,gt,wt,ht,ft,mt,vt,yt,bt,Tt,St,Ct,At,It,kt,xt,_t,Pt,Et,Lt,Dt,Mt,Ot,Rt,zt,Ft,$t,Bt,Nt,Ut,jt,Vt,Ht,qt;q=window,K=!(W=!(G=null)),Y=6e4,X="od",Z="od-sf",J=750,ee=10,te="onBeforePosMsg",ie="onPosMsg",oe={"exp-ovr":Q=1,"exp-push":0,bg:0,pin:0,"read-cookie":0,"write-cookie":0},ne="exp-ovr",de="collapse",se="error",re="geom-update",le="focus-change",ce=ae="msg",ue=3e3,pe="object",ge="string",we="style",he="length",fe="width",me="height",ve="PX",ye="clip",Te=(be="scroll")+"Width",Se=be+"Height",Ce=be+"Top",Ae=be+"Left",Ie="offsetParent",ke="offsetTop",xe="offsetLeft",_e="offsetWidth",Pe="offsetHeight",Ee="clientWidth",Le="clientHeight",De="onscroll",Me="compatMode",Oe="documentElement",Re="document",ze="nodeType",Fe="contains",$e="compareDocumentPosition",Be="elementFromPoint",Ne="parentNode",Ue="auto",je="overflow",Ve="toFixed",He="message",qe="postMessage",Ge="guid",We="application/x-shockwave-flash",Ke=q&&q.$sf,Ye=Ke&&Ke.ver,Xe=Ke&&Ke.env,Ze=Xe&&Xe.ua,Je=Ke&&Ke.lib,Qe=Je&&Je.lang,et=Je&&Je.dom,tt=et&&et.iframes,it=Qe&&Qe.cbool,ot=Qe&&Qe.cnum,nt=Qe&&Qe.cstr,dt=Qe&&Qe.callable,at=Qe&&Qe.noop,rt=Qe&&Qe[Ge],lt=Qe&&Qe.mix,ct=et&&et.elt,ut=et&&et.par,et&&et.tags,pt=et&&et.attr,gt=et&&et.doc,wt=et&&et.tagName,ht=et&&et.view,ft=tt&&tt.view,et&&et.purge,et&&et.ready,mt=q&&q.escape,vt=q&&q.Math,yt=vt&&vt.max,bt=vt&&vt.min,Tt=vt&&vt.round,St=Qe&&Qe.ParamHash,Ct=q&&q[Re],At=Xe&&Xe.isIE,It=Ze&&Ze.ie||0,kt=Ze&&Ze.webkit||0,xt=Ze&&Ze.gecko||0,_t=Ze&&Ze.opera||0,Pt=q&&q.location,Et=Pt&&(Pt.protocol+"//"+(Pt.host||Pt.hostname)||""),Lt={},Dt={},Mt={},Ot={},Rt={},$t=Ft=zt=K,Nt=Bt=0,Ht=Vt=jt=Ut=G,qt=[(vt="ShockwaveFlash.ShockwaveFlash")+".11",vt+".8",vt+".7",vt+".6",vt],Qe&&q==top&&(Qe.def("dom",{rect:f,currentStyle:y,contains:v,docRect:m,winRect:function(e){var t=(d=e&&ht(e)||q).innerHeight||0,i=d.innerWidth||0,o=d.screenY||d.screenTop||0,n=t+o,d=d.screenX||d.screenLeft||0,s=i+d;e=a(e);return t||i||!e||(t=e.clientHeight||0,s=d+(i=e.clientWidth||0),n=o+t),{t:o,l:d,b:n,r:s,w:i,h:t}},bounds:function(e,t,i,o,n){var d,s,r,c,u,w,v,T,S,C,A,I,k,x,_,P,E,L,D,M,O,R,z,F,$,B,N,U,j,V,H,Y=e&&l(e),X=a(e),Z=f(e),J=f(X),Q=h(X),ee=m(e),te={t:0,l:0,r:0,b:0,xs:0,ys:0,xiv:0,yiv:0,iv:0,w:0,h:0},ie=[],oe={left:G,right:G,top:G,bottom:G};if(t=t&&"object"==typeof t?t:{},o=ot(o,0,0),n=ot(n,0,0),!Z.h&&n&&(Z.h=n,Z.b=Z.t+n),!Z.w&&o&&(Z.w=o,Z.r=Z.l+o),Y)for(s=J.t,r=J.l,c=J.r,u=J.b;(O=y(Y))&&("block"!=O.display&&"absolute"!=O.position&&"none"==O.float&&"none"==O.clear||(d=Y==X,T=(V=f(Y)).t,S=V.l,C=V.r,A=V.b,L=O[je+"X"],D=O[je+"Y"],M=O[je],O=d?[-1,-1,-1,-1]:(e=>{var t,i,o,n,d=[-1,-1,-1,-1],s=[ye+"Top",ye+"Right",ye+"Bottom",ye+"Left"],a=0;if(e)if(It)for(;i=s[a];)g(t=e[i])&&0<=(t=ot(t,-1))&&(d[a]=t),a++;else if((t=e[ye])&&-1!=t.search(/\d+/g))for(n=(d=(d=(t=t.replace(/\w+\(([^\)]*?)\)/g,"$1")).split(" "))[he]<=1?d.split(","):d)[he],a=0;n--;)g(o=d[a])?d[a]=ot(o,-1):d[a]=-1,a++;return d})(O),H=K,_=d?(I=Q.w,Q.h):(I=Y[Te],Y[Se]),k=Y[_e],P=Y[Pe],x=Y[Ee],E=Y[Le],!v&&x<k&&(v=k-x),!w&&E<P&&(w=P-E),d?(x<I&&(r<(S=0)&&(r=S),(C=(q.innerWidth||k)+Q.x)<c)&&(c=C),E<_&&(s<(T=0)&&(s=T),(A=(q.innerHeight||P)+Q.y)<u)&&(u=A)):(v&&C-S==k&&(C-=v),w&&A-T==P&&(A-=w),("hidden"==L||L==be||L==Ue||"hidden"==M||M==be||M==Ue)&&(r<S&&(r=S,oe.left=Y),C<c&&(c=C,oe.right=Y),L==be||M==be||(L==Ue||M==Ue)&&x<I)&&(ie.push(Y),H=W),0<O[3]&&r<(F=S+O[3])&&(r=F,oe.left=Y),0<O[1]&&($=C+O[1])<c&&(c=$,oe.right=Y),"hidden"!=D&&D!=be&&D!=Ue&&"hidden"!=M&&M!=be&&M!=Ue||(s<T&&(s=T,oe.top=Y),A<u&&(u=A,oe.bottom=Y),H)||(D==be||M==be||(D==Ue||M==Ue)&&E<_)&&(ie.push(Y),H=W),0<O[0]&&s<(R=T+O[0])&&(s=R,oe.top=Y),0<O[2]&&(z=V.t+O[2])<u&&(u=z,oe.bottom=Y))),Y!=X)&&(Y=l(Y))&&p(Y););return S=Z.l,C=Z.r,T=Z.t,A=Z.b,N=C-S,F=J.l,$=J.r,R=J.t,z=J.b,B=(U=A-T)<(B=(B=bt(A,z)-yt(T,R))<0?0:B)?U:B,j=N<(j=(j=bt(C,$)-yt(S,F))<0?0:j)?N:j,te.t=!(R<T)||z<=T?0:yt(T-R,0),te.b=!(A<z)||A<=R?0:yt(z-A,0),te.l=!(F<S)||$<=S||z<=T||A<=R?0:yt(S-F,0),te.r=!(C<$)||C<=F||z<=T?0:yt($-C,0),te.w=yt(te.r-te.l,0),te.h=yt(te.b-te.t,0),te.xiv=0<N?ot((j/N)[Ve](2)):0,te.yiv=0<U?ot((B/U)[Ve](2)):0,te.iv=0<N||0<U?ot((j*B/(N*U))[Ve](2)):0,te.civ=0,i&&.49<te.iv&&(B=(j=b(e,o,n))[he],N=ot(j.on,0))&&(U=1-ot((N/B)[Ve](2),0),te.civ=te.iv=U),t.rect=Z,t.clipRect=J,t.docRect=ee,ie[he]?(t.isRoot=K,t.canScroll=W,te.xs=!!w,te.ys=!!v):(t.isRoot=W,te.xs=!!(ee.w>J.w&&w),te.ys=!!(ee.h>J.h&&v),t.canScroll=ee.w>J.w||ee.h>J.h),t.scrollNodes=ie,t.clipNodes=oe,t.expRect=te},overlaps:b},Je,W),Qe&&(Qe.def("msghost",{prep:function(e){var t,i,o,n=G,d=(-1<(d=(o=-1<(d=Pt.href.indexOf("#"))?Pt.href.substr(0,d):Pt.href).indexOf("?"))&&(o=o.substr(0,d)),escape(o));return e&&(o=e.name,o=St(o),i=0!=(i=(t=nt(e.src))&&t.substring(0,t.indexOf("/",9))).search(/http/gi)?"":i,(n=St(o)).id=e.id||"iframe_"+rt(),n.src=t,n.srcHost=i,n[Ge]=n[Ge]||rt(),n.host=Et,n.loc=d,n.proxyID="",zt?(n.html5=1,n.proxyPath=""):(o=T("prep",n))&&(n=o),e.name=n),n},attach:function(e,t,i){var o;"iframe"==wt(e)&&(o=pt(e,"id"))&&t&&t instanceof St&&o==t.id&&(zt?((Dt[o]=t)._xmsgcb=i,Ft||(et.attach(q,He,S),Ft=W)):T("attach",e,t,i))},detach:function(e){var t=pt(e,"id"),i=t&&Dt[t],o=W;if(i){for(t in i&&(i._xmsgcb=Dt[t]=G,i=G,delete Dt[t]),t="",Dt)if((i=Dt[t])&&i[Ge]){o=K;break}o&&zt&&Ft&&(Ft=K,et.detach(q,He,S))}else T("detach",e)},usingHTML5:function(){return zt},send:C},et,W),rt(),Et=0==Et.indexOf("file")?"file":Et,(Xe="on"+He)in q?zt=W:(et.attach(q,He,vt=function(){}),"function"==typeof q[Xe]?(zt=W,et.detach(q,He,vt)):zt=K)),Qe.def("$sf.host",{Config:e,PosConfig:t,PosMeta:i,Position:function e(d,a,r,l){var c,u,p=this,g=d&&typeof d;return p instanceof e?null==Ht?o("Publisher Config not initialized - abort",W):(g==pe?lt(p,d):c=p.id=nt(d)||rt(X),a?(p.html=a,p.src=""):p.src?p.html=((g=p.src)&&(-1<(g=-1<g.indexOf("${sf_ver}")?g.replace(/\${sf_ver}/gi,$sf.ver):g).indexOf("${ck_on}")&&(u=s()?"1":"0",g=g.replace(/\${ck_on}/gi,u)),-1<g.indexOf("${flash_ver}"))&&(u=n(),g=g.replace(/\${flash_ver}/gi,u)),nt(["<scr","ipt type='text/javascript', src='",g,"'></scr","ipt>"])):(p.html=p.html||"",p.src=""),p.html||(p.html=""),null==r||r instanceof i||(r=new i(r)),p.meta=r||p.meta||new i,p.conf=l||p.conf||{},void(c&&(Ht&&Ht.positions[c]?p.conf=Ht.positions[c]:l&&(l.id=c,p.conf=new t(l))))):new e(d,a,r,l)},nuke:H,get:function(e){return(e=Lt[e])?lt({},e):null},render:function e(){var t,i,o,n,d,s,a,r,l,c,u,p,g,w=0,h=arguments;if(!Ht)return K;if(!et.ready())return et.wait(function(){e.apply(G,h),h=G}),G;for(h[0]instanceof Array&&1==h[he]&&(h=h[0]);t=h[w++];)if((o=(i=t.id)?Ht.positions[i]:G)&&(n=(r=o.dest)&&ct(r))){if(c=o.w,u=o.h,!c){try{c=n.offsetWidth}catch(e){c=0}c&&(o.w=c)}if(!u){try{u=n.offsetHeight}catch(e){u=0}u&&(o.h=u)}c&&u&&(a=new St,d=ct(l=Z+"-"+i),s=ut(n),d&&s==d&&(s=ut(d)),U(r),(p=Mt[i])&&clearTimeout(p),Ot[i]&&delete Ot[i],Mt[i]=setTimeout(function(){(e=>{var t=e&&Mt[e];t&&(clearTimeout(t),H(e),A(ie,"render-timeout",e)),$()||(Ut="")})(i)},Ht.to),Ut="rendering",A("onStartPosRender",i,o,t),p=["margin:auto;z-index:0;",fe,":",c,ve,";",me,":",u,ve,";","visibility:inherit;"],d?((g=d[we]).width=c+ve,g.height=u+ve,(g=n&&n[we]).width=c+ve,g.height=u+ve):((d=et.make("div")).id=l,d.className="iab_sf",c=n.cloneNode(K),et.css(c,p),d.appendChild(c),et.css(d,p),s.replaceChild(d,n),n=ct(r)),a.id=i,a.dest=r,a.conf=St(o),a.meta=t.meta.toString(),a.html=mt(t.html),a.geom=mt(j(i,n)),a.src=Ht.renderFile,a.has_focus=Qe.cstr(document.hasFocus()),p[13]="top:0px;left:0px;visibility:hidden;display:none;max-width:none;max-height:none;",$t||(et.attach(q,be,O),et.attach(q,"resize",R),et.attach(q,"unload",z),et.attach(q,"focus",D),et.attach(q,"blur",M),$t=W),tt.replace({id:r,name:a,src:Ht.renderFile,_pos_id:i},p,d,N,F),Lt[i]=a,delete(g=$sf.lib.lang.mix({},a,!1,!0)).geom,delete g.has_focus,$sf.info.list.push(g))}},status:function(){return Ut}},G,W)),(e=>{var t=!1,i=!0,o=null,n=e&&e.document,d=e&&e.$sf,s=d&&d.lib,a=s&&s.lang,r=s&&s.dom,l=a&&a.cstr,c=a&&a.guid,u=r&&r.elt,p=r&&r.par,g=r&&r.tags,w=r&&r.attr,h=r&&r.purge,f=r&&r.ready,m={},v=0,y=t,b=t;function T(t,i){var o,a;try{(s=s||d&&d.lib)&&s.logger&&e==top?i?(s.logger.error(t),d.info.errs.push(t)):s.logger.log(t):(o=n.getElementsByTagName("head")[0],(a=n.createElement("script")).type="text/plain",a.text="\x3c!-- SafeFrame "+(i?"error":"log")+": "+(t||"unknown")+" --\x3e",o.appendChild(o,a))}catch(e){}}function S(){var e,t;if(r)for(e in m)(t=u(e))&&(h(t),delete m[e])}function C(){var h,v,C,A,I,k,x,_,P,E,L,D,M,O,R,z=g&&g("script")||[],F=[],$=0,B=t,N=d&&d.host,U=N&&N.conf;if(!d||!a||!r)return T("SafeFrame base library not found",i),B;if(s=s||d&&d.lib,b&&y)return T("Automatic boot already invoked"),B;if(e==top){try{O=N.Config()}catch(e){O=o}if(U&&!O)try{O=N.Config(U)}catch(e){O=o}if(!O)return T("No configuration found",i),B}for(;h=z[$++];)if(("sf_data"==h.className||"text/x-safeframe"==w(h,"type"))&&(y=i,(k=w(h,"id"))||(k=c("sf_data_element"),w(h,"id",k)),!m[k])){C=h.text||h.innerHTML||h.innerText;try{C=a.trim(C),C=(C=new Function("return "+C))()}catch(e){C=o,T("Error parsing tag configuration "+(e&&e.message||""),i);continue}if(C&&C.id&&(C.html||C.src))if(e!=top)R=C.html||(R=C.src,l(["<scr","ipt type='text/javascript', src='",R,"'></scr","ipt>"])),f()?T("cannot write html content into already loaded document"):n.write(R);else if(v=p(h))if((I=O&&O.positions[C.id])||((I=C.conf).id=C.id,I=I&&new N.PosConfig(I)),I){if(I.dest||(I=new N.PosConfig(I,c("sf_position"))),C.meta){for(M in M="",E={},x=C.meta)P=typeof(_=x[M]),!L&&"object"==P&&_&&(L=_,D=M),"object"!=P&&"function"!=P&&(E[M]=_);x=new N.PosMeta(E,D||"",D&&L?L:o)}if(A=new N.Position(C,o,x,I),m[k]=k,!u(I.dest))if(f()){k=r.make("div"),w(k,"id",I.dest);try{v.insertBefore(k,h)}catch(e){T("failed auto-adding destination element "+e.message,i);continue}}else n.write("<div id='",I.dest,"'></div>");F.push(A)}else T("no position conf found pre-defined or inline for position "+C.id,i);else T("can't find parent element for script tag",i);else T("no content or id property found in the inline position object",i)}if(F.length)try{N.render(F)}catch(e){T("failed during rendering "+e.message,i)}else T("No new positions to boot");r.wait(S)}setTimeout(function n(){var s,a,l,c,u,p=i;if(!y)if(a=d&&d.host,e==top){a&&!a.boot&&(a.boot=C);try{s=a&&a.Config()}catch(e){s=o}if(!s)try{s=a&&a.conf}catch(e){s=o}s&&("auto"in s&&s.auto===t&&(p=t),!a.render||!a.Config)&&(l=s.hostFile)?(c=g("head")[0],(u=r.make("script")).id="sf_host_lib",u.type="text/javascript",u.className="sf_lib",u.src=l,e.ActiveXObject?u.onreadystatechange=function(){var e=u.readyState;"loaded"!=e&&"complete"!=e||(b=t,p&&C(),u.onreadystatechange=o,u=c=a=s=o)}:u.onload=function(){b=t,p&&C(),u.onload=o,u=c=a=s=o},b=i,c.appendChild(u)):p&&(s?(b=i,C(),b=t):v++<=100&&setTimeout(n,50))}else C()},50)})(window)}}},this._isLoaded=!1,this.isLoading=!1,this.loadPromise=null,this.callbacks=[],this.safeFrameInstance=null,this.log=o.log}executeLibraryContent(){return n(this,void 0,void 0,function*(){try{if(this.SAFEFRAME_LIBRARY_CONTENT(),window.safeFrameInit)return this.safeFrameInstance=window.safeFrameInit,this._isLoaded=!0,this.log("SafeFrame library loaded from embedded content"),this.safeFrameInstance;throw new Error("SafeFrame library content executed but safeFrameInit not found")}catch(e){throw this.log("Error executing SafeFrame library content",e),e}})}load(){return n(this,void 0,void 0,function*(){if(this._isLoaded&&this.safeFrameInstance)return this.safeFrameInstance;if(this.isLoading&&this.loadPromise)return this.loadPromise;this.isLoading=!0;try{this.loadPromise=this.executeLibraryContent();const e=yield this.loadPromise;return this.isLoading=!1,this.callbacks.forEach(t=>{try{t(e)}catch(e){this.log("Error in SafeFrame callback",e)}}),this.callbacks=[],e}catch(e){throw this.isLoading=!1,this.loadPromise=null,e}})}init(e){return n(this,void 0,void 0,function*(){if(e)for(const t of e)t.id&&this.log("SafeFrame ID found in configuration",t.id);const t=yield this.load();return e&&t.setConfig(e),t.init(),t})}isLoaded(){return this._isLoaded&&!!this.safeFrameInstance}getInstance(){return this.safeFrameInstance}onLoad(e){this._isLoaded&&this.safeFrameInstance?e(this.safeFrameInstance):this.callbacks.push(e)}reset(){this._isLoaded=!1,this.isLoading=!1,this.loadPromise=null,this.callbacks=[],this.safeFrameInstance=null;const e=window;e.safeFrameInit&&delete e.safeFrameInit,window&&window.safeFrameInit&&delete window.safeFrameInit}}const a=s},10(e,t,i){i.r(t),i.d(t,{ajax:()=>E,analyticsLog:()=>r,buildAdUnitPath:()=>F,checkSafeFrameDelivery:()=>L,checkSlotTargeting:()=>V,createGptPfUnitConfig:()=>z,cyrb53:()=>c,deepEqual:()=>D,detectBrowser:()=>u,detectOS:()=>p,deviceDetection:()=>l,emitEvent:()=>$,escapeCssContentValue:()=>T,flattenTargetingValues:()=>j,formatSizeArrayToString:()=>H,generateUuid:()=>g,getCookie:()=>N,getElapsedTime:()=>s,getPbjs:()=>R,hasNameInObject:()=>w,hasOwn:()=>P,hashString:()=>b,isA:()=>m,isArray:()=>k,isBoolean:()=>A,isClientMobile:()=>n,isClientMobileOrTablet:()=>d,isEmpty:()=>x,isFn:()=>S,isNumber:()=>I,isPlainObject:()=>v,isStr:()=>C,isValidHttpUrl:()=>_,log:()=>a,mergeDeep:()=>O,normalizeCssPropertyName:()=>y,normalizeHttpUrl:()=>U,outerHeight:()=>q,resolveOdLibUrl:()=>G,setAttributes:()=>h,setCookie:()=>B,sha256:()=>W,truncate:()=>f,uniqueArray:()=>M});var o=function(e,t,i,o){return new(i||(i=Promise))(function(n,d){function s(e){try{r(o.next(e))}catch(e){d(e)}}function a(e){try{r(o.throw(e))}catch(e){d(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}r((o=o.apply(e,t||[])).next())})};function n(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e}function d(){let e=!1;var t;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e}function s(){return(new Date).getTime()-window.odTagStartTime.getTime()}function a(e,t,i=!1){var o,n,d;(null===(o=window.odT)||void 0===o?void 0:o.debug)&&(console.log(window.odT.logPrefix+e+" (time:"+s()+"ms)","background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color: "+(i?"#ba2323":"#79ba23")),void 0!==t&&console.log(t)),(null===(n=window.odBackfill)||void 0===n?void 0:n.debug)&&(console.log(`%cBACKFILL_SA:%c ${e} (time:`+s()+"ms)","background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF"),void 0!==t&&console.log(t)),(null===(d=window.odAnalytics)||void 0===d?void 0:d.debug)&&(console.log(`%cANALYTICS_SA:%c ${e} (time:`+s()+"ms)","background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF"),void 0!==t&&console.log(t))}function r(e,t){var i,o,n,d,a;((null===(o=null===(i=window.odT)||void 0===i?void 0:i.analytics)||void 0===o?void 0:o.debugAnalytics)||(null===(d=null===(n=null===window||void 0===window?void 0:window.odAnalytics)||void 0===n?void 0:n.analytics)||void 0===d?void 0:d.debugAnalytics))&&(console.log(((null===(a=null===window||void 0===window?void 0:window.odT)||void 0===a?void 0:a.analyticsLogPrefix)||"%cOptiDigital_Debug_Analytics:%c ")+e+" (time:"+s()+"ms)","background: #79ba23;border-radius:5px;color:#286090;font-weight:700;padding:2px 5px;","color: #286090"),window.odT.debugAnalytics&&(console.log(window.odT.analyticsLogPrefix+e+" (time:"+s()+"ms)","background: #79ba23;border-radius:5px;color:#286090;font-weight:700;padding:2px 5px;","color: #286090"),void 0!==t&&console.log(t)))}function l(){if(d())return n()?{deviceCategory:"Smartphone",dDevice:"30001"}:{deviceCategory:"Tablet",dDevice:"30002"};return"Mobile"===(window.document.documentElement.clientWidth<768?"Mobile":"Desktop")?{deviceCategory:"Smartphone",dDevice:"30001"}:{deviceCategory:"Desktop",dDevice:"30000"}}function c(e,t){Math.imul||(Math.imul=function(e,t){var i=65535&e,o=65535&t;return i*o+((e>>>16&65535)*o+i*(t>>>16&65535)<<16>>>0)|0});var i=3735928559^t,o=1103547991^t;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);i=Math.imul(i^n,2654435761),o=Math.imul(o^n,1597334677)}return i=Math.imul(i^i>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(i^i>>>13,3266489909)))+(i>>>0)}function u(){let e=function(e){return e.test(window.navigator.userAgent)};switch(!0){case e(/edg/i):return"Edge";case e(/trident/i):return"Internet Explorer";case e(/firefox|fxios/i):return"Firefox";case e(/opr\//i):return"Opera";case e(/ucbrowser/i):return"UC Browser";case e(/samsungbrowser/i):return"Samsung Browser";case e(/chrome|chromium|crios/i):return"Chrome";case e(/^((?!chrome|chromium|crios|android).)*safari/i):return"Safari";default:return"Other"}}function p(){let e=window.navigator.platform,t=window.navigator.userAgent,i=null;return i=-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(e)?"Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(e)?"iOS":/Android/.test(t)?"Android":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?"Windows":!i&&/Linux/.test(e)?"Linux":"Other",i}function g(e){function t(){try{return crypto.getRandomValues(new Uint8Array(1))[0]%16}catch(e){return 16*Math.random()}}return void 0!==e?(e^t()>>e/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>{const i=Number(e);return(i^t()>>i/4).toString(16)})}function w(e,t){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const o=e[i];if((null==o?void 0:o.name)&&o.name.startsWith(t))return o.name}return!1}function h(e,t){Object.keys(t).forEach(i=>{e.setAttribute(i,t[i])})}function f(e,t,i="\u2026"){if(e.length<=t)return e;const o=Intl.Segmenter;if(!o)return e.length<=t?e:e.slice(0,Math.max(0,t-i.length))+i;const n=new o(void 0,{granularity:"grapheme"}).segment(e)[Symbol.iterator]();let d=0;for(let o=0;o<=t-i.length;o++){const t=n.next();if(t.done)return e;d=t.value.index}for(let t=0;t<i.length;t++)if(n.next().done)return e;return e.slice(0,d)+i}function m(e,t){return toString.call(e)==="[object "+t+"]"}function v(e){return m(e,"Object")}function y(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function b(e){let t=0;for(let i=0;i<e.length;i+=1)t=(t<<5)-t+e.charCodeAt(i),t|=0;return Math.abs(t).toString(36)}function T(e){return String(e).replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\A ")}function S(e){return m(e,"Function")}function C(e){return m(e,"String")}function A(e){return m(e,"Boolean")}function I(e){return m(e,"Number")}const k=Array.isArray.bind(Array);function x(e){return!e||(k(e)||C(e)?!(e.length>0):Object.keys(e).length<=0)}function _(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function E(e,t,i,o){throw new Error("Function not implemented.")}function L(e,t){var i,o,n,d,s,a;let r=!1;return Array.isArray(null===(n=null===(o=null===(i=null===window||void 0===window?void 0:window.odT)||void 0===i?void 0:i.setup)||void 0===o?void 0:o.prebidSafeframe)||void 0===n?void 0:n.bidders)&&(null===(a=null===(s=null===(d=null===window||void 0===window?void 0:window.odT)||void 0===d?void 0:d.setup)||void 0===s?void 0:s.biddersSetup)||void 0===a?void 0:a.triplelift)&&(window.odT.setup.prebidSafeframe.bidders.includes("triplelift")||window.odT.setup.prebidSafeframe.bidders.push("triplelift")),window.odT.setup.hasOwnProperty("prebidSafeframe")&&-1!=window.odT.setup.prebidSafeframe.bidders.indexOf(t.hb_bidder)&&"1800x1000"!=t.hb_size&&(r=!0,"smart"!=t.hb_bidder||-1==e.indexOf("Content_")||"300x600"!=t.hb_size&&"320x480"!=t.hb_size||(r=!1),(t.hasOwnProperty("hb_deal_appnexus")||t.hasOwnProperty("hb_deal_xandr"))&&(r=!1)),r}function D(e,t){if(e===t)return!0;if(v(e)&&v(t)){const i=Object.keys(e),o=Object.keys(t);return i.length===o.length&&i.every(i=>D(e[i],t[i]))}return!(!Array.isArray(e)||!Array.isArray(t))&&(e.length===t.length&&e.every((e,i)=>D(e,t[i])))}function M(e){const t=[];for(const i of e)t.some(e=>D(e,i))||t.push(i);return t}function O(e,...t){if(!t.length)return e;const i=t.shift();if(v(e)&&v(i))for(const t in i){const o=i[t];v(o)?(v(e[t])||(e[t]={}),O(e[t],o)):Array.isArray(i[t])?(Array.isArray(e[t])||(e[t]=[]),e[t]=M([...e[t],...i[t]])):e[t]=o}return O(e,...t)}function R(){var e,t,i,o,n,d,s,a;return(null===(e=window.odBackfill)||void 0===e?void 0:e.backfill)&&(null===(t=window.odBackfill.backfill)||void 0===t?void 0:t.hasOwnProperty("pbjs"))?window.odBackfill.backfill.pbjs:(null===(i=window.odAnalytics)||void 0===i?void 0:i.setup)&&(null===(o=window.odAnalytics.setup)||void 0===o?void 0:o.hasOwnProperty("pbjs"))?window.odAnalytics.pbjs:void 0!==(null===(n=window.odBackfill)||void 0===n?void 0:n.pbjs)?window.odBackfill.pbjs:void 0!==(null===(d=window.odAnalytics)||void 0===d?void 0:d.pbjs)?window.odAnalytics.pbjs:window._pbjsGlobals?window._pbjsGlobals&&1===window._pbjsGlobals.length?(window.odBackfill&&(window.odBackfill.pbjs=window[window._pbjsGlobals[0]]),window.odAnalytics&&(window.odAnalytics.pbjs=window[window._pbjsGlobals[0]]),window[window._pbjsGlobals[0]]):void 0:((null===(s=window.odBackfill)||void 0===s?void 0:s.debug)&&console.warn("%cBACKFILL_SA:%c prebid.js isn't loaded yet, assume it will be pbjs","background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF"),(null===(a=window.odAnalytics)||void 0===a?void 0:a.debug)&&console.warn("%cANALYTICS_SA:%c prebid.js isn't loaded yet, assume it will be pbjs","background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF"),window.pbjs=window.pbjs||{},window.pbjs.que=window.pbjs.que||[],window.odBackfill&&(window.odBackfill.pbjs=window.pbjs),window.odAnalytics&&(window.odAnalytics.pbjs=window.pbjs),window.odBackfill?window.odBackfill.pbjs:window.odAnalytics?window.odAnalytics.pbjs:window.pbjs)}function z(e){var t,i,o;let n={adUnitPath:String(F(e.getAdUnitPath())),customDimensions:{},interstitial:!1};const d=null===(i=null===(t=window.odBackfill)||void 0===t?void 0:t.backfill)||void 0===i?void 0:i.gptCustomDimensionKey;return d&&Object.keys(d).length>0&&Object.entries(d).forEach(([t,i])=>{n.customDimensions[t]=e.getTargeting(String(i))[0]}),(null===(o=e.getOutOfPage)||void 0===o?void 0:o.call(e))&&(n.interstitial=!0),n}function F(e){if("string"!=typeof e)return e;let t=e;return t.startsWith("/")||(t="/"+t),t=t.replace(/,([^/]*\/)/,"/"),t}function $(e,t={}){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function B(e,t,i,o){let n=new Date;n.setTime(n.getTime()+1e3*i);let d="expires="+n.toUTCString();document.cookie=o?e+"="+t+";"+d+";domain="+o+";path=/;sameSite=Lax":e+"="+t+";"+d+";path=/"}function N(e){let t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let o=i[e];for(;" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}function U(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;try{const e=new URL(t,window.location.origin),i=e.protocol.toLowerCase();if("http:"===i||"https:"===i)return e.toString()}catch(e){return null}return null}function j(e){return e.reduce((e,t)=>Array.isArray(t)?e.concat(j(t)):(e.push(t),e),[])}function V(e){var t,i,o,n,d,s,a,r,l,c,u,p,g,w,h,f,m;if(e){const v=e.getConfig("targeting"),y=(null===(i=null===(t=null==v?void 0:v.targeting)||void 0===t?void 0:t.hb_bidder)||void 0===i?void 0:i[0])||"",b=(null===(n=null===(o=null==v?void 0:v.targeting)||void 0===o?void 0:o.hb_pb)||void 0===n?void 0:n[0])||"",T=(null===(a=null===(s=null===(d=null==v?void 0:v.targeting)||void 0===d?void 0:d.amznbid)||void 0===s?void 0:s[0])||void 0===a?void 0:a.length)||0,S=T>0?1:0;return{hb_bidder:y,hb_pb:b,amznbid:T>1?1:0,od_pfg:"1"===(null===(l=null===(r=null==v?void 0:v.targeting)||void 0===r?void 0:r.od_pfg)||void 0===l?void 0:l[0])?1:0,od_pf_group:"1"===(null===(u=null===(c=null==v?void 0:v.targeting)||void 0===c?void 0:c.od_pf_group)||void 0===u?void 0:u[0])?1:0,od_pf_pb:(null===(g=null===(p=null==v?void 0:v.targeting)||void 0===p?void 0:p.od_pf_pb)||void 0===g?void 0:g[0])?parseFloat(v.targeting.od_pf_pb[0]):"",od_pf_ta:(null===(h=null===(w=null==v?void 0:v.targeting)||void 0===w?void 0:w.od_pf_ta)||void 0===h?void 0:h[0])||"",hb_format:(null===(m=null===(f=null==v?void 0:v.targeting)||void 0===f?void 0:f.hb_format)||void 0===m?void 0:m[0])||null,isAmznbid:S}}return{}}function H(e){return e[0]+"x"+e[1]}function q(e){const t=e.offsetHeight,i=window.getComputedStyle(e);return["top","bottom"].map(e=>parseInt(i[`margin-${e}`],10)).reduce((e,t)=>e+t,t)}function G(e,t){var i;const o=null===(i=window.optidigitalSetup)||void 0===i?void 0:i.localLibs,n=null==o?void 0:o[e];return"string"==typeof n&&n.length>0?n+("launcher"===e&&window.fullPackage?"-f.js":".js"):t}function W(e){return o(this,void 0,void 0,function*(){const t=(new TextEncoder).encode(e),i=yield crypto.subtle.digest("SHA-256",t),o=new Uint8Array(i);let n="";for(let e=0;e<o.length;e++){n+=o[e].toString(16).padStart(2,"0")}return n})}},862(e,t,i){i.d(t,{K:()=>s}),e=i.hmd(e);const o={};var n,d;function s(e){return o.TCStringParse(e)}n=o,d=function(){function e(e){return parseInt(e,2)||0}var t=function(t){return 100*e(t)},i=function(t){for(var i="A".charCodeAt(),o=t.match(/.{6}/g)||[],n="",d=0,s=o.length;d<s;d+=1){var a=e(o[d])+i;n+=String.fromCharCode(a)}return n},o=function(e){return Boolean(Number(e))},n=function(e){for(var t=e.split(""),i={},n=0,d=t.length;n<d;n+=1)i[n+1]=o(t[n]);return i},d=function(e){for(var t=e.split(""),i={},n=0,d=Math.min(11,t.length);n<d;n+=1)i[n+1]=o(t[n]);return i},s=function(e){for(var t=e.split(""),i={},n=0,d=Math.min(1,t.length);n<d;n+=1)i[n+1]=o(t[n]);return i};return function(a){function r(e,t,i,d){function s(){if(d.pubRestrictionEntry&&d.rangeEntry)for(var t in d.rangeEntry)Object.prototype.hasOwnProperty.call(d.rangeEntry,t)&&(d.pubRestrictionEntry[t]=(d.pubRestrictionEntry[t]||[]).concat(d.rangeEntry[t]));d.numPubRestrictions&&(--d.numPubRestrictions,e.push({key:"purposeId",size:6},{key:"restrictionType",size:2},{key:"numEntries",size:12}))}function a(){d.numEntries?(--d.numEntries,e.push({key:"isRange",size:1,decoder:o},{key:"startVendorId",size:16})):s()}function r(){return!d.purposeId||[{purpose:d.purposeId,isAllowed:0!==d.restrictionType,isConsentRequired:1===d.restrictionType,isLegitimateInterestRequired:2===d.restrictionType}]}if("isRangeEncoding"===t.key)e.push(i?{key:"numEntries",size:12}:{key:"bitField",size:d.maxVendorId,decoder:n});else if("numEntries"===t.key)d.rangeEntry={},a();else if("isRange"===t.key)i&&e.push({key:"endVendorId",size:16});else if("startVendorId"===t.key)d.isRange||(d.rangeEntry[i]=r(),a());else if("endVendorId"===t.key){for(var l=d.startVendorId;l<=d.endVendorId;l+=1)d.rangeEntry[l]=r();a()}else"numCustomPurposes"===t.key?e.push({key:"customPurposeConsents",size:d.numCustomPurposes,decoder:n},{key:"customPurposeLegitimateInterests",size:d.numCustomPurposes,decoder:n}):"numPubRestrictions"===t.key&&(d.pubRestrictionEntry={},s())}function l(e){return e.pubRestrictionEntry||e.rangeEntry||e.bitField||e}function c(t,i){var o=i.slice(p,p+t.size);return p+=t.size,(t.decoder||e)(o)}function u(e,t){for(var i={},o=0;o<e.queue.length;o+=1){var n=e.queue[o],d=function(e,t){if(!e.queue)return c(e,t);for(var i={},o=0;o<e.queue.length;o+=1){var n=e.queue[o],d=c(n,t);n.key&&(i[n.key]=d),r(e.queue,n,d,i)}return l(i)}(n,t);n.key&&(i[n.key]=d),r(e.queue,n,d,i)}return l(i)}var p=0;return function(){for(var n=function(t){if("string"!=typeof t)throw new Error("Invalid transparency and consent string specified");for(var i=t.split("."),o=[],n=0,d=i.length;n<d;n+=1)o.push(function(e){for(var t="",i=0,o=e.length;i<o;i+=1){var n=e.charCodeAt(i).toString(2);t+="00000000".slice(0,8-n.length)+n}return t}(function(e){if("function"==typeof atob){var t=e.replace(/_/g,"/").replace(/-/g,"+");try{return atob(t)}catch(e){throw new Error("Unable to decode transparency and consent string")}}if("function"==typeof Buffer)return Buffer.from(e,"base64").toString("binary");throw new Error("Unable to detect base64 decoder")}(i[n])));var s=e(o[0].slice(0,6));if(2!==s)throw new Error("Unsupported transparency and consent string version "+s);return o}(a),r=function(n){for(var a=[{key:"purposeConsents",size:24,decoder:d},{key:"purposeLegitimateInterests",size:24,decoder:d}],r=[{key:"maxVendorId",size:16},{key:"isRangeEncoding",size:1,decoder:o}],l=[{key:"version",size:6},{key:"created",size:36,decoder:t},{key:"lastUpdated",size:36,decoder:t},{key:"cmpId",size:12},{key:"cmpVersion",size:12},{key:"consentScreen",size:6},{key:"consentLanguage",size:12,decoder:i},{key:"vendorListVersion",size:12},{key:"policyVersion",size:6},{key:"isServiceSpecified",size:1,decoder:o},{key:"useNonStandardStacks",size:1,decoder:o},{key:"specialFeatureOptins",size:12,decoder:s}].concat(a).concat({key:"purposeOneTreatment",size:1,decoder:o},{key:"publisherCountryCode",size:12,decoder:i},{key:"vendorConsents",queue:[{key:"maxVendorId",size:16},{key:"isRangeEncoding",size:1,decoder:o}]},{key:"vendorLegitimateInterests",queue:r},{key:"publisherRestrictions",queue:[{key:"numPubRestrictions",size:12}]}),c=[{size:3}],u=[].concat(c).concat(r),p=[].concat(c).concat(r),g=[].concat(c).concat(a).concat({key:"numCustomPurposes",size:6}),w=[{key:"core",queue:l}],h=1;h<n.length;h+=1){var f=e(n[h].slice(0,3));1===f?w.push({key:"disclosedVendors",queue:u}):2===f?w.push({key:"allowedVendors",queue:p}):3===f&&w.push({key:"publisherTC",queue:g})}return w}(n),l={},c=0;c<r.length;c+=1){var g=r[c],w=u(g,n[c]);g.key&&(l[g.key]=w),p=0}l.publisherTC=l.publisherTC||{},l.publisherTC.purposeConsents=l.publisherTC.purposeConsents||{},l.publisherTC.purposeLegitimateInterests=l.publisherTC.purposeLegitimateInterests||{};for(var h=1;h<=11;h+=1)h in l.publisherTC.purposeConsents||(l.publisherTC.purposeConsents[h]=!1),h in l.publisherTC.purposeLegitimateInterests||(l.publisherTC.purposeLegitimateInterests[h]=!1);return l}()}},"function"==typeof define&&i.amdO?define([],d):e.exports?e.exports=d():n.TCStringParse=d()}},t={};function i(o){var n=t[o];if(void 0!==n)return n.exports;var d=t[o]={id:o,loaded:!1,exports:{}};return e[o](d,d.exports,i),d.loaded=!0,d.exports}i.amdO={},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};class o{constructor(e,t,i){this.screen=e,this.setup=t,this.divIdPrefix=i}addInterstitial(e){var t,i,o,n;if((null===(t=this.setup.adSlotsConfig)||void 0===t?void 0:t.hasOwnProperty(`disable${this.screen}Interstitial`))&&this.setup.adSlotsConfig[`disable${this.screen}Interstitial`])return;const d=(null===(i=this.setup.adSlotsConfig)||void 0===i?void 0:i[`nameInterstitial${this.screen}`])||`${this.screen}_Interstitial`,{cdValue:s,adUnitPathSuffix:a,customKeyValues:r}=(null===(n=null===(o=this.setup.adSlotsConfig)||void 0===o?void 0:o.adSlotsDefinitions)||void 0===n?void 0:n.find(e=>e.name===d))||{};e[d]=Object.assign(Object.assign(Object.assign({name:d,adUnit:d,divId:`${this.divIdPrefix}${d}`,loadType:this.getLoadType(),lazyLoadPx:900,dfpSizes:[[320,480],[336,280],[300,250],[250,250]]},s&&{cdValue:s}),a&&{customAdUnitCode:a}),r&&{customKeyValues:r})}isInterstitialSlot(e){return e.toLowerCase().includes("interstitial")}getLoadType(){return 6}}class n{constructor(e,t,i){this.screen=e,this.setup=t,this.divIdPrefix=i}addSideRails(e){var t,i,o,n,d;((null===(i=null===(t=this.setup.adSlotsConfig)||void 0===t?void 0:t.sideRailsConfig)||void 0===i?void 0:i.enableLeft)||(null===(n=null===(o=this.setup.adSlotsConfig)||void 0===o?void 0:o.sideRailsConfig)||void 0===n?void 0:n.enableRight))&&document.documentElement.clientWidth>=1200&&document.documentElement.clientHeight>=650&&Object.keys((null===(d=this.setup.adSlotsConfig)||void 0===d?void 0:d.sideRailsConfig)||{}).forEach(t=>{var i,o,n,d,s,a;if(null===(o=null===(i=this.setup.adSlotsConfig)||void 0===i?void 0:i.sideRailsConfig)||void 0===o?void 0:o[t]){const i="enableLeft"===t?"Left":"Right",o=(null===(d=null===(n=this.setup.adSlotsConfig)||void 0===n?void 0:n.sideRailsConfig)||void 0===d?void 0:d[`nameSiderail${i}`])||`SideRail_${i}`,{cdValue:r,adUnitPathSuffix:l,refreshDelay:c,customKeyValues:u}=(null===(a=null===(s=this.setup.adSlotsConfig)||void 0===s?void 0:s.adSlotsDefinitions)||void 0===a?void 0:a.find(e=>e.name===o))||{};e[o]=Object.assign(Object.assign(Object.assign(Object.assign({name:o,adUnit:o,divId:`${this.divIdPrefix}${o}`,loadType:this.getLoadType(),lazyLoadPx:900,dfpSizes:[]},r&&{cdValue:r}),l&&{customAdUnitCode:l}),c&&{refreshDelay:c}),u&&{customKeyValues:u})}})}isSideRailSlot(e){return e.toLowerCase().includes("siderail")}getLoadType(){return 7}}var s=i(10);class a{constructor(e,t,i,o,n,d,a){this.rewardedAdDivId="",this.adSlotsDefinitions={},this.rewardedAdListenersRegistered=!1,this.grantedRewardedAdSlotNames=[],this.rewardedAdPayload=null,this.rewardedAdsReady=!1,this.tools=s,this.log=s.log.bind(s),this.screen=e,this.setup=t,this.divIdPrefix=i,this.rewardedAdCookie=o,this.rewardedAdFrequency=n,this.rewardedAdFrequencyImps=d,this.rewardedAdFrequencyInterval=a}addRewardedAds(e,t=!1,i=`${this.screen}_RewardedAd`){var o,n,d,s,a,r,l,c,u,p,g;if(!t&&!(null===(o=this.setup.adSlotsConfig)||void 0===o?void 0:o.hasOwnProperty("rewardedAdConfiguration")))return this.log("[Rewarded AD] Configuration not found for normal flow"),!1;if(!t&&!(null===(n=this.setup.adSlotsConfig)||void 0===n?void 0:n.rewardedAdConfiguration)||!this.checkRewardedAdFrequency()||(null===(d=this.setup.adSlotsConfig)||void 0===d?void 0:d.hasOwnProperty(`disable${this.screen}RewardedAd`))&&this.setup.adSlotsConfig[`disable${this.screen}RewardedAd`])return!1;if(!this.checkRewardedAdFrequency())return this.log("[Rewarded AD] Frequency limit reached"),!1;if((null===(s=this.setup.adSlotsConfig)||void 0===s?void 0:s.hasOwnProperty(`disable${this.screen}RewardedAd`))&&this.setup.adSlotsConfig[`disable${this.screen}RewardedAd`])return this.log("[Rewarded AD] Disabled by ad slot configuration"),!1;(null===(a=this.setup.adSlotsConfig)||void 0===a?void 0:a.hasOwnProperty(`nameRewardedAd${this.screen}`))?i=null===(r=this.setup.adSlotsConfig)||void 0===r?void 0:r[`nameRewardedAd${this.screen}`]:(null===(l=this.setup.adSlotsConfig)||void 0===l?void 0:l.hasOwnProperty("rewardedAdConfiguration"))&&(null===(c=this.setup.adSlotsConfig.rewardedAdConfiguration)||void 0===c?void 0:c.hasOwnProperty(`nameRewardedAd${this.screen}`))&&(i=null===(u=this.setup.adSlotsConfig.rewardedAdConfiguration)||void 0===u?void 0:u[`nameRewardedAd${this.screen}`]);const{cdValue:w,adUnitPathSuffix:h,customKeyValues:f}=(null===(g=null===(p=this.setup.adSlotsConfig)||void 0===p?void 0:p.adSlotsDefinitions)||void 0===g?void 0:g.find(e=>e.name===i))||{};return e[i]=Object.assign(Object.assign(Object.assign({name:i,adUnit:i,divId:`${this.divIdPrefix}${i}`,loadType:this.getLoadType(),lazyLoadPx:900,dfpSizes:[[320,480],[336,280],[300,250],[250,250]]},w&&{cdValue:w}),h&&{customAdUnitCode:h}),f&&{customKeyValues:f}),this.adSlotsDefinitions[i]=e[i],!0}isRewardedAdSlot(e){return e.toLowerCase().includes("rewardedad")}getLoadType(){return 8}rewardedAdSlotReady(e){var t;(null===(t=window.optidigitalToolbox)||void 0===t?void 0:t.hasOwnProperty("rewardedSlotReady"))&&window.optidigitalToolbox.rewardedSlotReady(e)}rewardedAdSlotGranted(e){var t;(null===(t=window.optidigitalToolbox)||void 0===t?void 0:t.hasOwnProperty("rewardedSlotGranted"))&&window.optidigitalToolbox.rewardedSlotGranted(e)}rewardedAdSlotClosed(e){var t;(null===(t=window.optidigitalToolbox)||void 0===t?void 0:t.hasOwnProperty("rewardedSlotClosed"))&&window.optidigitalToolbox.rewardedSlotClosed(e)}setRewardedAdDivId(e){this.rewardedAdDivId=e}get odT(){return window.odT}getLauncherGptAdSlots(){var e,t;return null!==(t=null===(e=this.odT)||void 0===e?void 0:e.gptAdSlots)&&void 0!==t?t:{}}setLauncherGptAdSlots(e,t){var i;const o=null===(i=this.odT)||void 0===i?void 0:i.gptAdSlots;o&&(o[e]=t)}getLauncherInitConfigAdUnit(){var e,t,i;return null!==(i=null===(t=null===(e=this.odT)||void 0===e?void 0:e.initConfig)||void 0===t?void 0:t.adUnit)&&void 0!==i?i:""}getGPTSlot(e){const t=this.getLauncherGptAdSlots();return e in t?[t[e]]:[]}setLauncherFinalAdSlots(e,t){var i,o;const n=null===(o=null===(i=this.odT)||void 0===i?void 0:i.finalAdSlotsConfig)||void 0===o?void 0:o.adSlotsDefinitions;n&&(n[e]=t)}pushLauncherFirstLoadAdSlots(e){var t,i;null===(i=null===(t=this.odT)||void 0===t?void 0:t.firstLoadAdSlots)||void 0===i||i.push(e)}filterLauncherLazyLoadPendingAdSlots(){const e=this.odT;(null==e?void 0:e.lazyLoadPendingAdSlots)&&(null==e?void 0:e.firstLoadAdSlots)&&(e.lazyLoadPendingAdSlots=e.lazyLoadPendingAdSlots.filter(t=>!e.firstLoadAdSlots.includes(t)))}handleRewardedAdsUncropping(){var e,t;null===(t=null===(e=this.odT)||void 0===e?void 0:e.handleRewardedAdsUncropping)||void 0===t||t.call(e)}getRewardedAdDivId(){return this.rewardedAdDivId}checkRewardedAdFrequency(){if(!0===this.rewardedAdFrequency){const e=this.getCookie(this.rewardedAdCookie);if(void 0!==e&&e>=this.rewardedAdFrequencyImps)return!1}return!0}incrementRewardedAdFrequency(e){let t=e.tools.getCookie(e.rewardedAdCookie);t.length>0?t++:t=1,e.tools.setCookie(e.rewardedAdCookie,t,e.rewardedAdFrequencyInterval)}getCookie(e){var t;const i=`; ${document.cookie}`.split(`; ${e}=`);if(2===i.length){const e=null===(t=i.pop())||void 0===t?void 0:t.split(";").shift();return e?parseInt(e,10):0}return 0}setFrequency(e){var t,i,o,n;this.rewardedAdCookie=null!==(t=e.cookieName)&&void 0!==t?t:this.rewardedAdCookie,this.rewardedAdFrequency=null!==(i=e.frequency)&&void 0!==i?i:this.rewardedAdFrequency,this.rewardedAdFrequencyImps=null!==(o=e.frequencyImps)&&void 0!==o?o:this.rewardedAdFrequencyImps,this.rewardedAdFrequencyInterval=null!==(n=e.frequencyInterval)&&void 0!==n?n:this.rewardedAdFrequencyInterval}createRewardedAdSlot(e=this.screen+"_RewardedAd",t=!1){var i,o,n,d,s,a,r,l,c;let u;if(!0===t){if(!this.addRewardedAds({},!0,e))return this.log("[Rewarded AD] Failed to add rewarded ad definition"),!1;this.setLauncherFinalAdSlots(e,this.adSlotsDefinitions[e]),this.pushLauncherFirstLoadAdSlots(e),this.filterLauncherLazyLoadPendingAdSlots(),u=(null===(i=this.setup.adSlotsConfig)||void 0===i?void 0:i[`nameRewardedAd${this.screen}`])||""}else{if(!(null===(o=this.setup.adSlotsConfig)||void 0===o?void 0:o.rewardedAdConfiguration))return this.log("[Rewarded AD] Configuration not found"),!1;u=(null===(d=null===(n=this.setup.adSlotsConfig)||void 0===n?void 0:n.rewardedAdConfiguration)||void 0===d?void 0:d[`nameRewardedAd${this.screen}`])||""}if(8==(null===(s=this.adSlotsDefinitions[e])||void 0===s?void 0:s.loadType)&&(e.toLowerCase().includes("_rewardedad")||e.toLowerCase().includes(null==u?void 0:u.toLowerCase()))){if((null===(a=this.getGPTSlot(e))||void 0===a?void 0:a.length)>0)return this.log("[Rewarded AD] Slot already declared on google tag"),!1;const i=u||e;this.setRewardedAdDivId(i.toLowerCase());let o=window.googletag.defineOutOfPageSlot(`${this.getLauncherInitConfigAdUnit()}${this.adSlotsDefinitions[e].customAdUnitCode?"/"+this.adSlotsDefinitions[e].customAdUnitCode:""}`,window.googletag.enums.OutOfPageFormat.REWARDED);if(o){let i=this.setup.adSlotsConfig&&this.setup.adSlotsConfig.adManagerKeyName?this.setup.adSlotsConfig.adManagerKeyName:(null===(c=null===(l=null===(r=this.setup)||void 0===r?void 0:r.customTargeting)||void 0===l?void 0:l.adslot)||void 0===c?void 0:c.name)?this.setup.customTargeting.adslot.name:"adslot";if(o.setConfig({targeting:{[i]:this.adSlotsDefinitions[e].cdValue?this.adSlotsDefinitions[e].cdValue:this.adSlotsDefinitions[e].adUnit}}),o.addService(googletag.pubads()),this.adSlotsDefinitions[e].customKeyValues)for(let t in this.adSlotsDefinitions[e].customKeyValues)o.setConfig({targeting:{[t]:this.adSlotsDefinitions[e].customKeyValues[t]}});if(this.setLauncherGptAdSlots(this.adSlotsDefinitions[e].name,o),this.log("[Rewarded AD] Created adslot "+e),this.rewardedAdListenersRegistered)this.log("[Rewarded AD] Listeners already registered");else{this.log("[Rewarded AD] Registering listeners");const e=this;googletag.pubads().addEventListener("rewardedSlotReady",t=>{var i,o;let n=e.grantedRewardedAdSlotNames;const d=e.getLauncherGptAdSlots(),s=Object.keys(d).find(e=>d[e]===t.slot)||"";if(n.includes(s)&&(n=n.filter(e=>e!==s)),e.rewardedAdSlotReady(t),null===(o=null===(i=e.setup.adSlotsConfig)||void 0===i?void 0:i.rewardedAdConfiguration)||void 0===o?void 0:o.enableForArticles){e.rewardedAdsReady=!0;const i=document.getElementById("od_rwdad_enable_reward_ad");i&&(i.classList.remove("od-loading"),i.addEventListener("click",i=>{t.makeRewardedVisible(),e.log("[Rewarded AD] Ad is active.")}))}}),googletag.pubads().addEventListener("rewardedSlotClosed",i=>{var o,n;e.rewardedAdSlotClosed(i),(null===(n=null===(o=e.setup.adSlotsConfig)||void 0===o?void 0:o.rewardedAdConfiguration)||void 0===n?void 0:n.enableForArticles)&&e.rewardedAdPayload&&(e.rewardedAdPayload=null);const d=e.getLauncherGptAdSlots(),s=i.slot?Object.keys(d).find(e=>d[e]===i.slot):Object.keys(d).find(t=>e.isRewardedAdSlot(t)),a=i.slot||(s?d[s]:null);if(a&&s){googletag.destroySlots([a]),delete d[s];const i=performance.now(),o=()=>{performance.now()-i>=300?e.grantedRewardedAdSlotNames.includes(s)||e.createRewardedAdSlot(s,t)&&window.googletag.cmd.push(function(){window.googletag.pubads().refresh(e.getGPTSlot(s))}):requestAnimationFrame(o)};requestAnimationFrame(o)}}),googletag.pubads().addEventListener("rewardedSlotGranted",t=>{var i,o;const n=e.getLauncherGptAdSlots();e.grantedRewardedAdSlotNames.push(Object.keys(n).find(e=>n[e]===t.slot)||""),!0===e.rewardedAdFrequency&&e.incrementRewardedAdFrequency(e),e.rewardedAdSlotGranted(t),(null===(o=null===(i=e.setup.adSlotsConfig)||void 0===i?void 0:i.rewardedAdConfiguration)||void 0===o?void 0:o.enableForArticles)&&(e.rewardedAdPayload=t.payload,e.handleRewardedAdsUncropping())}),this.rewardedAdListenersRegistered=!0}return this.log("[Rewarded AD] Slot created - "+e),!0}return this.log("[Rewarded AD] Failed to create adslot - "+e),!1}return this.log("[Rewarded AD] Slot not created - "+e),!1}}class r{constructor(e,t,i){this.stickyAdDivIds={},this.stickyAdModes={},this.stickyAdStatuses={},this.stickyAdTopTriggers={},this.stickyAdAutoHidePxValues={},this.screen=e,this.setup=t,this.divIdPrefix=i}getStickyAdConfigurations(){var e;const t=this.setup,i=this.screen,o=`${i}_Sticky_`,n=(null===(e=null==t?void 0:t.adSlotsConfig)||void 0===e?void 0:e.stickyAdConfiguration)||(null==t?void 0:t.stickyAdConfiguration);if(!n)return[];if("object"==typeof n){const e=Object.keys(n),t=e.some(e=>e.includes(o)),d=e.some(e=>e.includes("_Sticky_"));if(t){const e=[];for(const[t,o]of Object.entries(n))t.includes(i)&&e.push({slotName:t,config:o});return e}if(d)return[];const s=this.getStickyAdName(n);return s?[{slotName:s,config:n}]:[]}return[]}getStickyAdConfigurationBySlotName(e,t){var i,o,n;const d=`name${this.screen}`;if(t&&t.length>0){const i=t.find(({slotName:t,config:i})=>t===e||i&&i[d]===e);if(i)return i.config}const s=null===(o=null===(i=this.setup)||void 0===i?void 0:i.adSlotsConfig)||void 0===o?void 0:o.stickyAdConfiguration;if(s&&"object"==typeof s&&!Array.isArray(s)){if(!Object.keys(s).some(e=>e.includes(`${this.screen}_Sticky_`)))return s;{const t=s,i=Object.values(t).find(t=>t&&"object"==typeof t&&t[d]===e);if(i)return i;if(t[e])return t[e]}}const a=null===(n=this.setup)||void 0===n?void 0:n.stickyAdConfiguration;return a||null}createStickyAd(e,t){var i,o,n,d;if(!e||"string"!=typeof e)return void(t.log&&t.log("createStickyAd NOSTICKY because adSlotName is invalid"));const{initConfigAdUnit:s,log:a,getCookie:r,firstLoadAdSlots:l=[],setAttributes:c,stickyAutoCloseScroll:u,refreshAdSlots:p,onLegacyStateUpdate:g,adLayoutEnabled:w}=t,h=this.screen,f=this.setup,m=this.getCookieName(e),v=this.getStickyAdConfigurations();let y=this.getStickyAdConfigurationBySlotName(e,v);const b=/[^a-zA-Z0-9]/g,T=(null===(i=null==f?void 0:f.adSlotsConfig)||void 0===i?void 0:i.stickyAdConfiguration)||(null==f?void 0:f.stickyAdConfiguration);if(!y)return;const S=Number(null==y?void 0:y.frequency)||0,C=null==y?void 0:y.frequencyImps,A=Number(C),I=Number.isFinite(A)&&Number.isInteger(A)&&A>0;if(S&&I&&r&&m){const e=Number.parseInt(String(null!==(o=r(m))&&void 0!==o?o:""),10);if(Number.isFinite(e)&&e>=A)return void(null==a||a("createStickyAd NOSTICKY because of FREQUENCY CAPPING"))}const k=`disable${h}`,x=`adUnitsExcluded${h}`,_=(null==y?void 0:y.hasOwnProperty(k))&&y[k],P=(null==y?void 0:y.adUnitsExcluded)&&Array.isArray(y.adUnitsExcluded)&&y.adUnitsExcluded.includes(s),E=null==y?void 0:y[x],L=E&&Array.isArray(E)&&E.includes(s),D=null==f?void 0:f.adSlotsConfig,M=null===(n=null==D?void 0:D.adSlotsDefinitions)||void 0===n?void 0:n.some(t=>t.name===e&&0===t.status);if(_||P||L||M)return;const O=this.getStickyAdConfigKey(v,e);let R=this.getStickyAdModeFromConfig(y,O);"top"===R&&(this.setStickyAdTopTrigger(e,0),this.setStickyAdAutoHidePx(e,0));const z=`stickyAdTopTrigger${h}`,F=`stickyAdAutoHidePx${h}`,$=(null==y?void 0:y.hasOwnProperty(z))?y[z]:(null==T?void 0:T.hasOwnProperty(z))?T[z]:void 0,B=(null==y?void 0:y.hasOwnProperty(F))?y[F]:(null==T?void 0:T.hasOwnProperty(F))?T[F]:void 0;null!=$?this.setStickyAdTopTrigger(e,$):this.setStickyAdTopTrigger(e,this.getStickyAdTopTrigger(e)||0),null!=B?this.setStickyAdAutoHidePx(e,B):this.setStickyAdAutoHidePx(e,0);const N=`${this.divIdPrefix}${e}`,U=0===Object.keys(this.stickyAdDivIds).length;this.setStickyAdMode(e,R),this.setStickyAdDivId(e,N),this.setStickyAdStatus(e,"off");const j=this.getStickyAdTopTrigger(e),V=this.getStickyAdAutoHidePx(e);g&&U&&g({stickyAdDivId:N,stickyAdMode:R,stickyAdStatus:"off",stickyAdTopTrigger:j,stickyAdAutoHidePx:V}),a&&a("createStickyAd MODE:"+R+" with ADSLOT: "+e);const H=(null==y?void 0:y.zIndex)||"10";let q=(null==y?void 0:y.adCloseTop)||"-24";"top"===R&&"-24"===q&&(q="-23");let G=document.createElement("style");const W=null==y?void 0:y[`stickyAdMode${h}X`],K="none"===W?"none":"left"===W?"left":"inner-left"===W?"inner-left":"right",Y=null==y?void 0:y.backgroundColor,X=!Y||!(Y.includes("rgba")&&parseFloat(Y.split(",")[3])<1),Z=this.isVerticalStickyAdSlot(e);let J,Q,ee,te,ie,oe,ne,de,se,ae,re;if(Z)J="top",Q="20",ee="left"===K||"inner-left"===K?"left":"right",te="10",ie="border: 1px solid #999;",oe="50%",ne="",de="50",se="50",ae="34",re="34";else{if(J="inner-left"===K||"bottom"===R?"top":"bottom",Q="inner-left"===K?"3":"-24",ee="left"===K||"inner-left"===K?"left":"right",te="inner-left"===K?"3":"0",de="24",se="24",ae="16",re="16",ie="border: none;",X)if("inner-left"===K)ie="border: 1px solid #999;";else if("bottom"===R){ie=`border-${"left"===K?"right":"left"}: 1px solid #999; border-top: 1px solid #999; border-${"left"===K?"left":"right"}: none; border-bottom: none;`}else ie="border: none;";if(oe="0px 0 0 12px","inner-left"===K?oe="50%":"top"===R?oe="left"===K?"0 0 12px 0":"0px 0 0 12px":"bottom"===R&&(oe="left"===K?"0 12px 0 0":"12px 0 0 0"),ne="",X&&"inner-left"!==K){ne=`box-shadow: 0 ${"bottom"===R?"-1px":"1px"} 1px 0 rgba(0, 0, 0, 0.2);`}}const le=Y||"#fff",ce=Z||!X?"":"border-top: 1px solid #999; box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);",ue=e.replace(b,"_"),pe=`opd_adsticky_${ue}`,ge=`opd_adsticky-scroll_${ue}`,we=`opd_adsticky-close_${ue}`,he=`opd_adclosebox_${ue}`,fe=`opd_adclose_${ue}`,me=this.getStickyAdContainerId(e);let ve="";if(Z){ve=`\n        .${pe} {\n          display: none;\n          position: fixed;\n          ${"left"===R?"left: 0;":"right: 0;"}\n          top: ${(null==y?void 0:y.topValue)||"50%"};\n          transform: translateY(-50%) scale(${(null==y?void 0:y.verticalScale)||"0.4"});\n          transform-origin: ${R} center;\n          width: 300px;\n          height: auto;\n          padding: 0;\n          text-align: center;\n          background-color: ${le};\n          z-index: ${H};\n        }\n        .${pe} .optidigital-wrapper-div {\n          width: 300px !important;\n          min-width: 300px !important;\n          max-width: 300px !important;\n          margin: 0 !important;\n          padding: 0 !important;\n        }\n      `}else ve=`\n        .${pe} {\n          display: none;\n          position: fixed;\n          margin-bottom: 0;\n          ${R}: 0;\n          left: 0;\n          width: 100%;\n          height: auto;\n          padding: 5px 0 4px;\n          text-align: center;\n          background-color: ${le};\n          ${ce}\n        }\n      `;(null==y?void 0:y.biggerCloseIcon)&&(ve+=`\n        .${he}::before {\n          content: '';\n          display: block;\n          width: 70px;\n          height: 70px;\n          position: absolute;\n          ${J}: -${te}px !important;\n          ${ee}: -${te}px !important;\n        }\n      `),G.innerHTML=`\n      ${ve}\n      .${ge}:not(.${we}) {\n        display: block;\n      }\n      /* Hide sticky ad when close class is present - works for both base and scroll states */\n      .${pe}.${we},\n      .${ge}.${we},\n      [id="${me}"].${we} {\n        display: none !important;\n        visibility: hidden !important;\n        opacity: 0 !important;\n      }\n      .${he} {\n        appearance: none;\n        cursor: pointer;\n        position: absolute;\n        pointer-events: auto;\n        z-index: ${parseInt(H)+1};\n        ${"none"===K?"display: none;":""}\n        ${J}: ${Q}px !important;\n        ${ee}: ${te}px !important;\n        width: ${de}px;\n        height: ${se}px;\n        padding: 0px 0 0 0px;\n        background-color: ${le};\n        ${ie}\n        border-radius: ${oe};\n        font-size: 1.4em;\n        color: #444;\n        ${ne}\n      }\n      .${fe} {\n        position: absolute;\n        left: ${Z?"6":"left"===K||"inner-left"===K?"2":"4"}px;\n        top: ${Z?"6":"inner-left"===K?"3":"4"}px;\n        width: ${ae}px;\n        height: ${re}px;\n        opacity: 1;\n        text-align: center;\n        pointer-events: none;\n      }\n      .${fe}:before,\n      .${fe}:after {\n        position: absolute;\n        content: ' ';\n        height: ${ae}px;\n        width: 2px;\n        background-color: #333;\n      }\n      .${fe}:before {\n        transform: rotate(45deg);\n      }\n      .${fe}:after {\n        transform: rotate(-45deg);\n      }\n    `;const ye=document.body;if(ye)ye.appendChild(G);else{const e=setInterval(()=>{document.body&&(document.body.appendChild(G),clearInterval(e))},50)}let be=document.createElement("div");const Te=`z-index:${H};`;c?c(be,{id:me,class:`opd_adsticky ${pe}`,style:Te}):(be.id=me,be.className=`opd_adsticky ${pe}`,be.setAttribute("style",Te));let Se=document.createElement("span");Se.setAttribute("class",`opd_adclose ${fe}`);let Ce=document.createElement("button");Ce.type="button";const Ae=Z?"":`${"bottom"===R?"top":"bottom"}:${"inner-left"===K?"3":q}px!important;`;c?c(Ce,{class:`opd_adclosebox ${he}`,style:Ae}):(Ce.className=`opd_adclosebox ${he}`,Ae&&Ce.setAttribute("style",Ae));const Ie=this,ke=function(t){return t.preventDefault(),t.stopPropagation(),Ie.closeStickyAd(e,g),!1};Ce.addEventListener("click",ke,!1),Ce.addEventListener("mousedown",ke,!1),Ce.addEventListener("touchstart",ke,!1);let xe=document.createElement("div");c?c(xe,{id:N,class:e,style:"display: none;"}):(xe.id=N,xe.className=e,xe.setAttribute("style","display: none;")),w||xe.classList.add("optidigital-ad-center"),Ce.appendChild(Se),"bottom"==R?(be.appendChild(Ce),be.appendChild(xe)):(be.appendChild(xe),be.appendChild(Ce)),0==j&&(this.setStickyAdStatus(e,"init"),l.push(e),g&&g({stickyAdStatus:"init"}));const _e=(null==y?void 0:y.stickyTarget)||"body",Pe=document.querySelector(_e);if(Pe)Pe.appendChild(be);else if(ye)ye.appendChild(be);else{const e=setInterval(()=>{const t=document.querySelector(_e);t?(clearInterval(e),t.appendChild(be)):document.body&&(clearInterval(e),document.body.appendChild(be))},50)}if(!(null===(d=window.odT)||void 0===d?void 0:d._stickyScrollListenerAdded)){window.odT=window.odT||{},window.odT._stickyScrollListenerAdded=!0;let e=!1;const t=document.body,i=document.documentElement,o=e=>{let t=be.getAttribute("style")||"";t.includes("display:")?t=t.replace("block"===e?"display: none;":"display: block;","block"===e?"display: block;":"display: none;"):t+="block"===e?"display: block;":"display: none;",c?c(be,{id:me,style:t}):(be.id=me,be.setAttribute("style",t))};document.addEventListener("scroll",()=>{e||(e=!0,requestAnimationFrame(()=>{var n;const d=t.scrollTop||i.scrollTop,s=null===(n=window.odT)||void 0===n?void 0:n.stickyAdapter;if(!s)return void(e=!1);s.getAllStickyAdSlotNames().forEach(e=>{const t=s.getStickyAdTopTrigger(e)||0,i=s.getStickyAdMode(e),n=s.getStickyAdStatus(e);if(d>t&&("off"===n||"hidden"===n))if("hidden"===n)s.setStickyAdStatus(e,"rendered"),o("block");else{s.setStickyAdStatus(e,"init");const t=window.odT;(null==t?void 0:t.userAction)&&!t.userAction.length&&t.userAction.push("triggerSticky"),p&&p(e)}d<t&&"rendered"===n&&(s.setStickyAdStatus(e,"hidden"),o("none"));const a=s.getStickyAdAutoHidePx(e)||0;if("top"===i&&"rendered"===n&&a>0){const t=s.getStickyAdContainerId(e),i=document.getElementById(t);if(i){const t=`opd_adsticky-close opd_adsticky-close_${e.replace(b,"_")}`;d>a?i.classList.remove(t):u&&i.classList.add(t)}}}),e=!1}))},{passive:!0})}}getStickyAdConfigKey(e,t){for(const{slotName:i,config:o}of e)if(i===t||(null==o?void 0:o[`name${this.screen}`])===t)return i;return t}closeStickyAd(e,t){try{const i=this.getStickyAdContainerId(e),o=document.getElementById(i);if(o){const i=`opd_adsticky-close_${e.replace(/[^a-zA-Z0-9]/g,"_")}`;o.classList.add("opd_adsticky-close",i),this.setStickyAdStatus(e,"closed");const n=this.getStickyAdDivId(e);if(t){const e=window.odT;if(e&&e.stickyAdDivId===n){t({stickyAdStatus:"closed"});const e=document.getElementById("opd_bottomstickyad");e&&e.classList.add("opd_adsticky-close")}}}}catch(e){}}getStickyAdName(e,t){var i;const o=this.screen,n=this.setup,d=`name${o}`,s=`mode${o}`;if(null==e?void 0:e[d])return e[d];if(t)return t;const a=e||(null===(i=null==n?void 0:n.adSlotsConfig)||void 0===i?void 0:i.stickyAdConfiguration)||(null==n?void 0:n.stickyAdConfiguration);if(!a||"object"!=typeof a||Array.isArray(a))return;const r=a;if(r[d])return r[d];const l=Object.keys(r);if(l.some(e=>e.includes("_Sticky_"))&&!l.some(e=>e.includes(`${o}_Sticky_`)))return;const c={"sticky-top":"top","sticky-left":"left","sticky-right":"right"};let u="bottom";if(r.hasOwnProperty(s)){u=c[r[s]]||"bottom"}if(u){return{left:`${o}_Sticky_Left`,right:`${o}_Sticky_Right`,top:`${o}_Sticky_Top`,bottom:`${o}_Sticky_Bottom`}[u]}}getStickyAdContainerId(e){return e.toLowerCase().includes("bottom")?"opd_bottomstickyad":`opd_sticky_${e.replace(/[^a-zA-Z0-9]/g,"_")}`}getCookieName(e){return`opd_sticky_${e.replace(/[^a-zA-Z0-9]/g,"_")}`}updateStickyFrequency(e){const t=this.getStickyAdConfigurations(),i=this.getCookieName(e);let o=this.getStickyAdConfigurationBySlotName(e,t);if(!o)return;const n=Number(null==o?void 0:o.frequency)||0,d=Number(null==o?void 0:o.frequencyInterval),s=Number.isFinite(d)&&Number.isInteger(d)&&d>0,a=window.odT;if(n>0&&s&&(null==a?void 0:a.getCookie)&&(null==a?void 0:a.setCookie)){const e=a.getCookie(i),t=Number.parseInt(String(null!=e?e:""),10),o=(Number.isFinite(t)?t:0)+1;a.setCookie(i,o,d)}}getStickyAdModeFromConfig(e,t){if(t){const e=t.toLowerCase().split("_").pop();if(e&&["top","bottom","left","right"].includes(e))return e}if(e.hasOwnProperty(`mode${this.screen}`)){const t=e[`mode${this.screen}`];if("sticky-top"==t)return"top";if("sticky-left"==t)return"left";if("sticky-right"==t)return"right"}return"bottom"}isVerticalStickyAdSlot(e){const t=this.getStickyAdConfigurations();for(const{slotName:i,config:o}of t)if(i.toLowerCase()===e.toLowerCase()||(null==o?void 0:o[`name${this.screen}`])===e){const e=i.toLowerCase();return e.includes("sticky")&&(e.includes("left")||e.includes("right"))}const i=e.toLowerCase();return i.includes("sticky")&&(i.includes("left")||i.includes("right"))}isStickyAdSlot(e){return!!this.getStickyAdConfigurations().find(({slotName:t,config:i})=>t.toLowerCase()===e.toLowerCase()||(null==i?void 0:i[`name${this.screen}`])===e)}hasFallback(e){return!!this.getFallback(e)}getFallback(e){const t=this.getStickyAdConfigurations(),i=this.getStickyAdConfigurationBySlotName(e,t);if(null==i?void 0:i.fallback){const e=i.fallback,o=this.getStickyAdConfigurationBySlotName(e,t);return(null==o?void 0:o[`name${this.screen}`])||e}return null==i?void 0:i.fallback}isFallback(e){const t=this.getStickyAdConfigurations(),i=this.getStickyAdConfigurationBySlotName(e,t);return!(!(null==i?void 0:i.hasOwnProperty("isFallback"))||!0!==i.isFallback)}isVerticalStickySlot(e){if(!this.isStickyAdSlot(e))return!1;return!!this.getStickyAdMode(e)&&this.isVerticalStickyAdSlot(e)}getLoadType(e){return e&&this.isVerticalStickyAdSlot(e)?9:5}getLoadTypes(){return[5,9]}getVerticalSizes(){return[["fluid"],[300,600],[300,350],[300,250],[336,280],[160,600],[120,600],[250,250],[200,200]]}getHorizontalSizes(){return"Mobile"===this.screen?[[320,50],[320,80],[320,100],[300,100],[300,50]]:[[1e3,90],[970,90],[728,90]]}filterVerticalSizes(e){return e.filter(e=>{if(!Array.isArray(e))return!1;if(1===e.length&&"fluid"===e[0])return!0;if(2!==e.length)return!1;const t=e[0],i=e[1];return"number"==typeof t&&"number"==typeof i&&i>t})}getStickyAdDivId(e){return this.stickyAdDivIds[e]}getStickyAdMode(e){return this.stickyAdModes[e]}getStickyAdStatus(e){return this.stickyAdStatuses[e]}getStickyAdTopTrigger(e){return this.stickyAdTopTriggers[e]}getStickyAdAutoHidePx(e){return this.stickyAdAutoHidePxValues[e]}getAllStickyAdSlotNames(){return Object.keys(this.stickyAdDivIds)}getStickyAdSlotNameFromDivId(e){for(const[t,i]of Object.entries(this.stickyAdDivIds))if(i===e)return t;return null}shouldRefreshStickyAd(e,t){if(!e)return!1;const i=this.getStickyAdContainerId(e),o=document.getElementById(i),n=`opd_adsticky-scroll_${e}`,d=`opd_adsticky-close_${e}`,s=t||!o||!o.classList.contains(n),a=!o||!o.classList.contains(d);return s&&a}setStickyAdDivId(e,t){this.stickyAdDivIds[e]=t}setStickyAdMode(e,t){this.stickyAdModes[e]=t}setStickyAdStatus(e,t){this.stickyAdStatuses[e]=t}setStickyAdTopTrigger(e,t){this.stickyAdTopTriggers[e]=t}setStickyAdAutoHidePx(e,t){this.stickyAdAutoHidePxValues[e]=t}setStickyAdState(e,t){this.setStickyAdDivId(e,t.divId),this.setStickyAdMode(e,t.mode),this.setStickyAdStatus(e,t.status),this.setStickyAdTopTrigger(e,t.topTrigger),this.setStickyAdAutoHidePx(e,t.autoHidePx)}addStickyAdSlots(e,t){var i;const o=this.screen,n=this.divIdPrefix,d=this.setup,s=`${o}_Sticky_`,a=`stickyAdTopTrigger${o}`,r=`stickyAdAutoHidePx${o}`,l=null===(i=null==d?void 0:d.adSlotsConfig)||void 0===i?void 0:i.adSlotsDefinitions,c=this.getStickyAdConfigurations().filter(({slotName:e})=>e.startsWith(s));0!==c.length&&c.forEach(({slotName:i,config:d})=>{const s=i,c=`${n}${s}`;if(!document.getElementById(c))return;const u=null==l?void 0:l.find(e=>e.name===s),{cdValue:p,adUnitPathSuffix:g,customKeyValues:w,outOfPage:h,adTemplate:f}=u||{},m=this.getStickyAdModeFromConfig(d),v=d[a]||0,y=d[r]||100;e[s]=Object.assign(Object.assign(Object.assign(Object.assign({name:s,adUnit:s,divId:c,loadType:this.getLoadType(s),lazyLoadPx:0,lazyLoadPxWithCore:900,dfpSizes:[],adTemplate:f||`${o}sticky`},p&&{cdValue:p}),g&&{customAdUnitCode:g}),w&&{customKeyValues:w}),h&&{outOfPage:h});const b={divId:c,mode:m,status:"off",topTrigger:v,autoHidePx:y};this.setStickyAdState(s,b),t.setStickyAdState(s,b)})}getStickyNames(){var e,t,i,o,n;const d=this.getStickyAdConfigurations();if(d.length>0)return d.map(({slotName:e,config:t})=>this.getStickyAdName(t,e)||e).filter(e=>e);{const d=(null===(i=null===(t=null===(e=window.odT)||void 0===e?void 0:e.setup)||void 0===t?void 0:t.adSlotsConfig)||void 0===i?void 0:i.stickyAdConfiguration)||(null===(n=null===(o=window.odT)||void 0===o?void 0:o.setup)||void 0===n?void 0:n.stickyAdConfiguration),s=(null==d?void 0:d[`name${this.screen}`])||this.getStickyAdName(d)||null;return s?[s]:[]}}}var l=function(e,t,i,o){return new(i||(i=Promise))(function(n,d){function s(e){try{r(o.next(e))}catch(e){d(e)}}function a(e){try{r(o.throw(e))}catch(e){d(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}r((o=o.apply(e,t||[])).next())})};class c{constructor(e){var t;this.pendingContentFetch=null,this.config=Object.assign({mode:"multiple",ctaEnabled:!1,ctaText:"Read More",ctaBackgroundColor:"#ff5533",ctaTextColor:"#ffffff",brandEnabled:!1,fontFamily:"Arial, sans-serif",textDecoration:"none",containerBorder:"none",headerText:"Read more",headerEnabled:!0,headerBorder:"3px solid #3b5998"},null===(t=null==e?void 0:e.adSlotsConfig)||void 0===t?void 0:t.houseReads)}getHouseReads(e,t){var i;this.injectStyles(),(null===(i=window.odT)||void 0===i?void 0:i.aiContent)&&Object.keys(window.odT.aiContent).length>0?this.handleCachedContent(e,t):(this.pendingContentFetch||(this.pendingContentFetch=this.checkAvailability().then(e=>(window.odT.aiContent=e,this.pendingContentFetch=null,e)).catch(e=>{throw window.odT.log("[House Reads] Failed to load content:",e,!0),this.pendingContentFetch=null,e})),this.pendingContentFetch.then(()=>{this.handleCachedContent(e,t)}).catch(i=>{this.sendAdRequestEvent(null!=e?e:"unknown",t,!1)}))}handleCachedContent(e,t){var i;const o=(null===(i=window.odT)||void 0===i?void 0:i.aiContent)&&Object.keys(window.odT.aiContent).length>0;e&&o?this.insertLayoutToAdSlot(e,t):this.sendAdRequestEvent(null!=e?e:"unknown",t,!1)}injectStyles(){if(document.getElementById(c.STYLE_ELEMENT_ID))return;const e=document.createElement("style");e.id=c.STYLE_ELEMENT_ID,e.textContent=`\n      /* Base styles for all house reads */\n      .od-house-reads-ads-url {\n        text-decoration: none!important;\n        display: flex;\n        justify-content: center;\n        cursor: pointer;\n      }\n      .od-house-reads-ads {\n        font-family: ${this.config.fontFamily};\n        box-sizing: border-box;\n        display: flex;\n        flex-wrap: wrap;\n        overflow: hidden;\n        border: ${this.config.containerBorder};\n        position: relative;\n        isolation: isolate;\n      }\n\n      .od-house-reads-ads::before {\n        content: '';\n        position: absolute;\n        inset: 0;\n        z-index: -1;\n        ${this.config.backgroundColor?`background-color: ${this.config.backgroundColor};`:"mix-blend-mode: difference;"}\n      }\n\n      .od-house-reads-ads-brand {\n        width: 100%;\n        display: flex;\n        align-items: center;\n        justify-content: flex-start;\n      }\n\n      .od-house-reads-ads-brand img {\n        width: 30px;\n        height: 30px;\n        object-fit: contain;\n      }\n\n      .od-house-reads-ads-img {\n        max-width: 100%;\n        min-height: 20px;\n        overflow: hidden;\n        isolation: isolate;\n      }\n\n      .od-house-reads-ads-img img {\n        width: 100%;\n        height: 100%;\n        object-fit: cover;\n        object-position: center;\n        border-radius: 0;\n      }\n\n      .od-house-reads-ads-content {\n        min-width: 10px;\n        display: flex;\n        justify-content: center;\n        max-width: 100%;\n      }\n\n      .od-house-reads-ads-title {\n        flex-grow: 0;\n        display: flex;\n        align-items: center;\n      }\n\n      .od-house-reads-ads-title p {\n        margin: 0;\n        font-weight: 600;\n        text-align: left;\n        text-decoration: ${this.config.textDecoration};\n        ${this.config.titleColor?`color: ${this.config.titleColor};`:"mix-blend-mode: difference;"}\n      }\n\n      .od-house-reads-ads-cta {\n        display: flex;\n        justify-content: flex-start;\n      }\n\n      .od-house-reads-ads-cta span {\n        display: inline-block;\n        text-decoration: none;\n        border-radius: 4px;\n        font-weight: bold;\n        text-transform: uppercase;\n        ${this.config.ctaTextColor?"color: "+this.config.ctaTextColor+";":this.config.ctaBackgroundColor?"":"mix-blend-mode: difference;"}\n        ${this.config.ctaBackgroundColor?"background-color: "+this.config.ctaBackgroundColor+";":this.config.ctaTextColor?"":"mix-blend-mode: difference;"}\n      }\n\n      /* Size category: EXTRA_SMALL (\u2264 16000px\xb2) */\n      .od-size-xs {\n        padding: 10px;\n      }\n\n      .od-size-xs .od-house-reads-ads-brand {\n        display: none;\n      }\n\n      .od-size-xs .od-house-reads-ads-img {\n        max-width: 70px;\n      }\n\n      .od-size-xs.od-size-minimum .od-house-reads-ads-img {\n        max-width: 50px;\n      }\n\n      .od-size-xs .od-house-reads-ads-content {\n        flex: 1 1 50px;\n        padding: 0 0 0 10px;\n        flex-direction: row;\n        align-items: center;\n      }\n\n      .od-size-xs .od-house-reads-ads-title p {\n        font-size: 10px;\n        line-height: 1;\n      }\n\n      .od-size-xs .od-house-reads-ads-cta {\n        margin-top: 0;\n        margin-left: 10px;\n      }\n\n      .od-size-xs .od-house-reads-ads-cta span {\n        padding: 6px 10px;\n        line-height: 1.1;\n        font-size: 8px;\n        min-width: 70px;\n        text-align: center;\n      }\n\n      /* Size category: SMALL (\u2264 32000px\xb2) */\n      .od-size-sm {\n        padding: 10px;\n      }\n\n      .od-size-sm .od-house-reads-ads-brand {\n        display: none;\n      }\n\n      .od-size-sm .od-house-reads-ads-img {\n        flex: 1 1 50px;\n      }\n\n      .od-size-sm .od-house-reads-ads-content {\n        flex: 1 1 100px;\n        padding: 0 0 0 5px;\n        flex-direction: column;\n        align-items: flex-end;\n      }\n\n      .od-size-sm .od-house-reads-ads-title p {\n        font-size: 11px;\n        line-height: 1.4;\n      }\n\n      .od-size-sm .od-house-reads-ads-cta {\n        margin-top: 5px;\n      }\n\n      .od-size-sm .od-house-reads-ads-cta span {\n        padding: 7px;\n        line-height: 1;\n        font-size: 11px;\n      }\n\n      /* Size category: VERTICAL (height > 500) */\n      .od-size-vertical {\n        flex-direction: column;\n        padding: 15px;\n      }\n\n      .od-size-vertical .od-house-reads-ads-brand {\n        flex: 0;\n        padding: 0 0 5px 0;\n      }\n\n      .od-size-vertical .od-house-reads-ads-img {\n        flex: 1 1 200px;\n      }\n\n      .od-size-vertical .od-house-reads-ads-content {\n        flex: 1 1 200px;\n        padding: 0;\n        flex-direction: column;\n        align-items: center;\n        padding-top: 50px;\n        justify-content: space-between;\n      }\n\n      .od-size-vertical .od-house-reads-ads-title p {\n        font-size: 16px;\n        line-height: 1.4;\n      }\n\n      .od-size-vertical .od-house-reads-ads-cta {\n        margin-top: 20px;\n        width: 100%;\n      }\n\n      .od-size-vertical .od-house-reads-ads-cta span {\n        padding: 10px 20px;\n        line-height: 1.2;\n        font-size: 14px;\n        width: 100%;\n        text-align: center;\n      }\n\n      /* Size category: VERTICAL NARROW (height > 500, width < 600) */\n      .od-size-vertical-narrow {\n        flex-direction: column;\n        padding: 15px;\n      }\n\n      .od-size-vertical-narrow .od-house-reads-ads-brand {\n        flex: 0;\n        padding: 0 0 5px 0;\n      }\n\n      .od-size-vertical-narrow .od-house-reads-ads-img {\n        flex: 1 1 200px;\n      }\n\n      .od-size-vertical-narrow .od-house-reads-ads-content {\n        flex: 1 1 200px;\n        padding: 0;\n        flex-direction: column;\n        align-items: center;\n        padding-top: 50px;\n        justify-content: space-between;\n      }\n\n      .od-size-vertical-narrow .od-house-reads-ads-title p {\n        font-size: 11px;\n        line-height: 1.4;\n      }\n\n      .od-size-vertical-narrow .od-house-reads-ads-cta {\n        margin-top: 10px;\n        width: 100%;\n      }\n\n      .od-size-vertical-narrow .od-house-reads-ads-cta span {\n        padding: 7px;\n        line-height: 1.2;\n        font-size: 11px;\n        width: 100%;\n      }\n\n      /* Size category: MEDIUM_NARROW (height > 90, height < 600, width < 400) */\n      .od-size-md-narrow {\n        padding: 10px;\n      }\n\n      .od-size-md-narrow .od-house-reads-ads-brand {\n        flex: 0 0 100%;\n        padding: 0 0 5px 0;\n      }\n\n      .od-size-md-narrow .od-house-reads-ads-img {\n        flex: 1 1 200px;\n        height: ${this.config.brandEnabled?"80":"120"}px;\n        max-height: ${this.config.brandEnabled?"80":"120"}px;\n      }\n\n      .od-size-md-narrow .od-house-reads-ads-content {\n        flex: 1 1 200px;\n        padding: 0;\n        flex-direction: column;\n        align-items: flex-end;\n      }\n\n      .od-size-md-narrow .od-house-reads-ads-title p {\n        font-size: 16px;\n        line-height: 1.4;\n      }\n\n      .od-size-md-narrow .od-house-reads-ads-cta {\n        margin-top: 10px;\n      }\n\n      .od-size-md-narrow .od-house-reads-ads-cta span {\n        padding: 7px;\n        line-height: 1.2;\n        font-size: 11px;\n      }\n\n      /* Size category: SQUARED (height > 90, height < 600, width < 300) */\n      .od-size-squared {\n        padding: 10px;\n      }\n\n      .od-size-squared .od-house-reads-ads-brand {\n        flex: 0 0 100%;\n        padding: 0 0 5px 0;\n      }\n\n      .od-size-squared .od-house-reads-ads-img {\n        flex: 1 1 200px;\n        height: ${this.config.brandEnabled?"40":"80"}px;\n        max-height: ${this.config.brandEnabled?"40":"80"}px;\n      }\n\n      .od-size-squared .od-house-reads-ads-content {\n        flex: 1 1 200px;\n        padding: 0;\n        flex-direction: column;\n        align-items: flex-end;\n      }\n\n      .od-size-squared .od-house-reads-ads-title p {\n        font-size: 13px;\n        line-height: 1.4;\n      }\n\n      .od-size-squared .od-house-reads-ads-cta {\n        margin-top: 10px;\n      }\n\n      .od-size-squared .od-house-reads-ads-cta span {\n        padding: 7px;\n        line-height: 1.2;\n        font-size: 11px;\n      }\n\n      /* Size category: MEDIUM (height > 90, width > 400) */\n      .od-size-md {\n        padding: 15px;\n        align-content: center;\n      }\n\n      .od-size-md .od-house-reads-ads-brand {\n        flex: 0 0 100%;\n        padding: 0 0 5px 0;\n      }\n\n      .od-size-md .od-house-reads-ads-img {\n        flex: 1 1 200px;\n        max-height: calc(100% - 35px);\n      }\n\n      .od-size-md .od-house-reads-ads-content {\n        flex: 1 1 200px;\n        padding: 0 0 0 15px;\n        flex-direction: column;\n        align-items: flex-end;\n      }\n\n      .od-size-md .od-house-reads-ads-title p {\n        font-size: 16px;\n        line-height: 1.4;\n      }\n\n      .od-size-md .od-house-reads-ads-cta {\n        margin-top: 10px;\n      }\n\n      .od-size-md .od-house-reads-ads-cta span {\n        padding: 10px 20px;\n        line-height: 1.2;\n        font-size: 14px;\n      }\n\n      /* Size category: DEFAULT (small) */\n      .od-size-default {\n        padding: 10px;\n      }\n\n      .od-size-default .od-house-reads-ads-brand {\n        flex: 0;\n        padding: 0 5px 0 0;\n      }\n\n      .od-size-default .od-house-reads-ads-img {\n        flex: 1 1 200px;\n        max-height: 100%;\n      }\n\n      .od-size-default .od-house-reads-ads-content {\n        flex: 1 1 200px;\n        padding: 0 0 0 15px;\n        flex-direction: column;\n        align-items: flex-start;\n      }\n\n      .od-size-default .od-house-reads-ads-title p {\n        font-size: 11px;\n        line-height: 1.4;\n      }\n\n      .od-size-default .od-house-reads-ads-cta {\n        margin-top: 10px;\n      }\n\n      .od-size-default .od-house-reads-ads-cta span {\n        padding: 6px 10px;\n        line-height: 1.1;\n        font-size: 12px;\n      }\n\n      /* multiple-article layouts */\n      .od-house-reads-ads-multiple-container {\n        display: flex;\n        justify-content: center;\n      }\n      .od-house-reads-ads-multiple {\n        font-family: ${this.config.fontFamily};\n        box-sizing: border-box;\n        display: flex;\n        flex-direction: column;\n        overflow: hidden;\n        border: ${this.config.containerBorder};\n        padding: 15px;\n        position: relative;\n        isolation: isolate;\n      }\n\n      .od-house-reads-ads-multiple::before {\n        content: '';\n        position: absolute;\n        inset: 0;\n        z-index: -1;\n        ${this.config.backgroundColor?`background-color: ${this.config.backgroundColor};`:"mix-blend-mode: difference;"}\n      }\n\n      .od-multiple-header {\n        width: 100%;\n        margin-bottom: 15px;\n        text-align: left;\n      }\n\n      .od-multiple-header-text {\n        margin: 0 !important;\n        padding: 0 0 5px 0;\n        font-size: 14px !important;\n        font-weight: 700;\n        text-transform: uppercase;\n        border-bottom: ${this.config.headerBorder};\n        display: inline-block;\n        line-height: 1.2 !important;\n        ${this.config.titleColor?`color: ${this.config.titleColor};`:"mix-blend-mode: difference;"};\n      }\n\n      .od-multiple-articles {\n        display: flex;\n        flex: 1;\n        overflow: hidden;\n      }\n\n      .od-multiple-article-item {\n        text-decoration: none!important;\n        color: inherit;\n        display: flex;\n        overflow: hidden;\n        cursor: pointer;\n        border: none!important;\n      }\n\n      .od-multiple-article-image {\n        overflow: hidden;\n        background-color: #f0f0f0;\n        isolation: isolate;\n      }\n\n      .od-multiple-article-image img {\n        width: 100%;\n        height: 100%;\n        object-fit: cover;\n        object-position: center;\n        border-radius: 0;\n      }\n\n      .od-multiple-article-title {\n        display: flex;\n        align-items: flex-start;\n        padding-top: 8px;\n      }\n\n      .od-multiple-article-title p {\n        margin: 0 !important;\n        font-size: 13px;\n        font-weight: 600;\n        line-height: 1.3;\n        text-align: left;\n        ${this.config.titleColor?"color: "+this.config.titleColor+";":"mix-blend-mode: difference;"};\n      }\n\n      /* Grid 2x2 layout (for 300x250, 336x280, etc.) */\n      .od-multiple-grid-2x2 .od-multiple-articles, .od-multiple-grid-2x1 .od-multiple-articles {\n        flex-wrap: wrap;\n        gap: 10px;\n        align-items: flex-start;\n      }\n\n      .od-multiple-grid-2x1 .od-multiple-articles {\n        align-items: flex-start;\n      }\n\n      .od-multiple-grid-2x2 .od-multiple-article-item {\n        flex: 0 0 calc(50% - 5px);\n        flex-direction: column;\n        justify-content: center;\n      }\n\n      .od-multiple-grid-2x1 .od-multiple-article-item {\n        flex: 0 0 calc(50% - 5px);\n        flex-direction: column;\n        justify-content: flex-start;\n        min-height: 100px;\n      }\n\n      .od-multiple-grid-2x2 .od-multiple-article-image, .od-multiple-grid-2x1 .od-multiple-article-image {\n        width: 100%;\n        height: 90px;\n        max-height: 90px;\n      }\n      \n      .od-multiple-grid-2x2 .od-multiple-article-image {\n        height: 120px;\n        max-height: 120px;\n      }\n\n      .od-multiple-grid-2x2 .od-multiple-article-title, .od-multiple-grid-2x1 .od-multiple-article-title  {\n        padding: 2px 0 0 0;\n      }\n\n      .od-multiple-grid-2x1 .od-multiple-article-title p {\n        font-size: 12px !important;\n        line-height: 1.3 !important;\n        margin-top: 5px !important;\n      }\n\n      .od-multiple-grid-2x2 .od-multiple-article-title p {\n        font-size: 13px !important;\n        line-height: 1.4 !important;\n        margin-top: 5px !important;\n      }\n\n      /* Grid horizontal layout (for wide slots) */\n      .od-multiple-grid-horizontal .od-multiple-articles {\n        flex-direction: row;\n        gap: 12px;\n        overflow-x: auto;\n        justify-content: space-between;\n        align-items: center;\n      }\n\n      .od-multiple-grid-horizontal .od-multiple-article-item {\n        flex: 0 0 180px;\n        flex-direction: column;\n        min-height: 150px;\n        border: none;\n      }\n\n      .od-multiple-grid-horizontal .od-multiple-article-image {\n        width: 100%;\n        height: 100px;\n        min-height: 100px;\n      }\n\n      .od-multiple-grid-horizontal .od-multiple-article-title p {\n        font-size: 13px;\n      }\n\n      /* List vertical layout (for 300x600) */\n      .od-multiple-list-vertical .od-multiple-articles {\n        flex-direction: column;\n        gap: 12px;\n        justify-content: space-evenly;\n      }\n\n      .od-multiple-list-vertical .od-multiple-article-item {\n        flex-direction: row;\n        height: auto;\n      }\n\n      .od-multiple-list-vertical .od-multiple-article-image {\n        flex: 0 0 100px;\n        width: 100px;\n        height: 100px;\n        min-height: 100px;\n        margin-right: 10px;\n      }\n\n      .od-multiple-list-vertical .od-multiple-article-title {\n        flex: 1;\n        padding-top: 0;\n        align-items: center;\n      }\n\n      .od-multiple-list-vertical .od-multiple-article-title p {\n        font-size: 13px;\n        line-height: 1.4;\n      }\n\n      /* List vertical narrow layout (for 120-299px wide, 600px+ tall slots) */\n      .od-multiple-list-vertical-narrow .od-multiple-articles {\n        flex-direction: column;\n        gap: 12px;\n        justify-content: space-evenly;\n      }\n\n      .od-multiple-list-vertical-narrow .od-multiple-article-item {\n        flex-direction: column;\n        height: auto;\n      }\n\n      .od-multiple-list-vertical-narrow .od-multiple-article-image {\n        width: 100%;\n        height: 120px;\n        min-height: 120px;\n      }\n\n      .od-multiple-list-vertical-narrow .od-multiple-article-title {\n        flex: 1;\n        padding-top: 8px;\n        align-items: flex-start;\n      }\n\n      .od-multiple-list-vertical-narrow .od-multiple-article-title p {\n        font-size: 12px;\n        line-height: 1.3;\n      }\n    `,document.head.appendChild(e)}insertLayoutToAdSlot(e,t){const i=this.findAdSlot(e);if(!i)return window.odT.log(`[House Reads] Ad slot "${e}" not found`,void 0,!0),void this.sendAdRequestEvent(e,t,!1);const o=document.getElementById(i.divId);if(!o)return window.odT.log(`[House Reads] Div "${i.divId}" not found in DOM`,void 0,!0),void this.sendAdRequestEvent(e,t,!1);const n=this.createTopArticleLayout(e);n?(this.handleStickyAdConfiguration(i),this.ensureElementVisible(o),o.innerHTML=n,window.odT.log(`[House Reads] Inserted house reads into slot "${e}"`),this.sendAdRequestEvent(e,t)):(window.odT.log(`[House Reads] No content available to insert into slot "${e}"`,void 0,!0),this.sendAdRequestEvent(e,t,!1))}findAdSlot(e){var t,i;const o=null===(i=null===(t=window.odT)||void 0===t?void 0:t.finalAdSlotsConfig)||void 0===i?void 0:i.adSlotsDefinitions;if(!o||0===Object.keys(o).length)return window.odT.log("[House Reads] No ad slots definitions found",void 0,!0),null;const n=Object.values(o).find(t=>t.name===e);return(null==n?void 0:n.divId)?n:null}handleStickyAdConfiguration(e){var t,i;const o=null===(i=null===(t=window.odT)||void 0===t?void 0:t.stickyAdapter)||void 0===i?void 0:i.getStickyAdSlotNameFromDivId(e.divId);if(!o)return;const n=window.odT.stickyAdapter.getStickyAdContainerId(o),d=`opd_adsticky-scroll_${o.replace(/[^a-zA-Z0-9]/g,"_")}`,s=document.getElementById(n);if(null==s||s.classList.add(d),window.odT.stickyAdapter.setStickyAdStatus(o,"rendered"),e.divId===window.odT.stickyAdDivId){window.odT.stickyAdStatus="rendered";const e=document.getElementById(c.LEGACY_STICKY_CONTAINER_ID);null==e||e.classList.add(c.LEGACY_STICKY_CLASS)}window.odT.stickyAdapter.updateStickyFrequency(o)}ensureElementVisible(e){"none"===e.style.display&&(e.style.display="block")}createTopArticleLayout(e){return"multiple"===this.config.mode?this.createMultiArticleLayout(e):this.createSingleArticleLayout(e)}getArticles(e=1){var t;const i=null===(t=window.odT)||void 0===t?void 0:t.aiContent;if(!(null==i?void 0:i.top_articles)||0===i.top_articles.length)return[];const o=window.location.href,n=i.top_articles.filter(e=>e.url&&!this.isCurrentPage(e.url,o));if(0===n.length)return[];const d=[],s=n.length,a=Math.min(e,s);for(let e=0;e<a;e++){const e=n[window.odT.currentArticleIndex%s];d.push(e),window.odT.currentArticleIndex=window.odT.currentArticleIndex+1}return d}isCurrentPage(e,t){try{const i=new URL(e,window.location.origin),o=new URL(t),n=i.pathname.replace(/\/$/,"");return n===o.pathname.replace(/\/$/,"")}catch(e){return!1}}isSlotLargeEnoughForMultiMode(e){const{width:t,height:i,area:o}=e,{MIN_AREA:n,MIN_WIDTH:d,MIN_HEIGHT:s,VERTICAL_MIN_HEIGHT:a,NARROW_MIN_WIDTH:r}=c.MULTI_MODE_THRESHOLDS;return t>=r&&t<d&&i>=a||(t>=d&&i>=a||t>=d&&i>=s&&o>=n)}getMultiArticleLayoutType(e){const{width:t,height:i}=e;return i>=c.MULTI_MODE_THRESHOLDS.VERTICAL_MIN_HEIGHT&&t>=c.MULTI_MODE_THRESHOLDS.NARROW_MIN_WIDTH&&t<c.MULTI_MODE_THRESHOLDS.MIN_WIDTH?"list-vertical-narrow":i>=c.MULTI_MODE_THRESHOLDS.VERTICAL_MIN_HEIGHT?"list-vertical":t>=600?"grid-horizontal":i<280?"grid-2x1":"grid-2x2"}calculateArticleCount(e,t){const{width:i,height:o}=e;if("list-vertical-narrow"===t)return 2;if("list-vertical"===t){const e=o-40,t=110,i=Math.floor(e/t);return Math.min(Math.max(i,2),4)}if("grid-horizontal"===t){const e=i-30,t=192,o=Math.floor(e/t);return Math.min(Math.max(o,2),4)}return"grid-2x2"===t||"grid-2x1"===t?2:4}createMultiArticleLayout(e){const t=this.getAdSlotDimensions(e);if(!this.isSlotLargeEnoughForMultiMode(t))return this.createSingleArticleLayout(e);const i=this.getMultiArticleLayoutType(t),o=this.calculateArticleCount(t,i),n=this.getArticles(o);return 0===n.length?"":1===n.length?this.createSingleArticleLayout(e):this.buildMultiArticleHtml(n,t,i,e)}buildMultiArticleHtml(e,t,i,o){const n=`od-house-reads-ads-multiple od-multiple-${i}`,d=e.map((e,t)=>this.buildMultiArticleItem(e,i,t,o)).join("");return`\n      <div class="od-house-reads-ads-multiple-container">\n        <div class="${n}" style="width: ${t.width}px; height: ${t.height}px;">\n          ${this.buildMultiHeader()}\n          <div class="od-multiple-articles">\n            ${d}\n          </div>\n        </div>\n      </div>\n    `}buildMultiHeader(){return this.config.headerEnabled?`<div class="od-multiple-header"><p class="od-multiple-header-text">${this.config.headerText}</p></div>`:""}buildMultiArticleItem(e,t,i,o){const n=this.sanitizeUrl(e.url),d=this.sanitizeText(e.meta_title),s=this.truncateTitle(d,"multiple"),a=this.sanitizeUrl(e.meta_image),r=a&&"#"!==a;return`\n      <a href="${n}${c.UTM_SOURCE_PARAM}${encodeURIComponent(o)}"\n         target="_blank" \n         rel="noopener noreferrer" \n         class="od-multiple-article-item"\n         aria-label="${s||"Recommended article"}">\n        ${r?`<div class="od-multiple-article-image">\n          <img src="${a}" alt="${s||""}" loading="lazy">\n        </div>`:""}\n        <div class="od-multiple-article-title">\n          <p>${s}</p>\n        </div>\n      </a>\n    `}createSingleArticleLayout(e){const t=this.getArticles(1);if(0===t.length)return"";const i=t[0],o=this.getAdSlotDimensions(e),n=this.getSizeClass(o.width,o.height,o.area);return this.buildArticleHtml(i,o,n,e)}getAdSlotDimensions(e){const t=this.findAdSlot(e);if(!t)return{width:c.DEFAULT_MAX_WIDTH,height:c.DEFAULT_MAX_HEIGHT,area:c.DEFAULT_MAX_WIDTH*c.DEFAULT_MAX_HEIGHT};if(t.houseReadsSize&&Array.isArray(t.houseReadsSize)&&2===t.houseReadsSize.length){const[e,i]=t.houseReadsSize;return{width:e,height:i,area:e*i}}return this.getLargestSize(t.dfpSizes)}getLargestSize(e){if(!e||!Array.isArray(e)||0===e.length)return{width:c.DEFAULT_MAX_WIDTH,height:c.DEFAULT_MAX_HEIGHT,area:c.DEFAULT_MAX_WIDTH*c.DEFAULT_MAX_HEIGHT};let t=c.DEFAULT_MAX_WIDTH,i=c.DEFAULT_MAX_HEIGHT,o=0;for(const n of e)if(Array.isArray(n)&&n.length>=2){const[e,d]=n;if(1800===e&&1e3===d)continue;const s=e*d;s>o&&(o=s,t=e,i=d)}return{width:t,height:i,area:o||t*i}}buildArticleHtml(e,t,i,o){const n=this.sanitizeUrl(e.url),d=this.sanitizeText(e.meta_title),s=this.truncateTitle(d,i),a=this.sanitizeUrl(e.meta_image),r=this.sanitizeUrl(this.config.brandLogoUrl),l=this.sanitizeText(this.config.ctaText),u=this.config.brandEnabled&&!i.includes("xs")&&!i.includes("sm"),p=a;return`\n      <a href="${n}${c.UTM_SOURCE_PARAM}${encodeURIComponent(o)}"\n         target="_blank" \n         rel="noopener noreferrer" \n         class="od-house-reads-ads-url"\n         aria-label="${s||"Recommended article"}">\n        <div class="od-house-reads-ads ${i}" style="width: ${t.width}px; height: ${t.height}px;">\n          ${u?this.buildBrandSection(r):""}\n          ${p?this.buildImageSection(a,s):""}\n          <div class="od-house-reads-ads-content">\n            ${s?this.buildTitleSection(s):""}\n            ${this.config.ctaEnabled?this.buildCtaSection(l):""}\n          </div>\n        </div>\n      </a>\n    `}buildBrandSection(e){return`\n      <div class="od-house-reads-ads-brand">\n        <img src="${e}" alt="" role="presentation">\n      </div>`}buildImageSection(e,t){return`\n      <div class="od-house-reads-ads-img">\n        <img src="${e}" alt="${t||""}" loading="lazy">\n      </div>`}buildTitleSection(e){return`\n      <div class="od-house-reads-ads-title">\n        <p>${e}</p>\n      </div>`}buildCtaSection(e){return`\n      <div class="od-house-reads-ads-cta">\n        <span role="button">${e}</span>\n      </div>`}sanitizeText(e){return e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"):""}sanitizeUrl(e){if(!e)return"#";const t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t.replace(/"/g,"&quot;"):"#"}truncateTitle(e,t){if(!e)return"";let i=75;return"od-size-vertical"===t||"od-size-md"===t?i=100:"multiple"===t&&(i=60),e.length>i?`${e.substring(0,i)}...`:e}getSizeClass(e,t,i){const{MIN_AREA:o,EXTRA_SMALL_AREA:n,SMALL_AREA:d,MIN_HEIGHT_THRESHOLD:s,MAX_HEIGHT_THRESHOLD:a,VERTICAL_HEIGHT_THRESHOLD:r,SMALL_WIDTH:l,NARROW_WIDTH:u,MEDIUM_NARROW_WIDTH:p}=c.SIZE_THRESHOLDS;return i<=o?`${c.SIZE_CLASSES.EXTRA_SMALL} ${c.SIZE_CLASSES.MINIMUM}`:i<=n?c.SIZE_CLASSES.EXTRA_SMALL:i<=d?c.SIZE_CLASSES.SMALL:t>s&&t<a&&e<u?c.SIZE_CLASSES.SQUARED:t>s&&t<a&&e<p?c.SIZE_CLASSES.MEDIUM_NARROW:t>r&&e<l?c.SIZE_CLASSES.VERTICAL_NARROW:t>r?c.SIZE_CLASSES.VERTICAL:t>s&&e>p?c.SIZE_CLASSES.MEDIUM:c.SIZE_CLASSES.DEFAULT}checkAvailability(){return l(this,void 0,void 0,function*(){var e,t,i,o,n;if(null===(e=window.odT)||void 0===e?void 0:e.aiContent)return window.odT.aiContent;const d=null===(n=null===(o=null===(i=null===(t=window.odT)||void 0===t?void 0:t.setup)||void 0===i?void 0:i.info)||void 0===o?void 0:o.publisherId)||void 0===n?void 0:n.toString();if(!d)return window.odT.log("[House Reads] Publisher ID not configured",void 0,!0),{};try{const e=yield this.buildContentEndpoint(d),t=yield this.fetchContent(e);return this.sortArticlesByReadRate(t),t}catch(e){return window.odT.log("[House Reads] Failed to fetch content:",e,!0),{}}})}buildContentEndpoint(e){return l(this,void 0,void 0,function*(){const t=window.location.hostname,i=window.location.pathname,o=window.optidigitalToolboxCC,n=`${e}${t}${i}`,d=yield(0,s.sha256)(n);return`${c.CONTENT_API_BASE_URL}${d}.json?domain=${encodeURIComponent(t)}&pubid=${encodeURIComponent(e)}&country=${o}`})}fetchContent(e){return l(this,void 0,void 0,function*(){const t=yield fetch(e,{method:"GET",headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return t.json()})}sortArticlesByReadRate(e){e.top_articles&&Array.isArray(e.top_articles)&&e.top_articles.sort((e,t)=>{var i,o;return(null!==(i=e.rr)&&void 0!==i?i:0)-(null!==(o=t.rr)&&void 0!==o?o:0)})}sendAdRequestEvent(e,t,i=null){var o,n,d,s;if(!(null===(o=window.odT)||void 0===o?void 0:o.analytics))return;const a=null==t?void 0:t.slot,r=null!==(d=null===(n=window.odT.tools)||void 0===n?void 0:n.checkSlotTargeting(a))&&void 0!==d?d:{},{hb_bidder:l,hb_pb:c,amznbid:u,od_pfg:p,od_pf_group:g,od_pf_pb:w}=r,h=this.findAdSlot(e),f=null!==(s=null==h?void 0:h.divId)&&void 0!==s?s:null,m=window.odT.analytics.addBidderMetrics(f,l,c,u,null),v=null==t?void 0:t.size,y=null!=v?window.odT.tools.formatSizeArrayToString(v):"null",b={divId:e,divIdFull:f,filled:!1,demandType:!1===i?"unfilled":"house_reads",lineItemId:null==t?void 0:t.lineItemId,size:y,prebidWinner:l,prebidBid:c,amazonStatus:u,oyStatus:p,oyTestGroup:g,oyPb:w,nogam:!t,bidders:Object.keys(m).length>0?m:null};window.odT.analytics.adRequestEvent(b)}}c.STYLE_ELEMENT_ID="od-house-reads-ads-styles",c.CONTENT_API_BASE_URL="https://scripts.opti-digital.com/content/",c.UTM_SOURCE_PARAM="?utm_source=house_reads&utm_campaign=",c.DEFAULT_MAX_WIDTH=400,c.DEFAULT_MAX_HEIGHT=250,c.LEGACY_STICKY_CONTAINER_ID="opd_bottomstickyad",c.LEGACY_STICKY_CLASS="opd_adsticky-scroll",c.SIZE_THRESHOLDS={MIN_AREA:16e3,EXTRA_SMALL_AREA:29e3,SMALL_AREA:48e3,MIN_HEIGHT_THRESHOLD:90,MAX_HEIGHT_THRESHOLD:600,VERTICAL_HEIGHT_THRESHOLD:500,SMALL_WIDTH:300,NARROW_WIDTH:330,MEDIUM_NARROW_WIDTH:400},c.SIZE_CLASSES={MINIMUM:"od-size-minimum",EXTRA_SMALL:"od-size-xs",SMALL:"od-size-sm",SQUARED:"od-size-squared",MEDIUM_NARROW:"od-size-md-narrow",VERTICAL_NARROW:"od-size-vertical-narrow",VERTICAL:"od-size-vertical",MEDIUM:"od-size-md",DEFAULT:"od-size-default"},c.MULTI_MODE_THRESHOLDS={MIN_AREA:75e3,MIN_WIDTH:300,MIN_HEIGHT:250,VERTICAL_MIN_HEIGHT:600,NARROW_MIN_WIDTH:120,MAX_ARTICLES:4};class u{constructor(e,t,i,d,s,l,u){this.interstitialAdapter=new o(e,t,i),this.sideRailsAdapter=new n(e,t,i),this.rewardedAdsAdapter=new a(e,t,i,d,s,l,u),this.stickyAdapter=new r(e,t,i),this.houseReadsAdapter=new c(t)}addSpecialAdSlots(e,t){this.interstitialAdapter.addInterstitial(e),this.sideRailsAdapter.addSideRails(e),this.rewardedAdsAdapter.addRewardedAds(e),t&&this.stickyAdapter.addStickyAdSlots(e,t)}isSpecialAdSlot(e){return this.interstitialAdapter.isInterstitialSlot(e)||this.sideRailsAdapter.isSideRailSlot(e)||this.rewardedAdsAdapter.isRewardedAdSlot(e)}isSpecialAdLoadType(e){return e===this.interstitialAdapter.getLoadType()||e===this.sideRailsAdapter.getLoadType()||e===this.rewardedAdsAdapter.getLoadType()||this.stickyAdapter.getLoadTypes().includes(e)}getStickyAdapter(){return this.stickyAdapter}getHouseReadsAdapter(){return this.houseReadsAdapter}}var p=function(e,t,i,o){return new(i||(i=Promise))(function(n,d){function s(e){try{r(o.next(e))}catch(e){d(e)}}function a(e){try{r(o.throw(e))}catch(e){d(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}r((o=o.apply(e,t||[])).next())})};class g{constructor(e){var t,i,o,n,d,s,a,r,l,c,u;if(this.baseAutoInsertion={parentDiv:".od-ai-wrapper",divIdPrefix:"optidigital-adslot-",interval:300,previousType:"p",positionFirst:1,dontBreakWithPreviousType:["ul","ol"],keepTheDistancePx:100,keepDistanceFromTheBottom:100,intervalIncrement:300,recurrenceLevel:2,insertAdslotBeforeTarget:!1,insertAdslotIntoTarget:!1,debug:!1},this.autoInsertionDesktop=Object.assign(Object.assign({},this.baseAutoInsertion),{adSlots:this.generateAdSlots("Content_AI_",6)}),this.autoInsertionMobile=Object.assign(Object.assign({},this.baseAutoInsertion),{adSlots:this.generateAdSlots("Mobile_AI_",6)}),this.runImmediately=!0,this.scrollHandler=()=>{var e,t,i,o;((null===(i=null===(t=null===(e=window.odT.setup)||void 0===e?void 0:e.adSlotsConfig)||void 0===t?void 0:t.aiContent)||void 0===i?void 0:i[`enable${window.odT.screen}`])||(null===(o=window.odT)||void 0===o?void 0:o.forceAiContent))&&this.addAiArticle()},this.optidigitaltagsinserter=e,this.articleContentAdded=!1,this.articleHtmlFromApi={},this.articleContentAdded||!this.optidigitaltagsinserter||!(null===(o=null===(i=null===(t=window.odT.setup)||void 0===t?void 0:t.adSlotsConfig)||void 0===i?void 0:i.aiContent)||void 0===o?void 0:o[`enable${window.odT.screen}`])&&!(null===(n=window.odT)||void 0===n?void 0:n.forceAiContent))return;window.odT.analytics.setContentMetrics(!0);const p=null===(s=null===(d=window.odT.setup)||void 0===d?void 0:d.adSlotsConfig)||void 0===s?void 0:s.rewardedAdConfiguration,g=(null==p?void 0:p.articleContentSelector)||"article",w=document.querySelector(g);(null===(r=null===(a=window.odT.setup)||void 0===a?void 0:a.adSlotsConfig)||void 0===r?void 0:r.rewardedAdConfiguration)&&(null===(u=null===(c=null===(l=window.odT.setup)||void 0===l?void 0:l.adSlotsConfig)||void 0===c?void 0:c.rewardedAdConfiguration)||void 0===u?void 0:u.enableForArticles)&&window.odT.adAdaptersFactory.rewardedAdsAdapter.checkRewardedAdFrequency()&&w||(this.runImmediately=!1),this.runImmediately?this.scrollHandler():window.addEventListener("scroll",this.scrollHandler,{passive:!0})}generateAdSlots(e,t){return Array.from({length:t},(t,i)=>`${e}${i+1}`)}addAiArticle(){var e,t,i,o,n;window.odT.log("AI-Based Content: Trying to add AI article content"),window.removeEventListener("scroll",this.scrollHandler),this.articleContentAdded=!0;const d=(null===(i=null===(t=null===(e=window.odT.setup)||void 0===e?void 0:e.adSlotsConfig)||void 0===t?void 0:t.aiContent)||void 0===i?void 0:i.articleSelector)||(null===(n=null===(o=window.odT)||void 0===o?void 0:o.analytics)||void 0===n?void 0:n.articleSelector);window.odT.log(`AI-Based Content: Article container selector: ${d}`);document.querySelector(d)?this.checkAvailability().then(e=>{var t,i,o,n,s,a,r,l,c;if(e&&Object.keys(e).length>0||window.odT.forceAiContent){this.articleHtmlFromApi=e;const u=(null==e?void 0:e.title)||(null===(o=null===(i=null===(t=window.odT.setup)||void 0===t?void 0:t.adSlotsConfig)||void 0===i?void 0:i.aiContent)||void 0===o?void 0:o.articleTitle)||"",p=(null==e?void 0:e.subtitle)||(null===(a=null===(s=null===(n=window.odT.setup)||void 0===n?void 0:n.adSlotsConfig)||void 0===s?void 0:s.aiContent)||void 0===a?void 0:a.articleHeader)||"AI-assisted contextual content, generated to enrich your reading.",g=(null==e?void 0:e.content)||(window.odT.forceAiContent?"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent pulvinar sapien nibh. Sed metus metus, gravida nec ultricies eget, venenatis ut nisl. Maecenas varius, sem ut dignissim hendrerit, sapien erat consectetur nisi, quis blandit sem libero quis tortor. Curabitur rhoncus viverra bibendum.</p><p>Nunc aliquet at magna et luctus. Ut suscipit elementum eleifend. Integer vehicula purus et enim sodales, vitae malesuada neque sagittis. Aliquam tempus, purus eget posuere mattis, quam justo consequat nibh, volutpat ultricies nunc libero non orci. Aenean tincidunt porttitor ultrices. Donec ullamcorper eu libero eget finibus.</p><p>In id enim id sem venenatis dictum non nec dolor. Donec tincidunt feugiat leo, eget volutpat lectus tincidunt at. Ut sodales ante quis est euismod, sed sollicitudin metus fermentum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris malesuada tincidunt convallis. Pellentesque vel velit a ante cursus sollicitudin at sit amet purus. Ut in dolor blandit, venenatis sapien nec, porta nunc.</p><p>Etiam sit amet mauris a neque feugiat fringilla nec sed ligula. Sed pulvinar dui nec lectus venenatis egestas. In orci quam, consequat quis leo eget, ultricies convallis arcu. Nulla accumsan lobortis lorem, a placerat risus porta et. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sed eros diam. Etiam accumsan neque turpis. Mauris congue vulputate purus, et tempus nunc cursus non. Quisque tempor ex sem.</p><p>Phasellus finibus, magna at tincidunt feugiat, erat risus luctus purus, nec facilisis lectus augue non est. Integer sit amet tortor nec sapien tincidunt malesuada. Vivamus vel odio ut erat luctus posuere.</p><p>Sed at mauris vel lorem tincidunt ultrices. Fusce sit amet turpis vitae nulla pharetra luctus. Donec ut lorem nec justo viverra gravida sit amet sed erat.</p>":""),w=(null==e?void 0:e.icon)||(null===(c=null===(l=null===(r=window.odT.setup)||void 0===r?void 0:r.adSlotsConfig)||void 0===l?void 0:l.aiContent)||void 0===c?void 0:c.articleIcon)||"",h=`\n            <div class="od-ai-header">\n            ${w?`<div class="od-ai-icon">${w}</div>`:""}\n            <div class="od-ai-titles">\n            ${u?`<h3 class="od-ai-title">${u}</h3>`:""}\n            ${p?`<p class="od-ai-subtitle">${p}</p>`:""}\n            </div>\n            </div>\n            ${g}\n          `||"";this.appendMatchingParagraph(d,h);const f=this.getAutoInsertionConfig();f?this.optidigitaltagsinserter.insertInRead(f):window.odT.log("AI-Based Content: No auto-insertion config available.")}}).catch(e=>{}):window.odT.log(`AI-Based Content: Container not found: ${d}`)}getAutoInsertionConfig(){var e,t,i;const o=`autoInsertion${window.odT.screen}`,n="Desktop"===window.odT.screen?this.autoInsertionDesktop:this.autoInsertionMobile,d=null===(i=null===(t=null===(e=window.odT.setup)||void 0===e?void 0:e.adSlotsConfig)||void 0===t?void 0:t.aiContent)||void 0===i?void 0:i[o];return d?Object.assign(Object.assign({},n),d):n}checkAvailability(){return p(this,void 0,void 0,function*(){var e,t,i,o,n;let d="https://scripts.opti-digital.com/content/";const a=window.location.hostname,r=window.location.pathname,l=null===(i=null===(t=null===(e=window.odT.setup)||void 0===e?void 0:e.info)||void 0===t?void 0:t.publisherId)||void 0===i?void 0:i.toString(),c=`${l}${a}${r}`;if(d=`${d}${yield(0,s.sha256)(c)}.json?domain=${a}&pubid=${l}`,null===(o=window.odT)||void 0===o?void 0:o.aiContent)return(null===(n=window.odT.aiContent)||void 0===n?void 0:n.enrichment)||{};try{const e=yield fetch(d,{method:"GET"});if(!e.ok)return{};const t=yield e.json();window.odT.aiContent=t;return(null==t?void 0:t.enrichment)||{}}catch(e){return{}}})}appendMatchingParagraph(e,t,i){var o,n,d,s,a,r,l;const c=document.querySelector(e);if(!c)return void window.odT.log(`AI-Based Content: Container not found: ${e}`);let u=document.createElement("style");let p=`\n      .od-ai-wrapper { min-height: ${"Desktop"===window.odT.screen?"700px":"800px"}; ${"Desktop"===window.odT.screen?"background-color: rgb(255 255 255 / 0.1); box-shadow: inset 0 0 0 rgb(255 255 255 / 0.18), inset 0 0 0 rgb(0 0 0 / 0.18), 0 4px 12px rgb(0 0 0 / 0.28); border-radius: 8px; padding: 10px;":""};}\n      .od-ai-wrapper .od-ai-title { font-size: 1.1em !important; font-weight: bold !important; margin: 0 !important; padding: 0 !important; }\n      .od-ai-wrapper .od-ai-subtitle { font-style: italic; font-size: 0.85em; margin: 0; padding: 0; }\n      .od-ai-wrapper > h2 { margin: 30px 0 10px 0 !important; padding: 0; font-weight: bold; font-size: 1em; }\n      .od-ai-wrapper > p { margin-top: 10px !important; font-weight: normal !important; }\n      .od-ai-wrapper > h3 { margin: 30px 0 10px 0 !important; padding: 0; font-weight: bold; font-size: 1em; }\n      .od-ai-wrapper > h3 + p, .od-ai-wrapper > h2 + p { margin-top: 0 !important; }\n      .od-ai-header { display: flex; ${"Desktop"===window.odT.screen?"align-items: center; gap: 15px":"align-items: flex-start; gap: 5px; flex-direction: column"}; margin: 15px 0 0 0;}\n      .od-ai-icon { line-height: 1; }\n      .od-ai-icon svg { height: 45px; width: 45px; }\n      .od-ai-footer { display: flex; gap: 8px; align-items: center; margin: 20px 0 0 0; justify-content: space-between; padding: 0; }\n      .od-ai-vote { display: flex; gap: 8px; } \n      .od-ai-vote button { background: transparent; border: 1px solid rgba(0,0,0,0.15); border-radius: 6px; padding: 6px; cursor: pointer; line-height: 0; min-width: 30px; }\n      .od-ai-vote button:hover { background: rgba(0,0,0,0.05); }\n      .od-ai-vote svg { width: 16px; height: 16px; fill: currentColor; }\n      .od-ai-vote .od-voted { opacity: 0.6; pointer-events: none; }\n      .od-ai-footer-text { font-size: ${"Desktop"===window.odT.screen?"14px":"11px"} !important; font-style: italic; margin: 0 !important; padding: 0 !important; line-height: 1.2 !important; }\n    `;u.appendChild(document.createTextNode(p)),document.getElementsByTagName("head")[0].appendChild(u);const g=this.getMostCommonParagraphWrapper(c),w=(null===(d=null===(n=null===(o=window.odT)||void 0===o?void 0:o.setup)||void 0===n?void 0:n.adSlotsConfig)||void 0===d?void 0:d.aiContent)||{},h="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,f=(void 0===w.typingEffect||!0===w.typingEffect||(null===(s=window.odT)||void 0===s?void 0:s.forceAiContent))&&!h&&!this.runImmediately;if(g){const{wrapper:e,originalP:o}=g,n=this.getPathIndices(e,o);let d=e.cloneNode(!0);const s=this.isolatePathInClone(d,n);if(s){const e=document.createElement("div");e.classList.add("od-ai-wrapper"),s===d?d=e:s.replaceWith(e),this.stripIdsRecursively(d);const o=c.children,n=null===(l=null===(r=null===(a=window.odT.setup)||void 0===a?void 0:a.adSlotsConfig)||void 0===r?void 0:r.aiContent)||void 0===l?void 0:l.insertBeforeLast;if(n&&"number"==typeof n&&o.length-n>0){const e=o[o.length-n];c.insertBefore(d,e)}else c.appendChild(d);return void(f?this.startTypewriterWhenInView(e,t,()=>{this.appendVoteControls(e),window.odT.log("AI-Based Content: AI content appended with nested structure."),i&&i()}):(e.innerHTML=t,this.appendVoteControls(e),window.odT.log("AI-Based Content: AI content appended"),i&&i()))}}const m=document.createElement("div");m.classList.add("od-ai-wrapper"),c.appendChild(m),f?this.startTypewriterWhenInView(m,t,()=>{this.appendVoteControls(m),window.odT.log("AI-Based Content: AI content using fallback structure."),i&&i()}):(m.innerHTML=t,this.appendVoteControls(m),window.odT.log("AI-Based Content: AI content appended immediately"),i&&i())}getPathIndices(e,t){const i=[];let o=t;for(;o&&o!==e;){const e=o.parentElement;if(!e)break;const t=Array.from(e.children).indexOf(o);if(-1===t)break;i.unshift(t),o=e}return i}isolatePathInClone(e,t){let i=e;for(const e of t){const t=Array.from(i.children);if(!t[e])return null;const o=t[e];for(const e of t)e!==o&&i.removeChild(e);i=o}return i}getMostCommonParagraphWrapper(e){const t=Array.from(e.querySelectorAll("p")).filter(t=>this.isEligibleParagraph(t,e));if(0===t.length)return null;const i=new Map;for(const o of t){const t=this.topLevelWrapperOf(o,e);if(!t)continue;const n=this.structureSignature(t,o),d=i.get(n);d?d.count+=1:i.set(n,{count:1,sampleWrapper:t,sampleP:o})}let o=null;for(const e of i.values())(!o||e.count>o.count)&&(o=e);return o?{wrapper:o.sampleWrapper,originalP:o.sampleP}:null}isEligibleParagraph(e,t){if(!t.contains(e))return!1;if((e.textContent||"").trim().length<40)return!1;const i=new Set(["ASIDE","NAV","FOOTER","HEADER","FIGURE","FIGCAPTION","PRE","CODE","LI","UL","OL","TABLE","THEAD","TBODY","TH","TD","BLOCKQUOTE"]);let o=e;for(;o&&o!==t;){if(i.has(o.tagName))return!1;o=o.parentElement}if(null===e.offsetParent)return!1;const n=window.getComputedStyle(e);if("none"===n.display||"hidden"===n.visibility)return!1;return 0!==e.getClientRects().length}topLevelWrapperOf(e,t){let i=e;for(;i&&i.parentElement&&i.parentElement!==t;)i=i.parentElement;return i&&i.parentElement===t?i:null}structureSignature(e,t){const i=Array.from(e.classList).sort().join(".");return`${`${e.tagName.toLowerCase()}.${i}`}|depth:${this.depthBetween(t,e)}|children:${e.children?e.children.length:0}`}depthBetween(e,t){let i=0,o=e;for(;o&&o!==t;)o=o.parentElement,i+=1;return i}stripIdsRecursively(e){e.hasAttribute&&e.hasAttribute("id")&&e.removeAttribute("id");const t=e.children||[];for(let e=0;e<t.length;e++){const i=t[e];this.stripIdsRecursively(i)}}startTypewriterWhenInView(e,t,i){try{const o=this.setupTypewriter(e,t);if(!o)return void(i&&i());const{tasks:n,speedMs:d,chunkSize:s}=o;if(!n||0===n.length)return void(i&&i());if("function"==typeof window.IntersectionObserver){new IntersectionObserver((e,t)=>{for(const o of e)if(o.isIntersecting){t.disconnect(),this.runTyping(n,d,s).then(()=>{i&&i()});break}},{threshold:.1}).observe(e)}else this.runTyping(n,d,s).then(()=>{i&&i()})}catch(o){e.innerHTML=t,i&&i()}}setupTypewriter(e,t){var i,o,n,d,s;const a=(null===(n=null===(o=null===(i=window.odT)||void 0===i?void 0:i.setup)||void 0===o?void 0:o.adSlotsConfig)||void 0===n?void 0:n.aiContent)||{},r=a.typewriter||{},l="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(void 0===a.typingEffect||!0===a.typingEffect||(null===(d=window.odT)||void 0===d?void 0:d.forceAiContent))&&!l&&!this.runImmediately,u=Number(r.speedMs)>0?Number(r.speedMs):15,p=Math.max(1,Number(r.chunkSize)||1),g=Math.max(0,Number(null!==(s=r.immediateParagraphs)&&void 0!==s?s:2));if(!c)return e.innerHTML=t,null;const w=document.createElement("template");w.innerHTML=t;const h=[],f=new Set;try{const e=Array.from(w.content.querySelectorAll("p")),t=Array.from(w.content.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE)[1];!t||"H2"!==t.tagName&&"H3"!==t.tagName||f.add(t);const i=w.content.querySelector(".od-ai-header h3");i&&f.add(i);for(let t=0;t<Math.min(g,e.length);t++)f.add(e[t])}catch(e){}const m=e=>{for(const t of f)if(t.contains(e))return!0;return!1},v=(e,t,i)=>{if(e.nodeType===Node.TEXT_NODE){const o=e.textContent||"";if(t)return document.createTextNode(o);{const e=document.createTextNode("");return h.push({node:e,text:o,written:0,paragraph:i}),e}}if(e.nodeType===Node.ELEMENT_NODE){const o=e.cloneNode(!1),n=Array.from(e.childNodes);for(const e of n){const n=t||m(e),d=i||("P"===o.tagName?o:null),s=v(e,n,d);o.appendChild(s)}return o}return document.createDocumentFragment()},y=document.createDocumentFragment();return Array.from(w.content.childNodes).forEach(e=>{y.appendChild(v(e,m(e),null))}),e.innerHTML="",e.appendChild(y),{tasks:h,speedMs:u,chunkSize:p}}runTyping(e,t,i){var o,n,d;const s=null===(o=this.getAutoInsertionConfig)||void 0===o?void 0:o.call(this),a=Number(null!==(n=null==s?void 0:s.interval)&&void 0!==n?n:0),r=Number(null!==(d=null==s?void 0:s.intervalIncrement)&&void 0!==d?d:0),l=new Map,c=new Set;for(const t of e)t.paragraph&&l.set(t.paragraph,(l.get(t.paragraph)||0)+1);const u=l.size;let p=0,g=0,w=0,h=Math.max(0,a);const f=e=>{if(c.size>=u)return;const t=this.measureElementHeight(e);if(w+=t,w>=h){const t=document.createElement("div"),i=Array.isArray(null==s?void 0:s.adSlots)?s.adSlots:null;let o;if(i&&g+1<i.length)o=i[g+1];else{o=`${"Desktop"===window.odT.screen?"Content_":"Mobile_"}AI_${g+2}`}t.className=o,t.style.display="none",e.insertAdjacentElement("afterend",t),g++,w=0,h=Math.max(0,a+g*r)}};return new Promise(o=>{const n=()=>{const d=e[p];if(!d)return void o();const s=Math.min(d.text.length,d.written+i);if(d.node.textContent=d.text.slice(0,s),d.written=s,d.written===d.text.length){if(d.paragraph){const e=(l.get(d.paragraph)||0)-1;l.set(d.paragraph,e),0!==e||c.has(d.paragraph)||(c.add(d.paragraph),f(d.paragraph))}p++}(null==d?void 0:d.paragraph)?setTimeout(n,t):n()};n()})}appendVoteControls(e){var t,i,o,n,d,s;try{if(!(e&&e instanceof HTMLElement))return;if(e.querySelector(".od-ai-footer"))return;const a=document.createElement("div");a.className="od-ai-footer";const r=document.createElement("div");r.className="od-ai-vote";const l=document.createElement("button");l.type="button",l.title="Helpful",l.setAttribute("aria-label","Vote helpful"),l.innerHTML='<svg fill="#000000" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M466.27 286.69C475.04 271.84 480 256 480 236.85c0-44.015-37.218-85.58-85.82-85.58H357.7c4.92-12.81 8.85-28.13 8.85-46.54C366.55 31.936 328.86 0 271.28 0c-61.607 0-58.093 94.933-71.76 108.6-22.747 22.747-49.615 66.447-68.76 83.4H32c-17.673 0-32 14.327-32 32v240c0 17.673 14.327 32 32 32h64c14.893 0 27.408-10.174 30.978-23.95 44.509 1.001 75.06 39.94 177.802 39.94 7.22 0 15.22.01 22.22.01 77.117 0 111.986-39.423 112.94-95.33 13.319-18.425 20.299-43.122 17.34-66.99 9.854-18.452 13.664-40.343 8.99-62.99zm-61.75 53.83c12.56 21.13 1.26 49.41-13.94 57.57 7.7 48.78-17.608 65.9-53.12 65.9h-37.82c-71.639 0-118.029-37.82-171.64-37.82V240h10.92c28.36 0 67.98-70.89 94.54-97.46 28.36-28.36 18.91-75.63 37.82-94.54 47.27 0 47.27 32.98 47.27 56.73 0 39.17-28.36 56.72-28.36 94.54h103.99c21.11 0 37.73 18.91 37.82 37.82.09 18.9-12.82 37.81-22.27 37.81 13.489 14.555 16.371 45.236-5.21 65.62zM88 432c0 13.255-10.745 24-24 24s-24-10.745-24-24 10.745-24 24-24 24 10.745 24 24z"/></svg>';const c=document.createElement("button");c.type="button",c.title="Not helpful",c.setAttribute("aria-label","Vote not helpful"),c.innerHTML='<svg fill="#000000" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M466.27 225.31c4.674-22.647.864-44.538-8.99-62.99 2.958-23.868-4.021-48.565-17.34-66.99C438.986 39.423 404.117 0 327 0c-7 0-15 .01-22.22.01C201.195.01 168.997 40 128 40h-10.845c-5.64-4.975-13.042-8-21.155-8H32C14.327 32 0 46.327 0 64v240c0 17.673 14.327 32 32 32h64c11.842 0 22.175-6.438 27.708-16h7.052c19.146 16.953 46.013 60.653 68.76 83.4 13.667 13.667 10.153 108.6 71.76 108.6 57.58 0 95.27-31.936 95.27-104.73 0-18.41-3.93-33.73-8.85-46.54h36.48c48.602 0 85.82-41.565 85.82-85.58 0-19.15-4.96-34.99-13.73-49.84zM64 296c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zm330.18 16.73H290.19c0 37.82 28.36 55.37 28.36 94.54 0 23.75 0 56.73-47.27 56.73-18.91-18.91-9.46-66.18-37.82-94.54C206.9 342.89 167.28 272 138.92 272H128V85.83c53.611 0 100.001-37.82 171.64-37.82h37.82c35.512 0 60.82 17.12 53.12 65.9 15.2 8.16 26.5 36.44 13.94 57.57 21.581 20.384 18.699 51.065 5.21 65.62 9.45 0 22.36 18.91 22.27 37.81-.09 18.91-16.71 37.82-37.82 37.82z"/></svg>';const u=()=>{l.classList.add("od-voted"),c.classList.add("od-voted")};l.addEventListener("click",()=>p(this,void 0,void 0,function*(){u(),yield this.sendVote("up")})),c.addEventListener("click",()=>p(this,void 0,void 0,function*(){u(),yield this.sendVote("down")}));const g=document.createElement("p");g.className="od-ai-footer-text",g.textContent=(null===(i=null===(t=this.articleHtmlFromApi)||void 0===t?void 0:t.footer)||void 0===i?void 0:i.toString())||(null===(s=null===(d=null===(n=null===(o=window.odT)||void 0===o?void 0:o.setup)||void 0===n?void 0:n.adSlotsConfig)||void 0===d?void 0:d.aiContent)||void 0===s?void 0:s.articleFooter)||"This content was generated using AI and reviewed according to publisher guidelines.",r.appendChild(l),r.appendChild(c),a.appendChild(r),a.appendChild(g),e.appendChild(a)}catch(e){}}sendVote(e){return p(this,void 0,void 0,function*(){var t,i;try{null===(i=null===(t=window.odT)||void 0===t?void 0:t.log)||void 0===i||i.call(t,`AI-Based Content: Vote (${e}) skipped, no endpoint.`)}catch(e){}})}measureElementHeight(e){var t;try{if(!e)return 0;const i=null===(t=e.getBoundingClientRect)||void 0===t?void 0:t.call(e);let o=i?i.height:0;return(!o||o<1)&&(o=e.offsetHeight||0),Math.max(0,Math.round(o))}catch(e){return 0}}}class w{constructor(e,t){this.POTENTIAL_BIDDERS=[],this.APPROVED_BIDDERS=[],this.ENDPOINT="https://pbs.optidigital.com/cookie_sync",this.PURPOSE_FOR_COOKIE_DROPPING=1,this.OPTIDIGITAL_ID=915,this.biddersCount=0,this.biddersDone=0,this.MAX_SYNC_COUNT=0,this.vendorsList=[{id:32,name:"appnexus"},{id:76,name:"pubmatic"},{id:52,name:"rubicon"},{id:45,name:"smartadserver"},{id:28,name:"triplelift"},{id:241,name:"onetag"},{id:91,name:"criteo"},{id:259,name:"adyoulike"},{id:61,name:"gumgum"},{id:1043,name:"rise"},{id:164,name:"outbrain"},{id:10,name:"ix"},{id:253,name:"improvedigital"},{id:687,name:"missena"},{id:658,name:"bliink"},{id:628,name:"tappx"},{id:31,name:"ogury"},{id:36,name:"unruly"},{id:58,name:"33across"},{id:21,name:"thetradedesk"},{id:333,name:"inmobi"},{id:1028,name:"sparteo"},{id:639,name:"smilewanted"},{id:972,name:"kargo"},{id:69,name:"openx"}],this.getStringifiedData=()=>{var e,t;const i={bidders:this.APPROVED_BIDDERS};return this.MAX_SYNC_COUNT&&(i.limit=this.MAX_SYNC_COUNT),window.optidigitalToolboxGdpr&&(i.gdpr=1),(null===(t=null===(e=window.odT)||void 0===e?void 0:e.consentV2TCData)||void 0===t?void 0:t.tcString)&&(i.gdpr_consent=window.odT.consentV2TCData.tcString),JSON.stringify(i)},this.ajax=(e,t,i,o={})=>{try{window.odT.log("Cookie sync request"),window.postMessage({preSync:{status:"loaded"}},"*");const n=3e3;let d;const s=o.method||(i?"POST":"GET");let a="object"==typeof t?t:{success:t,error:function(e){}};d=new window.XMLHttpRequest,d.onreadystatechange=function(){if(4===d.readyState){const e=d.status;e>=200&&e<300||304===e?(window.odT.log("Cookie sync response success"),a.success(d.responseText,d)):a.error(d.statusText,d)}},d.open(s,e),d.timeout=n,o.withCredentials&&(d.withCredentials=!0),o.preflight&&d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.setRequestHeader("Content-Type",o.contentType||"text/plain"),"POST"===s&&i?d.send(i):d.send()}catch(e){}},this.isValidVendorsList=e=>!!Array.isArray(e)&&e.every(e=>null!==e&&"object"==typeof e&&"number"==typeof e.id&&"string"==typeof e.name),this.isValidUrl=e=>new RegExp(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i).test(e),this.insertElement=(e,t,i)=>{let o;t=t||document,o=i?t.getElementsByTagName(i):t.getElementsByTagName("head");try{let i=o.length?o[0]:t.getElementsByTagName("body")[0];i&&i.insertBefore(e,i.firstChild)}catch(e){}},this.getEmptyIframe=(e,t)=>{let i=document.createElement("iframe");return i.setAttribute("frameborder","0"),i.setAttribute("scrolling","no"),i.setAttribute("marginheight","0"),i.setAttribute("marginwidth","0"),i.setAttribute("TOPMARGIN","0"),i.setAttribute("LEFTMARGIN","0"),i.setAttribute("allowtransparency","true"),i.setAttribute("width",String(t)),i.setAttribute("height",String(e)),i.style.setProperty("height","0","important"),i.style.setProperty("width","0","important"),i.style.setProperty("border","0","important"),i.style.setProperty("display","block","important"),i},this.triggerDone=()=>{this.biddersDone++,this.biddersDone===this.biddersCount&&(window.odT.cookieSyncReady=!0,window.odT.log("Cookie sync complete"),window.postMessage({preSync:{status:"complete"}},"*"))},this.triggerPixel=(e,t)=>{const i=new Image;i.addEventListener("load",t),i.addEventListener("error",t),i.src=e},this.triggerIframeLoad=(e,t,i)=>{if(!e)return;let o=this.getEmptyIframe(0,0);o.id=`sync_${t}_${Date.now()}`,o.src=e,o.onload=i,this.insertElement(o,document,"html")},this.doBidderSync=(e,t,i,o)=>{t&&this.isValidUrl(t)?"image"===e||"redirect"===e?this.triggerPixel(t,o):"iframe"===e?this.triggerIframeLoad(t,i,o):o():o()},this.doAllSyncs=e=>{0!==e.length?(this.biddersCount=e.length,e.forEach(e=>{e.no_cookie&&this.doBidderSync(e.usersync.type,e.usersync.url,e.bidder,this.triggerDone)})):window.odT.cookieSyncReady=!0},this.process=e=>{const t=JSON.parse(e);"ok"!==t.status&&"no_cookie"!==t.status||t.bidder_status&&this.doAllSyncs(t.bidder_status)},this.run=()=>{var e,t,i,o,n,d,s,a,r,l,c,u,p,g,w,h,f;if(window.optidigitalToolboxGdpr)if((null===(o=null===(i=null===(t=null===(e=window.odT)||void 0===e?void 0:e.consentV2TCData)||void 0===t?void 0:t.purpose)||void 0===i?void 0:i.consents)||void 0===o?void 0:o[this.PURPOSE_FOR_COOKIE_DROPPING])&&(null===(d=(n=window.odT).checkVendor)||void 0===d?void 0:d.call(n,this.OPTIDIGITAL_ID))&&"Safari"!==window.odT.checkBrowser&&this.POTENTIAL_BIDDERS.length>0){(null===(r=null===(a=null===(s=window.odT)||void 0===s?void 0:s.setup)||void 0===a?void 0:a.vendorsList)||void 0===r?void 0:r.length)&&this.isValidVendorsList(window.odT.setup.vendorsList)?this.vendorsList=window.odT.setup.vendorsList:(null===(u=null===(c=null===(l=window.odT)||void 0===l?void 0:l.setup)||void 0===c?void 0:c.vendorsList)||void 0===u?void 0:u.length)?window.odT.log("Invalid vendorsList format, using default vendorsList",void 0,!0):window.odT.log("No vendorsList found in setup, using default vendorsList",void 0,!0),this.vendorsList=this.vendorsList.map(e=>"ttd"===e.name?Object.assign(Object.assign({},e),{name:"thetradedesk"}):e);const e=new Map(this.vendorsList.map(e=>[e.name,e]));this.POTENTIAL_BIDDERS.forEach(t=>{var i,o;const n=e.get(t);n?(null===(o=(i=window.odT).checkVendor)||void 0===o?void 0:o.call(i,n.id))&&!this.APPROVED_BIDDERS.includes(t)?this.APPROVED_BIDDERS.push(t):window.odT.log(`Vendor ${n.name} with id ${n.id} is not allowed to cookie sync`,void 0,!0):window.odT.log(`Bidder ${t} not found in vendors list, skipping cookie sync for this bidder`,void 0,!0)}),this.APPROVED_BIDDERS.length&&this.ajax(this.ENDPOINT,this.process,this.getStringifiedData(),{withCredentials:!0})}else window.odT.log(`Cookie sync not allowed. Purpose consent is done: ${null===(w=null===(g=null===(p=window.odT.consentV2TCData)||void 0===p?void 0:p.purpose)||void 0===g?void 0:g.consents)||void 0===w?void 0:w[this.PURPOSE_FOR_COOKIE_DROPPING]}, Optidigital vendor consent: ${null===(f=(h=window.odT).checkVendor)||void 0===f?void 0:f.call(h,this.OPTIDIGITAL_ID)}, Browser check (not Safari): ${"Safari"!==window.odT.checkBrowser}, Bidders list exists: ${this.POTENTIAL_BIDDERS.length>0}`,void 0,!0);else"Safari"!==window.odT.checkBrowser&&this.POTENTIAL_BIDDERS.length>0&&(this.APPROVED_BIDDERS.push(...this.POTENTIAL_BIDDERS),this.ajax(this.ENDPOINT,this.process,this.getStringifiedData(),{withCredentials:!0}))},e&&(this.POTENTIAL_BIDDERS=this.sanitizeBidders(e)||[]),t&&(this.MAX_SYNC_COUNT=t),this.run()}sanitizeBidders(e){if(e){const t=e.split(",").filter(function(e){return!!e});if(t.length>0)return t}}}const h=class{constructor(){this.OPTIDIGITAL_LAYOUT_STYLE_ID="optidigital-layout-style",this.slotKeyCounter=0,this.slotKeyFallbacks=new WeakMap,this.stylePruneTick=0,this.BRAND_TEXT_DEFAULTS={top:"2px",right:"16px","font-size":"11px","line-height":"11px","font-family":"Verdana",color:"#888888"}}ensureBrandLogoActiveRule(){this.ensureAdLayoutRule("optidigital-brand-logo-active",".optidigital-brand-logo.optidigital-brand-logo-active{opacity:1!important;}")}getBrandTextCssValue(e,t){return e[t]||this.BRAND_TEXT_DEFAULTS[t]||""}buildBrandTextRule(e,t,i){return`.${e}::before{content:"${s.escapeCssContentValue(t)}";position:absolute!important;top:${this.getBrandTextCssValue(i,"top")}!important;right:${this.getBrandTextCssValue(i,"right")}!important;font-size:${this.getBrandTextCssValue(i,"font-size")}!important;line-height:${this.getBrandTextCssValue(i,"line-height")}!important;font-family:${this.getBrandTextCssValue(i,"font-family")}!important;color:${this.getBrandTextCssValue(i,"color")}!important;font-weight:normal!important;}`}createDeclarationBlock(e,t=!1){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>[s.normalizeCssPropertyName(e),String(t)]).sort(([e],[t])=>e.localeCompare(t)).map(([e,i])=>`${e}:${i}${t?"!important":""};`).join("")}maybePruneUnusedGeneratedStyles(e){var t;if(this.stylePruneTick+=1,this.stylePruneTick%25!=0||e.ruleNodes.size<250)return;let i=0;const o=new Set;for(const[n,d]of e.ruleNodes.entries())if(n.startsWith("od-")&&!(document.getElementsByClassName(n).length>0)&&(null===(t=d.parentNode)||void 0===t||t.removeChild(d),e.ruleNodes.delete(n),o.add(n),i+=1,i>=50))break;if(o.size>0)for(const[t,i]of e.classCache.entries())o.has(i)&&e.classCache.delete(t)}getAdLayoutStyleElement(){let e=document.getElementById(this.OPTIDIGITAL_LAYOUT_STYLE_ID);return e||(e=document.createElement("style"),e.id=this.OPTIDIGITAL_LAYOUT_STYLE_ID,document.head.appendChild(e)),"__optidigitalRegistry"in e&&e.__optidigitalRegistry||(e.__optidigitalRegistry={classCache:new Map,ruleNodes:new Map}),e}ensureAdLayoutRule(e,t){const i=this.getAdLayoutStyleElement(),o=i.__optidigitalRegistry;if(o.ruleNodes.has(e)){const i=o.ruleNodes.get(e);return void(i&&(i.textContent=`${t}\n`))}const n=document.createTextNode(`${t}\n`);i.appendChild(n),o.ruleNodes.set(e,n)}ensureStyleClass(e,t,i=!1,o=""){const n=this.createDeclarationBlock(t,i);if(!n)return"";const d=this.getAdLayoutStyleElement().__optidigitalRegistry,a=o?`${e}|${o}|${i}`:`${e}|${i}|${n}`,r=d.classCache.get(a);if(r)return this.ensureAdLayoutRule(r,`.${r}{${n}}`),this.maybePruneUnusedGeneratedStyles(d),r;const l=o?`od-${e}-${s.hashString(`${e}|${o}|${i?"i":"n"}`)}`:`od-${e}-${s.hashString(a)}`;return this.ensureAdLayoutRule(l,`.${l}{${n}}`),d.classCache.set(a,l),this.maybePruneUnusedGeneratedStyles(d),l}addGeneratedClass(e,t){e&&t&&e.classList.add(t)}resolveSlotKey(e){var t;if(!e)return s.hashString("optidigital-slot-null");const i=null===(t=e.dataset)||void 0===t?void 0:t.odSlotKey;if(i)return i;const o=e.getAttribute("id");if(o)return s.hashString(o);const n=this.slotKeyFallbacks.get(e);if(n)return n;this.slotKeyCounter+=1;const d=s.hashString(`optidigital-slot-${this.slotKeyCounter}`);return this.slotKeyFallbacks.set(e,d),d}updateManagedLayoutClass(e,t,i,o,n=!1){if(!e)return;const d=e;d.__odLayoutRuntimeClasses||(d.__odLayoutRuntimeClasses={});const s=d.__odLayoutRuntimeClasses[t],a=this.resolveSlotKey(d),r=o?this.ensureStyleClass(i,o,n,a):"";s&&s!==r&&d.classList.remove(s),r?(d.classList.add(r),d.__odLayoutRuntimeClasses[t]=r):delete d.__odLayoutRuntimeClasses[t]}setLayoutVisibility(e,t){this.updateManagedLayoutClass(e,"visibility","layout-visibility",{display:t?"block":"none"},!0)}updateBrandLogoRuntimeState(e,t){if(!e)return;const i=e;this.setLayoutVisibility(e,!0),this.ensureBrandLogoActiveRule(),i.__odBrandLogoTimeout&&clearTimeout(i.__odBrandLogoTimeout),i.__odBrandLogoTimeout=window.setTimeout(()=>{null==e||e.classList.add("optidigital-brand-logo-active"),delete i.__odBrandLogoTimeout},2e3);const o=t.firstElementChild&&t.firstElementChild.firstElementChild&&t.firstElementChild.firstElementChild.offsetWidth;o&&o>1?(this.updateManagedLayoutClass(e,"brand-logo-width","brand-logo-width",{width:`${o}px`},!0),o===document.documentElement.clientWidth?this.updateManagedLayoutClass(e,"brand-logo-margin","brand-logo-margin",{"margin-right":"15px"},!0):this.updateManagedLayoutClass(e,"brand-logo-margin","brand-logo-margin",null,!0)):(this.updateManagedLayoutClass(e,"brand-logo-width","brand-logo-width",{width:"100%"},!0),this.updateManagedLayoutClass(e,"brand-logo-margin","brand-logo-margin",{"margin-right":"15px"},!0))}hideBrandLogoRuntimeState(e){if(!e)return;const t=e;t.__odBrandLogoTimeout&&(clearTimeout(t.__odBrandLogoTimeout),delete t.__odBrandLogoTimeout),this.setLayoutVisibility(e,!1),e.classList.remove("optidigital-brand-logo-active")}clearWrapperLoadingBackground(e){this.updateManagedLayoutClass(e,"loading-background","wrapper-loading-background",{"background-image":"none"},!0)}getTextAdsHeightPx(e){if(!e)return 0;if(e.__odTextAdsHeight&&e.__odTextAdsHeight>0)return e.__odTextAdsHeight;if(e.offsetHeight>0)return e.offsetHeight;const t=getComputedStyle(e),i=e.querySelector("span"),o=i?getComputedStyle(i):t,n=parseFloat(o.fontSize)||parseFloat(t.fontSize)||0;let d=parseFloat(o.lineHeight);(!Number.isFinite(d)||d<=3)&&(d=n);let s=d;const a=parseFloat(t.paddingTop)||0,r=parseFloat(t.paddingBottom)||0;if(s+=a+r,!a&&!r){const e=t.padding.split(/\s+/).filter(Boolean);1===e.length||2===e.length?s+=2*(parseFloat(e[0])||0):e.length>=3&&(s+=(parseFloat(e[0])||0)+(parseFloat(e[2])||0))}return s>0?Math.ceil(s):0}getFlyingCarpetMinHeight(e){const t=e.closest(".optidigital-wrapper-div");if(!t)return"";const i=Array.from(t.children).find(e=>{var t;return null===(t=e.classList)||void 0===t?void 0:t.contains("optidigital-text-ads")})||null,o=this.getTextAdsHeightPx(i);let n=e.__odFlyingCarpetMaxHeightPx||0;if(!n){const e=getComputedStyle(t).minHeight;e&&"0px"!==e&&(n=parseFloat(e)||0),!n&&t.offsetHeight>0&&(n=t.offsetHeight)}if(!n)return"";const d=Math.max(0,n-o);return d>1?`${d}px`:""}resolveFlyingCarpetViewportHeight(e){const t=this.getFlyingCarpetMinHeight(e);if(t)return t;const i=e.offsetHeight||0;return i>1?`${i}px`:""}applyFlyingCarpetLayout(e){const t=e,i=e.parentElement,o=this.resolveFlyingCarpetViewportHeight(e),n={top:t.__odFlyingCarpetTopValue||"50px",height:"100%",position:"relative",overflow:"hidden"};if(this.updateManagedLayoutClass(e,"flying-carpet-container","flying-carpet-container",n,!0),!i)return;if(!t.__odFlyingCarpetViewportWrapper||!t.__odFlyingCarpetFixedWrapper)return;const d=t.__odFlyingCarpetViewportWrapper,s=t.__odFlyingCarpetFixedWrapper;this.updateManagedLayoutClass(d,"flying-carpet-viewport","flying-carpet-viewport",Object.assign(Object.assign({position:"relative",overflow:"hidden",clip:"rect(0, auto, auto, 0)","clip-path":"polygon(0px 0px, 100% 0px, 100% 100%, 0px 100%)","-webkit-clip-path":"polygon(0px 0px, 100% 0px, 100% 100%, 0px 100%)",width:"100%"},o?{height:o}:{}),{top:"0",left:"0"}),!0),this.updateManagedLayoutClass(s,"flying-carpet-fixed","flying-carpet-fixed",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",display:"flex","justify-content":"center","align-items":"flex-start"},!0);let a=i;if((a===s||d.contains(a))&&(a=d.parentElement),a&&d.parentElement!==a){const t=e.parentElement===a?e:null;a.insertBefore(d,t)}s.parentElement!==d&&d.appendChild(s),e.parentElement!==s&&s.appendChild(e)}revertFlyingCarpetLayout(e){const t=e,i=t.__odFlyingCarpetViewportWrapper,o=t.__odFlyingCarpetFixedWrapper;this.updateManagedLayoutClass(e,"flying-carpet-container","flying-carpet-container",null,!0),this.updateManagedLayoutClass(i||null,"flying-carpet-viewport","flying-carpet-viewport",null,!0),this.updateManagedLayoutClass(o||null,"flying-carpet-fixed","flying-carpet-fixed",null,!0)}updateFlyingCarpetLayout(e,t){e&&void 0!==e&&(t?this.applyFlyingCarpetLayout(e):this.revertFlyingCarpetLayout(e))}createFlyingCarpetWrappers(e,t,i,o){const n=e,d=document.createElement("div"),s=document.createElement("div");d.dataset.odSlotKey=i,s.dataset.odSlotKey=i,d.appendChild(s),n.__odFlyingCarpetTopValue=this.getFlyingCarpetTopValue(null==o?void 0:o.topValueFC),n.__odFlyingCarpetViewportWrapper=d,n.__odFlyingCarpetFixedWrapper=s,e.parentNode===t?t.insertBefore(d,e):t.appendChild(d),s.appendChild(e),d.style.width="100%"}getStickyTopValue(e,t){if(!e)return"0px";const i=Object.entries(e).map(([e,t])=>({breakpoint:Number(e),value:t})).filter(({breakpoint:e})=>Number.isFinite(e)).sort((e,t)=>t.breakpoint-e.breakpoint).find(({breakpoint:e})=>t>e);return i?`${i.value}px`:"0px"}getFlyingCarpetTopValue(e){if("number"==typeof e&&Number.isFinite(e))return`${e}px`;if("string"==typeof e){const t=e.trim();if(/^-?\d+(\.\d+)?$/.test(t))return`${t}px`;if(/^-?\d+(\.\d+)?px$/i.test(t))return t}const t=Math.round((window.innerHeight-600)/2);return`${Math.max(0,t)}px`}mergeDeep(e,...t){const i=e;for(const e of t)if(s.isPlainObject(e))for(const[t,o]of Object.entries(e))if(Array.isArray(o))i[t]=[...o];else{if(s.isPlainObject(o)){const e=i[t];i[t]=s.isPlainObject(e)?this.mergeDeep(Object.assign({},e),o):this.mergeDeep({},o);continue}i[t]=o}return i}findUpParentWidth(e){let t,i,o,n=e,d=0;for(;n&&(t=window.getComputedStyle(n),i=parseFloat(t.paddingLeft),o=parseFloat(t.paddingRight),d=n.clientWidth-i-o,!(d>0));)n=n.parentElement;return d}isSpecialContentSlot(e){const t=e&&e.getAttribute("id");return Boolean(t&&(t.includes("Content")||t.includes("Mobile_Pos")||t.includes("Mobile_AI")))}createBrandLogoElement(e,t){const i=document.createElement("div"),o=e.textCss||{},n=this.resolveSlotKey(t),d=e.text?String(e.text):"",a=`brand-text-${s.hashString(JSON.stringify({text:d,top:this.getBrandTextCssValue(o,"top"),right:this.getBrandTextCssValue(o,"right"),fontSize:this.getBrandTextCssValue(o,"font-size"),lineHeight:this.getBrandTextCssValue(o,"line-height"),fontFamily:this.getBrandTextCssValue(o,"font-family"),color:this.getBrandTextCssValue(o,"color")}))}`,r=`od-${a}`,l=this.buildBrandTextRule(r,d,o);i.className="optidigital-brand-logo",i.dataset.odSlotKey=n,this.addGeneratedClass(i,this.ensureStyleClass("brand-logo",{display:"none",opacity:"0",transition:"opacity 2s","text-align":"right","line-height":"1",height:"20px",margin:"0"},!0));const c=s.normalizeHttpUrl(e.link)||null;if(c){const n=document.createElement("a");let d=t&&t.getAttribute("id")?t.getAttribute("id"):"";d=(null==d?void 0:d.replace(window.odT.divIdPrefix,""))||null;try{const e=new URL(c);d&&e.searchParams.set("utm_campaign",d),n.href=e.toString()}catch(e){n.href=c}n.target="_blank",n.className="optidigital-brand-logo-link";const s=["noopener","noreferrer"];!1!==e.optidigitalBrandNoFollow&&s.push("nofollow"),n.rel=s.join(" "),this.addGeneratedClass(n,this.ensureStyleClass("brand-link-target",{position:"relative",top:"0"},!0)),n.classList.add(r),this.addGeneratedClass(n,this.ensureStyleClass("brand-link",{display:"inline-block",color:"transparent",border:"none","text-decoration":"none","box-shadow":"none",height:"15px",background:`url(${e.src}) no-repeat right`,"background-size":"13px",padding:"0",margin:"3px 0 0 0",width:"auto","min-width":o["min-width"]?o["min-width"]:"85px","letter-spacing":"normal"},!0)),this.ensureAdLayoutRule(a,l),i.appendChild(n)}else{const t=document.createElement("img");this.addGeneratedClass(i,this.ensureStyleClass("brand-image-target",{position:"relative",top:"0"},!0)),i.classList.add(r),t.src=e.src,t.alt=e.alt||"",this.addGeneratedClass(t,this.ensureStyleClass("brand-image",{margin:"1px 0 0 0",padding:"0",width:"13px",height:"auto"},!0)),this.ensureAdLayoutRule(a,l),i.appendChild(t)}return i}attachTextBlockIfNeeded(e,t,i,o,n,d){var a;const r=e.addText||null;if(!s.hasOwn(e,"addText")||!r||!i||5===o)return;const l=document.createElement("div"),c=document.createElement("span");let u="La suite apr\xe8s la publicit\xe9",p="Publicit\xe9";const g=Object.entries(r).filter(([e])=>"textdesktop"!==e&&"textmobile"!==e).reduce((e,[t,i])=>(e[t]=i,e),{});l.className="optidigital-text-ads";const w=l,h=(null===(a=t.dataset)||void 0===a?void 0:a.odSlotKey)||t.getAttribute("id")||"";h&&(l.dataset.odSlotKey=h),this.addGeneratedClass(l,this.ensureStyleClass("text-block",Object.assign(Object.assign(Object.assign({},n),g),{"line-height":"1",display:"none",position:"static"}),d)),this.addGeneratedClass(c,this.ensureStyleClass("text-span",{"font-size":s.hasOwn(r,"font-size")?r["font-size"]:n["font-size"],position:"static"},d)),r.textdesktop&&(p=r.textdesktop),r.textmobile&&(u=r.textmobile),c.textContent=window.matchMedia("(min-width: 760px)").matches?p:u,l.append(c),t.before(l),w.__odTextAdsHeight=this.getTextAdsHeightPx(w)}attachBrandBlockIfNeeded(e,t,i,o,n,d,a){var r,l;if(!s.hasOwn(e,"optidigitalBrand")||!e.optidigitalBrand)return;if(s.hasOwn(e.optidigitalBrand,"disableBrandStickyFormat")&&e.optidigitalBrand.disableBrandStickyFormat&&i&&5===o)return;const c=document.createElement("div"),u={display:"flex","flex-direction":n,margin:"0"};if(c.className="optidigital-brand",e.width100&&(u.width="100%",u["align-items"]="center"),e.sticky&&(u.position="sticky",u.top=d,t.classList.remove("optidigital-ad-center-sticky")),this.addGeneratedClass(c,this.ensureStyleClass("brand-container",u,a)),t&&!(null===(r=t.parentNode)||void 0===r?void 0:r.classList.contains("optidigital-brand"))){const i=this.createBrandLogoElement(e.optidigitalBrand,t);null===(l=t.parentNode)||void 0===l||l.insertBefore(c,t),c.appendChild(t),c.appendChild(i)}}buildAdslotStyles(e,t,i){var o;let n={width:"auto"===e[`adDivWidth${window.odT.screen}`]?"auto":"100%"};return this.isSpecialContentSlot(t)&&(n["margin-top"]="0",n["margin-bottom"]="0"),e.sticky&&((null===(o=t.parentNode)||void 0===o?void 0:o.classList.contains("optidigital-brand"))?n.position="static":s.hasOwn(e,"optidigitalBrand")&&!1!==e.optidigitalBrand||(n.position="sticky",n.top=i)),s.hasOwn(e,"adDivStyle")&&(n=Object.assign(Object.assign({},n),e.adDivStyle)),n}setAdLayout(e,t,i,o,n,d,a){const r={optidigitalWrapper:{display:"flex","align-items":"center","justify-content":"center",width:"100%"},logoLoading:{"background-image":"url('https://scripts.opti-digital.com/img/optidigital_logo.svg')","background-position":"center","background-repeat":"no-repeat","background-size":"50px 50px"},addBackground:{"background-color":"transparent"},optidigitalBrand:{src:"https://scripts.opti-digital.com/img/optidigital_logo.svg",alt:"Optidigital Logo",link:`https://www.optidigital.com/?utm_medium=aio&utm_source=${window.location.host&&window.location.host.replace("www.","")}`,text:"Powered by",textCss:{}},reverse:!1,important:"important",customCss:"",adslotMinHeight:!0,sticky:!0,stickyTop:{769:"0",768:"67",525:"10"},fitContent:!1,width100:!0,checkParentOverflow:!1},l={"font-size":"13px","font-family":"Verdana",padding:"5px 0",margin:"0"};let c=this.mergeDeep({},r,e);const u=t.getAttribute("id"),p=Boolean(null==n?void 0:n.isFlyingCarpetEnabled);p&&Number.isFinite(i)&&i>0&&(t.__odFlyingCarpetMaxHeightPx=i);let g=c.reverse?"column-reverse":"column",w="0px",h="0px",f="0px",m=!1,v=0,y=0,b="0px";const T="important"===c.important;t.dataset.odSlotKey=this.resolveSlotKey(t),this.ensureBrandLogoActiveRule(),requestAnimationFrame(()=>{var e,r,S,C;i=Number(i)||0;const A=s.hasOwn(n,"contentExtraCLS")&&parseFloat(String(n.contentExtraCLS))>0?parseFloat(String(n.contentExtraCLS)):0;A>0&&(i+=A);let I=this.findUpParentWidth(t);w=o>=I?I+"px":o+"px";let k=i;if(!0===c.adslotMinHeight){if(c.optidigitalWrapper["padding-top"]&&(i+=parseFloat(c.optidigitalWrapper["padding-top"].slice(0,-2))),c.optidigitalWrapper["padding-bottom"]&&(i+=parseFloat(c.optidigitalWrapper["padding-bottom"].slice(0,-2))),c.optidigitalBrand&&(i+=20),c.addText&&u&&5!==a){if(c.addText["font-size"]?i+=parseFloat(c.addText["font-size"]):i+=parseFloat(l["font-size"]),c.addText.padding){let e=c.addText.padding.split(" ");1===e.length||2===e.length?i+=2*parseFloat(e[0]):3!==e.length&&4!==e.length||(i+=parseFloat(e[0])+parseFloat(e[2]))}c.addText["padding-top"]&&(i+=parseFloat(c.addText["padding-top"])),c.addText["padding-bottom"]&&(i+=parseFloat(c.addText["padding-bottom"])),c.addText.padding||c.addText["padding-top"]||c.addText["padding-bottom"]||(i+=10)}if(c.addBackground&&"transparent"!==c.addBackground["background-color"]&&!1===c.optidigitalBrand){let e=s.hasOwn(c.optidigitalWrapper,"padding-bottom")?c.optidigitalWrapper["padding-bottom"]:"15px";i+=parseFloat(e)}if(!c.addText&&c.addBackground&&"transparent"!==c.addBackground["background-color"]&&u&&5!==a){let e=s.hasOwn(c.optidigitalWrapper,"padding-top")?c.optidigitalWrapper["padding-top"]:"15px";h=e,i+=parseFloat(e)}f=i+"px"}const x=t.parentElement;if(x){const e=getComputedStyle(x),t=parseFloat(e.height),i=parseFloat(e.minHeight),o=parseFloat(f);!c.forceTextAndBranding&&Number.isFinite(t)&&t>0&&"number"==typeof i&&i!==t&&Number.isFinite(o)&&t<o&&(c.optidigitalBrand=!1,c.addText=!1,f=k+"px",m=!0)}let _=t.getBoundingClientRect().width;const P=window.innerWidth||screen.width;0===_&&(_=P);if(v=P,y=(P-_)/2,b=this.getStickyTopValue(c.stickyTop,P),c.sticky&&c.checkParentOverflow){let e=t.parentElement;const i=this.ensureStyleClass("overflow-clip",{overflow:"clip"},!0);for(;e&&"body"!==e.nodeName.toLowerCase()&&"html"!==e.nodeName.toLowerCase();){"visible"!==getComputedStyle(e).overflow&&e.classList.add(i),e=e.parentElement}}const E=document.createElement("div"),L=this.resolveSlotKey(t);if(E.setAttribute("data-optidigital-slot","true"),E.dataset.odSlotKey=L,E.className="optidigital-wrapper-div",c.nosnippet&&E.setAttribute("data-nosnippet",""),s.hasOwn(c,"optidigitalWrapper")){const e=Object.assign({},c.optidigitalWrapper);u&&5===a&&(e.padding="0"),d&&(e["justify-content"]="top"===d?"flex-start":"center"===d?"center":"flex-end"),this.addGeneratedClass(E,this.ensureStyleClass("wrapper-base",e,T))}if(this.addGeneratedClass(E,this.ensureStyleClass("wrapper-dimensions",{"min-width":w,"flex-direction":g,"padding-top":h,"min-height":f},T)),s.hasOwn(c,"addBackground")&&(u&&5!==a||c.addBackground.enableSticky)){let e=s.hasOwn(c.optidigitalWrapper,"padding-bottom")?c.optidigitalWrapper["padding-bottom"]:"15px";const t={"background-color":c.addBackground["background-color"]};c.fitContent&&(t.width="fit-content",t["margin-left"]="auto",t["margin-right"]="auto"),!1!==c.optidigitalBrand||"transparent"===c.addBackground["background-color"]||m||(t["padding-bottom"]=e),this.addGeneratedClass(E,this.ensureStyleClass("wrapper-background",t,T))}if(t&&!(null===(e=t.parentNode)||void 0===e?void 0:e.classList.contains("optidigital-brand"))&&(null===(r=t.parentNode)||void 0===r||r.insertBefore(E,t),E.appendChild(t)),v<525&&E.parentElement&&"opd_bottomstickyad"!==E.parentElement.getAttribute("id"))if("100%"===c[`wDivWidth${window.odT.screen}`])this.addGeneratedClass(E,this.ensureStyleClass("wrapper-mobile-width",{width:"100%"},!0));else{const e="rtl"===(null===(S=null===document||void 0===document?void 0:document.documentElement)||void 0===S?void 0:S.dir)||"rtl"===(null===(C=null===document||void 0===document?void 0:document.body)||void 0===C?void 0:C.dir);this.addGeneratedClass(E,this.ensureStyleClass("wrapper-mobile-offset",{width:`${v}px`,[e?"margin-right":"margin-left"]:`-${y}px`},!0))}if(t.closest(".optidigital-wrapper-div")&&this.isSpecialContentSlot(t)&&this.addGeneratedClass(t.closest(".optidigital-wrapper-div"),this.ensureStyleClass("wrapper-slot-spacing",{"margin-top":"1em","margin-bottom":"1em"})),s.hasOwn(c,"logoLoading")&&c.logoLoading){const e=Object.assign({},c.logoLoading);let t=Number(String(f||"").replace("px",""));t&&t<50&&(e["background-size"]="auto"),this.addGeneratedClass(E,this.ensureStyleClass("wrapper-loading",e,T))}this.attachTextBlockIfNeeded(c,t,u,a,l,T),this.attachBrandBlockIfNeeded(c,t,u,a,g,b,T);const D=this.buildAdslotStyles(c,t,b);if(p){const e=parseFloat(f);Number.isFinite(e)&&e>0&&(t.__odFlyingCarpetMaxHeightPx=e),(null==t?void 0:t.parentNode)&&this.createFlyingCarpetWrappers(t,t.parentNode,L,n)}if(this.addGeneratedClass(t,this.ensureStyleClass("adslot",D,T)),s.hasOwn(c,"customCss")&&c.customCss){const e=`custom-css-${s.hashString(String(c.customCss))}`;this.ensureAdLayoutRule(e,String(c.customCss))}})}};class f{constructor(e,t){var i;this.liveAnalyticsSampling=25,this.liveAnalyticsRand=0,this.isFirstAd=!0,this.articleSelector=null,this.pageViewCalls=0,this.liveAnalyticsId=null,this.pageViewPayload={},this.tagMode=!1,this.performances={scriptLoadingTime:0,adFirstRenderTime:0,fcp:0,tbt:0,ttfb:0,height:null,words:null,paragraphs:null,adDensity:null,isPerformances:!0},this.userPerformances={cls:null,fid:null,inp:null,lcp:0,isUserPerformances:!0},this.sessionMetrics=null,this.SESSION_STORAGE_KEY="od_session_metrics",this.SESSION_TIMEOUT_MS=18e5,this.SESSION_EXPIRY_MS=33696e6,this.ENGAGEMENT_THRESHOLD_MS=1e4,this.pageLoadTime=Date.now(),this.countedAdsInSession=new Set,this.hasUserAction=!1,this.firstScrollTime=null,this.maxScrollDepth=0,this.inpEventCount=0,this.enablePerformances=!0,this.isFirstCLSTrigerred=!0,this.userPerformanceSent=!1,this.adRequestStats=!0,this.widthBreakpoint=document.documentElement.clientWidth,this.checkBrowser=null,this.checkOs=null,this.deviceCategory={},this.debugAnalytics=!1,this.sessionMetricsEnabled=!1,this.adSlotsLoadCount={},this.adSlotsLoadTime={},this.auctionBids={},this.auctionFailsafe={},this.auctionMetrics={},this.adslotsNumber=null,this.adUnitPath=null,this.gamSlots=[],this.gamSlotsIds=[],this.tools=s,this.log=this.tools.log,this.analyticsLog=this.tools.analyticsLog,this.adLayoutAdapter=new h,this.checkBrowser=this.tools.detectBrowser(),this.checkOs=this.tools.detectOS(),this.deviceCategory=this.tools.deviceDetection(),this.log("Init Analytics Module"),this.setLiveAnalyticsSampling(e,t),this.setLiveAnalyticsRand(),this.isAdDensityEnabled=null===(i=e.enableAdDensity)||void 0===i||i,this.contentSelectors=e.contentSelectors||f.DEFAULT_CONTENT_SELECTORS,this.wordsHTMLTag=f.DEFAULT_WORDS_HTML_TAG,this.excludeTags=f.DEFAULT_EXCLUDE_TAGS,this.excludePatterns=e.excludePatterns||f.DEFAULT_EXCLUDE_PATTERNS,this.excludeLengthPatterns=f.DEFAULT_EXCLUDE_LENGTH_PATTERNS,this.minWords=f.MIN_WORDS,this.minSurface=f.MIN_SURFACE,this.minRatioWords=f.MIN_RATIO_WORDS,this.childRatio=f.CHILD_RATIO,this.setup=e,window!==window.top&&(this.tagMode=!0);const o=window.location.search;e.hasOwnProperty("adRequestStats")&&!1===e.adRequestStats&&(this.adRequestStats=!1),e.hasOwnProperty("enablePerformances")&&!1===e.enablePerformances&&(this.enablePerformances=e.enablePerformances),(o.includes("optidigital_debug_analytics=true")||!0===window.optidigital_debug_analytics)&&(this.debugAnalytics=!0),this.sessionMetricsEnabled=!0===e.sessionMetrics,this.sessionMetricsEnabled&&this.initializeSessionTracking(),this.setupScrollTracking(),this.setupScrollDepthTracking(),this.setupPageMetricsBeacon()}initializeSessionTracking(){try{const e=Date.now(),t=localStorage.getItem(this.SESSION_STORAGE_KEY);if(t){const i=JSON.parse(t);if(e-i.firstSession>this.SESSION_EXPIRY_MS){this.log("Session data expired (13 months), creating new user"),localStorage.removeItem(this.SESSION_STORAGE_KEY);const t=this.generateUserId();return this.sessionMetrics={sessionId:t,sessionCount:1,pageCount:1,firstSession:e,lastSession:e,currentSession:e,bouncedSessions:0,bounceRate:0,sessionHasEngagement:!1,adsExposed:0,maxScrollDepth:0},void this.persistSessionMetrics()}if(e-i.lastSession>this.SESSION_TIMEOUT_MS){const t=i.sessionHasEngagement,o=i.lastSession-i.currentSession,n=i.pageCount,d=this.isSessionEngaged(o,t,n,i.maxScrollDepth||0);let s=i.bouncedSessions||0;d||(s+=1),this.sessionMetrics={sessionId:i.sessionId,sessionCount:i.sessionCount+1,firstSession:i.firstSession,lastSession:e,currentSession:e,pageCount:1,bouncedSessions:s,bounceRate:this.calculateBounceRate(s,i.sessionCount+1),sessionHasEngagement:!1,adsExposed:0,maxScrollDepth:0},this.countedAdsInSession.clear()}else this.sessionMetrics=Object.assign(Object.assign({},i),{lastSession:e,currentSession:i.currentSession,pageCount:i.pageCount+1,bouncedSessions:i.bouncedSessions||0,bounceRate:i.bounceRate||0,sessionHasEngagement:i.sessionHasEngagement||!1,adsExposed:i.adsExposed||0,maxScrollDepth:i.maxScrollDepth||0})}else{const t=this.generateUserId();this.sessionMetrics={sessionId:t,sessionCount:1,firstSession:e,lastSession:e,currentSession:e,pageCount:1,bouncedSessions:0,bounceRate:0,sessionHasEngagement:!1,adsExposed:0,maxScrollDepth:0}}this.persistSessionMetrics(),this.log("Session tracking initialized",this.sessionMetrics)}catch(e){this.analyticsLog(`[initializeSessionTracking] Error initializing session tracking: ${e}`),this.sessionMetrics=null}}generateUserId(){try{return self.crypto.randomUUID()}catch(e){return this.tools.generateUuid()}}persistSessionMetrics(){if(!this.sessionMetrics)return;const e=this.getConsentObject();if("ok"===(null==e?void 0:e.consentType)&&this.sessionMetricsEnabled)try{localStorage.setItem(this.SESSION_STORAGE_KEY,JSON.stringify(this.sessionMetrics))}catch(e){this.analyticsLog(`[persistSessionMetrics] Error persisting session metrics: ${e}`)}}updateSessionActivity(){if(!this.sessionMetricsEnabled)return;if(this.hasUserAction=!0,!this.sessionMetrics)return void this.initializeSessionTracking();const e=Date.now();if(e-this.sessionMetrics.lastSession>this.SESSION_TIMEOUT_MS){const t=this.sessionMetrics.sessionHasEngagement,i=this.sessionMetrics.lastSession-this.sessionMetrics.currentSession,o=this.sessionMetrics.pageCount,n=this.sessionMetrics.maxScrollDepth||0,d=this.isSessionEngaged(i,t,o,n);let s=this.sessionMetrics.bouncedSessions||0;d||(s+=1),this.sessionMetrics=Object.assign(Object.assign({},this.sessionMetrics),{sessionCount:this.sessionMetrics.sessionCount+1,currentSession:e,lastSession:e,pageCount:1,bouncedSessions:s,bounceRate:this.calculateBounceRate(s,this.sessionMetrics.sessionCount+1),sessionHasEngagement:!0,adsExposed:0,maxScrollDepth:0}),this.countedAdsInSession.clear()}else this.sessionMetrics.sessionHasEngagement||(this.sessionMetrics.sessionHasEngagement=!0),this.sessionMetrics.lastSession=e;this.persistSessionMetrics()}clearSessionData(){try{localStorage.removeItem(this.SESSION_STORAGE_KEY),this.sessionMetrics=null,this.countedAdsInSession.clear(),this.log("Session data cleared (GDPR compliance)")}catch(e){this.analyticsLog(`[clearSessionData] Error clearing session data: ${e}`)}}getTimeToFirstScroll(){return this.firstScrollTime?this.firstScrollTime-this.pageLoadTime:null}calculateBounceRate(e,t){return 0===t?0:Math.round(e/t*100)}isSessionEngaged(e,t,i,o){return e>this.ENGAGEMENT_THRESHOLD_MS||(!!t||(i>=2||o>=25))}incrementAdsExposed(e){if(this.sessionMetricsEnabled&&this.sessionMetrics)try{if(this.countedAdsInSession.has(e))return;this.countedAdsInSession.add(e),this.sessionMetrics.adsExposed+=1,this.persistSessionMetrics(),this.log(`Ad exposed: ${e}. Total ads exposed in session: ${this.sessionMetrics.adsExposed}`)}catch(e){this.analyticsLog(`[incrementAdsExposed] Error incrementing ads exposed: ${e}`)}}setupPageMetricsBeacon(){window.addEventListener("beforeunload",()=>{if(this.isSamplingCase())try{const e=1===this.pageViewCalls?2:this.pageViewCalls;let t={id:this.liveAnalyticsId,part:e};const i=Object.assign(Object.assign({},t),{pageMetrics:{timeToFirstScroll:this.getTimeToFirstScroll(),scrollDepth:this.maxScrollDepth,timeOnPage:Date.now()-this.pageLoadTime}});if(this.sessionMetricsEnabled&&this.sessionMetrics&&"ok"===this.getConsentObject().consentType){const e=Date.now()-this.sessionMetrics.currentSession;this.hasUserAction&&!this.sessionMetrics.sessionHasEngagement&&(this.sessionMetrics.sessionHasEngagement=!0);const t=100-this.sessionMetrics.bounceRate;this.sessionMetrics.lastSession=Date.now(),this.persistSessionMetrics(),i.sessionMetrics={sessionId:this.sessionMetrics.sessionId,sessionCount:this.sessionMetrics.sessionCount,pagesPerSession:this.sessionMetrics.pageCount,sessionDuration:e,bounceRate:this.sessionMetrics.bounceRate,engagementRate:t,adsExposed:this.sessionMetrics.adsExposed,maxScrollDepth:this.maxScrollDepth}}this.sendAnalyticsRequest(i,"https://analytics.optidigital.com/pageview",!0)}catch(e){this.analyticsLog(`[setupPageMetricsBeacon] Error sending beacon: ${e}`)}})}setupScrollTracking(){const e=()=>{null===this.firstScrollTime&&(this.firstScrollTime=Date.now(),window.removeEventListener("scroll",e),window.removeEventListener("wheel",e),window.removeEventListener("touchmove",e))};window.addEventListener("scroll",e,{passive:!0}),window.addEventListener("wheel",e,{passive:!0}),window.addEventListener("touchmove",e,{passive:!0})}setupScrollDepthTracking(){const e=()=>{try{const e=window.innerHeight,t=this.getPageHeight(),i=window.pageYOffset||document.documentElement.scrollTop,o=Math.min(100,Math.round((i+e)/t*100));o>this.maxScrollDepth&&(this.maxScrollDepth=o,this.sessionMetricsEnabled&&this.sessionMetrics&&o>this.sessionMetrics.maxScrollDepth&&(this.sessionMetrics.maxScrollDepth=o,this.persistSessionMetrics()))}catch(e){this.analyticsLog(`[setupScrollDepthTracking] Error calculating scroll depth: ${e}`)}};e(),window.addEventListener("scroll",e,{passive:!0}),window.addEventListener("resize",e,{passive:!0})}findMainContent(){try{const e=document.querySelectorAll("article, section, div, main");let t=null,i=0;const o=document.body.innerText.trim().split(/\s+/).length;return e.forEach(e=>{let n=1;const d=this.countWords(e),s=this.getElSurface(e);if(s<this.minSurface)return;if(d<this.minWords)return;if(d/o<this.minRatioWords)return;this.containsExcludedTag(e)&&(n=1e4,this.analyticsLog("[findMainContent] Element ratio modified due to excluded tag",e)),this.containsExcludedElement(e)&&(n=1e5,this.analyticsLog("[findMainContent] Element ratio modified due to excluded pattern",e));let a=this.getScore(d,s);this.analyticsLog(`[findMainContent] MainContent candidate: tag=${e.tagName}, wordCount=${d}, surface=${s}, score=${a}`,e);let r=!1;e.querySelectorAll("article, section, div, main").forEach(t=>{if(t!==e&&this.countWords(t)>this.minWords&&this.getElSurface(t)>this.minSurface){const e=this.getScore(this.countWords(t),this.getElSurface(t));e/a>this.childRatio&&(this.analyticsLog(`[findMainContent] Child score (${e}) and element score (${a}) have a ratio (${e/a}) higher than allowed ratio (${this.childRatio})`,t),r=!0)}}),r?this.analyticsLog(`[findMainContent] Skipped because a child dominates: ${e.tagName}`):(a/=n,this.analyticsLog(`[findMainContent] MainContent candidate after updated score : tag=${e.tagName}, coefExclude=${n}, score=${a}`,e),a>i&&(i=a,t=e))}),t?(this.debugAnalytics&&(this.analyticsLog("[findMainContent] Best Element IS",t),t.style.border="3px solid red"),this.checkIfHiddenArticle(t)?(this.analyticsLog("[findMainContent] Best element has a computed height and hidden overflow"),null):t):null}catch(e){return this.analyticsLog(`[findMainContent] Error in findMainContent: ${e}`),null}}getElSurface(e){const t=e.getBoundingClientRect();return t.width*t.height}getScore(e,t){return e/Math.log(t)}containsExcludedElement(e){const t=e=>{const t=e.className+" "+e.id;return this.excludePatterns.some(e=>e.test(t))};if(t(e))return!0;let i=e.parentElement;for(;i;){if(t(i))return!0;i=i.parentElement}const o=e.querySelectorAll("*");for(const e of o)if(t(e))return!0;return!1}containsExcludedTag(e){let t=e.parentElement;for(;t;){if(this.excludeTags.includes(t.tagName.toLowerCase()))return!0;t=t.parentElement}return e.querySelectorAll(this.excludeTags.join(",")).length>0}checkIfHiddenArticle(e){const t=window.getComputedStyle(e,null),i=""!=e.style.height,o="hidden"===t.overflow;return i&&o}setLiveAnalyticsSampling(e,t){var i;this.liveAnalyticsSampling=t?100:null!==(i=null==e?void 0:e.liveAnalyticsSampling)&&void 0!==i?i:25}setLiveAnalyticsRand(){this.liveAnalyticsRand||(this.liveAnalyticsRand=Math.floor(100*Math.random()))}isSamplingCase(){return Boolean(this.liveAnalyticsSampling&&this.liveAnalyticsRand<this.liveAnalyticsSampling)}getConsentObject(){return window.odT||window.odConsent||{}}sendAnalyticsRequest(e,t="https://analytics.optidigital.com/adrequest",i=!1){const o=JSON.stringify(e);i?navigator.sendBeacon(t,o):fetch(t,{method:"POST",body:o})}countWords(e){let t=e.innerHTML.replace(/<script[^>]*>[\s\S]*?<\/script>/gi," ").replace(/<style[^>]*>[\s\S]*?<\/style>/gi," ").replace(/<a[^>]*>[\s\S]*?<\/a>/gi," ");t=t.replace(/<div[^>]*style="display: none;"[^>]*>[\s\S]*?<\/div>/gi," ");let i=t.replace(/<[^>]*>/g," ").replace(/[.,;:!?()]/g," ").replace(/\s+/g," ").trim().split(" ").filter(e=>e.length>0).length;return i||0}calculateAdDensity(e,t){if(0===e||0===t||!1===this.isAdDensityEnabled)return 0;return Math.min(1,Math.round(e/t*100)/100)}getPageHeight(){const{body:e,documentElement:t}=document;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}countWordsInElements(e){return Array.from(e).reduce((e,t)=>e+this.countWords(t),0)}createPerformanceObserver(e,t){PerformanceObserver.supportedEntryTypes.includes(e)&&new PerformanceObserver((i,o)=>{for(const n of i.getEntriesByType(e))t(n,o)}).observe({type:e,buffered:!0})}logPerformanceMetric(e,t){this.analyticsLog(`${e} captured: ${t||0}`)}registerPerformanceObserver(){if(this.enablePerformances&&this.isSamplingCase()&&"Chrome"===this.checkBrowser)try{this.createPerformanceObserver("paint",this.handlePaintEntry.bind(this)),this.createPerformanceObserver("largest-contentful-paint",this.handleLCPEntry.bind(this)),this.createPerformanceObserver("longtask",this.handleLongTaskEntry.bind(this)),this.createPerformanceObserver("event",this.handleEventEntry.bind(this)),this.createPerformanceObserver("layout-shift",this.handleCLSEntry.bind(this)),this.createPerformanceObserver("first-input",this.handleFIDEntry.bind(this)),this.createPerformanceObserver("navigation",this.handleNavigationEntry.bind(this))}catch(e){}}handlePaintEntry(e,t){"first-contentful-paint"===e.name&&(this.performances.fcp=Math.round(e.startTime),this.logPerformanceMetric("FCP",this.performances.fcp),t.disconnect())}handleLCPEntry(e){this.userPerformances.lcp=Math.round(e.startTime),this.logPerformanceMetric("LCP",this.userPerformances.lcp)}handleCLSEntry(e){!e.hadRecentInput&&e.value&&e.value>0&&(this.userPerformances.cls||(this.userPerformances.cls=0),this.userPerformances.cls+=Math.round(1e3*e.value)/1e3,this.logPerformanceMetric("CLS",this.userPerformances.cls))}handleFIDEntry(e,t){e.processingStart&&e.processingStart>e.startTime&&(this.userPerformances.fid=Math.round(e.processingStart-e.startTime),this.logPerformanceMetric("FID",this.userPerformances.fid),t.disconnect())}handleNavigationEntry(e,t){e.responseStart&&(this.performances.ttfb=Math.round(e.responseStart),this.logPerformanceMetric("TTFB",this.performances.ttfb),t.disconnect())}handleLongTaskEntry(e,t){if(e.duration>=50){const i=Math.round(e.duration-50);this.performances.tbt+=i,this.logPerformanceMetric("TBT",i),t.disconnect()}}handleEventEntry(e,t){if(this.inpEventCount>=50)return this.isSamplingCase()&&"Chrome"===this.checkBrowser&&!this.userPerformanceSent&&this.pageViewEvent({isUserPerformanceCall:!0,userAction:"ko"!==this.getConsentObject().consentType&&this.getConsentObject().consentCMPUIShown}),void t.disconnect();this.userPerformances.inp||(this.userPerformances.inp=0),e.duration>this.userPerformances.inp&&(this.userPerformances.inp=Math.round(e.duration),this.logPerformanceMetric("INP",this.userPerformances.inp)),this.inpEventCount++}getElementsInContext(e,t="*"){const i=[],o=t=>{for(const n of Array.from(t))n instanceof HTMLElement&&(e&&!(null==n?void 0:n.matches(e))||i.push(n),n.shadowRoot&&o(Array.from(n.shadowRoot.querySelectorAll("*"))))};return o(Array.from(document.querySelectorAll(t))),i}isAdDiv(e){var t;return"true"===e.getAttribute("data-optidigital-slot")||(null===(t=this.gamSlotsIds)||void 0===t?void 0:t.includes(e.id))||!1}collectDivElements(e="*"){return this.getElementsInContext("div",e)}extractContentMetrics(e){try{if("string"==typeof e)return this.getContentMetricsFromMainContent(e);if(e instanceof HTMLElement){const t=[e];let i=!1;const o=Array.from(e.querySelectorAll("div")).filter(e=>this.isAdDiv(e)).map(e=>{try{const t=e.getBoundingClientRect();return t.width*t.height<=1&&e.parentElement&&this.gamSlotsIds.length?e.parentElement:e}catch(t){return this.analyticsLog(`[extractContentMetrics] Error in getBoundingClientRect for ad div: ${t}`),e}}).filter(e=>{try{const t=e.getBoundingClientRect();return t.width*t.height>1}catch(e){return this.analyticsLog(`[extractContentMetrics] Error filtering by dimensions: ${e}`),!1}});let n=0,d=0;try{n=t.reduce((e,t)=>e+t.querySelectorAll("p").length,0),n-=o.reduce((e,t)=>e+t.querySelectorAll("p").length,0),d=t.reduce((e,t)=>e+this.countWordsInElements(t.querySelectorAll(this.wordsHTMLTag.toString())),0),d-=o.reduce((e,t)=>e+this.countWordsInElements(t.querySelectorAll(this.wordsHTMLTag.toString())),0)}catch(e){this.analyticsLog(`[extractContentMetrics] Error in paragraph/word counting: ${e}`)}if(t.forEach(e=>{e.style.height&&(i=!0)}),i)return{heights:null,paragraphs:n,words:d};let s=0,a=0;try{let i,n;s=o.reduce((e,t)=>{try{return e+t.getBoundingClientRect().height}catch(t){return this.analyticsLog(`[extractContentMetrics] Error in getBoundingClientRect for ad div: ${t}`),e}},0),a=t.reduce((e,t)=>{try{const i=t.getBoundingClientRect();return e+(t instanceof HTMLElement?i.height:0)}catch(t){return this.analyticsLog(`[extractContentMetrics] Error in getBoundingClientRect for main content: ${t}`),e}},0);let d=!1;for(const t of e.children)n=(t.className?t.className.toString():"")+" "+(t.id?t.id.toString():""),d=this.excludeLengthPatterns.some(e=>e.test(n)),d&&(i=t.getBoundingClientRect(),a-=i.height)}catch(e){this.analyticsLog(`[extractContentMetrics] Error in height calculation: ${e}`)}return{heights:{adsDivLength:s,contentLength:a},paragraphs:n,words:d}}return this.analyticsLog("[extractContentMetrics] Invalid context in extractContentMetrics"),{heights:null,paragraphs:0,words:0}}catch(e){return this.analyticsLog(`[extractContentMetrics] Error in extractContentMetrics: ${e}`),{heights:null,paragraphs:0,words:0}}}getContentMetricsFromMainContent(e){const t=this.getElementsInContext(e);let i=!1;if(!t.length)return{heights:null,paragraphs:0,words:0};const o=this.collectDivElements(`${e} div`).filter(e=>this.isAdDiv(e)).map(e=>{const t=e.getBoundingClientRect();return t.width*t.height<=1&&e.parentElement&&this.gamSlotsIds.length?e.parentElement:e}).filter(e=>{const t=e.getBoundingClientRect();return t.width*t.height>1});let n=t.reduce((e,t)=>e+t.querySelectorAll("p").length,0);n-=o.reduce((e,t)=>e+t.querySelectorAll("p").length,0);let d=t.reduce((e,t)=>e+this.countWordsInElements(t.querySelectorAll(this.wordsHTMLTag.toString())),0);if(d-=o.reduce((e,t)=>e+this.countWordsInElements(t.querySelectorAll(this.wordsHTMLTag.toString())),0),t.forEach(e=>{e.style.height&&(i=!0)}),i)return{heights:null,paragraphs:n,words:d};return{heights:{adsDivLength:o.reduce((e,t)=>e+t.getBoundingClientRect().height,0),contentLength:t.reduce((e,t)=>{const i=t.getBoundingClientRect();return e+(t instanceof HTMLElement?i.height:0)},0)},paragraphs:n,words:d}}setContentMetrics(e=!1){try{if(!this.isAdDensityEnabled&&!e)return this.performances.height=null,this.performances.paragraphs=null,this.performances.words=null,this.performances.adDensity=null,void this.log("Ad Density disabled");if(this.contentSelectors.length>0)for(const e of this.contentSelectors){const{heights:t,paragraphs:i,words:o}=this.extractContentMetrics(e);if(t)return this.performances.height=Math.floor(t.contentLength),this.performances.paragraphs=Math.floor(i),this.performances.words=Math.floor(o),this.performances.adDensity=this.calculateAdDensity(t.adsDivLength,t.contentLength),this.log(`Ad Density computed from selector ${e}`,this.performances.adDensity),this.articleSelector=e,void this.analyticsLog("[setContentMetrics] Ad Density details",{heights:t,adDensity:this.performances.adDensity})}else{let e=null;try{e=this.findMainContent()}catch(e){this.analyticsLog(`[setContentMetrics] Error in [findMainContent]: ${e}`)}if(e){const{heights:t,paragraphs:i,words:o}=this.extractContentMetrics(e);if(t)return this.performances.height=Math.floor(t.contentLength),this.performances.paragraphs=Math.floor(i),this.performances.words=Math.floor(o),this.performances.adDensity=this.calculateAdDensity(t.adsDivLength,t.contentLength),this.articleSelector=this.getElementSelector(e),this.log("Ad Density computed from automatic detection",this.performances.adDensity),void this.analyticsLog("[setContentMetrics] Ad Density details",{heights:t,adDensity:this.performances.adDensity})}}this.log("No ad density computed"),this.performances.height=null,this.performances.paragraphs=null,this.performances.words=null,this.performances.adDensity=null}catch(e){this.analyticsLog(`[setContentMetrics] Error: ${e}`),this.performances.height=null,this.performances.paragraphs=null,this.performances.words=null,this.performances.adDensity=null}}getElementSelector(e){try{const t=e,i=e=>{try{if("undefined"!=typeof CSS&&"function"==typeof CSS.escape)return CSS.escape(e)}catch(e){}return e.replace(/([\0-\x1F\x7F!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")};if(t.id&&t.id.trim().length>0){return`#${i(t.id.trim())}`}if(t.classList&&t.classList.length>0){const e=Array.from(t.classList).filter(Boolean).map(e=>i(e)).join(".");if(e)return`.${e}`}return t.tagName?t.tagName.toLowerCase():"*"}catch(e){return""}}isFirstAdRendered(e){const t=this.performances.adFirstRenderTime||0;return this.isFirstAd&&(0==t||e<t)}handleFirstAdPerformanceTracking(e=""){const t=Math.round(performance.now());if(this.enablePerformances&&"Chrome"===this.checkBrowser&&this.isSamplingCase()&&this.isFirstAdRendered(t)){this.isFirstAd=!1,this.performances.adFirstRenderTime=t,this.log(`First Ad Render Ended ${e}. Total render time: ${t} (ms)`),this.performances.scriptLoadingTime=window.launcherLoadTime,this.setContentMetrics(),this.log("Sending analytics for performances",this.performances);const i=this.getConsentObject();"ko"!==(null==i?void 0:i.consentType)&&(null==i?void 0:i.consentCMPUIShown)?this.pageViewEvent({isPerformanceCall:!0,userAction:!0}):this.pageViewEvent({isPerformanceCall:!0})}}pageViewEvent(e={},t=!1){var i,o,n,d,s,a,r,l,c,u,p,g,w,h,f,m,v,y;if(e.isPerformanceCall||e.isUserPerformanceCall||t||(this.pageViewCalls+=1),e.userAction&&this.updateSessionActivity(),!(null===(i=null===window||void 0===window?void 0:window.googletag)||void 0===i?void 0:i.cmd)||this.adslotsNumber||(null===window||void 0===window?void 0:window.odT)||window.googletag.cmd.push(()=>{var e,t,i,o,n;if(this.gamSlots=window.googletag.pubads().getSlots(),this.gamSlots.length>0)if(this.adslotsNumber=this.gamSlots.length,this.gamSlotsIds=this.gamSlots.map(e=>e.getSlotElementId()),(null===(e=this.gamSlots[0])||void 0===e?void 0:e.getSlotElementId())!==(null===(t=this.gamSlots[0])||void 0===t?void 0:t.getAdUnitPath())){const e=`/${null===(i=this.gamSlots[0])||void 0===i?void 0:i.getSlotElementId()}`||"";this.adUnitPath=(null===(o=this.gamSlots[0])||void 0===o?void 0:o.getAdUnitPath().replace(e,""))||""}else this.adUnitPath=((null===(n=this.gamSlots[0])||void 0===n?void 0:n.getAdUnitPath())||"").split("/").slice(0,-1).join("/")}),this.isSamplingCase()||t){if(!this.liveAnalyticsId){let e;try{e=self.crypto.randomUUID()}catch(t){e=this.tools.generateUuid()}this.liveAnalyticsId=e}const i=this.getConsentObject();let b=window.location.protocol+"//"+window.location.host+window.location.pathname,T="ok";T=(null==i?void 0:i.consentCMPUIShown)&&!e.userAction?"ui":"CMPv2_OOS"===(null==i?void 0:i.consentStatus)?"oos":1!==this.pageViewCalls||!e.firstCall||(null==i?void 0:i.consentV2TCData)&&(null===(o=null==i?void 0:i.consentV2TCData)||void 0===o?void 0:o.gdprApplies)&&!1!==(null===(n=null==i?void 0:i.consentV2TCData)||void 0===n?void 0:n.gdprApplies)?null==i?void 0:i.consentType:(null==i?void 0:i.waitingForCMPFinished)?"waiting_callback":"waiting_tcfapi";let S={id:this.liveAnalyticsId,part:this.pageViewCalls,gdpr:{gdprUi:(null==i?void 0:i.consentCMPUIShown)?1:0,gdprApplies:window.optidigitalToolboxGdpr?1:0,status:T}},C=JSON.parse(JSON.stringify(S)),A=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({sampling:this.liveAnalyticsSampling||25,country:window.optidigitalToolboxCC},null!=(null===(s=null===(d=this.setup)||void 0===d?void 0:d.info)||void 0===s?void 0:s.networkId)&&{networkId:this.setup.info.networkId}),null!=(null===(r=null===(a=this.setup)||void 0===a?void 0:a.info)||void 0===r?void 0:r.publisherId)&&{publisherId:this.setup.info.publisherId}),null!=(null===(c=null===(l=this.setup)||void 0===l?void 0:l.info)||void 0===c?void 0:c.siteId)&&{siteId:this.setup.info.siteId}),null!=(null===(p=null===(u=this.setup)||void 0===u?void 0:u.info)||void 0===p?void 0:p.revision)&&{revision:this.setup.info.revision}),{domain:window.location.hostname,uri:window.location.pathname,urlHash:this.tools.cyrb53(b,100),abTest:(null===(g=window.odT)||void 0===g?void 0:g.testGroup)?window.odT.testGroup:"control",device:{deviceCategory:this.deviceCategory.deviceCategory,browserWidth:this.widthBreakpoint,breakpoint:this.widthBreakpoint,browser:this.checkBrowser,os:this.checkOs},meta:{}}),C);e.firstCall||(A.gdpr.delayForCallback=this.tools.getElapsedTime()),document.referrer&&(A.source||(A.source={}),A.source.referrer=document.referrer,A.source.refDomain=new URL(document.referrer).hostname),new URL(window.location.href).searchParams.get("utm_source")&&(A.source||(A.source={}),A.source.utmSource=new URL(window.location.href).searchParams.get("utm_source")),new URL(window.location.href).searchParams.get("utm_campaign")&&(A.source||(A.source={}),A.source.utmCampaign=new URL(window.location.href).searchParams.get("utm_campaign")),(null===(h=null===(w=window.odT)||void 0===w?void 0:w.initConfig)||void 0===h?void 0:h.adUnit)&&""!==(null===(m=null===(f=window.odT)||void 0===f?void 0:f.initConfig)||void 0===m?void 0:m.adUnit)?A.adUnitPath=window.odT.initConfig.adUnit:this.adUnitPath&&(A.adUnitPath=this.adUnitPath);const I=window.document.querySelector("meta[property='og:title']");I&&I.getAttribute("content")?A.meta.title=I.getAttribute("content"):document.title&&(A.meta.title=document.title);const k=window.document.querySelector("meta[property='og:description']"),x=window.document.querySelector('meta[name="description"]');k&&k.getAttribute("content")?A.meta.description=k.getAttribute("content"):x&&x.getAttribute("content")&&(A.meta.description=x.getAttribute("content"));const _=window.document.querySelector("meta[property='og:image']");_&&_.getAttribute("content")&&(A.meta.image=_.getAttribute("content"));const P=window.document.querySelector("meta[property='article:author']"),E=window.document.querySelector('meta[name="author"]');P&&P.getAttribute("content")?A.meta.articleAuthor=P.getAttribute("content"):E&&E.getAttribute("content")&&(A.meta.articleAuthor=E.getAttribute("content"));const L=window.document.querySelector("meta[property='article:published_time']");if(L&&L.getAttribute("content")&&(A.meta.articlePublishedTime=L.getAttribute("content")),this.pageViewPayload=Object.assign({},A),!this.tagMode&&!t){let t=null;if(e.isPerformanceCall)t=Object.assign({performances:Object.assign({},this.performances)},C),this.log("Succesfully get performances payload",t);else if(e.isUserPerformanceCall)t=Object.assign({userPerformances:{}},C),0!==this.userPerformances.inp&&(t.userPerformances.inp=this.userPerformances.inp),0!==this.userPerformances.fid&&(t.userPerformances.fid=this.userPerformances.fid),t.userPerformances.lcp=this.userPerformances.lcp,this.isFirstCLSTrigerred&&(t.userPerformances.cls=this.userPerformances.cls),t.userPerformances.isUserPerformances=!0,this.log("Succesfully get user performances payload",t.userPerformances),this.userPerformanceSent=!0;else{let o=C;3===this.pageViewCalls||e.userAction?o.gdpr.delayForUserAction=Date.now()-(null==i?void 0:i.timeStampCMPUIShown):o.gdpr.delayForCallback=this.tools.getElapsedTime(),t=1===this.pageViewCalls?A:o}if((null===(y=null===(v=null===window||void 0===window?void 0:window.odT)||void 0===v?void 0:v.finalAdSlotsConfig)||void 0===y?void 0:y.adSlotsDefinitions)?t.adslotsNumber=Object.keys(window.odT.finalAdSlotsConfig.adSlotsDefinitions).length:this.adslotsNumber&&(t.adslotsNumber=this.adslotsNumber),window.odBotScore){const e=parseFloat(window.odBotScore);isNaN(e)||(t.interactionIndex=e)}this.sendAnalyticsRequest(t,"https://analytics.optidigital.com/pageview",!!e.sendBeacon)}}}getAnalyticsAdSize(e,t){var i,o,n;const d=t?null===(n=null===(o=null===(i=window.odT)||void 0===i?void 0:i.finalAdSlotsConfig)||void 0===o?void 0:o.adSlotsDefinitions)||void 0===n?void 0:n[t]:void 0,s="prebid"===(null==d?void 0:d.lastWinnerDemandType)?null==d?void 0:d.lastRenderedSize:null;return(null==d?void 0:d.isFlyingCarpetEnabled)&&"1x1"===e&&Array.isArray(s)&&s.length>=2?this.tools.formatSizeArrayToString(s):e}adRequestEvent(e,t=!1,i=!0){var o,n,d,s,a,r,l,c,u,p,g,w,h,f,m,v,y,b,T,S,C,A,I,k,x;const{divId:_,divIdFull:P,filled:E,demandType:L,lineItemId:D,size:M,prebidBid:O,prebidWinner:R,amazonStatus:z,oyStatus:F,oyTestGroup:$,oyPb:B,nogam:N,bidders:U,format:j,loadType:V,fallback:H}=e,q=this.getConsentObject();if(window.odT&&window.odT.userAction.length&&this.updateSessionActivity(),i){let e;if(P&&(e=document.getElementById(P)),E&&P&&(null===(o=window.odT)||void 0===o?void 0:o.adSlotsUnfilledCount)||!E&&"instream"===L){const t=null===(s=null===(d=null===(n=window.odT)||void 0===n?void 0:n.finalAdSlotsConfig)||void 0===d?void 0:d.adSlotsDefinitions)||void 0===s?void 0:s[_];let i="prebid"===(null==t?void 0:t.lastWinnerDemandType)&&null!==(a=null==t?void 0:t.lastRenderedSize)&&void 0!==a?a:null;i||!M||"prebid"!==L&&"backfill"!==L||(i=window.odT.parseRenderedSize(M));const o=window.odT.isFlyingCarpetRenderedSize(t,i);t&&i&&("prebid"===L||"backfill"===L)&&(t.lastWinnerDemandType=L,t.lastRenderedSize=i);const l=null==t?void 0:t.lastFlyingCarpetApplied;let c;if(c=t&&void 0!==l?l!==o?o?"Enabling Flying Carpet on Refresh":"Disabling Flying Carpet on Refresh":o?"Flying Carpet stayed enabled":"Flying Carpet stayed disabled":o?"Flying Carpet Enabled (1st display)":"Flying Carpet Disabled (1st display)",t&&(t.lastFlyingCarpetApplied=o,window.odT.log(`[Flying Carpet] Layout Decision for ${_}: ${c}`),this.adLayoutAdapter.updateFlyingCarpetLayout(e,o)),e&&e.closest(".optidigital-wrapper-div")){const t=e.closest(".optidigital-brand"),i=(null==t?void 0:t.previousElementSibling)&&t.previousElementSibling.classList.contains("optidigital-text-ads")?t.previousElementSibling:null,o=e.previousElementSibling&&e.previousElementSibling.classList.contains("optidigital-text-ads")?e.previousElementSibling:null,n=(null==e?void 0:e.nextElementSibling)||(null===(r=null==e?void 0:e.closest(".optidigital-brand"))||void 0===r?void 0:r.querySelector(".optidigital-brand-logo"));e.closest(".optidigital-brand")&&i&&this.adLayoutAdapter.setLayoutVisibility(i,!0),o&&this.adLayoutAdapter.setLayoutVisibility(o,!0),n&&this.adLayoutAdapter.updateBrandLogoRuntimeState(n,e)}window.odT.adSlotsUnfilledCount.hasOwnProperty(`${P}`)&&(window.odT.adSlotsUnfilledCount[`${P}`]=0),"instream"===L&&e&&e.parentElement&&(e.parentElement.style.setProperty("height","100%","important"),e.parentElement.style.setProperty("width","100%","important"))}if(!E&&P&&(null===(l=window.odT)||void 0===l?void 0:l.adSlotsUnfilledCount)||E&&"house_reads"===L){if(e&&e.closest(".optidigital-wrapper-div")){const t=e.closest(".optidigital-brand"),i=(null==t?void 0:t.previousElementSibling)&&(null===(c=null==t?void 0:t.previousElementSibling)||void 0===c?void 0:c.classList.contains("optidigital-text-ads"))?t.previousElementSibling:null,o=e.previousElementSibling&&e.previousElementSibling.classList.contains("optidigital-text-ads")?e.previousElementSibling:null,n=e.nextElementSibling;"none"!==(getComputedStyle(e)&&getComputedStyle(e).display)&&"house_reads"!==L||(e.closest(".optidigital-brand")&&i&&this.adLayoutAdapter.setLayoutVisibility(i,!1),o&&this.adLayoutAdapter.setLayoutVisibility(o,!1),n&&this.adLayoutAdapter.hideBrandLogoRuntimeState(n))}E||(window.odT.adSlotsUnfilledCount.hasOwnProperty(`${P}`)?window.odT.adSlotsUnfilledCount[`${P}`]++:window.odT.adSlotsUnfilledCount[`${P}`]=1)}if(e&&e.closest(".optidigital-wrapper-div")){const t=e.closest(".optidigital-wrapper-div");this.adLayoutAdapter.clearWrapperLoadingBackground(t);const i=null===(u=t.parentElement)||void 0===u?void 0:u.closest(".optidigital-wrapper-div");i&&this.adLayoutAdapter.clearWrapperLoadingBackground(i)}"Billboard_1"===_&&E&&"1800x1000"!==M&&(window.odT.finalAdSlotsConfig.adSlotsDefinitions.Billboard_1.dfpSizes=window.odT.finalAdSlotsConfig.adSlotsDefinitions.Billboard_1.dfpSizes.filter(e=>!(1800===e[0]&&1e3===e[1]))),"Billboard_1"===_&&E&&"1800x1000"===M&&(window.odT.wallpaperForBillboard=!0),_.toLowerCase().includes("wallpaper")&&E&&"1800x1000"===M&&(window.odT.wallpaperFilled=!0),E&&this.incrementAdsExposed(_)}if(window.odT&&!window.odT.presyncLoaded&&!window.odT.cookieSyncCalled)if(window.odT.cookieSyncCalled=!0,window.odT.userAction.length)window.odT.log("Trying to run cookie sync for SSPs after user action"),window.odT.runPBSUserSync(!0,!0);else if(!window.odT.presyncTimeoutScheduled){window.odT.presyncTimeoutScheduled=!0;const e=15e3,t=e=>{window.odT.presyncTimeout&&(clearTimeout(window.odT.presyncTimeout),window.odT.presyncTimeout=null),window.odT.userActionOriginal&&(window.odT.userAction=window.odT.userActionOriginal,window.odT.userActionOriginal=null),window.odT.presyncLoaded||(window.odT.log(`Trying to run cookie sync for SSPs ${e}`),window.odT.runPBSUserSync(!0,!0))};if(!window.odT.userActionOriginal){const e=window.odT.userAction;window.odT.userActionOriginal=e,window.odT.userAction=new Proxy(e,{set(e,i,o){const n=Reflect.set(e,i,o);return"length"===i&&e.length>0&&t("after user action detected"),n}})}window.odT.presyncTimeout=setTimeout(()=>{t("after timeout")},e)}if(this.adRequestStats&&(t||this.isSamplingCase())){!t||null!=this.pageViewPayload&&"object"==typeof this.pageViewPayload&&0!==Object.keys(this.pageViewPayload).length||this.pageViewEvent({},!0),this.pageViewPayload=this.pageViewPayload||{},this.pageViewPayload.sampling=t?100:this.liveAnalyticsSampling||25,delete this.pageViewPayload.gdpr;let e={0:"Direct",1:"Lazy Load",2:"Manual",5:"Sticky",6:"Interstitial",7:"Siderail",8:"Rewarded",9:"StickyOverlay",10:"Video"};const i=P||((null===(p=null===window||void 0===window?void 0:window.odT)||void 0===p?void 0:p.divIdPrefix)?`${null===(g=null===window||void 0===window?void 0:window.odT)||void 0===g?void 0:g.divIdPrefix}${_}`:`${_}`);let o=Object.assign({adRequest:{adSlot:void 0!==_&&(null===(m=null===(f=null===(h=null===(w=window.odT)||void 0===w?void 0:w.finalAdSlotsConfig)||void 0===h?void 0:h.adSlotsDefinitions)||void 0===f?void 0:f[_])||void 0===m?void 0:m.cdValue)?window.odT.finalAdSlotsConfig.adSlotsDefinitions[_].cdValue:_,lineItemId:D,filled:E?1:0,refresh:(null===(v=this.adSlotsLoadCount)||void 0===v?void 0:v[i])&&this.adSlotsLoadCount[i]>1?1:0,adSize:this.getAnalyticsAdSize(M,_),demandType:L,prebidWinner:R,prebidBid:O,amazonStatus:z,oyStatus:F,oyTestGroup:$,oyPb:B,nogam:N,format:j,fallback:H},gdpr:{gdprApplies:window.optidigitalToolboxGdpr?1:0,gdprUi:(null==q?void 0:q.consentCMPUIShown)?1:0,status:null==q?void 0:q.consentType}},this.pageViewPayload);if((null===(b=null===(y=window.odT)||void 0===y?void 0:y.initConfig)||void 0===b?void 0:b.adUnit)&&"string"==typeof window.odT.initConfig.adUnit&&""!==window.odT.initConfig.adUnit&&(null===(A=null===(C=null===(S=null===(T=window.odT)||void 0===T?void 0:T.finalAdSlotsConfig)||void 0===S?void 0:S.adSlotsDefinitions)||void 0===C?void 0:C[_])||void 0===A?void 0:A.customAdUnitCode)&&(o.adUnitPath=`${window.odT.initConfig.adUnit}/${window.odT.finalAdSlotsConfig.adSlotsDefinitions[_].customAdUnitCode}`),(null===(x=null===(k=null===(I=window.odT)||void 0===I?void 0:I.finalAdSlotsConfig)||void 0===k?void 0:k.adSlotsDefinitions)||void 0===x?void 0:x[_])&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[_].hasOwnProperty("loadType")?o.adRequest.loadType=e[window.odT.finalAdSlotsConfig.adSlotsDefinitions[_].loadType]:void 0!==V&&(o.adRequest.loadType=e[V]),"Video"!==o.adRequest.loadType||o.adRequest.filled||delete o.adRequest.filled,U&&"object"==typeof U&&Object.keys(U).length&&((null==U?void 0:U.isCached)&&(o.adRequest.isCached=!0,delete U.isCached),o.adRequest.bidders=U),window.odTLibs&&window.odT&&(o.v={l:window.odTLibs.odlauncher,c:window.odTLibs.odcore}),window.odBotScore){const e=parseFloat(window.odBotScore);isNaN(e)||(o.interactionIndex=e)}const n={};Object.keys(o.adRequest).forEach(e=>{const t=o.adRequest[e];""!==t&&null!=t&&(n[e]=t)}),o.adRequest=n,this.sendAnalyticsRequest(o)}}addBidderMetrics(e,t,i,o,n){const d=window.odpbjs||this.tools.getPbjs(),s=()=>{var t,i,n,s,a,r,l,c,u,p,g,w,h,f,m,v,y,b,T,S,C,A,I,k,x,_,P,E,L,D,M,O,R,z,F,$,B,N,U,j,V,H,q,G;const W={};if(e&&"function"==typeof(null==d?void 0:d.getBidResponsesForAdUnitCode)&&"function"==typeof d.getNoBidsForAdUnitCode){const o=d.getBidResponsesForAdUnitCode(e),m=d.getNoBidsForAdUnitCode(e);this.auctionBids[e]=[...o.bids,...m.bids];const v=(e=>{if(0===e.length)return[];const t=e[e.length-1].auctionId;return e.every(e=>e.auctionId===t)?[...e]:e.filter(e=>e.auctionId===t)})(this.auctionBids[e]),y=null===(t=null==d?void 0:d.getHighestUnusedBidResponseForAdUnitCode(e))||void 0===t?void 0:t.cpm,b=null===(n=null===(i=null===window||void 0===window?void 0:window.odT)||void 0===i?void 0:i.bidsFromOe)||void 0===n?void 0:n.find(t=>t.adUnitCode===e),T=null==b?void 0:b.cpm,S=null===(a=null===(s=null===window||void 0===window?void 0:window.odT)||void 0===s?void 0:s.analyticsFromOe)||void 0===a?void 0:a[e];S&&(W.dc=W.dc||[],Object.entries(S).forEach(([e,t])=>{W.dc.push({name:e,bid:t.bid<0?-2:parseFloat(window.odT.convertBidCpm(t.bid)),time:t.time})}));let C=0,A=!1;W.c2s=W.c2s||[],W.s2s=W.s2s||[];for(let t of v){let i=null===(l=null===(r=null==t?void 0:t.metrics)||void 0===r?void 0:r.getMetrics())||void 0===l?void 0:l["adapter.client.total"];i=void 0!==i?Math.round(i):null;const o={name:t.cpm?t.bidderCode:t.bidder,bid:t.cpm?t.cpm:t.timeout?-1:0,time:t.cpm?t.timeToRespond:(null===(u=null===(c=this.auctionMetrics)||void 0===c?void 0:c[t.auctionId])||void 0===u?void 0:u[t.bidder])?null===(g=null===(p=this.auctionMetrics)||void 0===p?void 0:p[t.auctionId])||void 0===g?void 0:g[t.bidder]:i};if(t.cpm&&(C=t.cpm>C?t.cpm:C),(null===(w=this.auctionFailsafe)||void 0===w?void 0:w[null==e?void 0:e.replace((null===(h=null===window||void 0===window?void 0:window.odT)||void 0===h?void 0:h.divIdPrefix)?window.odT.divIdPrefix:"","")])&&(o.bid=-3),"client"!==(null==t?void 0:t.src)&&"client"!==(null==t?void 0:t.source)||W.c2s.push(o),"s2s"===(null==t?void 0:t.src)||"s2s"===(null==t?void 0:t.source)){const e="context deadline exceeded";(null===(f=null==t?void 0:t.serverErrors)||void 0===f?void 0:f.find(t=>t.message===e))&&(o.bid=-2),W.s2s.push(o)}}(y&&y>C||T&&T>C)&&(A=!0,W.isCached=A)}else if(e&&(null===(v=null===(m=this.auctionMetrics)||void 0===m?void 0:m.firstCall)||void 0===v?void 0:v[e])&&!(null===(y=W.c2s)||void 0===y?void 0:y.length)&&!(null===(b=W.s2s)||void 0===b?void 0:b.length)){W.dc=W.dc||[];const t=(null===(C=null===(S=null===(T=this.auctionMetrics)||void 0===T?void 0:T.firstCall)||void 0===S?void 0:S[e])||void 0===C?void 0:C.dc)||[],i=Object.entries(t).map(([e,{bid:t,time:i}])=>({name:e,bid:t<0?-2:parseFloat(window.odT.convertBidCpm(t)),time:i}));W.dc.push(...i)}if(e&&!(null===(I=null===(A=this.auctionMetrics)||void 0===A?void 0:A.firstCall)||void 0===I?void 0:I[e])&&(null===(k=this.auctionMetrics)||void 0===k?void 0:k[e])&&!(null===(x=W.c2s)||void 0===x?void 0:x.length)&&!(null===(_=W.s2s)||void 0===_?void 0:_.length)){W.dc=W.dc||[];((null===(E=null===(P=this.auctionMetrics)||void 0===P?void 0:P.firstCallConfig)||void 0===E?void 0:E[e])||[]).forEach(t=>{var i;const o={name:t,bid:-1,time:(null===(i=this.auctionMetrics)||void 0===i?void 0:i[e])||void 0};W.dc&&W.dc.push(o)})}if(e&&(null===(D=null===(L=this.auctionMetrics)||void 0===L?void 0:L.amazon)||void 0===D?void 0:D[e])){W.c2s=W.c2s||[];const t={name:"amazon",bid:Number(o)>0?404:(null===(z=null===(R=null===(O=null===(M=null===window||void 0===window?void 0:window.odT)||void 0===M?void 0:M.setup)||void 0===O?void 0:O.biddersSetup)||void 0===R?void 0:R.amazon)||void 0===z?void 0:z.timeout)?(null===(N=null===(B=null===($=null===(F=null===window||void 0===window?void 0:window.odT)||void 0===F?void 0:F.setup)||void 0===$?void 0:$.biddersSetup)||void 0===B?void 0:B.amazon)||void 0===N?void 0:N.timeout)>(null===(j=null===(U=this.auctionMetrics)||void 0===U?void 0:U.amazon)||void 0===j?void 0:j[e])?0:-1:0,time:null===(H=null===(V=this.auctionMetrics)||void 0===V?void 0:V.amazon)||void 0===H?void 0:H[e]};(null===(q=this.auctionFailsafe)||void 0===q?void 0:q[null==e?void 0:e.replace((null===(G=null===window||void 0===window?void 0:window.odT)||void 0===G?void 0:G.divIdPrefix)?window.odT.divIdPrefix:"","")])&&(t.bid=-3),W.c2s.push(t)}const K=["c2s","s2s","dc"].filter(e=>Array.isArray(W[e])&&W[e].length>0).reduce((e,t)=>(e[t]=W[t],e),{});return W.isCached&&(K.isCached=!0),Object.keys(K).length?K:{}};if(void 0!==d&&"function"==typeof d.getBidResponsesForAdUnitCode)return s();const a=s();return d.que.push(s),a}updateAdSlotLoad(e){let t=new Date;this.adSlotsLoadTime[e]=t.getTime(),this.adSlotsLoadCount.hasOwnProperty(e)?this.adSlotsLoadCount[e]++:this.adSlotsLoadCount[e]=1}registerAdslotLoad(e,t,i,o){var n,d,s,a,r,l,c,u,p,g,w,h,f,m,v,y,b,T,S,C;let A=(new Date).getTime(),I=0,k=!1;const{hb_bidder:x,hb_pb:_,amznbid:P,od_pfg:E,od_pf_group:L,od_pf_pb:D,hb_format:M,isAmznbid:O}=this.tools.checkSlotTargeting(i.slot);let R="gam_direct";if(null!=i.yieldGroupIds&&(R="gam_adx"),null!=i.advertiserId&&(null===(n=this.setup)||void 0===n?void 0:n.advertisers)&&Object.keys(this.setup.advertisers).length>0)(null===(d=this.setup.advertisers)||void 0===d?void 0:d.hasOwnProperty("adx"))?-1!=(null===(s=this.setup.advertisers.adx)||void 0===s?void 0:s.indexOf(i.advertiserId))&&(R=i.lineItemId?"gam_direct":"gam_adx"):R=i.lineItemId?"gam_direct":"gam_adx",(null===(a=this.setup.advertisers)||void 0===a?void 0:a.hasOwnProperty("house"))&&-1!=(null===(r=this.setup.advertisers.house)||void 0===r?void 0:r.indexOf(i.advertiserId))&&(R="gam_house"),(null===(l=this.setup.advertisers)||void 0===l?void 0:l.hasOwnProperty("amazon"))&&-1!=(null===(c=this.setup.advertisers.amazon)||void 0===c?void 0:c.indexOf(i.advertiserId))&&(R="amazon"),(null===(u=this.setup.advertisers)||void 0===u?void 0:u.hasOwnProperty("prebid"))&&-1!=(null===(p=this.setup.advertisers.prebid)||void 0===p?void 0:p.indexOf(i.advertiserId))&&(R="prebid",k=!0);else{const t=((e,t)=>{var i,o;const n=document.getElementById(e),d=null==n?void 0:n.querySelector("iframe");let s;if(d)try{s=(null===(o=null===(i=d.contentDocument)||void 0===i?void 0:i.body)||void 0===o?void 0:o.innerHTML)||void 0}catch(e){s=void 0}const a=[null==n?void 0:n.outerHTML,s].filter(Boolean);for(const e of a){const t=e.toLowerCase();if(t.includes("renderad")||t.includes("prebid")||t.includes("uctag"))return k=!0,"prebid";if(t.includes("apstag")||t.includes("amazon-adsystem"))return"amazon"}return t.lineItemId?"gam_direct":"gam_adx"})(e,i);R=t||(i.adTransparencyUrl?"gam_house":i.lineItemId?"gam_direct":"gam_adx")}if(t?I++:R="unfilled",window.odT){if(window.odT.adSlotsLoadStatus.hasOwnProperty(e)?("prebid"!==R||"prebid"===R&&!window.odT.loadCoreFinished)&&(window.odT.adSlotsLoadStatus[e].time=A,window.odT.adSlotsLoadStatus[e].c++,window.odT.adSlotsLoadStatus[e].f1+=I,window.odT.adSlotsLoadStatus[e].s.push("prebid"===R?`${R}_${x}`:R)):("prebid"!==R||"prebid"===R&&!window.odT.loadCoreFinished)&&(window.odT.adSlotsLoadStatus[e]={time:A,c:1,f1:I,s:["prebid"===R?`${R}_${x}`:R]}),"gam_direct"===R){if(window.odT.adSlotsLoadStatus[e].delay=!1,window.odT.setup.directDemandRefreshDelay&&(window.odT.adSlotsLoadStatus[e].delay=window.odT.setup.directDemandRefreshDelay),window.odT.setup.directDemandCustomRefresh){const t=((e=null,t=null)=>{const i=window.odT.setup.directDemandCustomRefresh.find(e=>t&&e.lineItems&&e.lineItems.includes(t));if(i)return i.delay;const o=window.odT.setup.directDemandCustomRefresh.find(t=>e&&t.advertisers&&t.advertisers.includes(e));return o?o.delay:null})(i.advertiserId,i.lineItemId);t&&(window.odT.adSlotsLoadStatus[e].delay=t)}}else("prebid"!==R||"prebid"===R&&!window.odT.loadCoreFinished)&&(window.odT.adSlotsLoadStatus[e].delay=!1);if("gam_direct"===R){let e=!1;const t=()=>{var t,o,n,d;return e=window.odT.setup.anchorModeDirectDemand||(null===(o=null===(t=window.odT.setup)||void 0===t?void 0:t.anchorModeAdvertisers)||void 0===o?void 0:o.includes(i.advertiserId))||(null===(d=null===(n=window.odT.setup)||void 0===n?void 0:n.anchorModeLineItems)||void 0===d?void 0:d.includes(i.lineItemId)),e};t(),!e||window.odT.stickyFormatLoaded.length&&window.odT.stickyFormatLoaded.includes(o)||null===i.size||1===i.size[0]||1800===i.size[0]||1e3===i.size[1]||!window.odT.stickyFormatClosed||window.odT.setStickyFormat(o,null===(g=i.size)||void 0===g?void 0:g[0],window.odT.setup.stickyFormatTimeout?window.odT.setup.stickyFormatTimeout:4e3)}}let z="null";null!=i.size&&(z=this.tools.formatSizeArrayToString(i.size));const F=null===(f=null===(h=null===(w=window.odT)||void 0===w?void 0:w.finalAdSlotsConfig)||void 0===h?void 0:h.adSlotsDefinitions)||void 0===f?void 0:f[o];if((null==F?void 0:F.isFlyingCarpetEnabled)&&"unfilled"!==R){const e=null===(m=null==i?void 0:i.slot)||void 0===m?void 0:m.getTargeting("hb_size"),t=Array.isArray(e)&&e.length?e[0]:null;F.lastWinnerDemandType=R,F.lastRenderedSize="prebid"===R?window.odT.parseRenderedSize(t):null}O&&(null===(y=null===(v=window.odAnalytics)||void 0===v?void 0:v.amazonAuction)||void 0===y?void 0:y.duration)&&(window.odAnalytics.analytics.auctionMetrics.amazon=window.odAnalytics.analytics.auctionMetrics.amazon||{},window.odAnalytics.analytics.auctionMetrics.amazon[e]=window.odAnalytics.amazonAuction.duration);const $=this.addBidderMetrics(e,x,_,P,null),B=Object.assign({divId:o,divIdFull:e,filled:t,demandType:R,lineItemId:i.lineItemId,size:z,prebidWinner:x,prebidBid:Number.parseFloat(_)||0,amazonStatus:P,oyStatus:E,oyTestGroup:L,oyPb:D,nogam:!1,bidders:Object.keys($).length?$:null},k&&{format:M});"unfilled"===R||(null===(b=null===window||void 0===window?void 0:window.odT)||void 0===b?void 0:b.replaceHouseCampaigns(o,null==i?void 0:i.advertiserId))||this.adRequestEvent(B),"unfilled"!==R||(null===(T=null===window||void 0===window?void 0:window.odT)||void 0===T?void 0:T.isBackfillEnabled(o))||(null===(S=null===window||void 0===window?void 0:window.odT)||void 0===S?void 0:S.isSecondChanceEnabled(o,e))||(null===(C=null===window||void 0===window?void 0:window.odT)||void 0===C?void 0:C.isHouseReadsEnabled(o))||this.adRequestEvent(B)}}f.DEFAULT_CONTENT_SELECTORS=[],f.DEFAULT_WORDS_HTML_TAG=["h1","h2","h3","p"],f.DEFAULT_EXCLUDE_TAGS=["header","footer"],f.DEFAULT_EXCLUDE_PATTERNS=[/taboola/i,/smartbox/i,/ob-smartfeed-wrapp/i,/feed/i,/comment/i],f.DEFAULT_EXCLUDE_LENGTH_PATTERNS=[/taboola/i,/smartbox/i,/ob-smartfeed-wrapp/i,/feed/i,/comment/i],f.MIN_WORDS=100,f.MIN_SURFACE=5e4,f.MIN_RATIO_WORDS=.1,f.CHILD_RATIO=.667;const m=f;var v=function(e,t,i,o){return new(i||(i=Promise))(function(n,d){function s(e){try{r(o.next(e))}catch(e){d(e)}}function a(e){try{r(o.throw(e))}catch(e){d(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,a)}r((o=o.apply(e,t||[])).next())})};const y=class{constructor(e){var t;if(this.setup={},this.prebidAdUnits=[],this.adslotResults=new Map,this.videoInstreamStatus="init",this.videoGAMCorrelator=0,this.videoInstreamDMEncoding=1,this.videoInstreamPageTargeting={},this.videoInstreamLazyLoad=!0,this.startExecuted=!1,this.videoInstreamHBTimeout=3e3,this.videoInstreamTimeout=4e3,this.videoInstreamPrebidReady=!1,this.videoInstreamAmazonReady=!1,this.currentVideoAdSlotConfig=null,this.prebidParams=[],this.amazonParams=[],this.prebidVideoAdunits=[],this.waitingForConsent=!1,this.consentCallbackRegistered=!1,this.hasLoadedVideoModule=!1,this.initializedVideoSlots=new Set,this.hasAnyBids=!1,this.tools=s,0!==Object.keys(e).length){if(window.odT.log("InStream Module - Initializing"),this.setup=e,this.videoInstreamDMEncoding=null!==(t=e.dmEncoding)&&void 0!==t?t:1,this.startExecuted=e.startExecuted||!1,this.isVideoDebugEnabled()&&(this.setup.useImaSdkFetch=!0,window.odT.log("InStream Module - Video debug mode enabled: useImaSdkFetch set to true")),window.odT.initConfig.pageTargeting&&"object"==typeof window.odT.initConfig.pageTargeting){const e=window.odT.initConfig.pageTargeting||{};try{this.videoInstreamPageTargeting=this.normalizeCustomTargetingMap(e)}catch(e){window.odT.log("InStream Module - Error - Invalid page targeting:",e)}}this.init()}else window.odT.log("InStream Module - Error: OptiDigitalInstreamV1 setup is empty")}init(){window.odT.log("InStream Module - Initialized"),window.odT.optidigitalInstream=this}isVideoDebugEnabled(){try{return"true"===new URLSearchParams(window.location.search).get("optidigital_videodebug")}catch(e){return window.odT.log("InStream Module - Error checking video debug parameter:",e),!1}}setStartExecuted(e){this.startExecuted=e}getVideoInstreamAds(e,t,i){var o,n;this.setStartExecuted(!0);const d=null===(o=this.setup.videoAdSlotConfigurations)||void 0===o?void 0:o.map(t=>Object.assign(Object.assign({},t),{videoAdslots:t.videoAdslots.filter(t=>e.includes(t.adslot))})).filter(e=>e.videoAdslots.length>0);if(d&&0!==d.length){if(this.currentVideoAdSlotConfig=d,this.videoInstreamCallback=t,i&&!0!==(null===(n=this.setup)||void 0===n?void 0:n.videoInstreamIgnoreAPITimeout)&&(this.videoInstreamTimeout=i),this.videoInstreamStatus="auction",this.videoInstreamPrebidReady=!1,this.videoInstreamAmazonReady=!1,this.videoInstreamLazyLoad=!1,this.setup.lazyload){const e=document.querySelector(this.setup.lazyload.divSelector);if(null!=e){const t=e.getBoundingClientRect();t.top>=0&&t.top-window.innerHeight<=this.setup.lazyload.lazyLoadPx||t.top<0&&Math.abs(t.top)<=this.setup.lazyload.lazyLoadPx?this.videoInstreamLazyLoad=!1:(this.videoInstreamLazyLoad=!0,this.monitorVideoLazyLoadPlayer(this.setup.lazyload.divSelector,this.setup.lazyload.lazyLoadPx))}}this.videoInstreamLazyLoad||(this.startExecuted?this.checkConsentAndFetchVIADS():(this.videoInstreamPrebidReady=!0,this.videoInstreamAmazonReady=!0,this.videoBiddersBack()))}else window.odT.log(`InStream Module - Error: Div configuration not found for adslots: ${e}`,this.setup.videoAdSlotConfigurations)}monitorVideoLazyLoadPlayer(e,t){this.videoInstreamLazyIntervalID=setInterval(()=>{if(this.videoInstreamLazyLoad){const i=document.querySelector(e);if(null!=i){const e=i.getBoundingClientRect();(e.top>=0&&e.top-window.innerHeight<=t||e.top<0&&Math.abs(e.top)<=t)&&(clearInterval(this.videoInstreamLazyIntervalID),this.videoInstreamLazyLoad=!1,window.odT.log("InStream Module - Load Video Lazy Load player configuration"),this.startExecuted?this.checkConsentAndFetchVIADS():(this.videoInstreamPrebidReady=!0,this.videoInstreamAmazonReady=!0,this.videoBiddersBack()))}}},500)}checkConsentAndFetchVIADS(){if(window.odT.consentStatusNoGAM&&-1!==window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)){if(window.odT.log("InStream Module - CMP consent rejected, aborting video ad fetch"),this.videoInstreamStatus="aborted",this.videoInstreamCallback)try{this.videoInstreamCallback([])}catch(e){window.odT.log("InStream Module - Error: Video instream callback (consent rejected):",e)}}else!0===window.odT.CMPready&&window.odT.consentStatusNoGAM&&-1===window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)?this.fetchVIADS():this.waitingForConsent||(this.waitingForConsent=!0,window.odT.log("InStream Module - Waiting for CMP consent decision"),this.registerConsentCallback())}registerConsentCallback(){if(this.consentCallbackRegistered)return;this.consentCallbackRegistered=!0,window.odT.eventCallback||(window.odT.eventCallback=[]);const e=(t,i)=>{if("CONSENT_READY"===t){if(this.waitingForConsent=!1,window.odT.consentStatusNoGAM&&-1!==window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)){window.odT.log("InStream Module - CMP consent rejected, aborting video ad fetch"),this.videoInstreamStatus="aborted";const t=window.odT.eventCallback.indexOf(e);if(t>-1&&window.odT.eventCallback.splice(t,1),this.consentCallbackRegistered=!1,this.videoInstreamCallback)try{this.videoInstreamCallback([])}catch(e){window.odT.log("InStream Module - Error: Video instream callback (consent rejected):",e)}return}if(!0===window.odT.CMPready&&window.odT.consentStatusNoGAM&&-1===window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)){window.odT.log("InStream Module - CMP consent OK, proceeding with video ad fetch");const t=window.odT.eventCallback.indexOf(e);t>-1&&window.odT.eventCallback.splice(t,1),this.consentCallbackRegistered=!1,this.fetchVIADS()}}};window.odT.eventCallback.push(e),!0===window.odT.CMPready&&window.odT.consentStatusNoGAM&&-1===window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)&&setTimeout(()=>{e("CONSENT_READY",{status:window.odT.consentStatus})},0)}fetchVIADS(){this.fetchPrebidVideoBids().catch(e=>{window.odT.log("InStream Module - Error fetching Prebid bids:",e),this.videoInstreamPrebidReady=!0,this.videoBiddersBack()}),this.setup.biddersSetup&&this.setup.biddersSetup.amazon?this.fetchAPSVideoBids():this.videoInstreamAmazonReady=!0,setTimeout(()=>{try{this.callVideoInstreamCallback()}catch(e){window.odT.log("InStream Module - Error: Video instream callback:",e)}},this.videoInstreamTimeout)}waitForPrebidInstance(){return v(this,arguments,void 0,function*(e=2e3,t=50){const i=Date.now();for(;Date.now()-i<e;){const e=this.getPrebidInstance();if(e)return window.odT.log(`InStream Module - Prebid instance found after ${Date.now()-i} ms`),e;yield new Promise(e=>setTimeout(e,t))}return window.odT.log(`InStream Module - Prebid instance not found after ${Date.now()-i} ms timeout`),null})}fetchPrebidVideoBids(){return v(this,void 0,void 0,function*(){if(!this.currentVideoAdSlotConfig)return;window.odT.log("InStream Module - Fetch Prebid"),window.odT.userAction.push("triggerInstream"),window.odT.loadCore();const e=yield this.waitForPrebidInstance(window.odT.setup.loadCoreTimeout||2e3);if(!e)return window.odT.log("InStream Module - Prebid unavailable: no instance with requestBids(), skipping Prebid"),this.videoInstreamPrebidReady=!0,void this.videoBiddersBack();const t=[];for(const i of this.currentVideoAdSlotConfig)if(i.videoAdslots.forEach(e=>{const i=this.findConfigForAdslot(e.adslot);if(!i)return;const o=`${i.adslot}`;if(t.push(o),-1===this.prebidAdUnits.indexOf(o)){const e=this.getPrebidVideoAdunit(o,i.videoAdunitConfig);e&&(this.prebidVideoAdunits.push(e),this.prebidAdUnits.push(o))}}),t.length>0){const i=()=>{var i;window.odT.log("InStream Module - Prebid bids request"),window.odT.oyStatus&&(null===(i=window.optiyield)||void 0===i||i.cmd.push(()=>{var e;const t=null===(e=window.optiyield)||void 0===e?void 0:e.setPrebidFloors(window.odT.instreamModule.prebidVideoAdunits,window.odT.setP);(null==t?void 0:t.length)>0&&(window.odT.instreamModule.prebidVideoAdunits=t)})),window.odT.log("InStream Module - Prebid bids addAdUnits",window.odT.instreamModule.prebidVideoAdunits),e.addAdUnits(window.odT.instreamModule.prebidVideoAdunits),window.odT.log("InStream Module - Prebid bids requestBids"),e.setConfig({mediaTypePriceGranularity:{video:{buckets:[{precision:2,min:0,max:.1,increment:.01},{precision:2,min:.1,max:10,increment:.05},{precision:2,min:10,max:50,increment:.25}]}}}),e.requestBids({timeout:window.odT.instreamModule.videoInstreamTimeout,adUnitCodes:t,bidsBackHandler:t=>{let i=e.getBidResponses();i&&"object"==typeof i&&Object.keys(i).length>0?(this.hasAnyBids=!0,window.odT.log("InStream Module - Prebid bids received",i)):window.odT.log("InStream Module - No prebid bids received",i);let o=e.getAdserverTargeting();window.odT.instreamModule.processPrebidBids(o),window.odT.instreamModule.videoInstreamPrebidReady=!0,window.odT.instreamModule.videoBiddersBack()}})};e.que&&"function"==typeof e.que.push?e.que.push(i):i()}else this.videoInstreamPrebidReady=!0})}getPrebidInstance(){const e=[window.odpbjs,window.pbjs],t=window._pbjsGlobals;return Array.isArray(t)&&t.forEach(t=>{const i=window[t];i&&e.push(i)}),e.find(e=>e&&"function"==typeof e.requestBids)||null}processPrebidBids(e){if(!this.currentVideoAdSlotConfig)return this.videoInstreamPrebidReady=!0,void this.videoBiddersBack();for(const t of this.currentVideoAdSlotConfig)t.videoAdslots.forEach(t=>{const i=this.findConfigForAdslot(t.adslot);if(!i)return;const o=`${i.adslot}`,n=`optidigital-adslot-${i.adslot}`;if(e.hasOwnProperty(o)&&e[o].hasOwnProperty("hb_bidder")&&e[o].hasOwnProperty("hb_uuid")&&e[o].hasOwnProperty("hb_pb")&&e[o].hasOwnProperty("hb_size")&&e[o].hasOwnProperty("hb_format")){let t="&hb_bidder="+e[o].hb_bidder;t+="&hb_uuid="+e[o].hb_uuid,t+="&hb_pb="+e[o].hb_pb,t+="&hb_size="+e[o].hb_size,t+="&hb_format="+e[o].hb_format;const i=this.adslotResults.get(n)||{[o]:{vastURL:"",customParams:""}};this.prebidParams[o]=t,this.adslotResults.set(n,i)}})}fetchAPSVideoBids(){var e;if(window.odT.log("InStream Module - Fetch Amazon"),!window.odT.enableAmazonAPS||!this.currentVideoAdSlotConfig)return this.videoInstreamAmazonReady=!0,void this.videoBiddersBack();let t=[];for(const i of this.currentVideoAdSlotConfig)i.videoAdslots.forEach(e=>{var i,o,n,d,s,a;const r=this.findConfigForAdslot(e.adslot);if(!r)return;const l=`${r.adslot}`;if(null===(n=null===(o=null===(i=this.setup.biddersSetup)||void 0===i?void 0:i.amazon)||void 0===o?void 0:o.adSlots)||void 0===n?void 0:n.hasOwnProperty(l)){const e={slotID:this.setup.biddersSetup.amazon.adSlots[l].slotId,mediaType:"video",sizes:this.setup.biddersSetup.amazon.adSlots[l].sizes,optiYield:{adUnitPath:window.odT.initConfig.adUnit,cd:{cd1:l}}};(null===(s=null===(d=window.odT)||void 0===d?void 0:d.initConfig)||void 0===s?void 0:s.adUnit)&&window.odT.enableGpid&&"function"==typeof(null===(a=null===window||void 0===window?void 0:window.aps)||void 0===a?void 0:a.record)&&window.aps.record("ad/gpid/define",{map:{[l]:`${window.odT.initConfig.adUnit}#${l}`}}),t.push(e)}}),t.length>0?(window.odT.oyStatus&&(null===(e=window.optiyield)||void 0===e||e.cmd.push(()=>{var e;try{t=null===(e=window.optiyield)||void 0===e?void 0:e.setAmazonFloors(t,window.odT.setA)}catch(e){window.odT.log("InStream Module - Error: setAmazonFloors:",e)}})),window.apstag.fetchBids({slots:t,timeout:this.videoInstreamTimeout},e=>{e&&e.length>0?(this.hasAnyBids=!0,window.odT.log("InStream Module - Amazon VIDEO bids received",e)):window.odT.log("InStream Module - No amazon VIDEO bids received",e),this.processAmazonBids(e),this.videoInstreamAmazonReady=!0,this.videoBiddersBack()})):(this.videoInstreamAmazonReady=!0,this.videoBiddersBack())}processAmazonBids(e){if(!this.currentVideoAdSlotConfig)return this.videoInstreamAmazonReady=!0,void this.videoBiddersBack();if(e.length>0)for(const t of this.currentVideoAdSlotConfig)t.videoAdslots.forEach(t=>{const i=this.findConfigForAdslot(t.adslot);if(!i)return;const o=`${i.adslot}`,n=`optidigital-adslot-${i.adslot}`,d=e.find(e=>{var t,i,n,d;return e.slotID===(null===(d=null===(n=null===(i=null===(t=this.setup.biddersSetup)||void 0===t?void 0:t.amazon)||void 0===i?void 0:i.adSlots)||void 0===n?void 0:n[o])||void 0===d?void 0:d.slotId)});if(d){const e=this.adslotResults.get(n)||{[o]:{vastURL:"",customParams:""}};this.amazonParams[o]=d.qsParams,this.adslotResults.set(n,e)}})}getPrebidVideoAdunit(e,t){const i=[];if(this.setup.biddersSetup&&Object.keys(this.setup.biddersSetup).forEach(t=>{var o;if("amazon"===t)return;const n=this.setup.biddersSetup[t];if(null===(o=null==n?void 0:n.adSlots)||void 0===o?void 0:o.hasOwnProperty(e)){const o={bidder:t,params:n.adSlots[e]};i.push(o)}}),i.length>0){let o={};if(window.odT.initConfig&&window.odT.initConfig.adUnit&&window.odT.enableGpid){const t=`${window.odT.initConfig.adUnit}/${e}`;o={ext:{data:{pbadslot:t},gpid:t}}}return{code:e,mediaTypes:{video:t},bids:i,optiYield:{adUnitPath:`${window.odT.initConfig.adUnit}`,cd:{cd1:e}},ortb2Imp:o}}return null}videoBiddersBack(){this.videoInstreamAmazonReady&&this.videoInstreamPrebidReady&&(window.odT.log("InStream Module - Prebid & Amazon VIDEO bids received"),this.callVideoInstreamCallback())}resolveVideoDivId(e,t){var i,o,n,d;const s=null===(d=null===(n=null===(o=null===(i=window.odT)||void 0===i?void 0:i.finalAdSlotsConfig)||void 0===o?void 0:o.adSlotsDefinitions)||void 0===n?void 0:n[e])||void 0===d?void 0:d.divId;return"string"==typeof s&&s.length>0?s:t}findConfigForAdslot(e){const t=this.currentVideoAdSlotConfig;if(t)for(const i of t){const t=i.videoAdslots.find(t=>t.adslot===e);if(t)return t}}callVideoInstreamCallback(){if(this.videoInstreamStatus&&"done"!==this.videoInstreamStatus&&"aborted"!==this.videoInstreamStatus){if(window.odT.consentStatusNoGAM&&-1!==window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)){if(window.odT.log("InStream Module - CMP consent rejected, aborting GAM callback"),this.videoInstreamStatus="aborted",this.videoInstreamCallback)try{this.videoInstreamCallback([])}catch(e){window.odT.log("InStream Module - Error in video instream callback (consent rejected):",e)}return}if(this.videoInstreamStatus="done",!this.currentVideoAdSlotConfig)return;const e=[];this.vastURLCustomParams={};for(const t of this.currentVideoAdSlotConfig){t.videoAdslots.forEach(t=>{var i,o,n;const d=this.findConfigForAdslot(t.adslot);if(!d)return;const s=`${d.adslot}`,a=`optidigital-adslot-${d.adslot}`,r=this.adslotResults.get(a)||{[s]:{vastURL:"",customParams:""}},l=this.getVideoCustomParam(d,this.amazonParams&&this.amazonParams[s]||"",this.prebidParams&&this.prebidParams[s]||"");1===this.videoInstreamDMEncoding?(r[s].customParams=l,this.setup.dmGAMVASTParams&&(r[s].customParams+=this.setup.dmGAMVASTParams)):r[s].customParams=encodeURIComponent(l),this.vastURLCustomParams[s]=r[s].customParams,r[s].vastURL=this.getVideoGAMVASTTagURL(d),e.push(r);const c=window.odT.analytics.addBidderMetrics(s);let u=null;window.odT.oyStatus&&(null===(i=window.optiyield)||void 0===i||i.cmd.push(()=>{u=window.optiyield.getFloors({adUnitPath:window.odT.initConfig.adUnit,customDimensions:{cd1:t.adslot}},"Video-instream")}));const p={divId:s,divIdFull:a,demandType:"instream",amazonStatus:this.amazonParams&&this.amazonParams[s]&&this.amazonParams[s].includes("amznbid")?1:0,oyStatus:void 0!==window.odT.oyStatus?1:0,oyTestGroup:void 0!==(null==u?void 0:u.group)?u.group:0,oyPb:void 0!==(null===(o=null==u?void 0:u.pf)||void 0===o?void 0:o.gam)?u.pf.gam:void 0,loadType:10,nogam:!1,bidders:Object.keys(c).length?c:null};Array.isArray(null===(n=null==d?void 0:d.videoAdunitConfig)||void 0===n?void 0:n.playerSize)&&!Array.isArray(d.videoAdunitConfig.playerSize[0])&&(p.size=d.videoAdunitConfig.playerSize.join("x")),(null==d?void 0:d.playerConfig)||window.odT.analytics.adRequestEvent(p)});try{window.odT.log("InStream Module - Callback"),this.videoInstreamCallback(e)}catch(e){window.odT.log("InStream Module - Error in video instream callback:",e)}}}}formatVASTSizes(e){return Array.isArray(e[0])?e.map(e=>e.join("x")).join("|"):e.join("x")}getVASTSizeParam(e){var t;const i=(null!==(t=e.vastSizes)&&void 0!==t?t:[]).filter(e=>Array.isArray(e)&&2===e.length&&e.every(e=>"number"==typeof e&&!Number.isNaN(e)));return i.length>0?this.formatVASTSizes(i):this.formatVASTSizes(e.videoAdunitConfig.playerSize)}getVideoGAMVASTTagURL(e){var t,i,o,n,d;let s="https://pubads.g.doubleclick.net/gampad/ads?";s+="iu="+window.odT.initConfig.adUnit,s+="&sz="+this.getVASTSizeParam(e),s+="&ad_rule=0&plcmt="+(e.videoAdunitConfig.plcmt||1)+"&cust_params=",this.vastURLCustomParams&&this.vastURLCustomParams[e.adslot]&&(s+=encodeURIComponent(this.vastURLCustomParams[e.adslot]));let a="auto",r="0";return e.videoAdunitConfig.playbackmethod&&(e.videoAdunitConfig.playbackmethod.includes(3)&&(a="click"),(e.videoAdunitConfig.playbackmethod.includes(2)||e.videoAdunitConfig.playbackmethod.includes(6))&&(r="1")),s+="&vpa="+a+"&vpmute="+r,s+="&vpos="+e.type,s+="&gdfp_req=1&output=xml_vast4&unviewed_position_start=1&env=vp",s+="&correlator="+(this.videoGAMCorrelator++||Math.floor(1e13*Math.random())),s+="&url="+encodeURIComponent((null===(t=window.top)||void 0===t?void 0:t.location.href)||""),s+="&description_url="+encodeURIComponent((null===(i=window.top)||void 0===i?void 0:i.location.href)||""),window.odT.consentV2TCData&&!0===window.odT.consentV2TCData.gdprApplies&&(s+="&gdpr=1",s+="&gdpr_consent="+window.odT.consentV2TCData.tcString,window.odT.consentV2TCData.addtlConsent&&(s+="&addtl_consent="+window.odT.consentV2TCData.addtlConsent)),s+="&sdkv=h.3.777.0&osd=2&frm=0&vis=1&sdr=1",s+="&hl="+(navigator.language||""),s+="&is_amp=0&u_so=l&ctv=0&mpt=videojs-ima&mpv=2.0.6&sdki=100000445&ptt=20&vo=0&sdk_apis=2,7,8&omid_p=Google1/h.3.777.0",(null===(o=null==e?void 0:e.playerConfig)||void 0===o?void 0:o.videoSource)&&(s+="&media_url="+encodeURIComponent(e.playerConfig.videoSource)),s+="&top="+encodeURIComponent((null===(n=window.top)||void 0===n?void 0:n.location.href)||""),s+="&loc="+encodeURIComponent((null===(d=window.top)||void 0===d?void 0:d.location.href)||""),s}getVideoCustomParam(e,t,i){var o,n,d,s,a;let r=`${(null===(s=null===(d=null===(n=null===(o=window.odT)||void 0===o?void 0:o.setup)||void 0===n?void 0:n.customTargeting)||void 0===d?void 0:d.adslot)||void 0===s?void 0:s.name)?window.odT.setup.customTargeting.adslot.name:"adslot"}=`+e.adslot;const l={odtag_status:"1"};"test"===window.odT.testGroup&&(l.test_group="test");const c=window.odT.customPageTargeting||{},u=Object.assign(Object.assign(Object.assign(Object.assign({},l),this.videoInstreamPageTargeting),c),e.customTargeting||{});return r+=this.stringifyCustomTargetingMap(u),!0!==window.odT.limitedAds||"CMPv2_LAokHBok"!==window.odT.consentStatus&&"CMPv2_LAokHBko"!==window.odT.consentStatus||(r+="&od_limitedads=1"),window.odT.oyStatus&&(null===(a=window.optiyield)||void 0===a||a.cmd.push(()=>{var t;const i=decodeURIComponent(null===(t=window.optiyield)||void 0===t?void 0:t.getVideoInStreamFloor(window.odT.initConfig.adUnit,{cd1:e.adslot}));i&&(r+="&"+i)})),i&&(r+=i),t&&(r+=t),r}isSerializableTargetingValue(e){return"string"==typeof e||"number"==typeof e}normalizeCustomTargetingMap(e={}){try{return Object.entries(e).reduce((e,[t,i])=>{if(Array.isArray(i)){const o=this.tools.flattenTargetingValues(i).filter(e=>this.isSerializableTargetingValue(e)).map(e=>String(e)).filter(e=>""!==e);return o.length>0&&(e[t]=o),e}return this.isSerializableTargetingValue(i)&&""!==i?(e[t]=String(i),e):e},{})}catch(e){return window.odT.log("InStream Module - Error - Can not normalize custom targeting:",e),{}}}stringifyCustomTargetingMap(e={}){try{return Object.entries(e).map(([e,t])=>{if(Array.isArray(t)){const i=this.tools.flattenTargetingValues(t).filter(e=>this.isSerializableTargetingValue(e)).filter(e=>""!==e).join(",");return i?`&${e}=${i}`:""}return null==t||""===t?"":this.isSerializableTargetingValue(t)?`&${e}=${String(t)}`:""}).join("")}catch(e){return window.odT.log("InStream Module - Error - Can not stringify custom targeting:",e),""}}getVastUrlFromResults(e,t){var i;for(const o of e){const e=null===(i=o[t])||void 0===i?void 0:i.vastURL;if(e)return e}return""}isNonEmptyGamVastResponse(e){const t=e.trim();return!!t&&/<Ad[\s>]/i.test(t)}parseVastXml(e){try{const t=(new DOMParser).parseFromString(e,"text/xml"),i=t.querySelector("parsererror");return i?(window.odT.log("InStream Module - VAST XML parsing error:",i.textContent),null):t}catch(e){return window.odT.log("InStream Module - Failed to parse VAST XML:",e),null}}identifyDemandSource(e){var t,i;const o=this.parseVastXml(e);if(!o)return{source:"gam_adx"};const n=o.querySelector("Ad"),d=null==n?void 0:n.getAttribute("id"),s=d?parseInt(d):void 0,a=o.querySelector("AdSystem"),r=(null===(t=null==a?void 0:a.textContent)||void 0===t?void 0:t.trim())||"",l=o.querySelector("VASTAdTagURI"),c=(null===(i=null==l?void 0:l.textContent)||void 0===i?void 0:i.trim())||"";return"GDFP"===r?c&&c.includes("pbs.optidigital.com")?{source:"prebid",lineItemId:s}:c&&c.includes("aax.amazon-adsystem.com")?{source:"amazon",lineItemId:s}:{source:"gam_direct",lineItemId:s}:{source:"gam_adx"}}fetchGamVastXml(e){return v(this,void 0,void 0,function*(){try{const t=yield fetch(e,{credentials:"include",mode:"cors"});return t.ok?yield t.text():(window.odT.log("InStream Module - GAM VAST fetch failed with status",t.status),"")}catch(e){return window.odT.log("InStream Module - GAM VAST fetch error:",e),""}})}loadVideoModule(){return v(this,void 0,void 0,function*(){var e;if(!this.hasLoadedVideoModule){const t=s.resolveOdLibUrl("video",`https://scripts.opti-digital.com/lib/?site=${window.odT.siteCode}&lib=odvideos&v=${null===(e=window.odTLibs)||void 0===e?void 0:e.odvideo}`),{default:i}=yield import(t);window.odT.log("InStream Module - OptiDigitalVideoV1 module loaded"),new i,window.odT.log("InStream Module - OptiDigitalVideoV1 instance created"),this.hasLoadedVideoModule=!0}})}getVideoFallbackAdslotName(e){var t;const i=null===(t=null===window||void 0===window?void 0:window.odT)||void 0===t?void 0:t.screen;if(!i)return;const o=null==e?void 0:e[`fallback${i}`];return"string"==typeof o&&0!==o.length?o:void 0}hasVideoFallback(e){return"string"==typeof this.getVideoFallbackAdslotName(e)}clearFallbackFlag(e){var t,i,o;const n=null===(o=null===(i=null===(t=odT.setup)||void 0===t?void 0:t.adSlotsConfig)||void 0===i?void 0:i.adSlotsDefinitions)||void 0===o?void 0:o.find(t=>t&&t.name===e);n&&delete n.isFallBack}findFallbackPlacements(e){var t;const i=`${(null===(t=window.odT)||void 0===t?void 0:t.divIdPrefix)||"optidigital-adslot-"}${e}`,o=new Set,n=document.getElementById(i);return n instanceof HTMLElement&&o.add(n),document.querySelectorAll(`[data-adslot-id="${i}"]`).forEach(e=>{e instanceof HTMLElement&&o.add(e)}),Array.from(document.getElementsByClassName(e)).forEach(e=>{e instanceof HTMLElement&&o.add(e)}),Array.from(o)}repurposeVideoElementForFallback(e,t,i){var o,n,d,s;const a=`${(null===(o=window.odT)||void 0===o?void 0:o.divIdPrefix)||"optidigital-adslot-"}${i}`;e.removeAttribute("data-template"),e.id=a,e.className=i,e.setAttribute("data-adslot-id",a),e.style.removeProperty("display"),e.style.removeProperty("width"),e.style.removeProperty("height");const r=null===(n=window.odT.finalAdSlotsConfig)||void 0===n?void 0:n.adSlotsDefinitions;return(null==r?void 0:r[t])&&delete r[t],"function"==typeof(null===(s=null===(d=window.odT)||void 0===d?void 0:d.adLayoutAdapter)||void 0===s?void 0:s.setLayoutVisibility)&&window.odT.adLayoutAdapter.setLayoutVisibility(e,!0),e}resolveFallbackAdslotDefinition(e,t){var i;window.odT.finalAdSlotsConfig=window.odT.finalAdSlotsConfig||{adSlotsDefinitions:{}};const o=window.odT.finalAdSlotsConfig.adSlotsDefinitions;let n=o[e];return n||"function"!=typeof(null===(i=window.odT)||void 0===i?void 0:i.addNewAdSlot)||(window.odT.addNewAdSlot({foundEl:t,selector:e}),n=o[e]),n?(n.divId=t.id,n.name=e,n.adUnit="string"==typeof n.adUnit?n.adUnit:e,delete n.isFallBack,delete n.isVideoPlayer,delete n.adTemplate,o[e]=n,n):null}ensureFallbackRefreshReady(){var e;if(Array.isArray(window.odT.userAction)||(window.odT.userAction=[]),window.odT.userAction.includes("videoFallback")||window.odT.userAction.push("videoFallback"),"function"==typeof window.odT.loadCore&&window.odT.loadCore(),window.odT.loadCoreFinished||"function"!=typeof window.odT.loadCore)return Promise.resolve();const t=Number.isFinite(null===(e=window.odT.setup)||void 0===e?void 0:e.loadCoreTimeout)?window.odT.setup.loadCoreTimeout:1e3;return new Promise(e=>{let i=0;const o=window.setInterval(()=>{i+=50,(window.odT.loadCoreFinished||i>=t)&&(window.clearInterval(o),e())},50)})}buildSkippedFallbackResult(e){var t,i;const o=null===(t=null===window||void 0===window?void 0:window.odT)||void 0===t?void 0:t.screen;return!0===(null===(i=null==e?void 0:e.playerConfig)||void 0===i?void 0:i.forceSource)?{status:"skipped",reason:"force_source",screen:o}:e?o?{status:"skipped",reason:"no_fallback_configured",fallbackSlot:this.getVideoFallbackAdslotName(e),screen:o}:{status:"skipped",reason:"missing_screen"}:{status:"skipped",reason:"no_video_config",screen:o}}triggerVideoFallback(e,t,i){return v(this,void 0,void 0,function*(){var o,n;const d=null===(o=null===window||void 0===window?void 0:window.odT)||void 0===o?void 0:o.screen,s=this.getVideoFallbackAdslotName(e),a=i||this.resolveVideoDivId(t,void 0),r=a?document.getElementById(a):null;if(!(s&&r instanceof HTMLElement)){const e=s?"video_placement_not_found":d?"no_fallback_configured":"missing_screen";return window.odT.log(`InStream Module - Cannot trigger fallback for ${t}: missing fallback config or video placement`),{status:"failed",reason:e,fallbackSlot:s,screen:d}}window.odT.log(`InStream Module - Empty GAM response for slot ${t}, reusing video wrapper for fallback adslot ${s}`);const l=this.repurposeVideoElementForFallback(r,t,s);this.clearFallbackFlag(s);const c=this.resolveFallbackAdslotDefinition(s,l),u="string"==typeof(null==c?void 0:c.name)?c.name:s;return c?(window.odT.adslotInit([c]),window.odT.log("InStream Module - triggerVideoFallback called adslotInit"),"function"!=typeof(null===(n=window.odT)||void 0===n?void 0:n.refreshAdSlots)?(window.odT.log("InStream Module - refreshAdSlots unavailable for video fallback"),{status:"failed",reason:"refresh_unavailable",fallbackSlot:u,screen:d}):(yield this.ensureFallbackRefreshReady(),window.odT.refreshAdSlots([u],"manual"),{status:"triggered",reason:"refreshed",fallbackSlot:u,screen:d})):(window.odT.log(`InStream Module - Fallback adslot definition not found for ${s}`),{status:"failed",reason:"fallback_definition_not_found",fallbackSlot:s,screen:d})})}initVideoAuction(e){return v(this,void 0,void 0,function*(){window.odT.log("InStream Module - Called initVideoAuction with slots",e),"string"==typeof e&&(e=[e]),yield new Promise(t=>{this.getVideoInstreamAds(e,i=>v(this,void 0,void 0,function*(){var o,n,d,s,a,r,l;try{for(const t of e){if(this.initializedVideoSlots.has(t)){window.odT.log(`InStream Module - Slot ${t} already initialized, skipping duplicate init`);continue}const e=this.getVastUrlFromResults(i,t),c=this.findConfigForAdslot(t);if(!e){window.odT.log(`InStream Module - No vastURL for slot ${t}, skipping player creation`);continue}window.odT.log("InStream Module - vastURL obtained",e);const u=!0===this.setup.useImaSdkFetch,p=this.setup.localDevMockVastXml;if(u){window.odT.log("InStream Module - Using IMA SDK fetch mode (allows SDK to add sdk_apis, omid_p, etc.)"),yield this.loadVideoModule();const i=(null==c?void 0:c.playerConfig)||{},o=Object.assign(Object.assign({},i.adsConfig),{adTagUrl:e});delete o.adsResponse;const n=this.resolveVideoDivId(t,i.divId),d=Object.assign(Object.assign(Object.assign({},i),n?{divId:n}:{}),{adsConfig:o,onEvent:(e,t)=>{window.odT.log("InStream Module - Video player event:",e,t)}});window.odT.log("InStream Module - Creating player with adTagUrl (IMA SDK will fetch and add parameters)",d),window.createOdPlayer(d),this.initializedVideoSlots.add(t),window.odT.log("InStream Module - Called createOdPlayer for slot",t);continue}const g=p||(yield this.fetchGamVastXml(e)),w=window.odT.analytics.addBidderMetrics(t);let h=null;const f=[];["c2s","s2s","dc"].forEach(e=>{Array.isArray(w[e])&&f.push(...w[e])});for(const e of f)e.bid>0&&-1!==e.time&&(!h||e.bid>h.bid)&&(h={name:e.name,bid:e.bid});let m=null;window.odT.oyStatus&&(null===(o=window.optiyield)||void 0===o||o.cmd.push(()=>{m=window.optiyield.getFloors({adUnitPath:window.odT.initConfig.adUnit,customDimensions:{cd1:t}},"Video-instream")}));const v=this.resolveVideoDivId(t,null===(n=null==c?void 0:c.playerConfig)||void 0===n?void 0:n.divId),y=Object.assign({divId:t,divIdFull:v,demandType:"unfilled",amazonStatus:this.amazonParams&&this.amazonParams[t]&&this.amazonParams[t].includes("amznbid")?1:0,oyStatus:void 0!==window.odT.oyStatus?1:0,oyTestGroup:void 0!==(null==m?void 0:m.group)?m.group:0,oyPb:void 0!==(null===(d=null==m?void 0:m.pf)||void 0===d?void 0:d.gam)?m.pf.gam:void 0,loadType:10,nogam:!1,bidders:Object.keys(w).length?w:null},h&&{prebidWinner:h.name,prebidBid:parseFloat(h.bid.toFixed(3))});if(Array.isArray(null===(s=null==c?void 0:c.videoAdunitConfig)||void 0===s?void 0:s.playerSize)&&!Array.isArray(c.videoAdunitConfig.playerSize[0])&&(y.size=(null===(a=null==c?void 0:c.videoAdunitConfig)||void 0===a?void 0:a.playerSize).join("x")),!this.isNonEmptyGamVastResponse(g)){let e;if(window.odT.log(`InStream Module - Empty GAM response for slot ${t}, skipping player creation`),!0===(null===(r=null==c?void 0:c.playerConfig)||void 0===r?void 0:r.forceSource)){yield this.loadVideoModule();const i=this.resolveVideoDivId(t,c.playerConfig.divId);window.createOdPlayer(Object.assign(Object.assign({},c.playerConfig),i?{divId:i}:{})),this.initializedVideoSlots.add(t),e=this.buildSkippedFallbackResult(c)}else e=c&&this.hasVideoFallback(c)?yield this.triggerVideoFallback(c,t,this.resolveVideoDivId(t,null===(l=c.playerConfig)||void 0===l?void 0:l.divId)):this.buildSkippedFallbackResult(c);y.filled=0,y.fallback=e,window.odT.log("InStream Module - Video fallback result",e),window.odT.analytics.adRequestEvent(y);continue}{const e=this.identifyDemandSource(g);window.odT.log(`InStream Module - Demand source identified for slot ${t}:`,e.source),y.demandType=e.source,e.lineItemId&&(y.lineItemId=e.lineItemId),y.filled=1,window.odT.analytics.adRequestEvent(y),window.odT.log("InStream Module - Non-empty GAM response",g)}yield this.loadVideoModule(),window.odT.log("InStream Module - videoAdslotConfig",c);const b=(null==c?void 0:c.playerConfig)||{},T=Object.assign(Object.assign({},b.adsConfig),{adsResponse:g});delete T.adTagUrl;const S=this.resolveVideoDivId(t,b.divId),C=Object.assign(Object.assign(Object.assign({},b),S?{divId:S}:{}),{adsConfig:T,onEvent:(e,t)=>{window.odT.log("InStream Module - Video player event:",e,t)}});window.odT.log("InStream Module - Creating player with playerConfig",C),window.odT.log("InStream Module - Creating player with adsResponse",p?"(local dev mock VAST)":"(GAM VAST preflight)"),window.createOdPlayer(C),this.initializedVideoSlots.add(t),window.odT.log("InStream Module - Called createOdPlayer for slot",t)}this.hasLoadedVideoModule||window.odT.log("InStream Module - No vastURL found in results, skipping video load")}finally{t()}}))})})}};var b=i(862),T=i(456);window.launcherLoadTime=Math.round(performance.now());class S{adserver="GAM";adSlotsLoadStatus=[];adSlotsUnfilledCount=[];apsSizes=[[1e3,250],[1e3,90],[970,250],[970,90],[800,250],[700,250],[728,90],[468,60],[300,600],[120,600],[160,600],[336,280],[320,180],[300,250],[300,100],[300,50],[250,250],[320,100],[320,50],[200,200]];bidsFromOe=[];bidsFromOeBackfill=[];consentOK=["CMPv2_GAMokHBok","CMPv2_GAMokHBko","CMPv2_OOS"];consentStatusNoGAM=["CMPv2_RejectALL","CMPv2_GAMmv","CMPv2_GAMko","CMPv2_LAokHBok","CMPv2_LAokHBko","CMPv2_LAko","CMPv2_LAMmv"];consentStatusNoGAMButLA=["CMPv2_RejectALL","CMPv2_GAMmv","CMPv2_GAMko","CMPv2_LAko","CMPv2_LAMmv"];consentType="ko";currentArticleIndex=0;customDNR=!0;customPageTargeting={};debug=!1;debugBidderDiscount=1;defaultPriceGranularity={buckets:[{max:3,min:0,increment:.01,precision:2},{max:8,min:3,increment:.05,precision:2},{max:20,min:8,increment:.5,precision:2}]};enableArticleReporting=!0;enableGpid=!0;enableSourceReporting=!0;enableLimitedAds=!0;enableCookieConsent=!1;engageBackfill=!0;eventCallback=[];finalAdSlotsConfig={};firstLoadAdSlots=[];googleInit=!1;gptAdSlots=[];gptTrafficRand=0;houseReads=!1;iasId=!1;iasReady=!1;infiniteScrollId=1;infiniteScrollWallpaperSlot=!1;initConfig={};insertInreadStartDone=!1;isFirstCLSTrigerred=!0;lazyLoadPendingAdSlots=[];lazyLoadPendingAdSlotsWithRewarded=[];limitedAds=!1;logPrefix="%cOptiDigital_Debug:%c ";analyticsLogPrefix="%cOptiDigital_Debug_Analytics:%c ";mobileEvenVerticalSizes=!1;noGamUseSafeframe=!0;notVisibleAdslots=[];observedPerformances=["navigation","paint","first-input","largest-contentful-paint","layout-shift","longtask","event"];oyStatus=!0;pageViewCalls=0;pfConfig={};prebidSizes=[[1e3,250],[1e3,90],[970,250],[970,90],[800,250],[700,250],[728,90],[468,60],[300,600],[120,600],[160,600],[336,280],[320,200],[320,180],[320,150],[300,250],[300,100],[300,50],[250,250],[320,100],[320,50],[200,200]];prebidSizesAdjusted=!1;rewardedAdContentSelector="article";rewardedAdCookie="opd_rewardedAd";rewardedAdTimeout=3e3;screen=window.top?window.top.document.documentElement.clientWidth<768?"Mobile":"Desktop":document.documentElement.clientWidth<768?"Mobile":"Desktop";secondChancePending=[];setup={};siteCode="na";sizesFor={default:[["fluid"],[336,280],[250,250],[300,250],[200,200]],billboard:[[1e3,250],[1e3,90],[970,250],[800,250],[970,90],[728,90],[700,250],[300,250],[468,60]],halfpagead:[["fluid"],[300,600],[300,250],[160,600],[120,600],[250,250],[200,200]],content:[["fluid"],[336,280],[300,250],[250,250],[728,90],[700,250],[468,60]],interstitial:[[320,480],[336,280],[300,250],[250,250]],mobilepos:[["fluid"],[300,250],[320,160],[320,100],[320,80],[320,50],[250,250],[336,280],[300,50]],desktopsticky:[[1e3,90],[970,90],[728,90]],mobilesticky:[[320,50],[320,80],[320,100],[300,100],[300,50]],verticalsticky:[["fluid"],[300,600],[300,350],[300,250],[336,280],[160,600],[120,600],[250,250],[200,200]],flyingcarpet:[[300,600],[160,600],[120,600]],outofpage:[[1,1]],wallpaper:[[1,1]]};sizesForMobilePos=[[300,600],[160,600],[120,600]];sourceDomains=["www.google.fr","www.google.com","news.google.com","www.facebook.com","facebook.com","m.facebook.com","l.facebook.com","lm.facebook.com","from.flipboard.com","pinterest.com","pinterest.fr","www.linkedin.com","linkedin.com","t.co","instagram.com","googleapis.com","www.googleapis.com"];sourceID=!1;stickyAutoCloseScroll=!0;stickyAdAutoHidePx=100;stickyAdDivId=!1;stickyAdMode="bottom";stickyAdStatus="off";stickyAdTopTrigger=0;stickyCookie="opd_sticky";stickyFormatClosed=!0;stickyFormatLoaded=[];tagMode=!1;tagSizes=[["fluid"],[336,280],[250,250],[300,250],[200,200],[1e3,250],[1e3,90],[970,250],[800,250],[970,90],[728,90],[700,250],[468,60],[300,600],[160,600],[120,600],[320,480],[320,100],[320,80],[320,50],[300,50],[320,160],[300,100]];testGroup="control";userAction=[];windowStatus=1;constructor(e={}){window.odT=this,this.optidigitalSetup=window.optidigitalSetup,this.tools=s,this.cyrb53=s.cyrb53.bind(s),this.log=s.log.bind(s),this.checkSafeFrameDelivery=s.checkSafeFrameDelivery.bind(s),this.loadLibs(),window.optidigitalToolbox=this,this.infiniteScrollRefresh=this.spaManualLoad,this.loadConfig(this.optidigitalSetup||{}),this.analytics=new m(this.setup,this.forceAnalytics),this.iasModule=e?.iasModule,this.divIdPrefix=void 0!==this.setup.divIdPrefix?this.setup.divIdPrefix:"optidigital-adslot-",this.adLayoutAdapter=new h,this.adAdaptersFactory=new u(this.screen,this.setup,this.divIdPrefix,this.rewardedAdCookie,this.rewardedAdFrequency,this.rewardedAdFrequencyImps,this.rewardedAdFrequencyInterval),this.stickyAdapter=this.adAdaptersFactory.getStickyAdapter(),this.houseReadsAdapter=this.adAdaptersFactory.getHouseReadsAdapter(),this.setup.hasOwnProperty("launcherInit")&&"function"==typeof this.setup.launcherInit&&(this.setup.launcherInit(this.initConfig),this.log("launcherInit executed")),window.optiyield=window.optiyield||{cmd:[]},window.optiyield.initOptiYieldSdk=!1,window.googletag=window.googletag||{cmd:[]},window.googletag.cmd=window.googletag.cmd||[],window.googletag.cmd.push(function(){!1!==window.odT?.setup?.disableInitialLoad&&window.googletag.setConfig({disableInitialLoad:!0})}),window.odpbjs=window.odpbjs||{que:[]},window.optidigitalQueue=window.optidigitalQueue||{},window.optidigitalQueue.cmd=window.optidigitalQueue.cmd||[],window.optidigitalCoreQueue=window.optidigitalCoreQueue||{},window.optidigitalCoreQueue.cmd=window.optidigitalCoreQueue.cmd||[],this.setup&&this.setup.pbAlias&&(window[this.setup.pbAlias]=window.odpbjs),window.odpbjs.renderAd=function(e,t){window.odT.bidsFromOe&&window.odT.bidsFromOe.length&&window.odT.bidsFromOe.forEach(i=>{if(i.bidId===t)try{const o=e?.defaultView?.frameElement;o&&(o.width=i.width,o.height=i.height),e.write(i.ad);const n=window.odT.bidsFromOe.findIndex(e=>e.bidId===t);-1!==n&&window.odT.bidsFromOe.splice(n,1)}catch(e){}})};try{const e=window.odT?.setup?.videoInstreamSetup,t=e&&"object"==typeof e&&!Array.isArray(e)&&Array.isArray(e.videoAdSlotConfigurations)&&e.videoAdSlotConfigurations.length>0;this.instreamModule=t?new y(e):null,window.optidigitalToolbox.getVideoInstreamAds=this.instreamModule.getVideoInstreamAds.bind(this.instreamModule),window.optidigitalToolbox.initVideoAuction=this.instreamModule.initVideoAuction.bind(this.instreamModule)}catch(e){}this.openConnection(),this.bootstrapConsent(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{if(document.body)window.odT.startODT();else{let e=setInterval(()=>{document.body&&(window.odT.startODT(),clearInterval(e))},10)}}):window.odT.startODT()}getVideoInstreamAds(e,t,i){if(void 0===this.instreamModule){const e=this.setup?.videoInstreamSetup,t=e&&"object"==typeof e&&!Array.isArray(e)&&Array.isArray(e.videoAdSlotConfigurations)&&e.videoAdSlotConfigurations.length>0;this.instreamModule=t?new y(e):null}this.instreamModule&&this.instreamModule.getVideoInstreamAds(e,t,i)}initVideoAuction(e,t,i){if(void 0===this.instreamModule){const e=this.setup?.videoInstreamSetup,t=e&&"object"==typeof e&&!Array.isArray(e)&&Array.isArray(e.videoAdSlotConfigurations)&&e.videoAdSlotConfigurations.length>0;this.instreamModule=t?new y(e):null}this.instreamModule&&this.instreamModule.initVideoAuction(e,t,i)}setupVideoPlayerSlots(){const e=this.setup?.adSlotsConfig?.adSlotsDefinitions;if(!Array.isArray(e))return;const t=e.filter(e=>e&&"video"===e.adTemplate);t.length&&(this.finalAdSlotsConfig=this.finalAdSlotsConfig||{},this.finalAdSlotsConfig.adSlotsDefinitions=this.finalAdSlotsConfig.adSlotsDefinitions||{},t.forEach(e=>{const t=e.name;if(!t)return;const i="string"==typeof e.deviceTarget?e.deviceTarget.toLowerCase():"";if("Desktop"===window.odT.screen&&i.includes("mobile"))return;if("Mobile"===window.odT.screen&&i.includes("desktop"))return;const o=this.setup?.videoInstreamSetup;if(!(o&&Array.isArray(o.videoAdSlotConfigurations)&&o.videoAdSlotConfigurations.some(e=>Array.isArray(e.videoAdslots)&&e.videoAdslots.some(e=>e.adslot===t))))return void this.log(`Video Module - No videoInstreamSetup videoAdslot found for ${t}, skipping auto-init`);const n=`${this.divIdPrefix}${t}`,d=Array.isArray(e.divTarget)?e.divTarget:e.divTarget?[e.divTarget]:[];let s=document.getElementById(n)||document.querySelector(`[data-adslot-id="${n}"]`);if(!s&&d.length){let e=null;for(const t of d)if("string"==typeof t&&t.length&&(e=t.startsWith("#")?document.getElementById(t.slice(1)):t.startsWith(".")?document.querySelector(t):document.getElementById(t),e))break;if(!e)return void this.log(`Video Module - divTarget container not found for ${t}`);"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s=document.getElementById(n),s||(s=document.createElement("div"),s.id=n,s.className=t,e.appendChild(s))}s?(s.id||(s.id=n),s.className||(s.className=t),s.setAttribute("data-template","video"),s.style.width="100%",s.style.height="100%",this.finalAdSlotsConfig.adSlotsDefinitions[t]={...this.finalAdSlotsConfig.adSlotsDefinitions[t]||{},name:t,adUnit:t,divId:n,adTemplate:"video",isVideoPlayer:!0},window.optidigitalQueue=window.optidigitalQueue||{},window.optidigitalQueue.cmd=window.optidigitalQueue.cmd||[],window.optidigitalQueue.cmd.push(()=>{if(window.optidigitalToolbox&&"function"==typeof window.optidigitalToolbox.initVideoAuction){if((()=>{const t=e.lazyLoadPx||900;if(s){const e=s.getBoundingClientRect();return e.top>=0&&e.top-window.innerHeight<=t||e.top<0&&Math.abs(e.top)<=t}return!1})()&&window.odT&&"function"==typeof window.odT.loadCore){window.odT.log("Video Module - Triggering core on page load"),window.odT.userAction.push("triggerInstream"),window.odT.loadCore();if(!window.odT.instreamModule.getPrebidInstance()){let e=0;const i=window.odT.setup.loadCoreTimeout||1e3,o=setInterval(()=>{window.odT.instreamModule.getPrebidInstance()?(clearInterval(o),window.optidigitalToolbox.initVideoAuction([t])):e>i&&(clearInterval(o),window.odT.log(`Video Module - Core loading timeout for ${t}, starting auction without prebid`),window.optidigitalToolbox.initVideoAuction([t])),e+=50},50);return}}window.optidigitalToolbox.initVideoAuction([t])}})):this.log(`Video Module - placement not found for ${t}`)}))}startODT(){window?.odT?.setup?.[`lightPackageAndAmazon${window.odT.screen}`]&&window.odT.loadAPS(),window.odT.analytics.registerPerformanceObserver(),window.odT.setup.disableInfiniteScrollFirstLoad||window.odT.setup.spaManualMode||window.odT.setDefaultSizes(),window.odT.processCommandQueue()}loadLibs(){var e;function t(e,o){var n=i();return(t=function(e,t){return n[e-=456]})(e,o)}function i(){var e=["candidatesData","450TlPpUN","wrapperClass","parentElement","secureCandidateAdder","optidigital","previousTypeExtra","version","parentNode","nextElementSibling","verifyKeepDistanceFromTheBottom failed","_extendDefaults","Crawling DOM searching for possible candidates","forbiddenElements","insertOne","parentDiv","intervalIncrement","dontBreakWithPreviousType","insertInRead","keepTheDistancePx","1735LdfHMK","Step out ","Crawling DOM for candidates finished","_setupForbidden","pop","getBoundingClientRect","getElementsByClassName","topWithDistance","insertAtTheEnd","createElement","from","none","getElementById","infiniteScroll","verifyKeepTheDistanceFrom failed","debug","random","wrapperTag","length","block","verbose","debugLevel","keepDistanceFromBottom","557058HByNRb","invisible","useXPath","tagName","2.2.11","stepOut","getComputedStyle","readDOM","stepIn","appendChild","floor","parentDiv selector missing !","height","getInsertedAds","omitInvisible","color","14154UpmHDx","FIRST_ORDERED_NODE_TYPE","insertBefore","innerHTML","minHeight","error","createAdSlotElement","insertedAds","isOptiDiv","verifyInterval failed","style","exports","25150xPRwoq","insertAdslotIntoTarget","background","adsTag","top","previousType","getContainer","replace","81Hlizbw","includes","interval","recurrenceLevel","8UIFSTG","1396692myCUWX","keepDistanceFromTheBottom","bottom","presentLevel","children","every","setAttribute","classList","keepDistancePx","keepDistanceFromTheTop","display","info","data-adslot-id","forbidden","9912kaukii","insertAdslotBeforeTarget","nextSibling","verifyKeepDistanceFromTheTop failed","396583dGAPEZ"," <= ","className","_insertAll","Insertion start","_overrideTheOptions","getAttribute","parentContainer","2548553ipUeCg","keepDistanceFrom","push","domToolkit","candidateElements","optidigital-adslot-","isOptiClass","nextElement","infiniteAdslot","candidate:","adsCount","adSlots","positionFirst","reverse","isVisible","keepTheDistanceFrom","divIdPrefix","previousTypeClass","log","OptiDigital Smart Inserter","forEach","evaluate","__setupSingleForbidden","toLocaleLowerCase","logger","keepDistanceFromTop","singleNodeValue"];return(i=function(){return e})()}(()=>{var e={814:(e,t,i)=>{var o,n,d;function s(e,t){var i=a();return s=function(t,o){var n=i[t-=393];if(void 0===s.KIyUjI){var d=function(e){for(var t,i,o="",n="",s=o+d,a=0,r=0;i=e.charAt(r++);~i&&(t=a%4?64*t+i:i,a++%4)?o+=s.charCodeAt(r+10)-10!=0?String.fromCharCode(255&t>>(-2*a&6)):a:0)i="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(i);for(var l=0,c=o.length;l<c;l++)n+="%"+("00"+o.charCodeAt(l).toString(16)).slice(-2);return decodeURIComponent(n)};s.rYuNnP=d,e=arguments,s.KIyUjI=!0}var a=t+i[0],r=e[a];if(r)n=r;else{var l=function(e){this.ylGxOJ=e,this.QFRlrM=[1,0,0],this.MYLxhs=function(){return"newState"},this.lRKEDe="\\w+ *\\(\\) *{\\w+ *",this.bxjPTs="['|\"].+['|\"];? *}"};l.prototype.iLVXgA=function(){var e=new RegExp(this.lRKEDe+this.bxjPTs).test(this.MYLxhs.toString())?--this.QFRlrM[1]:--this.QFRlrM[0];return this.zcekba(e)},l.prototype.zcekba=function(e){return Boolean(~e)?this.IVHzJZ(this.ylGxOJ):e},l.prototype.IVHzJZ=function(e){for(var t=0,i=this.QFRlrM.length;t<i;t++)this.QFRlrM.push(Math.round(Math.random())),i=this.QFRlrM.length;return e(this.QFRlrM[0])},new l(s).iLVXgA(),n=s.rYuNnP(n),e[a]=n}return n},s(e,t)}function a(){var e=["Dw5KzwzPBMvK","Dg9tDhjPBMC","mtGZmda4mffcC3zhuq","zgvMAw5LuhjVCa","kcGOlISPkYKRkq","yxbWBhK","y2vPBa","y29UC3rYDwn0BW","zNjVBunOyxjdBW","Dg9tDhjPBMDuyq","zxHWB3j0CW","Eg9YrgvJCNLWDa","ohL6y0PmtW","BgvUz3rO","nZy5Du9nsxzq","mtu3nhbpDunIuG","B2jQzwn0","zNvUy3rPB24","mtC1ote2mxDyr3DQqW","nJyZndbWrhruAxy","DMfSDwu","AgfZt3DUuhjVCa","mJqYmZK0AMTXDhLd","zxj0Eq","zNjVBunVzgvqBW","x19LC01VzhvSzq","C2vHCMnO","yw1K","vvrgoefYCLrVuW","ChjVDg90ExbL","y2HHCKnVzgvbDa","tw9KDwXL","tw9KDwXLCW","mtmWwwflqKTV","Aw50","B0fYCG","mZiYmtC5m0PdBM92qq","y2fSBa","mta1ota4nLPywfPwEq"];return(a=function(){return e})()}e=i.nmd(e),function(e){for(var t=s,i=e();;)try{if(393714==parseInt(t(419))/1*(parseInt(t(420))/2)+parseInt(t(423))/3+parseInt(t(424))/4*(-parseInt(t(399))/5)+-parseInt(t(427))/6+-parseInt(t(404))/7+parseInt(t(417))/8*(-parseInt(t(402))/9)+parseInt(t(407))/10)break;i.push(i.shift())}catch(e){i.push(i.shift())}}(a),function(a,r){var l,c=s,u=(l=!0,function(e,t){var i=l?function(){if(t){var i=t[s(410)](e,arguments);return t=null,i}}:function(){};return l=!1,i}),p=u(this,function(){var e=s;return p[e(406)]()[e(431)](e(409)+"+$")[e(406)]()[e(412)+"r"](p)[e(431)](e(409)+"+$")});p(),c(421)==typeof t&&"object"==c(421)?e[c(415)]=r():"function"==c(422)&&i.amdD[c(393)]?(n=[],void 0===(d="function"==typeof(o=r)?o.apply(t,n):o)||(e.exports=d)):c(421)==typeof t?t[c(398)]=r():a[c(398)]=r()}(self,()=>(()=>{var e=s,t={d:(e,i)=>{var o=s;for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object[o(408)+o(428)](e,n,{enumerable:!0,get:i[n]})},o:(t,i)=>Object[e(395)][e(426)+e(428)][e(403)](t,i),r:t=>{var i=e,o={};o[i(425)]=i(397);var n={};n[i(425)]=!0,i(405)!=typeof Symbol&&Symbol.toStringTag&&Object[i(408)+i(428)](t,Symbol[i(414)+"g"],o),Object[i(408)+"erty"](t,i(430),n)}},i={};function o(t,i){var o=e;const n=t.replace(/[^A-Za-z0-9+/]/g,""),d=n.length,s=i?Math[o(411)]((3*d+1>>2)/i)*i:3*d+1>>2,a=new Uint8Array(s);let r,l,c=0,u=0;for(let e=0;e<d;e++)if(l=3&e,c|=((p=n.charCodeAt(e))>64&&p<91?p-65:p>96&&p<123?p-71:p>47&&p<58?p+4:43===p?62:47===p?63:0)<<6*(3-l),3===l||d-e==1){for(r=0;r<3&&u<s;)a[u]=c>>>(16>>>r&24)&255,r++,u++;c=0}var p;return a}function n(t){var i=e;let o,n="";const d=t[i(418)];for(let e=0;e<d;e++)o=t[e],n+=String[i(429)+i(400)](o>251&&o<254&&e+5<d?1073741824*(o-252)+(t[++e]-128<<24)+(t[++e]-128<<18)+(t[++e]-128<<12)+(t[++e]-128<<6)+t[++e]-128:o>247&&o<252&&e+4<d?(o-248<<24)+(t[++e]-128<<18)+(t[++e]-128<<12)+(t[++e]-128<<6)+t[++e]-128:o>239&&o<248&&e+3<d?(o-240<<18)+(t[++e]-128<<12)+(t[++e]-128<<6)+t[++e]-128:o>223&&o<240&&e+2<d?(o-224<<12)+(t[++e]-128<<6)+t[++e]-128:o>191&&o<224&&e+1<d?(o-192<<6)+t[++e]-128:o);return n}function d(t,i){for(var o=e,n="",d=0;d<t[o(418)];d++){var s=t.charCodeAt(d),a=i[o(396)](d%i.length);n+=String[o(413)+"de"](s^a)}return n}var a={};return a[e(394)+"tr"]=()=>n,a["base64DecT"+e(401)]=()=>o,a[e(416)]=()=>d,t.r(i),t.d(i,a),i})())}},t={};function i(o){var n=t[o];if(void 0!==n)return n.exports;var d=t[o]={id:o,loaded:!1,exports:{}};return e[o](d,d.exports,i),d.loaded=!0,d.exports}i.amdD=function(){throw new Error("define cannot be used indirect")},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e=i(814),t=function(){var t={config:{},dNR:1,dDevice:"30001",rand:0,randInterstitial:0,samplingInterstitial:25,unitTemplate:"%AU%|%C1%|%NR%|%D%|%C%",seed:100,acceptedConsents:["nocmp","nocmp_api","CMPv2_OOS","CMPv2_GAMokHBok","CMPv2_GAMokHBko"],params:Object.fromEntries(new URLSearchParams(window.location.search).entries()),debug:!1,pubId:0,initConfig:{},i4n3i2tConfig:{},clientDebug:!1,forceDebugPf:!1,pfDebug:void 0,pbjsCustomFloorsConfig:!1,pbjs:void 0,sourceID:void 0,sourceRatio:void 0,pfUnits:{},pbjsEvents:{addAdUnitsEvent:void 0,beforeBidRequestEvent:void 0},conf:{ma:!1},ABModeSplit:!1,randAB:0,ABgroupB:!1,aed:[{max:.01,min:0},{max:.25,min:.01},{max:.5,min:.25},{max:.75,min:.5},{max:1,min:.75},{max:1.25,min:1},{max:1.5,min:1.25},{max:1.75,min:1.5},{max:2,min:1.75},{max:3,min:2},{min:3}],logS:"background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;",logC:"color:#1E90FF",logP:"%cOYSDK:%c ",oy_mode_enum:Object.freeze({INACTIVE:"0",YIELD:"1",LASTLOOK:"2",HYBRID:"3"})};function i(e,t){return e.hasOwnProperty(t)}function o(e){if(void 0===e||void 0===e.adUnitPath)return{haveParent:!1,floorConfig:e};const t=e.adUnitPath.match(/(?<dirname>.*)\//);return null!=t&&i(t,"groups")&&void 0!==t.groups&&t.groups.dirname?(e.adUnitPath=t.groups.dirname,{haveParent:!0,floorConfig:e}):{haveParent:!1,floorConfig:e}}function n(e,o=""){let n="";try{n=a(e)}catch(e){}let s=window.odT.cyrb53(n,t.seed);t.debug&&console.log(t.logP+o+" pfUnit "+s+" was encrypted "+n,t.logS,t.logC);let r=function(e,o,n=""){if(!(i(t.config,"cur")&&i(t.config.cur,"code")&&t.config.cur.code.gam&&t.config.cur.code.amazon&&t.config.cur.code.prebid&&i(t.config.cur,"ratio")&&t.config.cur.ratio.gam&&t.config.cur.ratio.amazon&&t.config.cur.ratio.prebid))return;let s={imps:0,unfilled:0,firstUnfilled:0,pf:{def:!1,defgam:"0.00",defprebid:"0.00",defamazon:"0.00"}};if(!i(t.config,e)){t.conf?.spf?(s.is_small=!0,s.tf=87):(s.tf=0,s.ae=0),s.oy_mode=t.oy_mode_enum.LASTLOOK,t.pfUnits[e]=s,t.debug&&console.log("%cOYSDK:%c pfUnit: "+e+" configured as SMALL pfUnit","background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF");const i=d(window.location.hostname,window.odT.checkBrowser,o.adUnitPath,o.customDimensions?.cd1);return null!=i&&(s.pf.def=!0,s.pf.defgam=window.odT.getCpmStringValue(i,t.config.pbd),s.pf.defprebid=(s.pf.defgam*t.config.cur.ratio.prebid).toFixed(2),s.pf.defamazon=(s.pf.defgam*t.config.cur.ratio.amazon).toFixed(2)),t.pfUnits[e]}if(void 0!==t.pfUnits[e])return t.pfUnits[e];var a;s.pf.gam="0.00",s.pf.prebid="0.01",s.pf.amazon="0.01",s.tf=t.config[e]?.tf||0,s.ae=t.config[e]?.ae||0,s.oy_mode=(a=t.config[e])&&0===Object.keys(a).length?t.oy_mode_enum.INACTIVE:!("ll"in a)&&a?.pf?t.oy_mode_enum.HYBRID:"ll"in a&&!a.ll?t.oy_mode_enum.YIELD:"pf"in a?(t.debug&&console.warn("%cOYSDK:%c Issue with oy_mode extraction. Invalid configuration for pfUnit: "+a,"background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF"),t.oy_mode_enum.INACTIVE):t.oy_mode_enum.LASTLOOK,t.debug&&console.log("%cOYSDK:%c pfUnit: "+e+" oy_mode set to = "+s.oy_mode+" ("+Object.keys(t.oy_mode_enum).find(e=>t.oy_mode_enum[e]===s.oy_mode)+")","background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF"),s.status=t.config[e].status;let r=w(t.config[e]),l=t.sourceRatio?t.sourceRatio:1;var c=(t.config[e]?.pf||0)*t.config.cur.ratio.gam*r*l;s.pf.cr=1,s.pf.gam=window.odT.getCpmStringValue(c,t.config.pbd),s.pf.prebid=(s.pf.gam*t.config.cur.ratio.prebid).toFixed(2),s.pf.amazon=(s.pf.gam*t.config.cur.ratio.amazon).toFixed(2);const u=d(window.location.hostname,window.odT.checkBrowser,o.adUnitPath,o.customDimensions?.cd1);return null!=u&&(s.pf.def=!0,s.pf.defgam=window.odT.getCpmStringValue(u,t.config.pbd),s.pf.defprebid=(s.pf.defgam*t.config.cur.ratio.prebid).toFixed(2),s.pf.defamazon=(s.pf.defgam*t.config.cur.ratio.amazon).toFixed(2)),s.oy_mode==t.oy_mode_enum.LASTLOOK&&(s.pf.gam=s.pf.defgam,s.pf.prebid=s.pf.defprebid,s.pf.amazon=s.pf.defamazon),"0.00"==s.pf.amazon&&(s.pf.amazon="0.01"),"0.00"==s.pf.prebid&&(s.pf.prebid="0.01"),t.pfUnits[e]=s,t.debug&&console.log(t.logP+n+" pfUnit "+e+" pf_bucket:"+s.pf.gam+" pf_calculated: "+c+" pf_orig: "+t.config[e]?.pf+" ratio_gam: "+t.config.cur.ratio.gam+" tbr: "+r+" sbr: "+l,t.logS,t.logC),t.pfUnits[e]}(s,e,o);return{pfUnit:s,pfUnitObj:r}}function d(e,i,o,n){if(!t?.config?.defpf)return;const d="string"==typeof i?i.toLowerCase():"",s=t.config.defpf,a=[`${d}|${e}|${n}|${o}`,`${d}|${e}|${n}|*`,`${d}|${e}|*|${o}`,`${d}|${e}|*|*`,`${d}|*|${n}|${o}`,`${d}|*|${n}|*`,`${d}|*|*|${o}`,`${d}|*|*|*`,`*|${e}|${n}|${o}`,`*|${e}|${n}|*`,`*|${e}|*|${o}`,`*|${e}|*|*`,`*|*|${n}|${o}`,`*|*|${n}|*`,`*|*|*|${o}`,"*|*|*|*"];for(const e of a)if(void 0!==s[e])return s[e]}function s(e){if("string"!=typeof e)return e;let t=e;return t.startsWith("/")||(t="/"+t),t=t.replace(/,([^/]*\/)/,"/"),t}function a(e){var o=t.unitTemplate;if(!e)throw"Configuration is missing.";if(!i(e,"adUnitPath"))throw"AdUnitPath is missing. Check the configuration.";{let t=s(e.adUnitPath);o=o.replace("%AU%",t.toLowerCase())}return i(e,"customDimensions")&&Object.keys(e.customDimensions).length>0&&Object.entries(e.customDimensions).forEach(([e,t],i)=>{t&&(o=o.replace(`%C${e.substring(2)}%`,t.toLowerCase()))}),o}function r(e){var o="od_pf_ab";i(t.conf,"ab_key")&&(o=t.conf.ab_key);var n="1";return i(t.conf,"ab_values")?Array.isArray(t.conf.ab_values)&&0!=t.conf.ab_values.length&&(t.conf.ab_values.length>1?n=e?t.conf.ab_values[1]:t.conf.ab_values[0]:e&&(n=t.conf.ab_values[0])):n=e?"1":"0",{abKey:o,abValue:n}}function l(e,i,o){return i===t.oy_mode_enum.LASTLOOK?o?.cpm?`${e}_2`:`${e}_1`:t.oy_mode_enum.YIELD===i||t.oy_mode_enum.HYBRID===i?o?.cpm?`${e}_5`:`${e}_4`:`${e}_${i}`}function c(e){var o=!1;return(e.isEmpty||i(t.conf,"hcid")&&null!==e.advertiserId&&t.conf.hcid.includes(e.advertiserId))&&(o=!0),o}function u(){window.googletag.cmd.push(function(){window.googletag.pubads().addEventListener("slotRenderEnded",function(e){(function(e,o){let n=function(e,o){let n=p(e),d=!1,s="";try{s=a(n)}catch(e){return d}s=window.odT.cyrb53(s,t.seed);let r=t.pfUnits[s];if(void 0===r||!t.config[s])return d;if(c(o)){0==r.firstUnfilled&&(r.firstUnfilled=r.imps+1);var l=.5;i(t.conf,"rd")&&(l=t.conf.rd),r.pf.cr=r.pf.cr*l,d=!0,r.unfilled++}else{var u=1.15;i(t.conf,"ru")&&(u=t.conf.ru);var g=r.pf.cr*u;g<1&&(r.pf.cr=g,d=!0),r.imps++}if(d){var h=w(t.config[s]),f=(t.config[s]?.pf||0)*t.config.cur.ratio.gam*r.pf.cr*h;r.pf.gam=window.odT.getCpmStringValue(f,t.config.pbd),r.pf.prebid=(r.pf.gam*t.config.cur.ratio.prebid).toFixed(2),r.pf.amazon=(r.pf.gam*t.config.cur.ratio.amazon).toFixed(2),r.oy_mode==t.oy_mode_enum.LASTLOOK&&(r.pf.gam=r.pf.defgam,r.pf.prebid=r.pf.defprebid,r.pf.amazon=r.pf.defamazon),"0.00"==r.pf.amazon&&(r.pf.amazon="0.01"),"0.00"==r.pf.prebid&&(r.pf.prebid="0.01"),t.debug&&console.log(t.logP+"REFRESH pfUnit "+s+" pf_bucket:"+r.pf.gam+" pf_calculated: "+f+" pf_orig: "+t.config[s]?.pf+" ratio_gam: "+t.config.cur.ratio.gam+" tbr: "+h+" ratio_refresh:"+r.pf.cr,t.logS,t.logC)}return d}(e,o);if(n){if(window.odT.loadCoreFinished){let e=window.odT.getPbjs(t);void 0!==e&&e.que.push(function(){window.optiyield.setPrebidFloors(e.adUnits,window.odT.setP)})}g(e)}})(e.slot,e),function(e){if(e.slot.getOutOfPage()){if(t.randInterstitial>t.samplingInterstitial)return;let i=window.odT.cyrb53(a(p(e.slot)),t.seed);if(void 0===t.config[i])return;let o=e.slot.getConfig("targeting")?.targeting?.od_pf_group?.[0];void 0===o&&(o="0");let n=e.slot.getConfig("targeting")?.targeting?.od_pf_ta?.[0];void 0===n&&(n="oop_0_0");let d=0;c(e)&&(d=1);try{fetch(`https://optiyield-analytics.opti-digital.com/pfc/interstitial?pfunit=${i}&pubid=${t.pubId}&unfilled=${d}&od_pf_group=${o}&s=${t.samplingInterstitial}&od_pf_ta=${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}catch(e){}}}(e)})})}function p(e){let o={adUnitPath:s(e.getAdUnitPath()),customDimensions:{}};return i(t.initConfig,"gtpCustomDimensionKey")?Object.entries(t.initConfig.gtpCustomDimensionKey).forEach(([t,i],n)=>{o.customDimensions[t]=e.getConfig("targeting")?.targeting?.[i]?.[0]}):i(t.initConfig,"gptCustomDimensionKey")?Object.entries(t.initConfig.gptCustomDimensionKey).forEach(([t,i],n)=>{o.customDimensions[t]=e.getConfig("targeting")?.targeting?.[i]?.[0]}):i(t.conf,"gcdk")&&Object.entries(t.conf.gcdk).forEach(([t,i],n)=>{o.customDimensions[t]=e.getConfig("targeting")?.targeting?.[i]?.[0]}),o.interstitial=!1,e.getOutOfPage()&&(o.interstitial=!0),o}function g(e,o=!1){let n=window.optiyield.getFloors(p(e),"GPT",o);1==n.pfStatus?(n?.pf?.gam&&e.setConfig({targeting:{od_pf_pb:n.pf.gam}}),e.setConfig({targeting:{od_pf_group:(n?.group??0).toString()}}),i(n,"tf")&&(e.setConfig({targeting:{od_pf_ta:n.kv_ta}}),e.setConfig({targeting:{od_pf_mta:n.kv_mta}}),e.setConfig({targeting:{od_pfg:"1"}})),n?.kv_pff&&1==n?.group&&e.setConfig({targeting:{od_pf_filter:n.kv_pff}})):(e.setConfig({targeting:{od_pf_group:"0"}}),i(n,"tf")&&(e.setConfig({targeting:{od_pf_ta:n.kv_ta}}),e.setConfig({targeting:{od_pf_mta:n.kv_mta}}),e.setConfig({targeting:{od_pfg:"1"}}))),t.sourceID&&e.setConfig({targeting:{od_pf_sbr:t.sourceID.toString()}}),t.debug&&console.log(t.logP+` GPT ${1==n.pfStatus?`configure a price floor (${n.pf.gam})`:"doesn't find a price floor"} ADSlot ID: ${e.getSlotElementId()}`,t.logS,t.logC)}function w(e){return function(e,t,o){if(void 0===t)return 1;let n;if(i(t,o))n=t[o];else{if(!i(t,"0"))return 1;n=t[0]}let d=n.find(function(t){if(e<=t.h&&e>=t.l)return t});return d&&i(d,"r")?d.r:1}((new Date).getHours(),t.conf.tbc,e.tbc)}function h(e){return t.oy_mode_enum.YIELD===e?.oy_mode||t.oy_mode_enum.HYBRID===e?.oy_mode}return class{constructor(){}_d1spl4yS9ts(){try{console.log(t.pfUnits)}catch(e){console.error(e)}}_0i4n3i2t(o,n,d,s){try{if(window.optiyield._ready)return;if(window.optiyield._ready=!0,t.pubId=o,s&&"object"==typeof s&&(t.i4n3i2tConfig={...s}),"boolean"==typeof window?.top?.op5tiRyi1eld_dTeb9ugP&&window?.top?.op5tiRyi1eld_dTeb9ugP&&(t.debug=!0),(t.params&&"true"===t.params.optiyield_debug||"true"===sessionStorage.getItem("optiyield_debug"))&&(t.forceDebugPf=!0,t.clientDebug=!0),(t.params&&"false"===t.params.optiyield_debug||"false"===sessionStorage.getItem("optiyield_debug"))&&(t.forceDebugPf=!1,t.clientDebug=!0),t.params&&void 0!==t.params.optiyield_pf&&(t.pfDebug=t.params.optiyield_pf),t.debug&&console.log(t.logP+" version 4.0.31",t.logS,t.logC),n&&"object"==typeof n){if(n.ut){var a,r=(0,e.base64DecToArr)(n.ut),l=(0,e.UTF8ArrToStr)(r);a="number"==typeof o?o.toString():o,t.unitTemplate=(0,e.xorDecrypt)(l,a)}i(n,"conf")&&(t.conf=n.conf,i(t.conf,"si")&&(t.samplingInterstitial=t.conf.si))}var c=navigator.userAgent.toLowerCase();-1!=c.indexOf("safari")?-1==c.indexOf("chrome")&&(t.dNR=0):-1!=c.indexOf("firefox")&&(t.dNR=0),t.config={...n},t.unitTemplate=t.unitTemplate.replace("%NR%",t.dNR),t.rand=Math.floor(Math.random()*Math.floor(100)),t.randInterstitial=Math.floor(Math.random()*Math.floor(100)),t.randAB=Math.floor(Math.random()*Math.floor(100)),i(t.conf,"ab_r")&&i(t.conf,"ab_enable")&&t.conf.ab_enable&&(t.randAB<t.conf.ab_r&&(i(t.conf,"ab_m")&&"split"==t.conf.ab_m&&(t.ABModeSplit=!0),t.ABgroupB=!0),t.debug&&console.log(t.logP+" AB TEST enabled - mode %s - ratio %s% - group %s ",t.logS,t.logC,t.conf.ab_m,t.conf.ab_r,t.ABgroupB?"B":"A")),function(){if(1===t.dNR){let e=t.dNR.toString();window.googletag.cmd.push(function(){window.googletag.setConfig({targeting:{od_pf_nr:e}})})}}();try{!function(e){if(!e)throw"Country is missing.";t.unitTemplate=t.unitTemplate.replace("%C%",e)}(d)}catch(e){}(t.debug||t.clientDebug)&&console.log(t.logP+" is ready",t.logS,t.logC),i(t.conf,"sbr")&&function(o){if(void 0!==t.sourceID)return;if(!o)return;let n,d=(0,e.base64DecToArr)(o),s=(0,e.UTF8ArrToStr)(d),a="";a="number"==typeof t.pubId?t.pubId.toString():t.pubId;try{n=JSON.parse((0,e.xorDecrypt)(s,a))}catch(e){return void console.error(e)}if(void 0!==n){if(window.location&&window.location.href){let e=new URL(window.location.href).searchParams.toString();if(i(n,"sourceCampaignTrackers")){let o=n.sourceCampaignTrackers.find(t=>i(t,"s")&&e.includes(t.s));if(o)return t.sourceID=window.odT.cyrb53(o.s,100),void(t.sourceRatio=o.r)}}if(document.referrer&&i(n,"sourceDomains")){let e=new URL(document.referrer).hostname,o=n.sourceDomains.find(t=>i(t,"s")&&e.includes(t.s));if(o)return t.sourceID=window.odT.cyrb53(o.s,100),void(t.sourceRatio=o.r);let d=n.sourceDomains.find(e=>i(e,"s")&&"default".includes(e.s));d&&(t.sourceID=window.odT.cyrb53(d.s,100),t.sourceRatio=d.r)}}}(t.conf.sbr),function(){if("object"==typeof window.optiyield&&"object"==typeof window.optiyield.cmd)for(window.optiyield.cmd.push=function(e){if("function"==typeof e)try{e.call()}catch(e){console.error(e)}};window.optiyield.cmd.length>0;)try{window.optiyield.cmd.shift().call()}catch(e){console.error(e)}}(),t.ABModeSplit||u(),window.googletag.cmd.push(function(){window.googletag.setConfig({targeting:{od_pfs:"1"}})})}catch(e){}}init(e,o){try{if(window.optiyield._init_ready)return;if(window.optiyield._init_ready=!0,function(){try{t.dDevice=window.odT.dDevice,t.unitTemplate=t.unitTemplate.replace("%D%",t.dDevice);var e="1";i(t.i4n3i2tConfig,"deviceDetection")&&1==t.i4n3i2tConfig.deviceDetection&&("30000"==t.dDevice?e="0":"30001"==t.dDevice?e="1":"30002"==t.dDevice&&(e="2"),window.googletag.cmd.push(function(){window.googletag.setConfig({targeting:{od_pf_dd:e}})}))}catch(e){}}(),"object"==typeof e&&(t.initConfig={...e},t.ABModeSplit))return;"function"==typeof o&&(t.callback=o,t.callback())}catch(e){console.error(e)}}getFloors(e,d="RAW",s=!1){try{var a={};if(t.ABModeSplit)return a.pfStatus=0,a;let c=n(e,d);if(void 0===c.pfUnitObj&&i(t.conf,"faup")&&t.conf.faup){let t={haveParent:!1,floorConfig:e},i=5,s=0;do{if(t=o(t.floorConfig),c=n(t.floorConfig,d),void 0!==c.pfUnitObj)break;s+=1}while(t.haveParent&&s<i)}let u="";i(e,"interstitial")&&e.interstitial&&(u="oop_");let p=c.pfUnitObj,g=c.pfUnit;if(t.acceptedConsents.includes(window.odT.consentStatus))if(void 0!==p){let i=function(e,t){return t.find(function(t){if((void 0===t.max||e<=t.max)&&e>t.min)return t})}(p.ae,t.aed),o="";e.interstitial||(void 0!==i?o=i.hasOwnProperty("max")?`_${i.max.toFixed(2)}`:"_max":p?.is_small&&(o="_spf"));let n="0";if(s?.cpm&&(p.oy_mode==t.oy_mode_enum.HYBRID&&(n=s.cpm>parseFloat(p.pf.gam)?window.odT.getCpmStringValue(s.cpm,t.config.pbd):p.pf.gam,t.debug&&console.log("%cOYSDK:%c HYBRID cpm = "+n+" for "+g,"background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF")),p.oy_mode==t.oy_mode_enum.LASTLOOK&&(n=window.odT.getCpmStringValue(s.cpm,t.config.pbd),t.debug&&console.log("%cOYSDK:%c LASTLOOK cpm = "+n+" for "+g,"background: #286090;border-radius:5px;color:#79ba23;font-weight:700;padding:2px 5px;","color:#1E90FF"))),!Object.values(p.pf).some(e=>null===e||""===e)&&t.rand<p.tf){a.pfStatus=1,a.group=1,a.tf=p.tf,s?.cpm||p.oy_mode!=t.oy_mode_enum.LASTLOOK?a.pf={gam:s?.cpm?n:p.pf.gam,amazon:p.pf.amazon,prebid:p.pf.prebid}:p.pf.def?a.pf={gam:p.pf.defgam,amazon:"0.00"!==p.pf.defamazon?p.pf.defamazon:"0.01",prebid:"0.00"!==p.pf.defprebid?p.pf.defprebid:"0.01"}:a.pf={},a.kv_ta=`${u}1_${a.tf}${o}`,h(p)&&(a.kv_pff="1");const e=h(p)?"&od_pf_filter=1":"";a.kv_mta=l(a.kv_ta,p.oy_mode,s),a.gamSlotTargeting=`od_pf_group=1&od_pfg=1&od_pf_ta=${a.kv_ta}&od_pf_mta=${a.kv_mta}${e}`,a.pf.gam&&(a.gamSlotTargeting+=`&od_pf_pb=${a.pf.gam}`),t.sourceID&&(a.gamSlotTargeting+=`&od_pf_sbr=${t.sourceID}`)}else a.pfStatus=0,a.group=0,a.tf=p.tf,a.kv_ta=`${u}0_${a.tf}${o}`,a.kv_mta=l(a.kv_ta,p.oy_mode,s),a.gamSlotTargeting=`od_pf_group=0&od_pfg=1&od_pf_ta=${a.kv_ta}&od_pf_mta=${a.kv_mta}`,p.pf.def&&(a.pf={gam:p.pf.defgam,amazon:"0.00"!==p.pf.defamazon?p.pf.defamazon:"0.01",prebid:"0.00"!==p.pf.defprebid?p.pf.defprebid:"0.01"},a.gamSlotTargeting+=`&od_pf_pb=${a.pf.gam}`,a.pfStatus=1),t.sourceID&&(a.gamSlotTargeting+=`&od_pf_sbr=${t.sourceID}`)}else a.pfStatus=0,a.group=0,a.tf=0,a.kv_ta=`${u}0_0`,a.kv_mta=`${a.kv_ta}_0`,a.gamSlotTargeting=`od_pf_group=0&od_pfg=1&od_pf_ta=${a.kv_ta}&od_pf_mta=${a.kv_mta}`,t.sourceID&&(a.gamSlotTargeting+=`&od_pf_sbr=${t.sourceID}`),p?.pf?.def&&(a.pf={gam:p.pf.defgam,amazon:"0.00"!==p.pf.defamazon?p.pf.defamazon:"0.01",prebid:"0.00"!==p.pf.defprebid?p.pf.defprebid:"0.01"},a.gamSlotTargeting+=`&od_pf_pb=${a.pf.gam}`,a.pfStatus=1);if(0===Object.keys(a).length&&(a.pfStatus=0,a.group=0,a.gamSlotTargeting="od_pf_group=0"),t.clientDebug&&(t.forceDebugPf?(a.pfStatus=1,a.pf={gam:"1.00",prebid:"1.01",amazon:"1.02"},void 0!==t.pfDebug&&(a.pf.gam=t.pfDebug,a.pf.prebid=t.pfDebug,a.pf.amazon=t.pfDebug),a.gamSlotTargeting=`od_pf_group=1&od_pf_pb=${a.pf.gam}`):(a.gamSlotTargeting="od_pf_group=0",a.pfStatus=0)),t.debug)if(void 0===p)console.log(t.logP+d+" PfUnit "+g+" doesn't exist. Returned price floor object ",t.logS,t.logC,a);else{var r="ctrl";1==a.group&&(r="test"),console.log(t.logP+d+" PfUnit "+g+" is in "+r+" group . Returned price floor object ",t.logS,t.logC,a)}return a}catch(e){}return{pfStatus:0,gamSlotTargeting:"od_pf_group=0"}}setGptFloors(e){try{window.googletag.cmd.push(function(){if(i(t.conf,"ab_enable")&&t.conf.ab_enable){let e=r(t.ABgroupB);void 0!==typeof e.abValue&&window.googletag.setConfig({targeting:{[e.abKey]:e.abValue.toString()}})}t.ABModeSplit||window.googletag.pubads().getSlots().forEach(i=>{let o=!1;e&&e.find(e=>e.adUnitCode===i.getSlotElementId())?o=e.find(e=>e.adUnitCode===i.getSlotElementId()):e&&t.conf&&t.conf.gmapkey&&t.conf.pmapkey&&e.find(e=>e.adUnitCode===`${t.conf.pmapkey}${i.getConfig("targeting")?.targeting?.[t.conf.gmapkey]?.[0]}`)&&(o=e.find(e=>e.adUnitCode===`${t.conf.pmapkey}${i.getConfig("targeting")?.targeting?.[t.conf.gmapkey]?.[0]}`)),g(i,o)})})}catch(e){}}setAmazonCbk(e,i){if("function"==typeof i)return i(e,t)}setPrebidCbk(e,i){if("function"==typeof i)return i(e,t,s)}getVideoInStreamFloor(e,o={}){try{var n="";if(1===t.dNR&&(n+="od_pf_nr=1"),i(t.conf,"ab_enable")&&t.conf.ab_enable){let e=r(t.ABgroupB);if(""!==n&&(n+="&"),n+=e.abKey+"="+e.abValue,t.ABModeSplit)return encodeURIComponent(n)}var d=window.optiyield.getFloors({adUnitPath:e,customDimensions:o},"Video-instream");return"object"==typeof d&&(""!==n&&(n+="&"),n+=d.gamSlotTargeting),n.includes("od_pfg")||t.acceptedConsents.includes(t.consentStatus)&&(""!==n&&(n+="&"),n+="od_pfg=1"),encodeURIComponent(n)}catch(e){console.error(e)}return""}}}();if(window.optiyield=window.optiyield||{},window.optiyield.cmd=window.optiyield.cmd||[],window.optiyield.initOptiYieldSdk=window.optiyield.initOptiYieldSdk||!1,window.optiyield._ready=window.optiyield._ready||!1,0==window.optiyield._ready)var o=new t;window.optiyield.getFloors=o.getFloors,window.optiyield.setGptFloors=o.setGptFloors,window.optiyield.init=o.init,window.optiyield._0i4n3i2t=o._0i4n3i2t,window.optiyield._d1spl4yS9ts=o._d1spl4yS9ts,window.optiyield.setAmazonFloors=o.setAmazonCbk,window.optiyield.setPrebidFloors=o.setPrebidCbk,window.optiyield.getVideoInStreamFloor=o.getVideoInStreamFloor})()})(),e=new(function(){function e(e,t){return e.hasOwnProperty(t)}return class{constructor(){}getPbjs(t){return e(t.initConfig,"pbjs")?t.initConfig.pbjs:e(t.conf,"pbjs")?(window[t.conf.pbjs]=window[t.conf.pbjs]||{},window[t.conf.pbjs].que=window[t.conf.pbjs].que||[],window[t.conf.pbjs]):void 0!==t.pbjs?t.pbjs:window._pbjsGlobals?window._pbjsGlobals&&1==window._pbjsGlobals.length?(t.pbjs=window[_pbjsGlobals[0]],window[_pbjsGlobals[0]]):void 0:(t.debug&&console.warn(t.logP+" prebid.js isn't loaded yet, assume it will be pbjs",t.logS,t.logC),window.pbjs=window.pbjs||{},window.pbjs.que=window.pbjs.que||[],t.pbjs=window.pbjs,t.pbjs)}setA(t,i){try{return i.ABModeSplit||t.forEach(t=>{if(!e(t,"optiYield"))return;let o={adUnitPath:t.optiYield.adUnitPath,customDimensions:{}};e(t.optiYield,"cd")&&(o.customDimensions=t.optiYield.cd);let n=window.optiyield.getFloors(o,"AMAZON");i.clientDebug&&(1==n.pfStatus&&n.pf?.amazon?console.log(i.logP+" AMAZON configure a price floor ("+n.pf.amazon+") slot slotID: "+t.slotID,i.logS,i.logC):console.log(i.logP+" AMAZON doesn't find a price floor slotID: "+t.slotID,i.logS,i.logC)),0!==n.pfStatus&&void 0!==n.pf.amazon&&(e(t,"floor")?t.floor.value=Math.round(100*parseFloat(n.pf.amazon)):t.floor={currency:e(i.config,"cur")&&e(i.config.cur,"code")&&e(i.config.cur.code,"amazon")?i.config.cur.code.amazon:"USD",value:Math.round(100*parseFloat(n.pf.amazon))})}),t}catch(e){console.error(e)}return t}setP(t,i,o){try{if(i.ABModeSplit)return t;let n;n=e(i.conf,"pwmap")&&(void 0===t||Array.isArray(t)&&0==t.length)?function(t,i){let o=[];return window.googletag.cmd.push(function(){window.googletag.pubads().getSlots().forEach(n=>{let d="",s=t(n.getAdUnitPath());if(e(i.conf,"pwmap")&&"sei"===i.conf.pwmap?d=n.getSlotElementId():e(i.conf,"pwmap")&&"aup"===i.conf.pwmap?d=s:e(i.conf,"gmapkey")&&(e(i.conf,"pmapkey")&&""!==i.conf.pmapkey&&(d=i.conf.pmapkey),d+=n.getTargeting(i.conf.gmapkey)[0]),void 0!==d&&""!==d){let t={};t.code=d,t.optiYield={adUnitPath:s},function(t,i,o){e(o.conf,"gcdk")&&(t.optiYield.cd={},Object.entries(o.conf.gcdk).forEach(([e,o],n)=>{t.optiYield.cd[e]=i.getTargeting(o)[0]}))}(t,n,i),o.push(t)}})}),o}(o):t;let d=window.odT.getPbjs(i),s={floors:{data:{currency:e(i.config,"cur")&&e(i.config.cur,"code")&&e(i.config.cur.code,"prebid")?i.config.cur.code.prebid:"EUR",schema:{fields:["adUnitCode","mediaType"],delimiter:"|"},values:{}}}};return n.forEach(t=>{if(!e(t,"optiYield"))return;let o={adUnitPath:t.optiYield.adUnitPath,customDimensions:{}};e(t.optiYield,"cd")&&(o.customDimensions=t.optiYield.cd);let n=window.optiyield.getFloors(o,"PREBID");i.clientDebug&&(1==n.pfStatus&&n.pf?.prebid?console.log(i.logP+" PREBID configure a price floor ("+n.pf.prebid+") AdUnit code: "+t.code,i.logS,i.logC):console.log(i.logP+" PREBID doesn't find a price floor AdUnit code: "+t.code,i.logS,i.logC)),0!==n.pfStatus&&void 0!==n.pf.prebid&&(e(t,"code")&&(s.floors.data.values[t.code+"|*"]=parseFloat(n.pf.prebid)),e(t,"floors")?t.floors.values={"*":parseFloat(n.pf.prebid)}:t.floors={currency:e(i.config,"cur")&&e(i.config.cur,"code")&&e(i.config.cur.code,"prebid")?i.config.cur.code.prebid:"EUR",schema:{fields:["mediaType"]},values:{"*":parseFloat(n.pf.prebid)}})}),void 0===d||!i.conf||i.conf.ma||!i.conf.use_pb_cpm&&!i.conf.force_pb_cpm||i.auctionEndDone||(i.auctionEndDone=!0,d.que.push(function(){d.onEvent("auctionEnd",function(){const e=function(e){if(!e.conf.use_pb_cpm&&!e.conf.force_pb_cpm)return!1;const t=[];try{let i=1,o=!1;const n=odT.getPbjs(e)?.getConfig()?.currency?.adServerCurrency;n!==e?.config?.cur?.code?.gam&&(o=!0,i=.95);let d=odT.getPbjs(e).getHighestCpmBids();if(d.length)return d.map(d=>{const s=function(e,t){if(!t||!t.cpm)return 0;const i={low:"pbLg",medium:"pbMg",high:"pbHg",auto:"pbAg",dense:"pbDg",custom:"pbCg"}["function"==typeof odT.getPbjs(e)?.getConfig&&odT.getPbjs(e)?.getConfig("priceGranularity")]||"pbAg";return t[i]?parseFloat(t[i]):t.cpm}(e,d);t.push({adUnitCode:d.adUnitCode,cpm:parseFloat(o?odT.getPbjs(e).convertCurrency(s,n,e?.config?.cur?.code?.gam):s)*i})}),t}catch(e){}return!1}(i);window.optiyield.setGptFloors(e)})})),t}catch(e){console.error(e)}return t}}}()),window.odT.setA=e.setA,window.odT.setP=e.setP,window.odT.getPbjs=e.getPbjs,function(e){for(var i=t,o=e();;)try{if(351602===parseInt(i(530))/1+-parseInt(i(546))/2*(-parseInt(i(566))/3)+-parseInt(i(571))/4+-parseInt(i(507))/5*(parseInt(i(585))/6)+parseInt(i(460))/7*(parseInt(i(570))/8)+parseInt(i(488))/9*(parseInt(i(558))/10)+parseInt(i(589))/11)break;o.push(o.shift())}catch(e){o.push(o.shift())}}(i),(()=>{var e={147:e=>{var i=t;e[i(557)]={i8:i(534)}}},i={};function o(n){var d=t,s=i[n];if(void 0!==s)return s[d(557)];var a=i[n]={exports:{}};return e[n](a,a[d(557)],o),a[d(557)]}(()=>{var e=t;class i{constructor(e,i){var o=t;this[o(522)]=e,this[o(528)]=i}[e(478)](t){var i=e;this[i(522)]&&"verbose"===this[i(528)]&&console[i(478)](t)}[e(582)](t){var i=e;this[i(522)]&&[i(527),i(582)][i(567)](this[i(528)])&&console[i(582)](t)}[e(551)](t){var i=e;this.debug&&console[i(551)](t)}}class n{constructor({previousType:t,adsTag:o,insertAdslotBeforeTarget:n,insertAdslotIntoTarget:d,dontBreakWithPreviousType:s,recurrenceLevel:a,divIdPrefix:r,previousTypeExtra:l,previousTypeClass:c,parentContainer:u,debug:p,debugLevel:g,omitInvisible:w,infiniteScroll:h}){var f=e;this[f(586)]=n,this[f(559)]=d,this.previousType=t,this[f(476)]=r,this[f(493)]=l,this.previousTypeClass=c,this[f(504)]=s,this[f(561)]=o,this[f(522)]=p,this[f(522)]=g,this[f(484)]=new i(p,g),this[f(574)]=0,this[f(470)]=0,this[f(569)]=a,this[f(459)]=u,this[f(544)]=w,this[f(553)]=[],this[f(487)]=[],this.infiniteScroll=h}static[e(564)](t,i=!1){var o=e;if(i)return document[o(481)](t,document,null,XPathResult[o(547)],null)[o(486)];let n=t[o(565)]("#","")[o(565)](".","");if(t[o(567)]("#"))return document[o(519)](n);let d=document[o(513)](n);return d?d[0]:null}stepIn(){this[e(574)]++}stepOut(){this[e(574)]--}isVisible(t){var i=e,o=window[i(536)](t),n=t.getBoundingClientRect()[i(542)];return i(518)!==o[i(581)]&&"hidden"!==o.visibility&&n>0}[e(466)](t){var i=e;return!!t.classList&&t[i(578)].contains(this.previousTypeClass)}[e(491)](t,i,o){var n=e;if(!this.insertAdslotIntoTarget){if(!this[n(474)](o))return;if(!this[n(493)][n(567)](t))return}if(this[n(477)]&&!this.isOptiClass(o))return;if(this[n(559)]||this[n(586)])return this[n(522)]&&(this[n(487)][n(462)]({element:o,rect:o[n(512)]()}),o[n(577)]("data-adslot-top",o[n(512)]().top)),i[n(462)](o);let d=this[n(587)](o);if(this.logger[n(478)]({msg:"next sibling",nextSibling:d,htmlElement:o}),d)return this.candidatesData.push({element:d,rect:d.getBoundingClientRect()}),i.push(d);this.logger[n(582)]({htmlElement:o,nextSibling:d})}[e(537)](t,i=[]){var o=e;let n=t[o(533)][o(483)](),d=Array.from(t[o(575)]);var s,a=0;return this.presentLevel<this[o(569)]&&!this[o(504)][o(567)](n)?(this[o(484)][o(478)]({msg:"Step in "+this[o(574)]+" / "+this[o(569)],htmlElement:t}),this[o(538)](),a=i[o(525)],d[o(480)](e=>{this[o(537)](e,i)}),s=i.length,this[o(484)][o(478)]({msg:o(508)+this[o(574)]+" / "+this[o(569)],htmlElement:t,found:i[o(525)]}),this[o(535)](),a===s&&this[o(491)](n,i,t)):this.secureCandidateAdder(n,i,t),i}[e(554)](t){var i=e;return!!t.id&&t.id[i(567)](i(492))}nextSibling(t){var i=e;if(t===this.parentContainer)return null;let o=t[i(496)];if(this.logger[i(582)]({msg:i(469),candidate:t,next:o}),o){if(this.omitInvisible||this[i(474)](o))return this[i(554)](o)?this.nextSibling(o):o;this[i(484)][i(582)]({msg:i(531),candidate:t,next:o})}return this[i(587)](t[i(495)])}[e(467)](t){var i=e;return t[i(496)]||this[i(587)](t.parentNode)}[e(501)](t,i,o=null,n=""){var d=e;if(o){var s=document[d(516)](o);s.id="optidigital-ad-wrapper-"+(this[d(553)][d(525)]+1),s.className=n,s[d(539)](i),this[d(559)]?t[d(539)](s):t[d(495)][d(548)](s,t)}else this[d(559)]?t[d(539)](i):t[d(495)][d(548)](i,t);return this[d(553)].push(i),i}[e(515)](t,i){var o=e;return t.appendChild(i),this[o(553)][o(462)](i),i}[e(543)](){return this[e(553)]}[e(552)](t,i=!1){var o=e;let n=document[o(516)](this[o(561)]);return this[o(520)]||i||(n.id=this[o(476)]+t),n[o(577)](o(583),this.divIdPrefix+t),n[o(591)]=t,n[o(556)][o(581)]=o(518),n}}const d={parentDiv:null,divIdPrefix:e(465),omitInvisible:!0,wrapperTag:null,wrapperClass:"",adSlots:[],previousType:"div",previousTypeExtra:[],previousTypeClass:null,positionFirst:1,dontBreakWithPreviousType:["ul","ol"],keepTheDistanceFrom:[],keepDistanceFrom:[],keepTheDistancePx:100,keepDistancePx:null,keepDistanceFromTheTop:0,keepDistanceFromTop:null,keepDistanceFromTheBottom:0,keepDistanceFromBottom:null,interval:1200,intervalIncrement:0,recurrenceLevel:1,insertAdslotBeforeTarget:!1,insertAdslotIntoTarget:!1,infiniteAdslot:!1,infiniteScroll:!1,useXPath:!1,debugLevel:e(527),debug:!1};var s=o(147).i8;function a(t,i,o){var n=e;if(0===t)return!0;if(o){var d=o.getBoundingClientRect()[n(562)];return i.getBoundingClientRect()[n(573)]-t>=d}return!1}function r(t,i,o,n,d,s,a){var r=e;if(0===o)return!0;var l=t+i*(o-1);let c=d[r(512)]()[r(562)];function u(e){var t=r;return t(518)!==window[t(536)](e)[t(581)]}if(!u(d)){let e=null!==d[r(496)]?d[r(496)]:d[r(490)];for(;e;){if(!0===u(e)){c=e[r(512)]()[r(562)];break}e=null!==e[r(496)]?e[r(496)]:e[r(490)]}}let p=c+l;var g=p<=s;return g?a[r(582)]({msg:"verifyInterval ok",interval:t,intervalIncrement:i,adsInserted:o,test:g,candidate:n,lastPickedCandidate:d,lastPickedCandidateTop:d[r(512)]()[r(562)],testLogic:" "+p+r(590)+s+" ?",posY:p,candidateTop:s}):a.info({msg:r(555),interval:t,intervalIncrement:i,adsInserted:o,test:g,candidate:n,lastPickedCandidate:d,lastPickedCandidateTop:d[r(512)]().top,testLogic:" "+p+r(590)+s+" ?",posY:p,candidateTop:s}),g}window.optidigitaltagsinserter=new class{constructor(){this[e(494)]=s}[e(498)](e){var t={};for(var i in d)t[i]=e[i]?e[i]:d[i];return t}[e(457)](t){var i=e;t[i(461)].length>0&&0===t[i(475)][i(525)]&&(t[i(475)]=t[i(461)]),t.keepDistancePx&&(t[i(506)]=t[i(579)]),t[i(485)]&&(t.keepDistanceFromTheTop=t.keepDistanceFromTop),t[i(529)]&&(t[i(572)]=t.keepDistanceFromBottom),t[i(493)]=[...new Set([t[i(563)],...t[i(493)]])],this.adsTag="div",this.parentDiv=t[i(502)],this[i(563)]=t[i(563)],this[i(493)]=t[i(493)],this[i(477)]=t[i(477)],this[i(532)]=t.useXPath,this.debug=t[i(522)],this.debugLevel=t[i(528)],this.keepDistanceFromTheTop=t[i(580)],this.keepDistanceFromTheBottom=t[i(572)],this[i(472)]=t[i(472)],this[i(471)]=[...t[i(471)]][i(473)](),this[i(569)]=t[i(569)],this.interval=t.interval,this[i(503)]=t[i(503)],this.insertAdslotBeforeTarget=t[i(586)],this[i(559)]=t[i(559)],this[i(468)]=t[i(468)],this[i(475)]=t[i(475)],this[i(506)]=t.keepTheDistancePx,this.wrapperTag=t[i(524)],this[i(489)]=t[i(489)],this[i(520)]=t[i(520)]}[e(482)](i){var o=e;function n(e){var i=t,o=window[i(536)](e);return!(!o||!o[i(581)]||i(518)===o[i(581)])}var d=this[o(463)][o(467)](i);if(d){let e=i[o(512)]()[o(562)]-this[o(506)],t=d.getBoundingClientRect()[o(562)]+this[o(506)];t<e&&(t=e+this[o(506)]),n(i)&&(this.forbidden[o(462)]({topWithDistance:i[o(512)]().top-this[o(506)],botWithDistance:t}),this[o(500)][o(462)](i))}else this[o(484)][o(478)]({msg:"Missed next for forbidden element",forbiddenElement:i}),n(i)&&(this.forbiddenElements.push(i),this[o(584)][o(462)]({topWithDistance:i[o(512)]()[o(562)]-this.keepTheDistancePx,botWithDistance:this[o(459)][o(512)]().bottom+this[o(506)]}))}[e(510)](){var t=e;this[t(584)]=[],this[t(500)]=[],this[t(475)][t(480)](e=>{var i=t;if(e[i(567)]("#")){var o=document[i(519)](e[i(565)]("#",""));o&&this[i(482)](o)}else Array[i(517)](document.getElementsByClassName(e.replace(".","")))[i(480)](e=>{this.__setupSingleForbidden(e)})})}[e(505)](t={}){var o=e,d=this._extendDefaults(t);if(this[o(457)](d),this[o(484)]=new i(this.debug,this[o(528)]),this[o(484)][o(582)]({msg:o(479),version:this[o(494)],config:d}),this[o(502)]){if(this[o(459)]=n[o(564)](this[o(502)],this[o(532)]),this[o(459)])return this[o(463)]=new n({previousType:this[o(563)],adsTag:this[o(561)],insertAdslotBeforeTarget:d[o(586)],insertAdslotIntoTarget:d[o(559)],dontBreakWithPreviousType:d[o(504)],recurrenceLevel:d[o(569)],divIdPrefix:d.divIdPrefix,previousTypeExtra:d.previousTypeExtra,previousTypeClass:d.previousTypeClass,parentContainer:this[o(459)],debug:d[o(522)],debugLevel:d[o(528)],omitInvisible:d[o(544)],infiniteScroll:d[o(520)]}),this[o(484)].info({msg:o(499)}),this[o(464)]=this[o(463)].readDOM(this[o(459)]),this[o(484)][o(582)]({msg:o(509)}),this[o(510)](),this[o(484)].info({forbiddenDimensions:this.forbidden,forbiddenElements:this.forbiddenElements,candidates:this.candidateElements,candidatesData:this[o(463)].candidatesData}),this[o(592)](),this[o(522)]&&this[o(463)].getInsertedAds().forEach(e=>{var t=o;e[t(556)][t(581)]=t(526),e[t(556)][t(545)]="#FFFFF0",e[t(556)][t(560)]="#AA0000";var i=100+Math[t(540)](200*Math[t(523)]());e[t(556)][t(550)]=i+"px",e[t(549)]=e[t(458)](t(583))}),!0;this.logger[o(551)]({msg:"parentDiv missing!",selector:d[o(502)]})}else this[o(484)].error({msg:o(541),selector:d[o(502)]})}_insertAll(){var t=e;if(this[t(484)][t(582)]({msg:t(456),parent:this.parentContainer}),0===this.adSlots[t(525)])return!1;var i=0,o=null,n=this[t(471)][0];if(this.candidateElements.every(e=>{var d,s,l,c,u,p=t;if(0===this[p(471)][p(525)]&&!this[p(468)])return!1;if(i++,!(this[p(472)]<=i))return this[p(484)][p(582)]({msg:"verifyFirstIndex failed",candidate:e,positionFirst:this[p(472)],counter:i}),!0;if(!function(e,t,i){var o=p;if(0===e)return!0;var n=i[o(512)]()[o(562)];return t[o(512)]().top+e<=n}(this[p(580)],this[p(459)],e))return this[p(484)].info({msg:p(588),candidate:e}),!0;if(!r(this[p(568)],this.intervalIncrement,this[p(463)].getInsertedAds()[p(525)],e,o,e[p(512)]()[p(562)],this[p(484)]))return!0;if(d=this[p(584)],s=e,l=this.logger,u=0,!d[(c=p)(576)](e=>{var t=c;u++;var i=e[t(514)]>s[t(512)]().top||e.botWithDistance<s[t(512)]()[t(562)];return i||l[t(478)]({index:u,avoidDict:e,candidate:s,rectTop:s[t(512)]().top}),i}))return this[p(484)][p(582)]({msg:p(521),candidate:e}),!0;if(!a(this[p(572)],this[p(459)],e))return this.logger[p(582)]({msg:p(497),candidate:e,keepDistanceFromTheBottom:this[p(572)]}),!0;const g=0===this.adSlots.length,w=g?n:this[p(471)].pop(),h=g?n:this.wrapperClass,f=!!g;var m=this[p(463)][p(552)](w,f);return o=e,this.logger[p(582)]({msg:"INSERTING ABOVE",candidate:e,wrapperTag:this[p(524)],wrapperClass:h}),this.domToolkit.insertOne(e,m,this[p(524)],h),!0}),this[t(471)][t(525)]>0&&a(this[t(572)],this[t(459)])&&r(this[t(568)],this[t(503)],this[t(463)][t(543)]()[t(525)],null,o,this[t(459)][t(512)]()[t(573)],this[t(484)])){this.logger.info({msg:"INSERTING at the end of parent"});var d=this[t(471)][t(511)](),s=this[t(463)].createAdSlotElement(d);this[t(463)][t(515)](this[t(459)],s)}return this[t(484)][t(582)]({msg:"Insertion Finished"}),!0}}})()})()}setGptRand(){this.gptTrafficRand=Math.floor(100*Math.random()),Number.isFinite(window.odT?.setup?.bypassGPT)&&this.gptTrafficRand<window.odT?.setup?.bypassGPT&&(this.setup.disableGPT=!0,window.odT.log("GPT is disabled"))}getUniqueNumericSizes(e=[]){const t=[],i=new Set;for(const o of e){if(Array.isArray(o)&&1===o.length&&"fluid"===o[0]){i.has("fluid")||(i.add("fluid"),t.push(["fluid"]));continue}if(!Array.isArray(o)||2!==o.length)continue;if(!Number.isFinite(o[0])||!Number.isFinite(o[1]))continue;const e=`${o[0]}x${o[1]}`;i.has(e)||(i.add(e),t.push(o))}return t}getBiddingSizesForSlot(e){if(!e)return[];const t=Array.isArray(e.dfpSizes)?e.dfpSizes:[],i=Array.isArray(e.dfpSizesFC)?e.dfpSizesFC:[];return this.getUniqueNumericSizes([...t,...i])}parseRenderedSize(e){if(Array.isArray(e)&&2===e.length)return e;if("string"==typeof e&&e.includes("x")){const[t,i]=e.split("x").map(Number);if(Number.isFinite(t)&&Number.isFinite(i))return[t,i]}return null}isFlyingCarpetRenderedSize(e,t){if(!e||!Array.isArray(e.dfpSizesFC)||!e.dfpSizesFC.length)return!1;const i=this.parseRenderedSize(t);return!!i&&e.dfpSizesFC.some(e=>Array.isArray(e)&&2===e.length&&e[0]===i[0]&&e[1]===i[1])}isFlyingCarpetTallRenderedSize(e,t){if(!e||!e.isFlyingCarpetEnabled||!Number.isFinite(e.maxHeightFC))return!1;const i=this.parseRenderedSize(t);return!!i&&(Number.isFinite(i[1])&&i[1]>e.maxHeightFC)}setDefaultSizes(){this.setGptRand();const e={};if(!1===this.insertInreadStartDone&&this.setup?.[`insertInread${this.screen}`])try{optidigitaltagsinserter.insertInRead(this.setup[`insertInread${this.screen}`][0])}catch(e){}this.setup.hasOwnProperty("insertInreadTags")&&0==this.insertInreadStartDone&&this.setup.insertInreadTags(this.initConfig.adUnit);let t=document.querySelectorAll(`[id^="${this.divIdPrefix}"]`);t=Array.from(t);this.stickyAdapter.getStickyAdConfigurations();const i=this.stickyAdapter.getStickyNames(),o=(i[0],this.screen,e=>{e.forEach(e=>{if(!t.includes(e)){const o=e.getAttribute("class"),n=e.getAttribute("id");i.find(e=>o&&o.includes(e)||n&&n.includes(e))||t.push(e)}})});if(document.querySelectorAll(`[class^="${this.divIdPrefix}"]`).length){o(document.querySelectorAll(`[class^="${this.divIdPrefix}"]`))}if(this.setup.adSlotsConfig&&this.setup.adSlotsConfig.adSlotsPrefixes&&this.setup.adSlotsConfig.adSlotsPrefixes.length){this.mappedSite=!0;let e=this.setup.adSlotsConfig.adSlotsPrefixes.map(e=>`[id^="${e}"]`).join(","),t=`${this.setup.adSlotsConfig.adSlotsPrefixes.map(e=>`[class^="${e}"]`).join(",")},${this.setup.adSlotsConfig.adSlotsPrefixes.map(e=>`[class*="${e}"]`).join(",")}`;if(document.querySelectorAll(e).length){o(document.querySelectorAll(e))}if(document.querySelectorAll(t).length){o(document.querySelectorAll(t))}}else{if(document.querySelectorAll('[id^="Billboard_"], [id^="Mobile_"], [id^="Content_"], [id^="HalfpageAd_"], [id^="Rectangle_"], [id^="Wallpaper"]').length){o(document.querySelectorAll('[id^="Billboard_"], [id^="Mobile_"], [id^="Content_"], [id^="HalfpageAd_"], [id^="Rectangle_"], [id^="Wallpaper"]'))}if(document.querySelectorAll('[class^="Billboard_"], [class^="Mobile_"], [class^="Content_"], [class^="HalfpageAd_"], [class^="Rectangle_"], [class^="Wallpaper"], [class*=" Billboard_"], [class*=" Mobile_"], [class*=" Content_"], [class*=" HalfpageAd_"], [class*=" Rectangle_"], [class*=" Wallpaper"]').length){o(document.querySelectorAll('[class^="Billboard_"], [class^="Mobile_"], [class^="Content_"], [class^="HalfpageAd_"], [class^="Rectangle_"], [class^="Wallpaper"], [class*=" Billboard_"], [class*=" Mobile_"], [class*=" Content_"], [class*=" HalfpageAd_"], [class*=" Rectangle_"], [class*=" Wallpaper"]'))}}if(i.forEach(e=>{if(this.stickyAdapter.isFallback(e))this.log(`Sticky ad "${e}" is in fallback mode. It will not be created.`);else try{this.stickyAdapter.createStickyAd(e,{initConfigAdUnit:this.initConfig.adUnit,log:e=>this.log(e),getCookie:e=>this.getCookie(e),firstLoadAdSlots:this.firstLoadAdSlots,setAttributes:(e,t)=>this.tools.setAttributes(e,t),stickyAutoCloseScroll:this.stickyAutoCloseScroll,refreshAdSlots:e=>this.refreshAdSlots(e),onLegacyStateUpdate:e=>{void 0===e.stickyAdDivId||this.stickyAdDivId||(this.stickyAdDivId=e.stickyAdDivId),void 0!==e.stickyAdMode&&(this.stickyAdMode=e.stickyAdMode),void 0!==e.stickyAdStatus&&(this.stickyAdStatus=e.stickyAdStatus),void 0!==e.stickyAdTopTrigger&&(this.stickyAdTopTrigger=e.stickyAdTopTrigger),void 0!==e.stickyAdAutoHidePx&&(this.stickyAdAutoHidePx=e.stickyAdAutoHidePx)},adLayoutEnabled:this.setup.adLayoutEnabled})}catch(t){this.log('Error creating sticky ad "'+e+'": '+(t&&t.message?t.message:t))}}),i.forEach(e=>{if(document.getElementById(`${this.divIdPrefix}${e}`)&&""!==this.divIdPrefix){document.querySelectorAll(`[id="${this.divIdPrefix}${e}"]`).forEach(e=>{t.includes(e)||t.push(e)})}}),t.forEach(t=>{if("function"==typeof t.getAttribute&&"video"===t.getAttribute("data-template"))return;let o="",n="",d=0,s=null,a=null,r=null,{deviceTarget:l,adUnitPathSuffix:c,customKeyValues:u,outOfPage:p,disableGPT:g}=window.odT.setup?.adSlotsConfig?.adSlotsDefinitions?.find(e=>e.name===o)||{};const w=t.getAttribute("id"),h=i.some(e=>w===`${window.odT.divIdPrefix}${e}`);if(h)o=t.getAttribute("id"),o=o.replace(window.odT.divIdPrefix,"");else{if(!t.getAttribute("id")||t.getAttribute("id")&&!t.getAttribute("id").startsWith(window.odT.divIdPrefix)&&""!==window.odT.divIdPrefix){o=t.getAttribute("class");const e="Desktop"===window.odT.screen?/(Billboard_|Content_|HalfpageAd_|Rectangle_|Wallpaper_)\w+/:/(Mobile_)\w+/,i=o.match(e);if(i&&(o=i[0]),o=o.replace(window.odT.divIdPrefix,""),document.getElementById(`${window.odT.divIdPrefix}${o}`)&&document.querySelectorAll(`[id="${window.odT.divIdPrefix}${o}"]`).length<2&&document.querySelectorAll(`.${CSS.escape(o)}`).length>1){let e=document.querySelectorAll(`[id^="${window.odT.divIdPrefix}${o}"]`).length;t.setAttribute("id",`${window.odT.divIdPrefix}${o}_${e}`),d=e}else t.setAttribute("id",`${window.odT.divIdPrefix}${o}`)}else o=t.getAttribute("id").replace(window.odT.divIdPrefix,""),n=t.getAttribute("data-template")?t.getAttribute("data-template"):null,s=t.getAttribute("data-adslotname")?t.getAttribute("data-adslotname"):null,a=t.getAttribute("data-adunitcode")?t.getAttribute("data-adunitcode"):c||null,r=t.getAttribute("data-devicetargeting")?t.getAttribute("data-devicetargeting"):l||null,u=t.getAttribute("data-customkeyvalues")?t.getAttribute("data-customkeyvalues"):u||null;o&&"Wallpaper"!==o&&t.classList.add("optidigital-ad-center-sticky")}if(!window.odT.tagMode&&!h){if("Desktop"===window.odT.screen&&o.toLowerCase().includes("mobile")||"Desktop"===window.odT.screen&&r?.toLowerCase().includes("mobile"))return;if("Mobile"===window.odT.screen&&!o.toLowerCase().includes("mobile")||"Mobile"===window.odT.screen&&r?.toLowerCase().includes("desktop"))return}t.setAttribute("style","");const f=o;let m,v={name:s||(d?`${f}_${d}`:f),adUnit:f,divId:`${window.odT.divIdPrefix}${d?`${f}_${d}`:f}`,loadType:1,lazyLoadPx:600,lazyLoadPxWithCore:900,dfpSizes:{},...n&&{adTemplate:n},...a&&{customAdUnitCode:a},...u&&{customKeyValues:u},...p&&{outOfPage:p},...g&&{disableGPT:g}};m="Mobile"!==window.odT.screen||window.odT.setup?.adSlotsConfig?.useParentWidth?t.getBoundingClientRect().width&&t.getBoundingClientRect().width>0?t.getBoundingClientRect().width:t.parentElement?t.parentElement.getBoundingClientRect().width:0:screen.width;const y=window.odT.tagMode?document.documentElement.clientHeight:t.parentElement?getComputedStyle(t.parentElement)&&getComputedStyle(t.parentElement)["max-height"]:"";window.odT.setAdSlotParams(e,v,f,m,y,n),v.dfpSizes.length||window.odT.log(`There is no dfpSizes for ${v.name}`)}),this.setup?.adSlotsConfig?.adSlotsDefinitions&&this.setup.adSlotsConfig.adSlotsDefinitions.some(e=>void 0!==e.divTarget&&"video"!==e.adTemplate)){this.mappedSite=!0,this.setup.adSlotsConfig.adSlotsDefinitions.filter(e=>e.divTarget&&"video"!==e.adTemplate).forEach(e=>{if("Desktop"===window.odT.screen&&(!e.deviceTarget||e?.deviceTarget?.toLowerCase().includes("mobile")))return;if("Mobile"===window.odT.screen&&e?.deviceTarget?.toLowerCase().includes("desktop"))return;let i=1;e.divTarget.length&&e.divTarget.map(o=>{let n={name:e.name,adUnit:e.name,divId:null,loadType:1,lazyLoadPx:600,lazyLoadPxWithCore:900,dfpSizes:{},adTemplate:e.adTemplate};if(e.adUnitPathSuffix&&(n.customAdUnitCode=e.adUnitPathSuffix),e.cdValue&&(n.cdValue=e.cdValue),e.customKeyValues&&(n.customKeyValues=e.customKeyValues),e.outOfPage&&(n.outOfPage=!0),e.isFallBack&&(n.isFallBack=!0),o.startsWith("#")){let d=o.slice(1);document.getElementById(d)&&(n.divId=d,n.name=i>1?`${e.name}_${i}`:e.name,t?.some(e=>e.divId===n.divId)||(t.push(n),i++))}else if(o.startsWith(".")){let d=o.slice(1);document.querySelectorAll(`.${CSS.escape(d)}`).forEach(d=>{let s={name:e.name,adUnit:e.name,divId:null,loadType:1,lazyLoadPx:600,lazyLoadPxWithCore:900,dfpSizes:{},adTemplate:e.adTemplate};e.adUnitPathSuffix&&(s.customAdUnitCode=e.adUnitPathSuffix),e.cdValue&&(s.cdValue=e.cdValue),e.customKeyValues&&(n.customKeyValues=e.customKeyValues),e.outOfPage&&(n.outOfPage=!0),e.isFallBack&&(n.isFallBack=!0),d.getAttribute("id")?(s.name=i>1?`${e.name}_${i}`:e.name,s.divId=d.getAttribute("id")):(d.setAttribute("id",i>1?`${o.slice(1)}_${i}`:o.slice(1)),s.name=i>1?`${e.name}_${i}`:e.name,s.divId=i>1?`${o.slice(1)}_${i}`:o.slice(1)),t?.some(e=>e.divId===s.divId)||(t.push(s),i++)})}else document.getElementById(o)&&(n.divId=o,n.name=i>1?`${e.name}_${i}`:e.name,t?.some(e=>e.divId===n.divId)||(t.push(n),i++));if(document.getElementById(e.divId)){const t=document.getElementById(e.divId);t.getAttribute("data-template")&&(n.adTemplate=t.getAttribute("data-template")),t.getAttribute("data-adslotname")&&(n.name=t.getAttribute("data-adslotname")),t.getAttribute("data-adunitcode")&&(n.customAdUnitCode=t.getAttribute("data-adunitcode"))}})}),i.forEach(e=>{let{cdValue:i,adUnitPathSuffix:o,customKeyValues:n,outOfPage:d,adTemplate:s}=this.setup?.adSlotsConfig?.adSlotsDefinitions?.find(t=>t.name===e)||{};if(document.getElementById(`${window.odT.divIdPrefix}${e}`)){let a={name:e,adUnit:e,divId:`${this.divIdPrefix}${e}`,loadType:this.stickyAdapter.getLoadType(e),lazyLoadPx:0,lazyLoadPxWithCore:900,dfpSizes:{},adTemplate:s||`${this.screen}sticky`,...i&&{cdValue:i},...o&&{customAdUnitCode:o},...n&&{customKeyValues:n},...d&&{outOfPage:d}};t.push(a)}else window?.odT?.firstLoadAdSlots?.includes(e)&&window.odT.stickyAdDivId&&"string"==typeof e&&(window.odT.firstLoadAdSlots=window.odT.firstLoadAdSlots.filter(t=>t!==e),window.odT.log(`Sticky postion removed due to mispelling or not existing divId: ${e}`))}),t.forEach(t=>{if(t.divId){let i,o=document.getElementById(t.divId);o.setAttribute("style",""),i="Mobile"!==window.odT.screen||window.odT.setup?.adSlotsConfig?.useParentWidth?o&&o.getBoundingClientRect().width&&o.getBoundingClientRect().width>0?o.getBoundingClientRect().width:o&&o.parentElement?o.parentElement.getBoundingClientRect().width:0:screen.width;const n=window.odT.tagMode?document.documentElement.clientHeight:o&&o.parentElement?getComputedStyle(o.parentElement)&&getComputedStyle(o.parentElement)["max-height"]:"";window.odT.setAdSlotParams(e,t,t.name,i,n,t.adTemplate,t.divId),t.dfpSizes.length||window.odT.log(`There is no dfpSizes for ${t.name}`)}})}if(this.finalAdSlotsConfig.adSlotsDefinitions=e,"Mobile"===this.screen&&this.mobileEvenVerticalSizes){(e=>{window.odT.mobilePosPostions=0;for(const[t,i]of Object.entries(e))t.startsWith("Mobile_Pos")&&parseInt(t.slice(-1))%2==0&&(i.dfpSizes=[...i.dfpSizes,...window.odT.sizesForMobilePos],i.biddingSizes=window.odT.getBiddingSizesForSlot(i))})(this.finalAdSlotsConfig.adSlotsDefinitions)}try{this.adAdaptersFactory.addSpecialAdSlots(this.finalAdSlotsConfig.adSlotsDefinitions)}catch(e){this.log("[Rewarded AD] Failed to add special ad slots",e)}this.log("Valid adslots ",this.finalAdSlotsConfig.adSlotsDefinitions),this.createAdStyles(),this.adslotInit();try{this.setupVideoPlayerSlots()}catch(e){this.log("Video Module - Failed to setup video player slots",e)}function n(e,t,i=[]){if(e.parentElement&&e.parentElement.classList&&e.parentElement.classList.contains("optidigital-wrapper-div"))return i;const o=e.classList?Array.from(e.classList):[];for(const n of t)if("string"==typeof n)if(n.startsWith(".")){const t=n.substring(1);o.some(e=>e.startsWith(t))&&i.push({foundEl:e,selector:t})}else if(n.startsWith("#")){const t=n.substring(1);e.id!==t||Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).some(e=>e.divId?.includes(n))||i.push({foundEl:e,selector:t})}else e.id!==n||Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).some(e=>e.divId?.includes(n))||i.push({foundEl:e,selector:n});if(e.children&&e.children.length)for(let o=0;o<e.children.length;o++)n(e.children[o],t,i);return i}function d(e,t,i){e.forEach(e=>{"childList"===e.type&&e.addedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){n(e,i).forEach(e=>{window.odT.addNewAdSlot(e)})}})})}const s=(()=>{let e=null,t=null,i=null;return()=>{const o=window.odT.screen,n=window.odT?.setup?.adSlotsConfig?.adSlotsDefinitions,d=n?JSON.stringify(Object.keys(n).sort()):"";if(e&&t===o&&i===d)return e;let s=[];if(n){const e="Desktop"===o,t="Mobile"===o;for(const[i,o]of Object.entries(n))if(o.divTarget&&Array.isArray(o.divTarget)){const i=o.deviceTarget?.toLowerCase()||"";(e&&i&&!i.includes("mobile")||t&&!i.includes("desktop"))&&s.push(...o.divTarget)}}return 0===s.length&&(s="Mobile"===o?[".Mobile_"]:[".Billboard_",".Content_",".HalfpageAd_",".Rectangle_",".Wallpaper"]),e=s,t=o,i=d,s}})(),a=new MutationObserver((e,t)=>{if(!e.some(e=>"childList"===e.type&&e.addedNodes.length>0))return;d(e,0,s())}),r=document,l={childList:!0,subtree:!0};window.odT.setup.disableInfiniteScrollFirstLoad||window.odT.setup.spaManualMode||window.odT?.setup?.adSlotsConfig?.adSlotsPrefixes||a.observe(r,l)}setAdSlotParams(e,t,i,o,n,d,s){let a=d||i.replace(/[0-9]/g,"").replace(/_/g,"").toLowerCase();const r=this.screen?`${this.screen.toLowerCase()}sticky`:null,l=this.stickyAdapter.isStickyAdSlot(i),c=l?this.stickyAdapter.getStickyAdConfigurations():[];let u=!1;l&&(t.loadType=this.stickyAdapter.getLoadType(i),t.lazyLoadPx=0,u=this.stickyAdapter.isVerticalStickyAdSlot(i));const p=(e,t,i,o)=>2!==e.length||(!i||e[t]>=i)&&(!o||e[t]<=o),g=e=>(Array.isArray(e)?e:e?[e]:[]).map(e=>e.startsWith("#")||e.startsWith(".")?e.slice(1):e),w=e=>!("Desktop"===window.odT.screen&&(!e.deviceTarget||e?.deviceTarget?.toLowerCase().includes("mobile")))&&("Mobile"!==window.odT.screen||!e?.deviceTarget?.toLowerCase().includes("desktop"));let h=function(e,t){for(const i in e)if(i.includes(t.toLowerCase()))return i;for(const i in e)if(t.includes(i.toLowerCase()))return i;return t===r?`${window.odT.screen.toLowerCase()}sticky`:null}(this.sizesFor,a),f=[];const m=this.setup?.adSlotsConfig?.adSlotsDefinitions?.find(e=>e.name===i||e.divTarget&&g(e.divTarget).includes(s)&&w(e)||e.name===t?.adUnit)||{};if(f=this.tagMode?[...this.tagSizes]:l&&u?[...this.sizesFor.verticalsticky]:h?[...this.sizesFor[h]]:[...this.sizesFor.default],this.setup.adSlotsConfig){if(this.setup.adSlotsConfig.hasOwnProperty("adSlotsDefinitions")){const{odSize:e,size:i,minMaxSizes:o,disableBackfill:n,status:d,lazyLoadPx:s,refreshDelay:a,contentExtraCLS:r,vPos:l,anchor:c,adTemplate:u,customSizes:g,clsMaxHeight:w,isFlyingCarpetEnabled:h,isFlyingCarpetSizesEnabled:v,maxHeightFC:y,topValueFC:b,adUnitPathSuffix:T,cdValue:S,customKeyValues:C,divTarget:A,name:I,outOfPage:k,multiFormat:x,disableGPT:_,bypassGPT:P,disableHouseReads:E,forceHouseReads:L,houseReadsSize:D,isFallBack:M,loadType:O}=m;u&&this.sizesFor[u]&&(f=this.sizesFor[u]),k&&(t.outOfPage=k,f=this.sizesFor.outofpage);const R=x?.banner||{customSizes:g,size:i,minMaxSizes:o};if(R.customSizes&&(f=R.customSizes),R.size){const e=R.size;f=f.concat(e.filter(e=>-1===f.indexOf(e)))}R.minMaxSizes&&4===R.minMaxSizes.length&&(f=f.filter(e=>p(e,0,R.minMaxSizes[0],R.minMaxSizes[1])&&p(e,1,R.minMaxSizes[2],R.minMaxSizes[3]))),x&&(x.native&&(f=[["fluid"]],x.nativeSize=e??[300,250]),t.multiFormat=x),n&&(t.disableBackfill=n),E&&(t.disableHouseReads=E),L&&(t.forceHouseReads=L),D&&(t.houseReadsSize=D),0===d&&(t.status=0,document.getElementById(t.divId)&&(document.getElementById(t.divId).classList.remove("optidigital-ad-center-sticky"),document.getElementById(t.divId).style.setProperty("min-height","auto"))),s&&(t.lazyLoadPx=s,t.lazyLoadPxWithCore=s),void 0!==O&&(t.loadType=O),a&&(t.refreshDelay=a),r&&(t.contentExtraCLS=r),l&&(t.vPos=l),c&&(t.anchor=c),w&&Number.isFinite(w)&&(t.clsMaxHeight=w),"boolean"==typeof h&&(t.isFlyingCarpetEnabled=h),"boolean"==typeof v&&(t.isFlyingCarpetSizesEnabled=v),Number.isFinite(y)&&(t.maxHeightFC=y),Number.isFinite(b)&&(t.topValueFC=b),T&&!t.customAdUnitCode&&(t.customAdUnitCode=T),S&&!t.cdValue&&(t.cdValue=S),C&&!t.customKeyValues&&(t.customKeyValues=C),A&&(t.adUnit=I),_&&(t.disableGPT=_),M&&(t.isFallBack=!0),Number.isFinite(P)&&(t.bypassGPT=P,this.gptTrafficRand<P&&(t.disableGPT=!0,window.odT.log(`GPT is disabled for this placement ${t.name}`)))}const{lazyLoadPxGlobal:e,lazyLoadPxWithCoreGlobal:i}=this.setup.adSlotsConfig||{};if("object"!=typeof f)return void window.odT.log(`There is no sizes for ${t.name}`);t.multiFormat?this.setup.adSlotsConfig&&this.setup.adSlotsConfig.multiFormat?.banner[`minMaxSizes${this.screen}`]&&4===this.setup.adSlotsConfig.multiFormat?.banner[`minMaxSizes${this.screen}`].length&&(f=f.filter(e=>p(e,0,this.setup.adSlotsConfig.multiFormat?.banner[`minMaxSizes${this.screen}`][0],this.setup.adSlotsConfig.multiFormat?.banner[`minMaxSizes${this.screen}`][1])&&p(e,1,this.setup.adSlotsConfig.multiFormat?.banner[`minMaxSizes${this.screen}`][2],this.setup.adSlotsConfig.multiFormat?.banner[`minMaxSizes${this.screen}`][3]))):this.setup.adSlotsConfig&&this.setup.adSlotsConfig[`minMaxSizes${this.screen}`]&&4===this.setup.adSlotsConfig[`minMaxSizes${this.screen}`].length&&(f=f.filter(e=>p(e,0,this.setup.adSlotsConfig[`minMaxSizes${this.screen}`][0],this.setup.adSlotsConfig[`minMaxSizes${this.screen}`][1])&&p(e,1,this.setup.adSlotsConfig[`minMaxSizes${this.screen}`][2],this.setup.adSlotsConfig[`minMaxSizes${this.screen}`][3]))),e&&600===t.lazyLoadPx&&(t.lazyLoadPx=e),i&&900===t.lazyLoadPxWithCore&&(t.lazyLoadPxWithCore=i)}const v=this.setup?.adSlotsConfig?.adSlotsDefinitions?.find(e=>e.name===i||e.divTarget&&g(e.divTarget).includes(s)&&w(e)||e.name===t?.adUnit)?.allowAdsOverflow??this.setup?.adSlotsConfig?.allowAdsOverflow??10;if(o>0&&((o=v?o*(1+v/100):o)>=screen.width&&(o=screen.width),f=f.filter(e=>2!==e.length||e[0]<=o||1800===e[0])),("string"==typeof n&&n.endsWith("px")&&parseFloat(n)>0||"number"==typeof n&&n>0)&&(n=parseFloat(n),this.log(`Sizes of ${t.name} were limited to the height of ${n}`),n=v?n*(1+v/100):n,f=f.filter(e=>2!==e.length||e[1]<=n)),l&&!u){const e=this.stickyAdapter.getStickyAdConfigurationBySlotName(i,c);if(e&&e[`fat${this.screen}`]){let e="Desktop"===this.screen?1250:800;if(window.innerHeight>=e){let e="Desktop"===this.screen?[[1e3,250],[970,250],[800,250],[700,250]]:[[320,200],[320,180],[320,150]];f=[...f,...e]}}}u&&(f=this.sizesFor.verticalsticky),l&&!u&&0===f.length&&(f=this.stickyAdapter.getHorizontalSizes());let y=[];const b=Number.isFinite(t.maxHeightFC)?t.maxHeightFC:null;if(t.isFlyingCarpetEnabled&&Number.isFinite(b)){const e=e=>Array.isArray(e)&&2===e.length&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&e[1]>b;if(!0===t.isFlyingCarpetSizesEnabled){const t=this.getUniqueNumericSizes(f.concat(this.sizesFor.flyingcarpet));y=this.getUniqueNumericSizes(t.filter(e)),f=this.getUniqueNumericSizes(t.filter(t=>!e(t)))}else y=this.getUniqueNumericSizes(f.filter(e)),f=this.getUniqueNumericSizes(f.filter(t=>!e(t)))}t.dfpSizes=this.getUniqueNumericSizes(f),t.dfpSizesFC=y,t.biddingSizes=this.getBiddingSizesForSlot(t),void 0!==t.status&&0===t.status||!t.dfpSizes.length||(e[t.name]=t)}insertNewSlot(e,t,i,o){this.mobilePosPostions++,o?(e[`${t.className}${i}`]={...e[o]},e[`${t.className}${i}`].adUnit=`${t.className}`):e[`${t.className}${i}`]={...e[t.className]},e[`${t.className}${i}`].name=`${t.className}${i}`,e[`${t.className}${i}`].divId=`${this.divIdPrefix}${t.className}${i}`,e[`${t.className}${i}`].parentDiv=!1;let n=e[`${t.className}${i}`];n&&n.name&&n.name.startsWith("Mobile_Pos")&&"Mobile"===this.screen&&this.mobileEvenVerticalSizes&&(this.mobilePosPostions%2==0&&n.name?(n.dfpSizes=n.dfpSizes.filter(e=>!this.sizesForMobilePos.some(t=>JSON.stringify(t)===JSON.stringify(e))),n.dfpSizes=[...n.dfpSizes,...this.sizesForMobilePos]):n.dfpSizes=n.dfpSizes.filter(e=>!this.sizesForMobilePos.some(t=>JSON.stringify(t)===JSON.stringify(e)))),n.biddingSizes=this.getBiddingSizesForSlot(n),t.setAttribute("id",e[`${t.className}${i}`].divId),this.adslotInit([e[`${t.className}${i}`]]),!this.lazyLoadPendingAdSlots.includes(e[`${t.className}${i}`].name)&&window?.odT?.monitorLazyLoadCalled&&(this.lazyLoadPendingAdSlots.push(e[`${t.className}${i}`].name),this.monitorLazyLoadAdSlots(e[`${t.className}${i}`].name))}addNewAdSlot(e){let t,i;if(e&&"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length)({foundEl:t,selector:i}=e);else{if(!(e&&e instanceof HTMLElement))return;t=e}let o=t.getAttribute("id");const{adSlotsDefinitions:n}=window.odT.finalAdSlotsConfig,d=window.odT?.setup?.adSlotsConfig?.adSlotsDefinitions?.filter(e=>e?.divTarget?.includes(i)||e?.divTarget?.includes(`#${i}`)||e?.divTarget?.includes(`.${i}`));if(document.getElementById(o)){if(!Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).some(e=>e.divId.replace(window.odT.divIdPrefix,"")===o.replace(window.odT.divIdPrefix,""))){window.odT.log("New element with ID",t);let e=o.replace(window.odT.divIdPrefix,"");const i=t.parentElement?getComputedStyle(t.parentElement)&&getComputedStyle(t.parentElement)["max-height"]:"";let d,s={};s.name=e,s.adUnit=e,s.divId=o,s.parentDiv=!0,s.loadType=1,s.lazyLoadPx=600,s.lazyLoadPxWithCore=900,s.dfpSizes={},d="Mobile"!==window.odT.screen||window.odT.setup?.adSlotsConfig?.useParentWidth?t.getBoundingClientRect().width&&t.getBoundingClientRect().width>0?t.getBoundingClientRect().width:t.parentElement?t.parentElement.getBoundingClientRect().width:0:screen.width,window.odT.setAdSlotParams(n,s,e,d,i,!1,s.divId),n[s.name]&&(window.odT.adslotInit([n[s.name]]),!window.odT.lazyLoadPendingAdSlots.includes(n[s.name].name)&&window?.odT?.monitorLazyLoadCalled&&(window.odT.lazyLoadPendingAdSlots.push(n[s.name].name),window.odT.monitorLazyLoadAdSlots(n[s.name].name)))}}else{window.odT.log("New element",t);const e="Desktop"===window.odT.screen?/(Billboard_|Mobile_|Content_|HalfpageAd_|Rectangle_|Wallpaper_)\w+/:/(Mobile_)\w+/,o=t.className.match(e);o&&(t.className=o[0]);let s=2;if(n[t.className]){s=`_${Object.keys(window.odT.finalAdSlotsConfig.adSlotsDefinitions).filter(e=>e.startsWith(t.className)).length}`,void 0!==n[t.className]&&0===n[t.className].status||window.odT.insertNewSlot(n,t,s)}else if(Array.isArray(d)&&d.length){const e=d?.[0]?.name;if(!e)return;let o=Object.keys(window.odT.finalAdSlotsConfig.adSlotsDefinitions).filter(t=>t.startsWith(e)).length;s=o>0?`_${o+1}`:"";const a=t.parentElement?getComputedStyle(t.parentElement)&&getComputedStyle(t.parentElement)["max-height"]:"";let r,l={};l.name=`${e}${s}`,l.adUnit=`${e}`,l.divId=`${window.odT.divIdPrefix}${e}${s}`,l.parentDiv=!0,l.loadType=1,l.lazyLoadPx=600,l.lazyLoadPxWithCore=900,l.dfpSizes={},r="Mobile"!==window.odT.screen||window.odT.setup?.adSlotsConfig?.useParentWidth?t.getBoundingClientRect().width&&t.getBoundingClientRect().width>0?t.getBoundingClientRect().width:t.parentElement?t.parentElement.getBoundingClientRect().width:0:screen.width,window.odT.setAdSlotParams(n,l,i,r,a,!1,l.divId),n[l.name]&&(t.setAttribute("id",n[l.name].divId),window.odT.adslotInit([n[l.name]]),!window.odT.lazyLoadPendingAdSlots.includes(n[l.name].name)&&window?.odT?.monitorLazyLoadCalled&&(window.odT.lazyLoadPendingAdSlots.push(n[l.name].name),window.odT.monitorLazyLoadAdSlots(n[l.name].name)))}else{let e=window.odT.tools.hasNameInObject(window.odT.finalAdSlotsConfig.adSlotsDefinitions,`${t.className}_`),i=Object.keys(window.odT.finalAdSlotsConfig.adSlotsDefinitions).filter(e=>e.startsWith(t.className)).length;s=e?`_${i}`:"";const o=t.parentElement?getComputedStyle(t.parentElement)&&getComputedStyle(t.parentElement)["max-height"]:"";let d,a={};a.name=`${t.className}${s}`,a.adUnit=`${t.className}`,a.divId=`${window.odT.divIdPrefix}${t.className}${s}`,a.parentDiv=!0,a.loadType=1,a.lazyLoadPx=600,a.lazyLoadPxWithCore=900,a.dfpSizes={},d="Mobile"!==window.odT.screen||window.odT.setup?.adSlotsConfig?.useParentWidth?t.getBoundingClientRect().width&&t.getBoundingClientRect().width>0?t.getBoundingClientRect().width:t.parentElement?t.parentElement.getBoundingClientRect().width:0:screen.width,window.odT.setAdSlotParams(n,a,t.className,d,o,!1,a.divId),n[a.name]&&(t.setAttribute("id",n[`${t.className}${s}`].divId),window.odT.adslotInit([n[`${t.className}${s}`]]),!window.odT.lazyLoadPendingAdSlots.includes(n[`${t.className}${s}`].name)&&window?.odT?.monitorLazyLoadCalled&&(window.odT.lazyLoadPendingAdSlots.push(n[`${t.className}${s}`].name),window.odT.monitorLazyLoadAdSlots(n[`${t.className}${s}`].name)))}}}handleRewardedAdsCropping(){if(!this.setup?.adSlotsConfig?.rewardedAdConfiguration||!this.setup?.adSlotsConfig?.rewardedAdConfiguration?.enableForArticles||!this.adAdaptersFactory.rewardedAdsAdapter.checkRewardedAdFrequency())return;let e=this.setup?.adSlotsConfig?.rewardedAdConfiguration;window.odT.rewardedAdContentSelector=e?.articleContentSelector||"article";const t=e?.contentOffset;let i=e?.blurLastParagraphs;const o=e?.blurInPercentage||.2,n=e?.minParagraphs||10,d=e?.minParagraphsHeight||500,s=e?.excludedElements||{},a=e?.blurLayerZIndex||2147483646,r=e?.minAreaToBlur||!1,l=e?.blurRatio||8,c=e?.customTagName||"P";let u=document.querySelector(window.odT.rewardedAdContentSelector);if(!u)return void window.odT.log("Rewarded ad: Content selector not found");window.odT.analytics.enablePerformances&&window.odT.analytics.isSamplingCase()&&"Chrome"===window.odT.checkBrowser&&!0===window.odT.analytics.isFirstAd&&window.odT.analytics.setContentMetrics();let p=u.scrollHeight,g=Array.from(u.children);i&&i>g.length&&(i=g.length);let w=-1,h=0,f=-1,m=0;const v="number"==typeof i?p:t?p*(.8-t):p*o,y=g.length-1;"number"==typeof i&&g.length;for(let e=y;e>=0;e--)if(h+=g[e].offsetHeight,g[e].tagName===c)if("number"==typeof i&&m<i)m++,w=e;else{if(!(0===m&&h<=v))break;w=e}if(Object.keys(s).length){h=0;const e={},t=Object.keys(s),i={};for(let o=y;o>=0;o--){const n=g[o],d=n.id,a=n.classList;h+=n.offsetHeight;for(const r of t){if(e[r]>=(s[r]||1))continue;(r.startsWith(".")?a.contains(r.slice(1)):r.startsWith("#")?d===r.slice(1):d===r||a.contains(r))&&(e[r]=(e[r]||0)+1,i[r]={index:o+1,acc:h-n.offsetHeight})}}Object.keys(i).length&&(f=Math.max(...Object.values(i).map(e=>e.index)),h=Math.min(...Object.values(i).map(e=>e.acc)))}if(w=w>f?w:f,r&&h>=r&&(e.enableBlur=!0),g.length<=n)return void window.odT.log("Rewarded ad: Not enough paragraphs");if(p<=d)return void window.odT.log("Rewarded ad: Content height is less than minimum required");if(-1===w)return void window.odT.log("Rewarded ad: No suitable cut-off index found");const b=t=>{let i;return e?.consentHTML&&(i=document.createElement("div"),i.id="od_rwdad_consent_container",i.innerHTML=e?.consentHTML,e?.rewardedContainer?.style&&Object.keys(e?.rewardedContainer?.style).forEach(t=>{i.style[t]=e?.rewardedContainer?.style[t]}),t.appendChild(i)),i},T=(t,i=!1,o=!1)=>{let n,d=!0;document.querySelector("#od_rwdad_enable_reward_ad")?n=document.querySelector("#od_rwdad_enable_reward_ad"):(n=document.createElement("button"),d=!1),n.type="button",n.id="od_rwdad_enable_reward_ad",n.className=e?.readMoreButton?.className||"mx-auto btn-inscription-newsletter btn btn-secondary",n.textContent=e?.readMoreButton?.textContent||"Read more";const s=e?.readMoreButton?.bottomPosition||"135px",r=e?.readMoreButton?.spinColor||"#fff";if(e?.readMoreButton?.style&&Object.keys(e?.readMoreButton?.style).forEach(t=>{n.style[t]=e?.readMoreButton?.style[t]}),!d&&n&&t.appendChild(n),!document.getElementById("od-blur-overlay-style")){const t=document.createElement("style");t.id="od-blur-overlay-style",t.textContent=`\n          .od-loading { position: relative; color: transparent !important; pointer-events: none; user-select: none; }\n          .od-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 1em; height: 1em; margin: -0.5em 0 0 -0.5em; border: 2px solid ${r}; border-top: 2px solid transparent; border-radius: 50%; animation: spin 0.6s linear infinite; background-color: transparent; }\n          @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n        `,e?.enableBlur&&(t.textContent+=`\n            #od_rwdad_consent_container { visibility: hidden; opacity: 0; position: fixed; left: ${i.left}px; right: 0; bottom: ${s}; width: ${i.width}px; z-index: 2147483646; display: flex; justify-content: center; align-items: center; transition: visibility .3s, opacity 0.3s linear; }\n            .od-blur-overlay { position: absolute; left: -15px; right: 0; top: ${o}px; bottom: 0; width: calc(100% + 30px); height: calc(100% - ${o}px); pointer-events: all; backdrop-filter: blur(${l}px); z-index: ${a}; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; transition: visibility .3s, opacity 0.3s linear; }\n          `),document.head.appendChild(t)}};if(e?.enableBlur){let e=g[w];if(!e)return void window.odT.log("Rewarded ad: No suitable overlay start element found");const t=u.getBoundingClientRect();let i=e.getBoundingClientRect();if(0===i.top&&0===i.width){e=g[w-1!=-1?w-1:w],i=e.getBoundingClientRect()}const o=i.top-t.top;if(o<0&&0===i.top&&0===i.width)return void window.odT.log("Rewarded ad: Top offset is less than 0");window.odT.hiddenContainer=[];for(let e=g.length-1;e>=w;e--)window.odT.hiddenContainer.push({element:g[e],filter:g[e].style.filter,pointerEvents:g[e].style.pointerEvents}),g[e].style.filter=`blur(${l}px)`,g[e].style.pointerEvents="none";let n=b(document.body);T(n,t,o);const d=()=>{const t=e.getBoundingClientRect(),i=u.getBoundingClientRect(),o=n.getBoundingClientRect(),d=o.bottom-o.height/2;t.top<d&&i.bottom>o.bottom?(n.style.visibility="visible",n.style.opacity="1",n.style.pointerEvents="auto"):(n.style.visibility="hidden",n.style.opacity="0",n.style.pointerEvents="all")};window.addEventListener("scroll",d,{passive:!0})}else{let t=document.createElement("div");if(t.id="od_rwdad_wrapper",0==!document.querySelectorAll(`#${t.id}`).length)return;if(u.parentNode.insertBefore(t,u),e?.enableFade){let i=document.createElement("div");i.id="od_rwdad_fade_container",i.style.maskImage=`linear-gradient(to bottom, rgba(0,0,0,1) ${100-(e?.gradientPercentage||15)}%, rgba(0,0,0,0) 100%)`,i.style.webkitMaskImage=i.style.maskImage,0==document.querySelectorAll(`#${i.id}`).length&&(t.appendChild(i),document.querySelector(`#${i.id}`).appendChild(u))}else document.querySelector(`#${t.id}`).appendChild(u);window.odT.hiddenContainer=[];for(let e=g.length-1;e>=w;e--)window.odT.hiddenContainer.push({element:g[e],display:g[e].style.display}),g[e].style.display="none";b(t),T(t)}if(window.odT.rewardedAdReady=!0,e?.articleLeftToRead&&document.querySelector(".od_article_left_to_read")){const e=parseInt(h/p*100);e>=40?document.querySelector(".od_article_left_to_read").innerHTML=e:document.querySelector(".od_article_left_to_read").parentElement.style.display="none"}}handleRewardedAdsUncropping(){if(window.odT.setup?.adSlotsConfig?.rewardedAdConfiguration?.enableForArticles)if(window.odT.setup?.adSlotsConfig?.rewardedAdConfiguration?.enableBlur)window.odT.hiddenContainer.forEach(e=>{e.element.style.filter=e.filter,e.element.style.pointerEvents=e.pointerEvents}),document.querySelector(".od-blur-overlay")&&(document.querySelector(".od-blur-overlay").style.display="none"),document.querySelector("#od_rwdad_consent_container")&&(document.querySelector("#od_rwdad_consent_container").style.display="none"),window.odT.rewardedAdReady=!1,window.odT.refreshAdSlots(window.odT.lazyLoadPendingAdSlotsWithRewarded,"lazy"),window.odT.lazyLoadPendingAdSlotsWithRewarded=[];else if(window.odT.hiddenContainer.forEach(e=>{e.element.style.display=e.display}),document.querySelector("#od_rwdad_consent_container")&&(document.querySelector("#od_rwdad_consent_container").style.display="none"),document.querySelector("#od_rwdad_enable_reward_ad")&&(document.querySelector("#od_rwdad_enable_reward_ad").style.display="none"),window.odT.setup?.adSlotsConfig?.rewardedAdConfiguration?.enableFade){let e=document.querySelector("#od_rwdad_fade_container");e&&(e.style.maskImage="none",e.style.webkitMaskImage="none")}}getMinHeight(e,t,i){let o=0;for(const t of e){if(2===t.length&&1e3===t[1]&&!i){o=0;break}2===t.length&&1e3===t[1]&&i||2===t.length&&t[1]>0&&t[1]>o&&(o=t[1])}return t?Math.min(o,t):o}getMaxWidth(e){let t=0;for(let i=0;i<e.length;i++)2==e[i].length&&e[i][0]>t&&this.prebidSizes.some(t=>e[i].every((e,i)=>e===t[i]))&&(t=e[i][0]);return t}adslotInit(e){this.log("Initialize adslot CSS");let t=e||this.finalAdSlotsConfig.adSlotsDefinitions;for(const i of Object.values(t))if("object"==typeof i){const t=document.getElementById(i.divId);if(null!=t){if(t.closest('[data-optidigital-slot="true"]'))continue;let o=!1;if(i.dfpSizes&&i.dfpSizes.length){let e=i.dfpSizes,t=[[1,1],[1800,1e3]];e=e.filter(e=>!t.some(t=>t[0]===e[0]&&t[1]===e[1])),e.length||(o=!0)}let n=!(!this.setup.adLayoutEnabled||o||this.setup?.adLayoutConfig?.excludedAdslots?.includes(i.name)||this.setup?.adLayoutConfig?.excludedAdslots?.includes(i.adUnit)||this.stickyAdapter.isVerticalStickyAdSlot(i.adUnit)),d=i.vPos||"center",s=i.clsMaxHeight||null,a=i.loadType,r=5===a||9===a||i.outOfPage?null:this.getMinHeight(i.dfpSizes,s,n);if(i.hasOwnProperty("contentExtraCLS")&&parseFloat(i.contentExtraCLS)>0?r+=i.contentExtraCLS:this.setup.hasOwnProperty("adSlotsConfig")&&this.setup.adSlotsConfig.hasOwnProperty("contentExtraCLS")&&parseFloat(this.setup.adSlotsConfig.contentExtraCLS)>0&&(i.adUnit.toLowerCase().includes("content_")||i.adUnit.toLowerCase().includes("mobile_pos")||i.adUnit.toLowerCase().includes("mobile_ai"))&&(r+=parseFloat(this.setup.adSlotsConfig.contentExtraCLS)),!i.vPos&&this.setup.hasOwnProperty("adSlotsConfig")&&this.setup.adSlotsConfig.hasOwnProperty("contentExtraCLS")&&parseFloat(this.setup.adSlotsConfig.contentExtraCLS)>0&&(i.adUnit.toLowerCase().includes("content_")||i.adUnit.toLowerCase().includes("mobile_pos")||i.adUnit.toLowerCase().includes("mobile_ai"))&&(d="top"),n){let o;const n=this.stickyAdapter.getStickyAdSlotNameFromDivId(t.id);if(!n||"left"!==this.stickyAdapter.getStickyAdMode(n)&&"right"!==this.stickyAdapter.getStickyAdMode(n))o=this.getMaxWidth(i.dfpSizes);else if(i.dfpSizes&&i.dfpSizes.length>0){let e=!1;for(let t of i.dfpSizes)if(Array.isArray(t)&&2===t.length&&t[1]>t[0]){o=t[0],e=!0;break}e||(o=300)}else o=300;let s=this.setup.adLayoutConfig?this.setup.adLayoutConfig:{};e&&t.setAttribute("style",""),this.adLayoutAdapter.setAdLayout(s,t,r,o,i,d,a)}else{if(r>1){e&&t.setAttribute("style",""),this.log("CLS size for "+i.name+" => "+r+"px");const o=document.createElement("div"),n=`min-height: ${r}px; display: flex; flex-direction: column; justify-content: ${"center"===d?"center":"start"}; align-items: center; margin: auto;`;o.setAttribute("style",n),o.setAttribute("data-optidigital-slot","true"),o.classList.add("optidigital-wrapper-div"),t.parentNode.insertBefore(o,t),o.appendChild(t);const s=Boolean(i?.isFlyingCarpetEnabled),a=this.adLayoutAdapter.resolveSlotKey(t);s&&this.adLayoutAdapter.createFlyingCarpetWrappers(t,o,a,i)}else{t.parentElement?.setAttribute("data-optidigital-slot","true"),this.log("CLS size for "+i.adUnit+" => 0 => NO PARENT DIV");Boolean(i?.isFlyingCarpetEnabled)&&(this.log("Disabling Flying carpet for "+i.adUnit+" "),i.isFlyingCarpetEnabled=!1)}i.parentDiv=!0}}}this.log("Finish ad slot initialization"),this.layoutReady=!0,this.CMPready&&!e?this.runAuction("layoutReady"):!1===this.CMPready&&this.loadOdas(this.runOdasAuction)}checkVendor(e){let t=!1;return this.consentV2TCData&&this.consentV2TCData.hasOwnProperty("vendor")&&this.consentV2TCData.vendor.hasOwnProperty("consents")&&this.consentV2TCData.vendor.consents.hasOwnProperty(e)&&this.consentV2TCData.vendor.consents[e]&&(t=!0),t}consentCheckHBVendors(){let e=!1,t="CMP vendors MISSING: ",i=[{id:755,name:"google"},{id:915,name:"optidigital"},{id:32,name:"xandr"},{id:52,name:"magnite"},{id:45,name:"smart"},{id:91,name:"criteo"},{id:132,name:"teads"},{id:436,name:"invibes"},{id:793,name:"amazon"},{id:28,name:"triplelift"},{id:76,name:"pubmatic"},{id:259,name:"adyoulike"},{id:108,name:"richaudience"},{id:157,name:"seedtag"},{id:164,name:"outbrain"}],o=0;for(let e=0;e<i.length;e++)this.consentV2TCData.vendor.consents.hasOwnProperty(i[e].id)&&1==this.consentV2TCData.vendor.consents[i[e].id]?(o++,t+=`${i[e].name}_OK,`):t+=`${i[e].name}_KO,`;return o==i.length&&(e=!0,t=t.replace("MISSING","OK")),this.log(t),e}checkRejectAll(e){let t=!1,i=0,o=0;for(let t in e)"boolean"==typeof e[t]&&(i++,0==e[t]&&o++);return o==i&&(t=!0),t}analyzeConsentV2(){const e=this.consentV2TCData;if(!e||"object"!=typeof e)return;const{gdprApplies:t,purpose:i,vendor:o}=e;if(t&&i&&i.consents&&o&&o.consents&&o.legitimateInterests)if(t)if(this.checkRejectAll(i.consents))if(this.checkRejectAll(i.legitimateInterests))this.consentStatus="CMPv2_RejectALL";else if(!0===o.legitimateInterests[755]){[2,7,9,10].every(e=>!0===i.legitimateInterests[e])?(this.consentType="li",this.consentCheckHBVendors()?this.consentStatus="CMPv2_LAokHBok":this.consentStatus="CMPv2_LAokHBko"):this.consentStatus="CMPv2_LAko"}else this.consentStatus="CMPv2_LAMmv";else if(o.consents.hasOwnProperty("755")&&!0===o.consents[755]){const e=[2,7,9,10].every(e=>i.consents.hasOwnProperty(e)&&!0===i.consents[e]||i.legitimateInterests.hasOwnProperty(e)&&!0===i.legitimateInterests[e]);i.consents.hasOwnProperty(1)&&!0===i.consents[1]&&e?(this.consentType="ok",!0===i.consents[3]&&!0===i.consents[4]?this.consentCheckHBVendors()?this.consentStatus="CMPv2_GAMokHBok":this.consentStatus="CMPv2_GAMokHBko":!0===this.consentCheckHBVendors()?this.consentStatus="CMPv2_GAMnpHBok":this.consentStatus="CMPv2_GAMnpHBko"):this.consentStatus="CMPv2_GAMko"}else this.consentStatus="CMPv2_GAMmv";else this.consentStatus="CMPv2_OOS",this.consentType="ok";else this.consentStatus="CMPv2_invalid"}loadConfig(e){if(window!==window.top&&(this.tagMode=!0),"object"==typeof window.top.location&&window.top.location.hasOwnProperty("search")){const e=window.top.location.search;(e.includes("optidigital_debug=true")||!0===window.optidigital_debug)&&(this.debug=!0),e.includes("optidigital_debug_wallpaper=true")&&(this.debugWallpaper=!0,this.debugBidderDiscount=100),e.includes("optidigital_gamenv=test")&&(this.GAMEnv="test"),(e.includes("optidigital_fanalytics=true")||1==window.optidigital_fanalytics)&&(this.forceAnalytics=!0),e.includes("optidigital_fdload=true")&&(this.forceDload=!0),e.includes("optidigital_aicontent=true")&&(this.forceAiContent=!0)}this.setup=e,this.log("Load setup file and page configuration"),this.setup?.testGroup&&(this.testGroup=this.setup.testGroup,this.log(`Test group sampling is ${this.setup.sampling}`),this.log(`Test config revision is ${this.setup.info.revision}`));let t=document.getElementById("optidigital-ad-init");if(null!==t){let e=t.getAttribute("config");if(null==e&&(e=t.getAttribute("data-config")),e)try{this.initConfig=JSON.parse(e)}catch(t){let i=e;i=i.replace(",]","]"),this.log("Invalid JSON input => fixed "+t.message);try{this.initConfig=JSON.parse(i)}catch(e){this.log("Invalid JSON input => load error adUnit "),this.setup.hasOwnProperty("adUnitError")&&(this.initConfig={adUnit:this.setup.adUnitError})}}else this.setup.hasOwnProperty("adUnitError")&&(this.initConfig={adUnit:this.setup.adUnitError});let i=t.getAttribute("src");i.length>0&&(this.siteCode=i.substring(i.indexOf("site=")+5),-1!=this.siteCode.indexOf("&")&&(this.siteCode=this.siteCode.slice(0,this.siteCode.indexOf("&"))),this.log("Script site code => "+this.siteCode)),this.log("Opti Digital script config",this.initConfig)}else this.log("No script with id:optidigital-ad-init","error"),this.setup.hasOwnProperty("adUnitError")&&(this.initConfig={adUnit:this.setup.adUnitError});if(!(this.setup?.info?.publisherId&&this.setup?.info?.networkId&&this.setup?.info?.siteId&&this.setup?.info?.revision))return void this.log("No setup info");if(this.setup.hasOwnProperty("info")&&this.setup.info.hasOwnProperty("revision")&&this.log("PUBLIHSER:"+this.setup.info.publisherId+" - SITE:"+this.setup.info.siteId+" - REVISION:"+this.setup.info.revision),this.setup.info.hasOwnProperty("odNetworkId")&&this.setup.info.odNetworkId&&(this.odNetworkId=this.setup.info.odNetworkId),this.setup?.breakpoint&&(this.screen=window.top?window.top.document.documentElement.clientWidth<this.setup.breakpoint?"Mobile":"Desktop":document.documentElement.clientWidth<this.setup.breakpoint?"Mobile":"Desktop"),this.setup.hasOwnProperty("publisherInit")&&"function"==typeof this.setup.publisherInit)try{this.setup.publisherInit(this.initConfig)}catch(e){this.log("Error in publisherInit function",e,!0)}if(this.setup.hasOwnProperty("publisherInitStart")&&"function"==typeof this.setup.publisherInitStart)try{this.setup.publisherInitStart(this.initConfig)}catch(e){this.log("Error in publisherInitStart function",e,!0)}if(this.setup.hasOwnProperty("oyStatus")&&(this.oyStatus=this.setup.oyStatus),this.setup&&this.setup.hasOwnProperty("enableCookieConsent")&&(this.enableCookieConsent=this.setup.enableCookieConsent),this.setup.hasOwnProperty("enableArticleReporting")&&(this.enableArticleReporting=this.setup.enableArticleReporting),this.setup.hasOwnProperty("iasId")&&(this.iasId=this.setup.iasId),this.enableArticleReporting){let e=window.location.protocol+"//"+window.location.host+window.location.pathname;e.length>0&&(this.articleID=this.cyrb53(e,100)),this.setup.hasOwnProperty("enableArticleReportingKey")&&this.initConfig.hasOwnProperty("pageTargeting")&&this.initConfig.pageTargeting.hasOwnProperty(this.setup.enableArticleReportingKey)&&(this.articleID=this.initConfig.pageTargeting[this.setup.enableArticleReportingKey],this.log("Custom reporting key: "+this.setup.enableArticleReportingKey+" with value: "+this.articleID))}if(this.setup.hasOwnProperty("enableSourceReporting")&&(this.enableSourceReporting=this.setup.enableSourceReporting),this.enableSourceReporting){let e=document.referrer,t="direct_traffic";if(this.setup.hasOwnProperty("sourceCampaignTrackers")&&this.setup.sourceCampaignTrackers.length>0)for(let e in this.setup.sourceCampaignTrackers)if(-1!=window.location.search.indexOf(this.setup.sourceCampaignTrackers[e])){this.sourceID=this.cyrb53(this.setup.sourceCampaignTrackers[e],100),this.log("Source campaign: "+this.setup.sourceCampaignTrackers[e]);break}if(0==this.sourceID){if(e.length>0){let e=document.createElement("a");e.href=document.referrer,t=-1!=this.sourceDomains.indexOf(e.hostname)||this.setup.hasOwnProperty("sourceDomains")&&-1!=this.setup.sourceDomains.indexOf(e.hostname)?e.hostname:"referrer_unknown"}this.sourceID=this.cyrb53(t,100)}}this.setup.hasOwnProperty("enableLimitedAds")&&(this.enableLimitedAds=this.setup.enableLimitedAds),this.enableLimitedAds&&(this.consentStatusNoGAM=this.consentStatusNoGAMButLA,this.limitedAds=!0),this.setup.hasOwnProperty("targetingODBidder")&&1==this.setup.targetingODBidder&&(this.targetingPrebidPB="odtag_pb",this.targetingODBidder=!0),this.setup.hasOwnProperty("engageBackfill")&&!1===this.setup.engageBackfill&&(this.engageBackfill=!1),this.setup?.adSlotsConfig?.houseReads?.[`enabled${this.screen}`]&&(this.houseReads=this.setup?.adSlotsConfig?.houseReads?.[`enabled${this.screen}`]),this.setup.hasOwnProperty("infiniteScrollWallpaperSlot")&&(this.infiniteScrollWallpaperSlot=this.setup.infiniteScrollWallpaperSlot),this.setup.hasOwnProperty("mobileEvenVerticalSizes")&&this.setup.mobileEvenVerticalSizes&&(this.mobileEvenVerticalSizes=!0),this.setup.hasOwnProperty("enableGpid")&&!1===this.setup.enableGpid&&(this.enableGpid=!1),this.setup.hasOwnProperty("noGamUseSafeframe")&&(this.noGamUseSafeframe=this.setup.noGamUseSafeframe),this.deviceDetection(),this.checkBrowser=this.tools.detectBrowser(),this.checkOs=this.tools.detectOS(),"Safari"!==this.checkBrowser&&"Firefox"!==this.checkBrowser||(this.customDNR=!1);let i=this.setup.pageViewEventTimeout||0===this.setup.pageViewEventTimeout?this.setup.pageViewEventTimeout:1e3;setTimeout(()=>{window.odT.consentV2TCData||window.odT.consentCMPUIShown||!window.optidigitalToolboxGdpr||"timeout_tcfapi"===window.odT.consentType||window.odT.analytics.pageViewEvent({firstCall:!0})},i);const o=this.setup?.adSlotsConfig?.stickyAdConfiguration||this.setup?.stickyAdConfiguration;if(o&&"object"==typeof o){!Object.keys(o).some(e=>e.includes(`${this.screen}_Sticky_`))&&o.hasOwnProperty("frequency")&&o.hasOwnProperty("frequencyImps")&&o.hasOwnProperty("frequencyInterval")&&(this.stickyFrequency=o.frequency,this.stickyFrequencyImps=o.frequencyImps,this.stickyFrequencyInterval=o.frequencyInterval)}this.setup.hasOwnProperty("adSlotsConfig")&&this.setup.adSlotsConfig.hasOwnProperty("rewardedAdConfiguration")&&this.setup.adSlotsConfig.rewardedAdConfiguration.hasOwnProperty("frequency")&&this.setup.adSlotsConfig.rewardedAdConfiguration.hasOwnProperty("frequencyImps")&&this.setup.adSlotsConfig.rewardedAdConfiguration.hasOwnProperty("frequencyInterval")&&(this.rewardedAdFrequency=this.setup.adSlotsConfig.rewardedAdConfiguration.frequency,this.rewardedAdFrequencyImps=this.setup.adSlotsConfig.rewardedAdConfiguration.frequencyImps,this.rewardedAdFrequencyInterval=this.setup.adSlotsConfig.rewardedAdConfiguration.frequencyInterval),this.setup.hasOwnProperty("enableOdas")&&this.setup.enableOdas.includes("ok")&&(this.setup.enableOdas=[...this.setup.enableOdas,"timeout_callback","timeout_tcfapi"]),window.top.addEventListener("blur",function(){window.odT.log("Window blur"),window.setTimeout(function(){"iframe"==document.activeElement.tagName.toLowerCase()?window.odT.windowStatus=1:window.odT.windowStatus=0},0)}),window.top.addEventListener("focus",function(){window.odT.windowStatus=1,window.odT.log("Window focus")}),window.top.document.addEventListener("visibilitychange",e=>{window.odT.analytics.enablePerformances&&window.odT.analytics.isSamplingCase()&&"Chrome"===window.odT.checkBrowser&&"hidden"===document.visibilityState&&!window.odT.analytics.userPerformanceSent&&(window.odT.log("Sending user performances analytics on visibility change",window.odT.analytics.userPerformances),"ko"!==window.odT.consentType&&window.odT.consentCMPUIShown?window.odT.analytics.pageViewEvent({isUserPerformanceCall:!0,sendBeacon:!0,userAction:!0}):window.odT.analytics.pageViewEvent({isUserPerformanceCall:!0,sendBeacon:!0})),"visible"!==document.visibilityState&&(window.odT.windowStatus=0,window.odT.log("Window not visible"))}),window.addEventListener("mousedown",e=>{window.odT.userAction.includes(e.type)||window.odT.userAction.push(e.type)}),window.addEventListener("mousemove",e=>{window.odT.userAction.includes(e.type)||window.odT.userAction.push(e.type)}),window.addEventListener("touchstart",e=>{window.odT.userAction.includes(e.type)||window.odT.userAction.push(e.type)}),window.addEventListener("scroll",e=>{window.odT.userAction.includes(e.type)||window.odT.userAction.push(e.type)},{passive:!0})}getInfiniteScrollDPFSizes(e){return e.filter(function(e){let t=!1;return void 0!==e&&1800!=e[0]&&(t=!0),t})}setFrequency(e){this.adAdaptersFactory.rewardedAdsAdapter.setFrequency(e)}createRewardedAdSlot(e=this.screen+"_RewardedAd"){window.googletag.cmd.push(function(){try{if(window.odT?.finalAdSlotsConfig?.adSlotsDefinitions)window.odT.adAdaptersFactory.rewardedAdsAdapter.createRewardedAdSlot(e,!0);else{let t=0;const i=50,o=setInterval(function(){t+=i,window.odT?.finalAdSlotsConfig?.adSlotsDefinitions?(clearInterval(o),window.odT.adAdaptersFactory.rewardedAdsAdapter.createRewardedAdSlot(e,!0)):t>=window.odT.rewardedAdTimeout&&(clearInterval(o),window.odT.log(`Rewarded AD] Ad slots definitions still not defined after ${window.odT.rewardedAdTimeout}ms, failed to create slot: ${e}`))},i)}}catch(t){window.odT.log(`[Rewarded AD] Failed to create rewarded ad slot "${e}"`,t)}})}defineSlots(e){const{adSlotsDefinitions:t}=this.finalAdSlotsConfig,{adSlotsConfig:i}=this.setup;for(let o in e)if(!this.gptAdSlots.hasOwnProperty(e[o])&&t.hasOwnProperty(e[o])&&!this.isGPTdisabledForSlot(t[e[o]].name)&&!this.setup.disableGPT){let n=i&&i.adManagerKeyName?i.adManagerKeyName:this.setup?.customTargeting?.adslot?.name?this.setup.customTargeting.adslot.name:"adslot";if(6==t[e[o]].loadType){let i=window.googletag.defineOutOfPageSlot(`${this.initConfig.adUnit}${t[e[o]].customAdUnitCode?"/"+t[e[o]].customAdUnitCode:""}`,window.googletag.enums.OutOfPageFormat.INTERSTITIAL);if(i){if(i.setConfig({targeting:{[n]:t[e[o]].cdValue?t[e[o]].cdValue:t[e[o]].adUnit}}),i.addService(window.googletag.pubads()),t[e[o]].customKeyValues)for(let n in t[e[o]].customKeyValues)i.setConfig({targeting:{[n]:t[e[o]].customKeyValues[n]}});this.gptAdSlots[t[e[o]].name]=i,this.log("Created INTERSTITIAL adslot "+e[o])}else this.log("FAILED to create INTERSTITIAL adslot "+e[o]);continue}if(7==t[e[o]].loadType&&(e[o].toLowerCase().includes("siderail_left")||e[o].toLowerCase().includes(window.odT.setup?.adSlotsConfig?.sideRailsConfig?.nameSiderailLeft?.toLowerCase()))){let i=googletag.defineOutOfPageSlot(`${this.initConfig.adUnit}${t[e[o]].customAdUnitCode?"/"+t[e[o]].customAdUnitCode:""}`,googletag.enums.OutOfPageFormat.LEFT_SIDE_RAIL);if(i){if(i.setConfig({targeting:{[n]:t[e[o]].cdValue?t[e[o]].cdValue:t[e[o]].adUnit}}),i.addService(googletag.pubads()),t[e[o]].customKeyValues)for(let n in t[e[o]].customKeyValues)i.setConfig({targeting:{[n]:t[e[o]].customKeyValues[n]}});this.gptAdSlots[t[e[o]].name]=i,this.log("Created SIDE RAIL LEFT adslot "+e[o])}else this.log("FAILED to create SIDE RAIL LEFT adslot "+e[o]);continue}if(7==t[e[o]].loadType&&(e[o].toLowerCase().includes("siderail_right")||e[o].toLowerCase().includes(window.odT.setup?.adSlotsConfig?.sideRailsConfig?.nameSiderailRight?.toLowerCase()))){let i=googletag.defineOutOfPageSlot(`${this.initConfig.adUnit}${t[e[o]].customAdUnitCode?"/"+t[e[o]].customAdUnitCode:""}`,googletag.enums.OutOfPageFormat.RIGHT_SIDE_RAIL);if(i){if(i.setConfig({targeting:{[n]:t[e[o]].cdValue?t[e[o]].cdValue:t[e[o]].adUnit}}),i.addService(googletag.pubads()),t[e[o]].customKeyValues)for(let n in t[e[o]].customKeyValues)i.setConfig({targeting:{[n]:t[e[o]].customKeyValues[n]}});this.gptAdSlots[t[e[o]].name]=i,this.log("Created SIDE RAIL RIGHT adslot "+e[o])}else this.log("FAILED to create SIDE RAIL RIGHT adslot "+e[o]);continue}if(window.odT.setup.hasOwnProperty("adSlotsConfig")&&window.odT.setup.adSlotsConfig.hasOwnProperty("rewardedAdConfiguration"))try{if(this.adAdaptersFactory.rewardedAdsAdapter.createRewardedAdSlot(e[o]))continue}catch(t){this.log("[Rewarded AD] Failed to create rewarded ad slot `"+e[o]+"`",t)}if((-1!=t[e[o]].name.indexOf("OutOfPage")||t[e[o]].outOfPage)&&this.setup.sourceDomains&&"frandroid.com"!=this.setup.sourceDomains[0]&&this.setup.sourceDomains&&"numerama.com"!=this.setup.sourceDomains[0])this.gptAdSlots[t[e[o]].name]=window.googletag.defineOutOfPageSlot(`${this.initConfig.adUnit}${t[e[o]].customAdUnitCode?"/"+t[e[o]].customAdUnitCode:""}`,t[e[o]].divId).setConfig({collapseDiv:"ON_NO_FILL",targeting:{[n]:t[e[o]].cdValue?t[e[o]].cdValue:t[e[o]].adUnit}}).addService(window.googletag.pubads());else{let i=!1,d=t[e[o]].dfpSizes;t[e[o]].hasOwnProperty("infiniteScrollId")&&t[e[o]].infiniteScrollId>1&&(d=this.getInfiniteScrollDPFSizes(d),i=!0);const s=document.getElementById(t[e[o]].divId)+"-iframe-odadsrv";null!=s&&null!=s.parentElement&&s.parentElement.removeChild(s);try{if(this.gptAdSlots[t[e[o]].name]=window.googletag.defineSlot(`${this.initConfig.adUnit}${t[e[o]].customAdUnitCode?"/"+t[e[o]].customAdUnitCode:""}`,d,t[e[o]].divId).setConfig({collapseDiv:"ON_NO_FILL",targeting:{[n]:t[e[o]].cdValue?t[e[o]].cdValue:t[e[o]].adUnit}}).addService(window.googletag.pubads()),t[e[o]].customKeyValues)for(let i in t[e[o]].customKeyValues)this.gptAdSlots[t[e[o]].name].setConfig({targeting:{[i]:t[e[o]].customKeyValues[i]}});1==i&&window.odT.setSlotTargeting(this.gptAdSlots[t[e[o]].name],"infinite-scroll","yes")}catch(e){}}}}initPageTargeting(){if(window.odT.initConfig.hasOwnProperty("pageTargeting")&&"object"==typeof window.odT.initConfig.pageTargeting&&null!=window.odT.initConfig.pageTargeting){let e=Object.keys(window.odT.initConfig.pageTargeting);for(let t in e){if("string"!=typeof e[t])continue;let i=window.odT.initConfig.pageTargeting[e[t]];if("number"==typeof i)i=i.toString();else if(Array.isArray(i)&&(i=this.tools.flattenTargetingValues(i).filter(e=>"string"==typeof e||"number"==typeof e).map(e=>"number"==typeof e?e.toString():e),0===i.length))continue;window.odT.setPageTargeting(e[t],i)}}if(window.odT.articleID&&window.odT.setPageTargeting("article_id",window.odT.articleID.toString()),window.odT.sourceID&&window.odT.setPageTargeting("source_id",window.odT.sourceID.toString()),window.odT.testGroup&&"test"==window.odT.testGroup&&window.odT.setPageTargeting("test_group","test"),window.odT.GAMEnv&&"test"==window.odT.GAMEnv&&window.odT.setPageTargeting("optidigital_gamenv","test"),!window.odT.limitedAds||"CMPv2_LAokHBok"!=window.odT.consentStatus&&"CMPv2_LAokHBko"!=window.odT.consentStatus||window.odT.setPageTargeting("od_limitedads","1"),window.odT.setPageTargeting("odtag_status","1"),"Chrome"===window.odT.checkBrowser){let e="0";window.odT.setPageTargeting("od_ccd",e),"cookieDeprecationLabel"in navigator&&navigator.cookieDeprecationLabel.getValue().then(t=>{-1!=t.indexOf("treatment_1.")&&(e="1"),-1!=t.indexOf("control_2")&&(e="2"),window.odT.setPageTargeting("od_ccd",e)})}}isAdslotVisible(e){if(!e&&!e.parentElement)return!1;if(window.odT.setup?.adSlotsConfig?.adSlotsDefinitions){const t=e.getAttribute("id").replace(window.odT.divIdPrefix,""),i=e=>(Array.isArray(e)?e:e?[e]:[]).map(e=>e.startsWith("#")||e.startsWith(".")?e.slice(1):e),o=e=>!("Desktop"===window.odT.screen&&(!e.deviceTarget||e?.deviceTarget?.toLowerCase().includes("mobile")))&&("Mobile"!==window.odT.screen||!e?.deviceTarget?.toLowerCase().includes("desktop")),n=Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).find(e=>e.divId===t),d=window.odT.setup.adSlotsConfig.adSlotsDefinitions.find(e=>e.name===t||e.divTarget&&i(e.divTarget).includes(t)&&o(e)||e.name===n?.adUnit);if(d&&(d?.ignoreParentVisibility||d?.isFlyingCarpetEnabled))return!0}return!(0==e.parentElement.offsetWidth&&0==e.parentElement.offsetHeight)&&"hidden"!==getComputedStyle(e)?.visibility}buildFirstLoadAdSlots(){for(let e of Object.values(this.finalAdSlotsConfig.adSlotsDefinitions)){if(!e.hasOwnProperty("dfpSizes"))continue;const t=e.isFallBack;let i=0,o=0;if(e.hasOwnProperty("loadType")&&(i=e.loadType),e.hasOwnProperty("lazyLoadPx")&&(o=e?.lazyLoadPxWithCore?Math.max(e.lazyLoadPxWithCore,e.lazyLoadPx):e.lazyLoadPx),0==i||this.adAdaptersFactory.isSpecialAdLoadType(i)){const i=this.stickyAdapter.isStickyAdSlot(e.name)&&!window.odT.stickyAdapter.isFallback(e.name)&&0!==(this.stickyAdapter.getStickyAdTopTrigger(e.name)||0);t||i||-1!=this.firstLoadAdSlots.indexOf(e.name)||this.firstLoadAdSlots.push(e.name)}else if(1==i){const i=document.getElementById(e.divId);if(null!=i&&this.isAdslotVisible(i)){const n=i.getBoundingClientRect();this.log(`Position for ${e.name} - top: ${n.top}, innerHeight: ${window.innerHeight}`),n.top>=0&&n.top-window.innerHeight<=o||n.top<0&&Math.abs(n.top)<=o||this.forceDload?t||-1!=this.firstLoadAdSlots.indexOf(e.name)||this.firstLoadAdSlots.push(e.name):t||-1!=this.lazyLoadPendingAdSlots.indexOf(e.name)||this.lazyLoadPendingAdSlots.push(e.name)}else null==i||this.isAdslotVisible(i)||this.notVisibleAdslots.push(e.divId)}}if(window.odT.loadByGroup(window.odT.firstLoadAdSlots),this.log("First ad slots were created"),this.notVisibleAdslots.length){const e=new Map,t=t=>{const i=document.getElementById(t);if(!i)return;const o=i.parentElement;if(!o)return;let n=!1;const d=()=>{if(n)return;n=!0;const d=window?.odT?.finalAdSlotsConfig?.adSlotsDefinitions?Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).find(e=>e.divId===t):null,s=d?d.name:null,a=window?.odT?.analytics?.adSlotsLoadCount?.[t]>0;s&&!a&&(window.odT.lazyLoadPendingAdSlots.push(s),window.odT.monitorLazyLoadAdSlots(s)),window.odT.notVisibleAdslots=window.odT.notVisibleAdslots.filter(e=>e!==t);const r=e.get(t);r&&(r.intersection?.unobserve(i),r.resize?.unobserve(o),e.delete(t))},s=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&e.intersectionRatio>0&&d()})},{threshold:.1}),a=new ResizeObserver(e=>{e.forEach(e=>{const{width:t,height:i}=e.contentRect;t>0&&i>0&&d()})});s.observe(i),a.observe(o),e.set(t,{intersection:s,resize:a})};window.odT.notVisibleAdslots.forEach(t)}window.odT.AIArticles=new g(optidigitaltagsinserter)}createAdStyles(){let e=document.createElement("style");e.type="text/css";let t=".optidigital-ad-center { text-align: center; } .optidigital-ad-center-sticky { text-align: center; width:100%; position: -webkit-sticky; position: sticky; top: 0; }";for(let e of Object.values(this.finalAdSlotsConfig.adSlotsDefinitions))"object"!=typeof e||this.tagMode||(e.adUnit.includes("Content")||e.adUnit.includes("Mobile_Pos")||e.adUnit.includes("Mobile_AI"))&&(t+="."+e.adUnit+"{margin-top: 1em;margin-bottom: 1em;}");e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(e)}getGPTSlots(e){var t=[];for(var i in e)this.gptAdSlots.hasOwnProperty(e[i])&&t.push(this.gptAdSlots[e[i]]);return t}refreshAdSlots(e,t,i){window.odT.setup[`fullPackage${window.odT.screen}`]||"OD"===window.odT.adserver||window?.odT?.dynamicAdslotsCalled||window.odT.loadCore();const o=(e,t,i,o=!1)=>{null!==e&&window.odT.log(`Refresh ad slots - loadType:${t} prebidTimeout: ${i}, slot: ${e}`);window.odT.stickyAdapter.getStickyAdConfigurations();this.stickyAdapter.getStickyNames().forEach(t=>{if(null!==e&&e.includes(`${t}`)){const e=`${window.odT.divIdPrefix}${t}`;if(document.getElementById(`sf_tag_${e}`)||document.getElementById(`${e}-iframe-od`)||document.getElementById(`${e}-iframe-odadsrv`)){const i=document.getElementById(e);if(i){i.style.height=getComputedStyle(i).height,i.innerHTML="";const e=String(t).replace(/[^a-zA-Z0-9]/g,"_"),o=document.getElementsByClassName(`opd_adsticky-scroll_${e}`)[0];o&&(o.style.display="none")}}}}),void 0===t&&(t="manual"),void 0===i&&(i=null);let n=[],d=[],s=window.odT.setup.biddersSetup&&window.odT.setup.timeouts&&window.odT.setup.timeouts.prebidIndirect?window.odT.setup.timeouts.prebidIndirect:1500,a=window.odT.setup.biddersSetup&&window.odT.setup.timeouts&&window.odT.setup.timeouts.failsafe?window.odT.setup.timeouts.failsafe:2500;if(n="string"==typeof e?[e]:e,!window.odT.firstLoadAdSlotsShowed&&window.odT.setup[`fullPackage${window.odT.screen}`]&&(n=n?n.concat(window.odT.firstLoadAdSlots):window.odT.firstLoadAdSlots,window.odT.firstLoadAdSlotsShowed=!0),"OD"==window.odT.adserver&&window.odT.setup.adSlotsConfig&&window.odT.setup.adSlotsConfig.adSlotsDefinitions&&window.odT.setup.adSlotsConfig.adSlotsDefinitions.some(e=>void 0!==e.odZoneId)){let e=[];for(let t=0;t<n.length;t++)for(let i in window.odT.setup.adSlotsConfig.adSlotsDefinitions)if("object"==typeof window.odT.setup.adSlotsConfig.adSlotsDefinitions[i]&&window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odZoneId&&window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odSize&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[n[t]].adUnit==window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].name){let o={adslot:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i]?.cdValue?window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].cdValue:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].name,zoneId:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odZoneId,size:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odSize,divId:window.odT.finalAdSlotsConfig.adSlotsDefinitions[n[t]].divId};e.push(o);break}if(e.length>0){let i=window.odT.customDNR?"1":"0";optidigitalAdsrv.getAds(window.odT.initConfig.adUnit,e,"refresh",window.odT.consentType,window.odT.testGroup,t,!1,i)}return"ok"}for(let e in n)window.odT.finalAdSlotsConfig.adSlotsDefinitions.hasOwnProperty(n[e])&&d.push(n[e]);if(0==d.length)return"error: no matching slot";const r=window.odT.setup.disableGPT?[]:d.filter(e=>!window.odT.isGPTdisabledForSlot(e));if(null!==i&&(s=i),r.length>0&&window.googletag.cmd.push(function(){window.odT.defineSlots(r)}),window.odT.setup?.localDevMockDisplayAds&&r.length>0)return window.googletag.cmd.push(function(){const e=window.odT.getGPTSlots(r);"function"==typeof window.odT.clearRemoteCreativeResizeBySlots&&window.odT.clearRemoteCreativeResizeBySlots(e),window.googletag.pubads().refresh(e)}),"ok";window.odT.setup.hasOwnProperty("prebidIndirectStaticCpm")&&1==window.odT.setup.prebidIndirectStaticCpm&&window.odT.setup.hasOwnProperty("consentData")&&window.odT.setup.consentData.hasOwnProperty("consentData")&&window.odT.setup.consentData.hasOwnProperty("gdprApplies")&&!o&&window.odpbjs.que.push(function(){window.odpbjs.setConfig({consentManagement:{gdpr:{cmpApi:"static",allowAuctionWithoutConsent:!0,consentData:{getTCData:{tcString:window.odT.consentData.consentData,gdprApplies:window.odT.consentData.gdprApplies}}}},cache:{url:"https://pbs.optidigital.com/cache",ignoreBidderCacheKey:!0}})});for(let e in r)window.odT.gptAdSlots.hasOwnProperty(r[e])&&(window.googletag.cmd.push(function(){Object.keys(window.odT.gptAdSlots[r[e]]?.getConfig("targeting")?.targeting||[]).forEach(t=>{t.includes("hb_")&&window.odT.gptAdSlots[r[e]].setConfig({targeting:{[t]:null}})})}),"auto"==t&&window.googletag.cmd.push(function(){window.odT.setSlotTargeting(window.odT.gptAdSlots[r[e]],"auto_refresh","yes")}));return s>0&&!o?window.odTC.executeAPSAndPrebid(s,a,structuredClone(d)):o?window.odT.callPrebidAdapter("refresh",d):r.length>0&&window.googletag.cmd.push(function(){const e=window.odT.getGPTSlots(r);"function"==typeof window.odT.clearRemoteCreativeResizeBySlots&&window.odT.clearRemoteCreativeResizeBySlots(e),window.googletag.pubads().refresh(e)}),"ok"};if(window.odT.loadCoreFinished&&window.odT.userAction.length)o(e,t,i);else if(!window.odT.loadCoreFinished&&window.odT.userAction.length){let n=0;const d=setInterval(()=>{let s=window.odT.setup.loadCoreTimeout?window.odT.setup.loadCoreTimeout:1e3;window.odT.loadCoreFinished?(clearInterval(d),o(e,t,i)):n>s&&(clearInterval(d),o(e,t,i,!0)),n+=50},50)}else o(e,t,i,!0)}monitorAutomaticRefresh(){const{automaticRefresh:e}=this.setup;let t=e&&e.intervalTimeout?e.intervalTimeout:2e3;setInterval(()=>{if(0==window.odT.windowStatus)return!1;if(window.odT?.setup?.refreshAfterUserAction&&!window.odT?.userAction?.length)return!1;const t=new Date,i=Object.keys(window.odT.finalAdSlotsConfig.adSlotsDefinitions);let o=[];for(let n in i){if("string"!=typeof i[n])continue;let d=window.odT.finalAdSlotsConfig.adSlotsDefinitions[i[n]].adUnit,s=window.odT.finalAdSlotsConfig.adSlotsDefinitions[i[n]].divId,a=window.odT.finalAdSlotsConfig.adSlotsDefinitions[i[n]].loadType,r=e&&e.max?e.max:1/0,l=3e4;if(window.odT.finalAdSlotsConfig.adSlotsDefinitions[i[n]].refreshDelay?l=window.odT.adSlotsLoadStatus?.[s]?.delay?window.odT.adSlotsLoadStatus[s].delay:window.odT.finalAdSlotsConfig.adSlotsDefinitions[i[n]].refreshDelay:window.odT.adSlotsLoadStatus?.[s]?.delay&&(l=window.odT.adSlotsLoadStatus[s].delay),window.odT.analytics.adSlotsLoadCount[s]>=1&&window.odT.analytics.adSlotsLoadCount[s]<r&&l>0&&t.getTime()-window.odT.analytics.adSlotsLoadTime[s]>=l){let r=.5;e&&e.adSlots&&e.adSlots[d]&&e.adSlots[d].hasOwnProperty("view")&&"number"==typeof e.adSlots[d].view&&(r=e.adSlots[d].view);const l=document.getElementById(s);if(null==l||window.odT.tagMode){if(null!==l&&window.odT.tagMode){const e=e=>{let t=e.getBoundingClientRect();return(!window.odT.adSlotsUnfilledCount[s]||window.odT.adSlotsUnfilledCount[s]<3)&&t.height>=50&&(t.top>=0&&window.top.innerHeight-t.top>t.height*r||t.top<0&&Math.abs(t.top)<t.height*r)||0==r};let t=window.top.document.querySelectorAll("iframe");for(let d=0;d<t.length;d++){let s=t[d];if(s.contentWindow===window){e(s)&&o.push(i[n]);break}}}}else{const e=getComputedStyle(l)?.visibility;let d=l.getBoundingClientRect();if(0===d.top&&0===d.width||window.odT.setup.disableGPT&&0===d.height)if(l.closest(".optidigital-wrapper-div")&&5!==a&&9!==a)d=l.closest(".optidigital-wrapper-div").getBoundingClientRect();else{let e=l.parentElement;for(;e&&e.offsetHeight<1;)e=e.parentElement;d=e?e.getBoundingClientRect():l.getBoundingClientRect()}window.odT.log(`Position for ${i[n]}, top: ${d.top}, height: ${d.height}, innerHeight: ${window.innerHeight}`);const c=window.odT.stickyAdapter.getStickyAdSlotNameFromDivId(s);let u=!0;if(c){const e=window.odT.stickyAdapter.getStickyAdContainerId(c),t=document.getElementById(e);if(t&&t.getBoundingClientRect()){let e=t.getBoundingClientRect();0===e.top&&0===e.bottom&&0===e.width&&0===e.height&&(u=!1)}}const p=document.getElementById("opd_bottomstickyad");if(p&&p.getBoundingClientRect()&&!window.odT.stickyAdapter.isFallback(c)){let e=p.getBoundingClientRect();0===e.top&&0===e.bottom&&0===e.width&&0===e.height&&(u=!1)}const g="closed"===(c?window.odT.stickyAdapter.getStickyAdStatus(c):null)||"closed"===window.odT.stickyAdStatus;5!==a&&9!==a||window.odT.adSlotsUnfilledCount[s]&&!(window.odT.adSlotsUnfilledCount[s]<3)||g||!c||!window.odT.stickyAdapter.shouldRefreshStickyAd(c,u)?(5===a||9===a||window.odT.finalAdSlotsConfig.adSlotsDefinitions[i[n]].outOfPage||s.toLowerCase().includes("outofpage")||s.toLowerCase().includes("wallpaper")&&window.odT.wallpaperFilled||s.toLowerCase().includes("billboard_1")&&window.odT.wallpaperForBillboard||window.odT.adSlotsUnfilledCount[s]&&!(window.odT.adSlotsUnfilledCount[s]<3)||"hidden"===e||!(d.height>=1)||!(d.top>=0&&window.innerHeight-d.top>d.height*r||d.top<0&&Math.abs(d.top)<d.height*r))&&0!=r||(window.odT.log("Refresh slot => "+(t.getTime()-window.odT.analytics.adSlotsLoadTime[s])),window.odT.analytics.adSlotsLoadTime[s]=t.getTime(),o.push(i[n]),window.odT.loadByGroup(o,!1)):(window.odT.log("Refresh slot => "+(t.getTime()-window.odT.analytics.adSlotsLoadTime[s])),window.odT.analytics.adSlotsLoadTime[s]=t.getTime(),o.push(s.replace(window.odT.divIdPrefix,"")))}}else!window.odT.tagMode&&7===window.odT?.finalAdSlotsConfig?.adSlotsDefinitions?.[i[n]].loadType&&l>0&&t.getTime()-window.odT?.analytics?.adSlotsLoadTime?.[window.odT?.gptAdSlots?.[i[n]]?.getSlotElementId()]>=l&&(!window.odT.adSlotsUnfilledCount[window.odT?.gptAdSlots?.[i[n]]?.getSlotElementId()]||window.odT.adSlotsUnfilledCount[window.odT?.gptAdSlots?.[i[n]]?.getSlotElementId()]<3)&&(window.odT.log("Refresh slot => "+(t.getTime()-window.odT?.analytics?.adSlotsLoadTime?.[window.odT?.gptAdSlots?.[i[n]]?.getSlotElementId()])),window.odT.analytics.adSlotsLoadTime[window.odT?.gptAdSlots?.[i[n]]?.getSlotElementId()]=t.getTime(),o.push(i[n]));if(window.odT.analytics.adSlotsLoadCount[s]>=1&&window.odT.analytics.adSlotsLoadCount[s]<r&&t.getTime()-window.odT.analytics.adSlotsLoadTime[s]>=l-5e3){let t=.5;e&&e.adSlots&&e.adSlots[d]&&e.adSlots[d].hasOwnProperty("view")&&"number"==typeof e.adSlots[d].view&&(t=e.adSlots[d].view);const i=document.getElementById(s);if(null!=i){const e=i.getBoundingClientRect();(e.height>=1&&(e.top>=0&&window.innerHeight-e.top>e.height*t||e.top<0&&Math.abs(e.top)<e.height*t)||0==t)&&(window.odT.setup[`fullPackage${window.odT.screen}`]||window.odT.loadCore())}}}o.length>0&&window.odT.refreshAdSlots(o,"auto")},t),this.log("Monitor automatic refresh is starting")}monitorLazyLoadAdSlots(e=!1){if(e&&!window?.odT?.monitorLazyLoadCalled&&(window.odT.dynamicAdslotsCalled=!0),e||(window.odT.monitorLazyLoadCalled=!0),!window?.odT?.monitorLazyLoadCalled)return;const t=(e,t)=>new IntersectionObserver((e,i)=>{const o=[];e.forEach(e=>{if(e.isIntersecting){const n=window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[t]?.divId,d=n?document.getElementById(n):null,s=!!n&&window?.odT?.analytics?.adSlotsLoadCount?.[n]>0;let a=!1;window.odT.rewardedAdReady&&window.odT?.setup?.adSlotsConfig?.rewardedAdConfiguration?.articleContentSelector&&(a=window.odT.isElementUnderBlur(d,document.querySelector(window.odT.setup.adSlotsConfig.rewardedAdConfiguration.articleContentSelector))),s||(!window.odT.rewardedAdReady||window.odT.rewardedAdReady&&!a?this.stickyAdapter&&(this.stickyAdapter.isStickyAdSlot(t)||this.stickyAdapter.isVerticalStickySlot(t))&&this.stickyAdapter.isFallback(t)||o.push(t):window.odT.lazyLoadPendingAdSlotsWithRewarded.push(t)),window.odT.lazyLoadPendingAdSlots=window.odT.lazyLoadPendingAdSlots.filter(e=>e!==t),i.unobserve(e.target)}}),o.length>0&&(window.odT.loadByGroup(o),window.odT.refreshAdSlots(o,"lazy"))},{root:null,rootMargin:e,threshold:0});let i=null;const o=new Map,n=e=>{const n=window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.divId;if(!n)return;if(o.has(n))return;let d="0px";const s=window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[e];s?.lazyLoadPx&&(d=`${s.lazyLoadPxWithCore?Math.max(s.lazyLoadPxWithCore,s.lazyLoadPx):s.lazyLoadPx}px`),o.set(n,{lazyLoadObserver:null,adSlotId:e,rootMargin:d}),i||(i=new MutationObserver(e=>{if(0===o.size)return;const i=new Set(o.keys());e.forEach(e=>{"childList"===e.type&&e.addedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE&&e.id&&i.has(e.id)){const i=o.get(e.id);if(!i)return;i.lazyLoadObserver||(i.lazyLoadObserver=t(i.rootMargin||"0px",i.adSlotId)),i.lazyLoadObserver.observe(e)}})})}),i.observe(document.body,{childList:!0,subtree:!0}));const a=document.getElementById(n);if(!a)return;const r=o.get(n);r&&(r.lazyLoadObserver||(r.lazyLoadObserver=t(d,e)),r.lazyLoadObserver.observe(a))};e?n(e):this.lazyLoadPendingAdSlots.forEach(e=>{n(e)}),this.log("Monitor lazy load is starting")}loadCoreConfig(){!0!==window.optidigitalSetup?.localLibs?.skipCoreConfig&&"object"!=typeof window.optidigitalSetupCore&&function(){var e=document.createElement("link");e.rel="preload",e.as="script",e.href=s.resolveOdLibUrl("coreConfig",`https://scripts.opti-digital.com/tags/?lib=corev2_c&site=${window.odT.siteCode}${"test"===window.odT.testGroup?"&test=true":""}`);var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t);var i=document.createElement("script");i.async=!0,i.type="text/javascript",i.src=e.href,i.onload=function(){"object"==typeof window.odTC&&window.odTC.start()},e.after(i)}()}loadCore(){!window.odT.loadOTExecuted&&!window.odT.userAction.length||!0===window.odT.loadOTExecuted&&window.odT.userAction.length||!0===window.odT.loadOTExecuted&&!window.odT.userAction.length||(window.odT.enablePrebid=!0,window.odT.setup[`fullPackage${window.odT.screen}`]||window.odT.loadCoreConfig(),window.odT.loadCoreLib())}async loadCoreLib(){if(window.odT.loadOTExecuted=!0,-1==window.location.search.indexOf("optidigital_loads=0"))if(window.odT.setup[`fullPackage${window.odT.screen}`])"object"==typeof optidigitalSetupCore&&"object"==typeof window.odTC&&window.odTC.start();else{let e=s.resolveOdLibUrl("core",`https://scripts.opti-digital.com/lib/?lib=corev2&site=${window.odT.siteCode}&v=${odTLibs.odcore}`);const{default:t}=await import(e);new t}}initAdserver(e,t,i){const o=(e,t,i)=>{if(window.odpbjs.initAdserverSet)return;window.odpbjs.initAdserverSet=!0;const o=[];if(!i&&window.odT.firstLoadAdSlots.length>0)for(const e of window.odT.firstLoadAdSlots){if(window.odT.isGPTdisabledForSlot(e)||window.odT.setup.disableGPT){const t=window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.divId;if(t)if(window.odT.log(`First Chance: ${e} UNFILLED (GPT disabled)`),window.odT.triggerFallback(e),window.odT.callEventCallback("ADSLOT_UNFILLED",{adslot:{divId:t,name:e}}),window.odT.analytics.updateAdSlotLoad(t),window.odT.isHouseReadsEnabled(e))window.odT.houseReadsAdapter.getHouseReads(e);else{const i=window.googletag&&"function"==typeof window.googletag.pubads?window.googletag.pubads().getSlots().find(e=>e.getSlotElementId()===t):null,{amznbid:o,od_pfg:n,od_pf_group:d,od_pf_pb:s}=window.odT.tools.checkSlotTargeting(i),a=window.odT.analytics.addBidderMetrics(t,null,null,o);let r={divId:e,divIdFull:t,filled:!1,demandType:"unfilled",lineItemId:null,prebidWinner:null,amazonStatus:o,oyStatus:n,oyTestGroup:d,oyPb:s,prebidBid:null,nogam:!0,bidders:Object.keys(a).length?a:null};window.odT.analytics.adRequestEvent(r,!0)}continue}o.push(e)}window.googletag.cmd.push(function(){window.odT.log(`Init ads server from ${t}, CMP consent status: ${window.odT.consentStatus}`),void 0===window.googletag.pubadsReady?setTimeout(function(){window.googletag.cmd.push(function(){i?window.googletag.pubads().refresh(window.odT.getGPTSlots(i)):o.length>0&&window.googletag.pubads().refresh(window.odT.getGPTSlots(o))})},10):i?window.googletag.pubads().refresh(window.odT.getGPTSlots(i)):o.length>0&&window.googletag.pubads().refresh(window.odT.getGPTSlots(o))})};if(!window.odT.enableAmazonAPS||window.odT.amazonBidsReady)o(0,t,i);else{const e=(window.odT.setup.biddersSetup.amazon.timeout||1e3)-(Date.now()-window.odT.initAPS);let n=0;if(e>0){let d=setInterval(()=>{window.odT.amazonBidsReady||n>=e?(clearInterval(d),o(0,t,i)):n+=20},20)}else o(0,t,i)}}setCookie(e,t,i,o){let n=new Date;n.setTime(n.getTime()+1e3*i);let d="expires="+n.toUTCString();document.cookie=o?e+"="+t+";"+d+";domain="+o+";path=/;sameSite=Lax":e+"="+t+";"+d+";path=/"}getCookie(e){let t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let o=i[e];for(;" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}handleUnfilledSlot(e,t,i,o){window.odT.log(`First Chance: ${e} UNFILLED ${i}`),window.odT.triggerFallback(e),window.odT.analytics.updateAdSlotLoad(t);const n=window.odT.stickyAdapter.getStickyAdSlotNameFromDivId(t);if(n){const e=window.odT.stickyAdapter.getStickyAdContainerId(n),i=document.getElementById(e);if(i){const e=n.replace(/[^a-zA-Z0-9]/g,"_");i.classList.remove("opd_adsticky-scroll_"+e)}if(t==window.odT.stickyAdDivId){const e=document.getElementById("opd_bottomstickyad");e&&e.classList.remove("opd_adsticky-scroll")}}if(window.odT.loadChildrenIfEmpty&&window.odT.loadChildrenIfEmpty.hasOwnProperty(t)&&window.odT.refreshAdSlots(window.odT.loadChildrenIfEmpty[t],"parent"),window.odT.isBackfillEnabled(e))window.odT.callBackfillAdapter("backfill",e);else if(window.odT.isSecondChanceEnabled(e,t))"undefined"!=typeof optidigitalAdsrv?window.odT.runSecondChance(e,t,o):(window.odT.secondChancePending.push({adslotKV:e,divId:t,event:o}),window.odT.loadOdas(window.odT.runSecondChance,window.odT.secondChancePending));else if(window.odT.isHouseReadsEnabled(e)){let t={slot:o};window.odT.houseReadsAdapter.getHouseReads(e,t)}else{const i=window.odT.adAdaptersFactory.rewardedAdsAdapter.getRewardedAdDivId();"string"==typeof e&&"string"==typeof i&&e.toLowerCase()===i.toLowerCase()&&window.optidigitalToolbox?.rewardedSlotUnfilled&&window.optidigitalToolbox.rewardedSlotUnfilled(e),window.odT.callEventCallback("ADSLOT_UNFILLED",{adslot:{divId:t,name:e}})}let d={slot:o};window.odT.analytics.registerAdslotLoad(t,!1,d,e)}getSlotNameFromEntry(e){return"string"==typeof e?e:e?.placementId||e?.adUnitCode||e}buildOptiyieldDebugFromGptSlot(e){let t="OY_PF:";try{t+=e?.getConfig("targeting")?.targeting?.od_pf_pb?.[0]||"na"}catch(e){t+="na"}return t}handleUnfilledSlotEntry(e){const t=this?.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.divId;t&&this.handleUnfilledSlot(e,t,"",null)}eventSlotRendered(e){window.odT.analytics.handleFirstAdPerformanceTracking("through GAM");const t=e.slot.getSlotElementId();let i="";const o=window.odT.setup?.adSlotsConfig?.adManagerKeyName?window.odT.setup.adSlotsConfig.adManagerKeyName:window.odT.setup?.customTargeting?.adslot?.name?window.odT.setup.customTargeting.adslot.name:"adslot";if(1==e.slot.getConfig("targeting")?.targeting?.[o]?.length){let t=e.slot.getConfig("targeting")?.targeting?.[o]?.[0];i=Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).find(e=>e&&e.cdValue===t||e.adUnit===t)&&Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).find(e=>e&&e.cdValue===t||e.adUnit===t).name}if(!window.odT.finalAdSlotsConfig.adSlotsDefinitions[i])return;let n="OY_PF:";1==e.slot.getConfig("targeting")?.targeting?.od_pf_pb?.length?n+=e.slot.getConfig("targeting")?.targeting?.od_pf_pb?.[0]:n+="na";window.odT.stickyAdapter.getStickyAdSlotNameFromDivId(t)&&document.getElementById(t)&&(document.getElementById(t).style.height="auto");let d=`${window.odT.screen}_Sticky_Bottom`;const s=window.odT.setup?.adSlotsConfig?.stickyAdConfiguration||window.odT.setup?.stickyAdConfiguration;if(s&&"object"==typeof s){const e=Object.keys(s);if(e.some(e=>e.includes(`${window.odT.screen}_Sticky_`))){const t=e.filter(e=>e.includes(`${window.odT.screen}_Sticky_`));t.length>0&&(d=t[0])}else s[`name${window.odT.screen}`]&&(d=s[`name${window.odT.screen}`])}if(t===window.odT.stickyAdDivId&&document.getElementById(`${window.odT.divIdPrefix}${d}`)&&(document.getElementById(`${window.odT.divIdPrefix}${d}`).style.height="auto"),e.isEmpty)window.odT.handleUnfilledSlot(i,t,n,e.slot);else{let o="null";if(null!=e.size&&(o=window.odT.tools.formatSizeArrayToString(e.size)),window.odT.log(`First Chance: ${i} FILLED (${o}) ${n} `),8===window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[i]?.loadType){window.odT.handleRewardedAdsCropping();const e=window.odT.setup?.adSlotsConfig?.rewardedAdConfiguration?.timeout||5e3,t=performance.now(),i=()=>{if(window.odT.adAdaptersFactory?.rewardedAdsAdapter?.rewardedAdsReady)return;performance.now()-t>=e?window.odT.handleRewardedAdsUncropping():requestAnimationFrame(i)};requestAnimationFrame(i)}window.odT.analytics.adSlotsLoadCount.hasOwnProperty(t)||window.odT.stickyFormatLoaded.length&&window.odT.stickyFormatLoaded.includes(i)||!window.odT.finalAdSlotsConfig.adSlotsDefinitions.hasOwnProperty(i)||!window.odT.finalAdSlotsConfig.adSlotsDefinitions[i].hasOwnProperty("anchor")||!window.odT.finalAdSlotsConfig.adSlotsDefinitions[i].anchor||null===e.size||1===e.size[0]||1800===e.size[0]||1e3===e.size[1]||!window.odT.stickyFormatClosed||window.odT.setStickyFormat(i,e.size[0],window.odT.setup.stickyFormatTimeout?window.odT.setup.stickyFormatTimeout:4e3),window.odT.callEventCallback("ADSLOT_FILLED",{adslot:{divId:t,size:o,name:i,gptEvent:e}}),window.odT.loadChildrenIfFilled&&window.odT.loadChildrenIfFilled.hasOwnProperty(t)&&window.odT.refreshAdSlots(window.odT.loadChildrenIfFilled[t],"parent");const d=window.odT.stickyAdapter.getStickyAdSlotNameFromDivId(t);if(d){const e=window.odT.stickyAdapter.getStickyAdContainerId(d),i=`opd_adsticky-scroll_${d.replace(/[^a-zA-Z0-9]/g,"_")}`,o=document.getElementById(e);if(o&&o.classList.add(i),window.odT.stickyAdapter.setStickyAdStatus(d,"rendered"),t==window.odT.stickyAdDivId){window.odT.stickyAdStatus="rendered";const e=document.getElementById("opd_bottomstickyad");e&&e.classList.add("opd_adsticky-scroll")}window.odT.stickyAdapter.updateStickyFrequency(d)}window.odT.replaceHouseCampaigns(i,e?.advertiserId)&&window.odT.callBackfillAdapter("backfill",i),window.odT.analytics.updateAdSlotLoad(t),window.odT.analytics.registerAdslotLoad(t,!0,e,i)}}replaceHouseCampaigns(e,t){return!!this.isBackfillEnabled(e)&&(!(!Array.isArray(this.setup?.advertisers?.house_backfill)||!this.setup?.advertisers?.house_backfill?.includes(t))||!!(this.setup.backfillReplaceHouse&&Array.isArray(this.setup?.advertisers?.house)&&this.setup?.advertisers?.house?.includes(t)&&!Array.isArray(this.setup?.advertisers?.house_backfill)||0===this.setup?.advertisers?.house_backfill?.length))}callPrebidAdapter(e,t){t&&0!==t.length||(t=window.odT.firstLoadAdSlots);let i=window.odT.setup.biddersSetup&&window.odT.setup.timeouts&&window.odT.setup.timeouts.prebidIndirect?window.odT.setup.timeouts.prebidIndirect:1500,o=window.odT.setup.biddersSetup&&window.odT.setup.timeouts&&window.odT.setup.timeouts.failsafe?window.odT.setup.timeouts.failsafe:2500;void 0!==T.B&&"function"==typeof T.B.executeAPSAndPrebid?T.B.executeAPSAndPrebid(i,o,t):window.odT.log("AuctionAdapter is not available")}callBackfillAdapter(e,t){t&&(void 0!==T.B&&"function"==typeof T.B.backfill?T.B.backfill(t):window.odT.log("AuctionAdapter is not available"))}callPrebidAndAmazon(){window.odT.setUserId();let e=window.odT.setup.processTimeout?window.odT.setup.processTimeout:300,t=0;if(window.odT.checkServicesReady())window.odT.refreshAdSlots(null);else{let i=setInterval(()=>{window.odT.checkServicesReady()?(window.odT.log("User IDs are ready"),clearInterval(i),window.odT.refreshAdSlots(null)):t>=e?(clearInterval(i),window.odT.refreshAdSlots(null)):t+=20},20)}if(window.odT.id5Obj){const e=new Date(localStorage.getItem("id5id_last")),t=28800;Date.now()-e.getTime()>1e3*t&&window.odT.setId5Id()}}handleUnfilled(e,t){const i=Object.values(odT.finalAdSlotsConfig.adSlotsDefinitions).find(t=>t.cdValue===e);i&&(e=i.adUnit),window.odT.log(`Second Chance (backfill): ${e} UNFILLED`);const o=window.googletag&&"function"==typeof window.googletag.pubads?window.googletag.pubads().getSlots().find(e=>e.getSlotElementId()===t):null;if(window.odT.isSecondChanceEnabled(e,t))"undefined"!=typeof optidigitalAdsrv?window.odT.runSecondChance(e,t,o):(window.odT.secondChancePending.push({adslotKV:e,divId:t,event:o}),window.odT.loadOdas(window.odT.runSecondChance,window.odT.secondChancePending));else{"string"==typeof e&&e.toLowerCase()===window.odT.adAdaptersFactory.rewardedAdsAdapter.getRewardedAdDivId()&&window.optidigitalToolbox?.rewardedSlotUnfilled&&window.optidigitalToolbox.rewardedSlotUnfilled(e),window.odT.callEventCallback("ADSLOT_UNFILLED",{adslot:{divId:t,name:e}});const{amznbid:i,od_pfg:n,od_pf_group:d,od_pf_pb:s}=window.odT.tools.checkSlotTargeting(o),a=window.odT.analytics.addBidderMetrics(t,null,null,i);let r={divId:e,divIdFull:t,filled:!1,demandType:"unfilled",lineItemId:null,prebidWinner:null,amazonStatus:i,oyStatus:n,oyTestGroup:d,oyPb:s,prebidBid:null,nogam:!1,bidders:Object.keys(a).length?a:null};window.odT.stickyAdapter.isVerticalStickyAdSlot(e)?(r.nogam=!0,window.odT.analytics.adRequestEvent(r,!0)):window.odT.analytics.adRequestEvent(r)}}triggerFallback(e){if(!e||!window.odT.stickyAdapter||!window.odT.stickyAdapter.isStickyAdSlot(e)&&!window.odT.stickyAdapter.isVerticalStickyAdSlot(e)||!window.odT.stickyAdapter.hasFallback(e))return;const t=window.odT.stickyAdapter.getFallback(e);if(!t)return;window.odT.log(`${e} unfilled, triggering fallback to ${t}`),window.odT.stickyAdapter&&"function"==typeof window.odT.stickyAdapter.closeStickyAd&&window.odT.stickyAdapter.closeStickyAd(e);try{let e=[];this.stickyAdapter.createStickyAd(t,{initConfigAdUnit:this.initConfig.adUnit,log:e=>this.log(e),getCookie:e=>this.getCookie(e),firstLoadAdSlots:e,setAttributes:(e,t)=>this.tools.setAttributes(e,t),stickyAutoCloseScroll:this.stickyAutoCloseScroll,refreshAdSlots:e=>this.refreshAdSlots(e),onLegacyStateUpdate:e=>{void 0===e.stickyAdDivId||this.stickyAdDivId||(this.stickyAdDivId=e.stickyAdDivId),void 0!==e.stickyAdMode&&(this.stickyAdMode=e.stickyAdMode),void 0!==e.stickyAdStatus&&(this.stickyAdStatus=e.stickyAdStatus),void 0!==e.stickyAdTopTrigger&&(this.stickyAdTopTrigger=e.stickyAdTopTrigger),void 0!==e.stickyAdAutoHidePx&&(this.stickyAdAutoHidePx=e.stickyAdAutoHidePx)},adLayoutEnabled:this.setup.adLayoutEnabled})}catch(e){this.log('Error creating sticky ad "'+t+'": '+(e&&e.message?e.message:e))}const i=this.stickyAdapter.getStickyAdDivId(t);if(i){const e=document.getElementById(i);e&&this.addNewAdSlot(e)}this.refreshAdSlots(t,"lazy",this.setup.processTimeout||2e3)}async renderEngage(e,t,o,n){const d=this.stickyAdapter.getStickyAdSlotNameFromDivId(e);if(d){const t=this.stickyAdapter.getStickyAdContainerId(d),i=`opd_adsticky-scroll_${d.replace(/[^a-zA-Z0-9]/g,"_")}`,o=document.getElementById(t);if(o&&(o.classList.add(i),o.style.display="block"),this.stickyAdapter.setStickyAdStatus(d,"rendered"),e==this.stickyAdDivId){this.stickyAdStatus="rendered";const e=document.getElementById("opd_bottomstickyad");e&&e.classList.add("opd_adsticky-scroll")}this.stickyAdapter.updateStickyFrequency(d)}const s={hb_bidder:n.hb_bidder||n.bidder,hb_size:window.odT.tools.formatSizeArrayToString(o)};if(n.hasOwnProperty("hb_deal_appnexus")&&(s.hb_deal_appnexus=n.hb_deal_appnexus),n.hasOwnProperty("hb_deal_xandr")&&(s.hb_deal_xandr=n.hb_deal_xandr),(window.odT.noGamUseSafeframe||this.stickyAdapter.isVerticalStickyAdSlot(d??e))&&window.odT.checkSafeFrameDelivery(e,s)){const{EmbeddedSafeFrame:n}=i(764),d=new n;let s=[{id:e,size:window.odT.tools.formatSizeArrayToString(o),renderHtml:t,renderFile:"https://scripts.opti-digital.com/lib/?site="+window.odT.siteCode+"&lib=safeframe&v=1.1.0"}];document.getElementById(e).style.display="block",await d.init(s)}else{const i=document.getElementById(e);if(null!==i){i.innerHTML="";let n=t,d=document.createElement("div");d.setAttribute("style","border: 0pt none; margin: auto; text-align: center; width: "+o[0]+"px; height: "+o[1]+"px;");var a=document.createElement("iframe");window.odT.tools.setAttributes(a,{id:e+"-iframe-od",width:o[0],height:o[1],scrolling:"no",marginwidth:"0",marginheight:"0",frameborder:"0"}),d.appendChild(a),i.appendChild(d),a.contentWindow.document.open(),a.contentWindow.document.write(n),a.contentWindow.document.close(),i.style.display="block"}}return!0}setUserId(e=!1,t={},i=!1){if(this.consentOK.includes(this.consentStatus)){if(e&&t?.criteoId){const{criteoId:e}=t,o=localStorage.getItem("cto_bidid"),n=91;o&&this.checkVendor(n)&&(e.uids[0].id=o,i.eids.push(e))}const o=this.getCookie("_pbjs_id_optout")||this.getCookie("_pubcid_optout"),n=localStorage.getItem("_pbjs_id_optout")||localStorage.getItem("_pubcid_optout"),d=this.getCookie("_lr_env"),s=this.getCookie("_lr_pairId");if(!o&&!n&&t?.sharedId){const{sharedId:o}=t;let n=this.getCookie("_sharedid");const d=this.getCookie("_sharedid_cst"),{calculatedId:s,finalHashedConsent:a}=this.setShareId();let r=7776e3,l=window.location.host&&window.location.host.indexOf("www.")||window.location.host.replace("www.","");if(n)d&&d!==a&&this.setCookie("_sharedid_cst",a,r,l),e&&(o.uids[0].id=n,i.eids.push(o));else if(s&&a){let t=s;"object"==typeof window.PublisherCommonId&&window.PublisherCommonId.hasOwnProperty("getId")&&"function"==typeof window.PublisherCommonId.getId&&(t=window.PublisherCommonId.getId()),this.setCookie("_sharedid",t,r,l),this.setCookie("_sharedid_cst",a,r,l),e&&(o.uids[0].id=t,i.eids.push(o))}}if(this.checkVendor("131")&&t?.id5Id){const{id5Id:o}=t;if(this.id5Permission=!0,localStorage.getItem("id5id")){if(this.id5Obj=JSON.parse(decodeURIComponent(localStorage.getItem("id5id"))),localStorage.getItem("id5id_1019_nb")){let e=parseInt(localStorage.getItem("id5id_1019_nb"))+1,t=new Date(Date.now()+2592e6).toUTCString();localStorage.setItem("id5id_1019_nb",e),localStorage.setItem("id5id_1019_nb_exp",t)}e&&(o.uids[0].id=this.id5Obj.universal_uid,o.uids[0].ext=this.id5Obj.ext,i.eids.push(o))}else this.setId5Id()}if(t?.liverampId&&d&&(this.setup.liverampId||window.odT.setup?.userids?.liverampId?.params?.pid)&&e){const{liverampId:e}=t;e.uids[0].id=d,i.eids.push(e)}if(s&&(this.setup.liverampId||window.odT.setup?.userids?.liverampId?.params?.pid)&&e&&t?.pairId){const{pairId:e}=t;let o=JSON.parse(atob(decodeURIComponent(window.odT.getCookie("_lr_pairId"))))&&JSON.parse(atob(decodeURIComponent(window.odT.getCookie("_lr_pairId")))).envelope;o&&o.length&&(o.forEach(t=>{e.uids.push({id:t,atype:571187})}),i.eids.push(e))}if(1===window.odT.setup?.userids?.truelinkId?.status){if(window.odT.setup?.userids?.truelinkId?.params?.cookie?window.odT.getCookie(window.odT.setup.userids.truelinkId.params.cookie):window.odT.getCookie("id5-true-link")?window.odT.getCookie("id5-true-link"):null){const e={source:"true-link-id5-sync.com",uids:[{id:window.odT.getCookie("id5-true-link"),atype:1}]};i.eids.push(e)}}}}setShareId(){let e=null;window.odT.consentV2TCData&&window.odT.consentV2TCData.hasOwnProperty("gdprApplies")&&window.odT.consentV2TCData.gdprApplies&&window.odT.consentV2TCData.hasOwnProperty("tcString")&&window.odT.consentV2TCData.tcString&&(e=[window.odT.consentV2TCData.gdprApplies,window.odT.consentV2TCData.tcString]);const t=[JSON.stringify(e),"null","null"];let i="";t.forEach((e,t)=>{i+=`${t>0?":":""}${this.cyrb53(e)}`}),i+=":0";const o=this.cyrb53(i),n=encodeURIComponent((e=>{let t=Number(e);const i=[];for(;t>0;)i.push(String.fromCharCode(255&t)),t>>>=8;return btoa(i.join())})(o)),d=e=>e?(e^(window&&window.crypto&&window.crypto.getRandomValues?crypto.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random())>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,d);return{calculatedId:d(),finalHashedConsent:n}}setId5Id(){if(window.odT.id5CallSent)return;window.odT.id5CallSent=!0;const{calculatedId:e,finalHashedConsent:t}=this.setShareId(),i=e=>new Date(Date.now()+864e5*e).toUTCString(),o=localStorage.getItem("id5id"),n=i(90),d=i(30),s=window.odT.setup?.userids?.id5Id?.params?.partner||"1019",a={partner:s,gdpr:window.optidigitalToolboxGdpr?1:0,v:"optidigital/3.0.0",o:"client-side-fetch-api",u:window.location.href,top:(()=>{try{if(window.top===window.self)return!0}catch(e){return!1}return!1})?1:0};if(window.optidigitalToolboxGdpr&&(a.gdpr_consent=this.consentV2TCData&&this.consentV2TCData.tcString?this.consentV2TCData.tcString:""),document.referrer&&(a.rf=document.referrer),window.odT.setup?.userids?.id5Id?.params?.pd&&(a.pd=window.odT.setup.userids.id5Id.params.pd),o){const e=JSON.parse(decodeURIComponent(o));a.s=e.signature}let r=0;localStorage.getItem(`id5id_${s}_nb`)&&(r=parseInt(localStorage.getItem(`id5id_${s}_nb`))+1);const l=window.odT.setup?.userids?.id5Id?.params?.abTesting||{enabled:!1};l.enabled&&(a.ab_testing={enabled:!0,control_group_pct:l.controlGroupPct||.1});const c=`https://id5-sync.com/g/v2/${s}.json`,u=new XMLHttpRequest;u.open("POST",c,!0),u.onreadystatechange=function(){if(4==this.readyState&&200==this.status){window.odT.log("ID5 was set");let e=JSON.parse(this.responseText);window.odT.id5Obj=e,localStorage.setItem("id5id",encodeURIComponent(this.responseText)),localStorage.setItem("id5id_exp",n),localStorage.setItem("id5id_last",(new Date).toUTCString()),localStorage.setItem("id5id_last_exp",n),localStorage.setItem(`id5id_${s}_nb`,r),localStorage.setItem(`id5id_${s}_nb_exp`,d),localStorage.setItem("id5id_privacy",JSON.stringify(e.privacy)),localStorage.setItem("id5id_privacy_exp",d),localStorage.setItem("id5id_cst",decodeURIComponent(t)),window.odT.setPpid()}},u.send(JSON.stringify(a))}initOy(){let e=window.odT.odNetworkId?window.odT.odNetworkId:window.odT.setup.info.networkId;window.optiyield&&"function"==typeof window.optiyield._0i4n3i2t&&window.optiyield._0i4n3i2t(e,window.odT.pfConfig,window.odT.pfConfig.country),window.optiyield.cmd.push(function(){let t={pubId:e,mode:"manual"};""!==window.odT.setup?.adSlotsConfig?.adManagerKeyName?t.gtpCustomDimensionKey={cd1:window.odT.setup?.adSlotsConfig?.adManagerKeyName?window.odT.setup.adSlotsConfig.adManagerKeyName:"adslot"}:""!==window.odT.setup?.customTargeting?.adslot?.name&&(t.gtpCustomDimensionKey={cd1:window.odT.setup?.customTargeting?.adslot?.name||"adslot"}),window.optiyield.init(t,function(){window.odT.log("window.optiyield SDK is ready")})})}callOy(){this.log("Call OY SDK config"),this.pfConfig=window.optidigitalPFconfig,Object.keys(this.pfConfig).length>0?this.initOy():this.skipOy=!0}runAuction(e){this.setup?.info?.publisherId&&this.setup?.info?.networkId&&this.setup?.info?.siteId&&this.setup?.info?.revision&&(this.setup?.sspPriorities?.ssp&&(this.enableCookieSync=!0,window.odT.log("Trying to run cookie sync for SSPs with high priority"),this.runPBSUserSync()),this.buildFirstLoadAdSlots(),this.monitorLazyLoadAdSlots(),this.monitorAutomaticRefresh(),this.initConfig.uuid&&Object.keys(this.initConfig.uuid).some(e=>["email_md5","email_sha256","email_sha1"].includes(e))&&(this.setup.liverampId||this.setup?.userids?.liverampId?.params?.pid)?(window&&!window.ats&&(window.ats={},window.ats.retrieveEnvelope=this.retrieveEnvelope),this.refreshAtsEnvelope()):this.skipLiveRamp=!0,window.googletag.cmd.push(function(){window.odT.log("GPT is starting"),window.odT.setPpid(),window.odT.initPageTargeting(),window.odT.defineSlots(window.odT.firstLoadAdSlots),window.googletag.setConfig({singleRequest:!0,centering:!0}),window.googletag.pubads().addEventListener("slotRenderEnded",window.odT.eventSlotRendered),window.googletag.enableServices()}),window.addEventListener("message",window.odT.receivedMessage,!1),this.setup[`fullPackage${this.screen}`]?(this.userAction.push("fullPackage"),this.callOy(),this.loadCore(),this.callPrebidAndAmazon()):(this.callOy(),this.callPrebidAdapter(e)))}getCpmStringValue(e,t){let i="";const o=t.reduce((e,t)=>e.max>t.max?e:t,{max:0});let n=0,d=t.find(function(t){if(e>o.max){let e=t.precision;void 0===e&&(e=_defaultPrecision),i=t.max.toFixed(e)}else{if(e<=t.max&&e>=n)return t.min=n,t;n=t.max}});return d&&(i=window.odT.getCpmTarget(e,d)),i}getCpmTarget(e,t){const i=t.hasOwnProperty("precision")&&t.precision?t.precision:2,o=t.increment,n=t.min;let d,s,a=Math.pow(10,i+2),r=(e*a-n*a)/(o*a);try{d=Math.floor(r)*o+n}catch(e){s=!0}return(s||"number"!=typeof d)&&(d=Math.floor(r)*o+n),d=Number(d.toFixed(10)),d.toFixed(i)}convertCurrency(e,t="USD",i="EUR"){const o=window.odT?.setup?.currentRates?.USD||window.odT?.setup?.defaultRates?.USD||{EUR:.874508089199825,USD:1,JPY:162.413642326192,CZK:21.2103191954526,DKK:6.53721031919545,GBP:.746506340183647,HUF:312.898994315697,PLN:3.76781810231745,RON:4.57927415828596,SEK:9.67380848272846,CHF:.806908613904679,ISK:125.404459991255,NOK:9.73371228683865,TRY:46.8220376038478,AUD:1.44101442938347,BRL:5.14534324442501,CAD:1.41687800612156,CNY:6.79597726278968,HKD:7.83602973327503,IDR:18105.5968517709,ILS:3.02466112811544,INR:95.3882815916047,KRW:1512.45299519021,MXN:17.5501530389156,MYR:4.07695671184959,NZD:1.74167031045037,PHP:61.5986007870573,SGD:1.29287275907302,THB:33.4446873633581,ZAR:16.3719282903367};if(t===i)return e;if(!o[t]||!o[i])return window.odT.log(`convertToCurrencyv2 : Ratio not available for ${t} or ${i}`),e;const n=o[t];return e*(o[i]/n)}convertToCurrency(e,t="EUR"){let i=window.odT.setup.adServerCurrency?window.odT.setup.adServerCurrency:"EUR";if("USD"==window.odT.setup.adServerCurrency)return e;if("EUR"===t){let t=window.odT.setup.defaultRates?window.odT.setup.defaultRates:{USD:{EUR:.87,PLN:3.53}};window.odT.setup.currentRates?e*=window.odT.setup.currentRates.USD[i]:e*=t.USD[i]}if("USD"===t){e*=(window.odT.setup.defaultRatesUsd?window.odT.setup.defaultRatesUsd:{EUR:{USD:1.15,PLN:4.21}}).EUR.USD}return e}isGPTdisabledForSlot(e){const t=window.odT?.finalAdSlotsConfig?.adSlotsDefinitions?.[e];return t&&(this.stickyAdapter.isVerticalStickyAdSlot(e)||!0===t?.disableGPT)}receivedMessage(e){const t=e.message?"message":"data";let i=null;try{i=JSON.parse(e[t])}catch(e){return}if(!i||!i.adId||!i.message)return;const o=i.adId;switch(i.message){case"Prebid Request":{let t=window.odT.bidsFromOe?.find(e=>e.bidId===o);if(!t&&(t=window.odT.bidsFromOeBackfill?.find(e=>e.bidId===o),!t))return;const i=window.odT.getReplier(e);if(!i)return;return window.odT.prebidCreativeSourcesByAdId=window.odT.prebidCreativeSourcesByAdId||{},window.odT.prebidCreativeSourcesByAdId[o]={source:e.source,origin:e.origin||null,updatedAt:Date.now()},void window.odT.sendAdToCreative({adId:t.bidId,ad:t.ad,width:Number(t.width),height:Number(t.height),cpm:t.cpm,originalCpm:t.cpm},i)}case"Prebid Event":{let t=Boolean(window.odT.bidsFromOe?.find(e=>e.bidId===o));t||(t=Boolean(window.odT.bidsFromOeBackfill?.find(e=>e.bidId===o)));const n=Boolean(window.odT.prebidCreativeDimensionsByAdId?.[o]);if(!t&&!n)return;const d=window.odT.prebidCreativeSourcesByAdId?.[o];if(d&&d.source&&d.source!==e.source)return;return void window.odT.handlePrebidCreativeEvent(i)}default:return}}handlePrebidCreativeEvent(e){if(!e||!e.adId)return;const t=(e.action||e.eventType||e.type||e.event||"").toString().toLowerCase();if("adrendersucceeded"===t){const t=window.odT.prebidCreativeDimensionsByAdId?.[e.adId];return t&&(window.odT.resizeRemoteCreativeByAdId(e.adId,t.width,t.height),delete window.odT.prebidCreativeDimensionsByAdId[e.adId]),void(window.odT.prebidCreativeSourcesByAdId&&delete window.odT.prebidCreativeSourcesByAdId[e.adId])}const i=Number(e.width??e.w??e?.size?.[0]??e?.dimensions?.width),o=Number(e.height??e.h??e?.size?.[1]??e?.dimensions?.height);("resize"===t||"preresize"===t||"postresize"===t||Number.isFinite(i)||Number.isFinite(o))&&window.odT.resizeRemoteCreativeByAdId(e.adId,i,o)}prunePrebidCreativeDimensionsCache(){const e=window.odT.prebidCreativeDimensionsByAdId;if(!e)return;const t=Date.now(),i=6e5,o=Object.entries(e);if(!o.length)return;o.forEach(([o,n])=>{const d=Number(n?.updatedAt);(!Number.isFinite(d)||t-d>i)&&delete e[o]});const n=Object.entries(e);if(n.length>500){const t=n.sort(([,e],[,t])=>{const i=Number(e?.updatedAt),o=Number(t?.updatedAt);return(Number.isFinite(i)?i:0)-(Number.isFinite(o)?o:0)}),i=t.length-500;for(let o=0;o<i;o+=1){const[i]=t[o];delete e[i]}}const d=window.odT.prebidCreativeSourcesByAdId;d&&Object.entries(d).forEach(([o,n])=>{const s=Number(n?.updatedAt);(!Number.isFinite(s)||t-s>i||!e[o])&&delete d[o]})}findGptSlotByAdId(e){if(!window.googletag||!window.googletag.pubads||"function"!=typeof window.googletag.pubads)return null;if(!e)return null;const t=window.odT.gptSlotByAdId||(window.odT.gptSlotByAdId={}),i=window.odT.gptSlotElementIdByAdId||(window.odT.gptSlotElementIdByAdId={}),o=t[e];if(o&&"function"==typeof o.getSlotElementId){const n=o.getSlotElementId();if(n&&document.getElementById(n))return o;delete t[e],delete i[e]}const n=i[e];if(n){const o=(window.googletag.pubads().getSlots()||[]).find(e=>e.getSlotElementId()===n);if(o)return t[e]=o,o;delete i[e]}const d=(window.googletag.pubads().getSlots()||[]).find(t=>t.getTargetingKeys().some(i=>t.getTargeting(i).includes(e)))||null;return d&&(t[e]=d,i[e]=d.getSlotElementId()),d}resizeRemoteCreativeByAdId(e,t,i){const o=window.odT.findGptSlotByAdId(e);if(!o)return;const n=o.getSlotElementId(),d=document.getElementById(n);if(!d)return;const s=d.querySelector('iframe:not([style*="display: none"])'),a={};if(Number.isFinite(t)&&(a.width=`${t}px`),Number.isFinite(i)&&(a.height=`${i}px`),!Object.keys(a).length)return;const r="remote-creative-size";window.odT.adLayoutAdapter.updateManagedLayoutClass(s,r,"remote-creative-size",a,!0),window.odT.adLayoutAdapter.updateManagedLayoutClass(s?.parentElement||null,r,"remote-creative-size",a,!0)}clearRemoteCreativeResizeBySlotElementId(e){if(!e)return;const t=document.getElementById(e);if(!t)return;const i=t.querySelector('iframe:not([style*="display: none"])'),o="remote-creative-size";window.odT.adLayoutAdapter.updateManagedLayoutClass(t,o,"remote-creative-size",null,!0),window.odT.adLayoutAdapter.updateManagedLayoutClass(t.parentElement,o,"remote-creative-size",null,!0),window.odT.adLayoutAdapter.updateManagedLayoutClass(i,o,"remote-creative-size",null,!0),window.odT.adLayoutAdapter.updateManagedLayoutClass(i?.parentElement||null,o,"remote-creative-size",null,!0)}clearRemoteCreativeResizeBySlots(e){e&&e.length&&e.forEach(e=>{const t=e&&"function"==typeof e.getSlotElementId?e.getSlotElementId():null;t&&window.odT.clearRemoteCreativeResizeBySlotElementId(t)})}getReplier(e){return e.ports.length>0?function(t){e.ports[0].postMessage(JSON.stringify(t))}:null!==e.origin?function(t){e.source.postMessage(JSON.stringify(t),e.origin)}:void 0}sendAdToCreative(e,t){const{adId:i,ad:o,adUrl:n,width:d,height:s}=e;if(!i)return;window.odT.prebidCreativeDimensionsByAdId||(window.odT.prebidCreativeDimensionsByAdId={}),window.odT.prebidCreativeDimensionsByAdId[i]={width:Number(d),height:Number(s),updatedAt:Date.now()},window.odT.prunePrebidCreativeDimensionsCache(),t({message:"Prebid Response",ad:o,adUrl:n,adId:i,width:d,height:s});const a=window.odT.bidsFromOe.findIndex(e=>e.bidId===i);-1!==a&&window.odT.bidsFromOe.splice(a,1)}refreshGPTSlots(e){window.googletag.cmd.push(function(){const t=window.odT.getGPTSlots(e);window.odT.clearRemoteCreativeResizeBySlots(t),window.optiyield.cmd.push(function(){window.optiyield.setGptFloors()}),window.googletag.pubads().refresh(t)})}callEventCallback(e,t){window.odT.eventCallback.forEach(i=>{if("function"==typeof i)try{i(e,t)}catch(e){}})}getCMPConsent(){if(this.enableCookieConsent&&this.CMPready&&this.consentStatus&&"nocmp"!==this.consentStatus)return this.log("Cookie consent: Already retrieved, registering event listener for updates"),void("function"==typeof window.top.__tcfapi&&window.top.__tcfapi("addEventListener",2,(e,t)=>{!t||"useractioncomplete"!==e.eventStatus&&"cmpuiclosed"!==e.eventStatus||(this.consentStatus="CMPv2_ready",this.consentV2TCData=e,this.analyzeConsentV2(),this.setup&&this.setup.hasOwnProperty("onConsentCaptured")&&"function"==typeof this.setup.onConsentCaptured&&this.setup.onConsentCaptured(this.consentStatus,e),-1==this.consentStatusNoGAM.indexOf(this.consentStatus)?(this.CMPready=!0,this.layoutReady&&this.runAuction("cmpConsentUpdated")):(this.CMPready=!1,this.layoutReady&&this.loadOdas(this.runOdasAuction)),this.callEventCallback("CONSENT_READY",{status:this.consentStatus,tcData:e,source:"cmp_update"}))}));let e=this.setup?this.setup.cmpCallbackTimeout||(0===this.setup.cmpCallbackTimeout?this.setup.cmpCallbackTimeout:1500):1500,t=!1,i=0,o=!1;i=setTimeout(()=>{o=!0,window.odT.log("Timeout NO RESPONSE FROM CMP CALLBACK"),window.odT.consentStatus="CMPv2_GAMokHBok",window.odT.consentType="timeout_callback",-1==window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)&&(window.odT.log(`Consent ready, consent status: ${window.odT.consentStatus}`),window.odT.CMPready=!0,window.odT.layoutReady&&window.odT.runAuction("cmpTimeoutCallback")),window.odT.callEventCallback("CONSENT_READY",{status:window.odT.consentStatus}),window.odT.analytics.pageViewEvent(),t=!0},e),"function"==typeof window.top.__tcfapi?window.top.__tcfapi("addEventListener",2,function(e,n){o||(n&&"cmpuishown"===e.eventStatus&&(clearTimeout(i),window.odT.consentCMPUIShown=!0,window.odT.timeStampCMPUIShown=Date.now(),window.odT.log("CMP UI shown"),t||(window.odT.analytics.pageViewEvent(),t=!0)),!n||"tcloaded"!==e.eventStatus&&"useractioncomplete"!==e.eventStatus&&"cmpuiclosed"!=e.eventStatus?n&&!e.gdprApplies&&(clearTimeout(i),window.odT.consentStatus="CMPv2_OOS",window.odT.consentType="ok",window.odT.consentCMPUIShown?window.odT.analytics.pageViewEvent({userAction:!0}):window.odT.analytics.pageViewEvent(),window.odT.log(`CMP consent ready ${window.odT.consentStatus}`),window.odT.CMPready=!0,window.odT.layoutReady&&window.odT.runAuction("cmpReadyOOS")):(clearTimeout(i),window.odT.consentStatus="CMPv2_ready",window.odT.consentV2TCData=e,window.odT.analyzeConsentV2(),window.odT.setup&&window.odT.setup.hasOwnProperty("onConsentCaptured")&&(window.odT.setup.onConsentCaptured,1)&&window.odT.setup.onConsentCaptured(window.odT.consentStatus,e),window.odT.log(`CMP consent ready ${window.odT.consentStatus}`),-1==window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)?(window.odT.CMPready=!0,window.odT.layoutReady&&window.odT.runAuction("cmpConsentReadyOK"),window.odT?.setup?.enableCrModal?.includes(window.odT.consentType)&&"ok"!==window.odT.consentType&&window.odT?.setup?.crZoneId&&(window.odT.userAction.push("Load Cr Modal"),window.odT.loadOdas(odT.initCRModal))):(window.odT.CMPready=!1,window.odT.layoutReady&&window.odT.loadOdas(window.odT.runOdasAuction)),window.odT.callEventCallback("CONSENT_READY",{status:window.odT.consentStatus,tcData:e}),window.top.__tcfapi("removeEventListener",2,function(e){e&&window.odT.log("TCFAPPI event listener removed")},e.listenerId),window.odT.consentCMPUIShown?window.odT.analytics.pageViewEvent({userAction:!0}):window.odT.analytics.pageViewEvent()))}):this.consentStatus="nocmp"}tryCookieConsent(){if(!this.enableCookieConsent||!window.optidigitalToolboxGdpr)return!1;const e=[];this.setup&&this.setup.consentCookieName&&e.push(this.setup.consentCookieName),e.push("euconsent-v2","euconsent");let t=null;for(const i of e){const e=this.getCookie(i);if(e&&""!==e.trim()){t=e;break}}if(!t)return!1;try{const e=this.decodeTCStringFromCookie(t);if(e&&this.validateTCData(e))return this.processConsentData(e),!0}catch(e){}return this.log("Cookie consent: Failed to decode TC String from cookie"),!1}decodeTCStringFromCookie(e){try{const t=(0,b.K)(e);if(t&&t.core)return this.convertParsedTCToTCData(t,e)}catch(e){}this.log("Failed to decode TC String from cookie")}convertParsedTCToTCData(e,t){const i=e.core||{},o=e.publisherTC||{},n=i.vendorConsents||{},d=i.vendorLegitimateInterests||{},s=i.purposeConsents||{},a=i.purposeLegitimateInterests||{},r=o.purposeConsents||{},l=o.purposeLegitimateInterests||{},c=o.customPurposeConsents||{},u=o.customPurposeLegitimateInterests||{},p={...s},g={...a},w=Object.values(r).some(e=>!0===e)||Object.values(l).some(e=>!0===e),h=Object.keys(o).some(e=>"purposeConsents"!==e&&"purposeLegitimateInterests"!==e);(w||h)&&(Object.assign(p,r),Object.assign(g,l));return{tcString:t,gdprApplies:window.optidigitalToolboxGdpr?1:0,cmpId:i.cmpId,cmpVersion:i.cmpVersion,tcfPolicyVersion:i.policyVersion,purpose:{consents:p,legitimateInterests:g},vendor:{consents:n,legitimateInterests:d},publisher:{consents:r,legitimateInterests:l,customPurpose:{consents:c,legitimateInterests:u},restrictions:i.publisherRestrictions||{}},isServiceSpecific:i.isServiceSpecified,publisherCC:i.publisherCountryCode,useNonStandardTexts:i.useNonStandardStacks,purposeOneTreatment:i.purposeOneTreatment,specialFeatureOptins:i.specialFeatureOptins||{},vendorListVersion:i.vendorListVersion,consentLanguage:i.consentLanguage,consentScreen:i.consentScreen,created:i.created,lastUpdated:i.lastUpdated}}validateTCData(e){return e&&e.hasOwnProperty("tcString")&&e.hasOwnProperty("gdprApplies")&&e.hasOwnProperty("purpose")&&e.hasOwnProperty("vendor")&&e.tcString&&"string"==typeof e.tcString&&e.tcString.length>0}processConsentData(e){this.consentStatus="CMPv2_ready",this.consentV2TCData=e,this.analyzeConsentV2(),this.log(`Cookie consent: Retrieved consent, status: ${this.consentStatus}`),this.setup&&this.setup.hasOwnProperty("onConsentCaptured")&&"function"==typeof this.setup.onConsentCaptured&&this.setup.onConsentCaptured(this.consentStatus,e),-1==this.consentStatusNoGAM.indexOf(this.consentStatus)?(this.CMPready=!0,this.layoutReady&&this.runAuction("cookieConsentReady"),this?.setup?.enableCrModal?.includes(this.consentType)&&"ok"!==this.consentType&&this?.setup?.crZoneId&&(this.userAction.push("Load Cr Modal"),this.loadOdas(this.initCRModal))):(this.CMPready=!1,this.layoutReady&&this.loadOdas(this.runOdasAuction)),this.callEventCallback("CONSENT_READY",{status:this.consentStatus,tcData:e,source:"cookie"}),this.analytics.pageViewEvent()}bootstrapConsent(){if(this.enableCookieConsent){const e=this.tryCookieConsent();setTimeout(()=>{e||this.CMPready?(e||this.CMPready)&&"function"==typeof window.top.__tcfapi&&window.top.__tcfapi("addEventListener",2,(e,t)=>{!t||"useractioncomplete"!==e.eventStatus&&"cmpuiclosed"!==e.eventStatus||(this.consentStatus="CMPv2_ready",this.consentV2TCData=e,this.analyzeConsentV2(),this.setup&&this.setup.hasOwnProperty("onConsentCaptured")&&"function"==typeof this.setup.onConsentCaptured&&this.setup.onConsentCaptured(this.consentStatus,e),-1==this.consentStatusNoGAM.indexOf(this.consentStatus)?(this.CMPready=!0,this.layoutReady&&this.runAuction("cmpConsentUpdated")):(this.CMPready=!1,this.layoutReady&&this.loadOdas(this.runOdasAuction)),this.callEventCallback("CONSENT_READY",{status:this.consentStatus,tcData:e,source:"cmp_update"}))}):this.waitForCMP()},150)}else this.waitForCMP()}waitForCMP(){window.odT.log("CMP Start waiting API");let e=0,t=window.odT.setup&&(window.odT.setup.cmpApiTimeout||0===window.odT.setup.cmpApiTimeout)?window.odT.setup.cmpApiTimeout:1e3,i=0,o=!1;window.optidigitalToolboxGdpr?"function"==typeof window.top.__tcfapi?(window.odT.log("CMP API ready, wait for consent signal"),o=!0,window.odT.waitingForCMPFinished=!0,"loading"!==document.readyState?window.odT.getCMPConsent():document.addEventListener("DOMContentLoaded",function(e){window.odT.getCMPConsent()})):e=window.setInterval(function(){i+=50,o||("function"==typeof window.top.__tcfapi?(window.odT.log("CMP API ready, wait for consent signal"),window.clearInterval(e),o=!0,window.odT.waitingForCMPFinished=!0,"loading"!==document.readyState?window.odT.getCMPConsent():document.addEventListener("DOMContentLoaded",function(e){window.odT.getCMPConsent()})):i>=t&&(window.clearInterval(e),o=!0,window.odT.waitingForCMPFinished=!0,window.odT.log("Timeout NO CMP API"),window.odT.consentStatus="CMPv2_GAMokHBok",-1==window.odT.consentStatusNoGAM.indexOf(window.odT.consentStatus)&&(window.odT.log(`Consent ready, consent status: ${window.odT.consentStatus}`),window.odT.CMPready=!0,window.odT.layoutReady&&window.odT.runAuction("cmpTimeoutAPI")),window.odT.callEventCallback("CONSENT_READY",{status:window.odT.consentStatus}),window.odT.consentType="timeout_tcfapi",window.odT.analytics.pageViewEvent()))},50):(window.odT.consentStatus="CMPv2_OOS",window.odT.consentType="ok",window.odT.log("NO GDPR"),window.odT.analytics.pageViewEvent(),window.odT.log(`Consent ready, consent status: ${window.odT.consentStatus}`),window.odT.CMPready=!0,window.odT.layoutReady&&window.odT.runAuction("initnoGDPR"))}runPBSUserSync(e=!1,t=!1){try{if(window.odT.setup.hasOwnProperty("disablePresync")&&window.odT.setup.disablePresync)return!1;if("Chrome"!==window.odT.checkBrowser&&"Edge"!==window.odT.checkBrowser)return!1;if(window.odT.presyncLoaded)return!1;if(-1!=window.odT.consentOK.indexOf(window.odT.consentStatus)){let i="rubicon,smartadserver,pubmatic,criteo,appnexus,triplelift,outbrain,onetag,ix,thetradedesk";window.odT?.setup?.sspList&&"string"==typeof window.odT.setup.sspList&&(window.odT.setup.sspList.includes("ttd")&&(window.odT.setup.sspList=window.odT.setup.sspList.replace("ttd","thetradedesk")),i=window.odT.setup.sspList.toString());let o=window.odT?.setup?.sspPriorities?.ssp||[];o=o.map(e=>"ttd"===e.name?{...e,name:"thetradedesk"}:e);const n=o.filter(e=>1===Number(e?.priority)).map(e=>e?.name).filter(Boolean).join(","),d=o.slice().sort((e,t)=>Number(e?.priority??Number.POSITIVE_INFINITY)-Number(t?.priority??Number.POSITIVE_INFINITY)).map(e=>e?.name).filter(Boolean).join(","),s=o.slice().sort((e,t)=>Number(e?.priority??Number.POSITIVE_INFINITY)-Number(t?.priority??Number.POSITIVE_INFINITY)).map(e=>e?.name).filter(Boolean).map(e=>{const t="thetradedesk"===e?"ttd":e;if(window.odT?.setup?.s2sConfig?.[t])return"ttd"===t?"thetradedesk":t;if(window.odT?.setup?.s2sConfig?.aliasBidders?.[t]){const e=window.odT.setup.s2sConfig.aliasBidders[t];for(const i of e)if(window.odT?.setup?.s2sConfig?.[i])return t}return null}).filter(Boolean).filter((e,t,i)=>i.indexOf(e)===t).join(","),a=e?t?s||d||i:d||i:n||"",r=e?null:Number.isInteger(window.odT?.setup?.sspPriorities?.maxSspSync)?window.odT.setup.sspPriorities.maxSspSync:null;window.odT.log("Calling cookie sync function with SSPs: "+a),this.CookieSync=new w(a,r),t&&clearTimeout(window.odT.presyncTimeout),e&&!t&&(window.odT.presyncLoaded=!0)}}catch(e){}}isBackfillEnabled(e){let t=!1;if(window.odT.finalAdSlotsConfig.adSlotsDefinitions[e]&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[e].disableBackfill)return t;if(window.odT.stickyAdapter.hasFallback(e))return t;if(window.odT.engageBackfill&&window.odT.consentOK.includes(window.odT.consentStatus)){let i=window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.loadType;const o=window.odT.getPrebidAdUnitsSizes(window?.odT?.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.biddingSizes||window?.odT?.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.dfpSizes||[]);e&&!this.adAdaptersFactory.isSpecialAdSlot(e)&&(!i||i&&6!==i)&&(!i||i&&7!==i)&&(!i||i&&8!==i)&&o.length&&(t=!0)}return t}isHouseReadsEnabled(e){let t=!1;if(window.odT.finalAdSlotsConfig.adSlotsDefinitions[e]&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[e].disableHouseReads)return t;if(window.odT.stickyAdapter.hasFallback(e))return t;if(window.odT.stickyAdapter.isStickyAdSlot(e)&&!window.odT.finalAdSlotsConfig.adSlotsDefinitions[e].forceHouseReads)return t;if(window.odT.houseReads){let i=window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.loadType;const o=window.odT.getPrebidAdUnitsSizes(window?.odT?.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.biddingSizes||window?.odT?.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.dfpSizes||[]);e&&!this.adAdaptersFactory.isSpecialAdSlot(e)&&(!i||i&&6!==i)&&(!i||i&&7!==i)&&(!i||i&&8!==i)&&o.length&&(t=!0)}return t}deviceDetection(){window.odT.tools.isClientMobileOrTablet()?window.odT.tools.isClientMobile()?(window.odT.deviceCategory="Smartphone",window.odT.dDevice="30001"):(window.odT.deviceCategory="Tablet",window.odT.dDevice="30002"):"Mobile"===window.odT?.screen?(window.odT.deviceCategory="Smartphone",window.odT.dDevice="30001"):(window.odT.deviceCategory="Desktop",window.odT.dDevice="30000")}setStickyFormat(e,t,i=4e3){const o=window.odT?.setup?.anchorModeTop?window.odT.setup.anchorModeTop:0;let n,d=document.getElementById(`${window.odT.divIdPrefix}${e}`);if(!d){const t=window.odT.finalAdSlotsConfig?.adSlotsDefinitions?.[e]?.divId;t&&(d=document.getElementById(`${t}`))}if(""===window.odT.divIdPrefix&&(n=window.odT.finalAdSlotsConfig.adSlotsDefinitions?.[e]?.adUnit,e=window.odT.finalAdSlotsConfig.adSlotsDefinitions?.[e]?.divId,d=document.getElementById(`${e}`)),d&&"none"!==getComputedStyle(d).display&&"hidden"!==getComputedStyle(d).visibility){let s;window.odT.stickyFormatLoaded.push(e);let a={},r={},l=d.parentElement,c=window.getComputedStyle(d),u=window.getComputedStyle(l),p=parseFloat(c.marginTop)+parseFloat(c.marginBottom),g=Math.ceil(parseFloat(c.height)+p),w=!1;window.odT.stickyFormatClosed=!1;let h=0;r.display=u.display,r["flex-direction"]=u.flexDirection,r["align-items"]=u.alignItems,r["z-index"]=u.zIndex,!window.odT.setup.adLayoutEnabled||window.odT.setup?.adLayoutConfig?.excludedAdslots&&(window.odT.setup?.adLayoutConfig?.excludedAdslots?.includes(e)||window.odT.setup?.adLayoutConfig?.excludedAdslots?.includes(n))?(r["min-height"]=u.minHeight,r["justify-content"]=u.justifyContent,r.margin=u.margin):(r.width=u.width,r.position=u.position,r.top=u.top),a.position=c.position,a.background=c.background,a.margin=c.margin,a.width=c.width,a["max-width"]=c.maxWidth,a.top=c.top,a.left=c.left,a.right=c.right,a.display=c.display,a["padding-left"]=c.paddingLeft,a["padding-right"]=c.paddingRight,a["border-color"]=c.borderColor;const f=()=>{if(w){d.style.setProperty("visibility","hidden"),d.style.setProperty("opacity","0"),d.style.setProperty("transition","visibility 0s .5s, opacity .5s linear");const e=document.querySelector(".optidigital-close-button");e&&(e.style.setProperty("visibility","hidden"),e.style.setProperty("opacity","0"),e.style.setProperty("transition","visibility 0s .5s, opacity .5s linear"))}},m=()=>{const e=document.querySelector(".optidigital-temporary-element");e&&e.remove();const t=document.querySelector(".optidigital-close-button");t&&t.remove(),w=!1,d.style.setProperty("top","0"),d.style.setProperty("left","0"),d.style.setProperty("z-index","1"),d.style.setProperty("visibility","visible"),d.style.setProperty("opacity","1");for(const e in a)d.style.setProperty(e,a[e]);for(const e in r)l.style.setProperty(e,r[e])},v=e=>{if(!window.odT.stickyFormatClosed){let i=document.documentElement.clientWidth;if(t>0&&(h=(i-t)/2),!w||!document.querySelector(".optidigital-temporary-element")){w=!0;const t=document.createElement("div");t.classList.add("optidigital-temporary-element"),t.style.setProperty("height",`${g}px`),l.insertBefore(t,d);const i=document.createElement("div");if(i.innerHTML='<span><svg><path stroke="#ffffff" transform="translate(5.5,5) scale(0.6)" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/><circle r="7.5" cx="9.5" cy="9.5"></circle></svg></span>',i.classList.add("optidigital-close-button"),i.setAttribute("style",`position: fixed !important; top: ${o}px; left: 0; width: 100%; z-index: 2147483647; background: rgba(0,0,0, 0.2); color: #fff; height: 25px; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; user-select: none; -webkit-tap-highlight-color: transparent;`),l.insertBefore(i,d),document.querySelector(".optidigital-close-button")){const t=document.querySelector(".optidigital-close-button span");t.setAttribute("style","display: flex; height: 25px; align-items: center; position: relative; top: 0;");document.querySelector(".optidigital-close-button span svg").setAttribute("style",`position: absolute; top: 2.5px; right: ${h}px; width: 20px; height: 20px; transform: rotateY(-180deg) rotateZ(-90deg); max-width: unset;`);document.querySelector(".optidigital-close-button span svg circle").setAttribute("style",`stroke-dasharray: 47px; stroke-dashoffset: 0px; stroke-linecap: round; stroke-width: 2px; stroke: white; fill: none; animation: countdown ${e}ms linear forwards;`);let i=document.createElement("style");i.type="text/css";let o="@keyframes countdown {from {stroke-dashoffset: 0px;} to {stroke-dashoffset: 47px;}}";i.appendChild(document.createTextNode(o)),document.getElementsByTagName("head")[0].appendChild(i),t.addEventListener("click",()=>{f(),setTimeout(()=>{m(),clearTimeout(s),window.odT.stickyFormatClosed=!0},500)})}}d.setAttribute("style",`position: fixed !important; top: ${o+25}px; left: 0; right: 0; z-index: 2147483647; width: 100%; max-width: unset; background: rgba(0,0,0, 0.2); margin: 0 auto; border-color: transparent!important; padding-right: 0; padding-left: 0;`),window.odT.setup.adLayoutEnabled&&l.setAttribute("style","z-index: 2147483647"),"flex"!==getComputedStyle(l).display&&d.style.setProperty("display","flex")}};let y;const b=new window.IntersectionObserver(([e])=>{if(e.isIntersecting)return y=Date.now(),void(s=setTimeout(()=>{f(),setTimeout(()=>{m(),b.unobserve(d),window.odT.stickyFormatClosed=!0},500)},i))},{root:null,threshold:.1});if(b.observe(d),d.getBoundingClientRect().top<0){y=Date.now();let e=Date.now();e-y<i&&v(i-(e-y))}const T=()=>{const t="number"==typeof window?.odT?.setup?.anchorModeTopTrigger?window.odT.setup.anchorModeTopTrigger:25,o="number"==typeof window?.odT?.setup?.anchorModeTopTrigger?window.odT.setup.anchorModeTopTrigger:0,n=d?.getBoundingClientRect(),s=l?.getBoundingClientRect();if(n.top<t){let t=Date.now();t-y<i&&odT.stickyFormatLoaded.slice(-1)[0]===e&&v(i-(t-y))}s.top>=o&&m()};let S=!1;window.addEventListener("scroll",()=>{S||(S=!0,requestAnimationFrame(()=>{T(),S=!1}))},{passive:!0})}}registerEventCallback(e){var t=!1;return"function"==typeof e&&(window.odT.eventCallback.push(e),t=!0),t}adjustPrebidSizesForInfiniteScroll(){if(this.prebidSizesAdjusted)return!0;this.prebidSizesAdjusted=!0,this.log("Adjust sizes for Prebid infiniteScroll (remove 1800x1000)");for(let e in window.odpbjs.adUnits){if(window.odpbjs.adUnits[e].hasOwnProperty("mediaTypes")&&window.odpbjs.adUnits[e].mediaTypes.hasOwnProperty("banner")&&window.odpbjs.adUnits[e].mediaTypes.banner.hasOwnProperty("sizes"))for(let t in window.odpbjs.adUnits[e].mediaTypes.banner.sizes)1800==window.odpbjs.adUnits[e].mediaTypes.banner.sizes[t][0]&&1e3==window.odpbjs.adUnits[e].mediaTypes.banner.sizes[t][1]&&(window.odpbjs.adUnits[e].mediaTypes.banner.sizes[t][0]=1,window.odpbjs.adUnits[e].mediaTypes.banner.sizes[t][1]=1);if(window.odpbjs.adUnits[e].hasOwnProperty("sizes"))for(let t in window.odpbjs.adUnits[e].sizes)1800==window.odpbjs.adUnits[e].sizes[t][0]&&1e3==window.odpbjs.adUnits[e].sizes[t][1]&&(window.odpbjs.adUnits[e].sizes[t][0]=1,window.odpbjs.adUnits[e].sizes[t][1]=1)}return!0}cleanWallpaper(){this.log("Wallpaper cleanup");let e=document.getElementById("rp-skin-container-sandbox");null!=e&&(e.style.display="none"),e=document.getElementById("rubiconExpander"),null!=e&&(e.style.display="none")}spaManualLoad(e){if("string"==typeof e&&(window.odT.initConfig.adUnit=e),window.odT.setup.hasOwnProperty("publisherInfiniteScrollRefresh")&&"function"==typeof window.odT.setup.publisherInfiniteScrollRefresh&&window.odT.setup.publisherInfiniteScrollRefresh(window.odT.initConfig),(window.odT.setup.disableInfiniteScrollFirstLoad||window.odT.setup.spaManualMode)&&0===Object.keys(window.odT.finalAdSlotsConfig).length)window.odT.log("Call SPA manual mode after first load"),window.odT.setDefaultSizes();else if((window.odT.setup.disableInfiniteScrollFirstLoad||window.odT.setup.spaManualMode)&&Object.keys(window.odT.finalAdSlotsConfig).length){const e="Desktop"===window.odT.screen?'[class^="Billboard_"], [class^="Content_"], [class^="HalfpageAd_"], [class^="Rectangle_"], [class^="Wallpaper"], [class*=" Billboard_"], [class*=" Content_"], [class*=" HalfpageAd_"], [class*=" Rectangle_"], [class*=" Wallpaper"]':'[class^="Mobile_"], [class*=" Mobile_"]';document.querySelectorAll(e).length&&(window.odT.log("Call SPA manual mode"),document.querySelectorAll(e).forEach(e=>{window.odT.addNewAdSlot(e)}))}window.odT.log(`Call SPA function with adUnit: ${window.odT.initConfig.adUnit}`),window.odT.log("Updated adslots list",window.odT.finalAdSlotsConfig.adSlotsDefinitions),!1!==window.odT.infiniteScrollWallpaperSlot&&(window.odT.log("Manage infiniteScrollWallpaperSlot"),window.odT.adjustPrebidSizesForInfiniteScroll(),2==window.odT.infiniteScrollWallpaperSlot&&window.odT.cleanWallpaper()),window.odT.infiniteScrollId++}processCommandQueue(){window.odT.log("Processing command queue");const e=async function(e){try{if("function"!=typeof e)return;if(-1!==e.toString().indexOf("getVideoInstreamAds"))return window.odT.userAction.push("triggerInstream"),window.optidigitalCoreQueue=window.optidigitalCoreQueue||{},window.optidigitalCoreQueue.cmd=window.optidigitalCoreQueue.cmd||[],window.optidigitalCoreQueue.cmd.push(e),void window.odT.loadCore();e.call()}catch(e){window.odT.log("Error processing command : "+e.message)}};if("object"==typeof optidigitalQueue&&"object"==typeof optidigitalQueue.cmd)for(optidigitalQueue.cmd.push=function(t){e(t)};optidigitalQueue.cmd.length>0;)e(optidigitalQueue.cmd.shift())}loadOdas(e,t){if(!this.odasLoaded&&this.setup.hasOwnProperty("enableOdas")&&this.setup.enableOdas.includes(this.consentType)&&this.setup.hasOwnProperty("adSlotsConfig")&&this.setup.adSlotsConfig.hasOwnProperty("adSlotsDefinitions")&&Array.isArray(this.setup.adSlotsConfig.adSlotsDefinitions)&&this.setup.adSlotsConfig.adSlotsDefinitions.length&&this.setup.adSlotsConfig.adSlotsDefinitions.some(e=>void 0!==e.odZoneId)&&("ko"===this.consentType||this.userAction.length&&"ko"!==this.consentType)){this.log("Load odas"),this.odasLoaded=!0,"ko"===this.consentType&&(this.adserver="OD",this.buildFirstLoadAdSlots(),this.monitorLazyLoadAdSlots());let i=document.createElement("script");i.async=!0,i.type="text/javascript",i.src=`https://scripts.opti-digital.com/lib/?lib=od-exads-tagsv3&v=${odTLibs.odas}`,i.onload=function(){"undefined"!=typeof optidigitalAdsrv&&(t?t.forEach(t=>{e(t.adslotKV,t.divId,t.event)}):e())};let o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(i,o)}}isSecondChanceEnabled(e,t){let i=!1,o=t.substring(this.divIdPrefix.length);if(this.engageBackfill&&this.setup.hasOwnProperty("enableOdas")&&this.setup.enableOdas.includes(this.consentType)&&this.setup.hasOwnProperty("adSlotsConfig")&&this.setup.adSlotsConfig.hasOwnProperty("adSlotsDefinitions")&&("ko"===this.consentType||this.userAction.length&&"ko"!==this.consentType)&&!window.odT.stickyAdapter.hasFallback(e)&&(1==this.finalAdSlotsConfig.adSlotsDefinitions.hasOwnProperty(o)||Object.values(this.finalAdSlotsConfig.adSlotsDefinitions).find(e=>e.divId===o)))for(let t in this.setup.adSlotsConfig.adSlotsDefinitions)if("object"==typeof this.setup.adSlotsConfig.adSlotsDefinitions[t]&&this.setup.adSlotsConfig.adSlotsDefinitions[t].odZoneId&&this.setup.adSlotsConfig.adSlotsDefinitions[t].odSize&&e==this.setup.adSlotsConfig.adSlotsDefinitions[t].name&&!this.setup.adSlotsConfig.adSlotsDefinitions[t].disableBackfill){i=!0;break}return i}runOdasAuction(){let e=[];for(let t=0;t<window.odT.firstLoadAdSlots.length;t++)for(let i=0;i<window.odT.setup.adSlotsConfig.adSlotsDefinitions.length;i++)if("object"==typeof window.odT.setup.adSlotsConfig.adSlotsDefinitions[i]&&window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odZoneId&&window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odSize&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[window.odT.firstLoadAdSlots[t]]?.adUnit==window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].name){let o={adslot:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i]?.cdValue?window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].cdValue:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].name,zoneId:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odZoneId,size:window.odT.setup.adSlotsConfig.adSlotsDefinitions[i].odSize,divId:window.odT.finalAdSlotsConfig.adSlotsDefinitions[window.odT.firstLoadAdSlots[t]].divId};e.push(o);break}if(e.length>0){let t=window.odT.customDNR?"1":"0";optidigitalAdsrv.getAds(window.odT.initConfig.adUnit,e,"start",window.odT.consentType,window.odT.testGroup,"direct",!1,1,t)}window.odT.initCRModal()}runSecondChance(e,t,i){let o=e,n=[];for(let e in window.odT.setup.adSlotsConfig.adSlotsDefinitions)if("object"==typeof window.odT.setup.adSlotsConfig.adSlotsDefinitions[e]&&window.odT.setup.adSlotsConfig.adSlotsDefinitions[e].odZoneId&&window.odT.setup.adSlotsConfig.adSlotsDefinitions[e].odSize&&window.odT.finalAdSlotsConfig.adSlotsDefinitions[o]?.adUnit==window.odT.setup.adSlotsConfig.adSlotsDefinitions[e].name){let i={adslot:window.odT.setup.adSlotsConfig.adSlotsDefinitions[e]?.cdValue?window.odT.setup.adSlotsConfig.adSlotsDefinitions[e].cdValue:window.odT.setup.adSlotsConfig.adSlotsDefinitions[e].name,zoneId:window.odT.setup.adSlotsConfig.adSlotsDefinitions[e].odZoneId,size:window.odT.setup.adSlotsConfig.adSlotsDefinitions[e].odSize,divId:t};n.push(i);break}if(n.length>0){let e=window.odT.analytics.adSlotsLoadCount[t]>=1?"auto":"no",o=!(!i||-1==i.getConfig("targeting")?.targeting?.od_pf_group?.[0]?.indexOf("1")),d="0";window.googletag.cmd.push(function(){-1!=window.googletag.getConfig("targeting")?.targeting?.od_pf_nr?.[0]?.indexOf("1")&&(d="1")}),optidigitalAdsrv.getAds(window.odT.initConfig.adUnit,n,"unfilled",window.odT.consentType,window.odT.testGroup,e,o,d)}else{window.odT.callEventCallback("ADSLOT_UNFILLED",{adslot:{divId:t,name:e}});const i=window.googletag&&"function"==typeof window.googletag.pubads?window.googletag.pubads().getSlots().find(e=>e.getSlotElementId()===t):null,{hb_bidder:o,hb_pb:n,amznbid:d,od_pfg:s,od_pf_group:a,od_pf_pb:r}=window.odT.tools.checkSlotTargeting(i),l=window.odT.analytics.addBidderMetrics(t,o,n,d);let c={divId:e,divIdFull:t,filled:!1,demandType:"unfilled",lineItemId:null,prebidWinner:o,prebidBid:n,amazonStatus:d,oyStatus:s,oyTestGroup:a,oyPb:r,nogam:!1,bidders:Object.keys(l).length?l:null};window.odT.analytics.adRequestEvent(c)}}setPageTargeting(e,t){if(!e||!t)return;let i=window.odT?.setup?.customTargeting?.[e]?.name||e,o=window.odT?.setup?.customTargeting?.[e]?.value||t;this.log("CALL setPageTargeting key="+i+" value="+o),window.odT.customPageTargeting[i]=o,window.googletag.cmd.push(function(){window.googletag.setConfig({targeting:{[i]:o}})})}retrieveEnvelope(e){let t;try{t=decodeURIComponent(document.cookie.match("(^|;) *_lr_env=([^;]*)")[2]),t={envelope:JSON.parse(atob(t)).envelope},t=JSON.stringify(t)}catch(e){return t}finally{if(!e)return t;e(t)}}callAtsEnvelope(){const{email_md5:e,email_sha256:t,email_sha1:i}=this.initConfig.uuid,o={method:"GET"};let n=`https://api.rlcdn.com/api/identity/v2/envelope?pid=${Number(this.setup?.userids?.liverampId?.params?.pid||this.setup.liverampId)||0}`;n+=e?`&it=4&iv=${e}`:"",n+=t?`&it=4&iv=${t}`:"",n+=i?`&it=4&iv=${i}`:"",n+=`&ct=${window.optidigitalToolboxGdpr?"4":"3"}&cv=${this.consentV2TCData&&this.consentV2TCData.tcString}`;try{fetch(n,o).then(e=>e&&200!==e.status?(window.odT.skipLiveRamp=!0,!1):e).then(e=>e.json()).then(e=>{e.envelopes&&e.envelopes.length&&window.odT.getEnvelope(e.envelopes)}).catch(e=>{})}catch(e){}}refreshAtsEnvelope(){const e={method:"GET"};let t=window.odT.retrieveEnvelope();if(!t)return void window.odT.callAtsEnvelope();t=JSON.parse(t).envelope;const i=`https://api.rlcdn.com/api/identity/v2/envelope/refresh?pid=${this.setup?.userids?.liverampId?.params?.pid||this.setup.liverampId}&it=19&iv=${t}&ct=${window.optidigitalToolboxGdpr?"4":"3"}&cv=${this.consentV2TCData&&this.consentV2TCData.tcString}`;try{fetch(i,e).then(e=>e&&200!==e.status?(window.odT.skipLiveRamp=!0,!1):e).then(e=>e.json()).then(e=>{e.envelopes&&e.envelopes.length?window.odT.getEnvelope(e.envelopes):window.odT.callAtsEnvelope()}).catch(e=>{})}catch(e){}}calculateEnvelopeTTL(e,t){let i=2592e3;"US"===e&&"CA"===t&&(i=1296e3);return{expirationTime:i,expirationDate:1e3*i+ +new Date}}getEnvelope(e){const t=e.find(e=>"envelopeLiveramp"===e.source),i=e.find(e=>"pairIds"===e.source),o=t?t.value:null,n=i?i.value:null,d=window.odT.calculateEnvelopeTTL();if(o){const e={envelope:o},t=btoa(JSON.stringify(e));window.odT.liveRampObj=t,window.odT.setCookie("_lr_env",encodeURIComponent(t),d.expirationTime),window.odT.setCookie("_lr_env_exp",d.expirationDate,d.expirationTime)}if(n){const e=atob(n),t={envelope:JSON.parse(e)},i=btoa(JSON.stringify(t));window.odT.setCookie("_lr_pairId",encodeURIComponent(i),d.expirationTime),window.odT.setCookie("_lr_pairId_exp",d.expirationDate,d.expirationTime),window.odT.pairIdObj=i}}setPpid(){if(this.setup.enablePPID&&this.consentV2TCData&&this.consentV2TCData.hasOwnProperty("publisher")&&this.consentV2TCData.publisher.hasOwnProperty("consents")&&this.consentV2TCData.publisher.consents[1]){let e;const t=this.setup?.enablePPIDSource;if(t){const i=window.localStorage.getItem(t);if(i)try{const o=decodeURIComponent(i);let n;try{n=JSON.parse(o)}catch{n=o}e="id5Id"===t?n?.gp:n}catch(e){}else e=window.odT?.getCookie(t)}if(this.setup.hasOwnProperty("enablePPIDSource")&&!e)return;e||(e=this.getCookie("_oppid"));const i=15552e3;if(!e)try{e=self.crypto.randomUUID()}catch(t){e=this.tools.generateUuid()}this.setCookie("_oppid",e,i),window.googletag.cmd.push(function(){window.googletag.pubads().setPublisherProvidedId(e)})}}setSlotTargeting(e,t,i,o="optidigital",n=!1){const d=!!window.odT.setup.enableSendAllBids&&`_${o}`;let s=window.odT?.setup?.customTargeting?.[t]?.name||t,a=window.odT?.setup?.customTargeting?.[t]?.value||i;e.setConfig({targeting:{[s]:a}}),d&&n&&(s=`${s}${d}`.slice(0,20),e.setConfig({targeting:{[s]:a}}))}initCRModal(){if(window.odT.setup.crZoneId&&!window.odT.consentOK.includes(window.odT.consentStatus)){window.odT.log("Load Consent Recovery Modal");const e=window.odT.setup.crZoneId;let t=document.createElement("div");t.setAttribute("id","optidigital-adslot-CRModal"),t.setAttribute("class","CRModal"),t.setAttribute("style","display:none;"),document.body.appendChild(t);let i=[],o={zoneId:e,adslot:"CRModal",size:[1,1],divId:"optidigital-adslot-CRModal"};i.push(o);let n=window.odT.customDNR?"1":"0";optidigitalAdsrv.getAds(window.odT.initConfig.adUnit,i,"start",window.odT.consentType,window.odT.testGroup,"direct",!1,n)}}start(){this.runAuction("cmpConsentReadyOK")}loadByGroup(e,t=!0){if(window.odT.setup?.adSlotsConfig?.groups&&"object"==typeof window.odT.setup.adSlotsConfig.groups&&e){Object.keys(window.odT.setup.adSlotsConfig.groups).forEach(e=>{Object.values(window.odT.finalAdSlotsConfig.adSlotsDefinitions).forEach(t=>{window.odT.setup.adSlotsConfig.groups[e].includes(t.adUnit)&&!window.odT.setup.adSlotsConfig.groups[e].includes(t.name)&&window.odT.setup.adSlotsConfig.groups[e].push(t.name)})});Object.entries(window.odT.setup.adSlotsConfig.groups).filter(([t,i])=>i.some(t=>e.includes(t))).forEach(([t,i])=>{i.forEach(t=>{!e.includes(t)&&Object.values(window?.odT?.finalAdSlotsConfig?.adSlotsDefinitions)?.find(e=>e.name===t)&&e.push(t)})})}t&&(window.odT.lazyLoadPendingAdSlots=window.odT.lazyLoadPendingAdSlots.filter(t=>!e.includes(t)))}getPrebidAdUnitsSizes(e){return e.filter(function(e){let t=!1;if(void 0!==e&&2==e.length)for(let i in window.odT.prebidSizes)window.odT.prebidSizes[i][0]==e[0]&&window.odT.prebidSizes[i][1]==e[1]&&(t=!0);return t})}isElementUnderBlur(e,t){if(!e)return!1;return((e,t)=>{let i=e.parentElement;for(;i;){if(i.style.filter.includes("blur("))return!0;if(i===t)break;i=i.parentElement}return!1})(e,t)}checkServicesReady(){return(window.odT.id5Obj||!window.odT.id5Permission)&&(window.optiyield._ready||window.odT.skipOy)&&(window.odT.liveRampObj||window.odT.skipLiveRamp)&&(window.odT.iasReady||!window.odT.iasId)&&(window.odT.cookieSyncReady||!window.odT.enableCookieSync)}loadAPS(){if(window.odT.setup.biddersSetup&&window.odT.setup.biddersSetup.hasOwnProperty("amazon")&&(0==window.odT.setup.hasOwnProperty("skipAmazonInit")||1!=window.odT.setup.skipAmazonInit)&&(!window.odT.setup.biddersSetup?.amazon?.countries?.length||window.odT.setup.biddersSetup?.amazon?.countries.includes(window.optidigitalToolboxCC))&&(!window.odT.setup.biddersSetup?.amazon?.browsers?.length||window.odT.setup.biddersSetup?.amazon?.browsers.includes(window.odT.checkBrowser.toLowerCase()))&&(!window.odT.setup.biddersSetup?.amazon?.devices?.length||window.odT.setup.biddersSetup?.amazon?.devices.includes(window.odT.deviceCategory.toLowerCase()))&&!window.odT.enableAmazonAPS){const t=document.getElementsByTagName("script")[0],i=document.createElement("link");i.rel="preconnect",i.href="https://aax.amazon-adsystem.com",t.parentNode.insertBefore(i,t);const o=document.createElement("link");o.rel="preload",o.as="script",o.href=`https://config.aps.amazon-adsystem.com/configs/${window.odT.setup.amazonPubId?window.odT.setup.amazonPubId:window.odT.setup.biddersSetup.amazon.pubID}`,o.setAttribute("fetchpriority","high"),t.parentNode.insertBefore(o,t);const n=document.createElement("script");n.async=!0,n.src=`https://config.aps.amazon-adsystem.com/configs/${window.odT.setup.amazonPubId?window.odT.setup.amazonPubId:window.odT.setup.biddersSetup.amazon.pubID}`,n.setAttribute("fetchpriority","high"),t.parentNode.insertBefore(n,t);const d=document.createElement("link");d.rel="preload",d.as="script",d.href="https://client.aps.amazon-adsystem.com/publisher.js",d.setAttribute("fetchpriority","high"),t.parentNode.insertBefore(d,t);const s=document.createElement("script");s.async=!0,s.src="https://client.aps.amazon-adsystem.com/publisher.js",s.setAttribute("fetchpriority","high"),t.parentNode.insertBefore(s,t),window.aps=((e=(window.odT.setup.amazonPubId?window.odT.setup.amazonPubId:window.odT.setup.biddersSetup.amazon.pubID))=>{window._aps=window._aps||new Map,window._aps.has(e)||window._aps.set(e,{queue:[],store:new Map([["listeners",new Map]])});let t={accountID:e,record:function(e,t){return new Promise((i,o)=>{_aps.get(this.accountID).queue.push(new CustomEvent(e,{detail:{...t,resolve:i,reject:o}}))})},read:function(e){return this.record("bootstrap/store/willRead",{name:e}),_aps.get(this.accountID).store.get(e)},run:function(e,t){_aps.get("_system")?.store.get("listeners").has(e)?this.record(e,t):this.record("bootstrap/run/willDrop",{name:e,detail:t})},react:function(e,t){_aps.get(this.accountID).store.get("listeners").set(e,t),this.record("bootstrap/react/didExecute",{name:e})}};return t.record("bootstrap/version/declare",{version:6}),t})(),((e=window.aps)=>{window.apstag=window.apstag||{init:function(t,i){e.record("legacy/init/enqueue",{config:t,callback:i})},fetchBids:function(t,i){e.record("legacy/fetchBids/enqueue",{bidConfig:t,callback:i})},setDisplayBids:function(){e.run("legacy/setDisplayBids/enqueue",{arguments})},targetingKeys:function(){return e.read("legacy/targetingKeys")??[]},rpa:function(t,i,o){e.record("legacy/rpa/enqueue",{tokenConfig:t,callback:i,setCookie:o})},upa:function(t,i,o){e.record("legacy/upa/enqueue",{tokenConfig:t,callback:i,setCookie:o})},dpa:function(t){e.record("legacy/dpa/enqueue",{callback:t})}},e.record("bootstrapExtAPStag/version/declare",{version:1})})(),((e=window.aps)=>{window.apstag={...window.apstag,queue:{push:function(t){e.record("legacy/queue/push",{callback:t})}}},e.record("bootstrapExtQueue/version/declare",{version:1})})(),((e=window.aps)=>{window.apstag={...window.apstag,nativeContent:function(){return{enable:function(){e.record("nativeCommerceAds/service/enable")},registerHook:function(t,i){if("nativeContent.updateClickUrl"!==t)throw new Error("Unsupported event type");e.react("nativeCommerceAds/clickUrl/update",e=>({status:"completed",value:{url:i(e?.detail?.url,e?.detail?.element)}}))}}}},e.record("bootstrapExtNCA/version/declare",{version:1})})();var e={pubID:window.odT.setup.amazonPubId?window.odT.setup.amazonPubId:window.odT.setup.biddersSetup.amazon.pubID,adServer:"googletag",videoAdServer:"DFP",isSelfServePub:!0};!window.odT.setup.hasOwnProperty("info")||!window.odT.setup.info.hasOwnProperty("siteId")||window.odT.setup?.directBidders?.length&&window.odT.setup?.directBidders?.includes("amazon")||(e.schain={complete:1,ver:"1.0",nodes:[{asi:"optidigital.com",sid:window.odT?.setup?.info?.sellerId?window.odT.setup.info.sellerId.toString():window.odT.odNetworkId?`p${window.odT.setup.info.publisherId.toString()}`:window.odT.setup.info.siteId.toString(),hp:1}]}),window.apstag.init(e),window.odT.enableAmazonAPS=!0}(window.odT.setup.hasOwnProperty("skipAmazonInit")||1==window.odT.setup.skipAmazonInit)&&(window.odT.enableAmazonAPS=!0)}getAPSAdslotSizes(e){return e.filter(function(e){let t=!1;if(void 0!==e&&2==e.length)for(let i in window.odT.apsSizes)window.odT.apsSizes[i][0]==e[0]&&window.odT.apsSizes[i][1]==e[1]&&(t=!0);return t})}convertBidCpm(e=null){let t=e;if(t){const i=window.odT.convertToCurrency(e,"EUR"),o=window.odT.setup.prebidPriceGranularity?window.odT.setup.prebidPriceGranularity:window.odT.defaultPriceGranularity;t=window.odT.getCpmStringValue(i,o.buckets)}return t}openConnection(){try{if(!this.setup?.sspPriorities?.ssp)return;window.odT.log("Open connection");const e="https://pbs.optidigital.com/status",t=new XMLHttpRequest;t.withCredentials=!window.optidigitalToolboxGdpr,t.open("GET",e,!0),t.timeout=3e3,t.onreadystatechange=function(){this.readyState},t.send()}catch(e){}}}export{S as default};