import{f as u,o as c,w as m,b as d}from"./vue-vendor-CxLCUzY4.js";import{n as f,q as w,r as L}from"./index-B_2CoVdl.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";function W(e,l){const o=u(0),r=u(0);let a=()=>{L(e.value)?(o.value=e.value.scrollX,r.value=e.value.scrollY):e.value&&(o.value=e.value.scrollLeft,r.value=e.value.scrollTop)};if(f(l)){let t=0;l.wait&&l.wait>0&&(t=l.wait,Reflect.deleteProperty(l,"wait")),a=w(a,t)}let s;c(()=>{s=m(e,(t,i,v)=>{t?t.addEventListener("scroll",a):i&&i.removeEventListener("scroll",a),v(()=>{o.value=r.value=0,t&&t.removeEventListener("scroll",a)})},{immediate:!0})}),d(()=>{e.value&&e.value.removeEventListener("scroll",a)});function n(){s&&s()}return{refX:o,refY:r,stop:n}}export{W as useScroll};
