import{d6 as pe,cx as Z,d7 as he,d8 as J,az as W,cW as Q,b$ as I,d9 as ye,cS as V,cC as we,c1 as be,da as _e,db as Se,cy as Ae,aq as q,_ as F,f as D,O as Te,N as fe,a$ as Ee,r as b,y as R,be as Pe,a9 as X,bZ as j,o as C,m as G,w as ce,$ as Oe,a as K,a2 as N,k as A,a4 as Y,a0 as Le,bm as Re,aB as ze,c as ve,b as k,H as He,ar as Ce,bb as H,bw as ee,W as ae,aU as Ne,X as te,S as Be,j as Me,C as xe,a8 as $e,R as De,a1 as Ie,n as Ue,M as We,as as Xe}from"./entry.97b97815.js";import{d as re,c as ne}from"./_getTag.3f72bbba.js";var Ge="__lodash_hash_undefined__";function Ke(e){return this.__data__.set(e,Ge),this}function Ye(e){return this.__data__.has(e)}function $(e){var a=-1,n=e==null?0:e.length;for(this.__data__=new pe;++af))return!1;var d=r.get(e),g=r.get(a);if(d&&g)return d==a&&g==e;var o=-1,c=!0,h=n&Je?new $:void 0;for(r.set(e,a),r.set(a,e);++o({[n.size]:a,transform:`translate${n.axis}(${e}%)`}),me=Symbol("scrollbarContextKey"),Aa=q({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),Ta="Thumb",Ea=D({__name:"thumb",props:Aa,setup(e){const a=e,n=Te(me),t=fe("scrollbar");n||Ee(Ta,"can not inject scrollbar context");const u=b(),r=b(),s=b({}),f=b(!1);let i=!1,d=!1,g=ze?document.onselectstart:null;const o=R(()=>_a[a.vertical?"vertical":"horizontal"]),c=R(()=>Sa({size:a.size,move:a.move,bar:o.value})),h=R(()=>u.value[o.value.offset]**2/n.wrapElement[o.value.scrollSize]/a.ratio/r.value[o.value.offset]),m=v=>{var l;if(v.stopPropagation(),v.ctrlKey||[1,2].includes(v.button))return;(l=window.getSelection())==null||l.removeAllRanges(),_(v);const p=v.currentTarget;p&&(s.value[o.value.axis]=p[o.value.offset]-(v[o.value.client]-p.getBoundingClientRect()[o.value.direction]))},y=v=>{if(!r.value||!u.value||!n.wrapElement)return;const l=Math.abs(v.target.getBoundingClientRect()[o.value.direction]-v[o.value.client]),p=r.value[o.value.offset]/2,P=(l-p)*100*h.value/u.value[o.value.offset];n.wrapElement[o.value.scroll]=P*n.wrapElement[o.value.scrollSize]/100},_=v=>{v.stopImmediatePropagation(),i=!0,document.addEventListener("mousemove",S),document.addEventListener("mouseup",w),g=document.onselectstart,document.onselectstart=()=>!1},S=v=>{if(!u.value||!r.value||i===!1)return;const l=s.value[o.value.axis];if(!l)return;const p=(u.value.getBoundingClientRect()[o.value.direction]-v[o.value.client])*-1,P=r.value[o.value.offset]-l,z=(p-P)*100*h.value/u.value[o.value.offset];n.wrapElement[o.value.scroll]=z*n.wrapElement[o.value.scrollSize]/100},w=()=>{i=!1,s.value[o.value.axis]=0,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",w),T(),d&&(f.value=!1)},O=()=>{d=!1,f.value=!!a.size},E=()=>{d=!0,f.value=i};Pe(()=>{T(),document.removeEventListener("mouseup",w)});const T=()=>{document.onselectstart!==g&&(document.onselectstart=g)};return X(j(n,"scrollbarElement"),"mousemove",O),X(j(n,"scrollbarElement"),"mouseleave",E),(v,l)=>(C(),G(Re,{name:A(t).b("fade"),persisted:""},{default:ce(()=>[Oe(K("div",{ref_key:"instance",ref:u,class:N([A(t).e("bar"),A(t).is(A(o).key)]),onMousedown:y},[K("div",{ref_key:"thumb",ref:r,class:N(A(t).e("thumb")),style:Y(A(c)),onMousedown:m},null,38)],34),[[Le,v.always||f.value]])]),_:1},8,["name"]))}});var ue=F(Ea,[["__file","thumb.vue"]]);const Pa=q({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}}),Oa=D({__name:"bar",props:Pa,setup(e,{expose:a}){const n=e,t=b(0),u=b(0);return a({handleScroll:s=>{if(s){const f=s.offsetHeight-L,i=s.offsetWidth-L;u.value=s.scrollTop*100/f*n.ratioY,t.value=s.scrollLeft*100/i*n.ratioX}}}),(s,f)=>(C(),ve(He,null,[k(ue,{move:t.value,ratio:s.ratioX,size:s.width,always:s.always},null,8,["move","ratio","size","always"]),k(ue,{move:u.value,ratio:s.ratioY,size:s.height,vertical:"",always:s.always},null,8,["move","ratio","size","always"])],64))}});var La=F(Oa,[["__file","bar.vue"]]);const Ra=q({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ce([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),za={scroll:({scrollTop:e,scrollLeft:a})=>[e,a].every(H)},Ha="ElScrollbar",Ca=D({name:Ha}),Na=D({...Ca,props:Ra,emits:za,setup(e,{expose:a,emit:n}){const t=e,u=fe("scrollbar");let r,s;const f=b(),i=b(),d=b(),g=b("0"),o=b("0"),c=b(),h=b(1),m=b(1),y=R(()=>{const l={};return t.height&&(l.height=ee(t.height)),t.maxHeight&&(l.maxHeight=ee(t.maxHeight)),[t.wrapStyle,l]}),_=R(()=>[t.wrapClass,u.e("wrap"),{[u.em("wrap","hidden-default")]:!t.native}]),S=R(()=>[u.e("view"),t.viewClass]),w=()=>{var l;i.value&&((l=c.value)==null||l.handleScroll(i.value),n("scroll",{scrollTop:i.value.scrollTop,scrollLeft:i.value.scrollLeft}))};function O(l,p){We(l)?i.value.scrollTo(l):H(l)&&H(p)&&i.value.scrollTo(l,p)}const E=l=>{H(l)&&(i.value.scrollTop=l)},T=l=>{H(l)&&(i.value.scrollLeft=l)},v=()=>{if(!i.value)return;const l=i.value.offsetHeight-L,p=i.value.offsetWidth-L,P=l**2/i.value.scrollHeight,z=p**2/i.value.scrollWidth,B=Math.max(P,t.minSize),M=Math.max(z,t.minSize);h.value=P/(l-P)/(B/(l-B)),m.value=z/(p-z)/(M/(p-M)),o.value=B+Lt.noresize,l=>{l?(r==null||r(),s==null||s()):({stop:r}=Ne(d,v),s=X("resize",v))},{immediate:!0}),ae(()=>[t.maxHeight,t.height],()=>{t.native||te(()=>{var l;v(),i.value&&((l=c.value)==null||l.handleScroll(i.value))})}),Be(me,Me({scrollbarElement:f,wrapElement:i})),xe(()=>{t.native||te(()=>{v()})}),$e(()=>v()),a({wrapRef:i,update:v,scrollTo:O,setScrollTop:E,setScrollLeft:T,handleScroll:w}),(l,p)=>(C(),ve("div",{ref_key:"scrollbarRef",ref:f,class:N(A(u).b())},[K("div",{ref_key:"wrapRef",ref:i,class:N(A(_)),style:Y(A(y)),onScroll:w},[(C(),G(Ie(l.tag),{id:l.id,ref_key:"resizeRef",ref:d,class:N(A(S)),style:Y(l.viewStyle),role:l.role,"aria-label":l.ariaLabel,"aria-orientation":l.ariaOrientation},{default:ce(()=>[De(l.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),l.native?Ue("v-if",!0):(C(),G(La,{key:0,ref_key:"barRef",ref:c,height:o.value,width:g.value,always:l.always,"ratio-x":m.value,"ratio-y":h.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var Ba=F(Na,[["__file","scrollbar.vue"]]);const Ia=Xe(Ba);export{Ia as E,ge as b,$a as h,Da as i};