import{b as t}from"./p-B1u-Mq75.js";class o{constructor(){this.x=void 0,this.y=void 0,this.disabled=!1}static disableSmoothScrolling(){this.setScrollBehavior("auto")}static enableSmoothScrolling(){this.setScrollBehavior("smooth")}static setScrollBehavior(o){var i;if(t.hasDocument){const t=document;document.body.style.scrollBehavior=o;const s=null===(i=t.firstChild)||void 0===i?void 0:i.nextSibling;"smooth"===getComputedStyle(s).scrollBehavior&&(s.style.scrollBehavior=o)}}connect(o){o?this.target=o:t.hasDocument&&(this.target=document),onscroll=null,onkeydown=null}disconnect(){this.disabled&&this.enable(),this.target=void 0,onscroll=null,onkeydown=null}isDisabled(){return this.disabled}enable(){this.target&&t.hasWindow&&t.hasDocument&&(document.documentElement.style.overflow="",document.body.classList.remove("noscroll"),document.body.style.position="",document.body.style.top="",document.body.style.width="",void 0!==this.x&&void 0!==this.y&&(window.scrollTo(this.x,this.y),this.x=void 0,this.y=void 0),this.disabled=!1)}disable(){!this.disabled&&this.target&&t.hasWindow&&t.hasDocument&&(this.x=window.pageXOffset||document.documentElement.scrollLeft,this.y=window.pageYOffset||document.documentElement.scrollTop,document.documentElement.style.overflow="hidden",document.body.classList.add("noscroll"),document.body.style.position="fixed",document.body.style.top=`-${this.y}px`,document.body.style.width="100%",this.disabled=!0)}}export{o as B}