!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";const e=3,t=2,n=0,i=1,o=n,r=new URL(window.location.href).searchParams.get("aditude_debug");let s=n;switch(r){case"3":s=e;break;case"2":case"99":s=t;break;case"1":case"true":s=i;break;default:s=n}const d=(e,t={})=>{var n,i,r;const d=null!==(n=t.type)&&void 0!==n?n:"log",a=null!==(i=t.label)&&void 0!==i?i:{text:"",color:"#339933"},l=null!==(r=t.level)&&void 0!==r?r:o;return(...e)=>{l<=s&&((e,t)=>{console[e](...t)})(d,((e,t)=>{const n=[].slice.call(e),{label:i,prefix:o}=t;o&&n.unshift(o);const r=[],s=[];function d(e){return`display: inline-block; color: #fff; font-size: 9px; background: ${e}; padding: 1px 4px; border-radius: 0; margin-right: 1px;`}return s.push("%ctudeserve"),i.text.length>0&&s.push(`%c${i.text}`),i.text.length>0&&r.push(d(i.color)),r.push(d("green")),r.forEach((e=>{n.unshift(e)})),n.unshift(s.join("")),n})(e,{prefix:"",label:a}))}},a=d(0,{label:{text:"log",color:"#61B321"},level:i}),l=d(0,{type:"error",label:{text:"error",color:"red"},level:i}),c=d(0,{label:{text:"verbose",color:"#61B321"},level:e});function u(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function d(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,d)}a((i=i.apply(e,t||[])).next())}))}function h(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function m(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;class p{constructor(e){var t,n,i;this.currency="USD",this.slotId=e.slotId,this.bidder=null!==(t=e.bidder)&&void 0!==t?t:e.source,this.source=e.source,this.amount=e.amount,this.mediaType=null!==(n=e.mediaType)&&void 0!==n?n:"unknown",this.sourceData=e.sourceData,this.currency=null!==(i=e.currency)&&void 0!==i?i:"USD",c("Bid created",this)}toJson(){return{slotId:this.slotId,source:this.source,bidder:this.bidder,amount:this.amount,currency:this.currency,mediaType:this.mediaType,sourceData:this.sourceData}}}var f;class v{constructor(e,t,n,i,o=!0){this.adUnit=e,this.elementId=t,this.sizes=n,this.keyValues=i,this.safeframe=o,f.set(this,[]),a("Slot created",this)}getElement(){return document.getElementById(this.elementId)}get bids(){return h(this,f,"f")}set bids(e){c("setting bids to slot",{slot:this,bids:e}),m(this,f,e,"f")}clearBids(){m(this,f,[],"f")}}f=new WeakMap;const w=(e,t)=>new CustomEvent(`tudeserve_${e}`,{detail:t}),g=(e,t)=>{e.dispatchEvent(t),c(`event:${t.type.replace("tudeserve_","")} dispatched`,t.detail)};class b{on(e,t){window.addEventListener(`tudeserve_${e}`,(e=>{t(e.detail)})),c(`event:${e} listener registered`)}}const y=(e,t,n)=>{let i,o=0;new IntersectionObserver(((e,r)=>{e.forEach((e=>{e.isIntersecting?i=setInterval((()=>{o+=100,o>1e3&&(g(window,w("viewable",{slot:t,bid:n})),r.unobserve(e.target),clearInterval(i))}),100):clearInterval(i)}))}),{root:null,rootMargin:"0px 0px 0px 0px",threshold:.5}).observe(e)};let S;const E=new Uint8Array(16);function T(){if(!S&&(S="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!S))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return S(E)}const k=[];for(let e=0;e<256;++e)k.push((e+256).toString(16).slice(1));var A={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function I(e,t,n){if(A.randomUUID&&!t&&!e)return A.randomUUID();const i=(e=e||{}).random||(e.rng||T)();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k[e[t+0]]+k[e[t+1]]+k[e[t+2]]+k[e[t+3]]+"-"+k[e[t+4]]+k[e[t+5]]+"-"+k[e[t+6]]+k[e[t+7]]+"-"+k[e[t+8]]+k[e[t+9]]+"-"+k[e[t+10]]+k[e[t+11]]+k[e[t+12]]+k[e[t+13]]+k[e[t+14]]+k[e[t+15]]}(i)}class D{constructor(){this.timings={}}addTiming(e,t){this.timings[e]=null!=t?t:Date.now()}getTiming(e){return this.timings[e]}}class x{constructor(e){this.results=[],this.slots=[],this.tt=new D,this.status="init",this.id=I(),this.slots=null!=e?e:[],this.logTiming("init"),c("Request created",this)}nextStep(){switch(this.status){case"init":this.status="requested",this.logTiming("requested");break;case"requested":this.status="complete",this.logTiming("complete");break;default:l("Request already ended",this)}}addResult(e){this.results.push(e)}logTiming(e){this.tt.addTiming(e)}getTimings(){const e=this.tt.getTiming("init"),t=this.tt.getTiming("requested"),n=this.tt.getTiming("complete");return{startToRequest:t&&e?t-e:null,requestToComplete:n&&t?n-t:null,startToComplete:n&&e?n-e:null}}}const R=e=>{const t=document.createElement("iframe");return t.id=`tudeserve-frame--${e.elementId}`,t.name=t.id,t.setAttribute("width","1"),t.setAttribute("height","1"),t.setAttribute("scrolling","no"),t.setAttribute("frameBorder","0"),t.style.background="#fff",t.sandbox.add("allow-forms","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation","allow-presentation"),t};function j(e){if(e&&"createElement"in e&&"head"in e){const t=e.createElement("style");t.appendChild(e.createTextNode("html,body {padding:0;margin:0;}")),e.head.appendChild(t)}}function $(e,t,n){const i=document.createElement("script");t&&(i.onload=()=>t(!0)),n&&(i.onerror=e=>n(e)),i.async=!1,i.src=e,document.head.appendChild(i)}class _{static getSafeframeApi(){return u(this,void 0,void 0,(function*(){return this.promise||(this.promise=this.load()),this.promise}))}static load(){return u(this,void 0,void 0,(function*(){var e,t;const n=["https://edge.aditude.io/safeframe/1-1-1/js/lib/base.js","https://edge.aditude.io/safeframe/1-1-1/js/host/host.js","https://edge.aditude.io/safeframe/1-1-1/js/lib/boot.js"];n.forEach((e=>{const t=document.createElement("link");t.rel="preload",t.as="script",t.href=e,document.head.appendChild(t)}));for(const e of n)yield new Promise(((t,n)=>{$(e,t,n)}));null===(t=null===(e=window.$sf)||void 0===e?void 0:e.host)||void 0===t||t.Config({renderFile:"https://edge.aditude.io/safeframe/1-1-1/html/container.html",auto:!1,debug:!0,positions:{},supports:{"exp-ovr":0,"exp-push":0,bg:0,pin:0,"read-cookie":0,"write-cookie":0}});const i=document.createElement("style");return i.textContent=".tudeserve-wrap .iab_sf { display: inline-block; }",document.head.appendChild(i),window.$sf}))}}function B(){return u(this,void 0,void 0,(function*(){return _.getSafeframeApi()}))}function C(e){e=e||{};const t={};try{Object.keys(e).forEach((n=>{const i=e[n];(i||"0"===String(i))&&(Array.isArray(i)&&i.length?t[n]=i.map(String):t[n]=[String(i)])}))}catch(e){}return t}function U(e){const t=document.location.href,n=C(e);return`