@ehfuse/overlay-scrollbar 1.7.18 → 1.7.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Ve=Object.defineProperty;var Yt=Object.getOwnPropertyDescriptor;var Xt=Object.getOwnPropertyNames;var qt=Object.prototype.hasOwnProperty;var jt=(d,f)=>{for(var g in f)Ve(d,g,{get:f[g],enumerable:!0})},Gt=(d,f,g,u)=>{if(f&&typeof f=="object"||typeof f=="function")for(let S of Xt(f))!qt.call(d,S)&&S!==g&&Ve(d,S,{get:()=>f[S],enumerable:!(u=Yt(f,S))||u.enumerable});return d};var Kt=d=>Gt(Ve({},"__esModule",{value:!0}),d);var lo={};jt(lo,{OverlayScrollbar:()=>Ze,default:()=>Ze});module.exports=Kt(lo);var t=require("react");var Vt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],Ie=(d,f)=>{if(d instanceof HTMLElement&&d.isContentEditable||d.closest('[role="textbox"],[role="searchbox"]'))return!0;let g=d.tagName.toLowerCase();if(g==="input"){let u=(d.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(g)||["svg","path","circle","rect","line","polygon","polyline"].includes(g)||d.getAttribute("contenteditable")==="true")return!0;if(f?.excludeSelectors){for(let u of f.excludeSelectors)if(d.matches(u))return!0}return Zt(d,f)},Zt=(d,f)=>{let g=[...Vt,...f?.excludeClasses||[]],u=d,S=0,$=5;for(;u&&S<=$;){if(g.some(D=>u.classList.contains(D)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,S++}return!1};var I=require("react"),gt=({containerRef:d,config:f})=>{let g=f.enabled??!0,u=f.threshold??80,S=f.maxDistance??u*2,$=f.onRefresh,[D,k]=(0,I.useState)(0),[W,U]=(0,I.useState)(!1),A=(0,I.useRef)(0),ue=(0,I.useRef)(0),Y=(0,I.useRef)(!1),Z=(0,I.useRef)(!1),oe=(0,I.useRef)(!1),X=(0,I.useRef)(0),re=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{re.current=W},[W]),(0,I.useEffect)(()=>{let C=d.current;if(!C||!(g&&typeof $=="function"))return;let Te=b=>{let L=b instanceof Element?b:null;for(;L&&L!==C;){if(L instanceof HTMLElement&&L.scrollHeight>L.clientHeight+1&&L.scrollTop>0)return!1;L=L.parentElement}return!0},$e=b=>{Y.current=!1,Z.current=!1,oe.current=!1,!re.current&&b.touches.length===1&&C.scrollTop===0&&Te(b.target)&&(Y.current=!0,A.current=b.touches[0].clientY,ue.current=b.touches[0].clientX)},Q=b=>{if(!Y.current||re.current||b.touches.length!==1)return;let L=b.touches[0].clientY-A.current,de=b.touches[0].clientX-ue.current;if(!Z.current){if(L<=0||C.scrollTop>0){Y.current=!1;return}if(L>8&&L>Math.abs(de))Z.current=!0,oe.current=C.scrollTop<0;else return}!oe.current&&b.cancelable&&b.preventDefault();let we=Math.min(Math.max(L,0)*.5,S);X.current=we,k(we)},q=()=>{if(!Y.current||(Y.current=!1,!Z.current))return;Z.current=!1,oe.current=!1;let b=X.current;X.current=0,b>=u&&!re.current?(U(!0),k(u),Promise.resolve().then(()=>$()).catch(()=>{}).finally(()=>{U(!1),k(0)})):k(0)};return C.addEventListener("touchstart",$e,{passive:!0}),C.addEventListener("touchmove",Q,{passive:!1}),C.addEventListener("touchend",q,{passive:!0}),C.addEventListener("touchcancel",q,{passive:!0}),()=>{C.removeEventListener("touchstart",$e),C.removeEventListener("touchmove",Q),C.removeEventListener("touchend",q),C.removeEventListener("touchcancel",q)}},[d,g,$,u,S]),{pullDistance:D,isRefreshing:W,pullProgress:Math.min(D/u,1),pullThreshold:u}};var Pe=require("react");function vt(){let[d,f]=(0,Pe.useState)(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return(0,Pe.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let g=window.matchMedia("(pointer: coarse)"),u=S=>f(S.matches);return f(g.matches),typeof g.addEventListener=="function"?(g.addEventListener("change",u),()=>g.removeEventListener("change",u)):(g.addListener(u),()=>g.removeListener(u))},[]),d}var y=require("react/jsx-runtime"),Qt={},Jt={},eo={},to={},oo={},ro={},no=(0,t.forwardRef)(({className:d="",style:f={},containerStyle:g={},contentStyle:u={},children:S,onScroll:$,thumb:D=Qt,track:k=Jt,arrows:W=eo,dragScroll:U=to,autoHide:A=oo,pullToRefresh:ue=ro,showScrollbar:Y=!0,showHorizontalScrollbar:Z=!0,detectInnerScroll:oe=!1,scrollTopFab:X=!1},re)=>{let C=vt(),ne=Y,Te=C?!1:Z,Q=`os-${(0,t.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,q=X!==!1&&X!=null,b=typeof X=="object"?X:{},L=b.threshold??600,de=b.hideDelay??1500,we=b.position??"right",Qe=b.offset??16,yt=b.background??"#1976d2",xt=b.color??"#ffffff",Me=b.size??48,[Ee,Je]=(0,t.useState)(!1),J=(0,t.useRef)(null),Tt=(0,t.useRef)({});(0,t.useEffect)(()=>{Tt.current={children:S,onScroll:$,showScrollbar:ne,showHorizontalScrollbar:Te,thumb:D,track:k,arrows:W,dragScroll:U,autoHide:A}});let We=(0,t.useRef)(null),a=(0,t.useRef)(null),fe=(0,t.useRef)(null),pe=(0,t.useRef)(null),wt=(0,t.useRef)(null),F=(0,t.useRef)(null),{pullDistance:Oe,isRefreshing:Se,pullProgress:Ae}=gt({containerRef:a,config:ue}),et=ue.indicatorColor??"#1976d2",Mt=Oe>0||Se,[Ce,M]=(0,t.useState)(!1),[N,tt]=(0,t.useState)(!1),[ot,rt]=(0,t.useState)(!1),[ze,Et]=(0,t.useState)({y:0,scrollTop:0}),[he,nt]=(0,t.useState)(0),[St,Fe]=(0,t.useState)(0),[le,lt]=(0,t.useState)(!1),[it,at]=(0,t.useState)(!1),[B,st]=(0,t.useState)(!1),[Ne,Ct]=(0,t.useState)({x:0,scrollLeft:0}),[Be,ct]=(0,t.useState)(0),[_e,ut]=(0,t.useState)(0),[Ht,dt]=(0,t.useState)(!1),ie=(0,t.useRef)(!1),[j,ft]=(0,t.useState)(!1),[me,Lt]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[io,ao]=(0,t.useState)(null),[He,Le]=(0,t.useState)(null),[so,Dt]=(0,t.useState)(!1),[kt,Rt]=(0,t.useState)(0),be=(0,t.useRef)(null),[pt,ht]=(0,t.useState)(!1),ge=(0,t.useRef)(null),ee=(0,t.useRef)(null),te=(0,t.useRef)(null),E=(0,t.useMemo)(()=>{let e=D.color??"#606060";return{width:D.width??8,minHeight:D.minHeight??50,radius:D.radius??(D.width??8)/2,color:e,opacity:D.opacity??.6,hoverColor:D.hoverColor??e,hoverOpacity:D.hoverOpacity??1}},[D]),n=(0,t.useMemo)(()=>({width:k.width??16,color:k.color??"rgba(128, 128, 128, 0.1)",visible:k.visible??!0,alignment:k.alignment??"outside",radius:k.radius??E.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,E.radius]),z=(0,t.useMemo)(()=>{let e=W.color??"#808080";return{visible:W.visible??!1,step:W.step??50,color:e,opacity:W.opacity??.6,hoverColor:W.hoverColor??e,hoverOpacity:W.hoverOpacity??1}},[W]),ve=(0,t.useMemo)(()=>({enabled:C?!1:U.enabled??!0,excludeClasses:U.excludeClasses??[],excludeSelectors:U.excludeSelectors??[]}),[U,C]),s=(0,t.useMemo)(()=>({enabled:A.enabled??!0,delay:A.delay??1500,delayOnWheel:A.delayOnWheel??700,initialDelay:A.initialDelay??200}),[A]),[ae,It]=(0,t.useState)(()=>(A.initialDelay??200)>0),x=E.width,Pt=n.width,Ue=E.minHeight,_=z.visible,De=z.step,O=(0,t.useCallback)(()=>{if(!a.current)return;let e=document.activeElement;e&&a.current.contains(e)&&e!==a.current||a.current.focus()},[]);(0,t.useImperativeHandle)(re,()=>({getScrollContainer:()=>a.current,scrollTo:e=>{a.current&&a.current.scrollTo(e)},get scrollTop(){return a.current?.scrollTop||0},get scrollHeight(){return a.current?.scrollHeight||0},get clientHeight(){return a.current?.clientHeight||0}}),[]);let m=(0,t.useCallback)(()=>{if(F.current){let o=F.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;F.current=null}if(!a.current)return null;if(a.current.scrollHeight>a.current.clientHeight+2||a.current.scrollWidth>a.current.clientWidth+2)return F.current=a.current,a.current;if(!oe)return null;let e=a.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==a.current&&r.classList.contains("overlay-scrollbar-container"))continue;let l=r.parentElement,i=!1;for(;l&&l!==a.current;){if(l.classList.contains("overlay-scrollbar-container")&&l!==a.current){i=!0;break}l=l.parentElement}if(!i&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return F.current=r,r}return null},[]),G=(0,t.useCallback)(()=>m()!==null,[m]),T=(0,t.useCallback)(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null)},[]),ke=(0,t.useCallback)(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),mt=(0,t.useCallback)(()=>{te.current&&(clearTimeout(te.current),te.current=null)},[]),$t=(0,t.useCallback)(()=>{ke(),!(N||B||j||ie.current)&&(T(),M(!1))},[T,ke,N,B,j]),v=(0,t.useCallback)(e=>{s.enabled&&(T(),ge.current=setTimeout(()=>{M(!1),ge.current=null},e))},[T,s.enabled]),p=(0,t.useCallback)(()=>{let e=m()??a.current;if(!e){M(!1),lt(!1),dt(!1),T();return}!s.enabled&&!ae&&(M(!0),T());let o=e.clientHeight,r=e.scrollHeight,l=e.scrollTop,i=e.clientWidth,c=e.scrollWidth,w=e.scrollLeft,H=r-o>0,h=c-i>0,se=H||h;lt(H),dt(h),se||(M(!1),T());let ye=0,P=0;if(We.current){let K=window.getComputedStyle(We.current),V=parseFloat(K.paddingTop)||0;P=parseFloat(K.paddingBottom)||0,ye=V+P,Rt(P)}if(H){let K=_?x*2+n.margin*4:n.margin*2,V=o-K+ye,Re=o/r,ce=Math.max(V*Re,Ue),bt=r-o,_t=V-ce,Ut=bt>0?l/bt*_t:0;nt(ce),Fe(Ut)}else nt(0),Fe(0);let xe=c-i;if(xe>0){let K=i/c,V=Math.max(i*K,50),Re=i-V,ce=xe>0?w/xe*Re:0;ct(V),ut(ce)}else ct(0),ut(0)},[m,T,_,x,Ue,s.enabled,ae]),Wt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=m();o&&(tt(!0),Et({y:e.clientY,scrollTop:o.scrollTop}),T(),M(!0),O())},[m,T,O]),Ye=(0,t.useCallback)(e=>{if(!N)return;let o=m();if(!o)return;let r=o.clientHeight,i=o.scrollHeight-r,c=e.clientY-ze.y,w=r-he,H=c/w*i,h=Math.max(0,Math.min(i,ze.scrollTop+H));o.scrollTop=h,p()},[N,ze,he,p,m]),Xe=(0,t.useCallback)(()=>{tt(!1),G()&&v(s.delay)},[G,v,s.delay]),Ot=(0,t.useCallback)(e=>{if(!pe.current)return;let r=pe.current.getBoundingClientRect(),l=e.clientY-r.top,i=m();if(!i)return;let c=i.clientHeight,w=i.scrollHeight,h=l/c*(w-c);i.scrollTop=Math.max(0,Math.min(w-c,h)),p(),M(!0),v(s.delay),O()},[p,v,s.delay,m,O]),At=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current)return;let o=Math.max(0,a.current.scrollTop-De);a.current.scrollTop=o,p(),M(!0),v(s.delay),O()},[p,v,De,s.delay,O]),zt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!a.current||!fe.current)return;let o=a.current,l=fe.current.scrollHeight-o.clientHeight,i=Math.min(l,o.scrollTop+De);o.scrollTop=i,p(),M(!0),v(s.delay),O()},[p,v,De,s.delay,O]),Ft=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=m();o&&(st(!0),Ct({x:e.clientX,scrollLeft:o.scrollLeft}),T(),M(!0),O())},[m,T,O]),qe=(0,t.useCallback)(e=>{if(!B)return;let o=m();if(!o)return;let r=o.clientWidth,i=o.scrollWidth-r,c=e.clientX-Ne.x,w=r-Be,H=c/w*i,h=Math.max(0,Math.min(i,Ne.scrollLeft+H));o.scrollLeft=h,p()},[B,Ne,Be,p,m]),je=(0,t.useCallback)(()=>{st(!1),G()&&v(s.delay)},[G,v,s.delay]),Nt=(0,t.useCallback)(e=>{if(!pe.current)return;let r=pe.current.getBoundingClientRect(),l=e.clientX-r.left,i=m();if(!i)return;let c=i.clientWidth,w=i.scrollWidth,h=l/c*(w-c);i.scrollLeft=Math.max(0,Math.min(w-c,h)),p(),M(!0),v(s.delay),O()},[p,v,s.delay,m,O]),Bt=(0,t.useCallback)(e=>{if(!ve.enabled||e.defaultPrevented)return;let o=e.target,r=a.current;if(!r||!r.contains(o)||Ie(o,ve)||e.button!==0)return;let l=m();l&&(l.scrollHeight<=l.clientHeight&&l.scrollWidth<=l.clientWidth||(e.preventDefault(),ie.current=!0,Lt({x:e.clientX,y:e.clientY,scrollTop:l.scrollTop,scrollLeft:l.scrollLeft||0}),T()))},[ve,Ie,m,T]),Ge=(0,t.useCallback)(e=>{if(!ie.current&&!j)return;let o=m();if(!o)return;let r=me.x-e.clientX,l=me.y-e.clientY;if(Math.abs(l)<5&&Math.abs(r)<5)return;ie.current&&(ie.current=!1,ft(!0)),M(!0);let i=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,me.scrollTop+l)),c=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,me.scrollLeft+r));o.scrollTop=i,o.scrollLeft=c,p()},[j,me,m,p]),Ke=(0,t.useCallback)(()=>{let e=j;ie.current=!1,ft(!1),e&&G()&&v(s.delay)},[j,G,v,s.delay]);(0,t.useEffect)(()=>{let e=c=>{if(p(),q){let h=(c.target?.scrollTop??0)>L;Je(h),J.current&&(clearTimeout(J.current),J.current=null),h&&de>0&&(J.current=setTimeout(()=>{J.current=null,Je(!1)},de))}if(ae){$&&$(c);return}T(),M(!0),mt();let w=pt?s.delayOnWheel:s.delay;v(w),$&&$(c)},o=()=>{ht(!0),be.current&&clearTimeout(be.current),be.current=setTimeout(()=>{ht(!1)},300),mt(),te.current=setTimeout(()=>{M(!0),te.current=null,v(s.delayOnWheel)},50)},r=[],l=m();l&&r.push(l);let i=a.current;return i&&!l&&(r.push(i),i.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(w=>{let H=w;if(H!==i&&H.classList.contains("overlay-scrollbar-container"))return;let h=H.parentElement;for(;h&&h!==i;){if(h.classList.contains("overlay-scrollbar-container")&&h!==i)return;h=h.parentElement}r.push(H)})),r.forEach(c=>{c.addEventListener("scroll",e,{passive:!0}),c.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(c=>{c.removeEventListener("scroll",e),c.removeEventListener("wheel",o)}),be.current&&clearTimeout(be.current),te.current&&clearTimeout(te.current)}},[m,p,$,T,v,s,pt,ae,q,L,de]),(0,t.useEffect)(()=>()=>{J.current&&clearTimeout(J.current)},[]),(0,t.useEffect)(()=>{let e=r=>{let l=r.target;if(r.defaultPrevented||l instanceof Element&&Ie(l,ve))return;let i=m();if(!i)return;let{key:c}=r,{scrollTop:w,scrollHeight:H,clientHeight:h}=i,se=H-h,ye=50,P=null;switch(c){case"ArrowUp":r.preventDefault(),P=Math.max(0,w-ye);break;case"ArrowDown":r.preventDefault(),P=Math.min(se,w+ye);break;case"PageUp":r.preventDefault(),P=Math.max(0,w-h);break;case"PageDown":r.preventDefault(),P=Math.min(se,w+h);break;case"Home":r.preventDefault(),P=0;break;case"End":r.preventDefault(),P=se;break;default:return}if(P!==null){let xe=P/se,K=_?x*2+n.margin*4:n.margin*2,ce=(h-K-he)*xe;Fe(ce),i.scrollTop=P,T(),M(!0),v(s.delay)}},o=a.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[m,_,x,n.margin,he,T,v,s.delay,ve]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ge),document.addEventListener("mouseup",Ke),()=>{document.removeEventListener("mousemove",Ge),document.removeEventListener("mouseup",Ke)}),[j,Ge,Ke]),(0,t.useEffect)(()=>{if(N)return document.addEventListener("mousemove",Ye),document.addEventListener("mouseup",Xe),()=>{document.removeEventListener("mousemove",Ye),document.removeEventListener("mouseup",Xe)}},[N,Ye,Xe]),(0,t.useEffect)(()=>{if(B)return document.addEventListener("mousemove",qe),document.addEventListener("mouseup",je),()=>{document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",je)}},[B,qe,je]),(0,t.useEffect)(()=>{p();let e=setTimeout(()=>{p()},100);return()=>clearTimeout(e)},[p]),(0,t.useLayoutEffect)(()=>{Dt(!0),p(),!s.enabled&&!ae&&G()&&M(!0)},[G,p,s.enabled,ae]),(0,t.useEffect)(()=>{if(s.initialDelay>0){let e=setTimeout(()=>{It(!1)},s.initialDelay);return()=>clearTimeout(e)}},[s.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{p()}),o=[];return a.current&&o.push(a.current),fe.current&&o.push(fe.current),F.current&&document.contains(F.current)&&o.push(F.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[p]),(0,t.useEffect)(()=>{if(!a.current)return;let e=new MutationObserver(()=>{F.current=null,p()});return e.observe(a.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[p]);let R=Math.max(Pt,x);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-shared";if(document.getElementById(e))return;let o=document.createElement("style");o.id=e,o.textContent=`
1
+ "use strict";var Ve=Object.defineProperty;var jt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var Kt=Object.prototype.hasOwnProperty;var Vt=(d,f)=>{for(var b in f)Ve(d,b,{get:f[b],enumerable:!0})},Zt=(d,f,b,u)=>{if(f&&typeof f=="object"||typeof f=="function")for(let C of Gt(f))!Kt.call(d,C)&&C!==b&&Ve(d,C,{get:()=>f[C],enumerable:!(u=jt(f,C))||u.enumerable});return d};var Qt=d=>Zt(Ve({},"__esModule",{value:!0}),d);var so={};Vt(so,{OverlayScrollbar:()=>Ze,default:()=>Ze});module.exports=Qt(so);var e=require("react");var Jt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],Re=(d,f)=>{if(d instanceof HTMLElement&&d.isContentEditable||d.closest('[role="textbox"],[role="searchbox"]'))return!0;let b=d.tagName.toLowerCase();if(b==="input"){let u=(d.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(b)||["svg","path","circle","rect","line","polygon","polyline"].includes(b)||d.getAttribute("contenteditable")==="true")return!0;if(f?.excludeSelectors){for(let u of f.excludeSelectors)if(d.matches(u))return!0}return eo(d,f)},eo=(d,f)=>{let b=[...Jt,...f?.excludeClasses||[]],u=d,C=0,P=5;for(;u&&C<=P;){if(b.some(D=>u.classList.contains(D)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,C++}return!1};var I=require("react"),gt=({containerRef:d,config:f})=>{let b=f.enabled??!0,u=f.threshold??80,C=f.maxDistance??u*2,P=f.onRefresh,[D,k]=(0,I.useState)(0),[$,U]=(0,I.useState)(!1),A=(0,I.useRef)(0),ue=(0,I.useRef)(0),Y=(0,I.useRef)(!1),Z=(0,I.useRef)(!1),te=(0,I.useRef)(!1),X=(0,I.useRef)(0),oe=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{oe.current=$},[$]),(0,I.useEffect)(()=>{let H=d.current;if(!H||!(b&&typeof P=="function"))return;let xe=h=>{let L=h instanceof Element?h:null;for(;L&&L!==H;){if(L instanceof HTMLElement&&L.scrollHeight>L.clientHeight+1&&L.scrollTop>0)return!1;L=L.parentElement}return!0},Oe=h=>{Y.current=!1,Z.current=!1,te.current=!1,!oe.current&&h.touches.length===1&&H.scrollTop===0&&xe(h.target)&&(Y.current=!0,A.current=h.touches[0].clientY,ue.current=h.touches[0].clientX)},Q=h=>{if(!Y.current||oe.current||h.touches.length!==1)return;let L=h.touches[0].clientY-A.current,Te=h.touches[0].clientX-ue.current;if(!Z.current){if(L<=0||H.scrollTop>0){Y.current=!1;return}if(L>8&&L>Math.abs(Te))Z.current=!0,te.current=H.scrollTop<0;else return}!te.current&&h.cancelable&&h.preventDefault();let we=Math.min(Math.max(L,0)*.5,C);X.current=we,k(we)},q=()=>{if(!Y.current||(Y.current=!1,!Z.current))return;Z.current=!1,te.current=!1;let h=X.current;X.current=0,h>=u&&!oe.current?(U(!0),k(u),Promise.resolve().then(()=>P()).catch(()=>{}).finally(()=>{U(!1),k(0)})):k(0)};return H.addEventListener("touchstart",Oe,{passive:!0}),H.addEventListener("touchmove",Q,{passive:!1}),H.addEventListener("touchend",q,{passive:!0}),H.addEventListener("touchcancel",q,{passive:!0}),()=>{H.removeEventListener("touchstart",Oe),H.removeEventListener("touchmove",Q),H.removeEventListener("touchend",q),H.removeEventListener("touchcancel",q)}},[d,b,P,u,C]),{pullDistance:D,isRefreshing:$,pullProgress:Math.min(D/u,1),pullThreshold:u}};var Ie=require("react");function vt(){let[d,f]=(0,Ie.useState)(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return(0,Ie.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let b=window.matchMedia("(pointer: coarse)"),u=C=>f(C.matches);return f(b.matches),typeof b.addEventListener=="function"?(b.addEventListener("change",u),()=>b.removeEventListener("change",u)):(b.addListener(u),()=>b.removeListener(u))},[]),d}var y=require("react/jsx-runtime"),to={},oo={},ro={},no={},lo={},io={},ao=(0,e.forwardRef)(({className:d="",style:f={},containerStyle:b={},contentStyle:u={},children:C,onScroll:P,thumb:D=to,track:k=oo,arrows:$=ro,dragScroll:U=no,autoHide:A=lo,pullToRefresh:ue=io,showScrollbar:Y=!0,showHorizontalScrollbar:Z=!0,detectInnerScroll:te=!1,scrollTopFab:X=!1},oe)=>{let H=vt(),re=Y,xe=H?!1:Z,Q=`os-${(0,e.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,q=X!==!1&&X!=null,h=typeof X=="object"?X:{},L=h.threshold??600,Te=h.idleDelay??400,we=h.scrollingOpacity??.45,yt=h.position??"right",Qe=h.offset??16,xt=h.background??"#1976d2",Tt=h.color??"#ffffff",Me=h.size??48,[Pe,wt]=(0,e.useState)(!1),[Mt,Je]=(0,e.useState)(!1),ne=(0,e.useRef)(null),St=(0,e.useRef)({});(0,e.useEffect)(()=>{St.current={children:C,onScroll:P,showScrollbar:re,showHorizontalScrollbar:xe,thumb:D,track:k,arrows:$,dragScroll:U,autoHide:A}});let $e=(0,e.useRef)(null),a=(0,e.useRef)(null),de=(0,e.useRef)(null),fe=(0,e.useRef)(null),Et=(0,e.useRef)(null),F=(0,e.useRef)(null),{pullDistance:We,isRefreshing:Se,pullProgress:Ae}=gt({containerRef:a,config:ue}),et=ue.indicatorColor??"#1976d2",Ct=We>0||Se,[Ee,M]=(0,e.useState)(!1),[N,tt]=(0,e.useState)(!1),[ot,rt]=(0,e.useState)(!1),[ze,Ht]=(0,e.useState)({y:0,scrollTop:0}),[pe,nt]=(0,e.useState)(0),[Lt,Fe]=(0,e.useState)(0),[le,lt]=(0,e.useState)(!1),[it,at]=(0,e.useState)(!1),[B,st]=(0,e.useState)(!1),[Ne,Dt]=(0,e.useState)({x:0,scrollLeft:0}),[Be,ct]=(0,e.useState)(0),[_e,ut]=(0,e.useState)(0),[kt,dt]=(0,e.useState)(!1),ie=(0,e.useRef)(!1),[j,ft]=(0,e.useState)(!1),[he,Rt]=(0,e.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[co,uo]=(0,e.useState)(null),[Ce,He]=(0,e.useState)(null),[fo,It]=(0,e.useState)(!1),[Ot,Pt]=(0,e.useState)(0),me=(0,e.useRef)(null),[pt,ht]=(0,e.useState)(!1),be=(0,e.useRef)(null),J=(0,e.useRef)(null),ee=(0,e.useRef)(null),S=(0,e.useMemo)(()=>{let t=D.color??"#606060";return{width:D.width??8,minHeight:D.minHeight??50,radius:D.radius??(D.width??8)/2,color:t,opacity:D.opacity??.6,hoverColor:D.hoverColor??t,hoverOpacity:D.hoverOpacity??1}},[D]),n=(0,e.useMemo)(()=>({width:k.width??16,color:k.color??"rgba(128, 128, 128, 0.1)",visible:k.visible??!0,alignment:k.alignment??"outside",radius:k.radius??S.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,S.radius]),z=(0,e.useMemo)(()=>{let t=$.color??"#808080";return{visible:$.visible??!1,step:$.step??50,color:t,opacity:$.opacity??.6,hoverColor:$.hoverColor??t,hoverOpacity:$.hoverOpacity??1}},[$]),ge=(0,e.useMemo)(()=>({enabled:H?!1:U.enabled??!0,excludeClasses:U.excludeClasses??[],excludeSelectors:U.excludeSelectors??[]}),[U,H]),s=(0,e.useMemo)(()=>({enabled:A.enabled??!0,delay:A.delay??1500,delayOnWheel:A.delayOnWheel??700,initialDelay:A.initialDelay??200}),[A]),[ae,$t]=(0,e.useState)(()=>(A.initialDelay??200)>0),x=S.width,Wt=n.width,Ue=S.minHeight,_=z.visible,Le=z.step,W=(0,e.useCallback)(()=>{if(!a.current)return;let t=document.activeElement;t&&a.current.contains(t)&&t!==a.current||a.current.focus()},[]);(0,e.useImperativeHandle)(oe,()=>({getScrollContainer:()=>a.current,scrollTo:t=>{a.current&&a.current.scrollTo(t)},get scrollTop(){return a.current?.scrollTop||0},get scrollHeight(){return a.current?.scrollHeight||0},get clientHeight(){return a.current?.clientHeight||0}}),[]);let m=(0,e.useCallback)(()=>{if(F.current){let o=F.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;F.current=null}if(!a.current)return null;if(a.current.scrollHeight>a.current.clientHeight+2||a.current.scrollWidth>a.current.clientWidth+2)return F.current=a.current,a.current;if(!te)return null;let t=a.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of t){let r=o;if(r!==a.current&&r.classList.contains("overlay-scrollbar-container"))continue;let l=r.parentElement,i=!1;for(;l&&l!==a.current;){if(l.classList.contains("overlay-scrollbar-container")&&l!==a.current){i=!0;break}l=l.parentElement}if(!i&&(r.scrollHeight>r.clientHeight+2||r.scrollWidth>r.clientWidth+2))return F.current=r,r}return null},[]),G=(0,e.useCallback)(()=>m()!==null,[m]),T=(0,e.useCallback)(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),De=(0,e.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),mt=(0,e.useCallback)(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),At=(0,e.useCallback)(()=>{De(),!(N||B||j||ie.current)&&(T(),M(!1))},[T,De,N,B,j]),v=(0,e.useCallback)(t=>{s.enabled&&(T(),be.current=setTimeout(()=>{M(!1),be.current=null},t))},[T,s.enabled]),p=(0,e.useCallback)(()=>{let t=m()??a.current;if(!t){M(!1),lt(!1),dt(!1),T();return}!s.enabled&&!ae&&(M(!0),T());let o=t.clientHeight,r=t.scrollHeight,l=t.scrollTop,i=t.clientWidth,c=t.scrollWidth,w=t.scrollLeft,E=r-o>0,g=c-i>0,se=E||g;lt(E),dt(g),se||(M(!1),T());let ve=0,O=0;if($e.current){let K=window.getComputedStyle($e.current),V=parseFloat(K.paddingTop)||0;O=parseFloat(K.paddingBottom)||0,ve=V+O,Pt(O)}if(E){let K=_?x*2+n.margin*4:n.margin*2,V=o-K+ve,ke=o/r,ce=Math.max(V*ke,Ue),bt=r-o,Xt=V-ce,qt=bt>0?l/bt*Xt:0;nt(ce),Fe(qt)}else nt(0),Fe(0);let ye=c-i;if(ye>0){let K=i/c,V=Math.max(i*K,50),ke=i-V,ce=ye>0?w/ye*ke:0;ct(V),ut(ce)}else ct(0),ut(0)},[m,T,_,x,Ue,s.enabled,ae]),zt=(0,e.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let o=m();o&&(tt(!0),Ht({y:t.clientY,scrollTop:o.scrollTop}),T(),M(!0),W())},[m,T,W]),Ye=(0,e.useCallback)(t=>{if(!N)return;let o=m();if(!o)return;let r=o.clientHeight,i=o.scrollHeight-r,c=t.clientY-ze.y,w=r-pe,E=c/w*i,g=Math.max(0,Math.min(i,ze.scrollTop+E));o.scrollTop=g,p()},[N,ze,pe,p,m]),Xe=(0,e.useCallback)(()=>{tt(!1),G()&&v(s.delay)},[G,v,s.delay]),Ft=(0,e.useCallback)(t=>{if(!fe.current)return;let r=fe.current.getBoundingClientRect(),l=t.clientY-r.top,i=m();if(!i)return;let c=i.clientHeight,w=i.scrollHeight,g=l/c*(w-c);i.scrollTop=Math.max(0,Math.min(w-c,g)),p(),M(!0),v(s.delay),W()},[p,v,s.delay,m,W]),Nt=(0,e.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!a.current)return;let o=Math.max(0,a.current.scrollTop-Le);a.current.scrollTop=o,p(),M(!0),v(s.delay),W()},[p,v,Le,s.delay,W]),Bt=(0,e.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!a.current||!de.current)return;let o=a.current,l=de.current.scrollHeight-o.clientHeight,i=Math.min(l,o.scrollTop+Le);o.scrollTop=i,p(),M(!0),v(s.delay),W()},[p,v,Le,s.delay,W]),_t=(0,e.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let o=m();o&&(st(!0),Dt({x:t.clientX,scrollLeft:o.scrollLeft}),T(),M(!0),W())},[m,T,W]),qe=(0,e.useCallback)(t=>{if(!B)return;let o=m();if(!o)return;let r=o.clientWidth,i=o.scrollWidth-r,c=t.clientX-Ne.x,w=r-Be,E=c/w*i,g=Math.max(0,Math.min(i,Ne.scrollLeft+E));o.scrollLeft=g,p()},[B,Ne,Be,p,m]),je=(0,e.useCallback)(()=>{st(!1),G()&&v(s.delay)},[G,v,s.delay]),Ut=(0,e.useCallback)(t=>{if(!fe.current)return;let r=fe.current.getBoundingClientRect(),l=t.clientX-r.left,i=m();if(!i)return;let c=i.clientWidth,w=i.scrollWidth,g=l/c*(w-c);i.scrollLeft=Math.max(0,Math.min(w-c,g)),p(),M(!0),v(s.delay),W()},[p,v,s.delay,m,W]),Yt=(0,e.useCallback)(t=>{if(!ge.enabled||t.defaultPrevented)return;let o=t.target,r=a.current;if(!r||!r.contains(o)||Re(o,ge)||t.button!==0)return;let l=m();l&&(l.scrollHeight<=l.clientHeight&&l.scrollWidth<=l.clientWidth||(t.preventDefault(),ie.current=!0,Rt({x:t.clientX,y:t.clientY,scrollTop:l.scrollTop,scrollLeft:l.scrollLeft||0}),T()))},[ge,Re,m,T]),Ge=(0,e.useCallback)(t=>{if(!ie.current&&!j)return;let o=m();if(!o)return;let r=he.x-t.clientX,l=he.y-t.clientY;if(Math.abs(l)<5&&Math.abs(r)<5)return;ie.current&&(ie.current=!1,ft(!0)),M(!0);let i=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,he.scrollTop+l)),c=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,he.scrollLeft+r));o.scrollTop=i,o.scrollLeft=c,p()},[j,he,m,p]),Ke=(0,e.useCallback)(()=>{let t=j;ie.current=!1,ft(!1),t&&G()&&v(s.delay)},[j,G,v,s.delay]);(0,e.useEffect)(()=>{let t=c=>{if(p(),q){let E=c.target?.scrollTop??0;wt(E>L),Je(!0),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>{ne.current=null,Je(!1)},Te)}if(ae){P&&P(c);return}T(),M(!0),mt();let w=pt?s.delayOnWheel:s.delay;v(w),P&&P(c)},o=()=>{ht(!0),me.current&&clearTimeout(me.current),me.current=setTimeout(()=>{ht(!1)},300),mt(),ee.current=setTimeout(()=>{M(!0),ee.current=null,v(s.delayOnWheel)},50)},r=[],l=m();l&&r.push(l);let i=a.current;return i&&!l&&(r.push(i),i.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(w=>{let E=w;if(E!==i&&E.classList.contains("overlay-scrollbar-container"))return;let g=E.parentElement;for(;g&&g!==i;){if(g.classList.contains("overlay-scrollbar-container")&&g!==i)return;g=g.parentElement}r.push(E)})),r.forEach(c=>{c.addEventListener("scroll",t,{passive:!0}),c.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(c=>{c.removeEventListener("scroll",t),c.removeEventListener("wheel",o)}),me.current&&clearTimeout(me.current),ee.current&&clearTimeout(ee.current)}},[m,p,P,T,v,s,pt,ae,q,L,Te]),(0,e.useEffect)(()=>()=>{ne.current&&clearTimeout(ne.current)},[]),(0,e.useEffect)(()=>{let t=r=>{let l=r.target;if(r.defaultPrevented||l instanceof Element&&Re(l,ge))return;let i=m();if(!i)return;let{key:c}=r,{scrollTop:w,scrollHeight:E,clientHeight:g}=i,se=E-g,ve=50,O=null;switch(c){case"ArrowUp":r.preventDefault(),O=Math.max(0,w-ve);break;case"ArrowDown":r.preventDefault(),O=Math.min(se,w+ve);break;case"PageUp":r.preventDefault(),O=Math.max(0,w-g);break;case"PageDown":r.preventDefault(),O=Math.min(se,w+g);break;case"Home":r.preventDefault(),O=0;break;case"End":r.preventDefault(),O=se;break;default:return}if(O!==null){let ye=O/se,K=_?x*2+n.margin*4:n.margin*2,ce=(g-K-pe)*ye;Fe(ce),i.scrollTop=O,T(),M(!0),v(s.delay)}},o=a.current;if(o)return o.addEventListener("keydown",t),()=>{o.removeEventListener("keydown",t)}},[m,_,x,n.margin,pe,T,v,s.delay,ge]),(0,e.useEffect)(()=>(document.addEventListener("mousemove",Ge),document.addEventListener("mouseup",Ke),()=>{document.removeEventListener("mousemove",Ge),document.removeEventListener("mouseup",Ke)}),[j,Ge,Ke]),(0,e.useEffect)(()=>{if(N)return document.addEventListener("mousemove",Ye),document.addEventListener("mouseup",Xe),()=>{document.removeEventListener("mousemove",Ye),document.removeEventListener("mouseup",Xe)}},[N,Ye,Xe]),(0,e.useEffect)(()=>{if(B)return document.addEventListener("mousemove",qe),document.addEventListener("mouseup",je),()=>{document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",je)}},[B,qe,je]),(0,e.useEffect)(()=>{p();let t=setTimeout(()=>{p()},100);return()=>clearTimeout(t)},[p]),(0,e.useLayoutEffect)(()=>{It(!0),p(),!s.enabled&&!ae&&G()&&M(!0)},[G,p,s.enabled,ae]),(0,e.useEffect)(()=>{if(s.initialDelay>0){let t=setTimeout(()=>{$t(!1)},s.initialDelay);return()=>clearTimeout(t)}},[s.initialDelay]),(0,e.useEffect)(()=>{let t=new ResizeObserver(()=>{p()}),o=[];return a.current&&o.push(a.current),de.current&&o.push(de.current),F.current&&document.contains(F.current)&&o.push(F.current),o.forEach(r=>{t.observe(r)}),()=>t.disconnect()},[p]),(0,e.useEffect)(()=>{if(!a.current)return;let t=new MutationObserver(()=>{F.current=null,p()});return t.observe(a.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[p]);let R=Math.max(Wt,x);return(0,e.useEffect)(()=>{let t="overlay-scrollbar-shared";if(document.getElementById(t))return;let o=document.createElement("style");o.id=t,o.textContent=`
2
2
  /* ehfuse-editor-content\uB294 \uC2A4\uD06C\uB864\uBC14 \uC720\uC9C0 */
3
3
  .overlay-scrollbar-container .ehfuse-editor-content {
4
4
  scrollbar-width: thin !important;
@@ -27,7 +27,7 @@
27
27
  from { transform: rotate(0deg); }
28
28
  to { transform: rotate(360deg); }
29
29
  }
30
- `,document.head.appendChild(o)},[]),(0,t.useEffect)(()=>{let e=`overlay-scrollbar-instance-${Q}`,o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");r.id=e;let l=`.${Q}`;return r.textContent=`
30
+ `,document.head.appendChild(o)},[]),(0,e.useEffect)(()=>{let t=`overlay-scrollbar-instance-${Q}`,o=document.getElementById(t);o&&o.remove();let r=document.createElement("style");r.id=t;let l=`.${Q}`;return r.textContent=`
31
31
  ${l} {
32
32
  scrollbar-width: none !important;
33
33
  -ms-overflow-style: none !important;
@@ -38,5 +38,5 @@
38
38
  height: 0 !important;
39
39
  }
40
40
  ${l}::-webkit-scrollbar-track { display: none !important; }
41
- ${l}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(r),()=>{document.getElementById(e)?.remove()}},[Q]),(0,y.jsxs)("div",{ref:We,className:`overlay-scrollbar-wrapper ${d}`,onMouseLeave:$t,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...f},children:[Mt&&(0,y.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${Oe-68}px)`,transition:Se?"transform 0.15s ease-out":Oe===0?"transform 0.2s ease-out":"none",width:60,height:60,borderRadius:"50%",background:"#ffffff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1001,pointerEvents:"none",opacity:Se?1:Math.min(Ae*1.5,1)},children:Se?(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:et,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{transform:`rotate(${Ae*270}deg)`,opacity:Ae>=1?1:.6},children:(0,y.jsx)("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:et})})}),(0,y.jsx)("div",{ref:a,className:`overlay-scrollbar-container ${Q}`,tabIndex:-1,onMouseDown:Bt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:j?"none":"auto",...g},children:(0,y.jsx)("div",{ref:fe,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...u},children:S})}),ne&&le&&(n.overflowY??!0)&&(0,y.jsxs)("div",{ref:pe,className:"overlay-scrollbar-track",onMouseEnter:()=>{T(),ee.current=setTimeout(()=>{M(!0),ee.current=null},100)},onMouseLeave:()=>{ke(),N||v(s.delay)},style:{position:"absolute",top:0,right:0,width:`${R}px`,height:"100%",opacity:Ce?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Ot(e)},style:{position:"absolute",top:_?`${E.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(R-E.width)/2}px`,width:`${E.width}px`,height:_?`calc(100% - ${E.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{ref:wt,className:"overlay-scrollbar-thumb",onMouseDown:Wt,onMouseEnter:()=>rt(!0),onMouseLeave:()=>rt(!1),style:{position:"absolute",top:`${(_?x+n.margin*2:n.margin)+St}px`,right:n.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${Math.max(he,Ue)}px`,backgroundColor:ot||N?E.hoverColor:E.color,opacity:ot||N?E.hoverOpacity:E.opacity,borderRadius:`${E.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),ne&&le&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:At,onMouseEnter:()=>Le("up"),onMouseLeave:()=>Le(null),style:{position:"absolute",top:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${x}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(x*.75,8)}px`,color:He==="up"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:Ce?He==="up"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),ne&&le&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:zt,onMouseEnter:()=>Le("down"),onMouseLeave:()=>Le(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${x}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(x*.75,8)}px`,color:He==="down"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:Ce?He==="down"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),ne&&Te&&Ht&&(n.overflowX??!0)&&(0,y.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{T(),ee.current=setTimeout(()=>{M(!0),ee.current=null},100)},onMouseLeave:()=>{ke(),B||v(s.delay)},style:{position:"absolute",bottom:`${kt}px`,left:0,width:"100%",height:`${R}px`,opacity:Ce?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Nt(e)},style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(R-x)/2}px`,left:`${n.margin}px`,right:le?n.alignment==="outside"?`${R-n.margin}px`:`${R}px`:`${n.margin}px`,height:`${x}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Ft,onMouseEnter:()=>at(!0),onMouseLeave:()=>at(!1),style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(R-x)/2}px`,left:`${n.margin+_e}px`,right:le?n.alignment==="outside"?`${R-n.margin}px`:`${R}px`:"auto",maxWidth:le?n.alignment==="outside"?`calc(100% - ${n.margin+_e+R-n.margin}px)`:`calc(100% - ${n.margin+_e+R}px)`:"none",width:`${Math.max(Be,50)}px`,height:`${x}px`,backgroundColor:it||B?E.hoverColor:E.color,opacity:it||B?E.hoverOpacity:E.opacity,borderRadius:`${E.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),q&&(0,y.jsx)("button",{type:"button","aria-label":"\uB9E8 \uC704\uB85C",onClick:()=>a.current?.scrollTo({top:0,behavior:"smooth"}),style:{position:"absolute",[we]:Qe,bottom:Qe,zIndex:1200,width:Me,height:Me,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"50%",backgroundColor:yt,color:xt,boxShadow:"0 3px 8px rgba(15, 23, 42, 0.28)",cursor:"pointer",opacity:Ee?1:0,transform:Ee?"translateY(0) scale(1)":"translateY(8px) scale(0.9)",pointerEvents:Ee?"auto":"none",transition:Ee?"opacity 0.2s ease, transform 0.2s ease":"opacity 0.45s ease, transform 0.45s ease"},children:(0,y.jsx)("svg",{width:Math.round(Me*.5),height:Math.round(Me*.5),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,y.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})}),Ze=no;
41
+ ${l}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(r),()=>{document.getElementById(t)?.remove()}},[Q]),(0,y.jsxs)("div",{ref:$e,className:`overlay-scrollbar-wrapper ${d}`,onMouseLeave:At,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...f},children:[Ct&&(0,y.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${We-68}px)`,transition:Se?"transform 0.15s ease-out":We===0?"transform 0.2s ease-out":"none",width:60,height:60,borderRadius:"50%",background:"#ffffff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.25)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1001,pointerEvents:"none",opacity:Se?1:Math.min(Ae*1.5,1)},children:Se?(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{animation:"overlay-scrollbar-ptr-spin 0.8s linear infinite"},children:(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:et,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:"42",strokeDashoffset:"14"})}):(0,y.jsx)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",style:{transform:`rotate(${Ae*270}deg)`,opacity:Ae>=1?1:.6},children:(0,y.jsx)("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:et})})}),(0,y.jsx)("div",{ref:a,className:`overlay-scrollbar-container ${Q}`,tabIndex:-1,onMouseDown:Yt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:j?"none":"auto",...b},children:(0,y.jsx)("div",{ref:de,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",boxSizing:"border-box",...u},children:C})}),re&&le&&(n.overflowY??!0)&&(0,y.jsxs)("div",{ref:fe,className:"overlay-scrollbar-track",onMouseEnter:()=>{T(),J.current=setTimeout(()=>{M(!0),J.current=null},100)},onMouseLeave:()=>{De(),N||v(s.delay)},style:{position:"absolute",top:0,right:0,width:`${R}px`,height:"100%",opacity:Ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:t=>{t.preventDefault(),t.stopPropagation(),Ft(t)},style:{position:"absolute",top:_?`${S.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(R-S.width)/2}px`,width:`${S.width}px`,height:_?`calc(100% - ${S.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{ref:Et,className:"overlay-scrollbar-thumb",onMouseDown:zt,onMouseEnter:()=>rt(!0),onMouseLeave:()=>rt(!1),style:{position:"absolute",top:`${(_?x+n.margin*2:n.margin)+Lt}px`,right:n.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${Math.max(pe,Ue)}px`,backgroundColor:ot||N?S.hoverColor:S.color,opacity:ot||N?S.hoverOpacity:S.opacity,borderRadius:`${S.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),re&&le&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:Nt,onMouseEnter:()=>He("up"),onMouseLeave:()=>He(null),style:{position:"absolute",top:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${x}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(x*.75,8)}px`,color:Ce==="up"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:Ee?Ce==="up"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),re&&le&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:Bt,onMouseEnter:()=>He("down"),onMouseLeave:()=>He(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(R-x)/2}px`,width:`${x}px`,height:`${x}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(x*.75,8)}px`,color:Ce==="down"?z.hoverColor:z.color,userSelect:"none",zIndex:1001,opacity:Ee?Ce==="down"?z.hoverOpacity:z.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),re&&xe&&kt&&(n.overflowX??!0)&&(0,y.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{T(),J.current=setTimeout(()=>{M(!0),J.current=null},100)},onMouseLeave:()=>{De(),B||v(s.delay)},style:{position:"absolute",bottom:`${Ot}px`,left:0,width:"100%",height:`${R}px`,opacity:Ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:t=>{t.preventDefault(),t.stopPropagation(),Ut(t)},style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(R-x)/2}px`,left:`${n.margin}px`,right:le?n.alignment==="outside"?`${R-n.margin}px`:`${R}px`:`${n.margin}px`,height:`${x}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:_t,onMouseEnter:()=>at(!0),onMouseLeave:()=>at(!1),style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(R-x)/2}px`,left:`${n.margin+_e}px`,right:le?n.alignment==="outside"?`${R-n.margin}px`:`${R}px`:"auto",maxWidth:le?n.alignment==="outside"?`calc(100% - ${n.margin+_e+R-n.margin}px)`:`calc(100% - ${n.margin+_e+R}px)`:"none",width:`${Math.max(Be,50)}px`,height:`${x}px`,backgroundColor:it||B?S.hoverColor:S.color,opacity:it||B?S.hoverOpacity:S.opacity,borderRadius:`${S.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),q&&(0,y.jsx)("button",{type:"button","aria-label":"\uB9E8 \uC704\uB85C",onClick:()=>a.current?.scrollTo({top:0,behavior:"smooth"}),style:{position:"absolute",[yt]:Qe,bottom:Qe,zIndex:1200,width:Me,height:Me,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"50%",backgroundColor:xt,color:Tt,boxShadow:"0 3px 8px rgba(15, 23, 42, 0.28)",cursor:"pointer",opacity:Pe?Mt?we:1:0,transform:Pe?"translateY(0) scale(1)":"translateY(8px) scale(0.9)",pointerEvents:Pe?"auto":"none",transition:"opacity 0.25s ease, transform 0.25s ease"},children:(0,y.jsx)("svg",{width:Math.round(Me*.5),height:Math.round(Me*.5),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,y.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]})}),Ze=ao;
42
42
  //# sourceMappingURL=index.js.map