@sheetxl/utils-react 0.7.12 → 0.7.14

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