import{am as u,G as f,F as w,af as v,an as m}from"./D0ctIA8a.js";import{w as a}from"./XWfk0Wf1.js";function x(s,e,l=e){var d=s==="x",o=()=>u(()=>{r=!0,clearTimeout(t),t=setTimeout(n,100),l(window[d?"scrollX":"scrollY"])});addEventListener("scroll",o,{passive:!0});var r=!1,t,n=()=>{r=!1},i=!0;f(()=>{var c=e();i?i=!1:!r&&c!=null&&(r=!0,clearTimeout(t),scrollTo(window.scrollX,c),t=setTimeout(n,100))}),w(o),v(()=>{removeEventListener("scroll",o)})}function S(s,e){m(window,["resize"],()=>u(()=>e(window[s])))}const _=a(0),b=()=>{const{subscribe:s,set:e}=a(0);return _.subscribe(l=>{e(l)}),{subscribe:s}},g=b();function L({top:s,behavior:e}){window.scrollTo({top:s,behavior:e})}const Y=a(null);export{Y as a,S as b,x as c,_ as f,g as l,L as s};