"use strict";function GSPBtoggleBgScroll(e){"block"!=e&&"modal"!=e&&document.body.classList.toggle("scrollhidden")}function GSPBtogglemodaldialog(e,t,l="toggle"){"modal"==t&&(e.open&&"toggle"==l||"close"==l?e.close():e.showModal())}function GSPBSlidingPanelInit(e=document){let t=e.getElementsByClassName("gspb_button_wrapper");for(let l=0;l<t.length;l++){let a=t[l],i=a.dataset.paneltype;if(void 0===i)continue;let o=a.getAttribute("id"),n=a.querySelector(".gspb_slidingPanel"),s=n.dataset.hover,c=document.documentElement.clientWidth,d=n.dataset.autotrigger,g=n.dataset.closeintent,r=n.dataset.closeintentonce,v=n.dataset.autotriggertime,p=n.dataset.placebody,u=n.dataset.clickselector,S=n.dataset.closeselector,f=n.dataset.dynamicbefore,L=n.dataset.dynamicafter,y=a.querySelector('[data-panelid="'+o+'"]');y||(y=e.querySelector('[data-panelid="'+o+'"]'));let m=a.querySelector(".gspb_slidingPanel-close"),B=a.querySelectorAll(".gspb-custom-close");if(S&&(B=e.querySelectorAll(S)),f||L){let k=y.querySelector(".gspb_slidingPanel-inner");if(f){let b=e.querySelector(f);if(b){let E=document.createElement("div");E.classList.add("gspb-dynamic-content-before"),E.innerHTML=b.innerHTML,k.firstChild?k.insertBefore(E,k.firstChild):k.appendChild(E)}}if(L){let P=e.querySelector(L);if(P){let h=document.createElement("div");h.classList.add("gspb-dynamic-content-after"),h.innerHTML=P.innerHTML,k.appendChild(h)}}}if("block"!=i&&"modal"!=i&&p){let G=document.createElement("div");G.classList.add(o),G.setAttribute("data-paneltype",i),G.appendChild(y),document.body.appendChild(G)}if(a){let $=a.querySelector(".gspb-buttonbox");if("true"==s&&c>1024?(a.addEventListener("mouseenter",function(e){y.classList.add("active"),GSPBtogglemodaldialog(y,i,"open"),"block"!=i&&"modal"!=i&&document.body.classList.add("scrollhidden")},!1),a.addEventListener("mouseleave",function(e){y.classList.remove("active"),GSPBtogglemodaldialog(y,i,"close"),document.body.classList.remove("scrollhidden")},!1)):$.addEventListener("click",function(e){e.preventDefault(),y.classList.toggle("active"),GSPBtogglemodaldialog(y,i),a.classList.toggle("panelactive"),GSPBtoggleBgScroll(i)},!1),$.addEventListener("keydown",function(e){let t=void 0!==e.key?e.key:e.keyCode;("Enter"===t||13===t||["Spacebar"," "].indexOf(t)>=0||32===t)&&(e.preventDefault(),this.click())}),u){let _=a.closest(u);(_=_?[_]:e.querySelectorAll(u)).length&&_.forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),y.classList.toggle("active"),GSPBtogglemodaldialog(y,i),a.classList.toggle("panelactive"),e.classList.toggle("panelactive"),GSPBtoggleBgScroll(i)}),e.addEventListener("keydown",function(e){let t=void 0!==e.key?e.key:e.keyCode;("Enter"===t||13===t||["Spacebar"," "].indexOf(t)>=0||32===t)&&(e.preventDefault(),this.click())})})}if(m&&(m.addEventListener("click",function(e){y.classList.toggle("active"),GSPBtogglemodaldialog(y,i),a.classList.toggle("panelactive"),GSPBtoggleBgScroll(i)},!1),m.addEventListener("keydown",function(e){let t=void 0!==e.key?e.key:e.keyCode;("Enter"===t||13===t||["Spacebar"," "].indexOf(t)>=0||32===t)&&(e.preventDefault(),this.click())})),n.addEventListener("click",function(e){e.target.classList.contains("gspb_slidingPanel")&&(y.classList.toggle("active"),GSPBtogglemodaldialog(y,i),a.classList.toggle("panelactive"),GSPBtoggleBgScroll(i))},!1),B&&B.length>0&&B.forEach(e=>{e.addEventListener("click",function(e){y.classList.toggle("active"),GSPBtogglemodaldialog(y,i),a.classList.toggle("panelactive"),GSPBtoggleBgScroll(i)},!1),e.addEventListener("keydown",function(e){let t=void 0!==e.key?e.key:e.keyCode;("Enter"===t||13===t||["Spacebar"," "].indexOf(t)>=0||32===t)&&(e.preventDefault(),this.click())})}),d&&v&&setTimeout(()=>{y.classList.toggle("active"),GSPBtogglemodaldialog(y,i),a.classList.toggle("panelactive"),GSPBtoggleBgScroll(i)},1e3*parseFloat(v)),g){let q=e=>{let t=!e.toElement&&!e.relatedTarget&&e.clientY<10;if(r){let l=localStorage.getItem(r);l&&"1"==l&&(t=!1)}t&&(document.removeEventListener("mouseout",q),y.classList.toggle("active"),GSPBtogglemodaldialog(y,i),a.classList.toggle("panelactive"),GSPBtoggleBgScroll(i),r&&localStorage.setItem(r,"1"))};setTimeout(()=>{document.addEventListener("mouseout",q)},2e3)}"modal"==i&&y.addEventListener("click",e=>{let t=y.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&(y.close(),y.classList.remove("active"),GSPBtoggleBgScroll(i))})}}}GSPBSlidingPanelInit(),document.addEventListener("keydown",function(e){if("Escape"===e.key){let t=document.querySelectorAll(".gspb_slidingPanel");t.length&&t.forEach(e=>{let t=e.parentNode.dataset.paneltype;e.classList.remove("active"),GSPBtoggleBgScroll(t)});let l=document.querySelectorAll(".clickWrapNode");l.length&&l.forEach(e=>{e.classList.remove("panelactive")})}});