import{bA as c,c$ as w,bL as a,d0 as m,bd as h}from"./index-BKKvzUDD.js";import{r as v,c as y}from"./raf-C-x62Pcl.js";let n;const S=o=>{var s;if(!c)return 0;if(n!==void 0)return n;const e=document.createElement("div");e.className=`${o}-scrollbar__wrap`,e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);const r=e.offsetWidth;e.style.overflow="scroll";const t=document.createElement("div");t.style.width="100%",e.appendChild(t);const l=t.offsetWidth;return(s=e.parentNode)==null||s.removeChild(e),n=r-l,n};function g(o,e){if(!c)return;if(!e){o.scrollTop=0;return}const r=[];let t=e.offsetParent;for(;t!==null&&o!==t&&o.contains(t);)r.push(t),t=t.offsetParent;const l=e.offsetTop+r.reduce((u,d)=>u+d.offsetTop,0),s=l+e.offsetHeight,i=o.scrollTop,f=i+o.clientHeight;l<i?o.scrollTop=l:s>f&&(o.scrollTop=s-o.clientHeight)}export{S as g,g as s};
