!function(){"use strict";var t=function(t){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()},e=JSON.parse('{"xl":"1280","lg":"1024","md":"768","sm":"600","xs":"480"}'),i=Object.keys(e).reduce(((t,i)=>{const n=parseInt(e[i],10),o=n/16+"rem",s=(n-1)/16+"rem";return t[`${i}Min`]=window.matchMedia(`(min-width: ${o})`),t[`${i}Max`]=window.matchMedia(`(max-width: ${s})`),t}),{});const n=window.requestAnimationFrame;class o{constructor(t,e,i,n=250){Object.assign(this,{callback:t,event:e,element:i,frequency:n,timeout:!1}),this.requestTick=this.requestTick.bind(this),this.update=this.update.bind(this),this.callback?this.addHandler():console.error("Throttle error: you must specify a callback.")}addHandler(){this.element.addEventListener(this.event,this.requestTick)}update(){n(this.callback),window.clearTimeout(this.timeout),this.timeout=!1}requestTick(){this.timeout||(this.timeout=window.setTimeout(this.update,this.frequency))}destroy(){this.element.removeEventListener(this.event,this.requestTick),window.clearTimeout(this.timeout),this.timeout=!1}}var s;s=new WeakMap,function(e){const{component:i,load:n,name:o,querySelector:s={},querySelectorAll:r={},options:a={}}=e;if("function"!=typeof i)return;const c=()=>{(()=>{const t=void 0===o?null==e?void 0:e.root:`[data-component='${o}']`;let i;try{i=document.querySelectorAll(t)}catch(t){return console.error(t),[]}return i.length<1?(console.log(`No elements found for ${t}`),[]):Array.from(i).map((t=>{const e={};return Object.keys(s).forEach((i=>{e[i]=t.querySelector(s[i])})),Object.keys(r).forEach((i=>{const n=t.querySelectorAll(r[i]);e[i]=Array.from(n)})),{element:t,children:e,options:a}}))})().forEach((t=>new i(t)))};if(!1===n)return c;!0!==n?function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e)if("function"==typeof i)i(e);else if(Array.isArray(i)){const[t,n]=i;null==t||t.addEventListener(n,e)}}(c,n):c()}({name:"billboardOverlay",component:class{constructor({element:t,options:e}){if(s.set(this,!1),this.handleAdSlotLoaded=()=>{this.isSticky=!0,this.isScrolledPastBillboard?this.activateStickyCountdown():this.throttle=new o(this.activateStickyCountdown,"scroll",window)},this.handleTransitionend=()=>{const{stickyClass:t}=this.options;window.requestAnimationFrame((()=>{this.element.classList.toggle(t,this.isSticky),this.element.attributeStyleMap.clear()})),this.isSticky||this.element.removeEventListener("transitionend",this.handleTransitionend)},this.activateStickyCountdown=()=>{var t;window.scrollY>=100&&(setTimeout((()=>{this.isSticky=!1}),5e3),null===(t=this.throttle)||void 0===t||t.destroy())},this.element=t,this.options=e,i.lgMin.matches){const{height:t,top:e}=this.element.getBoundingClientRect();this.billboardBottom=window.pageYOffset+t+e,this.reducedMotionPref=window.matchMedia("(prefers-reduced-motion: no-preference)"),this.element.addEventListener("transitionend",this.handleTransitionend),this.element.addEventListener("nyp.slotOnload",this.handleAdSlotLoaded)}}get isScrolledPastBillboard(){return this.billboardBottom<=window.scrollY}set isSticky(t){(function(t,e,i,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(t,i):o?o.value=i:e.set(t,i)})(this,s,t,"f"),this.isScrolledPastBillboard&&this.reducedMotionPref.matches?window.requestAnimationFrame((()=>{this.element.attributeStyleMap.set("transform","translateY(-100%)")})):this.handleTransitionend();const e=new CustomEvent("nyp.billboardStickyChange",{bubbles:!0,composed:!0,detail:{isSticky:this.isSticky}});this.element.dispatchEvent(e)}get isSticky(){return function(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}(this,s,"f")}},options:{stickyClass:"is-sticky"}})}();