2 lines
43 KiB
JavaScript
2 lines
43 KiB
JavaScript
|
import{bY as Ft,a0 as H,V as I,O as We,M as $,aa as Ue,N as Ao,ac as ye,a2 as Ze,bZ as xo,a5 as Ro,a6 as _o,J as Bo,Q as Y,u as v,ag as we,a as N,T as ae,af as ve,aP as Mo,r as A,aQ as Le,bo as Qe,b_ as Me,o as j,c as oe,k as G,ai as nt,i as et,Y as re,B as qe,am as Kt,an as qt,Z as Q,h as Oe,j as de,H as Vt,b5 as Re,a7 as Ct,aS as Io,a9 as Pt,f as Ho,aR as Lo,X as ie,D as No,p as pe,bP as Yt,ap as rt,b$ as tt,c0 as Do,c1 as $o,c2 as jo,c3 as Ut,bs as Ve,c4 as Xt,F as Gt,aO as kt,a3 as zo,ak as Wo,bn as At,aI as Fo,ao as Ko,c5 as qo,ba as xt,a4 as Vo,c6 as Yo,c7 as Uo,t as Xo}from"./entry.834fe740.js";const te=(e,t,{checkForDefaultPrevented:o=!0}={})=>r=>{const s=e==null?void 0:e(r);if(o===!1||!s)return t==null?void 0:t(r)},fa=e=>t=>t.pointerType==="mouse"?e(t):void 0,Go=()=>Math.floor(Math.random()*1e4),Jt=Symbol("scrollbarContextKey"),at=Symbol("popper"),Zt=Symbol("popperContent"),it=Symbol("elTooltip"),Jo=Ft({type:H(Boolean),default:null}),Zo=Ft({type:H(Function)}),Qo=e=>{const t=`update:${e}`,o=`onUpdate:${e}`,n=[t],r={[e]:Jo,[o]:Zo};return{useModelToggle:({indicator:a,toggleReason:l,shouldHideWhenRouteChanges:i,shouldProceed:u,onShow:f,onHide:p})=>{const b=Ao(),{emit:h}=b,y=b.props,g=I(()=>We(y[o])),T=I(()=>y[e]===null),S=w=>{a.value!==!0&&(a.value=!0,l&&(l.value=w),We(f)&&f(w))},P=w=>{a.value!==!1&&(a.value=!1,l&&(l.value=w),We(p)&&p(w))},c=w=>{if(y.disabled===!0||We(u)&&!u())return;const C=g.value&&ye;C&&h(t,!0),(T.value||!C)&&S(w)},m=w=>{if(y.disabled===!0||!ye)return;const C=g.value&&ye;C&&h(t,!1),(T.value||!C)&&P(w)},d=w=>{!Ze(w)||(y.disabled&&w?g.value&&h(t,!1):a.value!==w&&(w?S():P()))},O=()=>{a.value?m():c()};return $(()=>y[e],d),i&&b.appContext.config.globalProperties.$route!==void 0&&$(()=>({...b.proxy.$route}),()=>{i.value&&a.value&&m()}),Ue(()=>{d(y[e])}),{hide:m,show:c,toggle:O,hasUpdateHandler:g}},useModelToggleProps:r,useModelToggleEmits:n}};function en(){let e;const t=(n,r)=>{o(),e=window.setTimeout(n,r)},o=()=>window.clearTimeout(e);return xo(()=>o()),{registerTimeout:t,cancelTimeout:o}}let Rt;const tn=Ro("namespace",_o),Qt=`${tn.value}-popper-container-${Go()}`,eo=`#${Qt}`,on=()=>{const e=document.createElement("div");return e.id=Qt,document.body.appendChild(e),e},nn=()=>{Bo(()=>{!ye||(!Rt||!document.body.querySelector(eo))&&(Rt=on())})},rn=Y({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200}}),an=({showAfter:e,hideAfter:t,open:o,close:n})=>{const{registerTimeout:r}=en();return{onOpen:l=>{r(()=>{o(l)},v(e))},onClose:l=>{r(()=>{n(l)},v(t))}}},to=Symbol("elForwardRef"),sn=e=>{we(to,{setForwardRef:o=>{e.value=o}})},ln=e=>({mounted(t){e(t)},updated(t){e(t)},unmounted(){e(null)}}),be=4,un={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"}},cn=({move:e,size:t,bar:o})=>({[o.size]:t,transform:`translate${o.axis}(${e}%)`}),pn=Y({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),fn="Thumb",dn=N({__name:"thumb",props:pn,setup(e){const t=e,o=ae(Jt),n=ve("scrollbar");o||Mo(fn,"can not inject scrollbar context");const r=A(),s=A(),a=A({}),l=A(!1);let i=!1,u=!1,f=ye?document.onselectstart:null;const p=I(()=>un[t.vertical?"vertical":"horizontal"]),b=I(()=>cn({size:t.size,move:t.move,bar:p.value})),h=I(()=>r.value[p.value.offset]**2/o.wrapElement[p.value.scrollSize]/t.ratio/s.value[p.value.offset]),y=O=>{var w;if(O.stopPropagation(),O.ctrlKey||[1,2].includes(O.button))return;(w=window.getSelection())==null||w.removeAllRanges(),T(O);const C=O.currentTarget;!C||(a.value[p.value.axis]=C[p.value.offset]-(O[p.value.client]-C.getBoundingClientRect()[p.value.direction]))},g=O=>{if(!s.value||!r.value||!o.wrapElement)return;const w=Math.abs(O.target.getBoundingClientRect()[p.value.direction]-O[p.value.client]),C=s.value[p.value.offset]/2,_=(w-C)*100*h.value/r.value[p.value.offset];o.wrapElement[p.value.scroll]=_*o.wrap
|