(()=>{var t={flyoutMenu:null,wpfooter:null,overlap:null,init:function(){if(this.flyoutMenu=document.getElementById("edd-flyout"),this.flyoutMenu){var t=document.getElementById("edd-flyout-button"),e=t.querySelector("img"),i=document.getElementById("edd-flyout-items"),o={state:"inactive",srcInactive:e.getAttribute("src"),srcActive:e.dataset.active};t.addEventListener("click",(t=>{t.preventDefault(),"active"===o.state?(this.flyoutMenu.classList.remove("opened"),e.setAttribute("src",o.srcInactive),o.state="inactive",i.classList.remove("active")):(this.flyoutMenu.classList.add("opened"),e.setAttribute("src",o.srcActive),o.state="active",i.classList.add("active"))})),this.wpfooter=document.getElementById("wpfooter"),this.wpfooter&&(this.overlap={},window.addEventListener("resize",this.handleScroll.bind(this)),window.addEventListener("scroll",(()=>this.debounce(this.handleScroll.bind(this),50))),window.addEventListener("load",this.handleScroll.bind(this)),document.addEventListener("edd_promo_notice_enter",(()=>this.flyoutMenu.classList.add("out"))),document.addEventListener("edd_promo_notice_dismiss",(()=>setTimeout(this.flyoutMenu.classList.remove("out"),500))))}},handleScroll:function(){if(!(this.overlap.length<1)){var t=this.wpfooter.offsetTop,e=t+this.wpfooter.offsetHeight,i=this.overlap.length>0?this.overlap[0].offsetTop+this.overlap[0].offsetHeight+85:0,o=window.scrollY,s=o+window.innerHeight;e<=s&&t>=o&&i>s?this.flyoutMenu.classList.add("out"):this.flyoutMenu.classList.remove("out")}},debounce:function(t,e,i){var o;return function(){var s=this,n=arguments,l=i&&!o;clearTimeout(o),o=setTimeout((function(){o=null,i||t.apply(s,n)}),e),l&&t.apply(s,n)}}};wp.domReady((function(){t.init()}))})();