@sheetxl/utils-react 0.7.19 → 0.7.21

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.
@@ -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.19
2
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.21
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.
@@ -1,7 +1,7 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._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: calc(var(--icon-size, 1rem), * .875);--icon-size-md: var(--icon-size, 1rem);--icon-size-lg: calc(var(--icon-size, 1rem) * 1.25);--icon-size-xl: calc(var(--icon-size, 1rem) * 1.5)}._Icon_17dpm_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_17dpm_10 .sm{--font-size: var(--icon-size-sm)}._Icon_17dpm_10 .md{--font-size: var(--icon-size-md)}._Icon_17dpm_10 .lg{--font-size: var(--icon-size-lg)}._Icon_17dpm_10 .xl{--font-size: var(--icon-size-xl)}._Icon_17dpm_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_17dpm_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_17dpm_10 .fill,._Icon_17dpm_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_17dpm_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_17dpm_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_17dpm_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_17dpm_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_17dpm_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_17dpm_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_17dpm_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_17dpm_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_17dpm_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_17dpm_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_17dpm_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_17dpm_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_17dpm_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_17dpm_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_17dpm_10 .line:not(.fixed):not([stroke]){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_17dpm_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_17dpm_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_17dpm_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_17dpm_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}: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}:root .has-touch-thumb,:root .has-touch-thumb *{--scrollbar-size: 4px;--scrollbar-border-width: 0px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size)}:root{--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_gqxsx_24 ::-webkit-scrollbar-button{background:transparent}._scrollbar_gqxsx_24{display:flex;flex:1 1 100%;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_gqxsx_24 ._track_gqxsx_35{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_gqxsx_24 ._thumb_gqxsx_47{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_gqxsx_24 ._thumb_gqxsx_47:hover{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px);max-width:var(--scrollbar-width, 100%)}._scrollbar_gqxsx_24.vertical ._thumb_gqxsx_47{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.vertical ._track_gqxsx_35{width:100%}._scrollbar_gqxsx_24.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px);max-height:var(--scrollbar-height, 100%)}._scrollbar_gqxsx_24.horizontal ._thumb_gqxsx_47{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.horizontal ._track_gqxsx_35{height:100%}._scrollbar_gqxsx_24.dragging ._thumb_gqxsx_47{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.vertical{width:var(--scrollbar-width)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.horizontal{height:var(--scrollbar-height)}._touch-thumb_gqxsx_124{position:absolute;cursor:grab;pointer-events:all;transition-property:opacity;border-radius:9999px;will-change:opacity;opacity:.7}._touch-thumb_gqxsx_124:hover,._touch-thumb_gqxsx_124.dragging{opacity:1}._scrollpane_1fbi8_2{position:relative;display:flex}._vertical-container_1fbi8_7{display:flex;flex:0}._horizontal-corner-container_1fbi8_12{display:flex;flex:none;flex-direction:row;align-items:stretch;justify-content:center}._horizontal-container_1fbi8_20{display:flex;flex:1 1 100%;flex-direction:column}._scrollbar-sizer_1fbi8_26{display:flex;flex:1 1 100%;align-items:stretch;justify-content:stretch}._scrollpane-content_1fbi8_34{position:relative;width:100%;flex:1 1 100%;display:flex;flex-direction:column;box-sizing:border-box}._scrollpane-content-element_1fbi8_43{display:flex;flex:1 1 100%;overflow:hidden}")),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.19
3
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.21
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 $=require("@sheetxl/utils"),u=require("react"),S=require("react/jsx-runtime"),gn=require("react-dom/client"),Nt=require("react-dom"),Y={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"};class Ye{constructor(e,t,n,r){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=r,r===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 r=null;if(typeof n=="function"){const i=t??this._context;r=n(typeof i=="function"?i():i)}else r=n;return r}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 r=this._callback.bind(this)(e,this);if(await Promise.resolve(r)===!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(r=>{r.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(r=>{let i=e[r];n["_"+r]!==i&&(n["_"+r]=t[r]=i)}),t}}class We extends Ye{}var ee=typeof window<"u"?window:{screen:{},navigator:{}},xe=(ee.matchMedia||function(){return{matches:!1}}).bind(ee),Kt=!1,yn={get passive(){return Kt=!0}},bt=function(){};ee.addEventListener&&ee.addEventListener("p",bt,yn),ee.removeEventListener&&ee.removeEventListener("p",bt,!1);var vn=Kt,bn="PointerEvent"in ee,pt="ontouchstart"in ee,Ht=pt||"TouchEvent"in ee&&xe("(any-pointer: coarse)").matches,wt=(ee.navigator.maxTouchPoints||0)>0||Ht,Wt=ee.navigator.userAgent||"",wn=xe("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Wt)&&Math.min(ee.screen.width||0,ee.screen.height||0)>=768,Ft=(xe("(pointer: coarse)").matches||!xe("(pointer: fine)").matches&&pt)&&!/Windows.*Firefox/.test(Wt),xn=xe("(any-pointer: fine)").matches||xe("(any-hover: hover)").matches||wn||!pt,ct=!wt||!xn&&Ft?wt?"touchOnly":"mouseOnly":"hybrid",Sn=ct==="mouseOnly"?"mouse":ct==="touchOnly"||Ft?"touch":"mouse";const En=Object.freeze(Object.defineProperty({__proto__:null,deviceType:ct,primaryInput:Sn,supportsPassiveEvents:vn,supportsPointerEvents:bn,supportsTouchEvents:Ht},Symbol.toStringTag,{value:"Module"})),Cn=new Set(["INPUT","TEXTAREA","SELECT"]),Ut={};function ke(){return En}const Vt=o=>o==="BracketLeft"?"[":o==="BracketRight"?"]":$.CommonUtils.camelToPrettyCase(o),qe=(o,e)=>{let t=!1,n=!1;const r={nativeEvent:o,currentTarget:e||o.currentTarget,target:o.target,bubbles:o.bubbles,cancelable:o.cancelable,defaultPrevented:o.defaultPrevented,eventPhase:o.eventPhase,isTrusted:o.isTrusted,preventDefault:()=>{t=!0,o.preventDefault()},isDefaultPrevented:()=>t,stopPropagation:()=>{n=!0,o.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:o.timeStamp,type:o.type};for(const i in o)i in r||typeof o[i]=="function"||(r[i]=o[i]);return r},Mn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Ut,boundPixel:function(o,e=!1,t=0){return o},createSyntheticEvent:qe,detectIt:ke,focusableNodeNames:Cn,toPrettyKeyCode:Vt},Symbol.toStringTag,{value:"Module"}));class _t{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=$.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=(r,i)=>{const a=n._root._listenersByKey,h=i.key(),l=a.get(h);l&&n._notifyCommands(l,"onCommandChange",i)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let r=n,i=n===this;for(;!i&&r;)r===this&&(i=!0),r=r._parent;return(i?n:this)._getCommand(e)}createChildGroup(e,t,n){let r;if(!n){let h=this;for(;h&&!r;){let l=h._nodes.get(t);l&&(r=l),h=h._parent}}r||(r=new _t(e,t),r._parent=this,r._root=this._root,r._unListenersByCommand=null,r._listenersByKey=null,r._commandsPropertyListener=null);const i=(h,l)=>{!h.has(t)||n?h.set(t,l):n===void 0&&console.warn("commandGroup already registered",t)};i(this._root._nodes,r);let a=this._parent;for(;a;)i(this._nodes,r),a=a._parent;return this._children.set(t,r),this._notify("onGroupChange"),r}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,r=this._commandsByShortcut,i=this._root._commandsPropertyListener,a=this._root._unListenersByCommand;for(let h=0;h<e.length;h++){const l=e[h],s=l.key();if(n.has(s)&&!t){t===void 0&&console.warn("command already registered",s);continue}n.set(s,l);let c=a.get(l);c&&(c(),a.delete(l));const d=l.addPropertyListener(i);a.set(l,d);const f=l.shortcut();if(!f)continue;const p=Array.isArray(f)?f:[f];for(let _=0;_<p.length;_++){const m=be(p[_]),E=r.get(m);E&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${m}, ${s}, ${E}.`),r.set(m,s)}}}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 r=i=>{i._children.forEach(a=>{for(let h=0;h<t.length;h++)a._nodes.delete(t[h]);r(a)})};r(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(Y.Alt),e.shiftKey&&t.push(Y.Shift),e.ctrlKey&&t.push(Y.Ctrl),e.metaKey&&t.push(Y.Meta);let n=be({key:e.code,modifiers:t});const r=this._commandsByShortcut;let i=r.get(n);i||(n=be({key:e.key,modifiers:t}),i=r.get(n)),!i&&e.code.startsWith("Digit")&&(n=be({key:e.code.substring(5,e.code.length),modifiers:t}),i=this._commandsByShortcut.get(n)),!i&&e.code.startsWith("Key")&&(i=be({key:e.code.substring(3,e.code.length),modifiers:t}),i=r.get(n));let a=null;return i&&(a=this._commandsByKey.get(i),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,r=t?.keys,i=this._root._listenersByKey;if(r&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let a=null;if(r)for(let h=0;h<r.length;h++){const l=r[h];if(!l)continue;let s=i.get(l);s||(s=new Set,i.set(l,s)),a||(a=[]),a.push(s),s.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 r=this;setTimeout(()=>{e.forEach(i=>{i[t]?.(r,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(r=>{r[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 Ln=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Tn=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"⌘":"^",be=(o,e=!1)=>{const t={};for(let r=0;o.modifiers&&r<o.modifiers.length;r++)t[o.modifiers[r]]=!0;let n="";return(t?.[Y.Ctrl]||t?.[Y.Meta])&&(n+=(n.length>0?"+":"")+(e?Tn:Ln)),t?.[Y.Alt]&&(n+=e?"⌥":"Alt"),t?.[Y.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+Vt(o.key),n},Fe=(o,e)=>{if(!e||!o||e.length===0)return $.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const i=e[r],a=i?o.getCommand(i):null;n[r]=a}return n};function it(o,e){if(typeof o=="function")return o(e);o&&(o.current=e)}var Se=parseInt(u.version.split(".")[0],10)>=19?function(o){return e=>{const t=[];for(const n of o){const r=it(n,e),i=typeof r=="function";t.push(i?r:()=>it(n,null))}return()=>{for(const n of t)n()}}}:function(o){return e=>{for(const t of o)it(t,e)}};const kn=u.memo(u.forwardRef((o,e)=>{const{refFocusStart:t,...n}=o,r=u.useRef(null),i=u.useCallback(()=>{if(t)return void t?.current?.focus();const a=r.current.parentElement.children;let h=[];const l=a.length;for(let s=0;s<l&&a[s]!==r.current;s++){const c=a[s],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(s,c){return s.tabindex-c.tabindex}),h[0].child.focus())},[t]);return S.jsx("div",{tabIndex:0,ref:Se([r,e]),onFocus:i,...n})}));var Pn=function(){},Xt=typeof window<"u",Dn=Xt?u.useLayoutEffect:u.useEffect,xt={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const me=Xt&&window.ResizeObserver!==void 0?function(){var o=u.useState(null),e=o[0],t=o[1],n=u.useState(xt),r=n[0],i=n[1],a=u.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var l=h[0].contentRect,s=l.x,c=l.y,d=l.width,f=l.height,p=l.top,_=l.left,m=l.bottom,E=l.right;i({x:s,y:c,width:d,height:f,top:p,left:_,bottom:m,right:E})}})},[]);return Dn(function(){if(e)return a.observe(e),function(){a.disconnect()}},[e]),[t,r]}:function(){return[Pn,xt]},An=u.memo(u.forwardRef((o,e)=>{const{className:t,style:n,children:r,radius:i=4,strokeWidth:a=1,strokeColor:h="grey",...l}=o,[s,{width:c,height:d}]=me(),f=u.useRef(null),p=(T,v=0)=>{const g=T/2,b=d-g+v;return(function(j,C,B=!1){if(C===0)return j;function O(P,y,z){let K=y.x-P.x,U=y.y-P.y,A=Math.sqrt(K*K+U*U);return L(P,y,Math.min(1,z/A))}function L(P,y,z){return{x:P.x+(y.x-P.x)*z,y:P.y+(y.y-P.y)*z}}function w(P,y){P.length>2&&(P[P.length-2]=y.x,P[P.length-1]=y.y)}function k(P){return{x:parseFloat(P[P.length-2]),y:parseFloat(P[P.length-1])}}let M=j.split(/[,\s]/).reduce(function(P,y){let z=y.match("([a-zA-Z])(.+)");return z?(P.push(z[1]),P.push(z[2])):P.push(y),P},[]).reduce(function(P,y){return parseFloat(y)==y&&P.length?P[P.length-1].push(y):P.push([y]),P},[]),I=[];if(M.length>1){let P=k(M[0]),y=null;M[M.length-1][0]==="Z"&&M[0].length>2&&(y=["L",P.x,P.y],M[M.length-1]=y),I.push(M[0]);for(let z=1;z<M.length;z++){let K=I[I.length-1],U=M[z],A=U===y?M[1]:M[z+1];if(A&&K&&K.length>2&&U[0]==="L"&&A.length>2&&A[0]==="L"){let W,H,V=k(K),J=k(U),pe=k(A);B?(W=L(J,K.origPoint||V,C),H=L(J,A.origPoint||pe,C)):(W=O(J,V,C),H=O(J,pe,C)),w(U,W),U.origPoint=J,I.push(U);let ae=L(W,J,.5),_e=L(J,H,.5),ce=["C",ae.x,ae.y,_e.x,_e.y,H.x,H.y];ce.origPoint=J,I.push(ce)}else I.push(U)}if(y){let z=k(I[I.length-1]);I.push(["Z"]),w(I[0],z)}}else I=M;return I.reduce(function(P,y){return P+y.join(" ")+" "},"")})(`${`M 0 ${g} L ${i-.5} ${g} L ${i-.5} ${b} L ${2*i} ${b}`} ${`L ${c-2*i} ${b}`} ${`M ${c-2*i} ${b} L ${c-i} ${b} L ${c-i} ${g} L ${c} ${g}`}`,i)},_=u.useMemo(()=>p(a),[c,d,i,a]),m=u.useMemo(()=>{if(i===0)return;const T=i/2;return p(i)+`L ${c} 0 L 0 0 L 0 ${T}`},[_,i,a]),E=u.useMemo(()=>({style:{clipPath:`path('${m}')`}}),[m]);return S.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...l,ref:Se([f,s,e]),children:[u.isValidElement(r)?u.cloneElement(r,E):S.jsx(S.Fragment,{}),S.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:c,height:d,viewBox:`0 0 ${c} ${d}`,children:S.jsx("path",{d:_,stroke:h,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:a})})]})})),ut={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Yt extends $.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!==ut.Warning?t?.type!==ut.Error?$.Notifier.log(e):$.Notifier.error(e):$.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(r=>{r(()=>{})})}showWindow(e,t){const n=this.getDelegate();if(n?.showWindow)return n.showWindow(e,t)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):$.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInput(e){const t=this.getDelegate();return t?.showInput?t.showInput(e):Promise.resolve({input:"",option:""})}}const zn=new Yt,qt=u.createContext(zn),Me=()=>u.useContext(qt),Rn=3,jn=.5,Bn=50,st=o=>({x:o.x,y:o.y,width:o.width,height:o.height,top:o.top,left:o.left,right:o.right,bottom:o.bottom});function Gt(o={}){const{threshold:e=jn,stillnessThreshold:t=Rn,maxHierarchyDepth:n=Bn}=o,[r,i]=me(),a=u.useRef(null),[h,l]=u.useReducer(_=>_+1,0),s=u.useRef(void 0),c=u.useRef({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0}),d=u.useCallback(_=>{a.current=_,typeof r=="function"&&r(_)},[r]),[f,p]=u.useState(i);return u.useEffect(()=>{i&&!f&&p(i)},[i,f]),u.useEffect(()=>{const _=a.current;if(!_)return;let m=!1,E=0;const T=()=>{if(!_)return;const C=_.getBoundingClientRect(),B=c.current;Math.abs(C.x-B.x)>e||Math.abs(C.y-B.y)>e||Math.abs(C.width-B.width)>e||Math.abs(C.height-B.height)>e?(m||(m=!0,p(st(C)),l()),E=0):E++,m&&E>=t&&(m=!1,p(st(C)),l()),c.current=st(C),s.current=requestAnimationFrame(T)};s.current=requestAnimationFrame(T);const v=C=>{m=!0,l()},g=C=>{m=!1,E=t,l()};let b=_;const j=[];for(;b&&b!==document.documentElement&&(b.addEventListener("animationstart",v,!0),b.addEventListener("animationend",g,!0),b.addEventListener("transitionstart",v,!0),b.addEventListener("transitionend",g,!0),j.push(b),b=b.parentElement,!(j.length>n)););return()=>{s.current&&cancelAnimationFrame(s.current),j.forEach(C=>{C.removeEventListener("animationstart",v,!0),C.removeEventListener("animationend",g,!0),C.removeEventListener("transitionstart",v,!0),C.removeEventListener("transitionend",g,!0)})}},[h,i,e,t,n]),[d,f]}const D=(o,e)=>{const t=u.useCallback((...i)=>o?.(...i),e),n=u.useRef(null);n.current=t;const r=u.useCallback((...i)=>n.current?.(...i),[]);if(n.current)return r};let Ue=0;function Zt(){const[o,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 r=document.fullscreenElement;if(e(!!r),!r)return;let i=r.querySelector(".fullscreen-portal-root");i||(i=document.createElement("div"),i.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",r.appendChild(i))}return Ue++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Ue--,Ue<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)}),Ue=0)}},[]),{getPortalContainer:t,isFullscreen:o}}function ht(o){if(!o)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:r=!1,consumeTouch:i=!0}=o,a=D(e,[e]),h=D(t,[t]),l=D(n,[n]),s=u.useRef(!1),c=o?.timerInitial??230,d=o?.timerContinuous??c/2,f=u.useRef(null),p=u.useRef(null),_=u.useRef(null),m=u.useRef(null),E=u.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),T=u.useCallback(w=>{m.current=setTimeout(()=>{window.requestAnimationFrame(()=>{if(s.current===!1)return;const k=p.current,M=f.current,I=qe(k,M.currentTarget);l?.(I,_.current,M)}),T(d)},w??c)},[]);u.useEffect(()=>()=>E(),[]);const v=r?"pointer":"mouse",g=u.useCallback(w=>{w.stopPropagation(),w.stopImmediatePropagation(),w.preventDefault()},[]),b=D(w=>{document.removeEventListener(`${v}move`,B),document.removeEventListener(`${v}up`,b),document.removeEventListener("keydown",O),document.removeEventListener("keyup",L),document.removeEventListener("touchstart",g,{capture:!0}),document.removeEventListener("touchmove",g,{capture:!0}),window.removeEventListener("blur",j),E(),window.requestAnimationFrame(()=>{if(s.current===!1)return;s.current=!1;const k=w,M=f.current,I=qe(k,M.currentTarget);h?.(I,_.current,M),_.current=null})},[]),j=u.useCallback(()=>{s.current!==!1&&(s.current=!1,b(p.current))},[]),C=D(()=>{E(),T(d),window.requestAnimationFrame(()=>{if(s.current===!1)return;const w=p.current,k=f.current,M=qe(w,k.currentTarget);l?.(M,_.current,k)})},[d]),B=D(w=>{p.current=w,C()},[]),O=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},C()},[]),L=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},C()},[d]);return D(w=>{w.isDefaultPrevented()||(_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},a(w,_.current)!==!1&&(f.current=w,p.current=w.nativeEvent,document.addEventListener(`${v}up`,b,{passive:!1}),document.addEventListener(`${v}move`,B,{passive:!1}),document.addEventListener("keydown",O,{passive:!1}),document.addEventListener("keyup",L,{passive:!1}),window.addEventListener("blur",j,{passive:!0}),r&&i&&(document.addEventListener("touchstart",g,{passive:!1,capture:!0}),document.addEventListener("touchmove",g,{passive:!1,capture:!0})),s.current=!0,T(c)))},[c,r])}const On=({initValue:o,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(o);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const r=e();return u.useLayoutEffect(()=>{n.current!==r&&(n.current=r,t(r))},[t,r]),null},dt=o=>{console&&console.warn&&console.warn(o)},lt=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let In=1,ft=!1,Jt=!1;const Ge=[],we=[],Je=()=>{we.forEach(o=>o())},$n=({automaticContainerInternalUseOnly:o})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,o||ft!==!1||(Jt=!0),u.useEffect(()=>{let r=!0;function i(){if(r)return we[0]!==i?(o||ft!==!0||dt("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([...Ge])}return we.push(i),Je(),()=>{r=!1,n.current?.length>0&&dt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),we.splice(we.indexOf(i),1),Je()}},[o]),S.jsx(S.Fragment,{children:e.map(({hook:r,key:i})=>u.createElement(On,{...r,key:i}))})},Nn=o=>{const e=In++;return Ge.push({hook:o,key:e}),we.length===0&&Jt===!1&&(ft=!0,(t=>{if(lt.document&&lt.document.createElement){const n=lt.document.createElement("div");gn.createRoot(n).render(S.jsx(t,{automaticContainerInternalUseOnly:!0}))}else dt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})($n)),Je(),()=>{Ge.splice(Ge.findIndex(t=>t.key===e),1),Je()}};let mt=null;mt||(mt=(o,e,t={})=>{let n,r,i=!1,a=!1,h=[],{unmountIfNoConsumers:l=!1}=t;const s=d=>{var f;r=d,f=()=>h.forEach(p=>p(d)),Nt.unstable_batchedUpdates(f)},c=()=>(a||(r=typeof o=="function"?o():o,a=!0),r);return()=>{const[d,f]=u.useState(c);return u.useEffect(()=>(i||(i=!0,n=Nn({initValue:o,useHookBody:e,applyStateChange:s})),h.push(f),r!==d&&f(r),()=>{h.splice(h.indexOf(f),1),h.length===0&&l&&(n(),i=!1)}),[]),d}});const Qt=mt;let en=()=>{console.warn("You must call useEditMode before setting its state.")};const Kn=Qt(null,()=>{const[o,e]=u.useState(null);return en=e,o}),St=Qt({setClipboard:o=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>$.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[o,e]=u.useState($.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>o,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let at=!1,Hn=0;var Wn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const Et=()=>"sheetxl-ui-"+Hn++,Ct=u.useId,Fn=Ct??function(){const[o,e]=u.useState(()=>at?Et():void 0);return Wn(()=>{o==null&&e(Et())},[]),u.useEffect(()=>{at||(at=!0)},[]),o},Un=[];function Qe(o,e,t=Un){const n=u.useRef(null);return u.useImperativeHandle(o,()=>{if(!n.current)return;const r=n.current,i=e?.();if(!i||typeof i!="object")throw new Error("attributes must return a plain object of values");const a=Object.keys(i),h=a.length;for(let l=0;l<h;l++){const s=a[l],c=i[s];Object.defineProperty(r,s,{value:c,writable:!0,configurable:!0,enumerable:!0})}return r},t),n}const Mt="Undo the last action.",Lt="Repeat the last action or undo the redo.",Vn=o=>`Redo ${o}`;class Xn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class Yn{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)}}function tn(o){var e,t,n="";if(typeof o=="string"||typeof o=="number")n+=o;else if(typeof o=="object")if(Array.isArray(o)){var r=o.length;for(e=0;e<r;e++)o[e]&&(t=tn(o[e]))&&(n&&(n+=" "),n+=t)}else for(t in o)o[t]&&(n&&(n+=" "),n+=t);return n}function X(){for(var o,e,t=0,n="",r=arguments.length;t<r;t++)(o=arguments[t])&&(e=tn(o))&&(n&&(n+=" "),n+=e);return n}const qn={},nn=o=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:r=0,paddingAfter:i=0,disabled:a,key:h,hitAreaProps:l=qn,...s}=o,c=n==="row",{style:d,className:f,...p}=l;return S.jsx("div",{style:{...t,position:"relative"},...s,children:S.jsx("div",{className:X("hit-box",f),style:{left:(c?-r:0)+"px",width:`calc(100% + ${c?r+i:0}px)`,top:(c?0:-r)+"px",height:`calc(100% + ${c?0:r+i}px)`,position:"absolute",...d},onPointerDown:a?void 0:e,...p})},h)},Ve={},de=(o,e,t=!0)=>o===null?null:o.pixels!==null?t?o.pixels:e-o.pixels:(t?o.percent:100-o.percent)/100*e,Xe=(o,e=!0)=>o?.percent?`${e?o.percent:100-o.percent}%`:o?.pixels?`${o.pixels}px`:void 0,se=(o,e)=>{if(o==null)return null;const t={percent:null,pixels:null};let n=e;return typeof o=="string"&&((o=o.trim().toLowerCase()).endsWith("px")?(o=o.substring(0,o.length-2),n=!1):o.endsWith("%")&&(o=o.substring(0,o.length-1),n=!0),o=parseFloat(o)),n?t.percent=o:t.pixels=o,Object.freeze(t)},on=u.memo(u.forwardRef((o,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:r="row",fixedPane:i=null,position:a,onPositionChange:h,minBefore:l,maxBefore:s,minAfter:c,maxAfter:d,children:f,className:p,style:_,disabled:m=!1,onDragStart:E,onDragResize:T,onDragFinish:v,resizerProps:g=Ve,paneProps:b=Ve,paneBeforeProps:j=Ve,paneAfterProps:C=Ve,createResizer:B=nn}=o;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const O=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),L=u.useMemo(()=>{let R=null;i&&(i==="before"?R=0:i==="after"&&(R=1));const F=R===null;return{fixedPaneOffset:R,isPercent:F,minBefore:se(l,F),maxBefore:se(s,F),minAfter:se(c,F),maxAfter:se(d,F)}},[l,s,c,d]),w=D(h,[h]),[k,M]=u.useState(()=>se(a,i===null));u.useEffect(()=>{M(se(a,i===null))},[a,i]);const[I,{width:P,height:y}]=me(),[z,{width:K,height:U}]=me(),A=r==="row"?K:U,W=r==="row"?P:y,H=u.useMemo(()=>((R,F,Q,G)=>{const re=[null,null],oe=[null,null];if(R||(R={percent:G.fixedPaneOffset===null?50:null,pixels:G.fixedPaneOffset===null?null:0}),F===0)return R?.pixels!=null?G.fixedPaneOffset!==1?(re[0]=R?.pixels,oe[1]=100):(re[1]=R?.pixels-Q,oe[0]=100):R?.percent!=null&&(G.fixedPaneOffset!==1?(oe[0]=R?.percent,oe[1]=100-R?.percent):(oe[1]=R?.percent,oe[0]=100-R?.percent)),{percents:oe,pixels:re,minBefore:Xe(G.minBefore,!0),maxBefore:Xe(G.maxBefore,!0),minAfter:Xe(G.minAfter),maxAfter:Xe(G.maxAfter)};let ie=de(R,F,G.fixedPaneOffset!==1),te=F-Q,gt=de(G.minBefore,te,!0)??0,pn=de(G.maxBefore,te,!0)??te,He=0,rt=0,yt=0,vt=te;He=(de(G.maxAfter,F,!1)??Q)-Q,rt=de(G.minAfter,F,!1)??F,yt=Math.max(gt,He),vt=Math.min(pn,rt),ie=Math.max(yt,Math.min(ie,vt)),rt=Math.min(te-ie,de(G.maxAfter,te-ie,!0)??te),He=Math.min(te-ie,de(G.minAfter,te-ie,!0)??te),re[0]=ie,re[1]=te-re[0];const _n=Math.max(0,Math.min(100,ie/te*100));return oe[0]=_n,oe[1]=100-oe[0],{percents:oe,pixels:re,minBefore:`${gt}px`,minAfter:`${He}px`,maxBefore:`${re[0]}px`,maxAfter:`${re[1]}px`}})(k,W,A,L),[L,k,W,A,r]),[V,J]=u.useState(!1),pe=D(E,[E]),ae=D(T,[T]),_e=D(v,[v]),ce=u.useRef(null),et=u.useRef(null),De=u.useRef(null),{style:tt,className:Ae,...ze}=b,Re={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...tt},{className:nt,style:je,...Be}=j,{className:Oe,style:Ie,...ge}=C,Ee={flex:"1 1 100%",width:"100%",..._,flexDirection:r,display:"flex"},{className:ne,style:ye,onPointerDown:$e,...Ne}=g,Ce=D(R=>{const F=se(R,i===null);M(F)},[i]),x=D(R=>{if(m||!V)return;const F=ue.current?.getBoundingClientRect();let Q=0;Q=r==="row"?(R.clientX??R.touches?.[0]?.clientX)-F.x:(R.clientY??R.touches?.[0]?.clientY)-F.y,Q=Math.max(0,Math.min(W,Q)),L.fixedPaneOffset===1&&(Q=W-Q),a&&k.pixels===Q||M({pixels:Q,percent:null}),ae?.(Q),R.stopPropagation(),R.preventDefault()},[L,r,m,V,k,W]),N=D(R=>{if(document.removeEventListener("pointermove",x),document.removeEventListener("touchmove",x),document.removeEventListener("pointerup",N),!!V&&(J(!1),!!k)){if(_e(k.pixels),!se(a,i===null)||k.pixels!==a){const F={...k};F.percent===null&&(F.percent=F.pixels/W*100),w(F)}R.stopPropagation(),R.preventDefault()}},[k,V,a,i,W]),q=D(R=>{$e?.(R),R.defaultPrevented||m||V||(J(!0),pe(),document.addEventListener("pointermove",x,{passive:!1}),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("pointerup",N,{passive:!1}))},[$e]),ue=Qe(e,()=>({setPosition:Ce,isSplitPane:()=>!0}),[]),ve=u.useMemo(()=>O?B?.({key:"resizer",ref:Se([z,et]),className:X("resizer",ne),onPointerDownCapture:q,style:{cursor:m?void 0:r==="row"?"ew-resize":"ns-resize",minWidth:r==="row"?"2px":void 0,minHeight:r!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...ye},splitDirection:r,disabled:m,...Ne}):null,[O,ne,Ne,r,ye,m]),he=r==="row"?"Width":"Height",ot=u.useMemo(()=>{if(!t)return null;const R={...Re,...je,flex:L.fixedPaneOffset===0&&H?.pixels[0]!==null?`0 0 ${Math.round(H?.pixels[0])}px`:`1 1 ${Math.round(H?.percents[0]??100)}%`,[`min${he}`]:H?.minBefore,[`max${he}`]:n?H?.maxBefore:"100%"};return S.jsx("div",{ref:ce,className:X("before",Ae,nt),style:R,...ze,...Be,children:t},"before")},[t,b,j,L,H]),Ke=u.useMemo(()=>{if(!n)return null;const R={...Re,...Ie,flex:L.fixedPaneOffset===1&&H?.pixels[1]!==null?`0 0 ${Math.round(H?.pixels[1])}px`:`1 1 ${Math.round(H?.percents[1]??100)}%`,[`min${he}`]:H?.minAfter,[`max${he}`]:t?H?.maxAfter:"100%"};return S.jsx("div",{ref:De,className:X("after",Ae,Oe),style:R,...ze,...ge,children:n},"after")},[n,b,C,L,H]);return S.jsxs("div",{ref:Se([I,ue]),className:X("splitPane",r==="row"?"vertical":"horizontal",{dragging:V},p),style:Ee,children:[ot,ve,Ke]})}));function Gn(o){if(typeof o=="function")return o;if(typeof o=="string"){const e=o.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const r=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!r)return null;const i=r[1]||"",a=r[2]||"";try{if(/;base64/i.test(i)){if(typeof atob<"u"){const h=atob(a),l=h.length;if(typeof TextDecoder<"u"){const c=new Uint8Array(l);for(let d=0;d<l;d++)c[d]=h.charCodeAt(d);return new TextDecoder("utf-8").decode(c)}let s="";for(let c=0;c<l;c++)s+=`%${h.charCodeAt(c).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 Pt(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return Pt(e);if(/^<\s*path\b/i.test(e)){const t=Tt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(o)){const e=[];for(const t of o)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const r=Tt(n);r&&e.push({d:r})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return o}function Tt(o){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);return e?e[1]??e[2]??null:null}function kt(o){if("svg"in o)return{...o,svg:Gn(o.svg)};if("url"in o){const e=typeof o.url=="string"?{src:o.url}:o.url;return{...o,url:e}}if("emoji"in o){const e=typeof o.emoji=="string"?o.emoji:o.emoji.text;return{...o,emoji:e}}return o}function Pt(o){try{if(typeof DOMParser<"u"){const a=new DOMParser().parseFromString(o,"image/svg+xml"),h=a.querySelector("svg"),l=h?.getAttribute("viewBox")??void 0,s=[];return a.querySelectorAll("path").forEach(c=>{const d=c.getAttribute("d");if(!d)return;const f={d},p=c.getAttribute("class");p&&(f.className=p);const _=c.getAttribute("fill");_&&_!=="none"&&(f.fill=_);const m=c.getAttribute("stroke");m&&(f.stroke=m);const E=c.getAttribute("opacity");E&&(f.opacity=Number(E));const T=c.getAttribute("fill-rule");T&&(f.fillRule=T);const v=c.getAttribute("clip-rule");v&&(f.clipRule=v),s.push(f)}),{viewBox:l,paths:s}}}catch{}const e=o.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],r=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let i;for(;i=r.exec(o);)n.push({d:i[1]});return{viewBox:t,paths:n}}function Dt(o){const e={};for(const[i,a]of Object.entries(o.icons))e[i]=kt(a);const t={label:o.meta?.label??"Unnamed",version:o.meta?.version??"1.0.0",license:o.meta?.license??"MIT",defaultViewBox:"0 0 24 24",extends:o.meta?.extends??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},r=o.overrides;if(r){const i={};for(const[a,h]of Object.entries(r)){const l={};for(const[s,c]of Object.entries(h))l[s]=kt(c);i[a]=l}n.__overrides=i}return n}function rn(){const o=new Map,e=new Map;let t="base",n=new Map;async function r(l){const s=o.get(l??t);if(!s)throw new Error(`Icon pack not registered: ${l}`);if(!s.pack){if(!s.loading){if(!s.loader)throw new Error(`No loader for icon pack: ${l}`);s.loading=s.loader().then(c=>{const d=c&&typeof c=="object"&&"default"in c?c.default:c;s.pack=Dt(d)}).catch(c=>{throw s.loading=void 0,c})}await s.loading}}function i(l){const s=l.indexOf(":");return s>0?{ns:l.slice(0,s),key:l.slice(s+1)}:{key:l}}function a(l,s){const c=[l,...o.get(l)?.pack?.meta.extends??[]];for(const d of c){const f=o.get(d);if(!f?.pack)continue;const{icons:p}=f.pack,_=p[e.get(d)?.get(s)??s]??p[s];if(_)return{glyph:_,pack:f.pack,packKey:d}}return null}function h(l,s){const c=s?.packKey??t;if(s?.packKey)return a(s.packKey,l);if(!l)return null;const{ns:d,key:f}=i(l);if(d){const p=o.get(d)?.pack;if(p){if(o.get(t)?.pack){const m=p.__overrides,E=m?.[t]?.[f];if(E)return{glyph:E,pack:p,packKey:d}}const _=a(d,f);if(_)return _}return null}return a(c,l)}return{register:function(l,s){const c=o.get(l)??{};typeof s=="function"?c.loader=s:c.pack=Dt(s),o.set(l,c),t||(t=l)},prefetch:async function(l=t){const s=Array.isArray(l)?l:[l];await Promise.all(s.map(r))},setActive:function(l){t=l;for(const s of n.keys())try{s(l)}catch{}},getActive:function(){return t},resolve:async function(l,s){let c=h(l,s);if(c)return c;const d=s?.packKey??t,{ns:f}=i(l);if(s?.packKey){if(await r(d),c=h(l,s),c)return c;const p=o.get(d)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),c=h(l,s),c))return c}else if(f){if(await r(f),c=h(l,s),c)return c;const p=o.get(f)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),c=h(l,s),c))return c}else{if(await r(d),c=h(l,s),c)return c;const p=o.get(d)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),c=h(l,s),c))return c}return null},registerAlias:function(l,s,c){e.has(l)||e.set(l,new Map),e.get(l).set(s,c)},has:function(l,s){return!!h(l,s)},getPack:function(l){return o.get(l??t)?.pack},hasPack:function(l){return!!o.get(l)?.pack},listPacks:function(){return Array.from(o.keys())},listIcons:function(l){const s=o.get(l)?.pack;return s?Object.keys(s.icons):[]},addActiveListener:function(l){const s=n.get(l);if(s)return s;const c=()=>{n.delete(l)};return n.set(l,c),c}}}on.displayName="SplitPane";const Te=rn();Te.register("base",()=>Promise.resolve().then(()=>require("./CLRMmhKU4QmUR8pR.cjs")));const At=o=>S.jsx("svg",{...o,children:S.jsx("path",{})}),Zn={Icon:"_Icon_17dpm_10"},zt=u.memo(o=>{const{iconKey:e,packKey:t,className:n,style:r,role:i,title:a,size:h,ariaHidden:l,sourceProps:s,children:c,...d}=o,[f,p]=u.useState(null);u.useEffect(()=>{let M=!0,I=t,P=e;if(!P){const y=Te.getPack(I);return void p({glyph:y?{svg:$.CommonUtils.EmptyArray}:void 0,pack:y??void 0,packKey:I??Te.getActive()})}if(P.includes(":")){const[y,z]=P.split(":");I=y,P=z}return Te.resolve(P,{packKey:I}).then(y=>{M&&p(y)}),()=>{M=!1}},[e,t]);const _=f?.pack,m=f?.glyph,E=f?.packKey;let T=m?m.svg:void 0;const v=m&&!T?m.url:void 0,g=!m||T||v?void 0:m.emoji,b=h!=null?typeof h=="number"?`${h}px`:h:void 0,j=u.useMemo(()=>[Zn.Icon,"icon",n].filter(Boolean).join(" "),[n]),C=u.useMemo(()=>{const M={...r};return M["--icon-size"]=b,M},[r,b]),B=i??(a?"img":"presentation"),O=l??(!a||void 0),L=M=>S.jsx("span",{className:j,style:C,role:B,"aria-hidden":O,title:a,"data-icon-glyph":e,"data-icon-pack":E,...d,children:M});if(c)return L(c);if(g)return L(S.jsx("span",{children:typeof g=="string"?g:g.text}));if(v)return L(S.jsx("img",{src:v.src,alt:a??""}));if(m&&"react"in m){const M=m.react,I={className:j,style:C,role:B,"aria-hidden":O,title:a,...d,...s};return L(S.jsx(M,{...I}))}const w={viewBox:T?.viewBox??_?.meta.defaultViewBox??"0 0 24 24"};if(typeof T=="function")return L(T(w)??S.jsx(At,{...w}));if(!T)return L(S.jsx(At,{...w}));const k=T.paths;return L(S.jsx("svg",{...w,children:k?k.map((M,I)=>S.jsx("path",{d:M.d,className:M.className,fill:M.fill,stroke:M.stroke,opacity:M.opacity,fillRule:M.fillRule,clipRule:M.clipRule},I)):null}))});class Ze{constructor(){this.store=new Map}async getItem(e){return this.store.get(e)??null}async setItem(e,t){this.store.set(e,t)}async removeItem(e){this.store.delete(e)}}const Rt=u.createContext(null),sn={parse:o=>o?JSON.parse(o):null,stringify:JSON.stringify},Jn={store:new Ze,namespace:"",serializer:sn,debounceMs:0,crossTabSync:!1,notify:()=>{},subscribeKey:()=>()=>{}},Qn={},eo={parse:o=>o==null?null:JSON.parse(o),stringify:JSON.stringify},Z={Horizontal:"horizontal",Vertical:"vertical"},fe={scrollbar:"_scrollbar_gqxsx_24",track:"_track_gqxsx_35",thumb:"_thumb_gqxsx_47","scrollbar-button":"_scrollbar-button_gqxsx_89","touch-thumb":"_touch-thumb_gqxsx_124"},ln="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",an="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",to={transform:"rotate(180deg)"},cn=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return S.jsx("button",{style:e,className:X(fe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:S.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:S.jsx("path",{d:i})})})},un=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return S.jsx("button",{style:e,className:X(fe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:S.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:to,children:S.jsx("path",{d:i})})})},no=ke().supportsTouchEvents,hn=u.memo(u.forwardRef((o,e)=>{const{borderColor:t="var(--sxl-app-color-primary, rgb(33, 115, 70))",backgroundColor:n="var(--sxl-app-color-background, white)",fillColor:r="var(--sxl-app-color-grey, grey)",borderWidth:i=3,size:a=22,style:h,className:l,onPointerDown:s,onPointerMove:c,onPointerUp:d,orientation:f=Z.Vertical,offset:p=0,currentTouchAnchor:_,elementParent:m,elementRoot:E,key:T,...v}=o;if(!no)return null;const g=D(s,[s]),b=D(c,[c]),j=D(d,[d]),C=f===Z.Vertical,[B,O]=u.useState(!1),L=ht(u.useMemo(()=>({processTouch:!0,consumeTouch:!0,onPointerDown:(A,W)=>{O(!0),g?.(A),A.preventDefault(),A.stopPropagation()},onPointerMoveOrWait:(A,W,H)=>{b?.(A)},onPointerUp:(A,W,H)=>{O(!1),j?.(H),A.preventDefault(),A.stopPropagation()}}),[])),w=u.useMemo(()=>{const A=a/2+i/2+6;return{x:C?-A:p+a,y:C?p+a:-A,width:0,height:0}},[C,p,a]),[k,{y:M,x:I}]=Gt(),P=u.useRef(null),{getPortalContainer:y,isFullscreen:z}=Zt(),[K,U]=u.useState(null);return u.useEffect(()=>{const A=P.current?.getBoundingClientRect();if(!A)return void U(null);let W=0,H=0,V=m;for(;V;)W+=V.scrollLeft,H+=V.scrollTop,V=E&&V===E.parentElement?null:V.parentElement;U(Nt.createPortal(S.jsx("div",{className:X("touch-thumb",fe["touch-thumb"],l,fe,{dragging:B}),ref:e,style:{left:W+(A?.x??0)-(a+i)/2,top:H+(A?.y??0)-(a+i)/2,width:C?a:1.8*a,height:C?1.8*a:a,borderWidth:`${i}px`,boxShadow:B?`${n} 0px 0px 0px 1.5px`:void 0,borderStyle:"solid",borderColor:t,backgroundColor:n,opacity:_?0:void 0,transitionDuration:"160ms",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center center",...h},tabIndex:-1,onPointerDown:L,...v}),E??y(),T))},[M,B,t,n,r,I,w?.x,w?.y,w?.width,w?.height,l,_,n,a,i,t,m,z,T]),w?S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:Se([k,P]),style:{position:"absolute",left:w.x,top:w.y,opacity:0}}),K]}):null}));hn.displayName="TouchThumbHandle";const oo=24,dn=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:r=0,style:i,className:a,orientation:h=Z.Vertical,onScrollOffset:l,onScroll:s,showCustomScrollButtons:c,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:p=120,minThumbSize:_=oo,maxThumbSize:m,createScrollStartButton:E=cn,createScrollEndButton:T=un,touchThumbProps:v,thumbProps:g,onMouseDown:b,...j}=o,C=ke().primaryInput==="touch",B=c??!C;D(s,[s]);const[O,L]=u.useState({offset:0,length:0,disabled:!1}),w=u.useRef(-1),k=h===Z.Vertical,[M,{width:I,height:P}]=me(),y=k?P:I,z=D((x,N,q)=>{if(N===0||q===0){const Ke={offset:0,length:_,disabled:!0};return L(Ke),Ke}if(N>=q)return{offset:0,length:y,disabled:!0};const ue=q/y,ve=N/ue,he=Math.min(Math.max(_,ve),Math.min(y,m??Number.MAX_SAFE_INTEGER)),ot=x/ue;return{offset:Math.min(Math.max(0,ot),y-he),length:he,disabled:!1}},[y,_,m]),K=D(x=>{const N=n/y,q=Math.round(x*N);L(z(q,r,n)),l?.(q,r,n),w.current=x},[l,r,n,y,O]),U=D(x=>{L(z(x,r,n)),l?.(x,r,n),w.current=x},[l,r,n]);u.useEffect(()=>{w.current!==t&&y!==0&&(w.current=-1,L(z(t,r,n)))},[t]),u.useEffect(()=>{y!==0&&L(z(t,r,n))},[r,n,k,y]);const A=Math.max(0,n-r),[W,H]=u.useState(!1),V=u.useRef(0),J=u.useRef(0),pe=Qe(e,()=>({isScrollbar:()=>!0}),[]),ae=D(x=>{H(!0),V.current=k?x.clientY:x.clientX,J.current=O.offset},[k,O]),_e=D(x=>{x.currentTarget.setPointerCapture(x.pointerId),ae(x),x.stopPropagation()},[b]),ce=D(x=>{if(!W)return;const N=(k?x.clientY:x.clientX)-V.current,q=J.current+N;K(q)},[W,k]),et=D(x=>{ce(x)},[]),De=D(x=>{H(!1)},[]),tt=D(x=>{try{x.currentTarget.releasePointerCapture(x.pointerId)}catch{}De(x)},[]),Ae=D(x=>{if(!x.currentTarget)return;const N=x.currentTarget.getBoundingClientRect(),q=k?x.clientY-N.top:x.clientX-N.left;K(q)},[k,O,r,n]),ze=D(x=>{const N=Math.max(1,Math.floor(.9*r));k?(x.key==="ArrowDown"&&K(Math.min(A,t+1)),x.key==="ArrowUp"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(A,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(A)):(x.key==="ArrowRight"&&K(Math.min(A,t+1)),x.key==="ArrowLeft"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(A,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(A))},[k,r,n,t,A]),Re=u.useRef(null),nt=u.useMemo(()=>{const x=O.disabled;if(x)return null;const N=S.jsx("div",{...g,className:X(fe.thumb,{disabled:x}),ref:Re,role:"slider","aria-label":k?"Rows":"Columns","aria-orientation":k?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":t,tabIndex:0,style:{...g?.style,position:"relative",[k?"height":"width"]:`${O.length}px`,[k?"width":"height"]:"100%",transform:k?`translateY(${O.offset}px)`:`translateX(${O.offset}px)`,[k?"minHeight":"minWidth"]:`${_}px`},onMouseDown:b,onPointerDown:_e,onPointerMove:et,onPointerUp:tt});return!C||x?N:S.jsxs(S.Fragment,{children:[N,S.jsx(hn,{...v,offset:O.offset,orientation:k?Z.Vertical:Z.Horizontal,onPointerDown:ae,onPointerMove:ce,onPointerUp:De})]})},[O,_,A,t,k,C,b,v,g]),[je,Be]=u.useState(null),Oe=D(()=>{let x;x=typeof d=="function"?d(t,r,n):t-d;const N=Math.max(0,x);return U(N),Be(N),N},[d,t,r,n]),Ie=D(()=>{let x;x=typeof d=="function"?d(t,r,n):t+d;const N=Math.min(A,x);return U(N),Be(N),N},[d,t,A,r,n]),ge=u.useRef(null),Ee=u.useRef(null),ne=u.useCallback(()=>{ge.current&&(clearTimeout(ge.current),ge.current=null,Ee.current=null)},[]),ye=u.useCallback((x,N,q,ue=f)=>{Ee.current=x,ge.current=setTimeout(()=>{const ve=q?Oe():Ie();ve!==Ee.current?ye(ve,!1,q,p):ne()},N?0:ue)},[Oe,Ie,ne]);u.useEffect(()=>()=>ne(),[ne]);const $e=u.useMemo(()=>{if(!B)return null;const x={orientation:h,disabled:t<=0,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ye(t,!0,!0)};return E?.(x)},[B,h,t,je]),Ne=u.useMemo(()=>{if(!B)return null;const x={orientation:h,disabled:t>=A,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ye(t,!0,!1)};return T?.(x)},[B,h,t,A,je]),Ce=k?"vertical":"horizontal";return S.jsxs("div",{ref:Se([pe,e]),className:X(a,fe.scrollbar,Ce,{dragging:W,"has-touch-thumb":C}),style:i,...j,children:[$e,S.jsx("div",{ref:M,role:"scrollbar","aria-orientation":Ce,"aria-valuemin":0,"aria-valuemax":A,"aria-valuenow":t,tabIndex:0,className:X(fe.track,"track",Ce),onMouseDown:b,onPointerDown:Ae,onKeyDown:ze,children:nt}),Ne]})}));let jt=Date.now,Bt=1e3,le={},ro=1;const Le=o=>{let e=le[o]!==null;return e&&(le[o]=null),e},Ot=(o,e,t,n=0,r)=>{let i=jt(),a=i,h=0,l=0,s=0,c=ro++;if(c%20==0){const f={};for(let p in le)f[p]=!0;le=f}const d=function(f){let p=f!==!0,_=jt(),m=!0;try{m=(!e||e(c))??!0}catch{m=!1}if(!le[c]||!m)return le[c]=null,void t?.(60-l/((_-i)/Bt),c,!1);if(p){s=Math.round((_-a)/16.666666666666668)-1;for(let v=0;v<Math.min(s,4);v++)d(!0),l++}n&&(h=(_-i)/n,h>1&&(h=1));let E=r?r(h):h,T=!1;try{T=o(E,_,p)}catch{T=!1}T!==!1&&h!==1||!p?p&&(a=_,requestAnimationFrame(d)):(le[c]=null,t?.(60-l/((_-i)/Bt),c,h===1||n==null))};return le[c]=!0,requestAnimationFrame(d),c},io=function(o){return Math.pow(o-1,3)+1},so=function(o){return(o/=.5)<1?.5*Math.pow(o,3):.5*(Math.pow(o-2,3)+2)};class lo{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,r){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),n!==null&&(this.__contentWidth=n),r!==null&&(this.__contentHeight=r),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,r,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0);const a=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),r===void 0&&(r=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const h=e/a;let l=h*(this.__scrollLeft+n)-n,s=h*(this.__scrollTop+r)-r;l>this.__maxScrollLeft?l=this.__maxScrollLeft:l<0&&(l=0),s>this.__maxScrollTop?s=this.__maxScrollTop:s<0&&(s=0),this.__publish(l,s,e,t)}zoomBy(e,t=!1,n=0,r=0,i){this.zoomTo(this.__zoomLevel*e,t,n,r,i)}scrollTo(e,t,n=!1,r=1){if(this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0),r!==void 0&&r!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=r,t*=r,this.__computeScrollMax(r)}else r=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,r,n)}scrollBy(e=0,t=0,n=!1){const r=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(r+(e||0),i+(t||0),n)}doMouseZoom(e,t,n,r){const i=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,r-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,r;this.__interruptedAnimation=!0,this.__isDecelerating&&(Le(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Le(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let i=e.length===1;i?(n=e[0].pageX,r=e[0].pageY):(n=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=r,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!i&&this.options.scrollingX,this.__enableScrollY=!i&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!i,this.__isSingleTouch=i,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 r,i;e.length===2?(r=Math.abs(e[0].pageX+e[1].pageX)/2,i=Math.abs(e[0].pageY+e[1].pageY)/2):(r=e[0].pageX,i=e[0].pageY);let a=this.__positions;if(this.__isDragging){let h=r-this.__lastTouchLeft,l=i-this.__lastTouchTop,s=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 p=r-this.__clientLeft,_=i-this.__clientTop;s=(p+s)*d/f-p,c=(_+c)*d/f-_,this.__computeScrollMax(d)}}if(this.__enableScrollX){s-=h*this.options.speedMultiplier;let f=this.__maxScrollLeft;(s>f||s<0)&&(this.options.bouncing?s+=h/2*this.options.speedMultiplier:s=s>f?f:0)}if(this.__enableScrollY){c-=l*this.options.speedMultiplier;const f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?c+=l/2*this.options.speedMultiplier:c=c>f?f:0)}a.length>60&&a.splice(0,30),a.push(s,c,t),this.__publish(s,c,d)}else{let h=this.options.locking?3:0,l=5,s=Math.abs(r-this.__initialTouchLeft),c=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&s>=h,this.__enableScrollY=this.options.scrollingY&&c>=h,a.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(s>=l||c>=l),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=r,this.__lastTouchTop=i,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,r=n;for(let i=n;i>0&&t[i]>this.__lastTouchMove-100;i-=3)r=i;if(r!==n){const i=t[n]-t[r],a=this.__scrollLeft-t[r-2],h=this.__scrollTop-t[r-1];this.__decelerationVelocityX=a/i*(1e3/60),this.__decelerationVelocityY=h/i*(1e3/60);const l=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>l||Math.abs(this.__decelerationVelocityY)>l)&&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,r=!1){const i=this.__isAnimating;if(i&&(Le(i),this.__isAnimating=0),r&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const a=this.__scrollLeft,h=this.__scrollTop,l=this.__zoomLevel,s=e-a,c=t-h,d=n-l,f=function(m,E,T){T&&(this.__scrollLeft=a+s*m,this.__scrollTop=h+c*m,this.__zoomLevel=l+d*m,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),p=function(m){return this.__isAnimating===m}.bind(this),_=function(m,E,T){E===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=Ot(f,p,_,this.options.animationDuration,i?io:so)}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),l=this.__clientWidth,s=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(a/l)*l,this.__minDecelerationScrollTop=Math.floor(h/s)*s,this.__maxDecelerationScrollLeft=Math.ceil(a/l)*l,this.__maxDecelerationScrollTop=Math.ceil(h/s)*s}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(a,h,l){this.__stepThroughDeceleration(l)}.bind(this),n=this.options.snapping?4:.1,r=function(){const a=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return a||(this.__didDecelerationComplete=!0),a}.bind(this),i=function(a,h,l){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=Ot(t,r,i)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const r=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);r!==t&&(t=r,this.__decelerationVelocityX=0);const i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,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 r=0,i=0,a=this.options.penetrationDeceleration,h=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?r=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(r=this.__maxDecelerationScrollLeft-t),n<this.__minDecelerationScrollTop?i=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(i=this.__maxDecelerationScrollTop-n),r!==0&&(r*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=r*a:this.__decelerationVelocityX=r*h),i!==0&&(i*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=i*a:this.__decelerationVelocityY=i*h)}}}const Pe=(o,e)=>S.jsx(dn,{...o,ref:e}),ao=Object.freeze(Object.defineProperty({__proto__:null,defaultCreateScrollbar:Pe,getScrollTo:(o,e,t,n,r=0)=>{for(let i=0;i<t.length;i++){const a=t[i].getBoundingClientRect();let h=a.left-e,l=h+a.width;if(n){if(h<o&&l>=o)return h}else if(Math.ceil(l)>Math.ceil(o)+2)return l}return r}},Symbol.toStringTag,{value:"Module"})),co="_scrollpane_1fbi8_2",uo="_vertical-container_1fbi8_7",ho="_horizontal-corner-container_1fbi8_12",fo="_horizontal-container_1fbi8_20",mo="_scrollbar-sizer_1fbi8_26",po="_scrollpane-content_1fbi8_34",It="_scrollpane-content-element_1fbi8_43",fn=({width:o,height:e})=>S.jsx("div",{className:"corner",style:{minWidth:`${o}px`,width:`${o}px`,minHeight:`${e}px`,height:`${e}px`}}),mn=u.memo(u.forwardRef((o,e)=>{const{children:t,viewport:n,onScrollViewport:r,showHorizontalScrollbar:i=!0,showVerticalScrollbar:a=!0,createScrollCorner:h=fn,createHorizontalScrollbar:l=Pe,createVerticalScrollbar:s=Pe,style:c,className:d,touchElement:f,disableTouch:p,..._}=o,m=i&&l,E=a&&s,T=D(r,[r]),v=Qe(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,f]);const b=u.useCallback((y,z)=>{T?.({left:y,top:z})},[]),j=u.useCallback(y=>{g.current?.doTouchStart(y.touches,y.timeStamp)},[]),C=u.useCallback(y=>{y.preventDefault(),g.current?.doTouchMove(y.touches,y.timeStamp)},[]),B=u.useCallback(y=>{g.current?.doTouchEnd(y.timeStamp)},[]),O=u.useCallback(({containerWidth:y,containerHeight:z,totalWidth:K,totalHeight:U})=>{g.current.setDimensions(y,z,K,U)},[]);u.useEffect(()=>{const y=f??v.current;if(!p&&ke().supportsTouchEvents&&y&&n){if(!g.current){const z={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new lo(b,z)}ke().supportsTouchEvents&&(y.addEventListener("touchstart",j),y.addEventListener("touchend",B),y.addEventListener("touchmove",C)),O({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{y?.removeEventListener("touchstart",j),y?.removeEventListener("touchend",B),y?.removeEventListener("touchmove",C)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,p,f]);const[L,{width:w}]=me(),[k,{height:M}]=me(),I=u.useMemo(()=>{if(!E)return null;const y=s({orientation:Z.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:z=>{T?.({top:z})}});return S.jsx("div",{className:X("vertical-container",uo),ref:L,children:y})},[s,n?.top,n?.height,n?.totalHeight]),P=u.useMemo(()=>{if(!m)return null;const y=l({orientation:Z.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:z=>{T?.({left:z})}});return S.jsxs("div",{className:X("horizontal-corner-container",ho),children:[S.jsx("div",{className:X("horizontal-container",fo),style:{width:`calc(100% - ${w}px)`},children:S.jsx("div",{ref:k,className:X("scrollbar-sizer",mo),children:y})}),E?h({width:w,height:M}):S.jsx(S.Fragment,{})]})},[l,n?.left,n?.width,n?.totalWidth,E,h,w,M]);return S.jsx("div",{className:X(d,"scrollpane",co),style:{minWidth:E?`${w}px`:void 0,minHeight:m?`${M}px`:void 0,...c},..._,ref:v,children:S.jsxs("div",{className:X("scrollpane-content",po),children:[S.jsxs("div",{className:X("scrollpane-content-element",It),children:[S.jsx("div",{className:X("scrollpane-content-element",It),children:t}),E?I:S.jsx(S.Fragment,{})]}),m?P:S.jsx(S.Fragment,{})]})})}));mn.displayName="ScrollPane";const _o=300,go=100,yo=1e6,vo=100,bo=50,$t=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:r=0,minSize:i=0,endGap:a=_o,endScrollIncrement:h=go,style:l=Ut,onMouseDown:s,onScrollOffset:c,onScroll:d,scaleLimit:f=yo,scaleFactor:p=vo,precisionFactor:_=bo,createScrollbar:m=Pe,...E}=o;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const T=D(s,[s]),[v,g]=u.useState(!1),b=u.useMemo(()=>{const L=f===0?r:Math.min(r??0,Math.max(i??0,(t??0)+(n??0))+(a??0)),w=f!==0&&L>f?p:1,k=w/_,M=Math.ceil(L/w);return{offset:Math.ceil(t/w),totalSize:M,viewportSize:Math.ceil(n/w),scaledOffset:t,scaledTotalSize:r,scaledViewportSize:n,factor:w,precision:k}},[t,r,n,v,i,a,h]),j=D((L,w,k)=>{const M=b.offset;Math.abs(L-M)<b.precision&&(L=M),c?.(L*b.factor,M,b.viewportSize)},[c,b]),C=u.useCallback(L=>{},[]),B=u.useCallback(L=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",B),g(!1)},[]),O=u.useCallback(L=>{g(!0),T?.(L),document.addEventListener("mousemove",C,{passive:!0}),document.addEventListener("mouseup",B,{passive:!0})},[C,B]);return Pe({style:l,...E,offset:b.offset,totalSize:b.totalSize,viewportSize:b.viewportSize,onMouseDown:O,onScrollOffset:j},e)}));$t.displayName="VirtualScrollbar",exports.Command=Ye,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=_t,exports.DefaultDynamicIconService=Te,exports.DefaultReactNotifier=Yt,exports.DynamicIcon=zt,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=kn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.InMemoryStore=Ze,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=Y,exports.LocalStorageStore=class{constructor(o=window.localStorage){this.storage=o}async getItem(o){try{return this.storage.getItem(o)}catch{return null}}async setItem(o,e){try{this.storage.setItem(o,e)}catch{}}async removeItem(o){try{this.storage.removeItem(o)}catch{}}subscribe(o){const e=t=>{t.storageArea===this.storage&&t.key&&o(t.key)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}},exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:o,notifier:e})=>(u.useEffect(()=>{const t=$.Notifier.getOverrides();return $.Notifier.setOverrides(e),()=>{$.Notifier.setOverrides(t)}},[e]),u.createElement(qt.Provider,{value:e},o)),exports.NotifierType=ut,exports.PersistenceStateProvider=function(o){const{store:e,namespace:t="",serializer:n=eo,debounceMs:r=0,crossTabSync:i=!0,children:a}=o,h=u.useMemo(()=>typeof window>"u"?new Ze:e??new Ze,[e]),l=u.useRef(new Map),s=u.useMemo(()=>({store:h,namespace:t,serializer:n,debounceMs:r,crossTabSync:i,notify(c){const d=l.current.get(c);d&&d.forEach(f=>f())},subscribeKey(c,d){const f=l.current,p=f.get(c)??new Set;return p.add(d),f.set(c,p),()=>{const _=f.get(c);_&&(_.delete(d),_.size===0&&f.delete(c))}}}),[h,t,n,r,i]);return u.useEffect(()=>{if(s.crossTabSync&&s.store.subscribe)return s.store.subscribe(c=>{if(!c.startsWith(s.namespace+":"))return;const d=c.slice(s.namespace.length+1);s.notify(d)})},[s]),S.jsx(Rt.Provider,{value:s,children:a})},exports.ReactErrorBoundary=({children:o})=>{const e=Me(),t=u.useCallback(n=>{e.showError(n)},[e]);return S.jsx(Xn,{onError:t,children:o})},exports.ReactUtils=Mn,exports.RoundedTab=An,exports.ScrollPane=mn,exports.ScrollUtils=ao,exports.Scrollbar=dn,exports.ScrollbarOrientation=Z,exports.SimpleCommand=We,exports.SplitPane=on,exports.SplitPaneResizer=nn,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:o})=>{const e=Me();return u.useEffect(()=>{const t=new Yn(e);return()=>{t.cleanup()}},[e]),S.jsx(S.Fragment,{children:o})},exports.VirtualScrollbar=$t,exports.WalkingIcon=function(o){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:r=3,dashLength:i=5,iconKey:a,packKey:h,style:l,className:s,...c}=o,d=u.useMemo(()=>{if(!e)return;const p={"--walk-duration":`${n*(r+i)}ms`,"--walk-dash-length":`${i}px`,"--walk-dash-gap":`${r}px`};return t&&t!=="accent"&&(p["--icon-accent"]=`var(--icon-${t})`),p},[e,n,r,i,t]),f=u.useMemo(()=>e?s+" walking":s,[e,s]);return S.jsx(zt,{iconKey:a,packKey:h,className:f,style:{...l,...d},...c})},exports.createDynamicIconService=rn,exports.defaultCreateScrollCorner=fn,exports.defaultCreateScrollEdgeButton=o=>{const{style:e,orientation:t=Z.Vertical,...n}=o,r=t===Z.Vertical,i=r?"rotate(90) ":"";return S.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${r?"vertical":"horizontal"} edge`,...n,children:S.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:i,children:S.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:o.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=un,exports.defaultCreateScrollStartButton=cn,exports.getDevicePixelRatio=function(o){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=o||{},r=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(r):r),t)},exports.toShortcutString=be,exports.useAnimatedMeasure=Gt,exports.useCallbackRef=D,exports.useCommand=function(o,e=null){const t=u.useRef(e);t.current=e;const[n,r]=u.useReducer(a=>a+1,0),i=u.useMemo(()=>Array.isArray(o)?o:[o],[o]);return u.useEffect(()=>{if(!i||i.length===0)return;const a=(s,c)=>{t.current?.onChange?.(c),r()};let h=null;e&&(h={onExecute(s,c){t.current?.onExecute?.(s,c)},onError(s,c,d){t.current?.onError?.(s,c,d)}});const l=new Set;for(let s=0;s<i.length;s++)l.add(i[s]?.addPropertyListener($.CommonUtils.debounce(a,0),!0)),e&&l.add(i[s]?.addExecuteListener(h));return()=>{l.forEach(s=>{s?.()})}},[o]),n},exports.useCommands=function(o,e=null,t=null,n){const r=u.useRef(t);r.current=t,e&&!Array.isArray(e)&&(e=[e]);const[i,a]=u.useState(Fe(o,e)),h=n?[...n,o]:[o];return u.useEffect(()=>{const l={onGroupChange:()=>{const f=Fe(o,e);a(f),r.current?.onChange?.(this)}};let s;e&&e.length>0&&(s={keys:e},l.onCommandChange=(f,p)=>{r.current?.onChange?.(o),a(Fe(o,e))});const c=o?.addListener(l,s),d=Fe(o,e);return a(d),r.current?.onChange&&r.current?.onChange(o),()=>{c?.()}},h),i},exports.useCopyPaste=o=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:r,commands:i}=o,a=Me(),h=D(r,[r]),l=D(n,[n]),{getClipboard:s,refNativeCopy:c}=St(),d=s();u.useMemo(()=>{const v=e?.element,g=t?.element??e?.element;if(!i)return;const b=[new We("cut",v,{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:[Y.Ctrl]}}),new We("copy",v,{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:[Y.Ctrl]}}),new We("paste",g,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste.yellow",shortcut:[{key:"V",modifiers:[Y.Ctrl]},{key:"F8",modifiers:[Y.Ctrl]}]})];i?.addCommands(b,!0)},[i]);const f=D(async v=>{if(!e?.element)return;let g=null;try{g=e.doCopy?.(v),typeof g=="string"?await d.writeText(g):await d.writeReference(g)}catch(b){throw b}},[e,a]),p=D(async v=>{const g=e?.element?.();if(g){c.current={sourceElement:g,args:v};try{await f(v)}catch(b){a.showError?.(b)}}},[e?.element,a]),_=u.useCallback(()=>{p({isCut:!0})},[]),m=D(async(v,g,b)=>{try{if(await v.doPaste(g,b)===!1)return;l?.(g,b)}catch(j){a.showError?.(j)}},[l]),E=D(async(v,g,b)=>{const j=t?.element?.();if(j&&await $.CommonUtils.whenFocus(j),!v&&!g)return;const C=await a.showBusy?.("Pasting...");if(g)try{return await m(t,g,b),void C?.()}catch(L){C?.(),a.showError?.(L)}let B,O=t.importFromExternal;O||(O=(L,w)=>({getItemType:()=>"text",toText:()=>v.text,isClipboardItem:!0}));try{B=await O(v,{isCut:!1})}catch(L){C?.(),a.showError?.(L)}if(B)try{const L=await Promise.resolve(B);await m(t,L,b),C?.()}catch(L){C?.(),a.showError?.(L)}else C?.()},[m,t,a]),T=D(async v=>{if(t?.element)try{const g=await d.readReference();if(g)return void await E(null,g,v);const b=[];b[0]=await $.ClipboardUtils.readStringFromClipboard(d,$.MimeType.plain),b[1]=await $.ClipboardUtils.readHTMLFromClipboard(d,$.MimeType.html),b[2]=await $.ClipboardUtils.readBlobFromClipboard(d,$.MimeType.png);const j={text:b[0]??null,html:b[1]??null,image:b[2]??null};await E(j,null,v)}catch(g){if(g?.message==="Document is not focused.")return;a.showError?.(g)}},[E,t?.element,a]);return D(async v=>{},[e?.element]),D(async v=>{},[t?.element,E,a]),u.useEffect(()=>{if(!d)return;const v=async j=>{const C=await d.readReference();h?.(C)},g=j=>{a.showMessage?.($.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},b=j=>{a.showMessage?.($.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",v),d.addEventListener("clipboarderrorread",g),d.addEventListener("clipboarderrorwrite",b),()=>{d.removeEventListener("clipboardchange",v),d.removeEventListener("clipboarderrorread",g),d.removeEventListener("clipboarderrorwrite",b)}},[d,a]),u.useEffect(()=>{},[f,E,e,t]),u.useEffect(()=>{i?.getCommand("cut")?.updateCallback(_).update({disabled:!e||!t}),i?.getCommand("copy")?.updateCallback(p).update({disabled:!e}),i?.getCommand("paste")?.updateCallback(T).update({disabled:!t})},[e,t,i]),{paste:T,copy:p,clipboard:d}},exports.useDevicePixelRatio=function(o){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 r=()=>{const i=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);i.addEventListener("change",r,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:i,listener:r}};return r(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[o]),e},exports.useEditMode=()=>{const o=Kn();return u.useMemo(()=>({setMode:e=>{en(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>o}),[o])},exports.useFullscreenPortal=Zt,exports.useGlobalClipboard=St,exports.useId=Fn,exports.useImperativeElement=Qe,exports.useMouseDownAndHoldListener=function(o,e){return ht({onPointerDown:o,onPointerMoveOrWait:(t,n,r)=>{o?.(r)},...e})},exports.useNotifier=Me,exports.useOnClickOrFocusAway=function(o,e,t){const n=D(e,[e]);u.useEffect(()=>{const r=i=>{o.current&&!o.current.contains(i.target)&&n(i)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",r),document.addEventListener("touchstart",r)),t&&t.focusEvents===!1||document.addEventListener("focus",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r),document.removeEventListener("focus",r)}},[o])},exports.usePersistenceState=function(o,e,t=Qn){const{store:n,namespace:r,serializer:i,debounceMs:a,subscribeKey:h}=u.useContext(Rt)||Jn,l=t.serializer??i??sn,s=u.useMemo(()=>`${r}:${o}`,[r,o]),c=u.useRef(null),d=`${s}::v`,[f,p]=u.useState(()=>{let m;try{if(typeof window<"u"&&"localStorage"in window&&s.startsWith(r)){const E=window.localStorage?.getItem(s)??null;E!=null&&(m=l.parse(E))}}catch{}if(m===void 0){const E=e;return typeof E=="function"?E():E}return m});u.useEffect(()=>{let m=!0;return(async()=>{const[E,T]=await Promise.all([n.getItem(s),n.getItem(d)]);let v;try{v=E==null?void 0:l.parse(E)}catch{}const g=T==null?void 0:Number.parseInt(T,10);v===void 0?!t.lazy&&e!==void 0&&(v=typeof e=="function"?e():e,await n.setItem(s,l.stringify(v)),t.version!=null&&await n.setItem(d,String(t.version))):t.version!=null&&g!==void 0&&g!==t.version&&t.migrate&&(v=t.migrate(v,g),await n.setItem(s,l.stringify(v)),await n.setItem(d,String(t.version))),m&&v!==void 0&&p(v)})(),()=>{m=!1}},[n,s,d,t.version,t.migrate,t.lazy]),u.useEffect(()=>h(o,async()=>{const m=await n.getItem(s);if(m!=null)try{p(l.parse(m))}catch{}}),[n,s,h,o]);const _=async m=>{await n.setItem(s,l.stringify(m)),t.version!=null&&await n.setItem(d,String(t.version))};return[f,m=>{p(E=>{const T=typeof m=="function"?m(E):m;return c.current&&clearTimeout(c.current),a>0?c.current=setTimeout(()=>{_(T)},a):_(T),T})},()=>{if(c.current&&clearTimeout(c.current),n.removeItem(s),n.removeItem(d),e!==void 0){const m=typeof e=="function"?e():e;p(m)}else p(void 0)}]},exports.useSynchronizedPointerHandler=ht,exports.useTraceUpdate=function(o,e=!0){const t=u.useRef(o);u.useEffect(()=>{if(e){const n=Object.entries(o).reduce((r,[i,a])=>(t.current[i]!==a&&(r[i]=[t.current[i],a]),r),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=o})},exports.useUndoManager=({manager:o,commands:e,disabled:t})=>{const n=Me(),r=D(a=>{try{o?.undo(a)}catch(h){n.error(h)}},[o]),i=D(a=>{try{o?.redo(a)}catch(h){n.error(h)}},[o]);return u.useMemo(()=>{if(!e)return;const a={contains:l=>!0,focus(){}},h=[new Ye("undo",a,{label:"Undo",description:Mt,shortcut:{key:"z",modifiers:[Y.Ctrl]},disabled:!0},r),new Ye("redo",a,{label:"Redo",description:Lt,shortcut:[{key:"y",modifiers:[Y.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[Y.Alt]}],disabled:!0},i)];e?.addCommands(h,!0)},[e]),u.useEffect(()=>{if(!e)return;const a=()=>{const l=o?.getTopUndoDescription(),s={};var c;e.getCommand("undo").update({disabled:t||!o||!o.hasUndo(),description:l?(c=l,`Undo ${c}`):Mt,state:s,context:{undoManager:o}});const d=o?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!o||!o.hasRedo(),description:d?Vn(d):Lt,state:s,context:{undoManager:o}})};if(a(),!o)return;const h=o.addListener({onStackChange(){a()}});return()=>h?.()},[o,e,t]),{undo:r,redo:i}};
7
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("@sheetxl/utils"),u=require("react"),S=require("react/jsx-runtime"),gn=require("react-dom/client"),Nt=require("react-dom"),Y={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"};class Ye{constructor(e,t,n,r){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=t,this._applyProps(n||{}),this._callback=r,r===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 r=null;if(typeof n=="function"){const i=t??this._context;r=n(typeof i=="function"?i():i)}else r=n;return r}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 r=this._callback.bind(this)(e,this);if(await Promise.resolve(r)===!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(r=>{r.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(r=>{let i=e[r];n["_"+r]!==i&&(n["_"+r]=t[r]=i)}),t}}class We extends Ye{}var ee=typeof window<"u"?window:{screen:{},navigator:{}},Se=(ee.matchMedia||function(){return{matches:!1}}).bind(ee),Kt=!1,yn={get passive(){return Kt=!0}},wt=function(){};ee.addEventListener&&ee.addEventListener("p",wt,yn),ee.removeEventListener&&ee.removeEventListener("p",wt,!1);var vn=Kt,bn="PointerEvent"in ee,_t="ontouchstart"in ee,Ht=_t||"TouchEvent"in ee&&Se("(any-pointer: coarse)").matches,xt=(ee.navigator.maxTouchPoints||0)>0||Ht,Wt=ee.navigator.userAgent||"",wn=Se("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Wt)&&Math.min(ee.screen.width||0,ee.screen.height||0)>=768,Ft=(Se("(pointer: coarse)").matches||!Se("(pointer: fine)").matches&&_t)&&!/Windows.*Firefox/.test(Wt),xn=Se("(any-pointer: fine)").matches||Se("(any-hover: hover)").matches||wn||!_t,ut=!xt||!xn&&Ft?xt?"touchOnly":"mouseOnly":"hybrid",Sn=ut==="mouseOnly"?"mouse":ut==="touchOnly"||Ft?"touch":"mouse";const En=Object.freeze(Object.defineProperty({__proto__:null,deviceType:ut,primaryInput:Sn,supportsPassiveEvents:vn,supportsPointerEvents:bn,supportsTouchEvents:Ht},Symbol.toStringTag,{value:"Module"})),Cn=new Set(["INPUT","TEXTAREA","SELECT"]),Ut={};function Pe(){return En}const Vt=o=>o==="BracketLeft"?"[":o==="BracketRight"?"]":$.CommonUtils.camelToPrettyCase(o),qe=(o,e)=>{let t=!1,n=!1;const r={nativeEvent:o,currentTarget:e||o.currentTarget,target:o.target,bubbles:o.bubbles,cancelable:o.cancelable,defaultPrevented:o.defaultPrevented,eventPhase:o.eventPhase,isTrusted:o.isTrusted,preventDefault:()=>{t=!0,o.preventDefault()},isDefaultPrevented:()=>t,stopPropagation:()=>{n=!0,o.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:o.timeStamp,type:o.type};for(const i in o)i in r||typeof o[i]=="function"||(r[i]=o[i]);return r},Mn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Ut,boundPixel:function(o,e=!1,t=0){return o},createSyntheticEvent:qe,detectIt:Pe,focusableNodeNames:Cn,toPrettyKeyCode:Vt},Symbol.toStringTag,{value:"Module"}));class gt{constructor(e,t){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=$.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=(r,i)=>{const a=n._root._listenersByKey,h=i.key(),l=a.get(h);l&&n._notifyCommands(l,"onCommandChange",i)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,t=!1){const n=this._root._focused;let r=n,i=n===this;for(;!i&&r;)r===this&&(i=!0),r=r._parent;return(i?n:this)._getCommand(e)}createChildGroup(e,t,n){let r;if(!n){let h=this;for(;h&&!r;){let l=h._nodes.get(t);l&&(r=l),h=h._parent}}r||(r=new gt(e,t),r._parent=this,r._root=this._root,r._unListenersByCommand=null,r._listenersByKey=null,r._commandsPropertyListener=null);const i=(h,l)=>{!h.has(t)||n?h.set(t,l):n===void 0&&console.warn("commandGroup already registered",t)};i(this._root._nodes,r);let a=this._parent;for(;a;)i(this._nodes,r),a=a._parent;return this._children.set(t,r),this._notify("onGroupChange"),r}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,t=void 0){const n=this._commandsByKey,r=this._commandsByShortcut,i=this._root._commandsPropertyListener,a=this._root._unListenersByCommand;for(let h=0;h<e.length;h++){const l=e[h],s=l.key();if(n.has(s)&&!t){t===void 0&&console.warn("command already registered",s);continue}n.set(s,l);let c=a.get(l);c&&(c(),a.delete(l));const d=l.addPropertyListener(i);a.set(l,d);const f=l.shortcut();if(!f)continue;const m=Array.isArray(f)?f:[f];for(let _=0;_<m.length;_++){const p=we(m[_]),E=r.get(p);E&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${p}, ${s}, ${E}.`),r.set(p,s)}}}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 r=i=>{i._children.forEach(a=>{for(let h=0;h<t.length;h++)a._nodes.delete(t[h]);r(a)})};r(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(Y.Alt),e.shiftKey&&t.push(Y.Shift),e.ctrlKey&&t.push(Y.Ctrl),e.metaKey&&t.push(Y.Meta);let n=we({key:e.code,modifiers:t});const r=this._commandsByShortcut;let i=r.get(n);i||(n=we({key:e.key,modifiers:t}),i=r.get(n)),!i&&e.code.startsWith("Digit")&&(n=we({key:e.code.substring(5,e.code.length),modifiers:t}),i=this._commandsByShortcut.get(n)),!i&&e.code.startsWith("Key")&&(i=we({key:e.code.substring(3,e.code.length),modifiers:t}),i=r.get(n));let a=null;return i&&(a=this._commandsByKey.get(i),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,r=t?.keys,i=this._root._listenersByKey;if(r&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let a=null;if(r)for(let h=0;h<r.length;h++){const l=r[h];if(!l)continue;let s=i.get(l);s||(s=new Set,i.set(l,s)),a||(a=[]),a.push(s),s.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 r=this;setTimeout(()=>{e.forEach(i=>{i[t]?.(r,n)})},0)}_notify(e,t){const n=this;setTimeout(()=>{n._listeners.forEach(r=>{r[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 Ln=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Tn=$.CommonUtils.getOS()===$.CommonUtils.OSType.MacOS||$.CommonUtils.getOS()===$.CommonUtils.OSType.IOS?"⌘":"^",we=(o,e=!1)=>{const t={};for(let r=0;o.modifiers&&r<o.modifiers.length;r++)t[o.modifiers[r]]=!0;let n="";return(t?.[Y.Ctrl]||t?.[Y.Meta])&&(n+=(n.length>0?"+":"")+(e?Tn:Ln)),t?.[Y.Alt]&&(n+=e?"⌥":"Alt"),t?.[Y.Shift]&&(n+=(n.length>0?"+":"")+(e?"⇧":"Shift")),n+=(n.length>0?"+":"")+Vt(o.key),n},Fe=(o,e)=>{if(!e||!o||e.length===0)return $.CommonUtils.EmptyArray;const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const i=e[r],a=i?o.getCommand(i):null;n[r]=a}return n};function st(o,e){if(typeof o=="function")return o(e);o&&(o.current=e)}var Ee=parseInt(u.version.split(".")[0],10)>=19?function(o){return e=>{const t=[];for(const n of o){const r=st(n,e),i=typeof r=="function";t.push(i?r:()=>st(n,null))}return()=>{for(const n of t)n()}}}:function(o){return e=>{for(const t of o)st(t,e)}};const kn=u.memo(u.forwardRef((o,e)=>{const{refFocusStart:t,...n}=o,r=u.useRef(null),i=u.useCallback(()=>{if(t)return void t?.current?.focus();const a=r.current.parentElement.children;let h=[];const l=a.length;for(let s=0;s<l&&a[s]!==r.current;s++){const c=a[s],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(s,c){return s.tabindex-c.tabindex}),h[0].child.focus())},[t]);return S.jsx("div",{tabIndex:0,ref:Ee([r,e]),onFocus:i,...n})}));var Pn=function(){},Xt=typeof window<"u",Dn=Xt?u.useLayoutEffect:u.useEffect,St={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const me=Xt&&window.ResizeObserver!==void 0?function(){var o=u.useState(null),e=o[0],t=o[1],n=u.useState(St),r=n[0],i=n[1],a=u.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var l=h[0].contentRect,s=l.x,c=l.y,d=l.width,f=l.height,m=l.top,_=l.left,p=l.bottom,E=l.right;i({x:s,y:c,width:d,height:f,top:m,left:_,bottom:p,right:E})}})},[]);return Dn(function(){if(e)return a.observe(e),function(){a.disconnect()}},[e]),[t,r]}:function(){return[Pn,St]},zn=u.memo(u.forwardRef((o,e)=>{const{className:t,style:n,children:r,radius:i=4,strokeWidth:a=1,strokeColor:h="grey",...l}=o,[s,{width:c,height:d}]=me(),f=u.useRef(null),m=(T,v=0)=>{const g=T/2,b=d-g+v;return(function(j,C,B=!1){if(C===0)return j;function O(P,y,A){let K=y.x-P.x,U=y.y-P.y,z=Math.sqrt(K*K+U*U);return L(P,y,Math.min(1,A/z))}function L(P,y,A){return{x:P.x+(y.x-P.x)*A,y:P.y+(y.y-P.y)*A}}function w(P,y){P.length>2&&(P[P.length-2]=y.x,P[P.length-1]=y.y)}function k(P){return{x:parseFloat(P[P.length-2]),y:parseFloat(P[P.length-1])}}let M=j.split(/[,\s]/).reduce(function(P,y){let A=y.match("([a-zA-Z])(.+)");return A?(P.push(A[1]),P.push(A[2])):P.push(y),P},[]).reduce(function(P,y){return parseFloat(y)==y&&P.length?P[P.length-1].push(y):P.push([y]),P},[]),I=[];if(M.length>1){let P=k(M[0]),y=null;M[M.length-1][0]==="Z"&&M[0].length>2&&(y=["L",P.x,P.y],M[M.length-1]=y),I.push(M[0]);for(let A=1;A<M.length;A++){let K=I[I.length-1],U=M[A],z=U===y?M[1]:M[A+1];if(z&&K&&K.length>2&&U[0]==="L"&&z.length>2&&z[0]==="L"){let W,H,V=k(K),J=k(U),_e=k(z);B?(W=L(J,K.origPoint||V,C),H=L(J,z.origPoint||_e,C)):(W=O(J,V,C),H=O(J,_e,C)),w(U,W),U.origPoint=J,I.push(U);let ce=L(W,J,.5),ge=L(J,H,.5),ue=["C",ce.x,ce.y,ge.x,ge.y,H.x,H.y];ue.origPoint=J,I.push(ue)}else I.push(U)}if(y){let A=k(I[I.length-1]);I.push(["Z"]),w(I[0],A)}}else I=M;return I.reduce(function(P,y){return P+y.join(" ")+" "},"")})(`${`M 0 ${g} L ${i-.5} ${g} L ${i-.5} ${b} L ${2*i} ${b}`} ${`L ${c-2*i} ${b}`} ${`M ${c-2*i} ${b} L ${c-i} ${b} L ${c-i} ${g} L ${c} ${g}`}`,i)},_=u.useMemo(()=>m(a),[c,d,i,a]),p=u.useMemo(()=>{if(i===0)return;const T=i/2;return m(i)+`L ${c} 0 L 0 0 L 0 ${T}`},[_,i,a]),E=u.useMemo(()=>({style:{clipPath:`path('${p}')`}}),[p]);return S.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...l,ref:Ee([f,s,e]),children:[u.isValidElement(r)?u.cloneElement(r,E):S.jsx(S.Fragment,{}),S.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:c,height:d,viewBox:`0 0 ${c} ${d}`,children:S.jsx("path",{d:_,stroke:h,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:a})})]})})),ht={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"};class Yt extends $.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!==ht.Warning?t?.type!==ht.Error?$.Notifier.log(e):$.Notifier.error(e):$.Notifier.warn(e)}showBusy(e,t){const n=this.getDelegate();return n?.showBusy?n.showBusy(e,t):new Promise(r=>{r(()=>{})})}showWindow(e,t){const n=this.getDelegate();if(n?.showWindow)return n.showWindow(e,t)}showError(e){const t=this.getDelegate();t?.showError?t.showError(e):$.Notifier.error(e)}showOptions(e){const t=this.getDelegate();return t?.showOptions?t.showOptions(e):Promise.resolve("")}showInput(e){const t=this.getDelegate();return t?.showInput?t.showInput(e):Promise.resolve({input:"",option:""})}}const An=new Yt,qt=u.createContext(An),Le=()=>u.useContext(qt),Rn=3,jn=.5,Bn=50,lt=o=>({x:o.x,y:o.y,width:o.width,height:o.height,top:o.top,left:o.left,right:o.right,bottom:o.bottom});function Gt(o={}){const{threshold:e=jn,stillnessThreshold:t=Rn,maxHierarchyDepth:n=Bn}=o,[r,i]=me(),a=u.useRef(null),[h,l]=u.useReducer(_=>_+1,0),s=u.useRef(void 0),c=u.useRef({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0}),d=u.useCallback(_=>{a.current=_,typeof r=="function"&&r(_)},[r]),[f,m]=u.useState(i);return u.useEffect(()=>{i&&!f&&m(i)},[i,f]),u.useEffect(()=>{const _=a.current;if(!_)return;let p=!1,E=0;const T=()=>{if(!_)return;const C=_.getBoundingClientRect(),B=c.current;Math.abs(C.x-B.x)>e||Math.abs(C.y-B.y)>e||Math.abs(C.width-B.width)>e||Math.abs(C.height-B.height)>e?(p||(p=!0,m(lt(C)),l()),E=0):E++,p&&E>=t&&(p=!1,m(lt(C)),l()),c.current=lt(C),s.current=requestAnimationFrame(T)};s.current=requestAnimationFrame(T);const v=C=>{p=!0,l()},g=C=>{p=!1,E=t,l()};let b=_;const j=[];for(;b&&b!==document.documentElement&&(b.addEventListener("animationstart",v,!0),b.addEventListener("animationend",g,!0),b.addEventListener("transitionstart",v,!0),b.addEventListener("transitionend",g,!0),j.push(b),b=b.parentElement,!(j.length>n)););return()=>{s.current&&cancelAnimationFrame(s.current),j.forEach(C=>{C.removeEventListener("animationstart",v,!0),C.removeEventListener("animationend",g,!0),C.removeEventListener("transitionstart",v,!0),C.removeEventListener("transitionend",g,!0)})}},[h,i,e,t,n]),[d,f]}const D=(o,e)=>{const t=u.useCallback((...i)=>o?.(...i),e),n=u.useRef(null);n.current=t;const r=u.useCallback((...i)=>n.current?.(...i),[]);if(n.current)return r};let Ue=0;function Zt(){const[o,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 r=document.fullscreenElement;if(e(!!r),!r)return;let i=r.querySelector(".fullscreen-portal-root");i||(i=document.createElement("div"),i.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",r.appendChild(i))}return Ue++,n(),document.addEventListener("fullscreenchange",n),()=>{document.removeEventListener("fullscreenchange",n),Ue--,Ue<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(r=>{r.parentNode&&r.parentNode.removeChild(r)}),Ue=0)}},[]),{getPortalContainer:t,isFullscreen:o}}function dt(o){if(!o)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:t,onPointerMoveOrWait:n,processTouch:r=!1,consumeTouch:i=!0}=o,a=D(e,[e]),h=D(t,[t]),l=D(n,[n]),s=u.useRef(!1),c=o?.timerInitial??230,d=o?.timerContinuous??c/2,f=u.useRef(null),m=u.useRef(null),_=u.useRef(null),p=u.useRef(null),E=u.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null)},[]),T=u.useCallback(w=>{p.current=setTimeout(()=>{window.requestAnimationFrame(()=>{if(s.current===!1)return;const k=m.current,M=f.current,I=qe(k,M.currentTarget);l?.(I,_.current,M)}),T(d)},w??c)},[]);u.useEffect(()=>()=>E(),[]);const v=r?"pointer":"mouse",g=u.useCallback(w=>{w.stopPropagation(),w.stopImmediatePropagation(),w.preventDefault()},[]),b=D(w=>{document.removeEventListener(`${v}move`,B),document.removeEventListener(`${v}up`,b),document.removeEventListener("keydown",O),document.removeEventListener("keyup",L),document.removeEventListener("touchstart",g,{capture:!0}),document.removeEventListener("touchmove",g,{capture:!0}),window.removeEventListener("blur",j),E(),window.requestAnimationFrame(()=>{if(s.current===!1)return;s.current=!1;const k=w,M=f.current,I=qe(k,M.currentTarget);h?.(I,_.current,M),_.current=null})},[]),j=u.useCallback(()=>{s.current!==!1&&(s.current=!1,b(m.current))},[]),C=D(()=>{E(),T(d),window.requestAnimationFrame(()=>{if(s.current===!1)return;const w=m.current,k=f.current,M=qe(w,k.currentTarget);l?.(M,_.current,k)})},[d]),B=D(w=>{m.current=w,C()},[]),O=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},C()},[]),L=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},C()},[d]);return D(w=>{w.isDefaultPrevented()||(_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},a(w,_.current)!==!1&&(f.current=w,m.current=w.nativeEvent,document.addEventListener(`${v}up`,b,{passive:!1}),document.addEventListener(`${v}move`,B,{passive:!1}),document.addEventListener("keydown",O,{passive:!1}),document.addEventListener("keyup",L,{passive:!1}),window.addEventListener("blur",j,{passive:!0}),r&&i&&(document.addEventListener("touchstart",g,{passive:!1,capture:!0}),document.addEventListener("touchmove",g,{passive:!1,capture:!0})),s.current=!0,T(c)))},[c,r])}const On=({initValue:o,useHookBody:e,applyStateChange:t})=>{const n=u.useRef(o);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const r=e();return u.useLayoutEffect(()=>{n.current!==r&&(n.current=r,t(r))},[t,r]),null},ft=o=>{console&&console.warn&&console.warn(o)},at=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let In=1,pt=!1,Jt=!1;const Ge=[],xe=[],Je=()=>{xe.forEach(o=>o())},$n=({automaticContainerInternalUseOnly:o})=>{const[e,t]=u.useState([]),n=u.useRef([]);return n.current=e,o||pt!==!1||(Jt=!0),u.useEffect(()=>{let r=!0;function i(){if(r)return xe[0]!==i?(o||pt!==!0||ft("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([...Ge])}return xe.push(i),Je(),()=>{r=!1,n.current?.length>0&&ft("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),xe.splice(xe.indexOf(i),1),Je()}},[o]),S.jsx(S.Fragment,{children:e.map(({hook:r,key:i})=>u.createElement(On,{...r,key:i}))})},Nn=o=>{const e=In++;return Ge.push({hook:o,key:e}),xe.length===0&&Jt===!1&&(pt=!0,(t=>{if(at.document&&at.document.createElement){const n=at.document.createElement("div");gn.createRoot(n).render(S.jsx(t,{automaticContainerInternalUseOnly:!0}))}else ft("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})($n)),Je(),()=>{Ge.splice(Ge.findIndex(t=>t.key===e),1),Je()}};let mt=null;mt||(mt=(o,e,t={})=>{let n,r,i=!1,a=!1,h=[],{unmountIfNoConsumers:l=!1}=t;const s=d=>{var f;r=d,f=()=>h.forEach(m=>m(d)),Nt.unstable_batchedUpdates(f)},c=()=>(a||(r=typeof o=="function"?o():o,a=!0),r);return()=>{const[d,f]=u.useState(c);return u.useEffect(()=>(i||(i=!0,n=Nn({initValue:o,useHookBody:e,applyStateChange:s})),h.push(f),r!==d&&f(r),()=>{h.splice(h.indexOf(f),1),h.length===0&&l&&(n(),i=!1)}),[]),d}});const Qt=mt;let en=()=>{console.warn("You must call useEditMode before setting its state.")};const Kn=Qt(null,()=>{const[o,e]=u.useState(null);return en=e,o}),Et=Qt({setClipboard:o=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>$.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[o,e]=u.useState($.InternalClipboard.Global);return{setClipboard:t=>e(t),getClipboard:()=>o,refNativeCopy:u.useRef(null),refNativeLastKey:u.useRef(null)}});let ct=!1,Hn=0;var Wn=typeof document<"u"?u.useLayoutEffect:u.useEffect;const Ct=()=>"sheetxl-ui-"+Hn++,Mt=u.useId,Fn=Mt??function(){const[o,e]=u.useState(()=>ct?Ct():void 0);return Wn(()=>{o==null&&e(Ct())},[]),u.useEffect(()=>{ct||(ct=!0)},[]),o},Un=[];function et(o,e,t=Un){const n=u.useRef(null);return u.useImperativeHandle(o,()=>{if(!n.current)return;const r=n.current,i=e?.();if(!i||typeof i!="object")throw new Error("attributes must return a plain object of values");const a=Object.keys(i),h=a.length;for(let l=0;l<h;l++){const s=a[l],c=i[s];Object.defineProperty(r,s,{value:c,writable:!0,configurable:!0,enumerable:!0})}return r},t),n}const Lt="Undo the last action.",Tt="Repeat the last action or undo the redo.",Vn=o=>`Redo ${o}`;class Xn extends u.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError?.(e)}render(){return this.props.children}}class Yn{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)}}function tn(o){var e,t,n="";if(typeof o=="string"||typeof o=="number")n+=o;else if(typeof o=="object")if(Array.isArray(o)){var r=o.length;for(e=0;e<r;e++)o[e]&&(t=tn(o[e]))&&(n&&(n+=" "),n+=t)}else for(t in o)o[t]&&(n&&(n+=" "),n+=t);return n}function X(){for(var o,e,t=0,n="",r=arguments.length;t<r;t++)(o=arguments[t])&&(e=tn(o))&&(n&&(n+=" "),n+=e);return n}const qn={},nn=o=>{const{onPointerDown:e,style:t,splitDirection:n,paddingBefore:r=0,paddingAfter:i=0,disabled:a,key:h,propsHitArea:l=qn,...s}=o,c=n==="row",{style:d,className:f,...m}=l;return S.jsx("div",{style:{...t,position:"relative"},...s,children:S.jsx("div",{className:X("hit-box",f),style:{left:(c?-r:0)+"px",width:`calc(100% + ${c?r+i:0}px)`,top:(c?0:-r)+"px",height:`calc(100% + ${c?0:r+i}px)`,position:"absolute",...d},onPointerDown:a?void 0:e,...m})},h)},Ve={},fe=(o,e,t=!0)=>o===null?null:o.pixels!==null?t?o.pixels:e-o.pixels:(t?o.percent:100-o.percent)/100*e,Xe=(o,e=!0)=>o?.percent?`${e?o.percent:100-o.percent}%`:o?.pixels?`${o.pixels}px`:void 0,se=(o,e)=>{if(o==null)return null;const t={percent:null,pixels:null};let n=e;return typeof o=="string"&&((o=o.trim().toLowerCase()).endsWith("px")?(o=o.substring(0,o.length-2),n=!1):o.endsWith("%")&&(o=o.substring(0,o.length-1),n=!0),o=parseFloat(o)),n?t.percent=o:t.pixels=o,Object.freeze(t)},on=u.memo(u.forwardRef((o,e)=>{const{elementBefore:t,elementAfter:n,splitDirection:r="row",fixedPane:i=null,position:a,onPositionChange:h,minBefore:l,maxBefore:s,minAfter:c,maxAfter:d,children:f,className:m,style:_,disabled:p=!1,onDragStart:E,onDragResize:T,onDragFinish:v,propsResizer:g=Ve,propsPane:b=Ve,propsPaneBefore:j=Ve,propsPaneAfter:C=Ve,renderResizer:B=nn}=o;if(f)throw new Error("Use elementBefore and elementAfter instead of children.");const O=u.useMemo(()=>u.isValidElement(n)&&u.isValidElement(t),[n,t]),L=u.useMemo(()=>{let R=null;i&&(i==="before"?R=0:i==="after"&&(R=1));const F=R===null;return{fixedPaneOffset:R,isPercent:F,minBefore:se(l,F),maxBefore:se(s,F),minAfter:se(c,F),maxAfter:se(d,F)}},[l,s,c,d]),w=D(h,[h]),[k,M]=u.useState(()=>se(a,i===null));u.useEffect(()=>{M(se(a,i===null))},[a,i]);const[I,{width:P,height:y}]=me(),[A,{width:K,height:U}]=me(),z=r==="row"?K:U,W=r==="row"?P:y,H=u.useMemo(()=>((R,F,Q,G)=>{const re=[null,null],oe=[null,null];if(R||(R={percent:G.fixedPaneOffset===null?50:null,pixels:G.fixedPaneOffset===null?null:0}),F===0)return R?.pixels!=null?G.fixedPaneOffset!==1?(re[0]=R?.pixels,oe[1]=100):(re[1]=R?.pixels-Q,oe[0]=100):R?.percent!=null&&(G.fixedPaneOffset!==1?(oe[0]=R?.percent,oe[1]=100-R?.percent):(oe[1]=R?.percent,oe[0]=100-R?.percent)),{percents:oe,pixels:re,minBefore:Xe(G.minBefore,!0),maxBefore:Xe(G.maxBefore,!0),minAfter:Xe(G.minAfter),maxAfter:Xe(G.maxAfter)};let ie=fe(R,F,G.fixedPaneOffset!==1),te=F-Q,yt=fe(G.minBefore,te,!0)??0,mn=fe(G.maxBefore,te,!0)??te,He=0,it=0,vt=0,bt=te;He=(fe(G.maxAfter,F,!1)??Q)-Q,it=fe(G.minAfter,F,!1)??F,vt=Math.max(yt,He),bt=Math.min(mn,it),ie=Math.max(vt,Math.min(ie,bt)),it=Math.min(te-ie,fe(G.maxAfter,te-ie,!0)??te),He=Math.min(te-ie,fe(G.minAfter,te-ie,!0)??te),re[0]=ie,re[1]=te-re[0];const _n=Math.max(0,Math.min(100,ie/te*100));return oe[0]=_n,oe[1]=100-oe[0],{percents:oe,pixels:re,minBefore:`${yt}px`,minAfter:`${He}px`,maxBefore:`${re[0]}px`,maxAfter:`${re[1]}px`}})(k,W,z,L),[L,k,W,z,r]),[V,J]=u.useState(!1),_e=D(E,[E]),ce=D(T,[T]),ge=D(v,[v]),ue=u.useRef(null),tt=u.useRef(null),De=u.useRef(null),{style:nt,className:ze,...Ae}=b,Re={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",height:"100%",widthResizer:"100%",display:"flex",overflow:"hidden",position:"relative",...nt},{className:ot,style:je,...Be}=j,{className:Oe,style:Ie,...ye}=C,Ce={flex:"1 1 100%",width:"100%",..._,flexDirection:r,display:"flex"},{className:ne,style:ve,onPointerDown:$e,...Ne}=g,Me=D(R=>{const F=se(R,i===null);M(F)},[i]),x=D(R=>{if(p||!V)return;const F=he.current?.getBoundingClientRect();let Q=0;Q=r==="row"?(R.clientX??R.touches?.[0]?.clientX)-F.x:(R.clientY??R.touches?.[0]?.clientY)-F.y,Q=Math.max(0,Math.min(W,Q)),L.fixedPaneOffset===1&&(Q=W-Q),a&&k.pixels===Q||M({pixels:Q,percent:null}),ce?.(Q),R.stopPropagation(),R.preventDefault()},[L,r,p,V,k,W]),N=D(R=>{if(document.removeEventListener("pointermove",x),document.removeEventListener("touchmove",x),document.removeEventListener("pointerup",N),!!V&&(J(!1),!!k)){if(ge(k.pixels),!se(a,i===null)||k.pixels!==a){const F={...k};F.percent===null&&(F.percent=F.pixels/W*100),w(F)}R.stopPropagation(),R.preventDefault()}},[k,V,a,i,W]),q=D(R=>{$e?.(R),R.defaultPrevented||p||V||(J(!0),_e(),document.addEventListener("pointermove",x,{passive:!1}),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("pointerup",N,{passive:!1}))},[$e]),he=et(e,()=>({setPosition:Me,isSplitPane:()=>!0}),[]),be=u.useMemo(()=>O?B?.({key:"resizer",ref:Ee([A,tt]),className:X("resizer",ne),onPointerDownCapture:q,style:{cursor:p?void 0:r==="row"?"ew-resize":"ns-resize",minWidth:r==="row"?"2px":void 0,minHeight:r!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...ve},splitDirection:r,disabled:p,...Ne}):null,[O,ne,Ne,r,ve,p]),de=r==="row"?"Width":"Height",rt=u.useMemo(()=>{if(!t)return null;const R={...Re,...je,flex:L.fixedPaneOffset===0&&H?.pixels[0]!==null?`0 0 ${Math.round(H?.pixels[0])}px`:`1 1 ${Math.round(H?.percents[0]??100)}%`,[`min${de}`]:H?.minBefore,[`max${de}`]:n?H?.maxBefore:"100%"};return S.jsx("div",{ref:ue,className:X("before",ze,ot),style:R,...Ae,...Be,children:t},"before")},[t,b,j,L,H]),Ke=u.useMemo(()=>{if(!n)return null;const R={...Re,...Ie,flex:L.fixedPaneOffset===1&&H?.pixels[1]!==null?`0 0 ${Math.round(H?.pixels[1])}px`:`1 1 ${Math.round(H?.percents[1]??100)}%`,[`min${de}`]:H?.minAfter,[`max${de}`]:t?H?.maxAfter:"100%"};return S.jsx("div",{ref:De,className:X("after",ze,Oe),style:R,...Ae,...ye,children:n},"after")},[n,b,C,L,H]);return S.jsxs("div",{ref:Ee([I,he]),className:X("splitPane",r==="row"?"vertical":"horizontal",{dragging:V},m),style:Ce,children:[rt,be,Ke]})}));function Gn(o){if(typeof o=="function")return o;if(typeof o=="string"){const e=o.trim();if(e.startsWith("data:image/svg+xml")){const t=(function(n){const r=/^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());if(!r)return null;const i=r[1]||"",a=r[2]||"";try{if(/;base64/i.test(i)){if(typeof atob<"u"){const h=atob(a),l=h.length;if(typeof TextDecoder<"u"){const c=new Uint8Array(l);for(let d=0;d<l;d++)c[d]=h.charCodeAt(d);return new TextDecoder("utf-8").decode(c)}let s="";for(let c=0;c<l;c++)s+=`%${h.charCodeAt(c).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 Dt(t)}if(e.startsWith("<")){if(/^<\s*svg\b/i.test(e))return Dt(e);if(/^<\s*path\b/i.test(e)){const t=kt(e);if(t)return{paths:[{d:t}]}}return{paths:[{d:e}]}}return{paths:[{d:e}]}}if(Array.isArray(o)){const e=[];for(const t of o)if(typeof t=="string"){const n=String(t).trim();if(n.startsWith("<path")){const r=kt(n);r&&e.push({d:r})}else e.push({d:n})}else t&&typeof t=="object"&&"d"in t&&typeof t.d=="string"&&e.push({...t});return{paths:e}}return o}function kt(o){const e=/\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);return e?e[1]??e[2]??null:null}function Pt(o){if("svg"in o)return{...o,svg:Gn(o.svg)};if("url"in o){const e=typeof o.url=="string"?{src:o.url}:o.url;return{...o,url:e}}if("emoji"in o){const e=typeof o.emoji=="string"?o.emoji:o.emoji.text;return{...o,emoji:e}}return o}function Dt(o){try{if(typeof DOMParser<"u"){const a=new DOMParser().parseFromString(o,"image/svg+xml"),h=a.querySelector("svg"),l=h?.getAttribute("viewBox")??void 0,s=[];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 _=c.getAttribute("fill");_&&_!=="none"&&(f.fill=_);const p=c.getAttribute("stroke");p&&(f.stroke=p);const E=c.getAttribute("opacity");E&&(f.opacity=Number(E));const T=c.getAttribute("fill-rule");T&&(f.fillRule=T);const v=c.getAttribute("clip-rule");v&&(f.clipRule=v),s.push(f)}),{viewBox:l,paths:s}}}catch{}const e=o.match(/viewBox="([^"]+)"/i),t=e?e[1]:void 0,n=[],r=/<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;let i;for(;i=r.exec(o);)n.push({d:i[1]});return{viewBox:t,paths:n}}function zt(o){const e={};for(const[i,a]of Object.entries(o.icons))e[i]=Pt(a);const t={label:o.meta?.label??"Unnamed",version:o.meta?.version??"1.0.0",license:o.meta?.license??"MIT",defaultViewBox:"0 0 24 24",extends:o.meta?.extends??[]};t.extends.includes("base")||t.extends.push("base");const n={meta:t,icons:e},r=o.overrides;if(r){const i={};for(const[a,h]of Object.entries(r)){const l={};for(const[s,c]of Object.entries(h))l[s]=Pt(c);i[a]=l}n.__overrides=i}return n}function rn(){const o=new Map,e=new Map;let t="base",n=new Map;async function r(l){const s=o.get(l??t);if(!s)throw new Error(`Icon pack not registered: ${l}`);if(!s.pack){if(!s.loading){if(!s.loader)throw new Error(`No loader for icon pack: ${l}`);s.loading=s.loader().then(c=>{const d=c&&typeof c=="object"&&"default"in c?c.default:c;s.pack=zt(d)}).catch(c=>{throw s.loading=void 0,c})}await s.loading}}function i(l){const s=l.indexOf(":");return s>0?{ns:l.slice(0,s),key:l.slice(s+1)}:{key:l}}function a(l,s){const c=[l,...o.get(l)?.pack?.meta.extends??[]];for(const d of c){const f=o.get(d);if(!f?.pack)continue;const{icons:m}=f.pack,_=m[e.get(d)?.get(s)??s]??m[s];if(_)return{glyph:_,pack:f.pack,packKey:d}}return null}function h(l,s){const c=s?.packKey??t;if(s?.packKey)return a(s.packKey,l);if(!l)return null;const{ns:d,key:f}=i(l);if(d){const m=o.get(d)?.pack;if(m){if(o.get(t)?.pack){const p=m.__overrides,E=p?.[t]?.[f];if(E)return{glyph:E,pack:m,packKey:d}}const _=a(d,f);if(_)return _}return null}return a(c,l)}return{register:function(l,s){const c=o.get(l)??{};typeof s=="function"?c.loader=s:c.pack=zt(s),o.set(l,c),t||(t=l)},prefetch:async function(l=t){const s=Array.isArray(l)?l:[l];await Promise.all(s.map(r))},setActive:function(l){t=l;for(const s of n.keys())try{s(l)}catch{}},getActive:function(){return t},resolve:async function(l,s){let c=h(l,s);if(c)return c;const d=s?.packKey??t,{ns:f}=i(l);if(s?.packKey){if(await r(d),c=h(l,s),c)return c;const m=o.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}else if(f){if(await r(f),c=h(l,s),c)return c;const m=o.get(f)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}else{if(await r(d),c=h(l,s),c)return c;const m=o.get(d)?.pack?.meta?.extends??[];if(m.length&&(await Promise.all(m.map(r)),c=h(l,s),c))return c}return null},registerAlias:function(l,s,c){e.has(l)||e.set(l,new Map),e.get(l).set(s,c)},has:function(l,s){return!!h(l,s)},getPack:function(l){return o.get(l??t)?.pack},hasPack:function(l){return!!o.get(l)?.pack},listPacks:function(){return Array.from(o.keys())},listIcons:function(l){const s=o.get(l)?.pack;return s?Object.keys(s.icons):[]},addActiveListener:function(l){const s=n.get(l);if(s)return s;const c=()=>{n.delete(l)};return n.set(l,c),c}}}on.displayName="SplitPane";const ke=rn();ke.register("base",()=>Promise.resolve().then(()=>require("./BA9O-cekHrH5qrOm.cjs")));const At=o=>S.jsx("svg",{...o,children:S.jsx("path",{})}),Zn={Icon:"_Icon_17dpm_10"},Rt=u.memo(o=>{const{iconKey:e,packKey:t,className:n,style:r,role:i,title:a,size:h,ariaHidden:l,propsSource:s,children:c,...d}=o,[f,m]=u.useState(null);u.useEffect(()=>{let M=!0,I=t,P=e;if(!P){const y=ke.getPack(I);return void m({glyph:y?{svg:$.CommonUtils.EmptyArray}:void 0,pack:y??void 0,packKey:I??ke.getActive()})}if(P.includes(":")){const[y,A]=P.split(":");I=y,P=A}return ke.resolve(P,{packKey:I}).then(y=>{M&&m(y)}),()=>{M=!1}},[e,t]);const _=f?.pack,p=f?.glyph,E=f?.packKey;let T=p?p.svg:void 0;const v=p&&!T?p.url:void 0,g=!p||T||v?void 0:p.emoji,b=h!=null?typeof h=="number"?`${h}px`:h:void 0,j=u.useMemo(()=>[Zn.Icon,"icon",n].filter(Boolean).join(" "),[n]),C=u.useMemo(()=>{const M={...r};return M["--icon-size"]=b,M},[r,b]),B=i??(a?"img":"presentation"),O=l??(!a||void 0),L=M=>S.jsx("span",{className:j,style:C,role:B,"aria-hidden":O,title:a,"data-icon-glyph":e,"data-icon-pack":E,...d,children:M});if(c)return L(c);if(g)return L(S.jsx("span",{children:typeof g=="string"?g:g.text}));if(v)return L(S.jsx("img",{src:v.src,alt:a??""}));if(p&&"react"in p){const M=p.react,I={className:j,style:C,role:B,"aria-hidden":O,title:a,...d,...s};return L(S.jsx(M,{...I}))}const w={viewBox:T?.viewBox??_?.meta.defaultViewBox??"0 0 24 24"};if(typeof T=="function")return L(T(w)??S.jsx(At,{...w}));if(!T)return L(S.jsx(At,{...w}));const k=T.paths;return L(S.jsx("svg",{...w,children:k?k.map((M,I)=>S.jsx("path",{d:M.d,className:M.className,fill:M.fill,stroke:M.stroke,opacity:M.opacity,fillRule:M.fillRule,clipRule:M.clipRule},I)):null}))});class Ze{constructor(){this.store=new Map}async getItem(e){return this.store.get(e)??null}async setItem(e,t){this.store.set(e,t)}async removeItem(e){this.store.delete(e)}}const jt=u.createContext(null),sn={parse:o=>o?JSON.parse(o):null,stringify:JSON.stringify},Jn={store:new Ze,namespace:"",serializer:sn,debounceMs:0,crossTabSync:!1,notify:()=>{},subscribeKey:()=>()=>{}},Qn={},eo={parse:o=>o==null?null:JSON.parse(o),stringify:JSON.stringify},Z={Horizontal:"horizontal",Vertical:"vertical"},pe={scrollbar:"_scrollbar_gqxsx_24",track:"_track_gqxsx_35",thumb:"_thumb_gqxsx_47","scrollbar-button":"_scrollbar-button_gqxsx_89","touch-thumb":"_touch-thumb_gqxsx_124"},ln="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",an="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",to={transform:"rotate(180deg)"},cn=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return S.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:S.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:S.jsx("path",{d:i})})})},un=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return S.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:S.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:to,children:S.jsx("path",{d:i})})})},no=Pe().supportsTouchEvents,hn=u.memo(u.forwardRef((o,e)=>{const{borderColor:t="var(--sxl-app-color-primary, rgb(33, 115, 70))",backgroundColor:n="var(--sxl-app-color-background, white)",fillColor:r="var(--sxl-app-color-grey, grey)",borderWidth:i=3,size:a=22,style:h,className:l,onPointerDown:s,onPointerMove:c,onPointerUp:d,orientation:f=Z.Vertical,offset:m=0,currentTouchAnchor:_,elementParent:p,elementRoot:E,key:T,...v}=o;if(!no)return null;const g=D(s,[s]),b=D(c,[c]),j=D(d,[d]),C=f===Z.Vertical,[B,O]=u.useState(!1),L=dt(u.useMemo(()=>({processTouch:!0,consumeTouch:!0,onPointerDown:(z,W)=>{O(!0),g?.(z),z.preventDefault(),z.stopPropagation()},onPointerMoveOrWait:(z,W,H)=>{b?.(z)},onPointerUp:(z,W,H)=>{O(!1),j?.(H),z.preventDefault(),z.stopPropagation()}}),[])),w=u.useMemo(()=>{const z=a/2+i/2+6;return{x:C?-z:m+a,y:C?m+a:-z,width:0,height:0}},[C,m,a]),[k,{y:M,x:I}]=Gt(),P=u.useRef(null),{getPortalContainer:y,isFullscreen:A}=Zt(),[K,U]=u.useState(null);return u.useEffect(()=>{const z=P.current?.getBoundingClientRect();if(!z)return void U(null);let W=0,H=0,V=p;for(;V;)W+=V.scrollLeft,H+=V.scrollTop,V=E&&V===E.parentElement?null:V.parentElement;U(Nt.createPortal(S.jsx("div",{className:X("touch-thumb",pe["touch-thumb"],l,pe,{dragging:B}),ref:e,style:{left:W+(z?.x??0)-(a+i)/2,top:H+(z?.y??0)-(a+i)/2,width:C?a:1.8*a,height:C?1.8*a:a,borderWidth:`${i}px`,boxShadow:B?`${n} 0px 0px 0px 1.5px`:void 0,borderStyle:"solid",borderColor:t,backgroundColor:n,opacity:_?0:void 0,transitionDuration:"160ms",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center center",...h},tabIndex:-1,onPointerDown:L,...v}),E??y(),T))},[M,B,t,n,r,I,w?.x,w?.y,w?.width,w?.height,l,_,n,a,i,t,p,A,T]),w?S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:Ee([k,P]),style:{position:"absolute",left:w.x,top:w.y,opacity:0}}),K]}):null}));hn.displayName="TouchThumbHandle";const oo=24,dn=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,totalSize:n=0,viewportSize:r=0,style:i,className:a,orientation:h=Z.Vertical,onScrollOffset:l,onScroll:s,showCustomScrollButtons:c,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:m=120,minThumbSize:_=oo,maxThumbSize:p,renderScrollButtonStart:E=cn,renderScrollButtonEnd:T=un,propsTouchThumb:v,propsThumb:g,onMouseDown:b,...j}=o,C=Pe().primaryInput==="touch",B=c??!C;D(s,[s]);const[O,L]=u.useState({offset:0,length:0,disabled:!1}),w=u.useRef(-1),k=h===Z.Vertical,[M,{width:I,height:P}]=me(),y=k?P:I,A=D((x,N,q)=>{if(N===0||q===0){const Ke={offset:0,length:_,disabled:!0};return L(Ke),Ke}if(N>=q)return{offset:0,length:y,disabled:!0};const he=q/y,be=N/he,de=Math.min(Math.max(_,be),Math.min(y,p??Number.MAX_SAFE_INTEGER)),rt=x/he;return{offset:Math.min(Math.max(0,rt),y-de),length:de,disabled:!1}},[y,_,p]),K=D(x=>{const N=n/y,q=Math.round(x*N);L(A(q,r,n)),l?.(q,r,n),w.current=x},[l,r,n,y,O]),U=D(x=>{L(A(x,r,n)),l?.(x,r,n),w.current=x},[l,r,n]);u.useEffect(()=>{w.current!==t&&y!==0&&(w.current=-1,L(A(t,r,n)))},[t]),u.useEffect(()=>{y!==0&&L(A(t,r,n))},[r,n,k,y]);const z=Math.max(0,n-r),[W,H]=u.useState(!1),V=u.useRef(0),J=u.useRef(0),_e=et(e,()=>({isScrollbar:()=>!0}),[]),ce=D(x=>{H(!0),V.current=k?x.clientY:x.clientX,J.current=O.offset},[k,O]),ge=D(x=>{x.currentTarget.setPointerCapture(x.pointerId),ce(x),x.stopPropagation()},[b]),ue=D(x=>{if(!W)return;const N=(k?x.clientY:x.clientX)-V.current,q=J.current+N;K(q)},[W,k]),tt=D(x=>{ue(x)},[]),De=D(x=>{H(!1)},[]),nt=D(x=>{try{x.currentTarget.releasePointerCapture(x.pointerId)}catch{}De(x)},[]),ze=D(x=>{if(!x.currentTarget)return;const N=x.currentTarget.getBoundingClientRect(),q=k?x.clientY-N.top:x.clientX-N.left;K(q)},[k,O,r,n]),Ae=D(x=>{const N=Math.max(1,Math.floor(.9*r));k?(x.key==="ArrowDown"&&K(Math.min(z,t+1)),x.key==="ArrowUp"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(z,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(z)):(x.key==="ArrowRight"&&K(Math.min(z,t+1)),x.key==="ArrowLeft"&&K(Math.max(0,t-1)),x.key==="PageDown"&&K(Math.min(z,t+N)),x.key==="PageUp"&&K(Math.max(0,t-N)),x.key==="Home"&&K(0),x.key==="End"&&K(z))},[k,r,n,t,z]),Re=u.useRef(null),ot=u.useMemo(()=>{const x=O.disabled;if(x)return null;const N=S.jsx("div",{...g,className:X(pe.thumb,{disabled:x}),ref:Re,role:"slider","aria-label":k?"Rows":"Columns","aria-orientation":k?"vertical":"horizontal","aria-valuemin":0,"aria-valuemax":z,"aria-valuenow":t,tabIndex:0,style:{...g?.style,position:"relative",[k?"height":"width"]:`${O.length}px`,[k?"width":"height"]:"100%",transform:k?`translateY(${O.offset}px)`:`translateX(${O.offset}px)`,[k?"minHeight":"minWidth"]:`${_}px`},onMouseDown:b,onPointerDown:ge,onPointerMove:tt,onPointerUp:nt});return!C||x?N:S.jsxs(S.Fragment,{children:[N,S.jsx(hn,{...v,offset:O.offset,orientation:k?Z.Vertical:Z.Horizontal,onPointerDown:ce,onPointerMove:ue,onPointerUp:De})]})},[O,_,z,t,k,C,b,v,g]),[je,Be]=u.useState(null),Oe=D(()=>{let x;x=typeof d=="function"?d(t,r,n):t-d;const N=Math.max(0,x);return U(N),Be(N),N},[d,t,r,n]),Ie=D(()=>{let x;x=typeof d=="function"?d(t,r,n):t+d;const N=Math.min(z,x);return U(N),Be(N),N},[d,t,z,r,n]),ye=u.useRef(null),Ce=u.useRef(null),ne=u.useCallback(()=>{ye.current&&(clearTimeout(ye.current),ye.current=null,Ce.current=null)},[]),ve=u.useCallback((x,N,q,he=f)=>{Ce.current=x,ye.current=setTimeout(()=>{const be=q?Oe():Ie();be!==Ce.current?ve(be,!1,q,m):ne()},N?0:he)},[Oe,Ie,ne]);u.useEffect(()=>()=>ne(),[ne]);const $e=u.useMemo(()=>{if(!B)return null;const x={orientation:h,disabled:t<=0,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ve(t,!0,!0)};return E?.(x)},[B,h,t,je]),Ne=u.useMemo(()=>{if(!B)return null;const x={orientation:h,disabled:t>=z,onMouseUp:ne,onMouseLeave:ne,onMouseDown:()=>ve(t,!0,!1)};return T?.(x)},[B,h,t,z,je]),Me=k?"vertical":"horizontal";return S.jsxs("div",{ref:Ee([_e,e]),className:X(a,pe.scrollbar,Me,{dragging:W,"has-touch-thumb":C}),style:i,...j,children:[$e,S.jsx("div",{ref:M,role:"scrollbar","aria-orientation":Me,"aria-valuemin":0,"aria-valuemax":z,"aria-valuenow":t,tabIndex:0,className:X(pe.track,"track",Me),onMouseDown:b,onPointerDown:ze,onKeyDown:Ae,children:ot}),Ne]})}));let Bt=Date.now,Ot=1e3,ae={},ro=1;const Te=o=>{let e=ae[o]!==null;return e&&(ae[o]=null),e},It=(o,e,t,n=0,r)=>{let i=Bt(),a=i,h=0,l=0,s=0,c=ro++;if(c%20==0){const f={};for(let m in ae)f[m]=!0;ae=f}const d=function(f){let m=f!==!0,_=Bt(),p=!0;try{p=(!e||e(c))??!0}catch{p=!1}if(!ae[c]||!p)return ae[c]=null,void t?.(60-l/((_-i)/Ot),c,!1);if(m){s=Math.round((_-a)/16.666666666666668)-1;for(let v=0;v<Math.min(s,4);v++)d(!0),l++}n&&(h=(_-i)/n,h>1&&(h=1));let E=r?r(h):h,T=!1;try{T=o(E,_,m)}catch{T=!1}T!==!1&&h!==1||!m?m&&(a=_,requestAnimationFrame(d)):(ae[c]=null,t?.(60-l/((_-i)/Ot),c,h===1||n==null))};return ae[c]=!0,requestAnimationFrame(d),c},io=function(o){return Math.pow(o-1,3)+1},so=function(o){return(o/=.5)<1?.5*Math.pow(o,3):.5*(Math.pow(o-2,3)+2)};class lo{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,r){e!==null&&(this.__clientWidth=e),t!==null&&(this.__clientHeight=t),n!==null&&(this.__contentWidth=n),r!==null&&(this.__contentHeight=r),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,r,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0);const a=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),r===void 0&&(r=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);const h=e/a;let l=h*(this.__scrollLeft+n)-n,s=h*(this.__scrollTop+r)-r;l>this.__maxScrollLeft?l=this.__maxScrollLeft:l<0&&(l=0),s>this.__maxScrollTop?s=this.__maxScrollTop:s<0&&(s=0),this.__publish(l,s,e,t)}zoomBy(e,t=!1,n=0,r=0,i){this.zoomTo(this.__zoomLevel*e,t,n,r,i)}scrollTo(e,t,n=!1,r=1){if(this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0),r!==void 0&&r!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=r,t*=r,this.__computeScrollMax(r)}else r=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,r,n)}scrollBy(e=0,t=0,n=!1){const r=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(r+(e||0),i+(t||0),n)}doMouseZoom(e,t,n,r){const i=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,r-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,r;this.__interruptedAnimation=!0,this.__isDecelerating&&(Te(this.__isDecelerating),this.__isDecelerating=0,this.__interruptedAnimation=!0),this.__isAnimating&&(Te(this.__isAnimating),this.__isAnimating=0,this.__interruptedAnimation=!0);let i=e.length===1;i?(n=e[0].pageX,r=e[0].pageY):(n=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=r,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=r,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!i&&this.options.scrollingX,this.__enableScrollY=!i&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!i,this.__isSingleTouch=i,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 r,i;e.length===2?(r=Math.abs(e[0].pageX+e[1].pageX)/2,i=Math.abs(e[0].pageY+e[1].pageY)/2):(r=e[0].pageX,i=e[0].pageY);let a=this.__positions;if(this.__isDragging){let h=r-this.__lastTouchLeft,l=i-this.__lastTouchTop,s=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=r-this.__clientLeft,_=i-this.__clientTop;s=(m+s)*d/f-m,c=(_+c)*d/f-_,this.__computeScrollMax(d)}}if(this.__enableScrollX){s-=h*this.options.speedMultiplier;let f=this.__maxScrollLeft;(s>f||s<0)&&(this.options.bouncing?s+=h/2*this.options.speedMultiplier:s=s>f?f:0)}if(this.__enableScrollY){c-=l*this.options.speedMultiplier;const f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?c+=l/2*this.options.speedMultiplier:c=c>f?f:0)}a.length>60&&a.splice(0,30),a.push(s,c,t),this.__publish(s,c,d)}else{let h=this.options.locking?3:0,l=5,s=Math.abs(r-this.__initialTouchLeft),c=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&s>=h,this.__enableScrollY=this.options.scrollingY&&c>=h,a.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(s>=l||c>=l),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=r,this.__lastTouchTop=i,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,r=n;for(let i=n;i>0&&t[i]>this.__lastTouchMove-100;i-=3)r=i;if(r!==n){const i=t[n]-t[r],a=this.__scrollLeft-t[r-2],h=this.__scrollTop-t[r-1];this.__decelerationVelocityX=a/i*(1e3/60),this.__decelerationVelocityY=h/i*(1e3/60);const l=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>l||Math.abs(this.__decelerationVelocityY)>l)&&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,r=!1){const i=this.__isAnimating;if(i&&(Te(i),this.__isAnimating=0),r&&this.options.animating){this.__scheduledLeft=e,this.__scheduledTop=t,this.__scheduledZoom=n;const a=this.__scrollLeft,h=this.__scrollTop,l=this.__zoomLevel,s=e-a,c=t-h,d=n-l,f=function(p,E,T){T&&(this.__scrollLeft=a+s*p,this.__scrollTop=h+c*p,this.__zoomLevel=l+d*p,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),m=function(p){return this.__isAnimating===p}.bind(this),_=function(p,E,T){E===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=It(f,m,_,this.options.animationDuration,i?io:so)}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),l=this.__clientWidth,s=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(a/l)*l,this.__minDecelerationScrollTop=Math.floor(h/s)*s,this.__maxDecelerationScrollLeft=Math.ceil(a/l)*l,this.__maxDecelerationScrollTop=Math.ceil(h/s)*s}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;const t=function(a,h,l){this.__stepThroughDeceleration(l)}.bind(this),n=this.options.snapping?4:.1,r=function(){const a=Math.abs(this.__decelerationVelocityX)>=n||Math.abs(this.__decelerationVelocityY)>=n;return a||(this.__didDecelerationComplete=!0),a}.bind(this),i=function(a,h,l){this.__isDecelerating=0,this.__didDecelerationComplete&&this.options.scrollingComplete?.(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=It(t,r,i)}__stepThroughDeceleration(e){let t=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){const r=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);r!==t&&(t=r,this.__decelerationVelocityX=0);const i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,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 r=0,i=0,a=this.options.penetrationDeceleration,h=this.options.penetrationAcceleration;t<this.__minDecelerationScrollLeft?r=this.__minDecelerationScrollLeft-t:t>this.__maxDecelerationScrollLeft&&(r=this.__maxDecelerationScrollLeft-t),n<this.__minDecelerationScrollTop?i=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(i=this.__maxDecelerationScrollTop-n),r!==0&&(r*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=r*a:this.__decelerationVelocityX=r*h),i!==0&&(i*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=i*a:this.__decelerationVelocityY=i*h)}}}const Qe=o=>S.jsx(dn,{...o}),ao=Object.freeze(Object.defineProperty({__proto__:null,defaultRenderScrollbar:Qe,getScrollTo:(o,e,t,n,r=0)=>{for(let i=0;i<t.length;i++){const a=t[i].getBoundingClientRect();let h=a.left-e,l=h+a.width;if(n){if(h<o&&l>=o)return h}else if(Math.ceil(l)>Math.ceil(o)+2)return l}return r}},Symbol.toStringTag,{value:"Module"})),le={scrollpane:"_scrollpane_1fbi8_2","vertical-container":"_vertical-container_1fbi8_7","horizontal-corner-container":"_horizontal-corner-container_1fbi8_12","scrollbar-sizer":"_scrollbar-sizer_1fbi8_26","scrollpane-content":"_scrollpane-content_1fbi8_34","scrollpane-content-element":"_scrollpane-content-element_1fbi8_43"},fn=o=>{const e=o?.width,t=o?.height;return S.jsx("div",{className:"corner",style:{minWidth:`${e}px`,width:`${e}px`,minHeight:`${t}px`,height:`${t}px`}})},pn=u.memo(u.forwardRef((o,e)=>{const{children:t,viewport:n,onScrollViewport:r,showHorizontalScrollbar:i=!0,showVerticalScrollbar:a=!0,createScrollCorner:h=fn,renderScrollbarHorizontal:l=Qe,renderScrollbarVertical:s=Qe,style:c,className:d,touchElement:f,disableTouch:m,..._}=o,p=i&&l,E=a&&s,T=D(r,[r]),v=et(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,f]);const b=u.useCallback((y,A)=>{T?.({left:y,top:A})},[]),j=u.useCallback(y=>{g.current?.doTouchStart(y.touches,y.timeStamp)},[]),C=u.useCallback(y=>{y.preventDefault(),g.current?.doTouchMove(y.touches,y.timeStamp)},[]),B=u.useCallback(y=>{g.current?.doTouchEnd(y.timeStamp)},[]),O=u.useCallback(({containerWidth:y,containerHeight:A,totalWidth:K,totalHeight:U})=>{g.current.setDimensions(y,A,K,U)},[]);u.useEffect(()=>{const y=f??v.current;if(!m&&Pe().supportsTouchEvents&&y&&n){if(!g.current){const A={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};g.current=new lo(b,A)}Pe().supportsTouchEvents&&(y.addEventListener("touchstart",j),y.addEventListener("touchend",B),y.addEventListener("touchmove",C)),O({containerWidth:n?.width,containerHeight:n?.height,totalWidth:n?.totalWidth,totalHeight:n?.totalHeight})}return()=>{y?.removeEventListener("touchstart",j),y?.removeEventListener("touchend",B),y?.removeEventListener("touchmove",C)}},[n?.width,n?.height,n?.totalWidth,n?.totalHeight,m,f]);const[L,{width:w}]=me(),[k,{height:M}]=me(),I=u.useMemo(()=>{if(!E)return null;const y=s({orientation:Z.Vertical,offset:n?.top,viewportSize:n?.height,totalSize:n?.totalHeight,onScrollOffset:A=>{T?.({top:A})}});return S.jsx("div",{className:X("vertical-container",le["vertical-container"]),ref:L,children:y})},[s,n?.top,n?.height,n?.totalHeight]),P=u.useMemo(()=>{if(!p)return null;const y=l({orientation:Z.Horizontal,offset:n?.left,viewportSize:n?.width,totalSize:n?.totalWidth,onScrollOffset:A=>{T?.({left:A})}});return S.jsxs("div",{className:X("horizontal-corner-container",le["horizontal-corner-container"]),children:[S.jsx("div",{className:X("horizontal-sizer",le["horizontal-sizer"]),style:{width:`calc(100% - ${w}px)`},children:S.jsx("div",{ref:k,className:X("scrollbar-sizer",le["scrollbar-sizer"]),children:y})}),E?h({width:w,height:M}):S.jsx(S.Fragment,{})]})},[l,n?.left,n?.width,n?.totalWidth,E,h,w,M]);return S.jsx("div",{className:X(d,"scrollpane",le.scrollpane),style:{minWidth:E?`${w}px`:void 0,minHeight:p?`${M}px`:void 0,...c},..._,ref:v,children:S.jsxs("div",{className:X("scrollpane-content",le["scrollpane-content"]),children:[S.jsxs("div",{className:X("scrollpane-content-element",le["scrollpane-content-element"]),children:[S.jsx("div",{className:X("scrollpane-content-element",le["scrollpane-content-element"]),children:t}),E?I:S.jsx(S.Fragment,{})]}),p?P:S.jsx(S.Fragment,{})]})})}));pn.displayName="ScrollPane";const co=300,uo=100,ho=1e6,fo=100,po=50,$t=u.memo(u.forwardRef((o,e)=>{const{offset:t=0,viewportSize:n=0,totalSize:r=0,minSize:i=0,endGap:a=co,endScrollIncrement:h=uo,style:l=Ut,onMouseDown:s,onScrollOffset:c,onScroll:d,scaleLimit:f=ho,scaleFactor:m=fo,precisionFactor:_=po,renderScrollbar:p=Qe,...E}=o;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const T=D(s,[s]),[v,g]=u.useState(!1),b=u.useMemo(()=>{const L=f===0?r:Math.min(r??0,Math.max(i??0,(t??0)+(n??0))+(a??0)),w=f!==0&&L>f?m:1,k=w/_,M=Math.ceil(L/w);return{offset:Math.ceil(t/w),totalSize:M,viewportSize:Math.ceil(n/w),scaledOffset:t,scaledTotalSize:r,scaledViewportSize:n,factor:w,precision:k}},[t,r,n,v,i,a,h]),j=D((L,w,k)=>{const M=b.offset;Math.abs(L-M)<b.precision&&(L=M),c?.(L*b.factor,M,b.viewportSize)},[c,b]),C=u.useCallback(L=>{},[]),B=u.useCallback(L=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",B),g(!1)},[]),O=u.useCallback(L=>{g(!0),T?.(L),document.addEventListener("mousemove",C,{passive:!0}),document.addEventListener("mouseup",B,{passive:!0})},[C,B]);return p({style:l,...E,offset:b.offset,totalSize:b.totalSize,viewportSize:b.viewportSize,onMouseDown:O,onScrollOffset:j,ref:e})}));$t.displayName="VirtualScrollbar",exports.Command=Ye,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=gt,exports.DefaultDynamicIconService=ke,exports.DefaultReactNotifier=Yt,exports.DynamicIcon=Rt,exports.ErrorTestPanel=()=>null,exports.FocusKeyNavigation=kn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.InMemoryStore=Ze,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,Composition:229},exports.KeyModifiers=Y,exports.LocalStorageStore=class{constructor(o=window.localStorage){this.storage=o}async getItem(o){try{return this.storage.getItem(o)}catch{return null}}async setItem(o,e){try{this.storage.setItem(o,e)}catch{}}async removeItem(o){try{this.storage.removeItem(o)}catch{}}subscribe(o){const e=t=>{t.storageArea===this.storage&&t.key&&o(t.key)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}},exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotifierProvider=({children:o,notifier:e})=>(u.useEffect(()=>{const t=$.Notifier.getOverrides();return $.Notifier.setOverrides(e),()=>{$.Notifier.setOverrides(t)}},[e]),u.createElement(qt.Provider,{value:e},o)),exports.NotifierType=ht,exports.PersistenceStateProvider=function(o){const{store:e,namespace:t="",serializer:n=eo,debounceMs:r=0,crossTabSync:i=!0,children:a}=o,h=u.useMemo(()=>typeof window>"u"?new Ze:e??new Ze,[e]),l=u.useRef(new Map),s=u.useMemo(()=>({store:h,namespace:t,serializer:n,debounceMs:r,crossTabSync:i,notify(c){const d=l.current.get(c);d&&d.forEach(f=>f())},subscribeKey(c,d){const f=l.current,m=f.get(c)??new Set;return m.add(d),f.set(c,m),()=>{const _=f.get(c);_&&(_.delete(d),_.size===0&&f.delete(c))}}}),[h,t,n,r,i]);return u.useEffect(()=>{if(s.crossTabSync&&s.store.subscribe)return s.store.subscribe(c=>{if(!c.startsWith(s.namespace+":"))return;const d=c.slice(s.namespace.length+1);s.notify(d)})},[s]),S.jsx(jt.Provider,{value:s,children:a})},exports.ReactErrorBoundary=({children:o})=>{const e=Le(),t=u.useCallback(n=>{e.showError(n)},[e]);return S.jsx(Xn,{onError:t,children:o})},exports.ReactUtils=Mn,exports.RoundedTab=zn,exports.ScrollPane=pn,exports.ScrollUtils=ao,exports.Scrollbar=dn,exports.ScrollbarOrientation=Z,exports.SimpleCommand=We,exports.SplitPane=on,exports.SplitPaneResizer=nn,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:o})=>{const e=Le();return u.useEffect(()=>{const t=new Yn(e);return()=>{t.cleanup()}},[e]),S.jsx(S.Fragment,{children:o})},exports.VirtualScrollbar=$t,exports.WalkingIcon=function(o){const{isWalking:e=!1,themedType:t="info",speed:n=120,dashGap:r=3,dashLength:i=5,iconKey:a,packKey:h,style:l,className:s,...c}=o,d=u.useMemo(()=>{if(!e)return;const m={"--walk-duration":`${n*(r+i)}ms`,"--walk-dash-length":`${i}px`,"--walk-dash-gap":`${r}px`};return t&&t!=="accent"&&(m["--icon-accent"]=`var(--icon-${t})`),m},[e,n,r,i,t]),f=u.useMemo(()=>e?s+" walking":s,[e,s]);return S.jsx(Rt,{iconKey:a,packKey:h,className:f,style:{...l,...d},...c})},exports.createDynamicIconService=rn,exports.defaultCreateScrollCorner=fn,exports.defaultCreateScrollEdgeButton=o=>{const{style:e,orientation:t=Z.Vertical,...n}=o,r=t===Z.Vertical,i=r?"rotate(90) ":"";return S.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${r?"vertical":"horizontal"} edge`,...n,children:S.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:i,children:S.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:o.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=un,exports.defaultCreateScrollStartButton=cn,exports.getDevicePixelRatio=function(o){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:t=3,round:n=!0}=o||{},r=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,n?Math.floor(r):r),t)},exports.toShortcutString=we,exports.useAnimatedMeasure=Gt,exports.useCallbackRef=D,exports.useCommand=function(o,e=null){const t=u.useRef(e);t.current=e;const[n,r]=u.useReducer(a=>a+1,0),i=u.useMemo(()=>Array.isArray(o)?o:[o],[o]);return u.useEffect(()=>{if(!i||i.length===0)return;const a=(s,c)=>{t.current?.onChange?.(c),r()};let h=null;e&&(h={onExecute(s,c){t.current?.onExecute?.(s,c)},onError(s,c,d){t.current?.onError?.(s,c,d)}});const l=new Set;for(let s=0;s<i.length;s++)l.add(i[s]?.addPropertyListener($.CommonUtils.debounce(a,0),!0)),e&&l.add(i[s]?.addExecuteListener(h));return()=>{l.forEach(s=>{s?.()})}},[o]),n},exports.useCommands=function(o,e=null,t=null,n){const r=u.useRef(t);r.current=t,e&&!Array.isArray(e)&&(e=[e]);const[i,a]=u.useState(Fe(o,e)),h=n?[...n,o]:[o];return u.useEffect(()=>{const l={onGroupChange:()=>{const f=Fe(o,e);a(f),r.current?.onChange?.(this)}};let s;e&&e.length>0&&(s={keys:e},l.onCommandChange=(f,m)=>{r.current?.onChange?.(o),a(Fe(o,e))});const c=o?.addListener(l,s),d=Fe(o,e);return a(d),r.current?.onChange&&r.current?.onChange(o),()=>{c?.()}},h),i},exports.useCopyPaste=o=>{const{source:e,target:t,onPaste:n,onClipboardUpdate:r,commands:i}=o,a=Le(),h=D(r,[r]),l=D(n,[n]),{getClipboard:s,refNativeCopy:c}=Et(),d=s();u.useMemo(()=>{const v=e?.element,g=t?.element??e?.element;if(!i)return;const b=[new We("cut",v,{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:[Y.Ctrl]}}),new We("copy",v,{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:[Y.Ctrl]}}),new We("paste",g,{label:"Paste",description:"Add content on the clipboard to your document.",icon:"paste.yellow",shortcut:[{key:"V",modifiers:[Y.Ctrl]},{key:"F8",modifiers:[Y.Ctrl]}]})];i?.addCommands(b,!0)},[i]);const f=D(async v=>{if(!e?.element)return;let g=null;try{g=e.doCopy?.(v),typeof g=="string"?await d.writeText(g):await d.writeReference(g)}catch(b){throw b}},[e,a]),m=D(async v=>{const g=e?.element?.();if(g){c.current={sourceElement:g,args:v};try{await f(v)}catch(b){a.showError?.(b)}}},[e?.element,a]),_=u.useCallback(()=>{m({isCut:!0})},[]),p=D(async(v,g,b)=>{try{if(await v.doPaste(g,b)===!1)return;l?.(g,b)}catch(j){a.showError?.(j)}},[l]),E=D(async(v,g,b)=>{const j=t?.element?.();if(j&&await $.CommonUtils.whenFocus(j),!v&&!g)return;const C=await a.showBusy?.("Pasting...");if(g)try{return await p(t,g,b),void C?.()}catch(L){C?.(),a.showError?.(L)}let B,O=t.importFromExternal;O||(O=(L,w)=>({getItemType:()=>"text",toText:()=>v.text,isClipboardItem:!0}));try{B=await O(v,{isCut:!1})}catch(L){C?.(),a.showError?.(L)}if(B)try{const L=await Promise.resolve(B);await p(t,L,b),C?.()}catch(L){C?.(),a.showError?.(L)}else C?.()},[p,t,a]),T=D(async v=>{if(t?.element)try{const g=await d.readReference();if(g)return void await E(null,g,v);const b=[];b[0]=await $.ClipboardUtils.readStringFromClipboard(d,$.MimeType.plain),b[1]=await $.ClipboardUtils.readHTMLFromClipboard(d,$.MimeType.html),b[2]=await $.ClipboardUtils.readBlobFromClipboard(d,$.MimeType.png);const j={text:b[0]??null,html:b[1]??null,image:b[2]??null};await E(j,null,v)}catch(g){if(g?.message==="Document is not focused.")return;a.showError?.(g)}},[E,t?.element,a]);return D(async v=>{},[e?.element]),D(async v=>{},[t?.element,E,a]),u.useEffect(()=>{if(!d)return;const v=async j=>{const C=await d.readReference();h?.(C)},g=j=>{a.showMessage?.($.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},b=j=>{a.showMessage?.($.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",v),d.addEventListener("clipboarderrorread",g),d.addEventListener("clipboarderrorwrite",b),()=>{d.removeEventListener("clipboardchange",v),d.removeEventListener("clipboarderrorread",g),d.removeEventListener("clipboarderrorwrite",b)}},[d,a]),u.useEffect(()=>{},[f,E,e,t]),u.useEffect(()=>{i?.getCommand("cut")?.updateCallback(_).update({disabled:!e||!t}),i?.getCommand("copy")?.updateCallback(m).update({disabled:!e}),i?.getCommand("paste")?.updateCallback(T).update({disabled:!t})},[e,t,i]),{paste:T,copy:m,clipboard:d}},exports.useDevicePixelRatio=function(o){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 r=()=>{const i=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);i.addEventListener("change",r,{once:!0,passive:!0}),t(window.devicePixelRatio),n.current={mediaMatcher:i,listener:r}};return r(),()=>{n.current&&n.current.mediaMatcher.removeEventListener("change",n.current.listener)}},[o]),e},exports.useEditMode=()=>{const o=Kn();return u.useMemo(()=>({setMode:e=>{en(t=>(typeof e=="function"&&(e=e(t)),e?.onModeChange?.(e??null),e))},getMode:()=>o}),[o])},exports.useFullscreenPortal=Zt,exports.useGlobalClipboard=Et,exports.useId=Fn,exports.useImperativeElement=et,exports.useMouseDownAndHoldListener=function(o,e){return dt({onPointerDown:o,onPointerMoveOrWait:(t,n,r)=>{o?.(r)},...e})},exports.useNotifier=Le,exports.useOnClickOrFocusAway=function(o,e,t){const n=D(e,[e]);u.useEffect(()=>{const r=i=>{o.current&&!o.current.contains(i.target)&&n(i)};return t&&t.mouseEvents===!1||(document.addEventListener("mousedown",r),document.addEventListener("touchstart",r)),t&&t.focusEvents===!1||document.addEventListener("focus",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r),document.removeEventListener("focus",r)}},[o])},exports.usePersistenceState=function(o,e,t=Qn){const{store:n,namespace:r,serializer:i,debounceMs:a,subscribeKey:h}=u.useContext(jt)||Jn,l=t.serializer??i??sn,s=u.useMemo(()=>`${r}:${o}`,[r,o]),c=u.useRef(null),d=`${s}::v`,[f,m]=u.useState(()=>{let p;try{if(typeof window<"u"&&"localStorage"in window&&s.startsWith(r)){const E=window.localStorage?.getItem(s)??null;E!=null&&(p=l.parse(E))}}catch{}if(p===void 0){const E=e;return typeof E=="function"?E():E}return p});u.useEffect(()=>{let p=!0;return(async()=>{const[E,T]=await Promise.all([n.getItem(s),n.getItem(d)]);let v;try{v=E==null?void 0:l.parse(E)}catch{}const g=T==null?void 0:Number.parseInt(T,10);v===void 0?!t.lazy&&e!==void 0&&(v=typeof e=="function"?e():e,await n.setItem(s,l.stringify(v)),t.version!=null&&await n.setItem(d,String(t.version))):t.version!=null&&g!==void 0&&g!==t.version&&t.migrate&&(v=t.migrate(v,g),await n.setItem(s,l.stringify(v)),await n.setItem(d,String(t.version))),p&&v!==void 0&&m(v)})(),()=>{p=!1}},[n,s,d,t.version,t.migrate,t.lazy]),u.useEffect(()=>h(o,async()=>{const p=await n.getItem(s);if(p!=null)try{m(l.parse(p))}catch{}}),[n,s,h,o]);const _=async p=>{await n.setItem(s,l.stringify(p)),t.version!=null&&await n.setItem(d,String(t.version))};return[f,p=>{m(E=>{const T=typeof p=="function"?p(E):p;return c.current&&clearTimeout(c.current),a>0?c.current=setTimeout(()=>{_(T)},a):_(T),T})},()=>{if(c.current&&clearTimeout(c.current),n.removeItem(s),n.removeItem(d),e!==void 0){const p=typeof e=="function"?e():e;m(p)}else m(void 0)}]},exports.useSynchronizedPointerHandler=dt,exports.useTraceUpdate=function(o,e=!0){const t=u.useRef(o);u.useEffect(()=>{if(e){const n=Object.entries(o).reduce((r,[i,a])=>(t.current[i]!==a&&(r[i]=[t.current[i],a]),r),{});Object.keys(n).length>0&&console.log("Changed props:",n)}t.current=o})},exports.useUndoManager=({manager:o,commands:e,disabled:t})=>{const n=Le(),r=D(a=>{try{o?.undo(a)}catch(h){n.error(h)}},[o]),i=D(a=>{try{o?.redo(a)}catch(h){n.error(h)}},[o]);return u.useMemo(()=>{if(!e)return;const a={contains:l=>!0,focus(){}},h=[new Ye("undo",a,{label:"Undo",description:Lt,shortcut:{key:"z",modifiers:[Y.Ctrl]},disabled:!0},r),new Ye("redo",a,{label:"Redo",description:Tt,shortcut:[{key:"y",modifiers:[Y.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[Y.Alt]}],disabled:!0},i)];e?.addCommands(h,!0)},[e]),u.useEffect(()=>{if(!e)return;const a=()=>{const l=o?.getTopUndoDescription(),s={};var c;e.getCommand("undo").update({disabled:t||!o||!o.hasUndo(),description:l?(c=l,`Undo ${c}`):Lt,state:s,context:{undoManager:o}});const d=o?.getTopRedoDescription();e.getCommand("redo").update({disabled:t||!o||!o.hasRedo(),description:d?Vn(d):Tt,state:s,context:{undoManager:o}})};if(a(),!o)return;const h=o.addListener({onStackChange(){a()}});return()=>h?.()},[o,e,t]),{undo:r,redo:i}};
@@ -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.19
4
+ * @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.21
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.