@ehfuse/overlay-scrollbar 1.7.29 → 1.7.31

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 Ze=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var eo=Object.prototype.hasOwnProperty;var to=(r,i)=>{for(var d in i)Ze(r,d,{get:i[d],enumerable:!0})},oo=(r,i,d,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let v of Jt(i))!eo.call(r,v)&&v!==d&&Ze(r,v,{get:()=>i[v],enumerable:!(u=Qt(i,v))||u.enumerable});return r};var ro=r=>oo(Ze({},"__esModule",{value:!0}),r);var go={};to(go,{OverlayScrollbar:()=>Je,default:()=>Je});module.exports=ro(go);var t=require("react");var no=["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"],ke=(r,i)=>{if(r instanceof HTMLElement&&r.isContentEditable||r.closest('[role="textbox"],[role="searchbox"]'))return!0;let d=r.tagName.toLowerCase();if(d==="input"){let u=(r.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(d)||["svg","path","circle","rect","line","polygon","polyline"].includes(d)||r.getAttribute("contenteditable")==="true")return!0;if(i?.excludeSelectors){for(let u of i.excludeSelectors)if(r.matches(u))return!0}return lo(r,i)},lo=(r,i)=>{let d=[...no,...i?.excludeClasses||[]],u=r,v=0,E=5;for(;u&&v<=E;){if(d.some(R=>u.classList.contains(R)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,v++}return!1};var io=r=>{if(r==null)return null;if(typeof r=="number")return Number.isFinite(r)?r:null;let i=r.trim();if(i==="")return null;let d=/^(-?\d*\.?\d+)(px)?$/.exec(i);if(!d)return null;let u=Number.parseFloat(d[1]);return Number.isFinite(u)?u:null},ao=r=>{if(r==null)return;if(typeof r=="number")return r;let i=r.trim().split(/\s+/);if(!(i.length===0||i[0]===""))return i.length===1||i.length===2?i[0]:i[2]},so=r=>{let i=typeof r=="number"?[`${r}px`]:r.trim().split(/\s+/),[d,u=d,v=d,E=u]=i;return`${d} ${u} 0 ${E}`},Qe=r=>{if(!r)return{style:r,spacerHeight:0};let i=r.paddingBottom!==void 0,d=r.padding!==void 0;if(!i&&!d)return{style:r,spacerHeight:0};let u=i?r.paddingBottom:ao(r.padding),v=io(u);if(v===null||v<=0)return{style:r,spacerHeight:0};let E={...r};return d&&r.padding!==void 0&&(E.padding=so(r.padding)),i&&(E.paddingBottom=0),{style:E,spacerHeight:v}};var I=require("react"),xt=({containerRef:r,config:i})=>{let d=i.enabled??!0,u=i.threshold??80,v=i.maxDistance??u*2,E=i.onRefresh,[R,k]=(0,I.useState)(0),[O,U]=(0,I.useState)(!1),z=(0,I.useRef)(0),de=(0,I.useRef)(0),X=(0,I.useRef)(!1),Z=(0,I.useRef)(!1),oe=(0,I.useRef)(!1),q=(0,I.useRef)(0),re=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{re.current=O},[O]),(0,I.useEffect)(()=>{let H=r.current;if(!H||!(d&&typeof E=="function"))return;let we=h=>{let D=h instanceof Element?h:null;for(;D&&D!==H;){if(D instanceof HTMLElement&&D.scrollHeight>D.clientHeight+1&&D.scrollTop>0)return!1;D=D.parentElement}return!0},Ie=h=>{X.current=!1,Z.current=!1,oe.current=!1,!re.current&&h.touches.length===1&&H.scrollTop===0&&we(h.target)&&(X.current=!0,z.current=h.touches[0].clientY,de.current=h.touches[0].clientX)},Q=h=>{if(!X.current||re.current||h.touches.length!==1)return;let D=h.touches[0].clientY-z.current,$e=h.touches[0].clientX-de.current;if(!Z.current){if(D<=0||H.scrollTop>0){X.current=!1;return}if(D>8&&D>Math.abs($e))Z.current=!0,oe.current=H.scrollTop<0;else return}!oe.current&&h.cancelable&&h.preventDefault();let le=Math.min(Math.max(D,0)*.5,v);q.current=le,k(le)},Y=()=>{if(!X.current||(X.current=!1,!Z.current))return;Z.current=!1,oe.current=!1;let h=q.current;q.current=0,h>=u&&!re.current?(U(!0),k(u),Promise.resolve().then(()=>E()).catch(()=>{}).finally(()=>{U(!1),k(0)})):k(0)};return H.addEventListener("touchstart",Ie,{passive:!0}),H.addEventListener("touchmove",Q,{passive:!1}),H.addEventListener("touchend",Y,{passive:!0}),H.addEventListener("touchcancel",Y,{passive:!0}),()=>{H.removeEventListener("touchstart",Ie),H.removeEventListener("touchmove",Q),H.removeEventListener("touchend",Y),H.removeEventListener("touchcancel",Y)}},[r,d,E,u,v]),{pullDistance:R,isRefreshing:O,pullProgress:Math.min(R/u,1),pullThreshold:u}};var Pe=require("react");function Tt(){let[r,i]=(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 d=window.matchMedia("(pointer: coarse)"),u=v=>i(v.matches);return i(d.matches),typeof d.addEventListener=="function"?(d.addEventListener("change",u),()=>d.removeEventListener("change",u)):(d.addListener(u),()=>d.removeListener(u))},[]),r}var y=require("react/jsx-runtime"),co={},uo={},fo={},po={},ho={},mo={},bo=(0,t.forwardRef)(({className:r="",style:i={},containerStyle:d={},contentStyle:u={},children:v,onScroll:E,thumb:R=co,track:k=uo,arrows:O=fo,dragScroll:U=po,autoHide:z=ho,pullToRefresh:de=mo,showScrollbar:X=!0,showHorizontalScrollbar:Z=!0,detectInnerScroll:oe=!1,scrollTopFab:q=!1},re)=>{let H=Tt(),ne=X,we=H?!1:Z,Q=`os-${(0,t.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,Y=q!==!1&&q!=null,h=typeof q=="object"?q:{},D=h.threshold??600,$e=h.idleOpacity??h.scrollingOpacity??.45,le=h.hideDelay??1500,wt=h.position??"right",et=h.offset??16,St=h.offsetBottom??et,Et=h.background??"#1976d2",Mt=h.color??"#ffffff",Se=h.size??48,[Oe,tt]=(0,t.useState)(!1),[Ct,fe]=(0,t.useState)(!1),J=(0,t.useRef)(null),Ht=(0,t.useRef)({});(0,t.useEffect)(()=>{Ht.current={children:v,onScroll:E,showScrollbar:ne,showHorizontalScrollbar:we,thumb:R,track:k,arrows:O,dragScroll:U,autoHide:z}});let We=(0,t.useRef)(null),c=(0,t.useRef)(null),pe=(0,t.useRef)(null),he=(0,t.useRef)(null),Lt=(0,t.useRef)(null),B=(0,t.useRef)(null),{pullDistance:ze,isRefreshing:Ee,pullProgress:Ae}=xt({containerRef:c,config:de}),ot=de.indicatorColor??"#1976d2",Dt=ze>0||Ee,[Me,M]=(0,t.useState)(!1),[F,rt]=(0,t.useState)(!1),[nt,lt]=(0,t.useState)(!1),[Be,Rt]=(0,t.useState)({y:0,scrollTop:0}),[me,it]=(0,t.useState)(0),[kt,Fe]=(0,t.useState)(0),[ie,at]=(0,t.useState)(!1),[st,ct]=(0,t.useState)(!1),[N,ut]=(0,t.useState)(!1),[Ne,Pt]=(0,t.useState)({x:0,scrollLeft:0}),[_e,dt]=(0,t.useState)(0),[Ue,ft]=(0,t.useState)(0),[It,pt]=(0,t.useState)(!1),ae=(0,t.useRef)(!1),[j,ht]=(0,t.useState)(!1),[be,$t]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[vo,yo]=(0,t.useState)(null),[Ce,He]=(0,t.useState)(null),[xo,Ot]=(0,t.useState)(!1),[Wt,zt]=(0,t.useState)(0),ge=(0,t.useRef)(null),[mt,bt]=(0,t.useState)(!1),ve=(0,t.useRef)(null),ee=(0,t.useRef)(null),te=(0,t.useRef)(null),C=(0,t.useMemo)(()=>{let e=R.color??"#606060";return{width:R.width??8,minHeight:R.minHeight??50,radius:R.radius??(R.width??8)/2,color:e,opacity:R.opacity??.6,hoverColor:R.hoverColor??e,hoverOpacity:R.hoverOpacity??1}},[R]),a=(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??C.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,C.radius]),A=(0,t.useMemo)(()=>{let e=O.color??"#808080";return{visible:O.visible??!1,step:O.step??50,color:e,opacity:O.opacity??.6,hoverColor:O.hoverColor??e,hoverOpacity:O.hoverOpacity??1}},[O]),ye=(0,t.useMemo)(()=>({enabled:H?!1:U.enabled??!0,excludeClasses:U.excludeClasses??[],excludeSelectors:U.excludeSelectors??[]}),[U,H]),f=(0,t.useMemo)(()=>({enabled:z.enabled??!0,delay:z.delay??1500,delayOnWheel:z.delayOnWheel??700,initialDelay:z.initialDelay??200}),[z]),[se,At]=(0,t.useState)(()=>(z.initialDelay??200)>0),T=C.width,Bt=a.width,Xe=C.minHeight,_=A.visible,Le=A.step,W=(0,t.useCallback)(()=>{if(!c.current)return;let e=document.activeElement;e&&c.current.contains(e)&&e!==c.current||c.current.focus()},[]);(0,t.useImperativeHandle)(re,()=>({getScrollContainer:()=>c.current,scrollTo:e=>{c.current&&c.current.scrollTo(e)},get scrollTop(){return c.current?.scrollTop||0},get scrollHeight(){return c.current?.scrollHeight||0},get clientHeight(){return c.current?.clientHeight||0}}),[]);let g=(0,t.useCallback)(()=>{if(B.current){let o=B.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;B.current=null}if(!c.current)return null;if(c.current.scrollHeight>c.current.clientHeight+2||c.current.scrollWidth>c.current.clientWidth+2)return B.current=c.current,c.current;if(!oe)return null;let e=c.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let n=o;if(n!==c.current&&n.classList.contains("overlay-scrollbar-container"))continue;let s=n.parentElement,l=!1;for(;s&&s!==c.current;){if(s.classList.contains("overlay-scrollbar-container")&&s!==c.current){l=!0;break}s=s.parentElement}if(!l&&(n.scrollHeight>n.clientHeight+2||n.scrollWidth>n.clientWidth+2))return B.current=n,n}return null},[]),G=(0,t.useCallback)(()=>g()!==null,[g]),w=(0,t.useCallback)(()=>{ve.current&&(clearTimeout(ve.current),ve.current=null)},[]),De=(0,t.useCallback)(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),gt=(0,t.useCallback)(()=>{te.current&&(clearTimeout(te.current),te.current=null)},[]),Ft=(0,t.useCallback)(()=>{De(),!(F||N||j||ae.current)&&(w(),M(!1))},[w,De,F,N,j]),x=(0,t.useCallback)(e=>{f.enabled&&(w(),ve.current=setTimeout(()=>{M(!1),ve.current=null},e))},[w,f.enabled]),m=(0,t.useCallback)(()=>{let e=g()??c.current;if(!e){M(!1),at(!1),pt(!1),w();return}!f.enabled&&!se&&(M(!0),w());let o=e.clientHeight,n=e.scrollHeight,s=e.scrollTop,l=e.clientWidth,p=e.scrollWidth,S=e.scrollLeft,L=n-o>0,b=p-l>0,ce=L||b;at(L),pt(b),ce||(M(!1),w());let xe=0,$=0;if(We.current){let K=window.getComputedStyle(We.current),V=parseFloat(K.paddingTop)||0;$=parseFloat(K.paddingBottom)||0,xe=V+$,zt($)}if(L){let K=_?T*2+a.margin*4:a.margin*2,V=o-K+xe,Re=o/n,ue=Math.max(V*Re,Xe),yt=n-o,Vt=V-ue,Zt=yt>0?s/yt*Vt:0;it(ue),Fe(Zt)}else it(0),Fe(0);let Te=p-l;if(Te>0){let K=l/p,V=Math.max(l*K,50),Re=l-V,ue=Te>0?S/Te*Re:0;dt(V),ft(ue)}else dt(0),ft(0)},[g,w,_,T,Xe,f.enabled,se]),Nt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=g();o&&(rt(!0),Rt({y:e.clientY,scrollTop:o.scrollTop}),w(),M(!0),W())},[g,w,W]),qe=(0,t.useCallback)(e=>{if(!F)return;let o=g();if(!o)return;let n=o.clientHeight,l=o.scrollHeight-n,p=e.clientY-Be.y,S=n-me,L=p/S*l,b=Math.max(0,Math.min(l,Be.scrollTop+L));o.scrollTop=b,m()},[F,Be,me,m,g]),Ye=(0,t.useCallback)(()=>{rt(!1),G()&&x(f.delay)},[G,x,f.delay]),_t=(0,t.useCallback)(e=>{if(!he.current)return;let n=he.current.getBoundingClientRect(),s=e.clientY-n.top,l=g();if(!l)return;let p=l.clientHeight,S=l.scrollHeight,b=s/p*(S-p);l.scrollTop=Math.max(0,Math.min(S-p,b)),m(),M(!0),x(f.delay),W()},[m,x,f.delay,g,W]),Ut=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!c.current)return;let o=Math.max(0,c.current.scrollTop-Le);c.current.scrollTop=o,m(),M(!0),x(f.delay),W()},[m,x,Le,f.delay,W]),Xt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!c.current||!pe.current)return;let o=c.current,s=pe.current.scrollHeight-o.clientHeight,l=Math.min(s,o.scrollTop+Le);o.scrollTop=l,m(),M(!0),x(f.delay),W()},[m,x,Le,f.delay,W]),qt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=g();o&&(ut(!0),Pt({x:e.clientX,scrollLeft:o.scrollLeft}),w(),M(!0),W())},[g,w,W]),je=(0,t.useCallback)(e=>{if(!N)return;let o=g();if(!o)return;let n=o.clientWidth,l=o.scrollWidth-n,p=e.clientX-Ne.x,S=n-_e,L=p/S*l,b=Math.max(0,Math.min(l,Ne.scrollLeft+L));o.scrollLeft=b,m()},[N,Ne,_e,m,g]),Ge=(0,t.useCallback)(()=>{ut(!1),G()&&x(f.delay)},[G,x,f.delay]),Yt=(0,t.useCallback)(e=>{if(!he.current)return;let n=he.current.getBoundingClientRect(),s=e.clientX-n.left,l=g();if(!l)return;let p=l.clientWidth,S=l.scrollWidth,b=s/p*(S-p);l.scrollLeft=Math.max(0,Math.min(S-p,b)),m(),M(!0),x(f.delay),W()},[m,x,f.delay,g,W]),jt=(0,t.useCallback)(e=>{if(!ye.enabled||e.defaultPrevented)return;let o=e.target,n=c.current;if(!n||!n.contains(o)||ke(o,ye)||e.button!==0)return;let s=g();if(!s||s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth)return;e.preventDefault();let l=document.activeElement;l instanceof HTMLElement&&l!==document.body&&!l.contains(o)&&l.blur(),ae.current=!0,$t({x:e.clientX,y:e.clientY,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft||0}),w()},[ye,ke,g,w]),Ke=(0,t.useCallback)(e=>{if(!ae.current&&!j)return;let o=g();if(!o)return;let n=be.x-e.clientX,s=be.y-e.clientY;if(Math.abs(s)<5&&Math.abs(n)<5)return;ae.current&&(ae.current=!1,ht(!0)),M(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,be.scrollTop+s)),p=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,be.scrollLeft+n));o.scrollTop=l,o.scrollLeft=p,m()},[j,be,g,m]),Ve=(0,t.useCallback)(()=>{let e=j;ae.current=!1,ht(!1),e&&G()&&x(f.delay)},[j,G,x,f.delay]);(0,t.useEffect)(()=>{let e=p=>{if(m(),Y){let b=(p.target?.scrollTop??0)>D;tt(b),J.current&&(clearTimeout(J.current),J.current=null),b&&le>0&&(J.current=setTimeout(()=>{J.current=null,tt(!1)},le))}if(se){E&&E(p);return}w(),M(!0),gt();let S=mt?f.delayOnWheel:f.delay;x(S),E&&E(p)},o=()=>{bt(!0),ge.current&&clearTimeout(ge.current),ge.current=setTimeout(()=>{bt(!1)},300),gt(),te.current=setTimeout(()=>{M(!0),te.current=null,x(f.delayOnWheel)},50)},n=[],s=g();s&&n.push(s);let l=c.current;return l&&!s&&(n.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(S=>{let L=S;if(L!==l&&L.classList.contains("overlay-scrollbar-container"))return;let b=L.parentElement;for(;b&&b!==l;){if(b.classList.contains("overlay-scrollbar-container")&&b!==l)return;b=b.parentElement}n.push(L)})),n.forEach(p=>{p.addEventListener("scroll",e,{passive:!0}),p.addEventListener("wheel",o,{passive:!0})}),()=>{n.forEach(p=>{p.removeEventListener("scroll",e),p.removeEventListener("wheel",o)}),ge.current&&clearTimeout(ge.current),te.current&&clearTimeout(te.current)}},[g,m,E,w,x,f,mt,se,Y,D,le]),(0,t.useEffect)(()=>()=>{J.current&&clearTimeout(J.current)},[]),(0,t.useEffect)(()=>{let e=n=>{let s=n.target;if(n.defaultPrevented||s instanceof Element&&ke(s,ye))return;let l=g();if(!l)return;let{key:p}=n,{scrollTop:S,scrollHeight:L,clientHeight:b}=l,ce=L-b,xe=50,$=null;switch(p){case"ArrowUp":n.preventDefault(),$=Math.max(0,S-xe);break;case"ArrowDown":n.preventDefault(),$=Math.min(ce,S+xe);break;case"PageUp":n.preventDefault(),$=Math.max(0,S-b);break;case"PageDown":n.preventDefault(),$=Math.min(ce,S+b);break;case"Home":n.preventDefault(),$=0;break;case"End":n.preventDefault(),$=ce;break;default:return}if($!==null){let Te=$/ce,K=_?T*2+a.margin*4:a.margin*2,ue=(b-K-me)*Te;Fe(ue),l.scrollTop=$,w(),M(!0),x(f.delay)}},o=c.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[g,_,T,a.margin,me,w,x,f.delay,ye]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",Ke),document.addEventListener("mouseup",Ve),()=>{document.removeEventListener("mousemove",Ke),document.removeEventListener("mouseup",Ve)}),[j,Ke,Ve]),(0,t.useEffect)(()=>{if(F)return document.addEventListener("mousemove",qe),document.addEventListener("mouseup",Ye),()=>{document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",Ye)}},[F,qe,Ye]),(0,t.useEffect)(()=>{if(N)return document.addEventListener("mousemove",je),document.addEventListener("mouseup",Ge),()=>{document.removeEventListener("mousemove",je),document.removeEventListener("mouseup",Ge)}},[N,je,Ge]),(0,t.useEffect)(()=>{m();let e=setTimeout(()=>{m()},100);return()=>clearTimeout(e)},[m]),(0,t.useLayoutEffect)(()=>{Ot(!0),m(),!f.enabled&&!se&&G()&&M(!0)},[G,m,f.enabled,se]),(0,t.useEffect)(()=>{if(f.initialDelay>0){let e=setTimeout(()=>{At(!1)},f.initialDelay);return()=>clearTimeout(e)}},[f.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{m()}),o=[];return c.current&&o.push(c.current),pe.current&&o.push(pe.current),B.current&&document.contains(B.current)&&o.push(B.current),o.forEach(n=>{e.observe(n)}),()=>e.disconnect()},[m]),(0,t.useEffect)(()=>{if(!c.current)return;let e=new MutationObserver(()=>{B.current=null,m()});return e.observe(c.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[m]);let P=Math.max(Bt,T);(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 tt=Object.defineProperty;var to=Object.getOwnPropertyDescriptor;var oo=Object.getOwnPropertyNames;var ro=Object.prototype.hasOwnProperty;var no=(r,i)=>{for(var d in i)tt(r,d,{get:i[d],enumerable:!0})},lo=(r,i,d,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let v of oo(i))!ro.call(r,v)&&v!==d&&tt(r,v,{get:()=>i[v],enumerable:!(u=to(i,v))||u.enumerable});return r};var io=r=>lo(tt({},"__esModule",{value:!0}),r);var xo={};no(xo,{OverlayScrollbar:()=>rt,default:()=>rt});module.exports=io(xo);var e=require("react");var ao=["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=(r,i)=>{if(r instanceof HTMLElement&&r.isContentEditable||r.closest('[role="textbox"],[role="searchbox"]'))return!0;let d=r.tagName.toLowerCase();if(d==="input"){let u=(r.type||"text").toLowerCase();return!["button","submit","reset","image","hidden"].includes(u)}if(["textarea","select","button"].includes(d)||["svg","path","circle","rect","line","polygon","polyline"].includes(d)||r.getAttribute("contenteditable")==="true")return!0;if(i?.excludeSelectors){for(let u of i.excludeSelectors)if(r.matches(u))return!0}return so(r,i)},so=(r,i)=>{let d=[...ao,...i?.excludeClasses||[]],u=r,v=0,E=5;for(;u&&v<=E;){if(d.some(R=>u.classList.contains(R)))return!0;if(u.classList.contains("MuiDialogContent-root"))break;u=u.parentElement,v++}return!1};var co=r=>{if(r==null)return null;if(typeof r=="number")return Number.isFinite(r)?r:null;let i=r.trim();if(i==="")return null;let d=/^(-?\d*\.?\d+)(px)?$/.exec(i);if(!d)return null;let u=Number.parseFloat(d[1]);return Number.isFinite(u)?u:null},uo=r=>{if(r==null)return;if(typeof r=="number")return r;let i=r.trim().split(/\s+/);if(!(i.length===0||i[0]===""))return i.length===1||i.length===2?i[0]:i[2]},fo=r=>{let i=typeof r=="number"?[`${r}px`]:r.trim().split(/\s+/),[d,u=d,v=d,E=u]=i;return`${d} ${u} 0 ${E}`},ot=r=>{if(!r)return{style:r,spacerHeight:0};let i=r.paddingBottom!==void 0,d=r.padding!==void 0;if(!i&&!d)return{style:r,spacerHeight:0};let u=i?r.paddingBottom:uo(r.padding),v=co(u);if(v===null||v<=0)return{style:r,spacerHeight:0};let E={...r};return d&&r.padding!==void 0&&(E.padding=fo(r.padding)),i&&(E.paddingBottom=0),{style:E,spacerHeight:v}};var I=require("react"),St=({containerRef:r,config:i})=>{let d=i.enabled??!0,u=i.threshold??80,v=i.maxDistance??u*2,E=i.onRefresh,[R,k]=(0,I.useState)(0),[O,_]=(0,I.useState)(!1),W=(0,I.useRef)(0),fe=(0,I.useRef)(0),q=(0,I.useRef)(!1),V=(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=O},[O]),(0,I.useEffect)(()=>{let S=r.current;if(!S||!(d&&typeof E=="function"))return;let Se=m=>{let D=m instanceof Element?m:null;for(;D&&D!==S;){if(D instanceof HTMLElement&&D.scrollHeight>D.clientHeight+1&&D.scrollTop>0)return!1;D=D.parentElement}return!0},Oe=m=>{q.current=!1,V.current=!1,te.current=!1,!oe.current&&m.touches.length===1&&S.scrollTop===0&&Se(m.target)&&(q.current=!0,W.current=m.touches[0].clientY,fe.current=m.touches[0].clientX)},Z=m=>{if(!q.current||oe.current||m.touches.length!==1)return;let D=m.touches[0].clientY-W.current,Ae=m.touches[0].clientX-fe.current;if(!V.current){if(D<=0||S.scrollTop>0){q.current=!1;return}if(D>8&&D>Math.abs(Ae))V.current=!0,te.current=S.scrollTop<0;else return}!te.current&&m.cancelable&&m.preventDefault();let ne=Math.min(Math.max(D,0)*.5,v);X.current=ne,k(ne)},Y=()=>{if(!q.current||(q.current=!1,!V.current))return;V.current=!1,te.current=!1;let m=X.current;X.current=0,m>=u&&!oe.current?(_(!0),k(u),Promise.resolve().then(()=>E()).catch(()=>{}).finally(()=>{_(!1),k(0)})):k(0)};return S.addEventListener("touchstart",Oe,{passive:!0}),S.addEventListener("touchmove",Z,{passive:!1}),S.addEventListener("touchend",Y,{passive:!0}),S.addEventListener("touchcancel",Y,{passive:!0}),()=>{S.removeEventListener("touchstart",Oe),S.removeEventListener("touchmove",Z),S.removeEventListener("touchend",Y),S.removeEventListener("touchcancel",Y)}},[r,d,E,u,v]),{pullDistance:R,isRefreshing:O,pullProgress:Math.min(R/u,1),pullThreshold:u}};var $e=require("react");function Et(){let[r,i]=(0,$e.useState)(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(pointer: coarse)").matches);return(0,$e.useEffect)(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;let d=window.matchMedia("(pointer: coarse)"),u=v=>i(v.matches);return i(d.matches),typeof d.addEventListener=="function"?(d.addEventListener("change",u),()=>d.removeEventListener("change",u)):(d.addListener(u),()=>d.removeListener(u))},[]),r}var y=require("react/jsx-runtime"),po={},mo={},ho={},bo={},go={},vo={},yo=(0,e.forwardRef)(({className:r="",style:i={},containerStyle:d={},contentStyle:u={},children:v,onScroll:E,thumb:R=po,track:k=mo,arrows:O=ho,dragScroll:_=bo,autoHide:W=go,pullToRefresh:fe=vo,showScrollbar:q=!0,showHorizontalScrollbar:V=!0,detectInnerScroll:te=!1,scrollTopFab:X=!1},oe)=>{let S=Et(),re=q,Se=S?!1:V,Z=`os-${(0,e.useId)().replace(/[^a-zA-Z0-9_-]/g,"")}`,Y=X!==!1&&X!=null,m=typeof X=="object"?X:{},D=m.threshold??600,Ae=m.idleOpacity??m.scrollingOpacity??.45,ne=m.hideDelay??1500,Mt=m.position??"right",nt=m.offset??16,Ct=m.offsetBottom??nt,Ht=m.background??"#1976d2",Lt=m.color??"#ffffff",Ee=m.size??48,[We,lt]=(0,e.useState)(!1),[Dt,pe]=(0,e.useState)(!1),Q=(0,e.useRef)(null),Rt=(0,e.useRef)({});(0,e.useEffect)(()=>{Rt.current={children:v,onScroll:E,showScrollbar:re,showHorizontalScrollbar:Se,thumb:R,track:k,arrows:O,dragScroll:_,autoHide:W}});let ze=(0,e.useRef)(null),c=(0,e.useRef)(null),me=(0,e.useRef)(null),he=(0,e.useRef)(null),kt=(0,e.useRef)(null),B=(0,e.useRef)(null),{pullDistance:Be,isRefreshing:Me,pullProgress:Fe}=St({containerRef:c,config:fe}),it=fe.indicatorColor??"#1976d2",Pt=Be>0||Me,[Ce,M]=(0,e.useState)(!1),[F,at]=(0,e.useState)(!1),[st,ct]=(0,e.useState)(!1),[Ne,It]=(0,e.useState)({y:0,scrollTop:0}),[be,ut]=(0,e.useState)(0),[$t,Ue]=(0,e.useState)(0),[le,dt]=(0,e.useState)(!1),[ft,pt]=(0,e.useState)(!1),[N,mt]=(0,e.useState)(!1),[_e,Ot]=(0,e.useState)({x:0,scrollLeft:0}),[qe,ht]=(0,e.useState)(0),[Xe,bt]=(0,e.useState)(0),[At,gt]=(0,e.useState)(!1),ie=(0,e.useRef)(!1),[ae,vt]=(0,e.useState)(!1),Ye=(0,e.useRef)(!1),[ge,Wt]=(0,e.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[To,wo]=(0,e.useState)(null),[He,Le]=(0,e.useState)(null),[So,zt]=(0,e.useState)(!1),[Bt,Ft]=(0,e.useState)(0),ve=(0,e.useRef)(null),je=(0,e.useRef)(!1),ye=(0,e.useRef)(null),J=(0,e.useRef)(null),ee=(0,e.useRef)(null),C=(0,e.useMemo)(()=>{let t=R.color??"#606060";return{width:R.width??8,minHeight:R.minHeight??50,radius:R.radius??(R.width??8)/2,color:t,opacity:R.opacity??.6,hoverColor:R.hoverColor??t,hoverOpacity:R.hoverOpacity??1}},[R]),a=(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??C.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,C.radius]),z=(0,e.useMemo)(()=>{let t=O.color??"#808080";return{visible:O.visible??!1,step:O.step??50,color:t,opacity:O.opacity??.6,hoverColor:O.hoverColor??t,hoverOpacity:O.hoverOpacity??1}},[O]),xe=(0,e.useMemo)(()=>({enabled:S?!1:_.enabled??!0,excludeClasses:_.excludeClasses??[],excludeSelectors:_.excludeSelectors??[]}),[_,S]),f=(0,e.useMemo)(()=>({enabled:W.enabled??!0,delay:W.delay??1500,delayOnWheel:W.delayOnWheel??700,initialDelay:W.initialDelay??200}),[W]),[se,Nt]=(0,e.useState)(()=>(W.initialDelay??200)>0),T=C.width,Ut=a.width,Ge=C.minHeight,U=z.visible,De=z.step,A=(0,e.useCallback)(()=>{if(!c.current)return;let t=document.activeElement;t&&c.current.contains(t)&&t!==c.current||c.current.focus()},[]);(0,e.useImperativeHandle)(oe,()=>({getScrollContainer:()=>c.current,scrollTo:t=>{c.current&&c.current.scrollTo(t)},get scrollTop(){return c.current?.scrollTop||0},get scrollHeight(){return c.current?.scrollHeight||0},get clientHeight(){return c.current?.clientHeight||0}}),[]);let b=(0,e.useCallback)(()=>{if(B.current){let o=B.current;if(document.contains(o)&&(o.scrollHeight>o.clientHeight+2||o.scrollWidth>o.clientWidth+2))return o;B.current=null}if(!c.current)return null;if(c.current.scrollHeight>c.current.clientHeight+2||c.current.scrollWidth>c.current.clientWidth+2)return B.current=c.current,c.current;if(!te)return null;let t=c.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of t){let n=o;if(n!==c.current&&n.classList.contains("overlay-scrollbar-container"))continue;let s=n.parentElement,l=!1;for(;s&&s!==c.current;){if(s.classList.contains("overlay-scrollbar-container")&&s!==c.current){l=!0;break}s=s.parentElement}if(!l&&(n.scrollHeight>n.clientHeight+2||n.scrollWidth>n.clientWidth+2))return B.current=n,n}return null},[]),j=(0,e.useCallback)(()=>b()!==null,[b]),H=(0,e.useCallback)(()=>{ye.current&&(clearTimeout(ye.current),ye.current=null)},[]),Re=(0,e.useCallback)(()=>{J.current&&(clearTimeout(J.current),J.current=null)},[]),yt=(0,e.useCallback)(()=>{ee.current&&(clearTimeout(ee.current),ee.current=null)},[]),_t=(0,e.useCallback)(()=>{Re(),!(F||N||ae||ie.current)&&(H(),M(!1))},[H,Re,F,N,ae]),x=(0,e.useCallback)(t=>{f.enabled&&(H(),ye.current=setTimeout(()=>{M(!1),ye.current=null},t))},[H,f.enabled]),g=(0,e.useCallback)(()=>{let t=b()??c.current;if(!t){M(!1),dt(!1),gt(!1),H();return}!f.enabled&&!se&&(M(!0),H());let o=t.clientHeight,n=t.scrollHeight,s=t.scrollTop,l=t.clientWidth,p=t.scrollWidth,w=t.scrollLeft,L=n-o>0,h=p-l>0,ue=L||h;dt(L),gt(h),ue||(M(!1),H());let Te=0,$=0;if(ze.current){let G=window.getComputedStyle(ze.current),K=parseFloat(G.paddingTop)||0;$=parseFloat(G.paddingBottom)||0,Te=K+$,Ft($)}if(L){let G=U?T*2+a.margin*4:a.margin*2,K=o-G+Te,Pe=o/n,de=Math.max(K*Pe,Ge),wt=n-o,Jt=K-de,eo=wt>0?s/wt*Jt:0;ut(de),Ue(eo)}else ut(0),Ue(0);let we=p-l;if(we>0){let G=l/p,K=Math.max(l*G,50),Pe=l-K,de=we>0?w/we*Pe:0;ht(K),bt(de)}else ht(0),bt(0)},[b,H,U,T,Ge,f.enabled,se]),qt=(0,e.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let o=b();o&&(at(!0),It({y:t.clientY,scrollTop:o.scrollTop}),H(),M(!0),A())},[b,H,A]),Ke=(0,e.useCallback)(t=>{if(!F)return;let o=b();if(!o)return;let n=o.clientHeight,l=o.scrollHeight-n,p=t.clientY-Ne.y,w=n-be,L=p/w*l,h=Math.max(0,Math.min(l,Ne.scrollTop+L));o.scrollTop=h,g()},[F,Ne,be,g,b]),Ve=(0,e.useCallback)(()=>{at(!1),j()&&x(f.delay)},[j,x,f.delay]),Xt=(0,e.useCallback)(t=>{if(!he.current)return;let n=he.current.getBoundingClientRect(),s=t.clientY-n.top,l=b();if(!l)return;let p=l.clientHeight,w=l.scrollHeight,h=s/p*(w-p);l.scrollTop=Math.max(0,Math.min(w-p,h)),g(),M(!0),x(f.delay),A()},[g,x,f.delay,b,A]),Yt=(0,e.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!c.current)return;let o=Math.max(0,c.current.scrollTop-De);c.current.scrollTop=o,g(),M(!0),x(f.delay),A()},[g,x,De,f.delay,A]),jt=(0,e.useCallback)(t=>{if(t.preventDefault(),t.stopPropagation(),!c.current||!me.current)return;let o=c.current,s=me.current.scrollHeight-o.clientHeight,l=Math.min(s,o.scrollTop+De);o.scrollTop=l,g(),M(!0),x(f.delay),A()},[g,x,De,f.delay,A]),Gt=(0,e.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let o=b();o&&(mt(!0),Ot({x:t.clientX,scrollLeft:o.scrollLeft}),H(),M(!0),A())},[b,H,A]),Ze=(0,e.useCallback)(t=>{if(!N)return;let o=b();if(!o)return;let n=o.clientWidth,l=o.scrollWidth-n,p=t.clientX-_e.x,w=n-qe,L=p/w*l,h=Math.max(0,Math.min(l,_e.scrollLeft+L));o.scrollLeft=h,g()},[N,_e,qe,g,b]),Qe=(0,e.useCallback)(()=>{mt(!1),j()&&x(f.delay)},[j,x,f.delay]),Kt=(0,e.useCallback)(t=>{if(!he.current)return;let n=he.current.getBoundingClientRect(),s=t.clientX-n.left,l=b();if(!l)return;let p=l.clientWidth,w=l.scrollWidth,h=s/p*(w-p);l.scrollLeft=Math.max(0,Math.min(w-p,h)),g(),M(!0),x(f.delay),A()},[g,x,f.delay,b,A]),Vt=(0,e.useCallback)(t=>{if(!xe.enabled||t.defaultPrevented)return;let o=t.target,n=c.current;if(!n||!n.contains(o)||Ie(o,xe)||t.button!==0)return;let s=b();if(!s||s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth)return;t.preventDefault();let l=document.activeElement;l instanceof HTMLElement&&l!==document.body&&!l.contains(o)&&l.blur(),ie.current=!0,Wt({x:t.clientX,y:t.clientY,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft||0})},[xe,Ie,b]),Je=(0,e.useCallback)(t=>{if(!ie.current&&!ae)return;let o=b();if(!o)return;let n=ge.x-t.clientX,s=ge.y-t.clientY;if(Math.abs(s)<5&&Math.abs(n)<5)return;ie.current&&(ie.current=!1,Ye.current=!0,vt(!0)),M(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,ge.scrollTop+s)),p=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,ge.scrollLeft+n));o.scrollTop=l,o.scrollLeft=p,g()},[ae,ge,b,g]),et=(0,e.useCallback)(()=>{let t=Ye.current;ie.current=!1,Ye.current=!1,vt(!1),t&&j()&&x(f.delay)},[j,x,f.delay]);(0,e.useEffect)(()=>{let t=p=>{if(g(),Y){let h=(p.target?.scrollTop??0)>D;lt(h),Q.current&&(clearTimeout(Q.current),Q.current=null),h&&ne>0&&(Q.current=setTimeout(()=>{Q.current=null,lt(!1)},ne))}if(se){E&&E(p);return}H(),M(!0),yt();let w=je.current?f.delayOnWheel:f.delay;x(w),E&&E(p)},o=()=>{je.current=!0,ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>{je.current=!1},300),yt(),ee.current=setTimeout(()=>{M(!0),ee.current=null,x(f.delayOnWheel)},50)},n=[],s=b();s&&n.push(s);let l=c.current;return l&&!s&&(n.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(w=>{let L=w;if(L!==l&&L.classList.contains("overlay-scrollbar-container"))return;let h=L.parentElement;for(;h&&h!==l;){if(h.classList.contains("overlay-scrollbar-container")&&h!==l)return;h=h.parentElement}n.push(L)})),n.forEach(p=>{p.addEventListener("scroll",t,{passive:!0}),p.addEventListener("wheel",o,{passive:!0})}),()=>{n.forEach(p=>{p.removeEventListener("scroll",t),p.removeEventListener("wheel",o)})}},[b,g,E,H,x,f,se,Y,D,ne]),(0,e.useEffect)(()=>()=>{Q.current&&clearTimeout(Q.current),ve.current&&clearTimeout(ve.current),ee.current&&clearTimeout(ee.current)},[]),(0,e.useEffect)(()=>{let t=n=>{let s=n.target;if(n.defaultPrevented||s instanceof Element&&Ie(s,xe))return;let l=b();if(!l)return;let{key:p}=n,{scrollTop:w,scrollHeight:L,clientHeight:h}=l,ue=L-h,Te=50,$=null;switch(p){case"ArrowUp":n.preventDefault(),$=Math.max(0,w-Te);break;case"ArrowDown":n.preventDefault(),$=Math.min(ue,w+Te);break;case"PageUp":n.preventDefault(),$=Math.max(0,w-h);break;case"PageDown":n.preventDefault(),$=Math.min(ue,w+h);break;case"Home":n.preventDefault(),$=0;break;case"End":n.preventDefault(),$=ue;break;default:return}if($!==null){let we=$/ue,G=U?T*2+a.margin*4:a.margin*2,de=(h-G-be)*we;Ue(de),l.scrollTop=$,H(),M(!0),x(f.delay)}},o=c.current;if(o)return o.addEventListener("keydown",t),()=>{o.removeEventListener("keydown",t)}},[b,U,T,a.margin,be,H,x,f.delay,xe]),(0,e.useEffect)(()=>(document.addEventListener("mousemove",Je),document.addEventListener("mouseup",et),()=>{document.removeEventListener("mousemove",Je),document.removeEventListener("mouseup",et)}),[ae,Je,et]),(0,e.useEffect)(()=>{if(F)return document.addEventListener("mousemove",Ke),document.addEventListener("mouseup",Ve),()=>{document.removeEventListener("mousemove",Ke),document.removeEventListener("mouseup",Ve)}},[F,Ke,Ve]),(0,e.useEffect)(()=>{if(N)return document.addEventListener("mousemove",Ze),document.addEventListener("mouseup",Qe),()=>{document.removeEventListener("mousemove",Ze),document.removeEventListener("mouseup",Qe)}},[N,Ze,Qe]),(0,e.useEffect)(()=>{g();let t=setTimeout(()=>{g()},100);return()=>clearTimeout(t)},[g]),(0,e.useLayoutEffect)(()=>{zt(!0),g(),!f.enabled&&!se&&j()&&M(!0)},[j,g,f.enabled,se]),(0,e.useEffect)(()=>{if(f.initialDelay>0){let t=setTimeout(()=>{Nt(!1)},f.initialDelay);return()=>clearTimeout(t)}},[f.initialDelay]);let xt=(0,e.useRef)(g);xt.current=g;let ce=(0,e.useRef)(null),ke=(0,e.useCallback)(()=>{ce.current===null&&(ce.current=requestAnimationFrame(()=>{ce.current=null,xt.current()}))},[]);(0,e.useEffect)(()=>()=>{ce.current!==null&&(cancelAnimationFrame(ce.current),ce.current=null)},[]),(0,e.useEffect)(()=>{let t=new ResizeObserver(()=>{ke()}),o=[];return c.current&&o.push(c.current),me.current&&o.push(me.current),B.current&&document.contains(B.current)&&o.push(B.current),o.forEach(n=>{t.observe(n)}),()=>t.disconnect()},[g,ke]),(0,e.useEffect)(()=>{if(!c.current)return;let t=new MutationObserver(()=>{B.current=null,ke()});return t.observe(c.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[ke]);let P=Math.max(Ut,T);(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 n=document.createElement("style");n.id=e;let s=`.${Q}`;return n.textContent=`
30
+ `,document.head.appendChild(o)},[]),(0,e.useEffect)(()=>{let t=`overlay-scrollbar-instance-${Z}`,o=document.getElementById(t);o&&o.remove();let n=document.createElement("style");n.id=t;let s=`.${Z}`;return n.textContent=`
31
31
  ${s} {
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
  ${s}::-webkit-scrollbar-track { display: none !important; }
41
- ${s}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(n),()=>{document.getElementById(e)?.remove()}},[Q]);let{normalizedContainerStyle:Gt,normalizedContentStyle:Kt,bottomSpacerHeight:vt}=(0,t.useMemo)(()=>{let e=Qe(d),o=Qe(u);return{normalizedContainerStyle:e.style,normalizedContentStyle:o.style,bottomSpacerHeight:e.spacerHeight+o.spacerHeight}},[d,u]);return(0,y.jsxs)("div",{ref:We,className:`overlay-scrollbar-wrapper ${r}`,onMouseLeave:Ft,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...i},children:[Dt&&(0,y.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${ze-68}px)`,transition:Ee?"transform 0.15s ease-out":ze===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:Ee?1:Math.min(Ae*1.5,1)},children:Ee?(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:ot,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:ot})})}),(0,y.jsx)("div",{ref:c,className:`overlay-scrollbar-container ${Q}`,tabIndex:-1,onMouseDown:jt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:j?"none":"auto",...Gt},children:(0,y.jsxs)("div",{ref:pe,className:"overlay-scrollbar-content",style:{flex:"1 1 auto",display:"flex",flexDirection:"column",boxSizing:"border-box",...Kt},children:[v,vt>0&&(0,y.jsx)("div",{className:"overlay-scrollbar-bottom-spacer","aria-hidden":"true",style:{flex:"0 0 auto",height:vt}})]})}),ne&&ie&&(a.overflowY??!0)&&(0,y.jsxs)("div",{ref:he,className:"overlay-scrollbar-track",onMouseEnter:()=>{w(),ee.current=setTimeout(()=>{M(!0),ee.current=null},100)},onMouseLeave:()=>{De(),F||x(f.delay)},style:{position:"absolute",top:0,right:0,width:`${P}px`,height:"100%",opacity:Me?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[a.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),_t(e)},style:{position:"absolute",top:_?`${C.width+a.margin*2}px`:`${a.margin}px`,right:a.alignment==="outside"?"0px":`${(P-C.width)/2}px`,width:`${C.width}px`,height:_?`calc(100% - ${C.width*2+a.margin*4}px)`:`calc(100% - ${a.margin*2}px)`,backgroundColor:a.color,borderRadius:`${a.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{ref:Lt,className:"overlay-scrollbar-thumb",onMouseDown:Nt,onMouseEnter:()=>lt(!0),onMouseLeave:()=>lt(!1),style:{position:"absolute",top:`${(_?T+a.margin*2:a.margin)+kt}px`,right:a.alignment==="outside"?"0px":`${(P-T)/2}px`,width:`${T}px`,height:`${Math.max(me,Xe)}px`,backgroundColor:nt||F?C.hoverColor:C.color,opacity:nt||F?C.hoverOpacity:C.opacity,borderRadius:`${C.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),ne&&ie&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:Ut,onMouseEnter:()=>He("up"),onMouseLeave:()=>He(null),style:{position:"absolute",top:`${a.margin}px`,right:a.alignment==="outside"?"0px":`${(P-T)/2}px`,width:`${T}px`,height:`${T}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(T*.75,8)}px`,color:Ce==="up"?A.hoverColor:A.color,userSelect:"none",zIndex:1001,opacity:Me?Ce==="up"?A.hoverOpacity:A.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),ne&&ie&&_&&(0,y.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:Xt,onMouseEnter:()=>He("down"),onMouseLeave:()=>He(null),style:{position:"absolute",bottom:`${a.margin}px`,right:a.alignment==="outside"?"0px":`${(P-T)/2}px`,width:`${T}px`,height:`${T}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(T*.75,8)}px`,color:Ce==="down"?A.hoverColor:A.color,userSelect:"none",zIndex:1001,opacity:Me?Ce==="down"?A.hoverOpacity:A.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),ne&&we&&It&&(a.overflowX??!0)&&(0,y.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{w(),ee.current=setTimeout(()=>{M(!0),ee.current=null},100)},onMouseLeave:()=>{De(),N||x(f.delay)},style:{position:"absolute",bottom:`${Wt}px`,left:0,width:"100%",height:`${P}px`,opacity:Me?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[a.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),Yt(e)},style:{position:"absolute",bottom:a.alignment==="outside"?"0px":`${(P-T)/2}px`,left:`${a.margin}px`,right:ie?a.alignment==="outside"?`${P-a.margin}px`:`${P}px`:`${a.margin}px`,height:`${T}px`,backgroundColor:a.color,borderRadius:`${a.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:qt,onMouseEnter:()=>ct(!0),onMouseLeave:()=>ct(!1),style:{position:"absolute",bottom:a.alignment==="outside"?"0px":`${(P-T)/2}px`,left:`${a.margin+Ue}px`,right:ie?a.alignment==="outside"?`${P-a.margin}px`:`${P}px`:"auto",maxWidth:ie?a.alignment==="outside"?`calc(100% - ${a.margin+Ue+P-a.margin}px)`:`calc(100% - ${a.margin+Ue+P}px)`:"none",width:`${Math.max(_e,50)}px`,height:`${T}px`,backgroundColor:st||N?C.hoverColor:C.color,opacity:st||N?C.hoverOpacity:C.opacity,borderRadius:`${C.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Y&&(0,y.jsx)("button",{type:"button","aria-label":"\uB9E8 \uC704\uB85C",onClick:()=>{fe(!1),c.current?.scrollTo({top:0,behavior:"smooth"})},onPointerDown:()=>fe(!0),onPointerUp:()=>fe(!1),onPointerLeave:()=>fe(!1),onPointerCancel:()=>fe(!1),style:{position:"absolute",[wt]:et,bottom:St,zIndex:1200,width:Se,height:Se,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"50%",backgroundColor:Et,color:Mt,boxShadow:"0 3px 8px rgba(15, 23, 42, 0.28)",cursor:"pointer",opacity:Oe?Ct?1:$e:0,pointerEvents:Oe?"auto":"none",transition:Oe?"opacity 0.15s ease":"opacity 0.45s ease"},children:(0,y.jsxs)("svg",{width:Math.round(Se*.5),height:Math.round(Se*.5),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0,y.jsx)("polyline",{points:"5 12 12 5 19 12"})]})})]})}),Je=bo;
41
+ ${s}::-webkit-scrollbar-thumb { display: none !important; }`,document.head.appendChild(n),()=>{document.getElementById(t)?.remove()}},[Z]);let{normalizedContainerStyle:Zt,normalizedContentStyle:Qt,bottomSpacerHeight:Tt}=(0,e.useMemo)(()=>{let t=ot(d),o=ot(u);return{normalizedContainerStyle:t.style,normalizedContentStyle:o.style,bottomSpacerHeight:t.spacerHeight+o.spacerHeight}},[d,u]);return(0,y.jsxs)("div",{ref:ze,className:`overlay-scrollbar-wrapper ${r}`,onMouseLeave:_t,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"visible",...i},children:[Pt&&(0,y.jsx)("div",{className:"overlay-scrollbar-pull-indicator",style:{position:"absolute",top:0,left:"50%",transform:`translate(-50%, ${Be-68}px)`,transition:Me?"transform 0.15s ease-out":Be===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:Me?1:Math.min(Fe*1.5,1)},children:Me?(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:it,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(${Fe*270}deg)`,opacity:Fe>=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:it})})}),(0,y.jsx)("div",{ref:c,className:`overlay-scrollbar-container ${Z}`,tabIndex:-1,onMouseDown:Vt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",outline:"none",userSelect:ae?"none":"auto",...Zt},children:(0,y.jsxs)("div",{ref:me,className:"overlay-scrollbar-content",style:{flex:"1 1 auto",display:"flex",flexDirection:"column",boxSizing:"border-box",...Qt},children:[v,Tt>0&&(0,y.jsx)("div",{className:"overlay-scrollbar-bottom-spacer","aria-hidden":"true",style:{flex:"0 0 auto",height:Tt}})]})}),re&&le&&(a.overflowY??!0)&&(0,y.jsxs)("div",{ref:he,className:"overlay-scrollbar-track",onMouseEnter:()=>{S||(H(),J.current=setTimeout(()=>{M(!0),J.current=null},100))},onMouseLeave:()=>{Re(),F||x(f.delay)},style:{position:"absolute",top:0,right:0,width:`${P}px`,height:"100%",opacity:Ce?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[a.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:t=>{t.preventDefault(),t.stopPropagation(),Xt(t)},style:{position:"absolute",top:U?`${C.width+a.margin*2}px`:`${a.margin}px`,right:a.alignment==="outside"?"0px":`${(P-C.width)/2}px`,width:`${C.width}px`,height:U?`calc(100% - ${C.width*2+a.margin*4}px)`:`calc(100% - ${a.margin*2}px)`,backgroundColor:a.color,borderRadius:`${a.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{ref:kt,className:"overlay-scrollbar-thumb",onMouseDown:qt,onMouseEnter:()=>ct(!0),onMouseLeave:()=>ct(!1),style:{position:"absolute",top:`${(U?T+a.margin*2:a.margin)+$t}px`,right:a.alignment==="outside"?"0px":`${(P-T)/2}px`,width:`${T}px`,height:`${Math.max(be,Ge)}px`,backgroundColor:st||F?C.hoverColor:C.color,opacity:st||F?C.hoverOpacity:C.opacity,borderRadius:`${C.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),re&&le&&U&&(0,y.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:Yt,onMouseEnter:()=>Le("up"),onMouseLeave:()=>Le(null),style:{position:"absolute",top:`${a.margin}px`,right:a.alignment==="outside"?"0px":`${(P-T)/2}px`,width:`${T}px`,height:`${T}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(T*.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"}),re&&le&&U&&(0,y.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:jt,onMouseEnter:()=>Le("down"),onMouseLeave:()=>Le(null),style:{position:"absolute",bottom:`${a.margin}px`,right:a.alignment==="outside"?"0px":`${(P-T)/2}px`,width:`${T}px`,height:`${T}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(T*.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"}),re&&Se&&At&&(a.overflowX??!0)&&(0,y.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{S||(H(),J.current=setTimeout(()=>{M(!0),J.current=null},100))},onMouseLeave:()=>{Re(),N||x(f.delay)},style:{position:"absolute",bottom:`${Bt}px`,left:0,width:"100%",height:`${P}px`,opacity:Ce?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[a.visible&&(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:t=>{t.preventDefault(),t.stopPropagation(),Kt(t)},style:{position:"absolute",bottom:a.alignment==="outside"?"0px":`${(P-T)/2}px`,left:`${a.margin}px`,right:le?a.alignment==="outside"?`${P-a.margin}px`:`${P}px`:`${a.margin}px`,height:`${T}px`,backgroundColor:a.color,borderRadius:`${a.radius}px`,cursor:"pointer"}}),(0,y.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:Gt,onMouseEnter:()=>pt(!0),onMouseLeave:()=>pt(!1),style:{position:"absolute",bottom:a.alignment==="outside"?"0px":`${(P-T)/2}px`,left:`${a.margin+Xe}px`,right:le?a.alignment==="outside"?`${P-a.margin}px`:`${P}px`:"auto",maxWidth:le?a.alignment==="outside"?`calc(100% - ${a.margin+Xe+P-a.margin}px)`:`calc(100% - ${a.margin+Xe+P}px)`:"none",width:`${Math.max(qe,50)}px`,height:`${T}px`,backgroundColor:ft||N?C.hoverColor:C.color,opacity:ft||N?C.hoverOpacity:C.opacity,borderRadius:`${C.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Y&&(0,y.jsx)("button",{type:"button","aria-label":"\uB9E8 \uC704\uB85C",onClick:()=>{pe(!1),c.current?.scrollTo({top:0,behavior:"smooth"})},onPointerDown:()=>pe(!0),onPointerUp:()=>pe(!1),onPointerLeave:()=>pe(!1),onPointerCancel:()=>pe(!1),style:{position:"absolute",[Mt]:nt,bottom:Ct,zIndex:1200,width:Ee,height:Ee,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"50%",backgroundColor:Ht,color:Lt,boxShadow:"0 3px 8px rgba(15, 23, 42, 0.28)",cursor:"pointer",opacity:We?Dt?1:Ae:0,pointerEvents:We?"auto":"none",transition:We?"opacity 0.15s ease":"opacity 0.45s ease"},children:(0,y.jsxs)("svg",{width:Math.round(Ee*.5),height:Math.round(Ee*.5),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0,y.jsx)("polyline",{points:"5 12 12 5 19 12"})]})})]})}),rt=yo;
42
42
  //# sourceMappingURL=index.js.map