1import{q as T,e as $,d as q,z as A,v as I,aY as O,f as P,o as V,l as k,U as j,h as l,C as z,n as w,aa as D,ad as G,_ as J}from"./Y4ICXCuc.js";function K(m={}){const h=m.trackHeight??311,d=m.thumbHeight??48,u=h-d,S=T(null),s=T(null),a=T(0),p=T(!1),b=T(0);let c=!1,v=0,f=0,r=null;const C=$(()=>({height:`${d}px`,top:`${a.value}px`})),y=$(()=>({top:`${Math.max(0,(b.value-h)/2)}px`,height:`${h}px`})),H=()=>{var t,e;b.value=((t=S.value)==null?void 0:t.clientHeight)||((e=s.value)==null?void 0:e.clientHeight)||0},M=(t,e)=>e>0?t/e*u:0,n=(t,e)=>u>0&&e>0?t/u*e:0,o=()=>{const t=s.value;if(!t)return;H();const{scrollHeight:e,clientHeight:i,scrollTop:x}=t;if(e<=i){p.value=!1,a.value=0;return}p.value=!0;const B=e-i,U=Math.max(0,Math.min(x,B));a.value=Math.max(0,Math.min(M(U,B),u))},F=()=>{const t=s.value;t&&(t.scrollTop=0,a.value=0,o())},N=()=>{c||o()},E=t=>{const e=s.value;if(!e)return;const i=Math.max(0,Math.min(t,u)),x=e.scrollHeight-e.clientHeight;e.scrollTop=n(i,x),a.value=i},L=t=>{c=!0,v=t,f=a.value},R=t=>{c&&E(f+(t-v))},Y=t=>R(t.clientY),_=t=>{var e;c&&(t.preventDefault(),R(((e=t.touches[0])==null?void 0:e.clientY)??v))},g=()=>{c&&(c=!1,document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",g))};return{containerRef:S,scrollContentRef:s,thumbStyle:C,scrollbarStyle:y,showScrollbar:p,onContentScroll:N,onThumbMouseDown:t=>{L(t.clientY),document.addEventListener("mousemove",Y),document.addEventListener("mouseup",g)},onThumbTouchStart:t=>{const e=t.touches[0];e&&(L(e.clientY),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("touchend",g))},onTrackClick:t=>{const e=t.currentTarget,i=t.clientY-e.getBoundingClientRect().top;E(i-d/2)},initScrollbarObserver:()=>{s.value&&(r==null||r.disconnect(),r=new ResizeObserver(()=>o()),r.observe(s.value),o())},updateScrollbar:o,scrollToTop:F,destroyScrollbar:()=>{r==null||r.disconnect(),r=null,g()}}}const Q=q({__name:"index",props:{trackColor:{type:String,default:"#C1C1C1"},thumbColor:{type:String,default:"#FF7A00"},trackHeight:{type:Number,default:311},thumbHeight:{type:Number,default:48}},setup(m,{expose:h}){const d=m,{containerRef:u,scrollContentRef:S,thumbStyle:s,scrollbarStyle:a,showScrollbar:p,onContentScroll:b,onThumbMouseDown:c,onThumbTouchStart:v,onTrackClick:f,initScrollbarObserver:r,updateScrollbar:C,scrollToTop:y,destroyScrollbar:H}=K({trackHeight:d.trackHeight,thumbHeight:d.thumbHeight});return A(()=>I(r)),O(H),h({updateScrollbar:C,scrollToTop:y}),(M,n)=>(V(),P("div",{ref_key:"containerRef",ref:u,class:"custom-provider-scrollbar"},[k("div",{ref_key:"scrollContentRef",ref:S,class:"custom-provider-scrollbar__content",onScroll:n[0]||(n[0]=(...o)=>l(b)&&l(b)(...o))},[z(M.$slots,"default",{},void 0,!0)],544),j(k("div",{class:"custom-provider-scrollbar__bar",style:w(l(a))},[k("div",{class:"custom-provider-scrollbar__track",style:w({background:m.trackColor}),onClick:n[4]||(n[4]=(...o)=>l(f)&&l(f)(...o))},[k("div",{class:"custom-provider-scrollbar__thumb",style:w({...l(s),background:m.thumbColor}),onMousedown:n[1]||(n[1]=D((...o)=>l(c)&&l(c)(...o),["prevent"])),onTouchstart:n[2]||(n[2]=D((...o)=>l(v)&&l(v)(...o),["prevent"])),onClick:n[3]||(n[3]=D(()=>{},["stop"]))},null,36)],4)],4),[[G,l(p)]])],512))}}),nt=J(Q,[["__scopeId","data-v-21039c7f"]]);export{nt as C};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.