@sheetxl/utils-react
Version:
Utils React - Utilities for React capabilities needed for all SheetXL components.
7 lines • 83.5 kB
JavaScript
(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)}})();
"use strict";/**
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.27
*
* (C) 2025-present SheetXL Inc. & Michael T. Ford
* License: The license can be found at https://www.sheetxl.com/license.
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),$=require("@sheetxl/utils"),E=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.getLabel()} : ${this.getDescription()}`)})}getKey(){return this._key}_resolve(e,t){if(typeof e=="function"){const n=t??this._context;return e(typeof n=="function"?n():n)}return e}getTarget(){return typeof this._target=="function"?this._target():this._target}getLabel(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}getDescription(e){return this._resolve(this._description,e)}getTags(e){return this._resolve(this._tags,e)}getIcon(e){return this._resolve(this._icon,e)}getShortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}getState(){return this._resolve(this._state)}getContext(){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 c=n._root._listenersByKey,d=i.getKey(),s=c.get(d);s&&n._notifyCommands(s,"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 d=this;for(;d&&!r;){let s=d._nodes.get(t);s&&(r=s),d=d._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=(d,s)=>{!d.has(t)||n?d.set(t,s):n===void 0&&console.warn("commandGroup already registered",t)};i(this._root._nodes,r);let c=this._parent;for(;c;)i(this._nodes,r),c=c._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,c=this._root._unListenersByCommand,d=e.length;for(let s=0;s<d;s++){const l=e[s],a=l.getKey();if(n.has(a)&&!t){t===void 0&&console.warn("command already registered",a);continue}n.set(a,l);let h=c.get(l);h&&(h(),c.delete(l));const f=l.addPropertyListener(i);c.set(l,f);const p=l.getShortcut();if(!p)continue;const _=Array.isArray(p)?p:[p],m=_.length;for(let S=0;S<m;S++){const C=we(_[S]),y=r.get(C);y&&!t&&t===void 0&&console.warn(`Shortcut already registered: ${C}, ${a}, ${y}.`),r.set(C,a)}}}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(c=>{const d=t.length,s=c._nodes;for(let l=0;l<d;l++)s.delete(t[l]);r(c)})};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 c=null;return i&&(c=this._commandsByKey.get(i),c&&c.disabled()&&(c=null),!c||c.getTarget()&&c.getTarget().contains(e.target)||(c=null)),c||(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 c=null;if(r){const d=r.length;for(let s=0;s<d;s++){const l=r[s];if(!l)continue;let a=i.get(l);a||(a=new Set,i.set(l,a)),c||(c=[]),c.push(a),a.add(e)}}return n.add(e),()=>{if(c){const d=c.length;for(let s=0;s<d;s++)c[s].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],c=i?o.getCommand(i):null;n[r]=c}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 c=r.current.parentElement.children;let d=[];const s=c.length;for(let l=0;l<s&&c[l]!==r.current;l++){const a=c[l],h=a.getAttribute("tabindex");h==null||h==="-1"||a.getAttribute("disabled")!=="true"&&a.focus&&d.push({tabindex:parseInt(h),child:a})}d.length!==0&&(d.sort(function(l,a){return l.tabindex-a.tabindex}),d[0].child.focus())},[t]);return E.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],c=u.useMemo(function(){return new window.ResizeObserver(function(d){if(d[0]){var s=d[0].contentRect,l=s.x,a=s.y,h=s.width,f=s.height,p=s.top,_=s.left,m=s.bottom,S=s.right;i({x:l,y:a,width:h,height:f,top:p,left:_,bottom:m,right:S})}})},[]);return Dn(function(){if(e)return c.observe(e),function(){c.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:c=1,strokeColor:d="grey",...s}=o,[l,{width:a,height:h}]=me(),f=u.useRef(null),p=(C,y=0)=>{const g=C/2,b=h-g+y;return(function(j,M,B=!1){if(M===0)return j;function O(P,v,A){let K=v.x-P.x,U=v.y-P.y,z=Math.sqrt(K*K+U*U);return T(P,v,Math.min(1,A/z))}function T(P,v,A){return{x:P.x+(v.x-P.x)*A,y:P.y+(v.y-P.y)*A}}function w(P,v){P.length>2&&(P[P.length-2]=v.x,P[P.length-1]=v.y)}function k(P){return{x:parseFloat(P[P.length-2]),y:parseFloat(P[P.length-1])}}let L=j.split(/[,\s]/).reduce(function(P,v){let A=v.match("([a-zA-Z])(.+)");return A?(P.push(A[1]),P.push(A[2])):P.push(v),P},[]).reduce(function(P,v){return parseFloat(v)==v&&P.length?P[P.length-1].push(v):P.push([v]),P},[]),I=[];if(L.length>1){let P=k(L[0]),v=null;L[L.length-1][0]==="Z"&&L[0].length>2&&(v=["L",P.x,P.y],L[L.length-1]=v),I.push(L[0]);for(let A=1;A<L.length;A++){let K=I[I.length-1],U=L[A],z=U===v?L[1]:L[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=T(J,K.origPoint||V,M),H=T(J,z.origPoint||_e,M)):(W=O(J,V,M),H=O(J,_e,M)),w(U,W),U.origPoint=J,I.push(U);let ce=T(W,J,.5),ge=T(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(v){let A=k(I[I.length-1]);I.push(["Z"]),w(I[0],A)}}else I=L;return I.reduce(function(P,v){return P+v.join(" ")+" "},"")})(`${`M 0 ${g} L ${i-.5} ${g} L ${i-.5} ${b} L ${2*i} ${b}`} ${`L ${a-2*i} ${b}`} ${`M ${a-2*i} ${b} L ${a-i} ${b} L ${a-i} ${g} L ${a} ${g}`}`,i)},_=u.useMemo(()=>p(c),[a,h,i,c]),m=u.useMemo(()=>{if(i===0)return;const C=i/2;return p(i)+`L ${a} 0 L 0 0 L 0 ${C}`},[_,i,c]),S=u.useMemo(()=>({style:{clipPath:`path('${m}')`}}),[m]);return E.jsxs("div",{className:t,style:{display:"flex",flexDirection:"row",...n},...s,ref:Ee([f,l,e]),children:[u.isValidElement(r)?u.cloneElement(r,S):E.jsx(E.Fragment,{}),E.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:a,height:h,viewBox:`0 0 ${a} ${h}`,children:E.jsx("path",{d:_,stroke:d,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:c})})]})})),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(),c=u.useRef(null),[d,s]=u.useReducer(_=>_+1,0),l=u.useRef(void 0),a=u.useRef({x:0,y:0,width:0,height:0,top:0,left:0,right:0,bottom:0}),h=u.useCallback(_=>{c.current=_,typeof r=="function"&&r(_)},[r]),[f,p]=u.useState(i);return u.useEffect(()=>{i&&!f&&p(i)},[i,f]),u.useEffect(()=>{const _=c.current;if(!_)return;let m=!1,S=0;const C=()=>{if(!_)return;const M=_.getBoundingClientRect(),B=a.current;Math.abs(M.x-B.x)>e||Math.abs(M.y-B.y)>e||Math.abs(M.width-B.width)>e||Math.abs(M.height-B.height)>e?(m||(m=!0,p(lt(M)),s()),S=0):S++,m&&S>=t&&(m=!1,p(lt(M)),s()),a.current=lt(M),l.current=requestAnimationFrame(C)};l.current=requestAnimationFrame(C);const y=M=>{m=!0,s()},g=M=>{m=!1,S=t,s()};let b=_;const j=[];for(;b&&b!==document.documentElement&&(b.addEventListener("animationstart",y,!0),b.addEventListener("animationend",g,!0),b.addEventListener("transitionstart",y,!0),b.addEventListener("transitionend",g,!0),j.push(b),b=b.parentElement,!(j.length>n)););return()=>{l.current&&cancelAnimationFrame(l.current),j.forEach(M=>{M.removeEventListener("animationstart",y,!0),M.removeEventListener("animationend",g,!0),M.removeEventListener("transitionstart",y,!0),M.removeEventListener("transitionend",g,!0)})}},[d,i,e,t,n]),[h,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,c=D(e,[e]),d=D(t,[t]),s=D(n,[n]),l=u.useRef(!1),a=o?.timerInitial??230,h=o?.timerContinuous??a/2,f=u.useRef(null),p=u.useRef(null),_=u.useRef(null),m=u.useRef(null),S=u.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),C=u.useCallback(w=>{m.current=setTimeout(()=>{window.requestAnimationFrame(()=>{if(l.current===!1)return;const k=p.current,L=f.current,I=qe(k,L.currentTarget);s?.(I,_.current,L)}),C(h)},w??a)},[]);u.useEffect(()=>()=>S(),[]);const y=r?"pointer":"mouse",g=u.useCallback(w=>{w.stopPropagation(),w.stopImmediatePropagation(),w.preventDefault()},[]),b=D(w=>{document.removeEventListener(`${y}move`,B),document.removeEventListener(`${y}up`,b),document.removeEventListener("keydown",O),document.removeEventListener("keyup",T),document.removeEventListener("touchstart",g,{capture:!0}),document.removeEventListener("touchmove",g,{capture:!0}),window.removeEventListener("blur",j),S(),window.requestAnimationFrame(()=>{if(l.current===!1)return;l.current=!1;const k=w,L=f.current,I=qe(k,L.currentTarget);d?.(I,_.current,L),_.current=null})},[]),j=u.useCallback(()=>{l.current!==!1&&(l.current=!1,b(p.current))},[]),M=D(()=>{S(),C(h),window.requestAnimationFrame(()=>{if(l.current===!1)return;const w=p.current,k=f.current,L=qe(w,k.currentTarget);s?.(L,_.current,k)})},[h]),B=D(w=>{p.current=w,M()},[]),O=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},M()},[]),T=D(w=>{_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},M()},[h]);return D(w=>{w.isDefaultPrevented()||(_.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},c(w,_.current)!==!1&&(f.current=w,p.current=w.nativeEvent,document.addEventListener(`${y}up`,b,{passive:!1}),document.addEventListener(`${y}move`,B,{passive:!1}),document.addEventListener("keydown",O,{passive:!1}),document.addEventListener("keyup",T,{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})),l.current=!0,C(a)))},[a,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(c=>[])):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]),E.jsx(E.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(E.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,c=!1,d=[],{unmountIfNoConsumers:s=!1}=t;const l=h=>{var f;r=h,f=()=>d.forEach(p=>p(h)),Nt.unstable_batchedUpdates(f)},a=()=>(c||(r=typeof o=="function"?o():o,c=!0),r);return()=>{const[h,f]=u.useState(a);return u.useEffect(()=>(i||(i=!0,n=Nn({initValue:o,useHookBody:e,applyStateChange:l})),d.push(f),r!==h&&f(r),()=>{d.splice(d.indexOf(f),1),d.length===0&&s&&(n(),i=!1)}),[]),h}});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 c=Object.keys(i),d=c.length;for(let s=0;s<d;s++){const l=c[s],a=i[l];Object.defineProperty(r,l,{value:a,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:c,key:d,propsHitArea:s=qn,...l}=o,a=n==="row",{style:h,className:f,...p}=s;return E.jsx("div",{style:{...t,position:"relative"},...l,children:E.jsx("div",{className:X("hit-box",f),style:{left:(a?-r:0)+"px",width:`calc(100% + ${a?r+i:0}px)`,top:(a?0:-r)+"px",height:`calc(100% + ${a?0:r+i}px)`,position:"absolute",...h},onPointerDown:c?void 0:e,...p})},d)},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:c,onPositionChange:d,minBefore:s,maxBefore:l,minAfter:a,maxAfter:h,children:f,className:p,style:_,disabled:m=!1,onDragStart:S,onDragResize:C,onDragFinish:y,propsResizer:g=Ve,propsPane:b=Ve,propsPaneBefore:j=Ve,propsPaneAfter:M=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]),T=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(s,F),maxBefore:se(l,F),minAfter:se(a,F),maxAfter:se(h,F)}},[s,l,a,h]),w=D(d,[d]),[k,L]=u.useState(()=>se(c,i===null));u.useEffect(()=>{L(se(c,i===null))},[c,i]);const[I,{width:P,height:v}]=me(),[A,{width:K,height:U}]=me(),z=r==="row"?K:U,W=r==="row"?P:v,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,T),[T,k,W,z,r]),[V,J]=u.useState(!1),_e=D(S,[S]),ce=D(C,[C]),ge=D(y,[y]),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}=M,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);L(F)},[i]),x=D(R=>{if(m||!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)),T.fixedPaneOffset===1&&(Q=W-Q),c&&k.pixels===Q||L({pixels:Q,percent:null}),ce?.(Q),R.stopPropagation(),R.preventDefault()},[T,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(ge(k.pixels),!se(c,i===null)||k.pixels!==c){const F={...k};F.percent===null&&(F.percent=F.pixels/W*100),w(F)}R.stopPropagation(),R.preventDefault()}},[k,V,c,i,W]),q=D(R=>{$e?.(R),R.defaultPrevented||m||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: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,...ve},splitDirection:r,disabled:m,...Ne}):null,[O,ne,Ne,r,ve,m]),de=r==="row"?"Width":"Height",rt=u.useMemo(()=>{if(!t)return null;const R={...Re,...je,flex:T.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 E.jsx("div",{ref:ue,className:X("before",ze,ot),style:R,...Ae,...Be,children:t},"before")},[t,b,j,T,H]),Ke=u.useMemo(()=>{if(!n)return null;const R={...Re,...Ie,flex:T.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 E.jsx("div",{ref:De,className:X("after",ze,Oe),style:R,...Ae,...ye,children:n},"after")},[n,b,M,T,H]);return E.jsxs("div",{ref:Ee([I,he]),className:X("splitPane",r==="row"?"vertical":"horizontal",{dragging:V},p),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]||"",c=r[2]||"";try{if(/;base64/i.test(i)){if(typeof atob<"u"){const d=atob(c),s=d.length;if(typeof TextDecoder<"u"){const a=new Uint8Array(s);for(let h=0;h<s;h++)a[h]=d.charCodeAt(h);return new TextDecoder("utf-8").decode(a)}let l="";for(let a=0;a<s;a++)l+=`%${d.charCodeAt(a).toString(16).padStart(2,"0")}`;return decodeURIComponent(l)}return(globalThis.Buffer?globalThis.Buffer.from(c,"base64"):require("buffer").Buffer.from(c,"base64")).toString("utf-8")}try{return decodeURIComponent(c)}catch{return c}}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 c=new DOMParser().parseFromString(o,"image/svg+xml"),d=c.querySelector("svg"),s=d?.getAttribute("viewBox")??void 0,l=[];return c.querySelectorAll("path").forEach(a=>{const h=a.getAttribute("d");if(!h)return;const f={d:h},p=a.getAttribute("class");p&&(f.className=p);const _=a.getAttribute("fill");_&&_!=="none"&&(f.fill=_);const m=a.getAttribute("stroke");m&&(f.stroke=m);const S=a.getAttribute("opacity");S&&(f.opacity=Number(S));const C=a.getAttribute("fill-rule");C&&(f.fillRule=C);const y=a.getAttribute("clip-rule");y&&(f.clipRule=y),l.push(f)}),{viewBox:s,paths:l}}}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,c]of Object.entries(o.icons))e[i]=Pt(c);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[c,d]of Object.entries(r)){const s={};for(const[l,a]of Object.entries(d))s[l]=Pt(a);i[c]=s}n.__overrides=i}return n}function rn(){const o=new Map,e=new Map;let t="base",n=new Map;async function r(s){const l=o.get(s??t);if(!l)throw new Error(`Icon pack not registered: ${s}`);if(!l.pack){if(!l.loading){if(!l.loader)throw new Error(`No loader for icon pack: ${s}`);l.loading=l.loader().then(a=>{const h=a&&typeof a=="object"&&"default"in a?a.default:a;l.pack=zt(h)}).catch(a=>{throw l.loading=void 0,a})}await l.loading}}function i(s){const l=s.indexOf(":");return l>0?{ns:s.slice(0,l),key:s.slice(l+1)}:{key:s}}function c(s,l){const a=[s,...o.get(s)?.pack?.meta.extends??[]];for(const h of a){const f=o.get(h);if(!f?.pack)continue;const{icons:p}=f.pack,_=p[e.get(h)?.get(l)??l]??p[l];if(_)return{glyph:_,pack:f.pack,packKey:h}}return null}function d(s,l){const a=l?.packKey??t;if(l?.packKey)return c(l.packKey,s);if(!s)return null;const{ns:h,key:f}=i(s);if(h){const p=o.get(h)?.pack;if(p){if(o.get(t)?.pack){const m=p.__overrides,S=m?.[t]?.[f];if(S)return{glyph:S,pack:p,packKey:h}}const _=c(h,f);if(_)return _}return null}return c(a,s)}return{register:function(s,l){const a=o.get(s)??{};typeof l=="function"?a.loader=l:a.pack=zt(l),o.set(s,a),t||(t=s)},prefetch:async function(s=t){const l=Array.isArray(s)?s:[s];await Promise.all(l.map(r))},setActive:function(s){t=s;for(const l of n.keys())try{l(s)}catch{}},getActive:function(){return t},resolve:async function(s,l){let a=d(s,l);if(a)return a;const h=l?.packKey??t,{ns:f}=i(s);if(l?.packKey){if(await r(h),a=d(s,l),a)return a;const p=o.get(h)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}else if(f){if(await r(f),a=d(s,l),a)return a;const p=o.get(f)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}else{if(await r(h),a=d(s,l),a)return a;const p=o.get(h)?.pack?.meta?.extends??[];if(p.length&&(await Promise.all(p.map(r)),a=d(s,l),a))return a}return null},registerAlias:function(s,l,a){e.has(s)||e.set(s,new Map),e.get(s).set(l,a)},has:function(s,l){return!!d(s,l)},getPack:function(s){return o.get(s??t)?.pack},hasPack:function(s){return!!o.get(s)?.pack},listPacks:function(){return Array.from(o.keys())},listIcons:function(s){const l=o.get(s)?.pack;return l?Object.keys(l.icons):[]},addActiveListener:function(s){const l=n.get(s);if(l)return l;const a=()=>{n.delete(s)};return n.set(s,a),a}}}on.displayName="SplitPane";const ke=rn();ke.register("base",()=>Promise.resolve().then(()=>require("./DJJQOl0dYYJgXfru.cjs")));const At=o=>E.jsx("svg",{...o,children:E.jsx("path",{})}),Zn={Icon:"_Icon_17dpm_10"},Rt=u.memo(o=>{const{iconKey:e,packKey:t,className:n,style:r,role:i,title:c,size:d,ariaHidden:s,propsSource:l,children:a,...h}=o,[f,p]=u.useState(null);u.useEffect(()=>{let L=!0,I=t,P=e;if(!P){const v=ke.getPack(I);return void p({glyph:v?{svg:$.CommonUtils.EmptyArray}:void 0,pack:v??void 0,packKey:I??ke.getActive()})}if(P.includes(":")){const[v,A]=P.split(":");I=v,P=A}return ke.resolve(P,{packKey:I}).then(v=>{L&&p(v)}),()=>{L=!1}},[e,t]);const _=f?.pack,m=f?.glyph,S=f?.packKey;let C=m?m.svg:void 0;const y=m&&!C?m.url:void 0,g=!m||C||y?void 0:m.emoji,b=d!=null?typeof d=="number"?`${d}px`:d:void 0,j=u.useMemo(()=>[Zn.Icon,"icon",n].filter(Boolean).join(" "),[n]),M=u.useMemo(()=>{const L={...r};return L["--icon-size"]=b,L},[r,b]),B=i??(c?"img":"presentation"),O=s??(!c||void 0),T=L=>E.jsx("span",{className:j,style:M,role:B,"aria-hidden":O,title:c,"data-icon-glyph":e,"data-icon-pack":S,...h,children:L});if(a)return T(a);if(g)return T(E.jsx("span",{children:typeof g=="string"?g:g.text}));if(y)return T(E.jsx("img",{src:y.src,alt:c??""}));if(m&&"react"in m){const L=m.react,I={className:j,style:M,role:B,"aria-hidden":O,title:c,...h,...l};return T(E.jsx(L,{...I}))}const w={viewBox:C?.viewBox??_?.meta.defaultViewBox??"0 0 24 24"};if(typeof C=="function")return T(C(w)??E.jsx(At,{...w}));if(!C)return T(E.jsx(At,{...w}));const k=C.paths;return T(E.jsx("svg",{...w,children:k?k.map((L,I)=>E.jsx("path",{d:L.d,className:L.className,fill:L.fill,stroke:L.stroke,opacity:L.opacity,fillRule:L.fillRule,clipRule:L.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 E.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:E.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",children:E.jsx("path",{d:i})})})},un=o=>{const{style:e,orientation:t=Z.Vertical,disabled:n,...r}=o,i=t===Z.Vertical?ln:an;return E.jsx("button",{style:e,className:X(pe["scrollbar-button"],t,"scroll-button"),disabled:n,...r,children:E.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",style:to,children:E.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:c=22,style:d,className:s,onPointerDown:l,onPointerMove:a,onPointerUp:h,orientation:f=Z.Vertical,offset:p=0,currentTouchAnchor:_,elementParent:m,elementRoot:S,key:C,...y}=o;if(!no)return null;const g=D(l,[l]),b=D(a,[a]),j=D(h,[h]),M=f===Z.Vertical,[B,O]=u.useState(!1),T=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=c/2+i/2+6;return{x:M?-z:p+c,y:M?p+c:-z,width:0,height:0}},[M,p,c]),[k,{y:L,x:I}]=Gt(),P=u.useRef(null),{getPortalContainer:v,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=m;for(;V;)W+=V.scrollLeft,H+=V.scrollTop,V=S&&V===S.parentElement?null:V.parentElement;U(Nt.createPortal(E.jsx("div",{className:X("touch-thumb",pe["touch-thumb"],s,pe,{dragging:B}),ref:e,style:{left:W+(z?.x??0)-(c+i)/2,top:H+(z?.y??0)-(c+i)/2,width:M?c:1.8*c,height:M?1.8*c:c,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",...d},tabIndex:-1,onPointerDown:T,...y}),S??v(),C))},[L,B,t,n,r,I,w?.x,w?.y,w?.width,w?.height,s,_,n,c,i,t,m,A,C]),w?E.jsxs(E.Fragment,{children:[E.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:c,orientation:d=Z.Vertical,onScrollOffset:s,onScroll:l,showCustomScrollButtons:a,scrollButtonIncrement:h=200,scrollButtonInitialRepeatDelay:f=260,scrollButtonAdditionalRepeatDelay:p=120,minThumbSize:_=oo,maxThumbSize:m,renderScrollButtonStart:S=cn,renderScrollButtonEnd:C=un,propsTouchThumb:y,propsThumb:g,onMouseDown:b,...j}=o,M=Pe().primaryInput==="touch",B=a??!M;D(l,[l]);const[O,T]=u.useState({offset:0,length:0,disabled:!1}),w=u.useRef(-1),k=d===Z.Vertical,[L,{width:I,height:P}]=me(),v=k?P:I,A=D((x,N,q)=>{if(N===0||q===0){const Ke={offset:0,length:_,disabled:!0};return T(Ke),Ke}if(N>=q)return{offset:0,length:v,disabled:!0};const he=q/v,be=N/he,de=Math.min(Math.max(_,be),Math.min(v,m??Number.MAX_SAFE_INTEGER)),rt=x/he;return{offset:Math.min(Math.max(0,rt