@sheetxl/utils-react 0.7.9 → 0.7.10
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/browser/cjs/{BR8g9GwalrjWsdSk.cjs → GDXov-yumZio8FPo.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{B5G0So8kDpXm7CIT.mjs → DRyP2NC3cYmWNj79.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/node/esm/{BNz6KrxO7ANRIJQq.mjs → ClIkEEc3keHubiqX.mjs} +1 -1
- package/node/esm/index.mjs +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.10
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(":root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent;--scrollbar-size: 13px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_1v478_17 ::-webkit-scrollbar-button{background:transparent}._scrollbar_1v478_17{display:flex;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_1v478_17 ._vsb-track_1v478_27{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_1v478_17 ._vsb-thumb_1v478_39{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_1v478_17 ._vsb-thumb_1v478_39:hover{background:var(--scrollbar-active-color)}._scrollbar_1v478_17.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px)}._scrollbar_1v478_17.vertical ._vsb-thumb_1v478_39{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.vertical ._vsb-track_1v478_27{width:100%}._scrollbar_1v478_17.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px)}._scrollbar_1v478_17.horizontal ._vsb-thumb_1v478_39{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.horizontal ._vsb-track_1v478_27{height:100%}._scrollbar_1v478_17.dragging ._vsb-thumb_1v478_39{background:var(--scrollbar-active-color)}._scrollbar-button_1v478_80{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar-button_1v478_80>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar-button_1v478_80:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar-button_1v478_80[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar-button_1v478_80.vertical{width:var(--scrollbar-width)}._scrollbar-button_1v478_80.horizontal{height:var(--scrollbar-height)}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}._Icon_1ipwo_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_1ipwo_10 .sm{--font-size: var(--icon-size-sm)}._Icon_1ipwo_10 .md{--font-size: var(--icon-size-md)}._Icon_1ipwo_10 .lg{--font-size: var(--icon-size-lg)}._Icon_1ipwo_10 .xl{--font-size: var(--icon-size-xl)}._Icon_1ipwo_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1ipwo_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_1ipwo_10 .fill,._Icon_1ipwo_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_1ipwo_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_1ipwo_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_1ipwo_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_1ipwo_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_1ipwo_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_1ipwo_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_1ipwo_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_1ipwo_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_1ipwo_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_1ipwo_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_1ipwo_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_1ipwo_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_1ipwo_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_1ipwo_10 .fill:not(.fixed){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_1ipwo_10 .line:not(.fixed){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_1ipwo_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_1ipwo_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_1ipwo_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_1ipwo_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
"use strict";/**
|
|
3
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
3
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.10
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),u=require("react"),kt=require("react-dom"),A=require("@sheetxl/utils"),ln=require("react-dom/client"),H={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"},ne={Horizontal:"horizontal",Vertical:"vertical"};function Tt(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var o=i.length;for(e=0;e<o;e++)i[e]&&(t=Tt(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function oe(){for(var i,e,t=0,n="",o=arguments.length;t<o;t++)(i=arguments[t])&&(e=Tt(i))&&(n&&(n+=" "),n+=e);return n}function Ye(i,e){if(typeof i=="function")return i(e);i&&(i.current=e)}var Le=parseInt(u.version.split(".")[0],10)>=19?function(i){return e=>{const t=[];for(const n of i){const o=Ye(n,e),r=typeof o=="function";t.push(r?o:()=>Ye(n,null))}return()=>{for(const n of t)n()}}}:function(i){return e=>{for(const t of i)Ye(t,e)}},an=function(){},Pt=typeof window<"u",cn=Pt?u.useLayoutEffect:u.useEffect,ut={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const xe=Pt&&window.ResizeObserver!==void 0?function(){var i=u.useState(null),e=i[0],t=i[1],n=u.useState(ut),o=n[0],r=n[1],a=u.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var s=h[0].contentRect,l=s.x,c=s.y,d=s.width,f=s.height,m=s.top,S=s.left,_=s.bottom,P=s.right;r({x:l,y:c,width:d,height:f,top:m,left:S,bottom:_,right:P})}})},[]);return cn(function(){if(e)return a.observe(e),function(){a.disconnect()}},[e]),[t,o]}:function(){return[an,ut]},qe={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Dt extends A.DefaultNotifier{setOverrides(e){super.setOverrides(e)}getDelegate(){return this._overrides}showMessage(e,t){const n=this.getDelegate();if(n?.showMessage)return n.showMessage(e,t);t?.type!==qe.Warning?t?.type!==qe.Error?A.Notifier.log(e):A.Notifier.error(e):A.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(o=>{o(()=>{})})}showWindow(e,t,n){const o=this.getDelegate();if(o?.showWindow)return o.showWindow(e,t,n)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):A.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInputOptions(e){const t=this.getDelegate();return t?.showInputOptions?t.showInputOptions(e):Promise.resolve({input:"",option:""})}}const un=new Dt,At=u.createContext(un),Ee=()=>u.useContext(At),k=(i,e)=>{const t=u.useCallback((...r)=>i?.(...r),e),n=u.useRef(null);n.current=t;const o=u.useCallback((...r)=>n.current?.(...r),[]);if(n.current)return o};function ht(i){if(!i)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:o=!1,consumeTouch:r=!0}=i,a=k(e,[e]),h=k(t,[t]),s=k(n,[n]),l=u.useRef(!1),c=i?.timerInitial??230,d=i?.timerContinuous??c/2,f=u.useRef(null),m=u.useRef(null),S=u.useRef(null),_=u.useRef(null),P=u.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]),T=u.useCallback(y=>{_.current=setTimeout(()=>{window.requestAnimationFrame(()=>{l.current!==!1&&s?.(m.current,S.current,f.current)}),T(d)},y??c)},[]);u.useEffect(()=>()=>P(),[]);const g=o?"pointer":"mouse",x=u.useCallback(y=>{y.stopPropagation(),y.stopImmediatePropagation(),y.preventDefault()},[]),w=k(y=>{document.removeEventListener(`${g}move`,K),document.removeEventListener(`${g}up`,w),document.removeEventListener("keydown",N),document.removeEventListener("keyup",C),document.removeEventListener("touchstart",x,{capture:!0}),document.removeEventListener("touchmove",x,{capture:!0}),window.removeEventListener("blur",z),P(),window.requestAnimationFrame(()=>{l.current!==!1&&(l.current=!1,h?.(y,S.current,f.current),S.current=null)})},[]),z=u.useCallback(()=>{l.current!==!1&&(l.current=!1,w(m.current))},[]),M=k(()=>{P(),T(d),window.requestAnimationFrame(()=>{l.current!==!1&&s?.(m.current,S.current,f.current)})},[d]),K=k(y=>{m.current=y,M()},[]),N=k(y=>{S.current={ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,altKey:y.altKey,metaKey:y.metaKey},M()},[]),C=k(y=>{S.current={ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,altKey:y.altKey,metaKey:y.metaKey},M()},[d]);return k(y=>{y.isDefaultPrevented()||(S.current={ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,altKey:y.altKey,metaKey:y.metaKey},a(y,S.current)!==!1&&(f.current=y,m.current=y.nativeEvent,document.addEventListener(`${g}up`,w,{passive:!1}),document.addEventListener(`${g}move`,K,{passive:!1}),document.addEventListener("keydown",N,{passive:!1}),document.addEventListener("keyup",C,{passive:!1}),window.addEventListener("blur",z,{passive:!0}),o&&r&&(document.addEventListener("touchstart",x,{passive:!1,capture:!0}),document.addEventListener("touchmove",x,{passive:!1,capture:!0})),l.current=!0,T(c)))},[c,o])}const hn=({initValue:i,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(i);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const o=e();return u.useLayoutEffect(()=>{n.current!==o&&(n.current=o,t(o))},[t,o]),null},Ze=i=>{console&&console.warn&&console.warn(i)},Xe=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let dn=1,Je=!1,zt=!1;const Ne=[],ve=[],He=()=>{ve.forEach(i=>i())},fn=({automaticContainerInternalUseOnly:i})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,i||Je!==!1||(zt=!0),u.useEffect(()=>{let o=!0;function r(){if(o)return ve[0]!==r?(i||Je!==!0||Ze("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void t(a=>[])):void t([...Ne])}return ve.push(r),He(),()=>{o=!1,n.current?.length>0&&Ze("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),ve.splice(ve.indexOf(r),1),He()}},[i]),b.jsx(b.Fragment,{children:e.map(({hook:o,key:r})=>u.createElement(hn,{...o,key:r}))})},pn=i=>{const e=dn++;return Ne.push({hook:i,key:e}),ve.length===0&&zt===!1&&(Je=!0,(t=>{if(Xe.document&&Xe.document.createElement){const n=Xe.document.createElement("div");ln.createRoot(n).render(b.jsx(t,{automaticContainerInternalUseOnly:!0}))}else Ze("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(fn)),He(),()=>{Ne.splice(Ne.findIndex(t=>t.key===e),1),He()}};let Qe=null;Qe||(Qe=(i,e,t={})=>{let n,o,r=!1,a=!1,h=[],{unmountIfNoConsumers:s=!1}=t;const l=d=>{var f;o=d,f=()=>h.forEach(m=>m(d)),kt.unstable_batchedUpdates(f)},c=()=>(a||(o=typeof i=="function"?i():i,a=!0),o);return()=>{const[d,f]=u.useState(c);return u.useEffect(()=>(r||(r=!0,n=pn({initValue:i,useHookBody:e,applyStateChange:l})),h.push(f),o!==d&&f(o),()=>{h.splice(h.indexOf(f),1),h.length===0&&s&&(n(),r=!1)}),[]),d}});const jt=Qe;let Rt=()=>{console.warn("You must call useEditMode before setting its state.")};const mn=jt(null,()=>{const[i,e]=u.useState(null);return Rt=e,i});class Ie{constructor(e,t,n,o){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=o,o===void 0&&(this._callback=()=>{console.log(`implement: ${this.label()} : ${this.description()}`)})}key(){return this._key}_resolve(e,t){if(typeof e=="function"){const n=t??this._context;return e(typeof n=="function"?n():n)}return e}target(){return typeof this._target=="function"?this._target():this._target}label(e,t){const n=this._scopedLabels?.[e]||this._label;let o=null;if(typeof n=="function"){const r=t??this._context;o=n(typeof r=="function"?r():r)}else o=n;return o}description(e){return this._resolve(this._description,e)}tags(e){return this._resolve(this._tags,e)}icon(e){return this._resolve(this._icon,e)}shortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}state(){return this._resolve(this._state)}context(){return typeof this._context=="function"?this._context():this._context}async execute(e,t){if(!this.disabled()&&this._callback){try{let n=!0;if(t?.beforeExecute&&(n=t?.beforeExecute(this,e)),await Promise.resolve(n)===!1)return!1;const o=this._callback.bind(this)(e,this);if(await Promise.resolve(o)===!1)return!1;t?.onExecute?.(this,e),this._notifyExecute(e)}catch(n){return console.warn(n),t?.onError(this,n,e),this._notifyError(e,n),!1}return!0}}addPropertyListener(e,t=!1){if(!e)throw new Error("listener must be specified");const n=this._listenersProperties;return n.add(e),t&&e({},this),()=>{n.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const t=this._listenersExecute;return t.add(e),function(){t.delete(e)}}_notifyExecute(e){const t=this;this._listenersExecute.forEach(n=>{n.onExecute(t,e)})}_notifyError(e,t){const n=this;this._listenersExecute.forEach(o=>{o.onError?.(n,e,t)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const t=this._applyProps(e);return Object.keys(t).length>0&&this._notifyPropertyChange(t),this}_notifyPropertyChange(e){const t=this;this._listenersProperties.forEach(n=>{n(e,t)})}_applyProps(e){let t={},n=this;return Object.keys(e).forEach(o=>{let r=e[o];n["_"+o]!==r&&(n["_"+o]=t[o]=r)}),t}}class Re extends Ie{}var q=typeof window<"u"?window:{screen:{},navigator:{}},we=(q.matchMedia||function(){return{matches:!1}}).bind(q),Bt=!1,_n={get passive(){return Bt=!0}},dt=function(){};q.addEventListener&&q.addEventListener("p",dt,_n),q.removeEventListener&&q.removeEventListener("p",dt,!1);var gn=Bt,yn="PointerEvent"in q,nt="ontouchstart"in q,Ot=nt||"TouchEvent"in q&&we("(any-pointer: coarse)").matches,ft=(q.navigator.maxTouchPoints||0)>0||Ot,$t=q.navigator.userAgent||"",vn=we("(pointer: coarse)").matches&&/iPad|Macintosh/.test($t)&&Math.min(q.screen.width||0,q.screen.height||0)>=768,Kt=(we("(pointer: coarse)").matches||!we("(pointer: fine)").matches&&nt)&&!/Windows.*Firefox/.test($t),xn=we("(any-pointer: fine)").matches||we("(any-hover: hover)").matches||vn||!nt,et=!ft||!xn&&Kt?ft?"touchOnly":"mouseOnly":"hybrid",wn=et==="mouseOnly"?"mouse":et==="touchOnly"||Kt?"touch":"mouse";const bn=Object.freeze(Object.defineProperty({__proto__:null,deviceType:et,primaryInput:wn,supportsPassiveEvents:gn,supportsPointerEvents:yn,supportsTouchEvents:Ot},Symbol.toStringTag,{value:"Module"})),Sn=new Set(["INPUT","TEXTAREA","SELECT"]),Nt={};function tt(){return bn}const It=i=>i==="BracketLeft"?"[":i==="BracketRight"?"]":A.CommonUtils.camelToPrettyCase(i),En=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Nt,boundPixel:function(i,e=!1,t=0){return i},createSyntheticEvent:i=>{let e=!1,t=!1;return{nativeEvent:i,currentTarget:i.currentTarget,target:i.target,bubbles:i.bubbles,cancelable:i.cancelable,defaultPrevented:i.defaultPrevented,eventPhase:i.eventPhase,isTrusted:i.isTrusted,preventDefault:()=>{e=!0,i.preventDefault()},isDefaultPrevented:()=>e,stopPropagation:()=>{t=!0,i.stopPropagation()},isPropagationStopped:()=>t,persist:()=>{},timeStamp:i.timeStamp,type:i.type}},detectIt:tt,focusableNodeNames:Sn,toPrettyKeyCode:It},Symbol.toStringTag,{value:"Module"}));class ot{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=A.CommonUtils.uuidV4(),this._target=e,this._groupKey=t??null,this._root=this,this._nodes=new Map,this._nodes.set(t,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const n=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(o,r)=>{const a=n._root._listenersByKey,h=r.key(),s=a.get(h);s&&n._notifyCommands(s,"onCommandChange",r)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let o=n,r=n===this;for(;!r&&o;)o===this&&(r=!0),o=o._parent;return(r?n:this)._getCommand(e)}createChildGroup(e,t,n){let o;if(!n){let h=this;for(;h&&!o;){let s=h._nodes.get(t);s&&(o=s),h=h._parent}}o||(o=new ot(e,t),o._parent=this,o._root=this._root,o._unListenersByCommand=null,o._listenersByKey=null,o._commandsPropertyListener=null);const r=(h,s)=>{!h.has(t)||n?h.set(t,s):n===void 0&&console.warn("commandGroup already registered",t)};r(this._root._nodes,o);let a=this._parent;for(;a;)r(this._nodes,o),a=a._parent;return this._children.set(t,o),this._notify("onGroupChange"),o}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,o=this._commandsByShortcut,r=this._root._commandsPropertyListener,a=this._root._unListenersByCommand;for(let h=0;h<e.length;h++){const s=e[h],l=s.key();if(n.has(l)&&!t){t===void 0&&console.warn("command already registered",l);continue}n.set(l,s);let c=a.get(s);c&&(c(),a.delete(s));const d=s.addPropertyListener(r);a.set(s,d);const f=s.shortcut();if(!f)continue;const m=Array.isArray(f)?f:[f];for(let S=0;S<m.length;S++){const _=ye(m[S]),P=o.get(_);P&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${_}, ${l}, ${P}.`),o.set(_,l)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,t=[];const n=this._groupKey;for(;e;)t.push(e._nodes),e._nodes.delete(n),e=e._parent;e=this._parent;const o=r=>{r._children.forEach(a=>{for(let h=0;h<t.length;h++)a._nodes.delete(t[h]);o(a)})};o(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,t){this._addCommands(e,t),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let t=this;if(e&&(t=this._nodes.get(e),!t))return void console.warn("group not found",e);let n=this._root._focused??this._root;for(;n;)n=n._parent;this._root._focused!==t&&(this._root._focused=t,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const t=[];e.altKey&&t.push(H.Alt),e.shiftKey&&t.push(H.Shift),e.ctrlKey&&t.push(H.Ctrl),e.metaKey&&t.push(H.Meta);let n=ye({key:e.code,modifiers:t});const o=this._commandsByShortcut;let r=o.get(n);r||(n=ye({key:e.key,modifiers:t}),r=o.get(n)),!r&&e.code.startsWith("Digit")&&(n=ye({key:e.code.substring(5,e.code.length),modifiers:t}),r=this._commandsByShortcut.get(n)),!r&&e.code.startsWith("Key")&&(r=ye({key:e.code.substring(3,e.code.length),modifiers:t}),r=o.get(n));let a=null;return r&&(a=this._commandsByKey.get(r),a&&a.disabled()&&(a=null),!a||a.target()&&a.target().contains(e.target)||(a=null)),a||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const t=this.getActive();if(!t||e.isDefaultPrevented())return!1;const n=t.findCommandByEvent?.(e);return!!n&&(n.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,t){const n=this._listeners,o=t?.keys,r=this._root._listenersByKey;if(o&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let a=null;if(o)for(let h=0;h<o.length;h++){const s=o[h];if(!s)continue;let l=r.get(s);l||(l=new Set,r.set(s,l)),a||(a=[]),a.push(l),l.add(e)}return n.add(e),()=>{if(a)for(let h=0;h<a.length;h++)a[h].delete(e);n.delete(e)}}_notifyCommands(e,t,n){const o=this;setTimeout(()=>{e.forEach(r=>{r[t]?.(o,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(o=>{o[e]?.(n,t)}),n._parent&&n._parent._notify(e,t)},0)}getAllCommands(){const e=[],t=this._groupKey;return this._commandsByKey.forEach(n=>{e.push({command:n,groupKey:t})}),this._children.forEach(n=>{e.push(...n.getAllCommands())}),e}}const Cn=A.CommonUtils.getOS()===A.CommonUtils.OSType.MacOS||A.CommonUtils.getOS()===A.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Mn=A.CommonUtils.getOS()===A.CommonUtils.OSType.MacOS||A.CommonUtils.getOS()===A.CommonUtils.OSType.IOS?"⌘":"^",ye=(i,e=!1)=>{const t={};for(let o=0;i.modifiers&&o<i.modifiers.length;o++)t[i.modifiers[o]]=!0;let n="";return(t?.[H.Ctrl]||t?.[H.Meta])&&(n+=(n.length>0?"+":"")+(e?Mn:Cn)),t?.[H.Alt]&&(n+=e?"⌥":"Alt"),t?.[H.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+It(i.key),n},Be=(i,e)=>{if(!e||!i||e.length===0)return A.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let o=0;o<t;o++){const r=e[o],a=r?i.getCommand(r):null;n[o]=a}return n},pt=jt({setClipboard:i=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>A.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[i,e]=u.useState(A.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>i,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let Ge=!1,Ln=0;var kn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const mt=()=>"sheetxl-ui-"+Ln++,_t=u.useId,Tn=_t??function(){const[i,e]=u.useState(()=>Ge?mt():void 0);return kn(()=>{i==null&&e(mt())},[]),u.useEffect(()=>{Ge||(Ge=!0)},[]),i},Pn=[];function Ue(i,e,t=Pn){const n=u.useRef(null);return u.useImperativeHandle(i,()=>{if(!n.current)return;const o=n.current,r=e?.();if(!r||typeof r!="object")throw new Error("attributes must return a plain object of values");const a=Object.keys(r),h=a.length;for(let s=0;s<h;s++){const l=a[s],c=r[l];Object.defineProperty(o,l,{value:c,writable:!0,configurable:!0,enumerable:!0})}return o},t),n}const gt="Undo the last action.",yt="Repeat the last action or undo the redo.",Dn=i=>`Redo ${i}`,An="_scrollbar_1v478_17",zn="_vsb-track_1v478_27",jn="_vsb-thumb_1v478_39",Ht="_scrollbar-button_1v478_80",Ut="M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z",Ft="M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z",Rn={transform:"rotate(180deg)"},Wt=i=>{const{style:e,orientation:t=ne.Vertical,disabled:n,...o}=i,r=t===ne.Vertical?Ut:Ft;return b.jsx("button",{style:e,className:oe(Ht,t,"scroll-button"),disabled:n,...o,children:b.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:b.jsx("path",{d:r})})})},Vt=i=>{const{style:e,orientation:t=ne.Vertical,disabled:n,...o}=i,r=t===ne.Vertical?Ut:Ft;return b.jsx("button",{style:e,className:oe(Ht,t,"scroll-button"),disabled:n,...o,children:b.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:Rn,children:b.jsx("path",{d:r})})})},Bn=24,Yt=u.memo(u.forwardRef((i,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:o=0,style:r,className:a,orientation:h=ne.Vertical,onScrollOffset:s,onScroll:l,showCustomScrollButtons:c=!0,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:m=120,minThumbSize:S=Bn,createScrollStartButton:_=Wt,createScrollEndButton:P=Vt,usePortal:T=!1,...g}=i;k(l,[l]);const[x,w]=u.useState({offset:0,length:0}),z=u.useRef(-1),M=h===ne.Vertical,[K,{width:N,height:C}]=xe(),y=M?C:N,j=k((E,B,Y)=>{if(B===0||Y===0)return void w({offset:0,length:S});const ge=Y/y,he=B/ge,Se=Math.min(Math.max(S,he),y),De=E/ge;return{offset:Math.min(Math.max(0,De),y-Se),length:Se}},[y,S]),v=k(E=>{const B=n/y,Y=Math.round(E*B);w(j(Y,o,n)),s?.(Y,o,n),z.current=E},[s,o,n,y,x]),R=k(E=>{w(j(E,o,n)),s?.(E,o,n),z.current=E},[s,o,n]);u.useEffect(()=>{z.current!==t&&y!==0&&(z.current=-1,w(j(t,o,n)))},[t]),u.useEffect(()=>{y!==0&&w(j(t,o,n))},[o,n,M,y]);const p=Math.max(0,n-o),[L,O]=u.useState(!1),W=u.useRef(0),U=u.useRef(0),Z=Ue(e,()=>({isScrollbar:()=>!0}),[]),V=k(E=>{E.currentTarget.setPointerCapture(E.pointerId),O(!0),W.current=M?E.clientY:E.clientX,U.current=x.offset,E.preventDefault(),E.stopPropagation()},[M,x]),I=k(E=>{if(!L)return;const B=(M?E.clientY:E.clientX)-W.current,Y=U.current+B;v(Y)},[L,M]),Q=k(E=>{try{E.currentTarget.releasePointerCapture(E.pointerId)}catch{}O(!1)},[]),X=k(E=>{if(!E.currentTarget)return;const B=E.currentTarget.getBoundingClientRect(),Y=M?E.clientY-B.top:E.clientX-B.left;v(Y)},[M,x,o,n]),fe=k(E=>{const B=Math.max(1,Math.floor(.9*o));M?(E.key==="ArrowDown"&&v(Math.min(p,t+1)),E.key==="ArrowUp"&&v(Math.max(0,t-1)),E.key==="PageDown"&&v(Math.min(p,t+B)),E.key==="PageUp"&&v(Math.max(0,t-B)),E.key==="Home"&&v(0),E.key==="End"&&v(p)):(E.key==="ArrowRight"&&v(Math.min(p,t+1)),E.key==="ArrowLeft"&&v(Math.max(0,t-1)),E.key==="PageDown"&&v(Math.min(p,t+B)),E.key==="PageUp"&&v(Math.max(0,t-B)),E.key==="Home"&&v(0),E.key==="End"&&v(p))},[M,o,n,t,p]),ae=b.jsx("div",{className:oe(jn),role:"slider","aria-label":M?"Rows":"Columns","aria-orientation":M?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":t,tabIndex:0,style:{position:T?"fixed":"relative",[M?"height":"width"]:`${x.length}px`,[M?"width":"height"]:"100%",transform:M?`translateY(${x.offset}px)`:`translateX(${x.offset}px)`},onPointerDown:V,onPointerMove:I,onPointerUp:Q}),[ce,ue]=u.useState(null),Te=k(()=>{let E;E=typeof d=="function"?d(t,o,n):t-d;const B=Math.max(0,E);return R(B),ue(B),B},[d,t,o,n]),Pe=k(()=>{let E;E=typeof d=="function"?d(t,o,n):t+d;const B=Math.min(p,E);return R(B),ue(B),B},[d,t,p,o,n]),pe=u.useRef(null),me=u.useRef(null),ee=u.useCallback(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null,me.current=null)},[]),_e=u.useCallback((E,B,Y,ge=f)=>{me.current=E,pe.current=setTimeout(()=>{const he=Y?Te():Pe();he!==me.current?_e(he,!1,Y,m):ee()},B?0:ge)},[Te,Pe,ee]);u.useEffect(()=>()=>ee(),[ee]);const Fe=u.useMemo(()=>{if(!c)return null;const E={orientation:h,disabled:t<=0,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>_e(t,!0,!0)};return _?.(E)},[c,h,t,ce]),We=u.useMemo(()=>{if(!c)return null;const E={orientation:h,disabled:t>=p,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>_e(t,!0,!1)};return P?.(E)},[c,h,t,p,ce]),be=M?"vertical":"horizontal";return b.jsxs("div",{ref:Le([Z,e]),className:oe(a,An,be,{dragging:L}),style:r,...g,children:[Fe,b.jsx("div",{ref:K,role:"scrollbar","aria-orientation":be,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":t,tabIndex:0,className:oe(zn,"track",be),onPointerDown:X,onKeyDown:fe,children:T?null:ae}),T?kt.createPortal(ae,document.body):null,We]})}));let vt=Date.now,xt=1e3,le={},On=1;const Ce=i=>{let e=le[i]!==null;return e&&(le[i]=null),e},wt=(i,e,t,n=0,o)=>{let r=vt(),a=r,h=0,s=0,l=0,c=On++;if(c%20==0){const f={};for(let m in le)f[m]=!0;le=f}const d=function(f){let m=f!==!0,S=vt(),_=!0;try{_=(!e||e(c))??!0}catch{_=!1}if(!le[c]||!_)return le[c]=null,void t?.(60-s/((S-r)/xt),c,!1);if(m){l=Math.round((S-a)/16.666666666666668)-1;for(let g=0;g<Math.min(l,4);g++)d(!0),s++}n&&(h=(S-r)/n,h>1&&(h=1));let P=o?o(h):h,T=!1;try{T=i(P,S,m)}catch{T=!1}T!==!1&&h!==1||!m?m&&(a=S,requestAnimationFrame(d)):(le[c]=null,t?.(60-s/((S-r)/xt),c,h===1||n==null))};return le[c]=!0,requestAnimationFrame(d),c},$n=function(i){return Math.pow(i-1,3)+1},Kn=function(i){return(i/=.5)<1?.5*Math.pow(i,3):.5*(Math.pow(i-2,3)+2)};class Nn{constructor(e,t){this.__isSingleTouch=!1,this.__isTracking=!1,this.__didDecelerationComplete=!1,this.__isGesturing=!1,this.__isDragging=!1,this.__isDecelerating=0,this.__isAnimating=0,this.__interruptedAnimation=!1,this.__lastScale=1,this.__enableScrollX=!0,this.__enableScrollY=!0,this.__clientLeft=0,this.__clientTop=0,this.__clientWidth=0,this.__clientHeight=0,this.__contentWidth=0,this.__contentHeight=0,this.__snapWidth=100,this.__snapHeight=100,this.__zoomLevel=1,this.__scrollLeft=0,this.__scrollTop=0,this.__maxScrollLeft=0,this.__maxScrollTop=0,this.__scheduledLeft=0,this.__scheduledTop=0,this.__scheduledZoom=0,this.__lastTouchLeft=0,this.__lastTouchTop=0,this.__lastTouchMove=0,this.__positions=[],this.__initialTouchLeft=0,this.__initialTouchTop=0,this.__zoomLevelStart=1,this.__minDecelerationScrollLeft=null,this.__minDecelerationScrollTop=null,this.__maxDecelerationScrollLeft=null,this.__maxDecelerationScrollTop=null,this.__decelerationVelocityX=null,this.__decelerationVelocityY=0,this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:void 0,penetrationDeceleration:.03,penetrationAcceleration:.08,...t}}setDimensions(e,t,n,o){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),n!==null&&(this.__contentWidth=n),o!==null&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)}setPosition(e,t){this.__clientLeft=e||0,this.__clientTop=t||0}setSnapSize(e,t){this.__snapWidth=e,this.__snapHeight=t}getValues(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}}getPoint(e,t){const n=this.getValues();return{left:e/n.zoom,top:t/n.zoom}}getScrollMax(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}}zoomTo(e,t=!1,n,o,r){if(!this.options.zooming)throw new Error("Zooming is not enabled!");r&&(this.__zoomComplete=r),this.__isDecelerating&&(Ce(this.__isDecelerating),this.__isDecelerating=0);const a=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),o===void 0&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const h=e/a;let s=h*(this.__scrollLeft+n)-n,l=h*(this.__scrollTop+o)-o;s>this.__maxScrollLeft?s=this.__maxScrollLeft:s<0&&(s=0),l>this.__maxScrollTop?l=this.__maxScrollTop:l<0&&(l=0),this.__publish(s,l,e,t)}zoomBy(e,t=!1,n=0,o=0,r){this.zoomTo(this.__zoomLevel*e,t,n,o,r)}scrollTo(e,t,n=!1,o=1){if(this.__isDecelerating&&(Ce(this.__isDecelerating),this.__isDecelerating=0),o!==void 0&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(n=!1),this.__publish(e,t,o,n)}scrollBy(e=0,t=0,n=!1){const o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,r=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),r+(t||0),n)}doMouseZoom(e,t,n,o){const r=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*r,!1,n-this.__clientLeft,o-this.__clientTop)}doTouchStart(e,t){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);let n,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(Ce(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Ce(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let r=e.length===1;r?(n=e[0].pageX,o=e[0].pageY):(n=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!r&&this.options.scrollingX,this.__enableScrollY=!r&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!r,this.__isSingleTouch=r,this.__positions=[]}doTouchMove(e,t,n=1){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(!this.__isTracking)return;let o,r;e.length===2?(o=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,r=e[0].pageY);let a=this.__positions;if(this.__isDragging){let h=o-this.__lastTouchLeft,s=r-this.__lastTouchTop,l=this.__scrollLeft,c=this.__scrollTop,d=this.__zoomLevel;if(n!==void 0&&this.options.zooming){let f=d;if(d=d/this.__lastScale*n,d=Math.max(Math.min(d,this.options.maxZoom),this.options.minZoom),f!==d){let m=o-this.__clientLeft,S=r-this.__clientTop;l=(m+l)*d/f-m,c=(S+c)*d/f-S,this.__computeScrollMax(d)}}if(this.__enableScrollX){l-=h*this.options.speedMultiplier;let f=this.__maxScrollLeft;(l>f||l<0)&&(this.options.bouncing?l+=h/2*this.options.speedMultiplier:l=l>f?f:0)}if(this.__enableScrollY){c-=s*this.options.speedMultiplier;const f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?c+=s/2*this.options.speedMultiplier:c=c>f?f:0)}a.length>60&&a.splice(0,30),a.push(l,c,t),this.__publish(l,c,d)}else{let h=this.options.locking?3:0,s=5,l=Math.abs(o-this.__initialTouchLeft),c=Math.abs(r-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&l>=h,this.__enableScrollY=this.options.scrollingY&&c>=h,a.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(l>=s||c>=s),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=n}doTouchEnd(e){if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){let t=this.__positions,n=t.length-1,o=n;for(let r=n;r>0&&t[r]>this.__lastTouchMove-100;r-=3)o=r;if(o!==n){const r=t[n]-t[o],a=this.__scrollLeft-t[o-2],h=this.__scrollTop-t[o-1];this.__decelerationVelocityX=a/r*(1e3/60),this.__decelerationVelocityY=h/r*(1e3/60);const s=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>s||Math.abs(this.__decelerationVelocityY)>s)&&this.__startDeceleration(e)}else this.options.scrollingComplete?.()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete?.();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}}__publish(e,t,n,o=!1){const r=this.__isAnimating;if(r&&(Ce(r),this.__isAnimating=0),o&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const a=this.__scrollLeft,h=this.__scrollTop,s=this.__zoomLevel,l=e-a,c=t-h,d=n-s,f=function(_,P,T){T&&(this.__scrollLeft=a+l*_,this.__scrollTop=h+c*_,this.__zoomLevel=s+d*_,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),m=function(_){return this.__isAnimating===_}.bind(this),S=function(_,P,T){P===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||T)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=wt(f,m,S,this.options.animationDuration,r?$n:Kn)}else this.__scheduledLeft=this.__scrollLeft=e,this.__scheduledTop=this.__scrollTop=t,this.__scheduledZoom=this.__zoomLevel=n,this.__callback&&this.__callback(e,t,n),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}__computeScrollMax(e=this.__zoomLevel){this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)}__startDeceleration(e){if(this.options.paging){const a=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),h=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),s=this.__clientWidth,l=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(a/s)*s,this.__minDecelerationScrollTop=Math.floor(h/l)*l,this.__maxDecelerationScrollLeft=Math.ceil(a/s)*s,this.__maxDecelerationScrollTop=Math.ceil(h/l)*l}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(a,h,s){this.__stepThroughDeceleration(s)}.bind(this),n=this.options.snapping?4:.1,o=function(){const a=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return a||(this.__didDecelerationComplete=!0),a}.bind(this),r=function(a,h,s){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=wt(t,o,r)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);const r=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);r!==n&&(n=r,this.__decelerationVelocityY=0)}if(e?this.__publish(t,n,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=n),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){let o=0,r=0,a=this.options.penetrationDeceleration,h=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?o=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(o=this.__maxDecelerationScrollLeft-t),n<this.__minDecelerationScrollTop?r=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-n),o!==0&&(o*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=o*a:this.__decelerationVelocityX=o*h),r!==0&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*a:this.__decelerationVelocityY=r*h)}}}const ke=(i,e)=>b.jsx(Yt,{...i,ref:e}),In=Object.freeze(Object.defineProperty({__proto__:null,defaultCreateScrollbar:ke,getScrollTo:(i,e,t,n,o=0)=>{for(let r=0;r<t.length;r++){const a=t[r].getBoundingClientRect();let h=a.left-e,s=h+a.width;if(n){if(h<i&&s>=i)return h}else if(Math.ceil(s)>Math.ceil(i)+2)return s}return o}},Symbol.toStringTag,{value:"Module"})),Xt=({width:i,height:e})=>b.jsx("div",{className:"corner",style:{minWidth:`${i}px`,width:`${i}px`,minHeight:`${e}px`,height:`${e}px`}}),Gt=u.memo(u.forwardRef((i,e)=>{const{children:t,viewport:n,onScrollViewport:o,showHorizontalScrollbar:r=!0,showVerticalScrollbar:a=!0,createScrollCorner:h=Xt,createHorizontalScrollbar:s=ke,createVerticalScrollbar:l=ke,style:c,touchElement:d,disableTouch:f,...m}=i,S=r&&s,_=a&&l,P=k(o,[o]),T=Ue(e,()=>({isScrollPane:()=>!0}),[]),g=u.useRef(null);u.useEffect(()=>{g.current&&(g.current.__scrollTop===n?.top&&g.current.__scrollLeft===n?.left||g.current.__isDecelerating||g.current?.scrollTo(n?.left,n?.top,!1))},[n?.left,n?.top,d]);const x=u.useCallback((p,L)=>{P?.({left:p,top:L})},[]),w=u.useCallback(p=>{g.current?.doTouchStart(p.touches,p.timeStamp)},[]),z=u.useCallback(p=>{p.preventDefault(),g.current?.doTouchMove(p.touches,p.timeStamp)},[]),M=u.useCallback(p=>{g.current?.doTouchEnd(p.timeStamp)},[]),K=u.useCallback(({containerWidth:p,containerHeight:L,totalWidth:O,totalHeight:W})=>{g.current.setDimensions(p,L,O,W)},[]);u.useEffect(()=>{const p=d??T.current;if(!f&&tt().supportsTouchEvents&&p&&n){if(!g.current){const L={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new Nn(x,L)}tt().supportsTouchEvents&&(p.addEventListener("touchstart",w),p.addEventListener("touchend",M),p.addEventListener("touchmove",z)),K({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{p?.removeEventListener("touchstart",w),p?.removeEventListener("touchend",M),p?.removeEventListener("touchmove",z)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,f,d]);const[N,{width:C}]=xe(),[y,{height:j}]=xe(),v=u.useMemo(()=>{if(!_)return null;const p=l({orientation:ne.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:L=>{P?.({top:L})}});return b.jsx("div",{style:{display:"flex",flex:"0"},ref:N,children:p})},[l,n?.top,n?.height,n?.totalHeight]),R=u.useMemo(()=>{if(!S)return null;const p=s({orientation:ne.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:L=>{P?.({left:L})}});return b.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[b.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${C}px)`},children:b.jsx("div",{ref:y,className:"sizer",children:p})}),_?h({width:C,height:j}):b.jsx(b.Fragment,{})]})},[s,n?.left,n?.width,n?.totalWidth,_,h,C,j]);return b.jsx("div",{style:{position:"relative",display:"flex",minWidth:_?`${C}px`:void 0,minHeight:S?`${j}px`:void 0,...c},...m,ref:T,children:b.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[b.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[b.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:t}),_?v:b.jsx(b.Fragment,{})]}),S?R:b.jsx(b.Fragment,{})]})})}));Gt.displayName="ScrollPane";let Oe=0;const Hn=300,Un=100,Fn=1e6,Wn=100,Vn=50,qt=u.memo(u.forwardRef((i,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:o=0,minSize:r=0,endGap:a=Hn,endScrollIncrement:h=Un,style:s=Nt,onMouseDown:l,onScrollOffset:c,onScroll:d,scaleLimit:f=Fn,scaleFactor:m=Wn,precisionFactor:S=Vn,createScrollbar:_=ke,...P}=i;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const T=k(l,[l]),[g,x]=u.useState(!1),w=u.useMemo(()=>{const C=f===0?o:Math.min(o??0,Math.max(r??0,(t??0)+(n??0))+(a??0)),y=f!==0&&C>f?m:1,j=y/S,v=Math.ceil(C/y);return{offset:Math.ceil(t/y),totalSize:v,viewportSize:Math.ceil(n/y),scaledOffset:t,scaledTotalSize:o,scaledViewportSize:n,factor:y,precision:j}},[t,o,n,g,r,a,h]),z=k((C,y,j)=>{const v=w.offset;Math.abs(C-v)<w.precision&&(C=v),c?.(C*w.factor,v,w.viewportSize)},[c,w]),M=u.useCallback(C=>{},[]),K=u.useCallback(C=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",K),x(!1)},[]),N=u.useCallback(C=>{x(!0),T?.(C),document.addEventListener("mousemove",M,{passive:!0}),document.addEventListener("mouseup",K,{passive:!0})},[M,K]);return ke({style:s,...P,offset:w.offset,totalSize:w.totalSize,viewportSize:w.viewportSize,onMouseDown:N,onScrollOffset:z},e)}));qt.displayName="VirtualScrollbar";const Yn=u.memo(u.forwardRef((i,e)=>{const{refFocusStart:t,...n}=i,o=u.useRef(null),r=u.useCallback(()=>{if(t)return void t?.current?.focus();const a=o.current.parentElement.children;let h=[];const s=a.length;for(let l=0;l<s&&a[l]!==o.current;l++){const c=a[l],d=c.getAttribute("tabindex");d==null||d==="-1"||c.getAttribute("disabled")!=="true"&&c.focus&&h.push({tabindex:parseInt(d),child:c})}h.length!==0&&(h.sort(function(l,c){return l.tabindex-c.tabindex}),h[0].child.focus())},[t]);return b.jsx("div",{tabIndex:0,ref:Le([o,e]),onFocus:r,...n})})),Xn=u.memo(u.forwardRef((i,e)=>{const{className:t,style:n,children:o,radius:r=4,strokeWidth:a=1,strokeColor:h="grey",...s}=i,[l,{width:c,height:d}]=xe(),f=u.useRef(null),m=(T,g=0)=>{const x=T/2,w=d-x+g;return(function(z,M,K=!1){if(M===0)return z;function N(p,L,O){let W=L.x-p.x,U=L.y-p.y,Z=Math.sqrt(W*W+U*U);return C(p,L,Math.min(1,O/Z))}function C(p,L,O){return{x:p.x+(L.x-p.x)*O,y:p.y+(L.y-p.y)*O}}function y(p,L){p.length>2&&(p[p.length-2]=L.x,p[p.length-1]=L.y)}function j(p){return{x:parseFloat(p[p.length-2]),y:parseFloat(p[p.length-1])}}let v=z.split(/[,\s]/).reduce(function(p,L){let O=L.match("([a-zA-Z])(.+)");return O?(p.push(O[1]),p.push(O[2])):p.push(L),p},[]).reduce(function(p,L){return parseFloat(L)==L&&p.length?p[p.length-1].push(L):p.push([L]),p},[]),R=[];if(v.length>1){let p=j(v[0]),L=null;v[v.length-1][0]==="Z"&&v[0].length>2&&(L=["L",p.x,p.y],v[v.length-1]=L),R.push(v[0]);for(let O=1;O<v.length;O++){let W=R[R.length-1],U=v[O],Z=U===L?v[1]:v[O+1];if(Z&&W&&W.length>2&&U[0]==="L"&&Z.length>2&&Z[0]==="L"){let V,I,Q=j(W),X=j(U),fe=j(Z);K?(V=C(X,W.origPoint||Q,M),I=C(X,Z.origPoint||fe,M)):(V=N(X,Q,M),I=N(X,fe,M)),y(U,V),U.origPoint=X,R.push(U);let ae=C(V,X,.5),ce=C(X,I,.5),ue=["C",ae.x,ae.y,ce.x,ce.y,I.x,I.y];ue.origPoint=X,R.push(ue)}else R.push(U)}if(L){let O=j(R[R.length-1]);R.push(["Z"]),y(R[0],O)}}else R=v;return R.reduce(function(p,L){return p+L.join(" ")+" "},"")})(`${`M 0 ${x} L ${r-.5} ${x} L ${r-.5} ${w} L ${2*r} ${w}`} ${`L ${c-2*r} ${w}`} ${`M ${c-2*r} ${w} L ${c-r} ${w} L ${c-r} ${x} L ${c} ${x}`}`,r)},S=u.useMemo(()=>m(a),[c,d,r,a]),_=u.useMemo(()=>{if(r===0)return;const T=r/2;return m(r)+`L ${c} 0 L 0 0 L 0 ${T}`},[S,r,a]),P=u.useMemo(()=>({style:{clipPath:`path('${_}')`}}),[_]);return b.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...s,ref:Le([f,l,e]),children:[u.isValidElement(o)?u.cloneElement(o,P):b.jsx(b.Fragment,{}),b.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:c,height:d,viewBox:`0 0 ${c} ${d}`,children:b.jsx("path",{d:S,stroke:h,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:a})})]})}));class Gn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class qn{constructor(e){this.notifier=e,this.handleUnhandledRejection=t=>{const n=t.reason;n instanceof DOMException&&n.name==="AbortError"||this.notifier.showError(n)},this.handleGlobalError=t=>{this.notifier.showError(t.error)},this.setupGlobalHandlers()}setupGlobalHandlers(){window.addEventListener("unhandledrejection",this.handleUnhandledRejection),window.addEventListener("error",this.handleGlobalError)}cleanup(){window.removeEventListener("unhandledrejection",this.handleUnhandledRejection),window.removeEventListener("error",this.handleGlobalError)}}const Zn={},Zt=i=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:o=0,paddingAfter:r=0,disabled:a,key:h,hitAreaProps:s=Zn,...l}=i,c=n==="row",{style:d,className:f,...m}=s;return b.jsx("div",{style:{...t,position:"relative"},...l,children:b.jsx("div",{className:oe("hit-box",f),style:{left:(c?-o:0)+"px",width:`calc(100% + ${c?o+r:0}px)`,top:(c?0:-o)+"px",height:`calc(100% + ${c?0:o+r}px)`,position:"absolute",...d},onPointerDown:a?void 0:e,...m})},h)},$e={},de=(i,e,t=!0)=>i===null?null:i.pixels!==null?t?i.pixels:e-i.pixels:(t?i.percent:100-i.percent)/100*e,Ke=(i,e=!0)=>i?.percent?`${e?i.percent:100-i.percent}%`:i?.pixels?`${i.pixels}px`:void 0,se=(i,e)=>{if(i==null)return null;const t={percent:null,pixels:null};let n=e;return typeof i=="string"&&((i=i.trim().toLowerCase()).endsWith("px")?(i=i.substring(0,i.length-2),n=!1):i.endsWith("%")&&(i=i.substring(0,i.length-1),n=!0),i=parseFloat(i)),n?t.percent=i:t.pixels=i,Object.freeze(t)},Jn=u.memo(u.forwardRef((i,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:o="row",fixedPane:r=null,position:a,onPositionChange:h,minBefore:s,maxBefore:l,minAfter:c,maxAfter:d,children:f,className:m,style:S,disabled:_=!1,onDragStart:P,onDragResize:T,onDragFinish:g,resizerProps:x=$e,paneProps:w=$e,paneBeforeProps:z=$e,paneAfterProps:M=$e,createResizer:K=Zt}=i;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const N=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),C=u.useMemo(()=>{let D=null;r&&(r==="before"?D=0:r==="after"&&(D=1));const $=D===null;return{fixedPaneOffset:D,isPercent:$,minBefore:se(s,$),maxBefore:se(l,$),minAfter:se(c,$),maxAfter:se(d,$)}},[s,l,c,d]),y=k(h,[h]),[j,v]=u.useState(()=>se(a,r===null));u.useEffect(()=>{v(se(a,r===null))},[a,r]);const[R,{width:p,height:L}]=xe(),[O,{width:W,height:U}]=xe(),Z=o==="row"?W:U,V=o==="row"?p:L,I=u.useMemo(()=>((D,$,G,F)=>{const ie=[null,null],te=[null,null];if(D||(D={percent:F.fixedPaneOffset===null?50:null,pixels:F.fixedPaneOffset===null?null:0}),$===0)return D?.pixels!=null?F.fixedPaneOffset!==1?(ie[0]=D?.pixels,te[1]=100):(ie[1]=D?.pixels-G,te[0]=100):D?.percent!=null&&(F.fixedPaneOffset!==1?(te[0]=D?.percent,te[1]=100-D?.percent):(te[1]=D?.percent,te[0]=100-D?.percent)),{percents:te,pixels:ie,minBefore:Ke(F.minBefore,!0),maxBefore:Ke(F.maxBefore,!0),minAfter:Ke(F.minAfter),maxAfter:Ke(F.maxAfter)};let re=de(D,$,F.fixedPaneOffset!==1),J=$-G,lt=de(F.minBefore,J,!0)??0,rn=de(F.maxBefore,J,!0)??J,je=0,Ve=0,at=0,ct=J;je=(de(F.maxAfter,$,!1)??G)-G,Ve=de(F.minAfter,$,!1)??$,at=Math.max(lt,je),ct=Math.min(rn,Ve),re=Math.max(at,Math.min(re,ct)),Ve=Math.min(J-re,de(F.maxAfter,J-re,!0)??J),je=Math.min(J-re,de(F.minAfter,J-re,!0)??J),ie[0]=re,ie[1]=J-ie[0];const sn=Math.max(0,Math.min(100,re/J*100));return te[0]=sn,te[1]=100-te[0],{percents:te,pixels:ie,minBefore:`${lt}px`,minAfter:`${je}px`,maxBefore:`${ie[0]}px`,maxAfter:`${ie[1]}px`}})(j,V,Z,C),[C,j,V,Z,o]),[Q,X]=u.useState(!1),fe=k(P,[P]),ae=k(T,[T]),ce=k(g,[g]),ue=u.useRef(null),Te=u.useRef(null),Pe=u.useRef(null),{style:pe,className:me,...ee}=w,_e={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...pe},{className:Fe,style:We,...be}=z,{className:E,style:B,...Y}=M,ge={flex:"1 1 100%",width:"100%",...S,flexDirection:o,display:"flex"},{className:he,style:Se,onPointerDown:De,...it}=x,Qt=k(D=>{const $=se(D,r===null);v($)},[r]),Ae=k(D=>{if(_||!Q)return;const $=st.current?.getBoundingClientRect();let G=0;G=o==="row"?(D.clientX??D.touches?.[0]?.clientX)-$.x:(D.clientY??D.touches?.[0]?.clientY)-$.y,G=Math.max(0,Math.min(V,G)),C.fixedPaneOffset===1&&(G=V-G),a&&j.pixels===G||v({pixels:G,percent:null}),ae?.(G),D.stopPropagation(),D.preventDefault()},[C,o,_,Q,j,V]),rt=k(D=>{if(document.removeEventListener("pointermove",Ae),document.removeEventListener("touchmove",Ae),document.removeEventListener("pointerup",rt),!!Q&&(X(!1),!!j)){if(ce(j.pixels),!se(a,r===null)||j.pixels!==a){const $={...j};$.percent===null&&($.percent=$.pixels/V*100),y($)}D.stopPropagation(),D.preventDefault()}},[j,Q,a,r,V]),en=k(D=>{De?.(D),D.defaultPrevented||_||Q||(X(!0),fe(),document.addEventListener("pointermove",Ae,{passive:!1}),document.addEventListener("touchmove",Ae,{passive:!1}),document.addEventListener("pointerup",rt,{passive:!1}))},[De]),st=Ue(e,()=>({setPosition:Qt,isSplitPane:()=>!0}),[]),tn=u.useMemo(()=>N?K?.({key:"resizer",ref:Le([O,Te]),className:oe("resizer",he),onPointerDownCapture:en,style:{cursor:_?void 0:o==="row"?"ew-resize":"ns-resize",minWidth:o==="row"?"2px":void 0,minHeight:o!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...Se},splitDirection:o,disabled:_,...it}):null,[N,he,it,o,Se,_]),ze=o==="row"?"Width":"Height",nn=u.useMemo(()=>{if(!t)return null;const D={..._e,...We,flex:C.fixedPaneOffset===0&&I?.pixels[0]!==null?`0 0 ${Math.round(I?.pixels[0])}px`:`1 1 ${Math.round(I?.percents[0]??100)}%`,[`min${ze}`]:I?.minBefore,[`max${ze}`]:n?I?.maxBefore:"100%"};return b.jsx("div",{ref:ue,className:oe("before",me,Fe),style:D,...ee,...be,children:t},"before")},[t,w,z,C,I]),on=u.useMemo(()=>{if(!n)return null;const D={..._e,...B,flex:C.fixedPaneOffset===1&&I?.pixels[1]!==null?`0 0 ${Math.round(I?.pixels[1])}px`:`1 1 ${Math.round(I?.percents[1]??100)}%`,[`min${ze}`]:I?.minAfter,[`max${ze}`]:t?I?.maxAfter:"100%"};return b.jsx("div",{ref:Pe,className:oe("after",me,E),style:D,...ee,...Y,children:n},"after")},[n,w,M,C,I]);return b.jsxs("div",{ref:Le([R,st]),className:oe("splitPane",o==="row"?"vertical":"horizontal",{dragging:Q},m),style:ge,children:[nn,tn,on]})}));function Qn(i){if(typeof i=="function")return i;if(typeof i=="string"){const e=i.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const o=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!o)return null;const r=o[1]||"",a=o[2]||"";try{if(/;base64/i.test(r)){if(typeof atob<"u"){const h=atob(a);if(typeof TextDecoder<"u"){const l=new Uint8Array(h.length);for(let c=0;c<h.length;c++)l[c]=h.charCodeAt(c);return new TextDecoder("utf-8").decode(l)}let s="";for(let l=0;l<h.length;l++)s+=`%${h.charCodeAt(l).toString(16).padStart(2,"0")}`;return decodeURIComponent(s)}return(globalThis.Buffer?globalThis.Buffer.from(a,"base64"):require("buffer").Buffer.from(a,"base64")).toString("utf-8")}try{return decodeURIComponent(a)}catch{return a}}catch{return null}})(e);if(t)return Et(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return Et(e);if(/^<\s*path\b/i.test(e)){const t=bt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(i)){const e=[];for(const t of i)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const o=bt(n);o&&e.push({d:o})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return i}function bt(i){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(i);return e?e[1]??e[2]??null:null}function St(i){if("svg"in i)return{...i,svg:Qn(i.svg)};if("url"in i){const e=typeof i.url=="string"?{src:i.url}:i.url;return{...i,url:e}}if("emoji"in i){const e=typeof i.emoji=="string"?i.emoji:i.emoji.text;return{...i,emoji:e}}return i}function Et(i){try{if(typeof DOMParser<"u"){const a=new DOMParser().parseFromString(i,"image/svg+xml"),h=a.querySelector("svg"),s=h?.getAttribute("viewBox")??void 0,l=[];return a.querySelectorAll("path").forEach(c=>{const d=c.getAttribute("d");if(!d)return;const f={d},m=c.getAttribute("class");m&&(f.className=m);const S=c.getAttribute("fill");S&&S!=="none"&&(f.fill=S);const _=c.getAttribute("stroke");_&&(f.stroke=_);const P=c.getAttribute("opacity");P&&(f.opacity=Number(P));const T=c.getAttribute("fill-rule");T&&(f.fillRule=T);const g=c.getAttribute("clip-rule");g&&(f.clipRule=g),l.push(f)}),{viewBox:s,paths:l}}}catch{}const e=i.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],o=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let r;for(;r=o.exec(i);)n.push({d:r[1]});return{viewBox:t,paths:n}}function Ct(i){const e={};for(const[r,a]of Object.entries(i.icons))e[r]=St(a);const t={label:i.meta?.label??"Unnamed",version:i.meta?.version??"1.0.0",license:i.meta?.license??"MIT",defaultViewBox:"0 0 24 24",extends:i.meta?.extends??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},o=i.overrides;if(o){const r={};for(const[a,h]of Object.entries(o)){const s={};for(const[l,c]of Object.entries(h))s[l]=St(c);r[a]=s}n.__overrides=r}return n}function Jt(){const i=new Map,e=new Map;let t="base",n=new Map;async function o(s){const l=i.get(s??t);if(!l)throw new Error(`Icon pack not registered: ${s}`);if(!l.pack){if(!l.loading){if(!l.loader)throw new Error(`No loader for icon pack: ${s}`);l.loading=l.loader().then(c=>{const d=c&&typeof c=="object"&&"default"in c?c.default:c;l.pack=Ct(d)}).catch(c=>{throw l.loading=void 0,c})}await l.loading}}function r(s){const l=s.indexOf(":");return l>0?{ns:s.slice(0,l),key:s.slice(l+1)}:{key:s}}function a(s,l){const c=[s,...i.get(s)?.pack?.meta.extends??[]];for(const d of c){const f=i.get(d);if(!f?.pack)continue;const{icons:m}=f.pack,S=m[e.get(d)?.get(l)??l]??m[l];if(S)return{glyph:S,pack:f.pack,packKey:d}}return null}function h(s,l){const c=l?.packKey??t;if(l?.packKey)return a(l.packKey,s);if(!s)return null;const{ns:d,key:f}=r(s);if(d){const m=i.get(d)?.pack;if(m){if(i.get(t)?.pack){const _=m.__overrides,P=_?.[t]?.[f];if(P)return{glyph:P,pack:m,packKey:d}}const S=a(d,f);if(S)return S}return null}return a(c,s)}return{register:function(s,l){const c=i.get(s)??{};typeof l=="function"?c.loader=l:c.pack=Ct(l),i.set(s,c),t||(t=s)},prefetch:async function(s=t){const l=Array.isArray(s)?s:[s];await Promise.all(l.map(o))},setActive:function(s){t=s;for(const l of n.keys())try{l(s)}catch{}},getActive:function(){return t},resolve:async function(s,l){let c=h(s,l);if(c)return c;const d=l?.packKey??t,{ns:f}=r(s);if(l?.packKey){if(await o(d),c=h(s,l),c)return c;const m=i.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}else if(f){if(await o(f),c=h(s,l),c)return c;const m=i.get(f)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}else{if(await o(d),c=h(s,l),c)return c;const m=i.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}return null},registerAlias:function(s,l,c){e.has(s)||e.set(s,new Map),e.get(s).set(l,c)},has:function(s,l){return!!h(s,l)},getPack:function(s){return i.get(s??t)?.pack},hasPack:function(s){return!!i.get(s)?.pack},listPacks:function(){return Array.from(i.keys())},listIcons:function(s){const l=i.get(s)?.pack;return l?Object.keys(l.icons):[]},addActiveListener:function(s){const l=n.get(s);if(l)return l;const c=()=>{n.delete(s)};return n.set(s,c),c}}}const Me=Jt();Me.register("base",()=>Promise.resolve().then(()=>require("./BR8g9GwalrjWsdSk.cjs")));const Mt=i=>b.jsx("svg",{...i,children:b.jsx("path",{})}),eo={Icon:"_Icon_1ipwo_10"},Lt=u.memo(i=>{const{iconKey:e,packKey:t,className:n,style:o,role:r,title:a,size:h,ariaHidden:s,sourceProps:l,children:c,...d}=i,[f,m]=u.useState(null);u.useEffect(()=>{let v=!0,R=t,p=e;if(!p){const L=Me.getPack(R);return void m({glyph:L?{svg:A.CommonUtils.EmptyArray}:void 0,pack:L??void 0,packKey:R??Me.getActive()})}if(p.includes(":")){const[L,O]=p.split(":");R=L,p=O}return Me.resolve(p,{packKey:R}).then(L=>{v&&m(L)}),()=>{v=!1}},[e,t]);const S=f?.pack,_=f?.glyph,P=f?.packKey;let T=_?_.svg:void 0;const g=_&&!T?_.url:void 0,x=!_||T||g?void 0:_.emoji,w=h!=null?typeof h=="number"?`${h}px`:h:void 0,z=u.useMemo(()=>[eo.Icon,"icon",n].filter(Boolean).join(" "),[n]),M=u.useMemo(()=>{const v={...o};return v["--icon-size"]=w,v},[o,w]),K=r??(a?"img":"presentation"),N=s??(!a||void 0),C=v=>b.jsx("span",{className:z,style:M,role:K,"aria-hidden":N,title:a,"data-icon-glyph":e,"data-icon-pack":P,...d,children:v});if(c)return C(c);if(x)return C(b.jsx("span",{children:typeof x=="string"?x:x.text}));if(g)return C(b.jsx("img",{src:g.src,alt:a??""}));if(_&&"react"in _){const v=_.react,R={className:z,style:M,role:K,"aria-hidden":N,title:a,...d,...l};return C(b.jsx(v,{...R}))}const y={viewBox:T?.viewBox??S?.meta.defaultViewBox??"0 0 24 24"};if(typeof T=="function")return C(T(y)??b.jsx(Mt,{...y}));if(!T)return C(b.jsx(Mt,{...y}));const j=T.paths;return C(b.jsx("svg",{...y,children:j?j.map((v,R)=>b.jsx("path",{d:v.d,className:v.className,fill:v.fill,stroke:v.stroke,opacity:v.opacity,fillRule:v.fillRule,clipRule:v.clipRule},R)):null}))});exports.Command=Ie,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=ot,exports.DefaultDynamicIconService=Me,exports.DefaultReactNotifier=Dt,exports.DynamicIcon=Lt,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=Yn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.KeyCodes={BackSpace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit_8:56,Y:89,Z:90,Meta:91,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,BackSlash:220,Slash:191,BracketRight:221,BracketLeft:219},exports.KeyModifiers=H,exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:i,notifier:e})=>(u.useEffect(()=>{const t=A.Notifier.getOverrides();return A.Notifier.setOverrides(e),()=>{A.Notifier.setOverrides(t)}},[e]),u.createElement(At.Provider,{value:e},i)),exports.NotifierType=qe,exports.ReactErrorBoundary=({children:i})=>{const e=Ee(),t=u.useCallback(n=>{e.showError(n)},[e]);return b.jsx(Gn,{onError:t,children:i})},exports.ReactUtils=En,exports.RoundedTab=Xn,exports.ScrollPane=Gt,exports.ScrollUtils=In,exports.Scrollbar=Yt,exports.ScrollbarOrientation=ne,exports.SimpleCommand=Re,exports.SplitPane=Jn,exports.SplitPaneResizer=Zt,exports.ToolTipPlacement={BottomEnd:"bottom-end",BottomStart:"bottom-start",Bottom:"bottom",LeftEnd:"left-end",LeftStart:"left-start",Left:"left",RightEnd:"right-end",RightStart:"right-start",Right:"right",TopEnd:"top-end",TopStart:"top-start",Top:"top"},exports.UncaughtErrorBoundary=({children:i})=>{const e=Ee();return u.useEffect(()=>{const t=new qn(e);return()=>{t.cleanup()}},[e]),b.jsx(b.Fragment,{children:i})},exports.VirtualScrollbar=qt,exports.WalkingIcon=function(i){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:o=3,dashLength:r=5,iconKey:a,packKey:h,style:s,className:l,...c}=i,d=u.useMemo(()=>{if(!e)return;const m={"--walk-duration":`${n*(o+r)}ms`,"--walk-dash-length":`${r}px`,"--walk-dash-gap":`${o}px`};return t&&t!=="accent"&&(m["--icon-accent"]=`var(--icon-${t})`),m},[e,n,o,r,t]),f=u.useMemo(()=>e?l+" walking":l,[e,l]);return b.jsx(Lt,{iconKey:a,packKey:h,className:f,style:{...s,...d},...c})},exports.createDynamicIconService=Jt,exports.defaultCreateScrollCorner=Xt,exports.defaultCreateScrollEdgeButton=i=>{const{style:e,orientation:t=ne.Vertical,...n}=i,o=t===ne.Vertical,r=o?"rotate(90) ":"";return b.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${o?"vertical":"horizontal"} edge`,...n,children:b.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:r,children:b.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:i.disabled?0:1},d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})})})},exports.defaultCreateScrollEndButton=Vt,exports.defaultCreateScrollStartButton=Wt,exports.getDevicePixelRatio=function(i){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=i||{},o=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(o):o),t)},exports.toShortcutString=ye,exports.useCallbackRef=k,exports.useCommand=function(i,e=null){const t=u.useRef(e);t.current=e;const[n,o]=u.useReducer(a=>a+1,0),r=u.useMemo(()=>Array.isArray(i)?i:[i],[i]);return u.useEffect(()=>{if(!r||r.length===0)return;const a=(l,c)=>{t.current?.onChange?.(c),o()};let h=null;e&&(h={onExecute(l,c){t.current?.onExecute?.(l,c)},onError(l,c,d){t.current?.onError?.(l,c,d)}});const s=new Set;for(let l=0;l<r.length;l++)s.add(r[l]?.addPropertyListener(A.CommonUtils.debounce(a,0),!0)),e&&s.add(r[l]?.addExecuteListener(h));return()=>{s.forEach(l=>{l?.()})}},[i]),n},exports.useCommands=function(i,e=null,t=null,n){const o=u.useRef(t);o.current=t,e&&!Array.isArray(e)&&(e=[e]);const[r,a]=u.useState(Be(i,e)),h=n?[...n,i]:[i];return u.useEffect(()=>{const s={onGroupChange:()=>{const f=Be(i,e);a(f),o.current?.onChange?.(this)}};let l;e&&e.length>0&&(l={keys:e},s.onCommandChange=(f,m)=>{o.current?.onChange?.(i),a(Be(i,e))});const c=i?.addListener(s,l),d=Be(i,e);return a(d),o.current?.onChange&&o.current?.onChange(i),()=>{c?.()}},h),r},exports.useCopyPaste=i=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:o,commands:r}=i,a=Ee(),h=k(o,[o]),s=k(n,[n]),{getClipboard:l,refNativeCopy:c}=pt(),d=l();u.useMemo(()=>{const g=e?.element,x=t?.element??e?.element;if(!r)return;const w=[new Re("cut",g,{label:"Cut",description:"Remove the selection and put it on the clipboard so you can paste it somewhere else.",icon:"cut",shortcut:{key:"X",modifiers:[H.Ctrl]}}),new Re("copy",g,{label:"Copy",description:"Put a copy of the selection on the clipboard so you can paste it somewhere else.",icon:"copy",shortcut:{key:"C",modifiers:[H.Ctrl]}}),new Re("paste",x,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste",shortcut:[{key:"V",modifiers:[H.Ctrl]},{key:"F8",modifiers:[H.Ctrl]}]})];r?.addCommands(w,!0)},[r]);const f=k(async g=>{if(!e?.element)return;let x=null;try{x=e.doCopy?.(g),typeof x=="string"?await d.writeText(x):await d.writeReference(x)}catch(w){throw w}},[e,a]),m=k(async g=>{const x=e?.element?.();if(x){c.current={sourceElement:x,args:g};try{await f(g)}catch(w){a.showError?.(w)}}},[e?.element,a]),S=u.useCallback(()=>{m({isCut:!0})},[]),_=k(async(g,x,w)=>{try{if(await g.doPaste(x,w)===!1)return;s?.(x,w)}catch(z){a.showError?.(z)}},[s]),P=k(async(g,x,w)=>{const z=t?.element?.();if(z&&await A.CommonUtils.whenFocus(z),!g&&!x)return;const M=await a.showBusy?.("Pasting...");if(x)try{return await _(t,x,w),void M?.()}catch(C){M?.(),a.showError?.(C)}let K,N=t.importFromExternal;N||(N=(C,y)=>({getItemType:()=>"text",toText:()=>g.text,isClipboardItem:!0}));try{K=await N(g,{isCut:!1})}catch(C){M?.(),a.showError?.(C)}if(K)try{const C=await Promise.resolve(K);await _(t,C,w),M?.()}catch(C){M?.(),a.showError?.(C)}else M?.()},[_,t,a]),T=k(async g=>{if(t?.element)try{const x=await d.readReference();if(x)return void await P(null,x,g);const w=[];w[0]=await A.ClipboardUtils.readStringFromClipboard(d,A.MimeType.plain),w[1]=await A.ClipboardUtils.readHTMLFromClipboard(d,A.MimeType.html),w[2]=await A.ClipboardUtils.readBlobFromClipboard(d,A.MimeType.png);const z={text:w[0]??null,html:w[1]??null,image:w[2]??null};await P(z,null,g)}catch(x){if(x?.message==="Document is not focused.")return;a.showError?.(x)}},[P,t?.element,a]);return k(async g=>{},[e?.element]),k(async g=>{},[t?.element,P,a]),u.useEffect(()=>{if(!d)return;const g=async z=>{const M=await d.readReference();h?.(M)},x=z=>{a.showMessage?.(A.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},w=z=>{a.showMessage?.(A.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",g),d.addEventListener("clipboarderrorread",x),d.addEventListener("clipboarderrorwrite",w),()=>{d.removeEventListener("clipboardchange",g),d.removeEventListener("clipboarderrorread",x),d.removeEventListener("clipboarderrorwrite",w)}},[d,a]),u.useEffect(()=>{},[f,P,e,t]),u.useEffect(()=>{r?.getCommand("cut")?.updateCallback(S).update({disabled:!e||!t}),r?.getCommand("copy")?.updateCallback(m).update({disabled:!e}),r?.getCommand("paste")?.updateCallback(T).update({disabled:!t})},[e,t,r]),{paste:T,copy:m,clipboard:d}},exports.useDevicePixelRatio=function(i){const[e,t]=u.useState(typeof window<"u"?window.devicePixelRatio:1),n=u.useRef(null);return u.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const o=()=>{const r=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",o,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:r,listener:o}};return o(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[i]),e},exports.useEditMode=()=>{const i=mn();return u.useMemo(()=>({setMode:e=>{Rt(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>i}),[i])},exports.useFullscreenPortal=function(){const[i,e]=u.useState(!!document.fullscreenElement),t=u.useCallback(()=>{const n=document.fullscreenElement;return n?n.querySelector(".fullscreen-portal-root")||n:document.body},[]);return u.useEffect(()=>{function n(){const o=document.fullscreenElement;if(e(!!o),!o)return;let r=o.querySelector(".fullscreen-portal-root");r||(r=document.createElement("div"),r.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",o.appendChild(r))}return Oe++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Oe--,Oe<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(o=>{o.parentNode&&o.parentNode.removeChild(o)}),Oe=0)}},[]),{getPortalContainer:t,isFullscreen:i}},exports.useGlobalClipboard=pt,exports.useId=Tn,exports.useImperativeElement=Ue,exports.useMouseDownAndHoldListener=function(i,e){return ht({onPointerDown:i,onPointerMoveOrWait:(t,n,o)=>{i?.(o)},...e})},exports.useNotifier=Ee,exports.useOnClickOrFocusAway=function(i,e,t){const n=k(e,[e]);u.useEffect(()=>{const o=r=>{i.current&&!i.current.contains(r.target)&&n(r)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",o),document.addEventListener("touchstart",o)),t&&t.focusEvents===!1||document.addEventListener("focus",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o),document.removeEventListener("focus",o)}},[i])},exports.useSynchronizedPointerHandler=ht,exports.useTraceUpdate=function(i,e=!0){const t=u.useRef(i);u.useEffect(()=>{if(e){const n=Object.entries(i).reduce((o,[r,a])=>(t.current[r]!==a&&(o[r]=[t.current[r],a]),o),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=i})},exports.useUndoManager=({manager:i,commands:e,disabled:t})=>{const n=Ee(),o=k(a=>{try{i?.undo(a)}catch(h){n.error(h)}},[i]),r=k(a=>{try{i?.redo(a)}catch(h){n.error(h)}},[i]);return u.useMemo(()=>{if(!e)return;const a={contains:s=>!0,focus(){}},h=[new Ie("undo",a,{label:"Undo",description:gt,shortcut:{key:"z",modifiers:[H.Ctrl]},disabled:!0},o),new Ie("redo",a,{label:"Redo",description:yt,shortcut:[{key:"y",modifiers:[H.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[H.Alt]}],disabled:!0},r)];e?.addCommands(h,!0)},[e]),u.useEffect(()=>{if(!e)return;const a=()=>{const s=i?.getTopUndoDescription(),l={};var c;e.getCommand("undo").update({disabled:t||!i||!i.hasUndo(),description:s?(c=s,`Undo ${c}`):gt,state:l,context:{undoManager:i}});const d=i?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!i||!i.hasRedo(),description:d?Dn(d):yt,state:l,context:{undoManager:i}})};if(a(),!i)return;const h=i.addListener({onStackChange(){a()}});return()=>h?.()},[i,e,t]),{undo:o,redo:r}};
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),u=require("react"),kt=require("react-dom"),A=require("@sheetxl/utils"),ln=require("react-dom/client"),H={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"},ne={Horizontal:"horizontal",Vertical:"vertical"};function Tt(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var o=i.length;for(e=0;e<o;e++)i[e]&&(t=Tt(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function oe(){for(var i,e,t=0,n="",o=arguments.length;t<o;t++)(i=arguments[t])&&(e=Tt(i))&&(n&&(n+=" "),n+=e);return n}function Ye(i,e){if(typeof i=="function")return i(e);i&&(i.current=e)}var Le=parseInt(u.version.split(".")[0],10)>=19?function(i){return e=>{const t=[];for(const n of i){const o=Ye(n,e),r=typeof o=="function";t.push(r?o:()=>Ye(n,null))}return()=>{for(const n of t)n()}}}:function(i){return e=>{for(const t of i)Ye(t,e)}},an=function(){},Pt=typeof window<"u",cn=Pt?u.useLayoutEffect:u.useEffect,ut={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const xe=Pt&&window.ResizeObserver!==void 0?function(){var i=u.useState(null),e=i[0],t=i[1],n=u.useState(ut),o=n[0],r=n[1],a=u.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var s=h[0].contentRect,l=s.x,c=s.y,d=s.width,f=s.height,m=s.top,S=s.left,_=s.bottom,P=s.right;r({x:l,y:c,width:d,height:f,top:m,left:S,bottom:_,right:P})}})},[]);return cn(function(){if(e)return a.observe(e),function(){a.disconnect()}},[e]),[t,o]}:function(){return[an,ut]},qe={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Dt extends A.DefaultNotifier{setOverrides(e){super.setOverrides(e)}getDelegate(){return this._overrides}showMessage(e,t){const n=this.getDelegate();if(n?.showMessage)return n.showMessage(e,t);t?.type!==qe.Warning?t?.type!==qe.Error?A.Notifier.log(e):A.Notifier.error(e):A.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(o=>{o(()=>{})})}showWindow(e,t,n){const o=this.getDelegate();if(o?.showWindow)return o.showWindow(e,t,n)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):A.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInputOptions(e){const t=this.getDelegate();return t?.showInputOptions?t.showInputOptions(e):Promise.resolve({input:"",option:""})}}const un=new Dt,At=u.createContext(un),Ee=()=>u.useContext(At),k=(i,e)=>{const t=u.useCallback((...r)=>i?.(...r),e),n=u.useRef(null);n.current=t;const o=u.useCallback((...r)=>n.current?.(...r),[]);if(n.current)return o};function ht(i){if(!i)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:o=!1,consumeTouch:r=!0}=i,a=k(e,[e]),h=k(t,[t]),s=k(n,[n]),l=u.useRef(!1),c=i?.timerInitial??230,d=i?.timerContinuous??c/2,f=u.useRef(null),m=u.useRef(null),S=u.useRef(null),_=u.useRef(null),P=u.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null)},[]),T=u.useCallback(y=>{_.current=setTimeout(()=>{window.requestAnimationFrame(()=>{l.current!==!1&&s?.(m.current,S.current,f.current)}),T(d)},y??c)},[]);u.useEffect(()=>()=>P(),[]);const g=o?"pointer":"mouse",x=u.useCallback(y=>{y.stopPropagation(),y.stopImmediatePropagation(),y.preventDefault()},[]),w=k(y=>{document.removeEventListener(`${g}move`,K),document.removeEventListener(`${g}up`,w),document.removeEventListener("keydown",N),document.removeEventListener("keyup",C),document.removeEventListener("touchstart",x,{capture:!0}),document.removeEventListener("touchmove",x,{capture:!0}),window.removeEventListener("blur",z),P(),window.requestAnimationFrame(()=>{l.current!==!1&&(l.current=!1,h?.(y,S.current,f.current),S.current=null)})},[]),z=u.useCallback(()=>{l.current!==!1&&(l.current=!1,w(m.current))},[]),M=k(()=>{P(),T(d),window.requestAnimationFrame(()=>{l.current!==!1&&s?.(m.current,S.current,f.current)})},[d]),K=k(y=>{m.current=y,M()},[]),N=k(y=>{S.current={ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,altKey:y.altKey,metaKey:y.metaKey},M()},[]),C=k(y=>{S.current={ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,altKey:y.altKey,metaKey:y.metaKey},M()},[d]);return k(y=>{y.isDefaultPrevented()||(S.current={ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,altKey:y.altKey,metaKey:y.metaKey},a(y,S.current)!==!1&&(f.current=y,m.current=y.nativeEvent,document.addEventListener(`${g}up`,w,{passive:!1}),document.addEventListener(`${g}move`,K,{passive:!1}),document.addEventListener("keydown",N,{passive:!1}),document.addEventListener("keyup",C,{passive:!1}),window.addEventListener("blur",z,{passive:!0}),o&&r&&(document.addEventListener("touchstart",x,{passive:!1,capture:!0}),document.addEventListener("touchmove",x,{passive:!1,capture:!0})),l.current=!0,T(c)))},[c,o])}const hn=({initValue:i,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(i);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const o=e();return u.useLayoutEffect(()=>{n.current!==o&&(n.current=o,t(o))},[t,o]),null},Ze=i=>{console&&console.warn&&console.warn(i)},Xe=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let dn=1,Je=!1,zt=!1;const Ne=[],ve=[],He=()=>{ve.forEach(i=>i())},fn=({automaticContainerInternalUseOnly:i})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,i||Je!==!1||(zt=!0),u.useEffect(()=>{let o=!0;function r(){if(o)return ve[0]!==r?(i||Je!==!0||Ze("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void t(a=>[])):void t([...Ne])}return ve.push(r),He(),()=>{o=!1,n.current?.length>0&&Ze("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),ve.splice(ve.indexOf(r),1),He()}},[i]),b.jsx(b.Fragment,{children:e.map(({hook:o,key:r})=>u.createElement(hn,{...o,key:r}))})},pn=i=>{const e=dn++;return Ne.push({hook:i,key:e}),ve.length===0&&zt===!1&&(Je=!0,(t=>{if(Xe.document&&Xe.document.createElement){const n=Xe.document.createElement("div");ln.createRoot(n).render(b.jsx(t,{automaticContainerInternalUseOnly:!0}))}else Ze("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(fn)),He(),()=>{Ne.splice(Ne.findIndex(t=>t.key===e),1),He()}};let Qe=null;Qe||(Qe=(i,e,t={})=>{let n,o,r=!1,a=!1,h=[],{unmountIfNoConsumers:s=!1}=t;const l=d=>{var f;o=d,f=()=>h.forEach(m=>m(d)),kt.unstable_batchedUpdates(f)},c=()=>(a||(o=typeof i=="function"?i():i,a=!0),o);return()=>{const[d,f]=u.useState(c);return u.useEffect(()=>(r||(r=!0,n=pn({initValue:i,useHookBody:e,applyStateChange:l})),h.push(f),o!==d&&f(o),()=>{h.splice(h.indexOf(f),1),h.length===0&&s&&(n(),r=!1)}),[]),d}});const jt=Qe;let Rt=()=>{console.warn("You must call useEditMode before setting its state.")};const mn=jt(null,()=>{const[i,e]=u.useState(null);return Rt=e,i});class Ie{constructor(e,t,n,o){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=o,o===void 0&&(this._callback=()=>{console.log(`implement: ${this.label()} : ${this.description()}`)})}key(){return this._key}_resolve(e,t){if(typeof e=="function"){const n=t??this._context;return e(typeof n=="function"?n():n)}return e}target(){return typeof this._target=="function"?this._target():this._target}label(e,t){const n=this._scopedLabels?.[e]||this._label;let o=null;if(typeof n=="function"){const r=t??this._context;o=n(typeof r=="function"?r():r)}else o=n;return o}description(e){return this._resolve(this._description,e)}tags(e){return this._resolve(this._tags,e)}icon(e){return this._resolve(this._icon,e)}shortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}state(){return this._resolve(this._state)}context(){return typeof this._context=="function"?this._context():this._context}async execute(e,t){if(!this.disabled()&&this._callback){try{let n=!0;if(t?.beforeExecute&&(n=t?.beforeExecute(this,e)),await Promise.resolve(n)===!1)return!1;const o=this._callback.bind(this)(e,this);if(await Promise.resolve(o)===!1)return!1;t?.onExecute?.(this,e),this._notifyExecute(e)}catch(n){return console.warn(n),t?.onError(this,n,e),this._notifyError(e,n),!1}return!0}}addPropertyListener(e,t=!1){if(!e)throw new Error("listener must be specified");const n=this._listenersProperties;return n.add(e),t&&e({},this),()=>{n.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const t=this._listenersExecute;return t.add(e),function(){t.delete(e)}}_notifyExecute(e){const t=this;this._listenersExecute.forEach(n=>{n.onExecute(t,e)})}_notifyError(e,t){const n=this;this._listenersExecute.forEach(o=>{o.onError?.(n,e,t)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const t=this._applyProps(e);return Object.keys(t).length>0&&this._notifyPropertyChange(t),this}_notifyPropertyChange(e){const t=this;this._listenersProperties.forEach(n=>{n(e,t)})}_applyProps(e){let t={},n=this;return Object.keys(e).forEach(o=>{let r=e[o];n["_"+o]!==r&&(n["_"+o]=t[o]=r)}),t}}class Re extends Ie{}var q=typeof window<"u"?window:{screen:{},navigator:{}},we=(q.matchMedia||function(){return{matches:!1}}).bind(q),Bt=!1,_n={get passive(){return Bt=!0}},dt=function(){};q.addEventListener&&q.addEventListener("p",dt,_n),q.removeEventListener&&q.removeEventListener("p",dt,!1);var gn=Bt,yn="PointerEvent"in q,nt="ontouchstart"in q,Ot=nt||"TouchEvent"in q&&we("(any-pointer: coarse)").matches,ft=(q.navigator.maxTouchPoints||0)>0||Ot,$t=q.navigator.userAgent||"",vn=we("(pointer: coarse)").matches&&/iPad|Macintosh/.test($t)&&Math.min(q.screen.width||0,q.screen.height||0)>=768,Kt=(we("(pointer: coarse)").matches||!we("(pointer: fine)").matches&&nt)&&!/Windows.*Firefox/.test($t),xn=we("(any-pointer: fine)").matches||we("(any-hover: hover)").matches||vn||!nt,et=!ft||!xn&&Kt?ft?"touchOnly":"mouseOnly":"hybrid",wn=et==="mouseOnly"?"mouse":et==="touchOnly"||Kt?"touch":"mouse";const bn=Object.freeze(Object.defineProperty({__proto__:null,deviceType:et,primaryInput:wn,supportsPassiveEvents:gn,supportsPointerEvents:yn,supportsTouchEvents:Ot},Symbol.toStringTag,{value:"Module"})),Sn=new Set(["INPUT","TEXTAREA","SELECT"]),Nt={};function tt(){return bn}const It=i=>i==="BracketLeft"?"[":i==="BracketRight"?"]":A.CommonUtils.camelToPrettyCase(i),En=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Nt,boundPixel:function(i,e=!1,t=0){return i},createSyntheticEvent:i=>{let e=!1,t=!1;return{nativeEvent:i,currentTarget:i.currentTarget,target:i.target,bubbles:i.bubbles,cancelable:i.cancelable,defaultPrevented:i.defaultPrevented,eventPhase:i.eventPhase,isTrusted:i.isTrusted,preventDefault:()=>{e=!0,i.preventDefault()},isDefaultPrevented:()=>e,stopPropagation:()=>{t=!0,i.stopPropagation()},isPropagationStopped:()=>t,persist:()=>{},timeStamp:i.timeStamp,type:i.type}},detectIt:tt,focusableNodeNames:Sn,toPrettyKeyCode:It},Symbol.toStringTag,{value:"Module"}));class ot{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=A.CommonUtils.uuidV4(),this._target=e,this._groupKey=t??null,this._root=this,this._nodes=new Map,this._nodes.set(t,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const n=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(o,r)=>{const a=n._root._listenersByKey,h=r.key(),s=a.get(h);s&&n._notifyCommands(s,"onCommandChange",r)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let o=n,r=n===this;for(;!r&&o;)o===this&&(r=!0),o=o._parent;return(r?n:this)._getCommand(e)}createChildGroup(e,t,n){let o;if(!n){let h=this;for(;h&&!o;){let s=h._nodes.get(t);s&&(o=s),h=h._parent}}o||(o=new ot(e,t),o._parent=this,o._root=this._root,o._unListenersByCommand=null,o._listenersByKey=null,o._commandsPropertyListener=null);const r=(h,s)=>{!h.has(t)||n?h.set(t,s):n===void 0&&console.warn("commandGroup already registered",t)};r(this._root._nodes,o);let a=this._parent;for(;a;)r(this._nodes,o),a=a._parent;return this._children.set(t,o),this._notify("onGroupChange"),o}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,o=this._commandsByShortcut,r=this._root._commandsPropertyListener,a=this._root._unListenersByCommand;for(let h=0;h<e.length;h++){const s=e[h],l=s.key();if(n.has(l)&&!t){t===void 0&&console.warn("command already registered",l);continue}n.set(l,s);let c=a.get(s);c&&(c(),a.delete(s));const d=s.addPropertyListener(r);a.set(s,d);const f=s.shortcut();if(!f)continue;const m=Array.isArray(f)?f:[f];for(let S=0;S<m.length;S++){const _=ye(m[S]),P=o.get(_);P&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${_}, ${l}, ${P}.`),o.set(_,l)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,t=[];const n=this._groupKey;for(;e;)t.push(e._nodes),e._nodes.delete(n),e=e._parent;e=this._parent;const o=r=>{r._children.forEach(a=>{for(let h=0;h<t.length;h++)a._nodes.delete(t[h]);o(a)})};o(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,t){this._addCommands(e,t),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let t=this;if(e&&(t=this._nodes.get(e),!t))return void console.warn("group not found",e);let n=this._root._focused??this._root;for(;n;)n=n._parent;this._root._focused!==t&&(this._root._focused=t,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const t=[];e.altKey&&t.push(H.Alt),e.shiftKey&&t.push(H.Shift),e.ctrlKey&&t.push(H.Ctrl),e.metaKey&&t.push(H.Meta);let n=ye({key:e.code,modifiers:t});const o=this._commandsByShortcut;let r=o.get(n);r||(n=ye({key:e.key,modifiers:t}),r=o.get(n)),!r&&e.code.startsWith("Digit")&&(n=ye({key:e.code.substring(5,e.code.length),modifiers:t}),r=this._commandsByShortcut.get(n)),!r&&e.code.startsWith("Key")&&(r=ye({key:e.code.substring(3,e.code.length),modifiers:t}),r=o.get(n));let a=null;return r&&(a=this._commandsByKey.get(r),a&&a.disabled()&&(a=null),!a||a.target()&&a.target().contains(e.target)||(a=null)),a||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const t=this.getActive();if(!t||e.isDefaultPrevented())return!1;const n=t.findCommandByEvent?.(e);return!!n&&(n.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,t){const n=this._listeners,o=t?.keys,r=this._root._listenersByKey;if(o&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let a=null;if(o)for(let h=0;h<o.length;h++){const s=o[h];if(!s)continue;let l=r.get(s);l||(l=new Set,r.set(s,l)),a||(a=[]),a.push(l),l.add(e)}return n.add(e),()=>{if(a)for(let h=0;h<a.length;h++)a[h].delete(e);n.delete(e)}}_notifyCommands(e,t,n){const o=this;setTimeout(()=>{e.forEach(r=>{r[t]?.(o,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(o=>{o[e]?.(n,t)}),n._parent&&n._parent._notify(e,t)},0)}getAllCommands(){const e=[],t=this._groupKey;return this._commandsByKey.forEach(n=>{e.push({command:n,groupKey:t})}),this._children.forEach(n=>{e.push(...n.getAllCommands())}),e}}const Cn=A.CommonUtils.getOS()===A.CommonUtils.OSType.MacOS||A.CommonUtils.getOS()===A.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Mn=A.CommonUtils.getOS()===A.CommonUtils.OSType.MacOS||A.CommonUtils.getOS()===A.CommonUtils.OSType.IOS?"⌘":"^",ye=(i,e=!1)=>{const t={};for(let o=0;i.modifiers&&o<i.modifiers.length;o++)t[i.modifiers[o]]=!0;let n="";return(t?.[H.Ctrl]||t?.[H.Meta])&&(n+=(n.length>0?"+":"")+(e?Mn:Cn)),t?.[H.Alt]&&(n+=e?"⌥":"Alt"),t?.[H.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+It(i.key),n},Be=(i,e)=>{if(!e||!i||e.length===0)return A.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let o=0;o<t;o++){const r=e[o],a=r?i.getCommand(r):null;n[o]=a}return n},pt=jt({setClipboard:i=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>A.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[i,e]=u.useState(A.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>i,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let Ge=!1,Ln=0;var kn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const mt=()=>"sheetxl-ui-"+Ln++,_t=u.useId,Tn=_t??function(){const[i,e]=u.useState(()=>Ge?mt():void 0);return kn(()=>{i==null&&e(mt())},[]),u.useEffect(()=>{Ge||(Ge=!0)},[]),i},Pn=[];function Ue(i,e,t=Pn){const n=u.useRef(null);return u.useImperativeHandle(i,()=>{if(!n.current)return;const o=n.current,r=e?.();if(!r||typeof r!="object")throw new Error("attributes must return a plain object of values");const a=Object.keys(r),h=a.length;for(let s=0;s<h;s++){const l=a[s],c=r[l];Object.defineProperty(o,l,{value:c,writable:!0,configurable:!0,enumerable:!0})}return o},t),n}const gt="Undo the last action.",yt="Repeat the last action or undo the redo.",Dn=i=>`Redo ${i}`,An="_scrollbar_1v478_17",zn="_vsb-track_1v478_27",jn="_vsb-thumb_1v478_39",Ht="_scrollbar-button_1v478_80",Ut="M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z",Ft="M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z",Rn={transform:"rotate(180deg)"},Wt=i=>{const{style:e,orientation:t=ne.Vertical,disabled:n,...o}=i,r=t===ne.Vertical?Ut:Ft;return b.jsx("button",{style:e,className:oe(Ht,t,"scroll-button"),disabled:n,...o,children:b.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:b.jsx("path",{d:r})})})},Vt=i=>{const{style:e,orientation:t=ne.Vertical,disabled:n,...o}=i,r=t===ne.Vertical?Ut:Ft;return b.jsx("button",{style:e,className:oe(Ht,t,"scroll-button"),disabled:n,...o,children:b.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:Rn,children:b.jsx("path",{d:r})})})},Bn=24,Yt=u.memo(u.forwardRef((i,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:o=0,style:r,className:a,orientation:h=ne.Vertical,onScrollOffset:s,onScroll:l,showCustomScrollButtons:c=!0,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:m=120,minThumbSize:S=Bn,createScrollStartButton:_=Wt,createScrollEndButton:P=Vt,usePortal:T=!1,...g}=i;k(l,[l]);const[x,w]=u.useState({offset:0,length:0}),z=u.useRef(-1),M=h===ne.Vertical,[K,{width:N,height:C}]=xe(),y=M?C:N,j=k((E,B,Y)=>{if(B===0||Y===0)return void w({offset:0,length:S});const ge=Y/y,he=B/ge,Se=Math.min(Math.max(S,he),y),De=E/ge;return{offset:Math.min(Math.max(0,De),y-Se),length:Se}},[y,S]),v=k(E=>{const B=n/y,Y=Math.round(E*B);w(j(Y,o,n)),s?.(Y,o,n),z.current=E},[s,o,n,y,x]),R=k(E=>{w(j(E,o,n)),s?.(E,o,n),z.current=E},[s,o,n]);u.useEffect(()=>{z.current!==t&&y!==0&&(z.current=-1,w(j(t,o,n)))},[t]),u.useEffect(()=>{y!==0&&w(j(t,o,n))},[o,n,M,y]);const p=Math.max(0,n-o),[L,O]=u.useState(!1),W=u.useRef(0),U=u.useRef(0),Z=Ue(e,()=>({isScrollbar:()=>!0}),[]),V=k(E=>{E.currentTarget.setPointerCapture(E.pointerId),O(!0),W.current=M?E.clientY:E.clientX,U.current=x.offset,E.preventDefault(),E.stopPropagation()},[M,x]),I=k(E=>{if(!L)return;const B=(M?E.clientY:E.clientX)-W.current,Y=U.current+B;v(Y)},[L,M]),Q=k(E=>{try{E.currentTarget.releasePointerCapture(E.pointerId)}catch{}O(!1)},[]),X=k(E=>{if(!E.currentTarget)return;const B=E.currentTarget.getBoundingClientRect(),Y=M?E.clientY-B.top:E.clientX-B.left;v(Y)},[M,x,o,n]),fe=k(E=>{const B=Math.max(1,Math.floor(.9*o));M?(E.key==="ArrowDown"&&v(Math.min(p,t+1)),E.key==="ArrowUp"&&v(Math.max(0,t-1)),E.key==="PageDown"&&v(Math.min(p,t+B)),E.key==="PageUp"&&v(Math.max(0,t-B)),E.key==="Home"&&v(0),E.key==="End"&&v(p)):(E.key==="ArrowRight"&&v(Math.min(p,t+1)),E.key==="ArrowLeft"&&v(Math.max(0,t-1)),E.key==="PageDown"&&v(Math.min(p,t+B)),E.key==="PageUp"&&v(Math.max(0,t-B)),E.key==="Home"&&v(0),E.key==="End"&&v(p))},[M,o,n,t,p]),ae=b.jsx("div",{className:oe(jn),role:"slider","aria-label":M?"Rows":"Columns","aria-orientation":M?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":t,tabIndex:0,style:{position:T?"fixed":"relative",[M?"height":"width"]:`${x.length}px`,[M?"width":"height"]:"100%",transform:M?`translateY(${x.offset}px)`:`translateX(${x.offset}px)`},onPointerDown:V,onPointerMove:I,onPointerUp:Q}),[ce,ue]=u.useState(null),Te=k(()=>{let E;E=typeof d=="function"?d(t,o,n):t-d;const B=Math.max(0,E);return R(B),ue(B),B},[d,t,o,n]),Pe=k(()=>{let E;E=typeof d=="function"?d(t,o,n):t+d;const B=Math.min(p,E);return R(B),ue(B),B},[d,t,p,o,n]),pe=u.useRef(null),me=u.useRef(null),ee=u.useCallback(()=>{pe.current&&(clearTimeout(pe.current),pe.current=null,me.current=null)},[]),_e=u.useCallback((E,B,Y,ge=f)=>{me.current=E,pe.current=setTimeout(()=>{const he=Y?Te():Pe();he!==me.current?_e(he,!1,Y,m):ee()},B?0:ge)},[Te,Pe,ee]);u.useEffect(()=>()=>ee(),[ee]);const Fe=u.useMemo(()=>{if(!c)return null;const E={orientation:h,disabled:t<=0,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>_e(t,!0,!0)};return _?.(E)},[c,h,t,ce]),We=u.useMemo(()=>{if(!c)return null;const E={orientation:h,disabled:t>=p,onMouseUp:ee,onMouseLeave:ee,onMouseDown:()=>_e(t,!0,!1)};return P?.(E)},[c,h,t,p,ce]),be=M?"vertical":"horizontal";return b.jsxs("div",{ref:Le([Z,e]),className:oe(a,An,be,{dragging:L}),style:r,...g,children:[Fe,b.jsx("div",{ref:K,role:"scrollbar","aria-orientation":be,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":t,tabIndex:0,className:oe(zn,"track",be),onPointerDown:X,onKeyDown:fe,children:T?null:ae}),T?kt.createPortal(ae,document.body):null,We]})}));let vt=Date.now,xt=1e3,le={},On=1;const Ce=i=>{let e=le[i]!==null;return e&&(le[i]=null),e},wt=(i,e,t,n=0,o)=>{let r=vt(),a=r,h=0,s=0,l=0,c=On++;if(c%20==0){const f={};for(let m in le)f[m]=!0;le=f}const d=function(f){let m=f!==!0,S=vt(),_=!0;try{_=(!e||e(c))??!0}catch{_=!1}if(!le[c]||!_)return le[c]=null,void t?.(60-s/((S-r)/xt),c,!1);if(m){l=Math.round((S-a)/16.666666666666668)-1;for(let g=0;g<Math.min(l,4);g++)d(!0),s++}n&&(h=(S-r)/n,h>1&&(h=1));let P=o?o(h):h,T=!1;try{T=i(P,S,m)}catch{T=!1}T!==!1&&h!==1||!m?m&&(a=S,requestAnimationFrame(d)):(le[c]=null,t?.(60-s/((S-r)/xt),c,h===1||n==null))};return le[c]=!0,requestAnimationFrame(d),c},$n=function(i){return Math.pow(i-1,3)+1},Kn=function(i){return(i/=.5)<1?.5*Math.pow(i,3):.5*(Math.pow(i-2,3)+2)};class Nn{constructor(e,t){this.__isSingleTouch=!1,this.__isTracking=!1,this.__didDecelerationComplete=!1,this.__isGesturing=!1,this.__isDragging=!1,this.__isDecelerating=0,this.__isAnimating=0,this.__interruptedAnimation=!1,this.__lastScale=1,this.__enableScrollX=!0,this.__enableScrollY=!0,this.__clientLeft=0,this.__clientTop=0,this.__clientWidth=0,this.__clientHeight=0,this.__contentWidth=0,this.__contentHeight=0,this.__snapWidth=100,this.__snapHeight=100,this.__zoomLevel=1,this.__scrollLeft=0,this.__scrollTop=0,this.__maxScrollLeft=0,this.__maxScrollTop=0,this.__scheduledLeft=0,this.__scheduledTop=0,this.__scheduledZoom=0,this.__lastTouchLeft=0,this.__lastTouchTop=0,this.__lastTouchMove=0,this.__positions=[],this.__initialTouchLeft=0,this.__initialTouchTop=0,this.__zoomLevelStart=1,this.__minDecelerationScrollLeft=null,this.__minDecelerationScrollTop=null,this.__maxDecelerationScrollLeft=null,this.__maxDecelerationScrollTop=null,this.__decelerationVelocityX=null,this.__decelerationVelocityY=0,this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:void 0,penetrationDeceleration:.03,penetrationAcceleration:.08,...t}}setDimensions(e,t,n,o){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),n!==null&&(this.__contentWidth=n),o!==null&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)}setPosition(e,t){this.__clientLeft=e||0,this.__clientTop=t||0}setSnapSize(e,t){this.__snapWidth=e,this.__snapHeight=t}getValues(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}}getPoint(e,t){const n=this.getValues();return{left:e/n.zoom,top:t/n.zoom}}getScrollMax(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}}zoomTo(e,t=!1,n,o,r){if(!this.options.zooming)throw new Error("Zooming is not enabled!");r&&(this.__zoomComplete=r),this.__isDecelerating&&(Ce(this.__isDecelerating),this.__isDecelerating=0);const a=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),o===void 0&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const h=e/a;let s=h*(this.__scrollLeft+n)-n,l=h*(this.__scrollTop+o)-o;s>this.__maxScrollLeft?s=this.__maxScrollLeft:s<0&&(s=0),l>this.__maxScrollTop?l=this.__maxScrollTop:l<0&&(l=0),this.__publish(s,l,e,t)}zoomBy(e,t=!1,n=0,o=0,r){this.zoomTo(this.__zoomLevel*e,t,n,o,r)}scrollTo(e,t,n=!1,o=1){if(this.__isDecelerating&&(Ce(this.__isDecelerating),this.__isDecelerating=0),o!==void 0&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(n=!1),this.__publish(e,t,o,n)}scrollBy(e=0,t=0,n=!1){const o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,r=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),r+(t||0),n)}doMouseZoom(e,t,n,o){const r=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*r,!1,n-this.__clientLeft,o-this.__clientTop)}doTouchStart(e,t){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);let n,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(Ce(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Ce(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let r=e.length===1;r?(n=e[0].pageX,o=e[0].pageY):(n=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!r&&this.options.scrollingX,this.__enableScrollY=!r&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!r,this.__isSingleTouch=r,this.__positions=[]}doTouchMove(e,t,n=1){if(e.length===void 0)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(!this.__isTracking)return;let o,r;e.length===2?(o=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,r=e[0].pageY);let a=this.__positions;if(this.__isDragging){let h=o-this.__lastTouchLeft,s=r-this.__lastTouchTop,l=this.__scrollLeft,c=this.__scrollTop,d=this.__zoomLevel;if(n!==void 0&&this.options.zooming){let f=d;if(d=d/this.__lastScale*n,d=Math.max(Math.min(d,this.options.maxZoom),this.options.minZoom),f!==d){let m=o-this.__clientLeft,S=r-this.__clientTop;l=(m+l)*d/f-m,c=(S+c)*d/f-S,this.__computeScrollMax(d)}}if(this.__enableScrollX){l-=h*this.options.speedMultiplier;let f=this.__maxScrollLeft;(l>f||l<0)&&(this.options.bouncing?l+=h/2*this.options.speedMultiplier:l=l>f?f:0)}if(this.__enableScrollY){c-=s*this.options.speedMultiplier;const f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?c+=s/2*this.options.speedMultiplier:c=c>f?f:0)}a.length>60&&a.splice(0,30),a.push(l,c,t),this.__publish(l,c,d)}else{let h=this.options.locking?3:0,s=5,l=Math.abs(o-this.__initialTouchLeft),c=Math.abs(r-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&l>=h,this.__enableScrollY=this.options.scrollingY&&c>=h,a.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(l>=s||c>=s),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=n}doTouchEnd(e){if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){let t=this.__positions,n=t.length-1,o=n;for(let r=n;r>0&&t[r]>this.__lastTouchMove-100;r-=3)o=r;if(o!==n){const r=t[n]-t[o],a=this.__scrollLeft-t[o-2],h=this.__scrollTop-t[o-1];this.__decelerationVelocityX=a/r*(1e3/60),this.__decelerationVelocityY=h/r*(1e3/60);const s=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>s||Math.abs(this.__decelerationVelocityY)>s)&&this.__startDeceleration(e)}else this.options.scrollingComplete?.()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete?.();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}}__publish(e,t,n,o=!1){const r=this.__isAnimating;if(r&&(Ce(r),this.__isAnimating=0),o&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const a=this.__scrollLeft,h=this.__scrollTop,s=this.__zoomLevel,l=e-a,c=t-h,d=n-s,f=function(_,P,T){T&&(this.__scrollLeft=a+l*_,this.__scrollTop=h+c*_,this.__zoomLevel=s+d*_,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),m=function(_){return this.__isAnimating===_}.bind(this),S=function(_,P,T){P===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||T)&&this.options.scrollingComplete?.(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=wt(f,m,S,this.options.animationDuration,r?$n:Kn)}else this.__scheduledLeft=this.__scrollLeft=e,this.__scheduledTop=this.__scrollTop=t,this.__scheduledZoom=this.__zoomLevel=n,this.__callback&&this.__callback(e,t,n),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}__computeScrollMax(e=this.__zoomLevel){this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)}__startDeceleration(e){if(this.options.paging){const a=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),h=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),s=this.__clientWidth,l=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(a/s)*s,this.__minDecelerationScrollTop=Math.floor(h/l)*l,this.__maxDecelerationScrollLeft=Math.ceil(a/s)*s,this.__maxDecelerationScrollTop=Math.ceil(h/l)*l}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(a,h,s){this.__stepThroughDeceleration(s)}.bind(this),n=this.options.snapping?4:.1,o=function(){const a=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return a||(this.__didDecelerationComplete=!0),a}.bind(this),r=function(a,h,s){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=wt(t,o,r)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);const r=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);r!==n&&(n=r,this.__decelerationVelocityY=0)}if(e?this.__publish(t,n,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=n),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){let o=0,r=0,a=this.options.penetrationDeceleration,h=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?o=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(o=this.__maxDecelerationScrollLeft-t),n<this.__minDecelerationScrollTop?r=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-n),o!==0&&(o*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=o*a:this.__decelerationVelocityX=o*h),r!==0&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*a:this.__decelerationVelocityY=r*h)}}}const ke=(i,e)=>b.jsx(Yt,{...i,ref:e}),In=Object.freeze(Object.defineProperty({__proto__:null,defaultCreateScrollbar:ke,getScrollTo:(i,e,t,n,o=0)=>{for(let r=0;r<t.length;r++){const a=t[r].getBoundingClientRect();let h=a.left-e,s=h+a.width;if(n){if(h<i&&s>=i)return h}else if(Math.ceil(s)>Math.ceil(i)+2)return s}return o}},Symbol.toStringTag,{value:"Module"})),Xt=({width:i,height:e})=>b.jsx("div",{className:"corner",style:{minWidth:`${i}px`,width:`${i}px`,minHeight:`${e}px`,height:`${e}px`}}),Gt=u.memo(u.forwardRef((i,e)=>{const{children:t,viewport:n,onScrollViewport:o,showHorizontalScrollbar:r=!0,showVerticalScrollbar:a=!0,createScrollCorner:h=Xt,createHorizontalScrollbar:s=ke,createVerticalScrollbar:l=ke,style:c,touchElement:d,disableTouch:f,...m}=i,S=r&&s,_=a&&l,P=k(o,[o]),T=Ue(e,()=>({isScrollPane:()=>!0}),[]),g=u.useRef(null);u.useEffect(()=>{g.current&&(g.current.__scrollTop===n?.top&&g.current.__scrollLeft===n?.left||g.current.__isDecelerating||g.current?.scrollTo(n?.left,n?.top,!1))},[n?.left,n?.top,d]);const x=u.useCallback((p,L)=>{P?.({left:p,top:L})},[]),w=u.useCallback(p=>{g.current?.doTouchStart(p.touches,p.timeStamp)},[]),z=u.useCallback(p=>{p.preventDefault(),g.current?.doTouchMove(p.touches,p.timeStamp)},[]),M=u.useCallback(p=>{g.current?.doTouchEnd(p.timeStamp)},[]),K=u.useCallback(({containerWidth:p,containerHeight:L,totalWidth:O,totalHeight:W})=>{g.current.setDimensions(p,L,O,W)},[]);u.useEffect(()=>{const p=d??T.current;if(!f&&tt().supportsTouchEvents&&p&&n){if(!g.current){const L={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new Nn(x,L)}tt().supportsTouchEvents&&(p.addEventListener("touchstart",w),p.addEventListener("touchend",M),p.addEventListener("touchmove",z)),K({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{p?.removeEventListener("touchstart",w),p?.removeEventListener("touchend",M),p?.removeEventListener("touchmove",z)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,f,d]);const[N,{width:C}]=xe(),[y,{height:j}]=xe(),v=u.useMemo(()=>{if(!_)return null;const p=l({orientation:ne.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:L=>{P?.({top:L})}});return b.jsx("div",{style:{display:"flex",flex:"0"},ref:N,children:p})},[l,n?.top,n?.height,n?.totalHeight]),R=u.useMemo(()=>{if(!S)return null;const p=s({orientation:ne.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:L=>{P?.({left:L})}});return b.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[b.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${C}px)`},children:b.jsx("div",{ref:y,className:"sizer",children:p})}),_?h({width:C,height:j}):b.jsx(b.Fragment,{})]})},[s,n?.left,n?.width,n?.totalWidth,_,h,C,j]);return b.jsx("div",{style:{position:"relative",display:"flex",minWidth:_?`${C}px`:void 0,minHeight:S?`${j}px`:void 0,...c},...m,ref:T,children:b.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[b.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[b.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:t}),_?v:b.jsx(b.Fragment,{})]}),S?R:b.jsx(b.Fragment,{})]})})}));Gt.displayName="ScrollPane";let Oe=0;const Hn=300,Un=100,Fn=1e6,Wn=100,Vn=50,qt=u.memo(u.forwardRef((i,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:o=0,minSize:r=0,endGap:a=Hn,endScrollIncrement:h=Un,style:s=Nt,onMouseDown:l,onScrollOffset:c,onScroll:d,scaleLimit:f=Fn,scaleFactor:m=Wn,precisionFactor:S=Vn,createScrollbar:_=ke,...P}=i;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const T=k(l,[l]),[g,x]=u.useState(!1),w=u.useMemo(()=>{const C=f===0?o:Math.min(o??0,Math.max(r??0,(t??0)+(n??0))+(a??0)),y=f!==0&&C>f?m:1,j=y/S,v=Math.ceil(C/y);return{offset:Math.ceil(t/y),totalSize:v,viewportSize:Math.ceil(n/y),scaledOffset:t,scaledTotalSize:o,scaledViewportSize:n,factor:y,precision:j}},[t,o,n,g,r,a,h]),z=k((C,y,j)=>{const v=w.offset;Math.abs(C-v)<w.precision&&(C=v),c?.(C*w.factor,v,w.viewportSize)},[c,w]),M=u.useCallback(C=>{},[]),K=u.useCallback(C=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",K),x(!1)},[]),N=u.useCallback(C=>{x(!0),T?.(C),document.addEventListener("mousemove",M,{passive:!0}),document.addEventListener("mouseup",K,{passive:!0})},[M,K]);return ke({style:s,...P,offset:w.offset,totalSize:w.totalSize,viewportSize:w.viewportSize,onMouseDown:N,onScrollOffset:z},e)}));qt.displayName="VirtualScrollbar";const Yn=u.memo(u.forwardRef((i,e)=>{const{refFocusStart:t,...n}=i,o=u.useRef(null),r=u.useCallback(()=>{if(t)return void t?.current?.focus();const a=o.current.parentElement.children;let h=[];const s=a.length;for(let l=0;l<s&&a[l]!==o.current;l++){const c=a[l],d=c.getAttribute("tabindex");d==null||d==="-1"||c.getAttribute("disabled")!=="true"&&c.focus&&h.push({tabindex:parseInt(d),child:c})}h.length!==0&&(h.sort(function(l,c){return l.tabindex-c.tabindex}),h[0].child.focus())},[t]);return b.jsx("div",{tabIndex:0,ref:Le([o,e]),onFocus:r,...n})})),Xn=u.memo(u.forwardRef((i,e)=>{const{className:t,style:n,children:o,radius:r=4,strokeWidth:a=1,strokeColor:h="grey",...s}=i,[l,{width:c,height:d}]=xe(),f=u.useRef(null),m=(T,g=0)=>{const x=T/2,w=d-x+g;return(function(z,M,K=!1){if(M===0)return z;function N(p,L,O){let W=L.x-p.x,U=L.y-p.y,Z=Math.sqrt(W*W+U*U);return C(p,L,Math.min(1,O/Z))}function C(p,L,O){return{x:p.x+(L.x-p.x)*O,y:p.y+(L.y-p.y)*O}}function y(p,L){p.length>2&&(p[p.length-2]=L.x,p[p.length-1]=L.y)}function j(p){return{x:parseFloat(p[p.length-2]),y:parseFloat(p[p.length-1])}}let v=z.split(/[,\s]/).reduce(function(p,L){let O=L.match("([a-zA-Z])(.+)");return O?(p.push(O[1]),p.push(O[2])):p.push(L),p},[]).reduce(function(p,L){return parseFloat(L)==L&&p.length?p[p.length-1].push(L):p.push([L]),p},[]),R=[];if(v.length>1){let p=j(v[0]),L=null;v[v.length-1][0]==="Z"&&v[0].length>2&&(L=["L",p.x,p.y],v[v.length-1]=L),R.push(v[0]);for(let O=1;O<v.length;O++){let W=R[R.length-1],U=v[O],Z=U===L?v[1]:v[O+1];if(Z&&W&&W.length>2&&U[0]==="L"&&Z.length>2&&Z[0]==="L"){let V,I,Q=j(W),X=j(U),fe=j(Z);K?(V=C(X,W.origPoint||Q,M),I=C(X,Z.origPoint||fe,M)):(V=N(X,Q,M),I=N(X,fe,M)),y(U,V),U.origPoint=X,R.push(U);let ae=C(V,X,.5),ce=C(X,I,.5),ue=["C",ae.x,ae.y,ce.x,ce.y,I.x,I.y];ue.origPoint=X,R.push(ue)}else R.push(U)}if(L){let O=j(R[R.length-1]);R.push(["Z"]),y(R[0],O)}}else R=v;return R.reduce(function(p,L){return p+L.join(" ")+" "},"")})(`${`M 0 ${x} L ${r-.5} ${x} L ${r-.5} ${w} L ${2*r} ${w}`} ${`L ${c-2*r} ${w}`} ${`M ${c-2*r} ${w} L ${c-r} ${w} L ${c-r} ${x} L ${c} ${x}`}`,r)},S=u.useMemo(()=>m(a),[c,d,r,a]),_=u.useMemo(()=>{if(r===0)return;const T=r/2;return m(r)+`L ${c} 0 L 0 0 L 0 ${T}`},[S,r,a]),P=u.useMemo(()=>({style:{clipPath:`path('${_}')`}}),[_]);return b.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...s,ref:Le([f,l,e]),children:[u.isValidElement(o)?u.cloneElement(o,P):b.jsx(b.Fragment,{}),b.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:c,height:d,viewBox:`0 0 ${c} ${d}`,children:b.jsx("path",{d:S,stroke:h,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:a})})]})}));class Gn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class qn{constructor(e){this.notifier=e,this.handleUnhandledRejection=t=>{const n=t.reason;n instanceof DOMException&&n.name==="AbortError"||this.notifier.showError(n)},this.handleGlobalError=t=>{this.notifier.showError(t.error)},this.setupGlobalHandlers()}setupGlobalHandlers(){window.addEventListener("unhandledrejection",this.handleUnhandledRejection),window.addEventListener("error",this.handleGlobalError)}cleanup(){window.removeEventListener("unhandledrejection",this.handleUnhandledRejection),window.removeEventListener("error",this.handleGlobalError)}}const Zn={},Zt=i=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:o=0,paddingAfter:r=0,disabled:a,key:h,hitAreaProps:s=Zn,...l}=i,c=n==="row",{style:d,className:f,...m}=s;return b.jsx("div",{style:{...t,position:"relative"},...l,children:b.jsx("div",{className:oe("hit-box",f),style:{left:(c?-o:0)+"px",width:`calc(100% + ${c?o+r:0}px)`,top:(c?0:-o)+"px",height:`calc(100% + ${c?0:o+r}px)`,position:"absolute",...d},onPointerDown:a?void 0:e,...m})},h)},$e={},de=(i,e,t=!0)=>i===null?null:i.pixels!==null?t?i.pixels:e-i.pixels:(t?i.percent:100-i.percent)/100*e,Ke=(i,e=!0)=>i?.percent?`${e?i.percent:100-i.percent}%`:i?.pixels?`${i.pixels}px`:void 0,se=(i,e)=>{if(i==null)return null;const t={percent:null,pixels:null};let n=e;return typeof i=="string"&&((i=i.trim().toLowerCase()).endsWith("px")?(i=i.substring(0,i.length-2),n=!1):i.endsWith("%")&&(i=i.substring(0,i.length-1),n=!0),i=parseFloat(i)),n?t.percent=i:t.pixels=i,Object.freeze(t)},Jn=u.memo(u.forwardRef((i,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:o="row",fixedPane:r=null,position:a,onPositionChange:h,minBefore:s,maxBefore:l,minAfter:c,maxAfter:d,children:f,className:m,style:S,disabled:_=!1,onDragStart:P,onDragResize:T,onDragFinish:g,resizerProps:x=$e,paneProps:w=$e,paneBeforeProps:z=$e,paneAfterProps:M=$e,createResizer:K=Zt}=i;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const N=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),C=u.useMemo(()=>{let D=null;r&&(r==="before"?D=0:r==="after"&&(D=1));const $=D===null;return{fixedPaneOffset:D,isPercent:$,minBefore:se(s,$),maxBefore:se(l,$),minAfter:se(c,$),maxAfter:se(d,$)}},[s,l,c,d]),y=k(h,[h]),[j,v]=u.useState(()=>se(a,r===null));u.useEffect(()=>{v(se(a,r===null))},[a,r]);const[R,{width:p,height:L}]=xe(),[O,{width:W,height:U}]=xe(),Z=o==="row"?W:U,V=o==="row"?p:L,I=u.useMemo(()=>((D,$,G,F)=>{const ie=[null,null],te=[null,null];if(D||(D={percent:F.fixedPaneOffset===null?50:null,pixels:F.fixedPaneOffset===null?null:0}),$===0)return D?.pixels!=null?F.fixedPaneOffset!==1?(ie[0]=D?.pixels,te[1]=100):(ie[1]=D?.pixels-G,te[0]=100):D?.percent!=null&&(F.fixedPaneOffset!==1?(te[0]=D?.percent,te[1]=100-D?.percent):(te[1]=D?.percent,te[0]=100-D?.percent)),{percents:te,pixels:ie,minBefore:Ke(F.minBefore,!0),maxBefore:Ke(F.maxBefore,!0),minAfter:Ke(F.minAfter),maxAfter:Ke(F.maxAfter)};let re=de(D,$,F.fixedPaneOffset!==1),J=$-G,lt=de(F.minBefore,J,!0)??0,rn=de(F.maxBefore,J,!0)??J,je=0,Ve=0,at=0,ct=J;je=(de(F.maxAfter,$,!1)??G)-G,Ve=de(F.minAfter,$,!1)??$,at=Math.max(lt,je),ct=Math.min(rn,Ve),re=Math.max(at,Math.min(re,ct)),Ve=Math.min(J-re,de(F.maxAfter,J-re,!0)??J),je=Math.min(J-re,de(F.minAfter,J-re,!0)??J),ie[0]=re,ie[1]=J-ie[0];const sn=Math.max(0,Math.min(100,re/J*100));return te[0]=sn,te[1]=100-te[0],{percents:te,pixels:ie,minBefore:`${lt}px`,minAfter:`${je}px`,maxBefore:`${ie[0]}px`,maxAfter:`${ie[1]}px`}})(j,V,Z,C),[C,j,V,Z,o]),[Q,X]=u.useState(!1),fe=k(P,[P]),ae=k(T,[T]),ce=k(g,[g]),ue=u.useRef(null),Te=u.useRef(null),Pe=u.useRef(null),{style:pe,className:me,...ee}=w,_e={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...pe},{className:Fe,style:We,...be}=z,{className:E,style:B,...Y}=M,ge={flex:"1 1 100%",width:"100%",...S,flexDirection:o,display:"flex"},{className:he,style:Se,onPointerDown:De,...it}=x,Qt=k(D=>{const $=se(D,r===null);v($)},[r]),Ae=k(D=>{if(_||!Q)return;const $=st.current?.getBoundingClientRect();let G=0;G=o==="row"?(D.clientX??D.touches?.[0]?.clientX)-$.x:(D.clientY??D.touches?.[0]?.clientY)-$.y,G=Math.max(0,Math.min(V,G)),C.fixedPaneOffset===1&&(G=V-G),a&&j.pixels===G||v({pixels:G,percent:null}),ae?.(G),D.stopPropagation(),D.preventDefault()},[C,o,_,Q,j,V]),rt=k(D=>{if(document.removeEventListener("pointermove",Ae),document.removeEventListener("touchmove",Ae),document.removeEventListener("pointerup",rt),!!Q&&(X(!1),!!j)){if(ce(j.pixels),!se(a,r===null)||j.pixels!==a){const $={...j};$.percent===null&&($.percent=$.pixels/V*100),y($)}D.stopPropagation(),D.preventDefault()}},[j,Q,a,r,V]),en=k(D=>{De?.(D),D.defaultPrevented||_||Q||(X(!0),fe(),document.addEventListener("pointermove",Ae,{passive:!1}),document.addEventListener("touchmove",Ae,{passive:!1}),document.addEventListener("pointerup",rt,{passive:!1}))},[De]),st=Ue(e,()=>({setPosition:Qt,isSplitPane:()=>!0}),[]),tn=u.useMemo(()=>N?K?.({key:"resizer",ref:Le([O,Te]),className:oe("resizer",he),onPointerDownCapture:en,style:{cursor:_?void 0:o==="row"?"ew-resize":"ns-resize",minWidth:o==="row"?"2px":void 0,minHeight:o!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...Se},splitDirection:o,disabled:_,...it}):null,[N,he,it,o,Se,_]),ze=o==="row"?"Width":"Height",nn=u.useMemo(()=>{if(!t)return null;const D={..._e,...We,flex:C.fixedPaneOffset===0&&I?.pixels[0]!==null?`0 0 ${Math.round(I?.pixels[0])}px`:`1 1 ${Math.round(I?.percents[0]??100)}%`,[`min${ze}`]:I?.minBefore,[`max${ze}`]:n?I?.maxBefore:"100%"};return b.jsx("div",{ref:ue,className:oe("before",me,Fe),style:D,...ee,...be,children:t},"before")},[t,w,z,C,I]),on=u.useMemo(()=>{if(!n)return null;const D={..._e,...B,flex:C.fixedPaneOffset===1&&I?.pixels[1]!==null?`0 0 ${Math.round(I?.pixels[1])}px`:`1 1 ${Math.round(I?.percents[1]??100)}%`,[`min${ze}`]:I?.minAfter,[`max${ze}`]:t?I?.maxAfter:"100%"};return b.jsx("div",{ref:Pe,className:oe("after",me,E),style:D,...ee,...Y,children:n},"after")},[n,w,M,C,I]);return b.jsxs("div",{ref:Le([R,st]),className:oe("splitPane",o==="row"?"vertical":"horizontal",{dragging:Q},m),style:ge,children:[nn,tn,on]})}));function Qn(i){if(typeof i=="function")return i;if(typeof i=="string"){const e=i.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const o=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!o)return null;const r=o[1]||"",a=o[2]||"";try{if(/;base64/i.test(r)){if(typeof atob<"u"){const h=atob(a);if(typeof TextDecoder<"u"){const l=new Uint8Array(h.length);for(let c=0;c<h.length;c++)l[c]=h.charCodeAt(c);return new TextDecoder("utf-8").decode(l)}let s="";for(let l=0;l<h.length;l++)s+=`%${h.charCodeAt(l).toString(16).padStart(2,"0")}`;return decodeURIComponent(s)}return(globalThis.Buffer?globalThis.Buffer.from(a,"base64"):require("buffer").Buffer.from(a,"base64")).toString("utf-8")}try{return decodeURIComponent(a)}catch{return a}}catch{return null}})(e);if(t)return Et(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return Et(e);if(/^<\s*path\b/i.test(e)){const t=bt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(i)){const e=[];for(const t of i)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const o=bt(n);o&&e.push({d:o})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return i}function bt(i){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(i);return e?e[1]??e[2]??null:null}function St(i){if("svg"in i)return{...i,svg:Qn(i.svg)};if("url"in i){const e=typeof i.url=="string"?{src:i.url}:i.url;return{...i,url:e}}if("emoji"in i){const e=typeof i.emoji=="string"?i.emoji:i.emoji.text;return{...i,emoji:e}}return i}function Et(i){try{if(typeof DOMParser<"u"){const a=new DOMParser().parseFromString(i,"image/svg+xml"),h=a.querySelector("svg"),s=h?.getAttribute("viewBox")??void 0,l=[];return a.querySelectorAll("path").forEach(c=>{const d=c.getAttribute("d");if(!d)return;const f={d},m=c.getAttribute("class");m&&(f.className=m);const S=c.getAttribute("fill");S&&S!=="none"&&(f.fill=S);const _=c.getAttribute("stroke");_&&(f.stroke=_);const P=c.getAttribute("opacity");P&&(f.opacity=Number(P));const T=c.getAttribute("fill-rule");T&&(f.fillRule=T);const g=c.getAttribute("clip-rule");g&&(f.clipRule=g),l.push(f)}),{viewBox:s,paths:l}}}catch{}const e=i.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],o=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let r;for(;r=o.exec(i);)n.push({d:r[1]});return{viewBox:t,paths:n}}function Ct(i){const e={};for(const[r,a]of Object.entries(i.icons))e[r]=St(a);const t={label:i.meta?.label??"Unnamed",version:i.meta?.version??"1.0.0",license:i.meta?.license??"MIT",defaultViewBox:"0 0 24 24",extends:i.meta?.extends??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},o=i.overrides;if(o){const r={};for(const[a,h]of Object.entries(o)){const s={};for(const[l,c]of Object.entries(h))s[l]=St(c);r[a]=s}n.__overrides=r}return n}function Jt(){const i=new Map,e=new Map;let t="base",n=new Map;async function o(s){const l=i.get(s??t);if(!l)throw new Error(`Icon pack not registered: ${s}`);if(!l.pack){if(!l.loading){if(!l.loader)throw new Error(`No loader for icon pack: ${s}`);l.loading=l.loader().then(c=>{const d=c&&typeof c=="object"&&"default"in c?c.default:c;l.pack=Ct(d)}).catch(c=>{throw l.loading=void 0,c})}await l.loading}}function r(s){const l=s.indexOf(":");return l>0?{ns:s.slice(0,l),key:s.slice(l+1)}:{key:s}}function a(s,l){const c=[s,...i.get(s)?.pack?.meta.extends??[]];for(const d of c){const f=i.get(d);if(!f?.pack)continue;const{icons:m}=f.pack,S=m[e.get(d)?.get(l)??l]??m[l];if(S)return{glyph:S,pack:f.pack,packKey:d}}return null}function h(s,l){const c=l?.packKey??t;if(l?.packKey)return a(l.packKey,s);if(!s)return null;const{ns:d,key:f}=r(s);if(d){const m=i.get(d)?.pack;if(m){if(i.get(t)?.pack){const _=m.__overrides,P=_?.[t]?.[f];if(P)return{glyph:P,pack:m,packKey:d}}const S=a(d,f);if(S)return S}return null}return a(c,s)}return{register:function(s,l){const c=i.get(s)??{};typeof l=="function"?c.loader=l:c.pack=Ct(l),i.set(s,c),t||(t=s)},prefetch:async function(s=t){const l=Array.isArray(s)?s:[s];await Promise.all(l.map(o))},setActive:function(s){t=s;for(const l of n.keys())try{l(s)}catch{}},getActive:function(){return t},resolve:async function(s,l){let c=h(s,l);if(c)return c;const d=l?.packKey??t,{ns:f}=r(s);if(l?.packKey){if(await o(d),c=h(s,l),c)return c;const m=i.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}else if(f){if(await o(f),c=h(s,l),c)return c;const m=i.get(f)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}else{if(await o(d),c=h(s,l),c)return c;const m=i.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(o)),c=h(s,l),c))return c}return null},registerAlias:function(s,l,c){e.has(s)||e.set(s,new Map),e.get(s).set(l,c)},has:function(s,l){return!!h(s,l)},getPack:function(s){return i.get(s??t)?.pack},hasPack:function(s){return!!i.get(s)?.pack},listPacks:function(){return Array.from(i.keys())},listIcons:function(s){const l=i.get(s)?.pack;return l?Object.keys(l.icons):[]},addActiveListener:function(s){const l=n.get(s);if(l)return l;const c=()=>{n.delete(s)};return n.set(s,c),c}}}const Me=Jt();Me.register("base",()=>Promise.resolve().then(()=>require("./GDXov-yumZio8FPo.cjs")));const Mt=i=>b.jsx("svg",{...i,children:b.jsx("path",{})}),eo={Icon:"_Icon_1ipwo_10"},Lt=u.memo(i=>{const{iconKey:e,packKey:t,className:n,style:o,role:r,title:a,size:h,ariaHidden:s,sourceProps:l,children:c,...d}=i,[f,m]=u.useState(null);u.useEffect(()=>{let v=!0,R=t,p=e;if(!p){const L=Me.getPack(R);return void m({glyph:L?{svg:A.CommonUtils.EmptyArray}:void 0,pack:L??void 0,packKey:R??Me.getActive()})}if(p.includes(":")){const[L,O]=p.split(":");R=L,p=O}return Me.resolve(p,{packKey:R}).then(L=>{v&&m(L)}),()=>{v=!1}},[e,t]);const S=f?.pack,_=f?.glyph,P=f?.packKey;let T=_?_.svg:void 0;const g=_&&!T?_.url:void 0,x=!_||T||g?void 0:_.emoji,w=h!=null?typeof h=="number"?`${h}px`:h:void 0,z=u.useMemo(()=>[eo.Icon,"icon",n].filter(Boolean).join(" "),[n]),M=u.useMemo(()=>{const v={...o};return v["--icon-size"]=w,v},[o,w]),K=r??(a?"img":"presentation"),N=s??(!a||void 0),C=v=>b.jsx("span",{className:z,style:M,role:K,"aria-hidden":N,title:a,"data-icon-glyph":e,"data-icon-pack":P,...d,children:v});if(c)return C(c);if(x)return C(b.jsx("span",{children:typeof x=="string"?x:x.text}));if(g)return C(b.jsx("img",{src:g.src,alt:a??""}));if(_&&"react"in _){const v=_.react,R={className:z,style:M,role:K,"aria-hidden":N,title:a,...d,...l};return C(b.jsx(v,{...R}))}const y={viewBox:T?.viewBox??S?.meta.defaultViewBox??"0 0 24 24"};if(typeof T=="function")return C(T(y)??b.jsx(Mt,{...y}));if(!T)return C(b.jsx(Mt,{...y}));const j=T.paths;return C(b.jsx("svg",{...y,children:j?j.map((v,R)=>b.jsx("path",{d:v.d,className:v.className,fill:v.fill,stroke:v.stroke,opacity:v.opacity,fillRule:v.fillRule,clipRule:v.clipRule},R)):null}))});exports.Command=Ie,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=ot,exports.DefaultDynamicIconService=Me,exports.DefaultReactNotifier=Dt,exports.DynamicIcon=Lt,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=Yn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.KeyCodes={BackSpace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit_8:56,Y:89,Z:90,Meta:91,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,BackSlash:220,Slash:191,BracketRight:221,BracketLeft:219},exports.KeyModifiers=H,exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:i,notifier:e})=>(u.useEffect(()=>{const t=A.Notifier.getOverrides();return A.Notifier.setOverrides(e),()=>{A.Notifier.setOverrides(t)}},[e]),u.createElement(At.Provider,{value:e},i)),exports.NotifierType=qe,exports.ReactErrorBoundary=({children:i})=>{const e=Ee(),t=u.useCallback(n=>{e.showError(n)},[e]);return b.jsx(Gn,{onError:t,children:i})},exports.ReactUtils=En,exports.RoundedTab=Xn,exports.ScrollPane=Gt,exports.ScrollUtils=In,exports.Scrollbar=Yt,exports.ScrollbarOrientation=ne,exports.SimpleCommand=Re,exports.SplitPane=Jn,exports.SplitPaneResizer=Zt,exports.ToolTipPlacement={BottomEnd:"bottom-end",BottomStart:"bottom-start",Bottom:"bottom",LeftEnd:"left-end",LeftStart:"left-start",Left:"left",RightEnd:"right-end",RightStart:"right-start",Right:"right",TopEnd:"top-end",TopStart:"top-start",Top:"top"},exports.UncaughtErrorBoundary=({children:i})=>{const e=Ee();return u.useEffect(()=>{const t=new qn(e);return()=>{t.cleanup()}},[e]),b.jsx(b.Fragment,{children:i})},exports.VirtualScrollbar=qt,exports.WalkingIcon=function(i){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:o=3,dashLength:r=5,iconKey:a,packKey:h,style:s,className:l,...c}=i,d=u.useMemo(()=>{if(!e)return;const m={"--walk-duration":`${n*(o+r)}ms`,"--walk-dash-length":`${r}px`,"--walk-dash-gap":`${o}px`};return t&&t!=="accent"&&(m["--icon-accent"]=`var(--icon-${t})`),m},[e,n,o,r,t]),f=u.useMemo(()=>e?l+" walking":l,[e,l]);return b.jsx(Lt,{iconKey:a,packKey:h,className:f,style:{...s,...d},...c})},exports.createDynamicIconService=Jt,exports.defaultCreateScrollCorner=Xt,exports.defaultCreateScrollEdgeButton=i=>{const{style:e,orientation:t=ne.Vertical,...n}=i,o=t===ne.Vertical,r=o?"rotate(90) ":"";return b.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${o?"vertical":"horizontal"} edge`,...n,children:b.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:r,children:b.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:i.disabled?0:1},d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})})})},exports.defaultCreateScrollEndButton=Vt,exports.defaultCreateScrollStartButton=Wt,exports.getDevicePixelRatio=function(i){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=i||{},o=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(o):o),t)},exports.toShortcutString=ye,exports.useCallbackRef=k,exports.useCommand=function(i,e=null){const t=u.useRef(e);t.current=e;const[n,o]=u.useReducer(a=>a+1,0),r=u.useMemo(()=>Array.isArray(i)?i:[i],[i]);return u.useEffect(()=>{if(!r||r.length===0)return;const a=(l,c)=>{t.current?.onChange?.(c),o()};let h=null;e&&(h={onExecute(l,c){t.current?.onExecute?.(l,c)},onError(l,c,d){t.current?.onError?.(l,c,d)}});const s=new Set;for(let l=0;l<r.length;l++)s.add(r[l]?.addPropertyListener(A.CommonUtils.debounce(a,0),!0)),e&&s.add(r[l]?.addExecuteListener(h));return()=>{s.forEach(l=>{l?.()})}},[i]),n},exports.useCommands=function(i,e=null,t=null,n){const o=u.useRef(t);o.current=t,e&&!Array.isArray(e)&&(e=[e]);const[r,a]=u.useState(Be(i,e)),h=n?[...n,i]:[i];return u.useEffect(()=>{const s={onGroupChange:()=>{const f=Be(i,e);a(f),o.current?.onChange?.(this)}};let l;e&&e.length>0&&(l={keys:e},s.onCommandChange=(f,m)=>{o.current?.onChange?.(i),a(Be(i,e))});const c=i?.addListener(s,l),d=Be(i,e);return a(d),o.current?.onChange&&o.current?.onChange(i),()=>{c?.()}},h),r},exports.useCopyPaste=i=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:o,commands:r}=i,a=Ee(),h=k(o,[o]),s=k(n,[n]),{getClipboard:l,refNativeCopy:c}=pt(),d=l();u.useMemo(()=>{const g=e?.element,x=t?.element??e?.element;if(!r)return;const w=[new Re("cut",g,{label:"Cut",description:"Remove the selection and put it on the clipboard so you can paste it somewhere else.",icon:"cut",shortcut:{key:"X",modifiers:[H.Ctrl]}}),new Re("copy",g,{label:"Copy",description:"Put a copy of the selection on the clipboard so you can paste it somewhere else.",icon:"copy",shortcut:{key:"C",modifiers:[H.Ctrl]}}),new Re("paste",x,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste",shortcut:[{key:"V",modifiers:[H.Ctrl]},{key:"F8",modifiers:[H.Ctrl]}]})];r?.addCommands(w,!0)},[r]);const f=k(async g=>{if(!e?.element)return;let x=null;try{x=e.doCopy?.(g),typeof x=="string"?await d.writeText(x):await d.writeReference(x)}catch(w){throw w}},[e,a]),m=k(async g=>{const x=e?.element?.();if(x){c.current={sourceElement:x,args:g};try{await f(g)}catch(w){a.showError?.(w)}}},[e?.element,a]),S=u.useCallback(()=>{m({isCut:!0})},[]),_=k(async(g,x,w)=>{try{if(await g.doPaste(x,w)===!1)return;s?.(x,w)}catch(z){a.showError?.(z)}},[s]),P=k(async(g,x,w)=>{const z=t?.element?.();if(z&&await A.CommonUtils.whenFocus(z),!g&&!x)return;const M=await a.showBusy?.("Pasting...");if(x)try{return await _(t,x,w),void M?.()}catch(C){M?.(),a.showError?.(C)}let K,N=t.importFromExternal;N||(N=(C,y)=>({getItemType:()=>"text",toText:()=>g.text,isClipboardItem:!0}));try{K=await N(g,{isCut:!1})}catch(C){M?.(),a.showError?.(C)}if(K)try{const C=await Promise.resolve(K);await _(t,C,w),M?.()}catch(C){M?.(),a.showError?.(C)}else M?.()},[_,t,a]),T=k(async g=>{if(t?.element)try{const x=await d.readReference();if(x)return void await P(null,x,g);const w=[];w[0]=await A.ClipboardUtils.readStringFromClipboard(d,A.MimeType.plain),w[1]=await A.ClipboardUtils.readHTMLFromClipboard(d,A.MimeType.html),w[2]=await A.ClipboardUtils.readBlobFromClipboard(d,A.MimeType.png);const z={text:w[0]??null,html:w[1]??null,image:w[2]??null};await P(z,null,g)}catch(x){if(x?.message==="Document is not focused.")return;a.showError?.(x)}},[P,t?.element,a]);return k(async g=>{},[e?.element]),k(async g=>{},[t?.element,P,a]),u.useEffect(()=>{if(!d)return;const g=async z=>{const M=await d.readReference();h?.(M)},x=z=>{a.showMessage?.(A.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},w=z=>{a.showMessage?.(A.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",g),d.addEventListener("clipboarderrorread",x),d.addEventListener("clipboarderrorwrite",w),()=>{d.removeEventListener("clipboardchange",g),d.removeEventListener("clipboarderrorread",x),d.removeEventListener("clipboarderrorwrite",w)}},[d,a]),u.useEffect(()=>{},[f,P,e,t]),u.useEffect(()=>{r?.getCommand("cut")?.updateCallback(S).update({disabled:!e||!t}),r?.getCommand("copy")?.updateCallback(m).update({disabled:!e}),r?.getCommand("paste")?.updateCallback(T).update({disabled:!t})},[e,t,r]),{paste:T,copy:m,clipboard:d}},exports.useDevicePixelRatio=function(i){const[e,t]=u.useState(typeof window<"u"?window.devicePixelRatio:1),n=u.useRef(null);return u.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const o=()=>{const r=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",o,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:r,listener:o}};return o(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[i]),e},exports.useEditMode=()=>{const i=mn();return u.useMemo(()=>({setMode:e=>{Rt(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>i}),[i])},exports.useFullscreenPortal=function(){const[i,e]=u.useState(!!document.fullscreenElement),t=u.useCallback(()=>{const n=document.fullscreenElement;return n?n.querySelector(".fullscreen-portal-root")||n:document.body},[]);return u.useEffect(()=>{function n(){const o=document.fullscreenElement;if(e(!!o),!o)return;let r=o.querySelector(".fullscreen-portal-root");r||(r=document.createElement("div"),r.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",o.appendChild(r))}return Oe++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Oe--,Oe<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(o=>{o.parentNode&&o.parentNode.removeChild(o)}),Oe=0)}},[]),{getPortalContainer:t,isFullscreen:i}},exports.useGlobalClipboard=pt,exports.useId=Tn,exports.useImperativeElement=Ue,exports.useMouseDownAndHoldListener=function(i,e){return ht({onPointerDown:i,onPointerMoveOrWait:(t,n,o)=>{i?.(o)},...e})},exports.useNotifier=Ee,exports.useOnClickOrFocusAway=function(i,e,t){const n=k(e,[e]);u.useEffect(()=>{const o=r=>{i.current&&!i.current.contains(r.target)&&n(r)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",o),document.addEventListener("touchstart",o)),t&&t.focusEvents===!1||document.addEventListener("focus",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o),document.removeEventListener("focus",o)}},[i])},exports.useSynchronizedPointerHandler=ht,exports.useTraceUpdate=function(i,e=!0){const t=u.useRef(i);u.useEffect(()=>{if(e){const n=Object.entries(i).reduce((o,[r,a])=>(t.current[r]!==a&&(o[r]=[t.current[r],a]),o),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=i})},exports.useUndoManager=({manager:i,commands:e,disabled:t})=>{const n=Ee(),o=k(a=>{try{i?.undo(a)}catch(h){n.error(h)}},[i]),r=k(a=>{try{i?.redo(a)}catch(h){n.error(h)}},[i]);return u.useMemo(()=>{if(!e)return;const a={contains:s=>!0,focus(){}},h=[new Ie("undo",a,{label:"Undo",description:gt,shortcut:{key:"z",modifiers:[H.Ctrl]},disabled:!0},o),new Ie("redo",a,{label:"Redo",description:yt,shortcut:[{key:"y",modifiers:[H.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[H.Alt]}],disabled:!0},r)];e?.addCommands(h,!0)},[e]),u.useEffect(()=>{if(!e)return;const a=()=>{const s=i?.getTopUndoDescription(),l={};var c;e.getCommand("undo").update({disabled:t||!i||!i.hasUndo(),description:s?(c=s,`Undo ${c}`):gt,state:l,context:{undoManager:i}});const d=i?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!i||!i.hasRedo(),description:d?Dn(d):yt,state:l,context:{undoManager:i}})};if(a(),!i)return;const h=i.addListener({onStackChange(){a()}});return()=>h?.()},[i,e,t]),{undo:o,redo:r}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { WalkingIcon as a } from "./index.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
4
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.10
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/esm/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { unstable_batchedUpdates as _n, createPortal as mn } from "react-dom";
|
|
|
5
5
|
import { DefaultNotifier as gn, Notifier as ye, CommonUtils as q, InternalClipboard as Ge, ClipboardUtils as tt, MimeType as nt } from "@sheetxl/utils";
|
|
6
6
|
import { createRoot as yn } from "react-dom/client";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
8
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.10
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1501,7 +1501,7 @@ function _o() {
|
|
|
1501
1501
|
} };
|
|
1502
1502
|
}
|
|
1503
1503
|
const Xe = _o();
|
|
1504
|
-
Xe.register("base", () => import("./
|
|
1504
|
+
Xe.register("base", () => import("./DRyP2NC3cYmWNj79.mjs"));
|
|
1505
1505
|
const Kt = (i) => C("svg", { ...i, children: C("path", {}) }), mo = { Icon: "_Icon_1ipwo_10" }, go = ve((i) => {
|
|
1506
1506
|
const { iconKey: e, packKey: t, className: n, style: o, role: r, title: a, size: h, ariaHidden: s, sourceProps: l, children: c, ...u } = i, [d, f] = se.useState(null);
|
|
1507
1507
|
se.useEffect(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.10
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.10
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1460,7 +1460,7 @@ function He() {
|
|
|
1460
1460
|
} };
|
|
1461
1461
|
}
|
|
1462
1462
|
const Re = He();
|
|
1463
|
-
Re.register("base", () => import("./
|
|
1463
|
+
Re.register("base", () => import("./ClIkEEc3keHubiqX.mjs"));
|
|
1464
1464
|
const Ne = (e2) => t("svg", { ...e2, children: t("path", {}) }), Ve = { Icon: "_Icon_1ipwo_10" }, We = _((e2) => {
|
|
1465
1465
|
const { iconKey: n2, packKey: i2, className: r2, style: s2, role: l2, title: a2, size: c2, ariaHidden: h2, sourceProps: u2, children: p2, ...f2 } = e2, [_2, m2] = o.useState(null);
|
|
1466
1466
|
o.useEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-react",
|
|
3
3
|
"description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.10",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sheetxl/utils": "^0.7.
|
|
43
|
+
"@sheetxl/utils": "^0.7.10",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"detect-it": "^4.0.1",
|
|
46
46
|
"react-merge-refs": "^3.0.2",
|