import{akasC,basI,RasY,dasU,Basae,aasle,Casre,Hasne,aTasD,a9asq,oasB,easK,wasoe,Kasie,qasj,aLasce,nasP,fasN,alas$,Lasue,Zasfe,yasd,btasve,jas_,casse,sasV,Masde,DasF,cQasme,Gashe,PasG,bzaspe,hasbe,rasge,gasye,a3asSe,aKasQ,amasZ,a7asJ,Faswe,zasze,lasEe}from"./index-OHfcEHzU.js";import{uasxe}from"./index-e-x1HcvT.js";constTe=I({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:Y([String,Object,Array,Boolean]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:Y([String,Object,Array,Boolean]),default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void0},id:String,role:String,...xe(["ariaLabel","ariaOrientation"])}),He={"end-reached":l=>["left","right","top","bottom"].includes(l),scroll:({scrollTop:l,scrollLeft:u})=>[l,u].every(C)},_e={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},Le=({move:l,size:u,bar:r})=>({[r.size]:u,transform:`translate${r.axis}(${l}%)`}),ke=I({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),X=Symbol("scrollbarContextKey");functionee(l,u,r=.03){returnl-u>r}constCe=I({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),Ne="Thumb";varBe=U({__name:"thumb",props:ke,setup(l){constu=l,r=ae(X),o=le("scrollbar");r||re(Ne,"can not inject scrollbar context");constm=d(),f=d(),y=d({}),g=d(!1);leth=!1,i=!1,p=0,v=0,s=ve?document.onselectstart:null;conste=_(()=>_e[u.vertical?"vertical":"horizontal"]),t=_(()=>Le({size:u.size,move:u.move,bar:e.value})),w=_(()=>m.value[e.value.offset]**2/r.wrapElement[e.value.scrollSize]/u.ratio/f.value[e.value.offset]),S=c=>{varT;if(c.stopPropagation(),c.ctrlKey||[1,2].includes(c.button))return;(T=window.getSelection())==null||T.removeAllRanges(),x(c);constb=c.currentTarget;b&&(y.value[e.value.axis]=b[e.value.offset]-(c[e.value.client]-b.getBoundingClientRect()[e.value.direction]))},E=c=>{if(!f.value||!m.value||!r.wrapElement)return;constb=(Math.abs(c.target.getBoundingClientRect()[e.value.direction]-c[e.value.client])-f.value[e.value.offset]/2)*100*w.value/m.value[e.value.offset];r.wrapElement[e.value.scroll]=b*r.wrapElement[e.value.scrollSize]/100},x=c=>{c.stopImmediatePropagation(),h=!0,p=r.wrapElement.scrollHeight,v=r.wrapElement.scrollWidth,document.addEventListener("mousemove",R),document.addEventListener("mouseup",L),s=document.onselectstart,document.onselectstart=()=>!1},R=c=>{if(!m.value||!f.value||h===!1)return;constb=y.value[e.value.axis];if(!b)return;constT=((m.value.getBoundingClientRect()[e.value.direction]-c[e.value.client])*-1-(f.value[e.value.offset]-b))*100*w.value/m.value[e.value.offset];e.value.scroll==="scrollLeft"?r.wrapElement[e.value.scroll]=T*v/100:r.wrapElement[e.value.scroll]=T*p/100},L=()=>{h=!1,y.value[e.value.axis]=0,document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",L),k(),i&&(g.value=!1)},A=()=>{i=!1,g.value=!!u.size},W=()=>{i=!0,g.value=h};ne(()=>{k(),document.removeEventListener("mouseup",L)});constk=()=>{document.onselectstart!==s&&(document.onselectstart=s)};returnD(q(r,"scrollbarElement"),"mousemove",A),D(q(r,"scrollbarElement"),"mouseleave",W),(c,b)=>(B(),K(fe,{name:N(o).b("fade"),persisted:""},{default:oe(()=>[ie(j("div",{ref_key:"instance",ref:m,class:P([N(o).e("bar"),N(o).is(e.value.key)]),onMousedown:E,onClick:b[0]||(b[0]=ce(()=>{},["stop"]))},[j("div",{ref_key:"thumb",ref:f,class:P(N(o).e("thumb")),style:$(t.value),onMousedown:S},null,38)],34),[[ue,l.always||g.value]])]),_:1},8,["name"]))}}),te=Be,Pe=U({__name:"bar",props:Ce,setup(l,{expose:u}){constr=