@sheetxl/studio-mui 0.7.12 → 0.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/BAcqVi4z0lEWdogG.cjs +6 -0
- package/browser/cjs/{CcsfLc43Qp-vN_dY.cjs → BXSBqvJbFd1zmXED.cjs} +3 -3
- package/browser/cjs/BXpuqWQiSePSVD7I.cjs +6 -0
- package/browser/cjs/BY_Yr3aQW5hLO-nN.cjs +6 -0
- package/browser/cjs/BankB3sWgfQSVyEv.cjs +20 -0
- package/browser/cjs/{wyak0LMoe5SYbD51.cjs → BkRzKXHu8z2zghTF.cjs} +2 -2
- package/browser/cjs/CYeknazLzZOjQtcK.cjs +6 -0
- package/browser/cjs/CyLVMzcTgEZPvYOm.cjs +6 -0
- package/browser/cjs/DD9bJC3Knid6T5It.cjs +6 -0
- package/browser/cjs/{CMEmwUuGpnOyILAu.cjs → SQX0Xb9ngHtVWoYW.cjs} +1 -1
- package/browser/cjs/_A_9JrHZzYhVIimw.cjs +7 -0
- package/browser/cjs/gmJVh5GO4raegeQH.cjs +6 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{fsGSNDVe9urk2cLB.mjs → BUX-eSzx85xb14z2.mjs} +2 -2
- package/browser/esm/BhK8LG6eLNtnpyM8.mjs +50 -0
- package/browser/esm/{B7ChnkonDRA2zazH.mjs → Bt5mafuXg0WhvqQl.mjs} +3 -3
- package/browser/esm/CM2aBn9YvLNeeDKP.mjs +26 -0
- package/browser/esm/{DK1cCQD1jHxZbFAp.mjs → CWzQRJNunubg1KYs.mjs} +1 -1
- package/browser/esm/{CRmCo9Jr1gvSFGVp.mjs → C_L0TMqGy3dfJBxX.mjs} +833 -829
- package/browser/esm/{aeHM-2IGRQaGFohd.mjs → D3fJ2Y2akXy1Cea2.mjs} +28 -27
- package/browser/esm/DAM5zld1EMvhrTq7.mjs +46 -0
- package/browser/esm/DBreu3Q0z7uri1up.mjs +50 -0
- package/browser/esm/DYbBkU4jsgMfwHKv.mjs +155 -0
- package/browser/esm/DkCrTK-q70GM5ZtY.mjs +53 -0
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/uswYw8_B9PDchitz.mjs +25 -0
- package/licenses/dependencies.txt +142 -142
- package/node/esm/{BSTIZiKBGgwjXLtp.mjs → B2g633xDh_bOofUD.mjs} +18 -18
- package/node/esm/{CGaHni9C2sipjSMn.mjs → B2kR5d7yN_btwSPu.mjs} +9 -7
- package/node/esm/{H012qdl97RHln5MW.mjs → B3fiHsOdyeQ-hH_X.mjs} +1 -1
- package/node/esm/{BEFwnAOkyd0CWlex.mjs → BCgE2DMn9_S_eSSk.mjs} +13 -13
- package/node/esm/B_WXfCoiTjdjGFTw.mjs +26 -0
- package/node/esm/BjHur-Y2v2kC9PV8.mjs +156 -0
- package/node/esm/CJHoW3AcW0bzWuGz.mjs +52 -0
- package/node/esm/CKgRE7End3PwfjDJ.mjs +25 -0
- package/node/esm/{CwKoYwlrp9nnVHln.mjs → EtyY49hdotdAcmRj.mjs} +22 -22
- package/node/esm/index.mjs +115 -116
- package/node/esm/{Df6HNjgJTgShGC-O.mjs → uQbXUzeyLOqo4POP.mjs} +1 -1
- package/package.json +17 -15
- package/browser/cjs/BYfcSe1JgcohGr-C.cjs +0 -7
- package/browser/cjs/BZPmbh6TWeAN2tiY.cjs +0 -6
- package/browser/cjs/CrkutQSHB1Buy5oQ.cjs +0 -6
- package/browser/cjs/D2KC31HOMCGQMLvD.cjs +0 -6
- package/browser/cjs/DiQXaxwfHcQfkYKX.cjs +0 -6
- package/browser/cjs/Dmw2IW35YLNmLgvP.cjs +0 -20
- package/browser/cjs/bItCE_-c88dO7Izw.cjs +0 -6
- package/browser/cjs/fa-Q2vHsld47aqrE.cjs +0 -6
- package/browser/esm/BZPlU0oT2oGTQQgK.mjs +0 -46
- package/browser/esm/BzGH26JDt4xKZfM7.mjs +0 -49
- package/browser/esm/CA-_Kya2gsMrF9Ef.mjs +0 -26
- package/browser/esm/CGBRrUgnGzuP9FGo.mjs +0 -156
- package/browser/esm/csScKLYnqrrlL197.mjs +0 -25
- package/browser/esm/lm9H6CMj_7o_ra2l.mjs +0 -53
- package/node/esm/BqLlyKyVXFNiRaJv.mjs +0 -25
- package/node/esm/Cq6TadzONqFlX07d.mjs +0 -26
- package/node/esm/D71WQjM6hP5FzBql.mjs +0 -157
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";var Di=Object.create;var En=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var Ii=Object.getOwnPropertyNames;var Ni=Object.getPrototypeOf,Oi=Object.prototype.hasOwnProperty;var Ai=(a,i,o,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ii(i))!Oi.call(a,r)&&r!==o&&En(a,r,{get:()=>i[r],enumerable:!(t=Fi(i,r))||t.enumerable});return a};var Pn=(a,i,o)=>(o=a!=null?Di(Ni(a)):{},Ai(i||!a||!a.__esModule?En(o,"default",{value:a,enumerable:!0}):o,a));/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/const A=require("@sheetxl/sdk"),oe=require("@sheetxl/react"),e=require("react/jsx-runtime"),n=require("react"),E=require("@mui/material"),b=require("@sheetxl/utils-mui"),w=require("@sheetxl/utils-react"),q=require("@mui/material/styles"),Pe=require("@mui/system"),Je=require("react-dom"),je=require("@sheetxl/utils"),ct=require("@sheetxl/io");function ka(a){var i,o,t="";if(typeof a=="string"||typeof a=="number")t+=a;else if(typeof a=="object")if(Array.isArray(a)){var r=a.length;for(i=0;i<r;i++)a[i]&&(o=ka(a[i]))&&(t&&(t+=" "),t+=o)}else for(o in a)a[o]&&(t&&(t+=" "),t+=o);return t}function ie(){for(var a,i,o=0,t="",r=arguments.length;o<r;o++)(a=arguments[o])&&(i=ka(a))&&(t&&(t+=" "),t+=i);return t}const va=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...u}=a,l=w.useCommands(o,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),c=n.useMemo(()=>{for(let x=0;x<l.length;x++)if(l[x]?.state())return l[x];return l[0]},[l]),m=n.useMemo(()=>{if(!t)return null;const x={...t};return delete x.beforeExecute,x},[t]),C=n.useCallback((x,f)=>{const p={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},y=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...p,command:f.getCommand("formatAlignLeftToggle")}),e.jsx(b.CommandButton,{...p,command:f.getCommand("formatAlignCenterToggle")}),e.jsx(b.CommandButton,{...p,command:f.getCommand("formatAlignRightToggle")}),e.jsx(b.CommandButton,{...p,command:f.getCommand("formatAlignJustifyToggle")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...p,command:f.getCommand("formatAlignCenterContinuousToggle")}),e.jsx(b.CommandButton,{...p,command:f.getCommand("formatAlignFillToggle")}),e.jsx(b.CommandButton,{...p,command:f.getCommand("formatAlignDistributedHorizontalToggle")})]}),S=e.jsxs(E.Box,{sx:{className:ie("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:g=>g.stopPropagation(),children:[e.jsx(b.CommandButton,{command:f.getCommand("formatIndentDecrease"),commandHook:m,scope:r,disabled:s}),e.jsx(b.CommandButton,{command:f.getCommand("formatIndentIncrease"),commandHook:m,scope:r,disabled:s})]}),h=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...u,children:[S,e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})]});return b.defaultCreatePopupPanel({...x,children:h})},[s,t]);return e.jsx(b.CommandPopupButton,{ref:i,parentFloat:d,commands:o,commandHook:t,scope:r,createPopupPanel:C,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:c?.key(),icon:c?.icon()??"FormatAlignLeft",...u})})),ja=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=w.useCommands(o,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),l=n.useMemo(()=>{for(let m=0;m<u.length;m++)if(u[m]?.state())return u[m];return u[0]},[u]),c=n.useCallback((m,C)=>{const x={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},f=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...x,command:C.getCommand("formatAlignTopToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatAlignMiddleToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatAlignBottomToggle")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatAlignJustifyVerticalToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatAlignDistributedVerticalToggle")})]});return b.defaultCreatePopupPanel({...m,children:f})},[s,t]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:c,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:l?.icon()??"TextVerticalBottom",...d})})),Ta=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=w.useCommands(o,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),l=n.useMemo(()=>{for(let m=0;m<u.length;m++)if(u[m]?.state())return u[m];return u[0]},[u]),c=w.useCallbackRef((m,C)=>{const x={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},f=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...x,command:C.getCommand("formatTextOverflowVisibleToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatTextOverflowWrapToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatTextOverflowClipToggle")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatTextOverflowShrinkToggle")})]});return b.defaultCreatePopupPanel({...m,children:f})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:c,icon:l?.icon()??"TextHorizontalOverflow",...d})})),Ba=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=w.useCommands(o,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),l=n.useMemo(()=>{const C=u.length;for(let x=0;x<C;x++){const f=u[x];if(f?.state())return f}return u[1]},[u]),c=n.useCallback((C,x)=>{const f={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},p=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...f,command:x.getCommand("formatTextRotate0")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...f,command:x.getCommand("formatTextRotate315")}),e.jsx(b.CommandButton,{...f,command:x.getCommand("formatTextRotate45")}),e.jsx(b.CommandButton,{...f,command:x.getCommand("formatTextRotate90")}),e.jsx(b.CommandButton,{...f,command:x.getCommand("formatTextRotate270")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.InputCommandButton,{...f,command:x.getCommand("formatTextRotateCustom"),label:"Custom"})]});return b.defaultCreatePopupPanel({...C,children:p})},[s,t,r,o]),m=n.useMemo(()=>(o.getCommand("formatTextRotateCustom")?.state()??0)!==0,[u]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,selected:m,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:c,quickCommand:m?"formatTextRotate0":"formatTextRotate315",icon:l?.icon()??"TextRotation315",...d})})),Ea={Preset:"preset",Custom:"custom"},ut={Start:"start",End:"end"},xo={},Li=(a,i,o,t)=>{const r=a+"-"+i+"-"+o+(t?"-server":"");if(xo[r])return xo[r];const s=((d,u,l,c)=>{if(typeof document>"u"&&!c)return null;const m=c?new c:document.createElement("canvas");m.width=2*l,m.height=2*l;const C=m.getContext("2d");return C?(C.fillStyle=d,C.fillRect(0,0,m.width,m.height),C.fillStyle=u,C.fillRect(0,0,l,l),C.translate(l,l),C.fillRect(0,0,l,l),m.toDataURL()):null})(a,i,o,t);return xo[r]=s,s},zi={},Pa=n.memo(a=>{const{className:i,style:o=w.ReactUtils.EmptyCssProperties,white:t="transparent",grey:r="grey",size:s=8,borderRadius:d,boxShadow:u,renderers:l=zi,children:c,...m}=a,C=c,x=n.useMemo(()=>Object.assign({borderRadius:d,boxShadow:u,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${Li(t,r,s,l?.canvas)}) center left`},o),[t,r,s,l]);return n.isValidElement(c)?n.cloneElement(c,{...C.props}):e.jsx("div",{style:x,...m})}),Hi=n.memo(a=>{const{selectedColor:i,onSelectColor:o,onPreviewColor:t,onClick:r,onKeyDown:s,onMouseOver:d,onMouseLeave:u,onFocus:l,style:c=w.ReactUtils.EmptyCssProperties,children:m,alphaWhite:C,alphaGrey:x,darkMode:f,alphaCheckSize:p=7,...y}=a;if(!i)throw new Error("a selectedColor is required");const S=n.useCallback(T=>{r?.(T),T.isDefaultPrevented()||(T.ctrlKey?t?.(i.toRGBA()):o?.(i.toRGBA()))},[o,t,r,i]),h=n.useCallback(T=>{d?.(T),T.isDefaultPrevented()||t?.(i.toRGBA())},[t,d,i]),g=n.useCallback(T=>{u?.(T),T.isDefaultPrevented()},[t,u]),k=n.useCallback(T=>{l?.(T),T.isDefaultPrevented()||t?.(i.toRGBA())},[t,l,i]),j=n.useCallback(T=>{s?.(T),T.isDefaultPrevented()||T.keyCode===w.KeyCodes.Enter&&o?.(i.toRGBA())},[o,s,i]),v=n.useMemo(()=>i.toRGBA().alpha===1?null:e.jsx(Pa,{size:p,white:C,grey:x,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[C,x,i]);return e.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...c},tabIndex:0,...y,onClick:S,onKeyDown:j,onMouseOver:h,onMouseLeave:g,onFocus:k,children:[v,e.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:i.toCSS(f)},children:m})]})}),io=n.memo(a=>{const{schemeColorLookup:i,selectedColor:o,previewColor:t,colorDef:r,onSelectColorDef:s,onPreviewColorDef:d,swatchProps:u,defaultButtonSize:l=24,isLarge:c=!1,compareRGB:m=!1,darkMode:C=!1,...x}=a,f=new A.Color({val:r.definition.val,adjs:r.definition.adjs},v=>i(v)),p=m?f.toRGBA().toString():f.toString(),y=o&&(m?o.toRGBA().toString():o.toString())===p,S=t&&(m?t.toRGBA().toString():t.toString())===p,h=[];h.push({[A.IColor.AdjustmentType.Inv]:!0}),h.push({[A.IColor.AdjustmentType.Alpha]:100});const g=f.adjust(h),k=n.useCallback(()=>{s?.(r)},[s,r]),j=n.useCallback(v=>{d?.(v?r:null)},[d,r]);return e.jsx(b.SimpleTooltip,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:r.description,placement:"bottom-start",children:e.jsx("div",{style:{width:l*(c?1.2:1)+"px",height:l*(c?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...x,children:e.jsxs(Hi,{selectedColor:f,title:null,onSelectColor:k,onPreviewColor:j,alphaCheckSize:c?9:void 0,darkMode:C,...u,children:[e.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:g.toRGBA(C).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:y?"1":"0"}}),e.jsx("div",{style:{position:"absolute",width:.33*l*(c?1.2:1)+"px",height:.33*l*(c?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:g.toRGBA(C).toString(),borderRadius:"50%",opacity:S?"1":"0"}})]})})})}),Dt=n.memo(a=>{const{title:i,schemeColorLookup:o,colorDefs:t,selectedColor:r,previewColor:s,onSelectColorDef:d,onPreviewColorDef:u,style:l=w.ReactUtils.EmptyCssProperties,compareRGB:c=!1,darkMode:m,swatchProps:C,...x}=a;let f;if(Array.isArray(t[0]))f=t;else{f=[];for(let g=0;g<t.length;g++)f.push([t[g]])}const p=n.useCallback(g=>{d?.(g)},[d]),y=n.useCallback(g=>{u?.(g)},[u]),S=n.useMemo(()=>{let g=[];for(let k=0;k<f.length;k++){let j=[],v=f[k];for(let M=0;M<v.length;M++){let R=v[M];j.push(e.jsx(io,{schemeColorLookup:o,colorDef:R,selectedColor:r,previewColor:s,onSelectColorDef:p,onPreviewColorDef:y,swatchProps:C,compareRGB:c,darkMode:m},k+" "+M))}let T=e.jsx(E.Box,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:M=>M.shadows[2],borderRadius:"2px",overflow:"hidden"},children:j},""+k);g.push(T)}return g},[f,r,s,p,y]),h=n.useMemo(()=>i?e.jsx(E.Typography,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:g=>g.palette.text.secondary},children:i}):null,[i]);return e.jsxs(E.Box,{style:{...l},children:[h,e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...x,children:S})]})}),Me=(a,i)=>({description:a,definition:{val:i,adjs:[]}}),ge=(a,i,o,t,r,s)=>{const d=Me(a,i);t?.push(d);const u=new A.Color({val:d.definition.val,adjs:d.definition.adjs},o),l=u.toString();r?.set(l,u);const c=u.toRGBA().toString();s?.set(c,u)},Wi=n.lazy(()=>Promise.resolve().then(()=>require("./BkRzKXHu8z2zghTF.cjs"))),Ra=n.memo(n.forwardRef((a,i)=>{const{selectedColor:o=null,previewColor:t=a.selectedColor??null,recentColors:r,schemeLookup:s,disableAlpha:d=!1,previewDebounceTime:u=100,initialPanelType:l,defaultButtonSize:c=24,width:m,onElementLoad:C,onDone:x,onEyeDropStart:f,onEyeDropStop:p,onPreviewColor:y,onPreviewColorImmediate:S,onSelectColor:h,autoColor:g,autoColorLabel:k="Automatic",autoColorPosition:j=ut.Start,compareRGB:v=!1,darkMode:T=!1,...M}=a,R=t||o,D=w.useCallbackRef(y,[y]),F=w.useCallbackRef(S,[S]),B=w.useCallbackRef(h,[h]),P=w.useCallbackRef(f,[f]),N=w.useCallbackRef(p,[p]),[z,O]=n.useState(!1),H=q.useTheme(),I=n.useMemo(()=>s||A.Color.getDefaultSchemeLookup(),[s]),W=n.useMemo(()=>{const K=new Map,te=new Map,de=[];ge("Primary Background","bg1",I,de,K,te),ge("Primary Text","tx1",I,de,K,te),ge("Secondary Background","bg2",I,de,K,te),ge("Secondary Text","tx2",I,de,K,te),ge("Accent 1","accent1",I,de,K,te),ge("Accent 2","accent2",I,de,K,te),ge("Accent 3","accent3",I,de,K,te),ge("Accent 4","accent4",I,de,K,te),ge("Accent 5","accent5",I,de,K,te),ge("Accent 6","accent6",I,de,K,te);const ve=A.ITheme.buildPalette(de,I,K,te),se=[];if(ge("Dark Red","C00000",I,se,K,te),ge("Red","FF0000",I,se,K,te),ge("Orange","FFC000",I,se,K,te),ge("Yellow","FFFF00",I,se,K,te),ge("Light Green","92D050",I,se,K,te),ge("Green","00B050",I,se,K,te),ge("Light Blue","00B0F0",I,se,K,te),ge("Blue","0070C0",I,se,K,te),ge("Dark Blue","002060",I,se,K,te),d?ge("Purple Is A Fruit","7030A0",I,se,K,te):ge("Transparent","00000000",I,se,K,te),g){const me=g.toString();K.set(me,g)}const De=new Map,Te=typeof r=="function"?r():r,Ne=[];for(let me=0;Te&&me<Te.length;me++){const Z=Te[me].toString();De.set(Z,Te[me]),Ne.push({description:"Recent "+(me+1),definition:{val:Te[me].toString()}})}return{primaryColors:de,modifiedPresets:ve,standardColors:se,recentColorsLimited:Ne,mapAllPresets:K,mapAllPresetsRGB:te,mapRecent:De}},[I,r,d,g]);n.useEffect(()=>{C?.()},[]);const[ee,X]=n.useState(!1),ne=n.useCallback(()=>{X(K=>!K)},[]);n.useEffect(()=>{if(l)X(l===Ea.Custom);else if(o){let K=o.toString(),te=W.mapAllPresets.get(K);te||(K=o.toRGBA().toString(),te=W.mapAllPresetsRGB.get(K));const de=W.mapRecent.get(K);X(!te&&!de)}},[o,l]);const $=n.useCallback(A.CommonUtils.debounce(K=>{D?.(K)},u),[D,u]),[U,Y]=n.useState();n.useEffect(()=>{Y(t||o)},[t,o]);const _=w.useCallbackRef(K=>{F&&(F(K),$(K))},[F]),L=w.useCallbackRef(K=>{_(K?new A.Color({val:K.definition.val,adjs:K.definition.adjs},I):null)},[I]),G=n.useCallback(K=>{K.ctrlKey&&X(!0)},[]),Q=w.useCallbackRef(K=>{let te=!1;if(K){const de=K.toString();te=!W.mapAllPresets.has(de)}B?.(K,te)},[B,W]),fe=w.useCallbackRef(K=>{const te=K?new A.Color({val:K.definition.val,adjs:K.definition.adjs},I):null;Promise.resolve(x?.()).then(()=>{Q(te)})},[I,x]),re=w.useCallbackRef(K=>{_(K?new A.Color(K,I):null)},[I]),ue=n.useMemo(()=>window.EyeDropper===void 0?e.jsx(e.Fragment,{}):e.jsx(E.IconButton,{"aria-label":"eye dropper",size:"small",sx:{color:K=>K.palette.text.icon??K.palette.action.active},onClick:async()=>{O(!0),P?.(),await new EyeDropper().open().then(K=>{O(!1),N?.();let te=new A.Color(K.sRGBHex),de=te.toString(),ve=W.mapAllPresets.get(de);if(ve||(de=te.toRGBA().toString(),ve=W.mapAllPresetsRGB.get(de)),!ve){const se=te.toRGBA(),De=3;let Te=255;W.mapAllPresetsRGB.forEach((Ne,me)=>{const Z=Ne.toRGBA(),le=Math.abs(Z.red-se.red)+Math.abs(Z.blue-se.blue)+Math.abs(Z.green-se.green);le<De&&le<Te&&(ve=Ne)})}X(!ve),_(ve||te)}).catch(K=>{O(!1),K?.name!=="AbortError"&&console.error(K)})},children:e.jsx(w.DynamicIcon,{iconKey:"Colorize"})}),[W,T]),Se=n.useMemo(()=>{if(!ee)return;const K={opacity:ee?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return e.jsx(n.Suspense,{fallback:e.jsx("div",{style:K,children:e.jsx(b.LoadingPanel,{})}),children:e.jsx(Wi,{style:K,selectedColor:R?R.toRGBA().toString():"transparent",onColorChange:re,disableAlpha:d})})},[ee,R]),Ce=n.useMemo(()=>({onClick:G,alphaGrey:H.palette.text.icon??H.palette.action.active}),[G,H]),J=n.useMemo(()=>{if(!g)return null;const K={description:k,definition:{val:g.getVal(),adjs:g.getAdjustments()}};return e.jsx(e.Fragment,{children:e.jsxs(E.MenuItem,{sx:{display:"flex",color:te=>te.palette.text.secondary},onMouseOver:()=>{L(null)},onClick:()=>{fe(null)},children:[e.jsx(E.Box,{sx:{flex:"none",boxShadow:te=>te.shadows[2],borderRadius:te=>te.spacing(.5),overflow:"hidden"},children:e.jsx(io,{schemeColorLookup:I,colorDef:K,selectedColor:o===null?g:o,previewColor:t===null?g:t,defaultButtonSize:c,isLarge:!0,darkMode:T,compareRGB:v,swatchProps:Ce})}),e.jsx(E.Typography,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:k})]})})},[g,k,I,o,t]);return e.jsxs(E.Box,{ref:i,sx:{width:m,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},...M,children:[e.jsxs("div",{style:{position:"relative",display:"flex"},children:[e.jsxs("div",{style:{opacity:ee?"0":1},children:[J&&j===ut.Start?e.jsxs(e.Fragment,{children:[J,e.jsx(E.Divider,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,e.jsx(Dt,{title:"Theme Colors",schemeColorLookup:I,colorDefs:W.primaryColors,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsx(Dt,{schemeColorLookup:I,colorDefs:W.modifiedPresets,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Dt,{title:"Standard Colors",schemeColorLookup:I,colorDefs:W.standardColors,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T}),e.jsxs("div",{style:{opacity:W.recentColorsLimited.length===0?"0":void 0,display:W.recentColorsLimited.length===0?"none":void 0},children:[e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsx(Dt,{title:"Recent Colors",schemeColorLookup:I,colorDefs:W.recentColorsLimited,selectedColor:o,previewColor:t===void 0?o:t,swatchProps:Ce,onPreviewColorDef:L,onSelectColorDef:fe,compareRGB:v,darkMode:T})]}),J&&j===ut.End?e.jsxs(e.Fragment,{children:[e.jsx(E.Divider,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),J,e.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),Se]}),e.jsx(E.Divider,{light:!0,style:{marginBottom:"10px"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[ue,e.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),e.jsx(E.Button,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{ne()},children:ee?e.jsx("div",{children:"Preset"}):e.jsx("div",{children:"Custom"})}),e.jsx(E.Button,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(x?.()).then(()=>{Q(U)})},children:"Done"})]})]})})),$i=e.jsx(w.DynamicIcon,{iconKey:"circle.colored"}),Ao=n.memo(n.forwardRef((a,i)=>{const{selectedColor:o,quickColor:t,icon:r=$i,tooltip:s,label:d,onPreviewColor:u,onPreviewColorImmediate:l,onSelectColor:c,variant:m=b.PopupButtonType.Toolbar,panelProps:C,shouldCloseFloatAll:x=!0,compareRGB:f=!1,darkMode:p=!1,...y}=a,S=w.useCallbackRef(u,[u]),h=w.useCallbackRef(l,[l]),g=w.useCallbackRef(c,[c]),[k,j]=n.useState(()=>{}),v=t||k||o||C?.autoColor,T=n.useRef(!1),M=n.useCallback(()=>{},[]),R=w.useCallbackRef(()=>{j(o)},[o]),D=w.useCallbackRef(W=>{T.current||(j(W),S?.(W))},[S]),F=w.useCallbackRef(W=>{T.current||(j(W),h?.(W))},[h]),B=w.useCallbackRef((W,ee)=>{T.current||(j(void 0),g?.(W,ee))},[g]),P=n.useMemo(()=>e.jsx(E.Box,{className:"color-wrapper",sx:{lineHeight:"0",color:"inherit","--sxl-color-active":`${v?.toCSS(p)??"transparent"}`,"& .activeColor":{fill:`${v?.toCSS(p)??"transparent"}`},"& .style_grey":{fill:W=>W.palette.text.icon??W.palette.action.active}},children:typeof r=="function"?r():r}),[v,r,p]),N=w.useCallbackRef(W=>{g?.(t,!1)},[g,t]),[z,O]=n.useState(!1),H=n.useCallback(W=>{const{closeFloat:ee,closeFloatAll:X}=W;return e.jsx(Ra,{...C,selectedColor:o,previewColor:k,onDone:x?X:ee,onKeyDown:ne=>{ne.which===w.KeyCodes.Enter&&(x?X():ee())},onPreviewColorImmediate:F,onPreviewColor:D,onSelectColor:B,onEyeDropStart:()=>O(!0),onEyeDropStop:()=>O(!1),compareRGB:f,darkMode:p})},[o,k,x,v,C?.autoColor,p]),I={onQuickClick:t?N:void 0,createPopupPanel:H,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:R,onPopupClose:M,tooltip:s||d||"Color",label:d,icon:P,...y};return m===b.PopupButtonType.Toolbar?e.jsx(b.ExhibitPopupIconButton,{ref:i,...I}):e.jsx(b.ExhibitPopupMenuItem,{ref:i,...I})})),eo=82,Mo=a=>{const{styleColor:i,length:o=eo,width:t=1,dashArray:r=null,sx:s,isDouble:d=!1,isAngled:u=!1,darkMode:l=!1,...c}=a;return e.jsx(E.SvgIcon,{sx:{width:`${o}px`,height:`${t}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:m=>`${i?i.toRGBA(l).toString():m.palette.text.icon??m.palette.action.active}`},"& .style_grey":{stroke:m=>m.palette.text.icon??m.palette.action.active},...s},height:t,width:o,viewBox:`0 0 ${o} ${t}`,...c,children:e.jsx(oe.StyledStrokePath,{length:o,width:t,dashArray:r,isDouble:d,isAngled:u,className:"activeColor"})})},Ma=n.memo(n.forwardRef((a,i)=>{const{variant:o,showLabels:t=!1,disabled:r=!1,createPopupPanel:s,styleColor:d,selectedStyle:u,onSelectStyle:l,showNone:c=!0,darkMode:m,sx:C,...x}=a,f=w.useCallbackRef(l,[]),p=n.useCallback(g=>{const{popupContainer:k,floatReference:j,closeFloat:v,...T}=g,M=[],R=A.IBorder.BuiltInDefinitionsArray;for(let D=0;D<R.length;D++){const F=R[D];if(F.description==="None"&&!c)continue;const B=e.jsx(Mo,{styleColor:d,length:eo,width:F.width,darkMode:m,dashArray:F.pattern,isDouble:F.description.toLowerCase().includes("double"),isAngled:F.description.toLowerCase().includes("slant")});let P=null;P=t?e.jsxs(e.Fragment,{children:[e.jsx(E.Box,{sx:{marginRight:"6px"},children:F.description}),e.jsxs(E.Box,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[e.jsx("div",{style:{flex:"1 1 100%"}}),B]})]}):F.description==="None"?"None":B,M.push(e.jsx(b.ExhibitMenuItem,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:b.createStrokeShadowFilter(4)},paddingLeft:"16px",background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},tooltipProps:{description:t?"":F.description},icon:null,disabled:r,onMouseDown:N=>N.preventDefault(),onMouseUp:()=>{v(),f(F.style)},onKeyDown:N=>{N.which===w.KeyCodes.Enter&&v()},selected:F.style===u,parentFloat:j,children:P},D))}return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:M})},[r,c,d,u,m]),y=n.useMemo(()=>{const g=A.IBorder.BuiltInDefinitions.get(u);let k;return k=g.description==="None"?e.jsx(E.Box,{sx:{minWidth:`${eo}px`},children:"None"}):e.jsx(Mo,{styleColor:d,length:eo,width:g.width,dashArray:g.pattern,darkMode:m,isDouble:g.description.toLowerCase().includes("double"),isAngled:g.description.toLowerCase().includes("slant")}),e.jsx(E.Box,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:b.createStrokeShadowFilter()}},children:k})},[u,d]),S=n.useMemo(()=>A.IBorder.BuiltInDefinitions.get(u),[u]),h={disabled:r,icon:y,tooltip:"Border Style: "+S.description,sx:{background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,...C},createPopupPanel:p,...x};return o===b.PopupButtonType.Toolbar?e.jsx(b.ExhibitPopupIconButton,{...h}):e.jsx(b.ExhibitPopupMenuItem,{...h})})),Da=n.memo(n.forwardRef((a,i)=>{const{autoColor:o=null,schemeLookup:t,autoStrokeStyle:r=A.IBorder.StrokeStyle.Thin,disabled:s=!1,darkMode:d=!1,showStylingBefore:u=!0,onSelectBorder:l,onPreviewBorder:c,selectedBorder:m,createTemporaryBorder:C,...x}=a,f=w.useCallbackRef(l,[l]),p=w.useCallbackRef(c,[c]),[y,S]=n.useState(),[h,g]=n.useState(),k=y??r,j=h??o,v=m||{bottom:{style:r,color:o?.toString()}},T=w.useCallbackRef(P=>{const N={},z=P?Object.keys(P):[];let O=!1;const H=z.length;for(let Y=0;Y<H;Y++){const _=z[Y];P[_]?.style&&(N[_]={style:P[_].style,color:P[_].color},O||N[_].style===A.IBorder.StrokeStyle.None||(O=!0))}z.length<6&&(O=!0);const I=O?N.left:null,W=O?N.top:null,ee=O?N.right:null,X=O?N.bottom:null,ne=O?N.vertical:null,$=O?N.horizontal:null;let U="";return W||I||(U+="M 3,5 H 5 V 3 H 3 "),W||(U+="M 7,5 H 9 V 3 H 7 "),W||ne||(U+="M 11,5 h 2 V 3 h -2 "),W||(U+="M 15,5 h 2 V 3 h -2 "),W||ee||(U+="M 19,5 h 2 V 3 h -2 "),I||(U+="M 3,9 H 5 V 7 H 3 "),ne||(U+="M 11,9 h 2 V 7 h -2 "),ee||(U+="M 19,9 h 2 V 7 h -2 "),$||I||(U+="M 3,13 H 5 V 11 H 3 "),$||(U+="M 7,13 H 9 V 11 H 7 "),$||ne||(U+="M 11,13 h 2 v -2 h -2 "),$||ee||(U+="M 19,13 h 2 v -2 h -2 "),$||(U+="M 15,13 h 2 v -2 h -2 "),I||(U+="M 3,17 H 5 V 15 H 3 "),ne||(U+="M 11,17 h 2 v -2 h -2 "),ee||(U+="M 19,17 h 2 v -2 h -2 "),X||I||(U+="M 3,21 H 5 V 19 H 3 "),X||(U+="M 7,21 H 9 V 19 H 7 "),X||ne||(U+="M 11,21 h 2 v -2 h -2 "),X||(U+="M 15,21 h 2 v -2 h -2 "),X||ee||(U+="M 19,21 h 2 v -2 h -2 "),e.jsxs(w.DynamicIcon,{children:[" ",e.jsxs(E.Box,{className:"border-icon",sx:{width:"var(--icon-size, var(--icon-size-md))",height:"var(--icon-size, var(--icon-size-md))",position:"relative","& .grid > path":{opacity:"0.8"}},children:[e.jsx("svg",{viewBox:"0 0 24 24",className:"grid",style:{top:"0px",left:"0px",width:"calc(var(--icon-size, var(--icon-size-md)) + 1px)",height:"calc(var(--icon-size, var(--icon-size-md)) + 1px)",position:"absolute"},children:e.jsx("path",{className:"fill",d:U})}),e.jsx(E.Box,{className:"border-container",sx:{position:"absolute",display:"flex",justifyContent:"stretch",alignItems:"stretch",top:"0px",left:"0px",width:"var(--icon-size, var(--icon-size-md))",height:"var(--icon-size, var(--icon-size-md))",padding:"1px 1px","& svg path":{filter:b.strokeShadowFilter}},children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:(Y,_)=>{if(!C||z.length===0)return null;const L=Y.rowIndex,G=Y.colIndex,Q={};return L===0?(Q.top=N.top,Q.bottom=N.horizontal):(Q.top=N.horizontal,Q.bottom=N.bottom),G===0?(Q.left=N.left,Q.right=N.vertical):(Q.left=N.vertical,Q.right=N.right),C?.(Q)},darkMode:d,style:{top:"2px",left:"2px",width:"calc(100% - 5px)",height:"calc(100% - 5px)",position:"absolute"}})})]})]})},[j,k,d]),M=n.useCallback((P,N,z)=>{let O=null;if(P&&P.length>0){let H=null;(N||z)&&(H={style:z,color:N?.toString()??null}),O={};const I=P.length;for(let W=0;W<I;W++)O[P[W]]=H}return O},[]),R=n.useCallback(P=>{f?.(P)},[]),D=n.useCallback(P=>{p?.(P)},[]),F=n.useCallback(P=>{const{closeFloatAll:N,floatReference:z}=P,O=(W,ee,X="bottom",ne=!1)=>{const $=M(W,j??null,ne?A.IBorder.StrokeStyle.None:k??null),U=ne?M([],j??null,k??null):$;return e.jsx(b.ExhibitIconButton,{icon:T(U),sx:{background:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},tooltipProps:{label:ee,simple:!0,placement:X},onClick:()=>{N(),D($),R($)}})},H=e.jsxs(e.Fragment,{children:[e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom,A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical],"All Borders","top"),O([A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical],"Inner Borders","top"),O([A.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),O([A.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom],"Outside Borders","top")]}),e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[O([A.IBorder.Edge.Left],"Left Borders"),O([A.IBorder.Edge.Top],"Top Borders"),O([A.IBorder.Edge.Right],"Right Borders"),O([A.IBorder.Edge.Bottom],"Bottom Borders"),O([A.IBorder.Edge.Left,A.IBorder.Edge.Top,A.IBorder.Edge.Right,A.IBorder.Edge.Bottom,A.IBorder.Edge.Horizontal,A.IBorder.Edge.Vertical,A.IBorder.Edge.DiagonalUp,A.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),I=e.jsx(e.Fragment,{children:e.jsxs(E.Box,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[e.jsx(Ao,{variant:b.PopupButtonType.Toolbar,icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),selectedColor:k===A.IBorder.StrokeStyle.None?new A.Color("transparent"):j,onPreviewColor:W=>{g(W)},onSelectColor:(W,ee)=>{g(W)},darkMode:d,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:o,schemeLookup:t},disabled:s||k===A.IBorder.StrokeStyle.None,parentFloat:z,shouldCloseFloatAll:!1}),e.jsx(Ma,{selectedStyle:k,onSelectStyle:S,styleColor:j,darkMode:d,variant:b.PopupButtonType.Toolbar,parentFloat:z})]})});return e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:W=>W.stopPropagation(),children:[u?I:H,e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),u?H:I]})},[k,j,o,t,d]),B=n.useMemo(()=>T(v),[v,d]);return e.jsx(b.ExhibitPopupIconButton,{ref:i,createPopupPanel:F,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:P},N)=>e.jsx(b.ExhibitTooltip,{label:"Borders",description:"Set the borders.",disabled:N,children:P}),onQuickClick:()=>{f?.(v)},quickButtonProps:{sx:{}},disabled:s,icon:B,...x})})),Fa=n.memo(n.forwardRef((a,i)=>{const{commands:o,command:t,commandHook:r,variant:s=w.CommandButtonType.Toolbar,disabled:d=!1,autoColor:u,autoStrokeStyle:l,schemeLookup:c,createTemporaryBorder:m,selectedBorder:C,onSelectBorder:x,darkMode:f,icon:p,label:y,...S}=a,h=w.useCommands(o,["formatBorder"]),g=t??h[0],k=g?.context()??null,j=k?.autoColor??u,v=k?.autoStyle??l,T=C??k?.quickBorder,M=f??k?.darkMode,R=m??k?.createTemporaryBorder,D=c??k?.schemeLookup,F=w.useCallbackRef(P=>{k?.onBorderSelect&&k.onBorderSelect(P),x?.(P),g?.execute(P,r)},[g,x,r]),B=n.useCallback((P,N)=>{const{children:z,title:O,...H}=P;let I=P.children;return(g?.disabled()||d)&&(I=e.jsx("div",{children:I})),e.jsx(b.CommandTooltip,{command:g,placement:s===w.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:N,...H,children:I})},[g,d]);return e.jsx(Da,{ref:i,autoColor:j,darkMode:M,autoStrokeStyle:v,createTemporaryBorder:R,schemeLookup:D,selectedBorder:T,onSelectBorder:F,createTooltip:B,disabled:d||!g||g.disabled(),...S})})),Ia=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=n.useCallback((l,c)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:c.getCommand("mergeToggle")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("mergeHorizontal")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("mergeVertical")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...m,command:c.getCommand("unmerge")})]});return b.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,quickCommand:"mergeToggle",commandHook:t,scope:r,tooltip:"Combine or split cells.",createPopupPanel:u,icon:"MergeAll",...d})})),Na=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=n.useCallback((l,c)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:c.getCommand("freezeToggle")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("freezeToggleHorizontal")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("freezeToggleVertical")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...m,command:c.getCommand("unfreeze")})]});return b.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:u,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:"Freeze",...d})})),Oa=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=n.useCallback((l,c)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:c.getCommand("find")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("findReplace")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("goto")})]});return b.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:u,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:"Find",...d})})),Aa=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,showQuickButtons:r=!!a.commands,commands:s,fontSizes:d=oe.FontUtils.DefaultFontSizes,disabled:u=!1,parentFloat:l,icon:c,label:m,sx:C,...x}=a;w.useCommand(o);const f=()=>o?.state()?.toString()||"11",[p,y]=n.useState(f),S=w.useCallbackRef(()=>{const R=parseFloat(p);isNaN(R)?y(f()):parseFloat(f())!==R&&o.execute(R,t)},[f,o,p,t]);n.useEffect(()=>{y(f())},[o?.state()]);const h=n.useMemo(()=>{if(!t)return null;const R={...t};return delete R.beforeExecute,R},[t]),g=w.useCommands(s,["formatFontSizeIncrease","formatFontSizeDecrease"]),k=n.useMemo(()=>g?e.jsxs(E.Box,{className:ie("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:R=>R.stopPropagation(),children:[e.jsx(b.CommandButton,{command:g[0],commandHook:h}),e.jsx(b.CommandButton,{command:g[1],commandHook:h})]}):null,[g]),j=q.useTheme(),v=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("12.3",Math.round(j.typography.fontSize),j.typography.fontFamily).width}px`,[j]),T=n.useCallback(R=>{const{onMouseDown:D,onMouseUp:F,...B}=R;return e.jsx(E.IconButton,{component:"div",...B,disableRipple:!0,children:e.jsx(E.Input,{inputMode:"numeric",disabled:u||!o||o.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:P=>`1px solid ${P.palette.text.icon??P.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:P=>`1px solid ${P.palette.error.main}`},"::after":{borderBottom:P=>`1px solid ${P.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:P=>`${Math.round(P.typography.fontSize)}px`,width:v,color:P=>P.palette.text.secondary,input:{padding:"0 0",textAlign:"center",height:"1rem",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:P=>P.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:P=>P.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"}},value:p,onFocus:P=>{P.target?.select()},onKeyDown:P=>{if(P.which===w.KeyCodes.Enter)f()!==p&&(P.stopPropagation(),P.preventDefault(),S());else if(P.which===w.KeyCodes.Escape)f()!==p&&(y(f()),setTimeout(()=>{P.target?.select()},0),P.stopPropagation(),P.preventDefault());else{if(P.key.match("[-]")||P.key.match("[0-9.]")&&(p+P.key).length>4)return P.stopPropagation(),void P.preventDefault();if(P.which===w.KeyCodes.Space)return void P.preventDefault()}},onBlur:()=>{S()},onChange:P=>{if(P.target.value.length>4)return P.stopPropagation(),void P.preventDefault();y(P.target.value)}})})},[p,u,o]),M=n.useCallback(R=>{const D=N=>{o?.execute(N,t)},F=o?.state(),B=[];for(let N=0;N<d.length;N++){const z=d[N]===F;B.push(e.jsx(b.ExhibitMenuItem,{selected:z,icon:z?e.jsx(b.SelectedIcon,{}):void 0,disabled:u||!o||o.disabled(),onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&D(d[N])},onKeyDown:O=>{O.keyCode!==w.KeyCodes.Enter&&O.keyCode!==w.KeyCodes.Space||D(d[N])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:d[N]})},"fontSize-"+N))}const P=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...x,children:[k,e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:B})]});return b.defaultCreatePopupPanel({...R,children:P})},[u,o?.state(),t]);return e.jsx(b.ExhibitPopupIconButton,{ref:i,sx:{...C},tabIndex:-1,outlined:!0,disabled:u,parentFloat:l,createPopupPanel:M,createTooltip:({children:R},D)=>e.jsx(b.ExhibitTooltip,{label:o?.label(),description:o?.description(),disabled:D||o?.disabled(),children:R}),createQuickButton:T,...x})})),Rn=n.memo(a=>{const{selected:i,disabled:o,formattedValue:t,handleSetFormat:r,format:s,sx:d,...u}=a;return e.jsx(b.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...d},disabled:o,selected:i,icon:i?e.jsx(b.SelectedIcon,{}):void 0,onMouseDown:l=>{l.button===0&&l.preventDefault()},onMouseUp:l=>{l.button===0&&r(s.numberFormat)},onKeyDown:l=>{l.keyCode!==w.KeyCodes.Enter&&l.keyCode!==w.KeyCodes.Space||r(s.numberFormat)},...u,children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsxs(E.Typography,{component:"div",children:[s.formatType,s.formatType===A.NumberFormat.Type.Custom?"…":""]}),e.jsx(E.Typography,{variant:"caption",component:"div",sx:{color:l=>Pe.alpha(l.palette.text.primary,.6),paddingTop:t&&t.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:t&&t.length>0?t:" "})]})})}),La=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,sx:s,disabled:d=!1,parentFloat:u,...l}=a,c=w.useCommands(o,["formatNumberFormat"])[0],m=c?.state()?A.NumberFormat.Styles.lookupStyle(c?.state()).formatType:A.NumberFormat.Type.General,C=n.useMemo(()=>{if(!t)return null;const y={...t};return delete y.beforeExecute,y},[t]),x=n.useCallback((y,S)=>{const h=F=>{t?.beforeExecute?.(c,c?.state()),c.execute(F,t),t?.onExecute?.(c,c?.state())},g=c?.context()(),k=A.NumberFormat.Styles.lookupPrimary(),j=[];for(let F=0;F<k.length;F++){let B="";if(g&&!g.isEmpty())try{B=g.getNumberFormat(k[F].numberFormat).displayText}catch(N){console.warn(N)}B===""&&k[F].formatType===A.NumberFormat.Type.General&&(B="No specific format");const P=k[F].formatType===m;j.push(e.jsx(Rn,{selected:P,disabled:d||!c||c.disabled(),formattedValue:B,handleSetFormat:h,format:k[F]},k[F].formatType))}const v={numberFormat:"",formatType:A.NumberFormat.Type.Custom},T=m===A.NumberFormat.Type.Custom,M=e.jsx(Rn,{selected:T,disabled:d||!c||c.disabled(),formattedValue:T?g.getNumberFormat().displayText:"",handleSetFormat:()=>{t?.beforeExecute?.(c,c?.state()),S.getCommand("formatNumberDialog")?.execute(c?.state()),t?.onExecute?.(c,c?.state())},format:v,sx:{flex:"0",width:"100%"}},A.NumberFormat.Type.Custom),R=e.jsxs(E.Box,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:F=>F.stopPropagation(),children:[e.jsx(b.CommandButton,{command:S.getCommand("formatNumberFormatAccountingStyle"),commandHook:C,scope:r}),e.jsx(b.CommandButton,{command:S.getCommand("formatNumberFormatPercentStyle"),commandHook:C,scope:r}),e.jsx(b.CommandButton,{command:S.getCommand("formatNumberFormatCommaStyle"),commandHook:C,scope:r}),e.jsx(b.CommandButton,{command:S.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:C,scope:r}),e.jsx(b.CommandButton,{command:S.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:C,scope:r})]}),D=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...l,children:[R,e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:j}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),M]});return b.defaultCreatePopupPanel({...y,children:D})},[c?.context(),c?.state(),t,r]),f=q.useTheme(),p=n.useMemo(()=>{const y=A.NumberFormat.Type.MediumTime;return`${A.IFont.getSharedMeasurer()(y,Math.round(f.typography.fontSize),f.typography.fontFamily).width}px`},[f]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,sx:s,outlined:!0,disabled:d,parentFloat:u,createPopupPanel:x,createTooltip:({children:y},S)=>e.jsx(b.ExhibitTooltip,{label:c?.label(),description:c?.description(),disabled:S,children:y}),icon:e.jsx(E.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:y=>`${Math.round(y.typography.fontSize)}px`,color:y=>y.palette.text.secondary,fontFamily:y=>y.typography.fontFamily,width:p},children:e.jsx(E.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:m})}),...l})})),Lo=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=n.useCallback((l,c)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"clear",disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:c.getCommand("clearAll")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("clearFormats")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("clearContents")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("clearComments")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("clearHyperlinks")})]});return b.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,disabled:s,commandHook:t,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:u,icon:"ClearAll",...d})})),za=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=n.useCallback((l,c)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"fill",disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:c.getCommand("fillDown")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("fillRight")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("fillUp")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("fillLeft")})]});return b.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,disabled:s,commandHook:t,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:u,icon:"FillDown",...d})})),zo=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,disableSheet:d=!1,preferSingleMenu:u=!0,showQuickButton:l=!0,variant:c=w.CommandButtonType.Toolbar,...m}=a,C=w.useCommands(o,["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"]),{singleCommand:x,allDisabled:f}=n.useMemo(()=>{let y=null,S=0;for(let h=0;h<C.length;h++)C[h]&&!C[h]?.disabled()&&(u&&c===w.CommandButtonType.Menuitem&&(y=S===0?C[h]:null),S++);return{singleCommand:y,allDisabled:S===0}},[C]),p=n.useCallback((y,S)=>{let h=null;const g={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"insertCells",disabled:s};d||(h=e.jsxs(e.Fragment,{children:[e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...g,command:S.getCommand("addSheet")})]}));const k=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...g,command:C[0]}),e.jsx(b.CommandButton,{...g,command:C[1]}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...g,command:C[2]}),e.jsx(b.CommandButton,{...g,command:C[3]}),h]});return b.defaultCreatePopupPanel({...y,children:k})},[s,C,t,r]);return x?e.jsx(b.CommandButton,{ref:i,variant:c,commandHook:t,disabled:s,command:x,...m}):e.jsx(b.CommandPopupButton,{ref:i,variant:c,quickCommand:"insertCells",commands:o,commandHook:t,scope:r,disabled:s||f,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert."})]}),createPopupPanel:p,...m})})),Ho=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,disableSheet:d=!1,preferSingleMenu:u=!0,showQuickButton:l=!0,variant:c=w.CommandButtonType.Toolbar,...m}=a,C=w.useCommands(o,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:x,allDisabled:f}=n.useMemo(()=>{let y=null,S=0;for(let h=0;h<C.length;h++)C[h]&&!C[h]?.disabled()&&(u&&c===w.CommandButtonType.Menuitem&&(y=S===0?C[h]:null),S++);return{singleCommand:y,allDisabled:S===0}},[C]),p=n.useCallback((y,S)=>{const h={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"deleteCells",disabled:s};let g=null;d||(g=e.jsxs(e.Fragment,{children:[e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...h,command:S.getCommand("deleteSheet")})]}));const k=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...h,command:S.getCommand("deleteCellsShiftUp")}),e.jsx(b.CommandButton,{...h,command:S.getCommand("deleteCellsShiftLeft")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...h,command:S.getCommand("deleteRows")}),e.jsx(b.CommandButton,{...h,command:S.getCommand("deleteColumns")}),g]});return b.defaultCreatePopupPanel({...y,children:k})},[s,t,r]);return x?e.jsx(b.CommandButton,{ref:i,variant:c,commandHook:t,disabled:s,command:x,...m}):e.jsx(b.CommandPopupButton,{ref:i,variant:c,quickCommand:"deleteCells",commands:o,commandHook:t,scope:r,disabled:s||f,tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),e.jsx("br",{}),e.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:p,...m})})),Wo=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,...s}=a,d=n.useCallback((u,l)=>{const c={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"formatCells"},m={commands:l,parentFloat:u.floatReference,...c},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...c,command:l.getCommand("resizeRows")}),e.jsx(b.CommandButton,{...c,command:l.getCommand("autoFitRows")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...c,command:l.getCommand("resizeColumns")}),e.jsx(b.CommandButton,{...c,command:l.getCommand("autoFitColumns")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.SimpleCommandPopupButton,{ref:i,...m,popupCommandKeys:["hideColumns","hideRows",null,"unhideColumns","unhideRows"],popupScope:"hideUnhide",label:"Hide & Unhide"})]});return b.defaultCreatePopupPanel({...u,children:C})},[t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,createPopupPanel:d,icon:"CellsFormat",label:"Format Cells",tooltip:"Change row and column sizes or visibility.",...s})}));Wo.displayName="CellsFormatCommandButton";const ft=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,onSelectColor:r,disabled:s=!1,variant:d=w.CommandButtonType.Toolbar,quickColor:u,panelProps:l,isSplit:c=!1,darkMode:m,icon:C,...x}=a,{autoColor:f,schemeLookup:p,recentColors:y,...S}=l;if(x.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");w.useCommand(o);const h=o?.context();let g=u??h?.quickColor;c&&!g&&(g=new A.Color("transparent"));const k=f??h?.autoColor,j=p??h?.schemeLookup,v=y??h?.recentColors,T=m??h?.darkMode,M=n.useMemo(()=>({autoColor:k,schemeLookup:j,recentColors:v,darkMode:T,...S}),[k,j,v,T]),R=w.useCallbackRef((F,B)=>{F&&B&&h?.addRecentColor&&h.addRecentColor(F),h?.onColorSelect&&h.onColorSelect(F),r?.(F,B),o?.execute(F,t)},[o,r,t,h]),D=n.useCallback((F,B)=>{const{children:P,title:N,...z}=F;let O=F.children;return(o?.disabled()||s)&&(O=e.jsx("div",{children:O})),e.jsx(b.CommandTooltip,{command:o,placement:d===w.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:B,...z,children:O})},[o,s]);return e.jsx(Ao,{ref:i,panelProps:M,icon:C??o?.icon(h),quickColor:g,selectedColor:o?.state(),onSelectColor:R,variant:d===w.CommandButtonType.Menuitem?b.PopupButtonType.Menuitem:b.PopupButtonType.Toolbar,createTooltip:D,label:o?.label(),disabled:s||!o||o.disabled(),compareRGB:!0,darkMode:T,...x})}));ft.displayName="ColorCommandButton";const Ha=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...u}=a,l=w.useCommands(o,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),c=n.useCallback((m,C)=>{const x={variant:w.CommandButtonType.Menuitem,parentFloat:m.floatReference,commandHook:t,scope:r,disabled:s},f=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...x,command:C.getCommand("gridlinesToggle")}),e.jsx(ft,{...x,command:C.getCommand("sheetViewFormatGridlinesColor"),icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),panelProps:{disableAlpha:!0}}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...x,command:C.getCommand("sheetViewToggleGridlinesColumns")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("sheetViewToggleGridlinesRows")})]});return b.defaultCreatePopupPanel({...m,children:f})},[s,t]);return e.jsx(b.CommandPopupButton,{ref:i,parentFloat:d,quickCommand:l[0]?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:e.jsx(b.LabelIcon,{command:l[0],scope:"view"}),...u})})),$o=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=n.useCallback((l,c)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:s},C=c.getCommand("sortCustom"),x=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:c.getCommand("sortAscending")}),e.jsx(b.CommandButton,{...m,command:c.getCommand("sortDescending")}),C?e.jsx(b.CommandButton,{...m,command:C}):null,e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...m,scope:"filter",command:c.getCommand("autoFilterToggle")}),e.jsx(b.CommandButton,{...m,scope:"filter",command:c.getCommand("autoFilterClear")}),e.jsx(b.CommandButton,{...m,scope:"filter",command:c.getCommand("autoFilterReapply")})]});return b.defaultCreatePopupPanel({...l,children:x})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,disabled:s,label:"Sort",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:u,icon:"SortFilter",...d})})),Vi=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=n.useCallback((l,c)=>{const m={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"sort",disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,scope:"filter",command:c.getCommand("autoFilterToggle")}),e.jsx(b.CommandButton,{...m,scope:"filter",command:c.getCommand("autoFilterClear")}),e.jsx(b.CommandButton,{...m,scope:"filter",command:c.getCommand("autoFilterReapply")})]});return b.defaultCreatePopupPanel({...l,children:C})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,scope:r,disabled:s,label:"Filter",tooltip:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Organize your data so it's easier to analyze."}),e.jsx("br",{}),e.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:u,icon:"FilterToggle",...d})})),Vo=n.memo(n.forwardRef((a,i)=>{const{quickCommand:o,icon:t,isRedo:r=!1,nestRedo:s=!0,undoManager:d,scope:u,sx:l,disabled:c,commands:m,...C}=a,x=[o];!r&&s&&x.push("redo");const f=w.useCommands(m,x),p=f[0],y=f[1],S=d??p?.context?.()?.undoManager;let h=c;c||(h=!p||p.disabled(),y&&!y.disabled()&&(h=!1));const[g,k]=n.useState(0),j=n.useCallback((v,T)=>{let M=g===0?"Cancel":`${p.label()} ${g} Action${g===1?"":"s"}`,R=!1;S||(R=!0),R||(R=s?!S.hasRedo()&&!S.hasUndo():!S.hasRedo());const D=O=>{p.execute(O)},F=e.jsx(b.ExhibitMenuItem,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:R?void 0:"0 0",minWidth:"180px"},icon:e.jsx(w.DynamicIcon,{}),onMouseEnter:()=>{k(0)},onMouseDown:O=>{O.button===0&&O.preventDefault()},onMouseUp:O=>{O.button===0&&D(g)},onKeyDown:O=>{O.isDefaultPrevented()||O.keyCode!==w.KeyCodes.Enter&&O.keyCode!==w.KeyCodes.Space||D(g)},children:e.jsx(E.Typography,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:M})});if(R)return F;const B=r?S?.getRedoDescriptions():S?.getUndoDescriptions(),P=[];for(let O=0;O<B.length;O++){const H=B[O];P.push(e.jsx(b.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex"},disabled:h,selected:O<g,icon:e.jsx(w.DynamicIcon,{}),onMouseEnter:()=>{k(O+1)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&D(O+1)},onKeyDown:I=>{I.isDefaultPrevented()||I.keyCode!==w.KeyCodes.Enter&&I.keyCode!==w.KeyCodes.Space||D(O+1)},children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[e.jsx(E.Typography,{component:"div",children:H}),e.jsx(w.DynamicIcon,{})]})},`action:${O}`))}let N=null;if(!r&&s){const O={scope:"undo",commands:T,variant:w.CommandButtonType.Menuitem,parentFloat:v.floatReference};N=[],N.push(e.jsx(Vo,{...O,quickCommand:"redo",isRedo:!0},"nested:redo")),S.hasRedo()&&S.hasUndo()&&N.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal"},"action:redo-div"))}const z=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{v.closeFloatAll()},onMouseLeave:()=>{k(0)},children:[N,e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:P}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),F]});return b.defaultCreatePopupPanel({...v,children:z})},[p?.context(),p?.state(),u,S,g,h]);return e.jsx(b.CommandPopupButton,{ref:i,commands:m,quickCommand:o,scope:u,disabled:h,label:p?.label()??(r?"Redo":"Undo"),tooltip:e.jsx(e.Fragment,{children:e.jsx("span",{children:`${p?.label()??"No"} last actions.`})}),createPopupPanel:j,icon:t??(r?"Redo":"Undo"),selected:!1,...C})})),pt=A.IFontCollection.getFontList(),Wa=new Map;for(let a=0;a<pt.length;a++)Wa.set(pt[a].fontRef.getFamily(),pt[a]);const $a=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,sx:r,disabled:s=!1,parentFloat:d,icon:u,label:l,...c}=a;w.useCommand(o);const m=o?.state(),C=q.useTheme(),x=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("Times New Roman",Math.round(C.typography.fontSize),C.typography.fontFamily).width}px`,[C]),f=n.useCallback(p=>{const y=k=>{o?.execute(k,t)},S=[];for(let k=0;k<pt.length;k++)S.push({key:pt[k].fontRef.getFamily(),description:pt[k].fontRef.getFamily()});Wa.get(m)||S.unshift({key:m,description:m});const h=[];for(let k=0;k<S.length;k++){const j=S[k].key===m;h.push(e.jsx(b.ExhibitMenuItem,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:j,disabled:s||!o||o.disabled(),icon:j?e.jsx(b.SelectedIcon,{}):void 0,onMouseUp:v=>{v.button===0&&y(S[k].key)},onMouseDown:v=>{v.button===0&&v.preventDefault()},onKeyDown:v=>{v.keyCode!==w.KeyCodes.Enter&&v.keyCode!==w.KeyCodes.Space||y(S[k].key)},children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(E.Typography,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>S[k]?.key},children:S[k].description})})},k+""+S[k].key))}const g=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...c,children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:h})});return b.defaultCreatePopupPanel({...p,children:g})},[s,o?.state()]);return e.jsx(b.ExhibitPopupIconButton,{ref:i,sx:{...r},outlined:!0,disabled:s,parentFloat:d,createPopupPanel:f,createTooltip:({children:p},y)=>e.jsx(b.ExhibitTooltip,{label:o?.label(),description:o?.description(),disabled:y,children:p}),icon:e.jsx(E.Box,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:p=>`${Math.round(p.typography.fontSize)}px`,fontFamily:p=>p.typography.fontFamily,color:p=>p.palette.text.secondary,width:x},children:e.jsx(E.Box,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:m})}),...c})})),Va=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=w.useCommands(o,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),l=n.useMemo(()=>{for(let m=0;m<u.length;m++)if(u[m]?.state())return u[m];return u[0]},[u]),c=n.useCallback((m,C)=>{const x={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"textEffects",disabled:s},f=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...x,command:C.getCommand("formatStrikeThroughToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatSuperscriptToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatSubscriptToggle")})]});return b.defaultCreatePopupPanel({...m,children:f})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,quickCommand:l?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:l?.icon()??"TextStrike",...d})})),_a=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=w.useCommands(o,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),l=n.useMemo(()=>{for(let m=0;m<u.length;m++)if(u[m]?.state())return u[m];return u[0]},[u]),c=n.useCallback((m,C)=>{const x={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"underline",disabled:s},f=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...x,command:C.getCommand("formatUnderlinedToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatUnderlinedDoubleToggle")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatUnderlinedAccountingToggle"),commandHook:t}),e.jsx(b.CommandButton,{...x,command:C.getCommand("formatUnderlinedAccountingDoubleToggle")})]});return b.defaultCreatePopupPanel({...m,children:f})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,quickCommand:l?.key(),commands:o,commandHook:t,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:c,icon:l?.icon()??"TextUnderline",...d})})),_o=n.memo(n.forwardRef((a,i)=>{const{command:o,commands:t,commandHook:r,scope:s,includePasteAllInPopup:d=!0,disabled:u=!1,...l}=a,c=w.useCallbackRef((m,C)=>{const x={variant:w.CommandButtonType.Menuitem,commandHook:r,scope:"paste",disabled:u},f=[];return d&&(f.push(n.createElement(b.CommandButton,{...x,command:C.getCommand("paste"),key:"paste"})),f.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal"},"paste-div"))),f.push(n.createElement(b.CommandButton,{...x,command:C.getCommand("pasteValues"),key:"pasteValues"})),f.push(n.createElement(b.CommandButton,{...x,command:C.getCommand("pasteFormats"),key:"pasteFormats"})),f.push(n.createElement(b.CommandButton,{...x,command:C.getCommand("pasteFormulas"),key:"pasteFormulas"})),f.push(n.createElement(b.CommandButton,{...x,command:C.getCommand("pasteTranspose"),key:"pasteTranspose"})),f.push(n.createElement(b.CommandButton,{...x,command:C.getCommand("pasteLinks"),key:"pasteLinks"})),b.defaultCreatePopupPanel({...m,children:f})},[u,r,s,d]);return e.jsx(b.CommandPopupButton,{ref:i,commands:t,commandHook:r,scope:s,createPopupPanel:c,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",...l})})),Ka=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,parentFloat:d,...u}=a,l=w.useCommands(o,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),c=n.useCallback((m,C)=>{const x={variant:w.CommandButtonType.Menuitem,parentFloat:m.floatReference,commandHook:t,scope:r,disabled:s},f=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...x,command:C.getCommand("sheetViewToggleShowHeadings")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("sheetViewToggleShowHeadingsNumeric")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...x,command:C.getCommand("sheetViewToggleShowHeadingColumns")}),e.jsx(b.CommandButton,{...x,command:C.getCommand("sheetViewToggleShowHeadingRows")})]});return b.defaultCreatePopupPanel({...m,children:f})},[s,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,parentFloat:d,quickCommand:l[0]?.key(),commands:o,commandHook:t,createPopupPanel:c,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:e.jsx(b.LabelIcon,{command:l[0],scope:"view"}),...u})})),Ua=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r="view",disabled:s=!1,...d}=a,u=n.useCallback(l=>{const c={variant:w.CommandButtonType.Menuitem,parentFloat:l.floatReference,commandHook:t,scope:r,disabled:s},m=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowFormulaBar")}),e.jsx(b.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowTabs")}),e.jsx(b.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowStatusBar")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowHorizontalScrollBar")}),e.jsx(b.CommandButton,{...c,command:o.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return b.defaultCreatePopupPanel({...l,children:m})},[s,o,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,disabled:s,commandHook:t,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:u,icon:e.jsx(b.LabelIcon,{icon:null,label:"Workbook View"}),...d})})),qa=n.memo(n.forwardRef((a,i)=>{const{value:o,cellStyle:t,styles:r,createTemporaryCell:s,bodyStyle:d,sx:u,borderProps:l,disabled:c,...m}=a,C=n.useMemo(()=>s({value:o,style:t}),[o,t,s]),x=n.useMemo(()=>C.getStyle(),[C,d]),f=n.useMemo(()=>x.getFill().toCSS(d?.darkMode??!1),[x]),p=x.getInsets(),y=x.getFont(),S=n.useCallback(()=>x.getBorder(),[x]);return e.jsx(E.Box,{ref:i,sx:{width:"100px",height:"100%",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:d?.fill,filter:c?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...f},"& .text":{flex:"1 1 100%",...y.toCSS(d?.darkMode??!1,1),boxSizing:"border-box",padding:`${p.top}px ${p.right}px ${p.bottom}px ${p.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:y.toCSS().textDecoration,textAlign:A.ITextFrame.toCSSHorizontalTextAlign(C.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...u},...m,children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:S,darkMode:d?.darkMode??!1,rowCount:1,columnCount:1,style:{height:"100%",width:"100%",...l?.style},...l,children:e.jsx(E.Box,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-2px",marginBottom:"-2px",display:"flex",alignItems:"center"},children:e.jsx(E.Box,{className:"text",children:o})})})})})),_i=n.memo(a=>{const{styles:i,namedStyle:o,selectedNamed:t,hasContextMenu:r=!0,bodyStyle:s,onSelectNamed:d,createTemporaryCell:u,parentFloat:l,commands:c,disabled:m,commandHook:C,...x}=a,f=n.useCallback(S=>{const h={variant:w.CommandButtonType.Menuitem,commandHook:C,context:"cellStyle"},g=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...h,style:{fontWeight:550},command:c.getCommand("formatCellStyle"),commandState:o,disabled:m}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...h,command:c.getCommand("modifyCellStyle"),commandState:{named:o}}),e.jsx(b.CommandButton,{...h,command:c.getCommand("deleteCellStyle"),commandState:o,disabled:m||o?.getName()===A.IStyle.BuiltInName.Normal})]}),k=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:g})});return b.defaultCreatePopupPanel({...S,children:k})},[]),p=o?.getName()===t?.getName();let y=e.jsx(b.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:S=>`solid ${p?S.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:o.getName(),placement:"bottom-start"},disabled:m,icon:null,onClick:()=>{d?.(o)},...x,children:e.jsx(qa,{value:o.getName(),cellStyle:{named:o.getName()},styles:i,createTemporaryCell:u,bodyStyle:s})},o.getName());return r&&(y=e.jsx(b.ContextMenu,{label:o.getName(),parentFloat:l,createPopupPanel:f,children:y})),y}),Ga=n.memo(n.forwardRef((a,i)=>{const{commands:o,command:t,commandHook:r,selectedNamed:s,onSelectNamed:d,disabled:u=!1,bodyStyle:l,usePreviewIcon:c=!0,...m}=a;w.useCommand(t);const C=t?.context(),x=C?.styles,f=s??C?.named(),p=l??C?.bodyStyle(),y=w.useCallbackRef(j=>{d?.(j),t?.execute(j,r)},[t,d,r]),S=n.useCallback((j,v)=>{const T={onSelectNamed:y,styles:x(),parentFloat:j.floatReference},M=x().getCustomNamed(),R=new Map,D=[];for(let I=0;I<M.length;I++)R.set(M[I].getName(),M[I]),x().getNamed(M[I].getName()).getBuiltInID()===null&&D.push(M[I].getName());const F=I=>{let W=R.get(I);return W||(W=x().getNamed(I)),!W||W.isHidden()?null:e.jsx(_i,{namedStyle:W,selectedNamed:f,bodyStyle:C.bodyStyle(),createTemporaryCell:C.createTemporaryCell,commands:o,commandHook:r,...T},I)},B=(I,W,ee=!0)=>{const X=[];for(let ne=0;ne<W.length;ne++){const $=F(W[ne]);$&&X.push($)}return X.length===0?null:e.jsxs(E.Box,{children:[ee?e.jsx(b.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(b.ExhibitMenuHeader,{children:I},I+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:X},I+"-presets")]},I)},P=(I,W)=>{const ee=[];for(let X=0;X<W.length;X++){const ne=F(W[X]);ne&&ee.push(ne)}return ee.length===0?null:e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:ee},I+"-presets")},N=[];N.push(B("Custom",D,!1)),N.push(B("Good, Bad and Neutral",[A.IStyle.BuiltInName.Normal,A.IStyle.BuiltInName.Bad,A.IStyle.BuiltInName.Good,A.IStyle.BuiltInName.Neutral],D.length>0)),N.push(B("Data and Model",[A.IStyle.BuiltInName.Calculation,A.IStyle.BuiltInName.CheckCell,A.IStyle.BuiltInName.ExplanatoryText,A.IStyle.BuiltInName.FollowedHyperlink,A.IStyle.BuiltInName.Hyperlink,A.IStyle.BuiltInName.Input,A.IStyle.BuiltInName.LinkedCell,A.IStyle.BuiltInName.Note,A.IStyle.BuiltInName.Output,A.IStyle.BuiltInName.WarningText])),N.push(B("Titles and Headings",[A.IStyle.BuiltInName.Heading1,A.IStyle.BuiltInName.Heading2,A.IStyle.BuiltInName.Heading3,A.IStyle.BuiltInName.Heading4,A.IStyle.BuiltInName.Title,A.IStyle.BuiltInName.Total]));let z=[];var O,H;return z.push(P("Accent 1",[A.IStyle.BuiltInName.Accent1_20,A.IStyle.BuiltInName.Accent1_40,A.IStyle.BuiltInName.Accent1_60,A.IStyle.BuiltInName.Accent1])),z.push(P("Accent 2",[A.IStyle.BuiltInName.Accent2_20,A.IStyle.BuiltInName.Accent2_40,A.IStyle.BuiltInName.Accent2_60,A.IStyle.BuiltInName.Accent2])),z.push(P("Accent 3",[A.IStyle.BuiltInName.Accent3_20,A.IStyle.BuiltInName.Accent3_40,A.IStyle.BuiltInName.Accent3_60,A.IStyle.BuiltInName.Accent3])),z.push(P("Accent 4",[A.IStyle.BuiltInName.Accent4_20,A.IStyle.BuiltInName.Accent4_40,A.IStyle.BuiltInName.Accent4_60,A.IStyle.BuiltInName.Accent4])),z.push(P("Accent 5",[A.IStyle.BuiltInName.Accent5_20,A.IStyle.BuiltInName.Accent5_40,A.IStyle.BuiltInName.Accent5_60,A.IStyle.BuiltInName.Accent5])),z.push(P("Accent 6",[A.IStyle.BuiltInName.Accent6_20,A.IStyle.BuiltInName.Accent6_40,A.IStyle.BuiltInName.Accent6_60,A.IStyle.BuiltInName.Accent6])),N.push((O="Themed Cell Styles",H=z,e.jsxs(E.Box,{children:[e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.ExhibitMenuHeader,{children:O},O+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:H},O+"-presets")]},O))),N.push(B("Number Format",[A.IStyle.BuiltInName.Comma,A.IStyle.BuiltInName.Comma0,A.IStyle.BuiltInName.Currency,A.IStyle.BuiltInName.Currency0,A.IStyle.BuiltInName.Percent])),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:I=>`${I.shape.borderRadius}px`,paddingBottom:I=>`${I.shape.borderRadius}px`},children:[e.jsx(E.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:N}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{variant:w.CommandButtonType.Menuitem,commandState:f,command:v.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:u})]})},[f,x?.().getTheme(),p]),h=w.useCallbackRef(j=>{const v=18/A.IFont.getDeviceScale(),T=C?.createTemporaryCell(j);return T.getStyle().getFont().getSize()<=v?T:T.createTemporaryCell({style:{font:{size:v}}})},[C?.createTemporaryCell]),g=u||!t||t.disabled(),k=n.useMemo(()=>C&&c?e.jsx(qa,{value:f?.getName()??"Custom",cellStyle:f?{named:f.getName()}:void 0,styles:C.styles(),createTemporaryCell:h,bodyStyle:C.bodyStyle(),className:"outline-hover",disabled:g,sx:{marginRight:"4px",borderRadius:"2px",minHeight:"calc(100% - 2px)",overflow:"hidden",outline:j=>`1px solid ${j.palette.action.hover}`},borderProps:{style:{height:"calc(100% - 2px)",width:"calc(100% - 1px)"}}}):t?.icon(),[f,p,g,t]);return e.jsx(b.CommandPopupButton,{ref:i,createPopupPanel:S,outlined:c,commands:o,createTooltip:({children:j},v)=>e.jsx(b.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:v,children:j}),selected:!1,disabled:g,label:t?.label(),icon:k,...m})})),Xa="_sheetxl-reset_11z3j_1",Ki=10,Ko=n.memo(n.forwardRef((a,i)=>{const{styles:o,table:t,tableStyle:r=t?.getStyle()??o.getDefaultTableStyle(),bodyStyle:s,sx:d,disabled:u,className:l,forceThinBorder:c,cellHeight:m=Ki,isLive:C=!1,...x}=a,f=Math.ceil(1.3*m),[p,y]=n.useReducer(j=>j+1,0);n.useEffect(()=>{if(C&&t)return t.addListeners({onAnyChange:()=>{y()}})},[t,C]);const S=n.useMemo(()=>{let j=t?.toJSON()??{};const v={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return j&&(j.styleOptions={...j.styleOptions,name:r.getName()}),j.ref=v,new A.Table({initialAnchor:v,json:j,styles:o})},[p,t,r,o]),h=n.useMemo(()=>{const j=[];for(let v=0;v<5;v++)for(let T=0;T<5;T++){const M=S.getStyleAt({colIndex:T,rowIndex:v});j.push(M)}return j},[S]),g=n.useMemo(()=>{const j=(T,M,R)=>{let D=R.getFill().toCSS(s?.darkMode??!1);const F=f-(M<4?1:0),B=m-(T<4?1:0),P=R.getFont().getFill().toCSS(s?.darkMode??!1);return D={...D,position:"absolute",boxSizing:"border-box",left:M*(f-1),top:T*(m-1),width:F,height:B},e.jsx("td",{className:`table-style-fill ${T}-${M}`,style:D,children:e.jsx("div",{className:`table-style-text ${T}-${M}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(F-6)/2,top:(B-1)/2,borderTop:`1px solid ${P}`}})},`${T}-${M}`)},v=[];for(let T=0;T<5;T++){const M=[];for(let R=0;R<5;R++){const D=h[5*T+R];M.push(j(T,R,D))}v.push(e.jsx("tr",{children:M},T))}return v},[S,r,s]),k=n.useCallback((j,v)=>h[v].getBorder()??null,[h]);return e.jsx(E.Box,{ref:i,className:"table-format-preview",sx:{background:s?.fill,filter:u?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...d},...x,children:e.jsx(oe.StaticBorderRenderer,{getBorderAt:k,rowCount:5,columnCount:5,forceThinBorder:c,width:5*(f-1)+1,height:5*(m-1)+1,darkMode:s?.darkMode??!1,style:{pointerEvents:"none"},children:e.jsx("table",{className:ie(l,"sheetxl-table-preview",Xa),style:{borderCollapse:"collapse",width:5*(f-1)+1,height:5*(m-1)+1},children:e.jsx("tbody",{children:g})})})})})),St=(a,i,o,t,r)=>{a.beginPath(),a.moveTo(i+.5,o+.5),a.lineTo(t+.5,r+.5),a.stroke()},Ya=n.memo(n.forwardRef((a,i)=>{const{table:o,tableStyle:t,styles:r,bodyStyle:s,disabled:d,style:u,className:l,canvas:c,...m}=a,C=n.useMemo(()=>{const p=o.toJSON(),y={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return p.styleOptions={...p.styleOptions,name:t.getName()},p.ref=y,new A.Table({initialAnchor:y,json:p,styles:r})},[o,t,r]),x=n.useMemo(()=>{const p=[];for(let y=0;y<5;y++)for(let S=0;S<5;S++){const h=C.getStyleAt({colIndex:S,rowIndex:y});p.push(h)}return p},[C]),f=n.useMemo(()=>{let p=c;if(c||(p=document.createElement("canvas")),!p)return null;p.width!==61&&(p.width=61),p.height!==46&&(p.height=46);const y=p.getContext("2d",{alpha:!1});if(!y)return null;const S=12,h=s?.darkMode??!1;for(let g=0;g<5;g++)for(let k=0;k<5;k++){const j=x[5*g+k].getFill();let v=s?.fill;j.getType()===A.IFill.Type.Solid?v=j.getColor().toCSS(h,!1):j.getType()===A.IFill.Type.Gradient?v=j.getStops[0]?.color.toCSS(h,!1):j.getType()===A.IFill.Type.Pattern&&(v=j.getForeground().toCSS(h,!1)),y.fillStyle=v;const T=k*S,M=9*g;y.fillRect(T,M,13,10)}y.lineWidth=1;for(let g=0;g<5;g++)for(let k=0;k<5;k++){const j=x[5*g+k],v=k*S,T=9*g,M=j.getBorder();if(!M.isEmpty()){const F=M.getLeft();F.isNone()||(y.strokeStyle=F.getColor().toCSS(h,!1),St(y,v,T,v,T+9));const B=M.getTop();B.isNone()||(y.strokeStyle=B.getColor().toCSS(h,!1),St(y,v,T,v+S,9*g));const P=M.getRight();P.isNone()||(y.strokeStyle=P.getColor().toCSS(h,!1),St(y,v+S,T,v+S,T+9));const N=M.getBottom();N.isNone()||(y.strokeStyle=N.getColor().toCSS(h,!1),St(y,v,T+9,v+S,T+9))}y.strokeStyle=j.getFont().getFill().toCSS(h,!1);const R=4,D=2.5;St(y,k*S+D,9*g+R,k*S+D+7,9*g+R)}return`url(${p.toDataURL()})`},[c,C,t,s]);return e.jsx("div",{ref:i,className:ie("table-style-preview",l),style:{backgroundImage:f,width:61,height:46,...u},...m})})),Ui="_table-style-options-container_1kfn2_1",qi="_table-style-options_1kfn2_1",Za=n.memo(n.forwardRef((a,i)=>{const{styleOptions:o,onStyleOptionsChange:t,showHeaderRow:r,onShowHeaderRowChange:s,showTotalRow:d,onShowTotalRowChange:u,showFilterButton:l,onShowFilterButtonChange:c,sx:m,className:C,disabled:x,...f}=a;return e.jsx("div",{className:Ui,children:e.jsxs(E.Box,{sx:{pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:p=>`${p.spacing(2)}`,marginRight:p=>`${p.spacing(2)}`},"& .MuiCheckbox-root":{padding:p=>`${p.spacing(.5)}`},...m},...f,ref:i,className:ie(C,qi),children:[s&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:r??!1,indeterminate:r==null,onChange:()=>s(!r),disabled:x||r==null}),label:"Header Row",labelPlacement:"end"}),u&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:d??!1,indeterminate:d==null,onChange:()=>u(!d),disabled:x||d==null}),label:"Total Row",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:o?.showRowStripes??!1,indeterminate:!o,disabled:x||!o,onChange:()=>{t?.({...o,showRowStripes:!o?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:o?.showFirstColumn??!1,indeterminate:!o,disabled:x||!o,onChange:()=>{t?.({...o,showFirstColumn:!o?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:o?.showLastColumn??!1,indeterminate:!o,disabled:x||!o,onChange:()=>{t?.({...o,showLastColumn:!o?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:o?.showColumnStripes??!1,indeterminate:!o,disabled:x||!o,onChange:()=>{t?.({...o,showColumnStripes:!o?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),c&&e.jsx(E.FormControlLabel,{control:e.jsx(E.Checkbox,{checked:l??!1,indeterminate:l==null,disabled:x||!o||l==null,onChange:()=>c(!l)}),label:"Filter Button",labelPlacement:"end"})]})})}));function bo(a,i){if(typeof a=="function")return a(i);a&&(a.current=i)}var et=parseInt(n.version.split(".")[0],10)>=19?function(a){return i=>{const o=[];for(const t of a){const r=bo(t,i),s=typeof r=="function";o.push(s?r:()=>bo(t,null))}return()=>{for(const t of o)t()}}}:function(a){return i=>{for(const o of a)bo(o,i)}},Gi=function(){},Qa=typeof window<"u",dt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xi=Qa?n.useLayoutEffect:n.useEffect,Mn={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Ve=Qa&&window.ResizeObserver!==void 0?function(){var a=n.useState(null),i=a[0],o=a[1],t=n.useState(Mn),r=t[0],s=t[1],d=n.useMemo(function(){return new window.ResizeObserver(function(u){if(u[0]){var l=u[0].contentRect,c=l.x,m=l.y,C=l.width,x=l.height,f=l.top,p=l.left,y=l.bottom,S=l.right;s({x:c,y:m,width:C,height:x,top:f,left:p,bottom:y,right:S})}})},[]);return Xi(function(){if(i)return d.observe(i),function(){d.disconnect()}},[i]),[o,r]}:function(){return[Gi,Mn]},Yi="_range-row_akhf4_1",Zi="_action-row_akhf4_15",Ja=n.createContext(null);Ja.displayName="HookFormContext";const er=()=>n.useContext(Ja);typeof window<"u"?n.useLayoutEffect:n.useEffect;const Uo=n.memo(n.forwardRef((a,i)=>{const{disabled:o,style:t,className:r,sx:s,defaultInput:d,value:u,formName:l,formOptions:c,onChangeInput:m,onValidate:C,onKeyDown:x,...f}=a,p=er(),y=l&&p?p.register(l,c):null,[S,h]=n.useState(""),[g,k]=n.useState(""),[j,v]=n.useState(u);n.useEffect(()=>{v(u),k("")},[u]);const T=w.useCallbackRef(B=>{let P="";try{v(B),C?.(B),m?.(B)}catch(N){P=N.message??"Invalid Name"}l&&p&&(P?p.setError(l,{message:P}):p.clearErrors(l)),k(P)},[u,C,m]),M=w.useCallbackRef(async B=>{B.keyCode===w.KeyCodes.Escape&&S!==u&&(T(S),p?.setValue(l,S),p?.clearErrors(l),B.stopPropagation()),x?.(B)},[x,S,u,p]),R=w.useCallbackRef(B=>{h(B.target.value??"")},[]),D=w.useCallbackRef(B=>{h(""),y?.onBlur(B)},[]),F=n.useCallback(B=>{T(B.target.value),y?.onChange(B)},[y]);return e.jsx(E.FormControl,{sx:{paddingTop:B=>B.spacing(1.5),minWidth:135,width:"100%",...s},size:"small",ref:i,className:ie("named-input",r),...f,children:e.jsx(E.TextField,{label:"Name",placeholder:d,onFocus:R,onBlur:D,inputRef:y?.ref,disabled:o,error:!!g,helperText:g||" ",sx:{"& .MuiFormHelperText-root":{marginTop:B=>B.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:"autoFocus",name:l,spellCheck:!1,autoComplete:"off",readOnly:o,sx:{paddingTop:B=>B.spacing(1.25),paddingBottom:B=>B.spacing(.75),backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`}}},value:j??"",onChange:F,onKeyDownCapture:M,onContextMenu:B=>{B.stopPropagation()}})})}));Uo.displayName="NamedInput";const Wt=a=>a===null?"":a.toString(),qo=n.memo(n.forwardRef((a,i)=>{const{formName:o,formOptions:t,disabled:r,style:s,className:d,sx:u,onKeyDown:l,value:c,onChangeInput:m,resolvedAddress:C,...x}=a,f=er(),p=o&&f?f.register(o,t):null,[y,S]=n.useState(""),[h,g]=n.useState(!1),[k,j]=n.useState(()=>Wt(c));n.useEffect(()=>{j(Wt(c)),S(""),o&&f&&f.clearErrors(o),g(!1)},[c]);const v=w.useCallbackRef(P=>{let N="";try{j(P);const z=Wt(c),O=C(P);O.toString()!==z&&m?.(O)}catch{N="Invalid Range"}o&&f&&(N?f.setError(o,{message:N}):f.clearErrors(o)),S(N),g(!0)},[k,m,o,f]),T=w.useCallbackRef(async P=>{if(h&&P.keyCode===w.KeyCodes.Escape){const N=Wt(c);j(N),S(""),g(!1),P.stopPropagation()}l?.(P)},[c,m,l,h]),M=w.useCallbackRef(P=>{p?.onBlur(P)},[p]),R=n.useCallback(P=>{v(P.target.value),p?.onChange(P)},[p]),[D,F]=n.useState(!1),B=n.useMemo(()=>e.jsx(E.InputAdornment,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:e.jsx(b.ExhibitOptionButton,{disabled:!0,selected:D,onSelectToggle:P=>{F(P)},label:"Select Range",icon:e.jsx(w.DynamicIcon,{iconKey:"SelectRangeMode"})})}),[D]);return e.jsx(E.FormControl,{sx:{paddingTop:P=>P.spacing(1.5),minWidth:135,width:"100%",...u},size:"small",ref:i,className:ie("range-input",d),...x,children:e.jsx(E.TextField,{label:"Range",placeholder:"Enter Range",onBlur:M,disabled:r,error:!!y,inputRef:p?.ref,helperText:y||" ",sx:{"& .MuiFormHelperText-root":{marginTop:P=>P.spacing(.5)}},slotProps:{input:{endAdornment:B},inputLabel:{shrink:!0},htmlInput:{spellCheck:!1,autoComplete:"off",readOnly:r,name:o,sx:{paddingTop:P=>P.spacing(1.25),paddingBottom:P=>P.spacing(.75)}}},value:k??"",onChange:R,onKeyDownCapture:T,onContextMenu:P=>{P.stopPropagation()}})})}));qo.displayName="RangeInput";const Ee=[];Ee.push(Me("Primary Background","bg1")),Ee.push(Me("Primary Text","tx1")),Ee.push(Me("Secondary Background","bg2")),Ee.push(Me("Secondary Text","tx2")),Ee.push(Me("Accent 1","accent1")),Ee.push(Me("Accent 2","accent2")),Ee.push(Me("Accent 3","accent3")),Ee.push(Me("Accent 4","accent4")),Ee.push(Me("Accent 5","accent5")),Ee.push(Me("Accent 6","accent6"));const tr=a=>{const{docTheme:i,onSelectTheme:o,darkMode:t,isSelected:r,outlined:s,sx:d,...u}=a,l=q.useTheme(),c=n.useMemo(()=>{let m=[];for(let C=0;C<Ee.length;C++){const x=Ee[C];m.push(e.jsx(io,{schemeColorLookup:i.schemeLookup(),colorDef:x,darkMode:t,selectedColor:null},C+"-colorDef"))}return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:e.jsx(E.Box,{sx:{display:"flex",boxShadow:C=>C.shadows[2]},children:m})})},[i,l]);return e.jsx(b.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:m=>`solid ${r?m.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:m=>`solid ${m.palette.text.primary} 1px !important`}},icon:null,...u,children:e.jsxs(E.Box,{sx:{border:m=>`solid ${m.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:m=>r?m.palette.text.primary:void 0,"&:hover:not([disabled])":{color:m=>m.palette.text.primary}},children:[e.jsx(E.Box,{sx:{},children:i.getName()}),e.jsxs(E.Box,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[c,e.jsx(E.Box,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>i.getFontScheme().getMajorFont()},children:e.jsx(b.SimpleTooltip,{disableInteractive:!0,slotProps:{popper:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}}},title:e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
|
|
7
|
+
The heading font is '${i.getFontScheme().getMajorFont()}'.`}),placement:"bottom-start",children:e.jsx("div",{children:i.getFontScheme().getMinorFont()})})})]})]})})},or=n.memo(n.forwardRef((a,i)=>{const{themes:o,selectedTheme:t,onSelectTheme:r,sx:s,disabled:d=!1,darkMode:u,...l}=a,c=n.useMemo(()=>{const m=o?.getItems({selected:t})??[],C=[];if(m.length===0)return e.jsx(b.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});const x=m.length;for(let f=0;f<x;f++){const p=m[f],y=t&&p?.getName()===t.getName(),S=m[f+1];S&&S.isCustom()!==p.isCustom()&&C.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${f}`)),C.push(e.jsx(tr,{docTheme:p,onSelectTheme:()=>r(p),isSelected:y,disabled:d,darkMode:u,onMouseDown:h=>{h.button===0&&h.preventDefault()},onMouseUp:h=>{h.button===0&&r(p)},onKeyDown:h=>{h.keyCode!==w.KeyCodes.Enter&&h.keyCode!==w.KeyCodes.Space||r(p)}},p.getName()))}return C},[t,r,u]);return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:i,...l,children:e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsx(b.ExhibitMenuHeader,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),e.jsx(b.ExhibitDivider,{}),e.jsx(E.Box,{sx:{flex:"1 1 100%",overflow:"auto",padding:"6px 16px"},children:c})]})})})),nr=n.memo(n.forwardRef((a,i)=>{const{themes:o,selectedTheme:t,onSelectTheme:r,icon:s,tooltip:d,label:u,variant:l=b.PopupButtonType.Toolbar,darkMode:c,panelProps:m,...C}=a,x=s||e.jsx(w.DynamicIcon,{iconKey:"Theme2"}),f=n.useCallback(y=>{const{closeFloatAll:S}=y;return e.jsx(or,{...m,themes:o,selectedTheme:t,onSelectTheme:r,darkMode:c,onKeyDown:h=>{h.which===w.KeyCodes.Enter&&S()}})},[o,t,r,m,c]),p={createPopupPanel:f,tooltip:d||u||"Theme",label:u,icon:x,...C};return l===b.PopupButtonType.Toolbar?e.jsx(b.ExhibitPopupIconButton,{ref:i,...p}):e.jsx(b.ExhibitPopupMenuItem,{ref:i,...p})})),Go=n.memo(n.forwardRef((a,i)=>{const{sheet:o,className:t,debounceDelay:r=220,sx:s,...d}=a,[u,l]=n.useState(()=>o.getView().getZoomScale()),[c,m]=n.useState(null),C=n.useRef(0);oe.useModelListener(o,{onViewChange:()=>{m(!0),C.current===0&&l(o.getView().getZoomScale())}}),n.useEffect(()=>{C.current=0,m(!1),l(o.getView().getZoomScale())},[o]),n.useEffect(()=>{C.current!==0&&A.CommonUtils.debounce(()=>{u===C.current&&(C.current=0,o.getView().update({zoomScale:u}))},r)()},[u,r]);const x=w.useCallbackRef(M=>{let R=M;M<100?R=Math.round(M/(10/9)+10):M>100&&(R=Math.round(3*M-200)),C.current=R,m(!0),l(R)},[o]),f=M=>{let R=M;return M<100?R=10/9*(M-10):M>100&&(R=(M+200)/3),R},p=f(u),[y,S]=n.useState(null),h=n.useRef(null),g=n.useCallback(()=>{const M=y;M&&requestAnimationFrame(()=>{h.current?.contains(document.activeElement)&&M.focus()})},[]),k=w.useMouseDownAndHoldListener(()=>{x(f(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!1,10)))}),j=w.useMouseDownAndHoldListener(()=>x(f(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!0,10)))),v=q.useTheme(),T=n.useMemo(()=>`${A.IFont.getSharedMeasurer()("100%",Math.round(v.typography.fontSize),v.typography.fontFamily).width}px`,[v]);return e.jsxs(E.Box,{ref:i,className:ie(t),sx:{padding:"0px 0px",display:"flex",alignItems:"center",color:M=>M.palette.text.secondary,...s},onFocus:M=>{M.relatedTarget&&!y&&S(M.relatedTarget)},onBlur:M=>{y&&!h?.current?.contains(M.relatedTarget)&&S(null)},onMouseDown:M=>{M.button===0&&M.preventDefault()},onMouseUp:M=>{M.button===0&&g()},...d,children:[e.jsx(b.SimpleTooltip,{disableInteractive:!0,title:"Zoom Out",children:e.jsx(E.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:M=>M.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:M=>{M.button!==0?M.preventDefault():k(M)},children:e.jsx(w.DynamicIcon,{iconKey:"Remove"})})}),e.jsx(E.Slider,{ref:h,sx:{flex:"1 1 100%",padding:"6px 0px !important",marginRight:"2px",marginLeft:"2px","& .MuiSlider-thumb":{height:14,width:6,borderRadius:.75,"&.Mui-focusVisible":{boxShadow:M=>`0px 0px 0px 3px ${b.hexToRGB(M.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:M=>`0px 0px 0px 2px ${b.hexToRGB(M.palette.primary.main,.16)}`}},"& .MuiSlider-mark":{width:"1px",height:"8px"},"& .MuiSlider-markActive":{backgroundColor:"currentColor"},"& .MuiSlider-thumb:not(.MuiSlider-active)":{transition:c?"left 260ms ease-in":"none"}},valueLabelDisplay:"auto",size:"small",track:!1,min:0,step:1,value:p,max:200,marks:[{value:100}],onAnimationEnd:()=>m(!1),onWheel:M=>{x(f(A.CommonUtils.findNextStep(o.getView().getZoomScale(),M.deltaY<0,10)))},onKeyDown:M=>{M.which===w.KeyCodes.Down||M.which===w.KeyCodes.Right?(x(f(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!0,10))),M.preventDefault()):M.which===w.KeyCodes.Up||M.which===w.KeyCodes.Left?(x(f(A.CommonUtils.findNextStep(o.getView().getZoomScale(),!1,10))),M.preventDefault()):M.which!==w.KeyCodes.Enter&&M.which!==w.KeyCodes.Escape||g()},onChange:(M,R)=>{Math.abs(R-100)<3?x(100):x(R)},valueLabelFormat:(M,R)=>`Zoom: ${Math.round(u)}%`}),e.jsx(b.SimpleTooltip,{disableInteractive:!0,title:"Zoom In",children:e.jsx(E.IconButton,{sx:{padding:"0","&:hover:not([disabled])":{color:M=>M.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:M=>{M.button!==0?M.preventDefault():j(M)},children:e.jsx(w.DynamicIcon,{iconKey:"Add"})})}),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row"},children:[e.jsx(E.Box,{sx:{minWidth:"8px"}}),e.jsx(E.Typography,{noWrap:!0,component:"div",onClick:()=>{x(100)},sx:{cursor:"pointer",display:"flex",flex:"1 1 100%",fontSize:"0.70rem",marginLeft:"2px",marginRight:"2px",userSelect:"none",justifyContent:"center",width:T},children:e.jsx("div",{children:Math.round(u)+"%"})})]})]})}));Go.displayName="SheetZoomScale";const Xo=n.memo(n.forwardRef((a,i)=>{const{sx:o,sheet:t,gridStyle:r,children:s,childrenEnd:d,...u}=a;n.useImperativeHandle(i,()=>({}));const l=n.useRef(null);n.useEffect(()=>{const f=p=>p.preventDefault();return l.current?.addEventListener("wheel",f,{passive:!1}),()=>{l.current?.removeEventListener("wheel",f)}},[]);const c=w.useEditMode(),m=n.useMemo(()=>{const f=c.getMode();return f?.description?f.description:"Ready"},[c]),[C,x]=n.useState(!1);return e.jsxs(E.Box,{ref:l,sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",overflow:C?"visible":"hidden",boxShadow:`0px -1px 0px ${r.header.edgeStrokeFill}`,...o},onMouseOver:()=>x(!0),onMouseLeave:()=>x(!1),...u,children:[s,e.jsx("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"end",overflow:"hidden"},children:e.jsx(E.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:f=>f.palette.text.secondary},variant:"caption",children:m})}),d?e.jsx(E.Box,{sx:{display:"flex",alignItems:"center"},children:d}):null,e.jsx(b.ExhibitDivider,{style:{marginTop:"6px",marginBottom:"6px"}}),e.jsx(Go,{sx:{paddingLeft:"4px",minWidth:"175px"},sheet:t})]})}));Xo.displayName="StatusBar";var Dn,Fn,yo,In,Nn,$t={exports:{}},wt={},kt={exports:{}},On={},An={exports:{}};function Qi(){return Fn?Dn:(Fn=1,Dn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function Ji(){if(In)return yo;In=1;var a=Qi();function i(){}function o(){}return o.resetWarningCache=i,yo=function(){function t(d,u,l,c,m,C){if(C!==a){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}function r(){return t}t.isRequired=t;var s={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:r,element:t,elementType:t,instanceOf:r,node:t,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:o,resetWarningCache:i};return s.PropTypes=s,s},yo}function Ot(){return Nn||(Nn=1,An.exports=Ji()()),An.exports}var Ln,Vt={exports:{}},zn,xe={},ze={};function lo(){return zn||(zn=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.dontSetMe=function(a,i,o){if(a[i])return new Error(`Invalid prop ${i} passed to ${o} - do not set this, set it on the child.`)},ze.findInArray=function(a,i){for(let o=0,t=a.length;o<t;o++)if(i.apply(i,[a[o],o,a]))return a[o]},ze.int=function(a){return parseInt(a,10)},ze.isFunction=function(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"},ze.isNum=function(a){return typeof a=="number"&&!isNaN(a)}),ze}var Hn,Wn,He={};function Yo(){if(Wn)return xe;Wn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.addClassName=d,xe.addEvent=function(l,c,m,C){if(!l)return;const x={capture:!0,...C};l.addEventListener?l.addEventListener(c,m,x):l.attachEvent?l.attachEvent("on"+c,m):l["on"+c]=m},xe.addUserSelectStyles=function(l){if(!l)return;let c=l.getElementById("react-draggable-style-el");c||(c=l.createElement("style"),c.type="text/css",c.id="react-draggable-style-el",c.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
8
|
+
`,c.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
9
|
+
`,l.getElementsByTagName("head")[0].appendChild(c)),l.body&&d(l.body,"react-draggable-transparent-selection")},xe.createCSSTransform=function(l,c){const m=r(l,c,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:m}},xe.createSVGTransform=function(l,c){return r(l,c,"")},xe.getTouch=function(l,c){return l.targetTouches&&(0,a.findInArray)(l.targetTouches,m=>c===m.identifier)||l.changedTouches&&(0,a.findInArray)(l.changedTouches,m=>c===m.identifier)},xe.getTouchIdentifier=function(l){if(l.targetTouches&&l.targetTouches[0])return l.targetTouches[0].identifier;if(l.changedTouches&&l.changedTouches[0])return l.changedTouches[0].identifier},xe.getTranslation=r,xe.innerHeight=function(l){let c=l.clientHeight;const m=l.ownerDocument.defaultView.getComputedStyle(l);return c-=(0,a.int)(m.paddingTop),c-=(0,a.int)(m.paddingBottom),c},xe.innerWidth=function(l){let c=l.clientWidth;const m=l.ownerDocument.defaultView.getComputedStyle(l);return c-=(0,a.int)(m.paddingLeft),c-=(0,a.int)(m.paddingRight),c},xe.matchesSelector=t,xe.matchesSelectorAndParentsTo=function(l,c,m){let C=l;do{if(t(C,c))return!0;if(C===m)return!1;C=C.parentNode}while(C);return!1},xe.offsetXYFromParent=function(l,c,m){const C=c===c.ownerDocument.body?{left:0,top:0}:c.getBoundingClientRect(),x=(l.clientX+c.scrollLeft-C.left)/m,f=(l.clientY+c.scrollTop-C.top)/m;return{x,y:f}},xe.outerHeight=function(l){let c=l.clientHeight;const m=l.ownerDocument.defaultView.getComputedStyle(l);return c+=(0,a.int)(m.borderTopWidth),c+=(0,a.int)(m.borderBottomWidth),c},xe.outerWidth=function(l){let c=l.clientWidth;const m=l.ownerDocument.defaultView.getComputedStyle(l);return c+=(0,a.int)(m.borderLeftWidth),c+=(0,a.int)(m.borderRightWidth),c},xe.removeClassName=u,xe.removeEvent=function(l,c,m,C){if(!l)return;const x={capture:!0,...C};l.removeEventListener?l.removeEventListener(c,m,x):l.detachEvent?l.detachEvent("on"+c,m):l["on"+c]=null},xe.scheduleRemoveUserSelectStyles=function(l){window.requestAnimationFrame?window.requestAnimationFrame(()=>{s(l)}):s(l)};var a=lo(),i=(function(l,c){if(typeof WeakMap=="function")var m=new WeakMap,C=new WeakMap;return(function(x,f){if(!f&&x&&x.__esModule)return x;var p,y,S={__proto__:null,default:x};if(x===null||typeof x!="object"&&typeof x!="function")return S;if(p=f?C:m){if(p.has(x))return p.get(x);p.set(x,S)}for(const h in x)h!=="default"&&{}.hasOwnProperty.call(x,h)&&((y=(p=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,h))&&(y.get||y.set)?p(S,h,y):S[h]=x[h]);return S})(l,c)})((function(){if(Hn)return He;Hn=1,Object.defineProperty(He,"__esModule",{value:!0}),He.browserPrefixToKey=m,He.browserPrefixToStyle=function(C,x){return x?`-${x.toLowerCase()}-${C}`:C},He.default=void 0,He.getPrefix=c;const l=["Moz","Webkit","O","ms"];function c(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const x=window.document?.documentElement?.style;if(!x||C in x)return"";for(let f=0;f<l.length;f++)if(m(C,l[f])in x)return l[f];return""}function m(C,x){return x?`${x}${(function(f){let p="",y=!0;for(let S=0;S<f.length;S++)y?(p+=f[S].toUpperCase(),y=!1):f[S]==="-"?y=!0:p+=f[S];return p})(C)}`:C}return He.default=c(),He})());let o="";function t(l,c){return o||(o=(0,a.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(m){return(0,a.isFunction)(l[m])})),!!(0,a.isFunction)(l[o])&&l[o](c)}function r(l,c,m){let{x:C,y:x}=l,f=`translate(${C}${m},${x}${m})`;return c&&(f=`translate(${`${typeof c.x=="string"?c.x:c.x+m}`}, ${`${typeof c.y=="string"?c.y:c.y+m}`})`+f),f}function s(l){if(l)try{if(l.body&&u(l.body,"react-draggable-transparent-selection"),l.selection)l.selection.empty();else{const c=(l.defaultView||window).getSelection();c&&c.type!=="Caret"&&c.removeAllRanges()}}catch{}}function d(l,c){l.classList?l.classList.add(c):l.className.match(new RegExp(`(?:^|\\s)${c}(?!\\S)`))||(l.className+=` ${c}`)}function u(l,c){l.classList?l.classList.remove(c):l.className=l.className.replace(new RegExp(`(?:^|\\s)${c}(?!\\S)`,"g"),"")}return xe}var $n,Fe={};function ar(){if($n)return Fe;$n=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.canDragX=function(t){return t.props.axis==="both"||t.props.axis==="x"},Fe.canDragY=function(t){return t.props.axis==="both"||t.props.axis==="y"},Fe.createCoreData=function(t,r,s){const d=!(0,a.isNum)(t.lastX),u=o(t);return d?{node:u,deltaX:0,deltaY:0,lastX:r,lastY:s,x:r,y:s}:{node:u,deltaX:r-t.lastX,deltaY:s-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:s}},Fe.createDraggableData=function(t,r){const s=t.props.scale;return{node:r.node,x:t.state.x+r.deltaX/s,y:t.state.y+r.deltaY/s,deltaX:r.deltaX/s,deltaY:r.deltaY/s,lastX:t.state.x,lastY:t.state.y}},Fe.getBoundPosition=function(t,r,s){if(!t.props.bounds)return[r,s];let{bounds:d}=t.props;d=typeof d=="string"?d:(function(l){return{left:l.left,top:l.top,right:l.right,bottom:l.bottom}})(d);const u=o(t);if(typeof d=="string"){const{ownerDocument:l}=u,c=l.defaultView;let m;if(d==="parent"?m=u.parentNode:m=u.getRootNode().querySelector(d),!(m instanceof c.HTMLElement))throw new Error('Bounds selector "'+d+'" could not find an element.');const C=m,x=c.getComputedStyle(u),f=c.getComputedStyle(C);d={left:-u.offsetLeft+(0,a.int)(f.paddingLeft)+(0,a.int)(x.marginLeft),top:-u.offsetTop+(0,a.int)(f.paddingTop)+(0,a.int)(x.marginTop),right:(0,i.innerWidth)(C)-(0,i.outerWidth)(u)-u.offsetLeft+(0,a.int)(f.paddingRight)-(0,a.int)(x.marginRight),bottom:(0,i.innerHeight)(C)-(0,i.outerHeight)(u)-u.offsetTop+(0,a.int)(f.paddingBottom)-(0,a.int)(x.marginBottom)}}return(0,a.isNum)(d.right)&&(r=Math.min(r,d.right)),(0,a.isNum)(d.bottom)&&(s=Math.min(s,d.bottom)),(0,a.isNum)(d.left)&&(r=Math.max(r,d.left)),(0,a.isNum)(d.top)&&(s=Math.max(s,d.top)),[r,s]},Fe.getControlPosition=function(t,r,s){const d=typeof r=="number"?(0,i.getTouch)(t,r):null;if(typeof r=="number"&&!d)return null;const u=o(s),l=s.props.offsetParent||u.offsetParent||u.ownerDocument.body;return(0,i.offsetXYFromParent)(d||t,l,s.props.scale)},Fe.snapToGrid=function(t,r,s){const d=Math.round(r/t[0])*t[0],u=Math.round(s/t[1])*t[1];return[d,u]};var a=lo(),i=Yo();function o(t){const r=t.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Fe}var Vn,_n,Kn,Un,vt={},_t={};function rr(){return Vn||(Vn=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.default=function(){}),_t}function el(){if(_n)return vt;_n=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.default=void 0;var a=(function(f,p){if(typeof WeakMap=="function")var y=new WeakMap,S=new WeakMap;return(function(h,g){if(!g&&h&&h.__esModule)return h;var k,j,v={__proto__:null,default:h};if(h===null||typeof h!="object"&&typeof h!="function")return v;if(k=g?S:y){if(k.has(h))return k.get(h);k.set(h,v)}for(const T in h)T!=="default"&&{}.hasOwnProperty.call(h,T)&&((j=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(h,T))&&(j.get||j.set)?k(v,T,j):v[T]=h[T]);return v})(f,p)})(n),i=u(Ot()),o=u(Je),t=Yo(),r=ar(),s=lo(),d=u(rr());function u(f){return f&&f.__esModule?f:{default:f}}function l(f,p,y){return(p=(function(S){var h=(function(g,k){if(typeof g!="object"||!g)return g;var j=g[Symbol.toPrimitive];if(j!==void 0){var v=j.call(g,k);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(g)})(S,"string");return typeof h=="symbol"?h:h+""})(p))in f?Object.defineProperty(f,p,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[p]=y,f}const c={start:"touchstart",move:"touchmove",stop:"touchend"},m={start:"mousedown",move:"mousemove",stop:"mouseup"};let C=m,x=class extends a.Component{constructor(){super(...arguments),l(this,"dragging",!1),l(this,"lastX",NaN),l(this,"lastY",NaN),l(this,"touchIdentifier",null),l(this,"mounted",!1),l(this,"handleDragStart",f=>{if(this.props.onMouseDown(f),!this.props.allowAnyClick&&typeof f.button=="number"&&f.button!==0)return!1;const p=this.findDOMNode();if(!p||!p.ownerDocument||!p.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:y}=p;if(this.props.disabled||!(f.target instanceof y.defaultView.Node)||this.props.handle&&!(0,t.matchesSelectorAndParentsTo)(f.target,this.props.handle,p)||this.props.cancel&&(0,t.matchesSelectorAndParentsTo)(f.target,this.props.cancel,p))return;f.type!=="touchstart"||this.props.allowMobileScroll||f.preventDefault();const S=(0,t.getTouchIdentifier)(f);this.touchIdentifier=S;const h=(0,r.getControlPosition)(f,S,this);if(h==null)return;const{x:g,y:k}=h,j=(0,r.createCoreData)(this,g,k);(0,d.default)("DraggableCore: handleDragStart: %j",j),(0,d.default)("calling",this.props.onStart),this.props.onStart(f,j)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,t.addUserSelectStyles)(y),this.dragging=!0,this.lastX=g,this.lastY=k,(0,t.addEvent)(y,C.move,this.handleDrag),(0,t.addEvent)(y,C.stop,this.handleDragStop))}),l(this,"handleDrag",f=>{const p=(0,r.getControlPosition)(f,this.touchIdentifier,this);if(p==null)return;let{x:y,y:S}=p;if(Array.isArray(this.props.grid)){let g=y-this.lastX,k=S-this.lastY;if([g,k]=(0,r.snapToGrid)(this.props.grid,g,k),!g&&!k)return;y=this.lastX+g,S=this.lastY+k}const h=(0,r.createCoreData)(this,y,S);if((0,d.default)("DraggableCore: handleDrag: %j",h),this.props.onDrag(f,h)!==!1&&this.mounted!==!1)this.lastX=y,this.lastY=S;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const k=document.createEvent("MouseEvents");k.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(k)}}),l(this,"handleDragStop",f=>{if(!this.dragging)return;const p=(0,r.getControlPosition)(f,this.touchIdentifier,this);if(p==null)return;let{x:y,y:S}=p;if(Array.isArray(this.props.grid)){let k=y-this.lastX||0,j=S-this.lastY||0;[k,j]=(0,r.snapToGrid)(this.props.grid,k,j),y=this.lastX+k,S=this.lastY+j}const h=(0,r.createCoreData)(this,y,S);if(this.props.onStop(f,h)===!1||this.mounted===!1)return!1;const g=this.findDOMNode();g&&this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(g.ownerDocument),(0,d.default)("DraggableCore: handleDragStop: %j",h),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,g&&((0,d.default)("DraggableCore: Removing handlers"),(0,t.removeEvent)(g.ownerDocument,C.move,this.handleDrag),(0,t.removeEvent)(g.ownerDocument,C.stop,this.handleDragStop))}),l(this,"onMouseDown",f=>(C=m,this.handleDragStart(f))),l(this,"onMouseUp",f=>(C=m,this.handleDragStop(f))),l(this,"onTouchStart",f=>(C=c,this.handleDragStart(f))),l(this,"onTouchEnd",f=>(C=c,this.handleDragStop(f)))}componentDidMount(){this.mounted=!0;const f=this.findDOMNode();f&&(0,t.addEvent)(f,c.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const f=this.findDOMNode();if(f){const{ownerDocument:p}=f;(0,t.removeEvent)(p,m.move,this.handleDrag),(0,t.removeEvent)(p,c.move,this.handleDrag),(0,t.removeEvent)(p,m.stop,this.handleDragStop),(0,t.removeEvent)(p,c.stop,this.handleDragStop),(0,t.removeEvent)(f,c.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,t.scheduleRemoveUserSelectStyles)(p)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:o.default.findDOMNode(this)}render(){return a.cloneElement(a.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return vt.default=x,l(x,"displayName","DraggableCore"),l(x,"propTypes",{allowAnyClick:i.default.bool,allowMobileScroll:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(f,p){if(f[p]&&f[p].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),l(x,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),vt}function tl(){return Kn||(Kn=1,(function(a){Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),a.default=void 0;var i=(function(p,y){if(typeof WeakMap=="function")var S=new WeakMap,h=new WeakMap;return(function(g,k){if(!k&&g&&g.__esModule)return g;var j,v,T={__proto__:null,default:g};if(g===null||typeof g!="object"&&typeof g!="function")return T;if(j=k?h:S){if(j.has(g))return j.get(g);j.set(g,T)}for(const M in g)M!=="default"&&{}.hasOwnProperty.call(g,M)&&((v=(j=Object.defineProperty)&&Object.getOwnPropertyDescriptor(g,M))&&(v.get||v.set)?j(T,M,v):T[M]=g[M]);return T})(p,y)})(n),o=m(Ot()),t=m(Je),r=(function(){if(Ln)return Vt.exports;function p(S){var h,g,k="";if(typeof S=="string"||typeof S=="number")k+=S;else if(typeof S=="object")if(Array.isArray(S)){var j=S.length;for(h=0;h<j;h++)S[h]&&(g=p(S[h]))&&(k&&(k+=" "),k+=g)}else for(g in S)S[g]&&(k&&(k+=" "),k+=g);return k}function y(){for(var S,h,g=0,k="",j=arguments.length;g<j;g++)(S=arguments[g])&&(h=p(S))&&(k&&(k+=" "),k+=h);return k}return Ln=1,Vt.exports=y,Vt.exports.clsx=y,Vt.exports})(),s=Yo(),d=ar(),u=lo(),l=m(el()),c=m(rr());function m(p){return p&&p.__esModule?p:{default:p}}function C(){return C=Object.assign?Object.assign.bind():function(p){for(var y=1;y<arguments.length;y++){var S=arguments[y];for(var h in S)({}).hasOwnProperty.call(S,h)&&(p[h]=S[h])}return p},C.apply(null,arguments)}function x(p,y,S){return(y=(function(h){var g=(function(k,j){if(typeof k!="object"||!k)return k;var v=k[Symbol.toPrimitive];if(v!==void 0){var T=v.call(k,j);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(k)})(h,"string");return typeof g=="symbol"?g:g+""})(y))in p?Object.defineProperty(p,y,{value:S,enumerable:!0,configurable:!0,writable:!0}):p[y]=S,p}class f extends i.Component{static getDerivedStateFromProps(y,S){let{position:h}=y,{prevPropsPosition:g}=S;return!h||g&&h.x===g.x&&h.y===g.y?null:((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:h,prevPropsPosition:g}),{x:h.x,y:h.y,prevPropsPosition:{...h}})}constructor(y){super(y),x(this,"onDragStart",(S,h)=>{if((0,c.default)("Draggable: onDragStart: %j",h),this.props.onStart(S,(0,d.createDraggableData)(this,h))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),x(this,"onDrag",(S,h)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",h);const g=(0,d.createDraggableData)(this,h),k={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:v}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[T,M]=(0,d.getBoundPosition)(this,k.x,k.y);k.x=T,k.y=M,k.slackX=this.state.slackX+(j-k.x),k.slackY=this.state.slackY+(v-k.y),g.x=k.x,g.y=k.y,g.deltaX=k.x-this.state.x,g.deltaY=k.y-this.state.y}if(this.props.onDrag(S,g)===!1)return!1;this.setState(k)}),x(this,"onDragStop",(S,h)=>{if(!this.state.dragging||this.props.onStop(S,(0,d.createDraggableData)(this,h))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",h);const g={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:k,y:j}=this.props.position;g.x=k,g.y=j}this.setState(g)}),this.state={dragging:!1,dragged:!1,x:y.position?y.position.x:y.defaultPosition.x,y:y.position?y.position.y:y.defaultPosition.y,prevPropsPosition:{...y.position},slackX:0,slackY:0,isElementSVG:!1},!y.position||y.onDrag||y.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??t.default.findDOMNode(this)}render(){const{axis:y,bounds:S,children:h,defaultPosition:g,defaultClassName:k,defaultClassNameDragging:j,defaultClassNameDragged:v,position:T,positionOffset:M,scale:R,...D}=this.props;let F={},B=null;const P=!T||this.state.dragging,N=T||g,z={x:(0,d.canDragX)(this)&&P?this.state.x:N.x,y:(0,d.canDragY)(this)&&P?this.state.y:N.y};this.state.isElementSVG?B=(0,s.createSVGTransform)(z,M):F=(0,s.createCSSTransform)(z,M);const O=(0,r.clsx)(h.props.className||"",k,{[j]:this.state.dragging,[v]:this.state.dragged});return i.createElement(l.default,C({},D,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),i.cloneElement(i.Children.only(h),{className:O,style:{...h.props.style,...F},transform:B}))}}a.default=f,x(f,"displayName","Draggable"),x(f,"propTypes",{...l.default.propTypes,axis:o.default.oneOf(["both","x","y","none"]),bounds:o.default.oneOfType([o.default.shape({left:o.default.number,right:o.default.number,top:o.default.number,bottom:o.default.number}),o.default.string,o.default.oneOf([!1])]),defaultClassName:o.default.string,defaultClassNameDragging:o.default.string,defaultClassNameDragged:o.default.string,defaultPosition:o.default.shape({x:o.default.number,y:o.default.number}),positionOffset:o.default.shape({x:o.default.oneOfType([o.default.number,o.default.string]),y:o.default.oneOfType([o.default.number,o.default.string])}),position:o.default.shape({x:o.default.number,y:o.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),x(f,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(On)),On}function ir(){if(Un)return kt.exports;Un=1;const{default:a,DraggableCore:i}=tl();return kt.exports=a,kt.exports.default=a,kt.exports.DraggableCore=i,kt.exports}var qn,Kt={};function ol(){if(qn)return Kt;qn=1,Kt.__esModule=!0,Kt.cloneElement=function(s,d){return d.style&&s.props.style&&(d.style=t(t({},s.props.style),d.style)),d.className&&s.props.className&&(d.className=s.props.className+" "+d.className),i.default.cloneElement(s,d)};var a,i=(a=n)&&a.__esModule?a:{default:a};function o(s,d){var u=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(s,c).enumerable})),u.push.apply(u,l)}return u}function t(s){for(var d=1;d<arguments.length;d++){var u=arguments[d]!=null?arguments[d]:{};d%2?o(Object(u),!0).forEach(function(l){r(s,l,u[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(u)):o(Object(u)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(u,l))})}return s}function r(s,d,u){return(d=(function(l){var c=(function(m,C){if(typeof m!="object"||m===null)return m;var x=m[Symbol.toPrimitive];if(x!==void 0){var f=x.call(m,C);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(m)})(l,"string");return typeof c=="symbol"?c:String(c)})(d))in s?Object.defineProperty(s,d,{value:u,enumerable:!0,configurable:!0,writable:!0}):s[d]=u,s}return Kt}var Gn,Xn,jt={};function lr(){if(Gn)return jt;Gn=1,jt.__esModule=!0,jt.resizableProps=void 0;var a,i=(a=Ot())&&a.__esModule?a:{default:a};ir();var o={axis:i.default.oneOf(["both","x","y","none"]),className:i.default.string,children:i.default.element.isRequired,draggableOpts:i.default.shape({allowAnyClick:i.default.bool,cancel:i.default.string,children:i.default.node,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:i.default.node,grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number}),height:function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];var d,u=r[0];return u.axis==="both"||u.axis==="y"?(d=i.default.number).isRequired.apply(d,r):i.default.number.apply(i.default,r)},handle:i.default.oneOfType([i.default.node,i.default.func]),handleSize:i.default.arrayOf(i.default.number),lockAspectRatio:i.default.bool,maxConstraints:i.default.arrayOf(i.default.number),minConstraints:i.default.arrayOf(i.default.number),onResizeStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,resizeHandles:i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:i.default.number,width:function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];var d,u=r[0];return u.axis==="both"||u.axis==="x"?(d=i.default.number).isRequired.apply(d,r):i.default.number.apply(i.default,r)}};return jt.resizableProps=o,jt}function sr(){if(Xn)return wt;Xn=1,wt.__esModule=!0,wt.default=void 0;var a=(function(x,f){if(x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var p=s(f);if(p&&p.has(x))return p.get(x);var y={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in x)if(h!=="default"&&Object.prototype.hasOwnProperty.call(x,h)){var g=S?Object.getOwnPropertyDescriptor(x,h):null;g&&(g.get||g.set)?Object.defineProperty(y,h,g):y[h]=x[h]}return y.default=x,p&&p.set(x,y),y})(n),i=ir(),o=ol(),t=lr(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(x){if(typeof WeakMap!="function")return null;var f=new WeakMap,p=new WeakMap;return(s=function(y){return y?p:f})(x)}function d(){return d=Object.assign?Object.assign.bind():function(x){for(var f=1;f<arguments.length;f++){var p=arguments[f];for(var y in p)Object.prototype.hasOwnProperty.call(p,y)&&(x[y]=p[y])}return x},d.apply(this,arguments)}function u(x,f){var p=Object.keys(x);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(x);f&&(y=y.filter(function(S){return Object.getOwnPropertyDescriptor(x,S).enumerable})),p.push.apply(p,y)}return p}function l(x){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?u(Object(p),!0).forEach(function(y){c(x,y,p[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(p)):u(Object(p)).forEach(function(y){Object.defineProperty(x,y,Object.getOwnPropertyDescriptor(p,y))})}return x}function c(x,f,p){return(f=(function(y){var S=(function(h,g){if(typeof h!="object"||h===null)return h;var k=h[Symbol.toPrimitive];if(k!==void 0){var j=k.call(h,g);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(h)})(y,"string");return typeof S=="symbol"?S:String(S)})(f))in x?Object.defineProperty(x,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):x[f]=p,x}function m(x,f){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,y){return p.__proto__=y,p},m(x,f)}var C=(function(x){var f,p;function y(){for(var h,g=arguments.length,k=new Array(g),j=0;j<g;j++)k[j]=arguments[j];return(h=x.call.apply(x,[this].concat(k))||this).handleRefs={},h.lastHandleRect=null,h.slack=null,h}p=x,(f=y).prototype=Object.create(p.prototype),f.prototype.constructor=f,m(f,p);var S=y.prototype;return S.componentWillUnmount=function(){this.resetData()},S.resetData=function(){this.lastHandleRect=this.slack=null},S.runConstraints=function(h,g){var k=this.props,j=k.minConstraints,v=k.maxConstraints,T=k.lockAspectRatio;if(!j&&!v&&!T)return[h,g];if(T){var M=this.props.width/this.props.height,R=h-this.props.width,D=g-this.props.height;Math.abs(R)>Math.abs(D*M)?g=h/M:h=g*M}var F=h,B=g,P=this.slack||[0,0],N=P[0],z=P[1];return h+=N,g+=z,j&&(h=Math.max(j[0],h),g=Math.max(j[1],g)),v&&(h=Math.min(v[0],h),g=Math.min(v[1],g)),this.slack=[N+(F-h),z+(B-g)],[h,g]},S.resizeHandler=function(h,g){var k=this;return function(j,v){var T=v.node,M=v.deltaX,R=v.deltaY;h==="onResizeStart"&&k.resetData();var D=(k.props.axis==="both"||k.props.axis==="x")&&g!=="n"&&g!=="s",F=(k.props.axis==="both"||k.props.axis==="y")&&g!=="e"&&g!=="w";if(D||F){var B=g[0],P=g[g.length-1],N=T.getBoundingClientRect();k.lastHandleRect!=null&&(P==="w"&&(M+=N.left-k.lastHandleRect.left),B==="n"&&(R+=N.top-k.lastHandleRect.top)),k.lastHandleRect=N,P==="w"&&(M=-M),B==="n"&&(R=-R);var z=k.props.width+(D?M/k.props.transformScale:0),O=k.props.height+(F?R/k.props.transformScale:0),H=k.runConstraints(z,O);z=H[0],O=H[1];var I=z!==k.props.width||O!==k.props.height,W=typeof k.props[h]=="function"?k.props[h]:null;W&&!(h==="onResize"&&!I)&&(j.persist==null||j.persist(),W(j,{node:T,size:{width:z,height:O},handle:g})),h==="onResizeStop"&&k.resetData()}}},S.renderResizeHandle=function(h,g){var k=this.props.handle;if(!k)return a.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+h,ref:g});if(typeof k=="function")return k(h,g);var j=l({ref:g},typeof k.type=="string"?{}:{handleAxis:h});return a.cloneElement(k,j)},S.render=function(){var h=this,g=this.props,k=g.children,j=g.className,v=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var T=g.resizeHandles;g.transformScale;var M=(function(R,D){if(R==null)return{};var F,B,P={},N=Object.keys(R);for(B=0;B<N.length;B++)F=N[B],D.indexOf(F)>=0||(P[F]=R[F]);return P})(g,r);return(0,o.cloneElement)(k,l(l({},M),{},{className:(j?j+" ":"")+"react-resizable",children:[].concat(k.props.children,T.map(function(R){var D,F=(D=h.handleRefs[R])!=null?D:h.handleRefs[R]=a.createRef();return a.createElement(i.DraggableCore,d({},v,{nodeRef:F,key:"resizableHandle-"+R,onStop:h.resizeHandler("onResizeStop",R),onStart:h.resizeHandler("onResizeStart",R),onDrag:h.resizeHandler("onResize",R)}),h.renderResizeHandle(R,F))}))}))},y})(a.Component);return wt.default=C,C.propTypes=t.resizableProps,C.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},wt}var Yn,Zn,Tt={};function nl(){if(Yn)return Tt;Yn=1,Tt.__esModule=!0,Tt.default=void 0;var a=(function(f,p){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var y=d(p);if(y&&y.has(f))return y.get(f);var S={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in f)if(g!=="default"&&Object.prototype.hasOwnProperty.call(f,g)){var k=h?Object.getOwnPropertyDescriptor(f,g):null;k&&(k.get||k.set)?Object.defineProperty(S,g,k):S[g]=f[g]}return S.default=f,y&&y.set(f,S),S})(n),i=s(Ot()),o=s(sr()),t=lr(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(f){return f&&f.__esModule?f:{default:f}}function d(f){if(typeof WeakMap!="function")return null;var p=new WeakMap,y=new WeakMap;return(d=function(S){return S?y:p})(f)}function u(){return u=Object.assign?Object.assign.bind():function(f){for(var p=1;p<arguments.length;p++){var y=arguments[p];for(var S in y)Object.prototype.hasOwnProperty.call(y,S)&&(f[S]=y[S])}return f},u.apply(this,arguments)}function l(f,p){var y=Object.keys(f);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(f);p&&(S=S.filter(function(h){return Object.getOwnPropertyDescriptor(f,h).enumerable})),y.push.apply(y,S)}return y}function c(f){for(var p=1;p<arguments.length;p++){var y=arguments[p]!=null?arguments[p]:{};p%2?l(Object(y),!0).forEach(function(S){m(f,S,y[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(y)):l(Object(y)).forEach(function(S){Object.defineProperty(f,S,Object.getOwnPropertyDescriptor(y,S))})}return f}function m(f,p,y){return(p=(function(S){var h=(function(g,k){if(typeof g!="object"||g===null)return g;var j=g[Symbol.toPrimitive];if(j!==void 0){var v=j.call(g,k);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(g)})(S,"string");return typeof h=="symbol"?h:String(h)})(p))in f?Object.defineProperty(f,p,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[p]=y,f}function C(f,p){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,S){return y.__proto__=S,y},C(f,p)}var x=(function(f){var p,y;function S(){for(var h,g=arguments.length,k=new Array(g),j=0;j<g;j++)k[j]=arguments[j];return(h=f.call.apply(f,[this].concat(k))||this).state={width:h.props.width,height:h.props.height,propsWidth:h.props.width,propsHeight:h.props.height},h.onResize=function(v,T){var M=T.size;h.props.onResize?(v.persist==null||v.persist(),h.setState(M,function(){return h.props.onResize&&h.props.onResize(v,T)})):h.setState(M)},h}return y=f,(p=S).prototype=Object.create(y.prototype),p.prototype.constructor=p,C(p,y),S.getDerivedStateFromProps=function(h,g){return g.propsWidth!==h.width||g.propsHeight!==h.height?{width:h.width,height:h.height,propsWidth:h.width,propsHeight:h.height}:null},S.prototype.render=function(){var h=this.props,g=h.handle,k=h.handleSize;h.onResize;var j=h.onResizeStart,v=h.onResizeStop,T=h.draggableOpts,M=h.minConstraints,R=h.maxConstraints,D=h.lockAspectRatio,F=h.axis;h.width,h.height;var B=h.resizeHandles,P=h.style,N=h.transformScale,z=(function(O,H){if(O==null)return{};var I,W,ee={},X=Object.keys(O);for(W=0;W<X.length;W++)I=X[W],H.indexOf(I)>=0||(ee[I]=O[I]);return ee})(h,r);return a.createElement(o.default,{axis:F,draggableOpts:T,handle:g,handleSize:k,height:this.state.height,lockAspectRatio:D,maxConstraints:R,minConstraints:M,onResizeStart:j,onResize:this.onResize,onResizeStop:v,resizeHandles:B,transformScale:N,width:this.state.width},a.createElement("div",u({},z,{style:c(c({},P),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},S})(a.Component);return Tt.default=x,x.propTypes=c(c({},t.resizableProps),{},{children:i.default.element}),Tt}var al=(Zn||(Zn=1,$t.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},$t.exports.Resizable=sr().default,$t.exports.ResizableBox=nl().default),$t.exports);const Zo=n.memo(n.forwardRef((a,i)=>{const{disabled:o,names:t,workbook:r,restoreFocus:s,readonly:d=!1,disabled:u=!1,commandPopupButtonProps:l,sx:c,...m}=a,C=w.useNotifier(),[x,f]=n.useState(null),[p,y]=n.useState(()=>r.getSelectedRanges().getCoords()),[S,h]=n.useState(!1),{reference:g}=b.useFloatStack({parentFloat:l?.parentFloat}),[k,j]=n.useState(()=>d||!r.getProtection().isStructureAllowed()),v=()=>x?.text??"",[T,M]=n.useState(v),R=w.useCallbackRef(()=>{if(g?.closeAll(),!T){const _=v();return M(v()),_}if(v()===T)return T;const $=T.trim().toLowerCase();if($==="r"||$==="c")return T;try{const _=r.getRanges(T);if(_)return _.toString()}catch{}const U=t.getByName(T);if(U&&U.getRanges())return T;let Y=null;try{const _=r.getRanges(T),L=_.getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));Y=r.getRanges(L)}catch{}if(!Y){const _=r.getSelectedRanges().getCoords().map(L=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...L}));Y=r.getRanges(_)}try{let _=t.getByName(T);k||_||(_=t.addReference(T,Y)),_&&f({text:_.getName()})}catch(_){M(v()),C.showMessage?.(_.message,{type:w.NotifierType.Error})}return null},[T,t,g,k,C]),D=w.useCallbackRef(()=>{if(r.isClosed())return;const $=[];for(let _=0;_<p.length;_++){const L=p[_];$.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...L})}let U=null;try{U=t.lookupByRanges($)}catch{}let Y=null;Y=U?.length>0?U[0].getName():r.getSelectedSheet().getSelectedRange().toString(),f({text:Y})},[r,p]),[F,B]=n.useState(()=>t?.getItems()??null);oe.useModelListener(t,{onCollectionChange($){B(t.getItems()),D()},onClose($){B([])}}),n.useEffect(()=>{M(v())},[x,p]);const[P,N]=n.useState(r?.getSelectedSheet());oe.useModelListener(r,{onProtectionChange:$=>{j(d||!$.getProtection().isStructureAllowed())},onSheetsChange:$=>{N($?.getSelectedSheet())},onViewChange($){N($?.getSelectedSheet())}});const[z,O]=n.useState(null),H=w.useCallbackRef(A.CommonUtils.debounce(D,z?320:0),[]);oe.useModelListener(P.getSelection(),{onChange:()=>{y($=>{const U=r.getSelectedRanges().getCoords();return A.CoordUtils.isEqualRangesArrays(U,$)?$:U})},onAdjustingChange:$=>{O($.getAdjusting())}}),n.useEffect(()=>{if(z){const $=r.getSelectedRange(),U=$.getRowCount(),Y=$.getColumnCount();let _=`${U}R x ${Y}C`;if(_.length>17&&(_=`${U}x${Y}`),U>1||Y>1)return void f({text:_,fontStyle:"italic",justifyContent:"center"})}f({text:r.getSelectedSheet().getSelectedRange().toString()}),H()},[p,r,z]);const I=n.useRef(null),W=n.useCallback($=>{const{onMouseDown:U,onMouseUp:Y,..._}=$;return e.jsx(E.IconButton,{..._,sx:{..._?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:e.jsx(E.Input,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:I},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:L=>`1px solid ${L.palette.text.icon??L.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:L=>`1px solid ${L.palette.primary.main}`},"::after":{borderBottom:L=>`1px solid ${L.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",height:"1rem",fontSize:11*A.IFont.getDeviceScale(),fontStyle:x?.fontStyle,paddingLeft:L=>L.spacing(.75),paddingRight:L=>L.spacing(.75),boxShadow:"none",flex:"1",color:L=>L.palette.text.secondary,input:{padding:"0",height:"1rem",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:L=>L.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:L=>L.palette.text.primary}}},value:T,onFocus:L=>{L.target?.select()},onKeyDown:L=>{if(L.which===w.KeyCodes.Enter||L.which===w.KeyCodes.Tab){let G=T;v()!==T&&(L.stopPropagation(),L.preventDefault(),G=R()),G?ee(G):s?.()}else if(L.which===w.KeyCodes.Escape)v()!==T?(M(v()),setTimeout(()=>{L.target?.select()},0),L.stopPropagation(),L.preventDefault()):s?.();else if(L.which===w.KeyCodes.Space)return void L.stopPropagation()},onBlur:()=>{M(v())},onChange:L=>{M(L.target.value)}})})},[T,x]),ee=w.useCallbackRef(async $=>{try{g?.closeAll();const U=t.lookupByRanges($)?.[0];U&&await U?.select(),await r.getRanges($)?.select()}catch(U){C.showMessage?.(U.message,{type:w.NotifierType.Error})}},[t,C,r]),X=n.useCallback($=>{setTimeout(()=>{h(!0)},0);const U={variant:w.CommandButtonType.Menuitem,parentFloat:$.floatReference,commandHook:{...l?.commandHook,beforeExecute:(re,ue)=>(g?.closeAll(),l?.commandHook?.beforeExecute?.(re,ue))},scope:l?.scope,commands:l?.commands};let Y=t.getItems({scope:r?.getSelectedSheet().getName()});Y=Y.sort((re,ue)=>re.getType()===ue.getType()?re.getName().localeCompare(ue.getName()):re.getType()==="range"?-1:1);const _=k?null:["editNamedReference","deleteNamedReference"],L=k?null:["editTable",null,"convertTableToRange","deleteTable"],G=[],Q=Y.length;for(let re=0;re<Q;re++){const ue=Y[re],Se=ue.getRanges();if(!Se||ue.isHidden())continue;const Ce=ue.getType();Ce!==Y[re-1]?.getType()&&(re>0&&G.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal"},`type-divider-${G.length}`)),G.push(e.jsx(b.ExhibitMenuHeader,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:ue.getType()==="reference"?"Ranges":"Tables"},`type-header-${G.length}`))),Ce==="reference"?G.push(n.createElement(b.SimpleCommandPopupButton,{...U,key:"named-"+G.length,popupCommandKeys:_,popupScope:"namedItem",scope:"namedItem",commandState:ue,commands:l?.commands,label:ue.getName(),quickCommand:"selectNamed",disabled:!ue.getRanges()||u,icon:"NamedRange"})):Ce==="table"&&G.push(n.createElement(b.SimpleCommandPopupButton,{...U,key:"namedItem-"+G.length,popupCommandKeys:L,popupScope:"namedItem",scope:"namedItem",commands:l?.commands,commandState:ue,label:ue.getName(),quickCommand:"selectNamed",disabled:!Se||u,icon:"InsertTable"}))}const fe=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...m,children:[k?null:e.jsx(b.CommandButton,{...U,scope:"namedItem",command:l?.commands.getCommand("addNamedReference")}),G&&G.length>0?e.jsxs(e.Fragment,{children:[k?null:e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:G})]}):null]});return b.defaultCreatePopupPanel({...$,children:fe})},[r,F,t,x,k]),ne=w.useImperativeElement(i,()=>({focus($){I.current?.focus($)}}),[]);return e.jsx(E.Box,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...c},ref:et([ne,i]),...m,children:e.jsx(b.ExhibitPopupIconButton,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%"},...c},buttonProps:{sx:{backgroundColor:$=>$.palette.background.paper,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`}},tabIndex:-1,outlined:{color:$=>o?$.palette.action.disabled:q.alpha($.palette.divider,.2)},parentFloat:g,createPopupPanel:X,onPopupOpen:()=>h(!0),onPopupClose:()=>h(!1),createTooltip:({children:$},U)=>e.jsx(b.ExhibitTooltip,{title:U||S?"":"Name Box",disabled:U,leaveDelay:0,sx:{opacity:U||S?0:1},children:$}),createQuickButton:W})})}));Zo.displayName="NamedCollectionEditor";const rl=(a,i)=>e.jsx(Zo,{ref:i,...a}),Qo=n.memo(n.forwardRef((a,i)=>{const{sx:o,workbook:t,sheetElement:r,gridStyle:s,showNamedCollectionEditor:d=!0,NamedCollectionEditorProps:u,renderNamedCollectionEditor:l=rl,disabled:c,commands:m,...C}=a,[x,f]=n.useState(t?.getSelectedSheet());oe.useModelListener(t,{onSheetsChange:L=>{f(L?.getSelectedSheet())},onViewChange(L){f(L?.getSelectedSheet())}});const[p,y]=n.useState(x.getSelection().getCoords().cell),S=x.getRange(p).getCell(),h=c||!S.isEditAllowed(),g=n.useRef(null),k=n.useMemo(()=>({fontSize:11}),[]);oe.useModelListener(x.getSelection(),{onChange:()=>{y(x.getSelection().getCoords().cell)}}),oe.useModelListener(x,{onProtectionChange(){y(x.getSelection().getCoords().cell)}});const j=g.current?.getLineHeight()??20,[v,T]=n.useState(j),[M,R]=n.useState(5),[D,F]=n.useState(1),B=w.useCallbackRef((L,{size:G})=>{L.preventDefault(),L.stopPropagation();const Q=Math.floor(G.height/j);T(Q*j+1),Q>1&&R(Q)},[j]),P=w.useCallbackRef((L,{size:G})=>{const Q=Math.floor(G.height/j);F(Q)},[j]),N=w.useEditMode(),z=N.getMode();let O=null;z?.key==="edit"&&(O=z.args?.stateAndCoords);const H=n.useMemo(()=>{let L=O?.editState;return L||(L=oe.createCellEditStateFromCell(()=>x.getRange(p).getCell())),e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:e.jsx(oe.SheetCellEditor,{ref:g,activeCoords:p,sheet:x,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:p})},defaultTextStyle:k,useRichStyling:!1,disabled:h,onChangeEdit:G=>{if(G.dirty!==void 0){const Q={sheet:x,coords:p,editState:G};N.setMode(fe=>({...fe,args:{...fe?.args,stateAndCoords:Q}}))}},editState:L,commands:m,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:D})})},[x,O,p,D,r]),I=n.useRef(null),W=n.useMemo(()=>d?l({names:t.getNames(),workbook:t,...u},I):null,[l,u,d,x,t,h]),ee=n.useMemo(()=>e.jsxs(E.Paper,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,border:L=>`solid ${h?L.palette.action.disabled:q.alpha(L.palette.divider,.2)} 1px`},children:[e.jsx(b.ExhibitIconButton,{sx:{border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"warning","aria-label":"cancel-formula-edit",icon:e.jsx(w.DynamicIcon,{iconKey:"CloseError"}),tooltipProps:{label:"Cancel",simple:!0},disabled:h||O===null,onMouseDown:L=>{L.button===0&&L.preventDefault()},onClick:()=>{r.cancelEdit()}}),e.jsx(b.ExhibitIconButton,{sx:{border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"primary","aria-label":"commit-formula-edit",icon:e.jsx(w.DynamicIcon,{iconKey:"CheckSuccess"}),tooltipProps:{label:"Enter",simple:!0},disabled:h||O===null,onMouseDown:L=>{L.button===0&&L.preventDefault()},onClick:()=>{r.submitEdit()}}),e.jsx(b.ExhibitIconButton,{sx:{border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,disabled:!0,"aria-label":"commit-formula-function",icon:e.jsx(w.DynamicIcon,{iconKey:"Function",style:{transform:"scale(0.85)"}}),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:L=>{L.button===0&&L.preventDefault()}})]}),[h,O]),X=q.useTheme(),[ne,$]=n.useState(!1),U=n.useMemo(()=>e.jsxs(E.Box,{className:"formula-bar",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:L=>L.spacing(.5),alignItems:"start"},children:[ee,e.jsxs(E.Paper,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:L=>L.typography.fontFamily,fontSize:11*A.IFont.getDeviceScale(),alignItems:"stretch",paddingTop:"2px",paddingBottom:"2px",boxShadow:"none",borderRadius:L=>`${L.shape.borderRadius}px`,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,border:L=>`solid ${h?L.palette.action.disabled:q.alpha(L.palette.divider,.2)} 1px`,"& textarea":{color:L=>h?`${L.palette.text.disabled} !important`:L.palette.text.primary},"& .react-resizable-handle":{width:"100%",height:"8px",backgroundColor:"transparent",boxSizing:"content-box",zIndex:1e3},"& .react-resizable-handle-s":{position:"absolute",bottom:"-10px",cursor:"s-resize"}},onFocus:()=>$(!0),onBlur:()=>$(!1),onMouseDown:L=>{L.target?.classList.contains("react-resizable-handle")&&L.preventDefault()},children:[e.jsx(E.Box,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignItems:"center",marginTop:"0px",paddingLeft:L=>L.spacing(1),paddingRight:L=>L.spacing(1)},children:e.jsx(al.ResizableBox,{height:v,draggableOpts:{grid:[j,j]},minConstraints:[j,j],maxConstraints:[15*j,15*j],onResize:P,onResizeStop:B,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:H})}),e.jsx(b.ExhibitIconButton,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,"aria-label":"toggle-expand-formula-edit",icon:e.jsx(w.DynamicIcon,{iconKey:D>1?"ExpandLess":"ExpandMore"}),tooltipProps:{label:(D>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:L=>{L.button===0&&L.preventDefault()},onClick:()=>{const L=D>1?1:M;T(L*j+1),F(L)}}),e.jsx(E.Box,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:ne?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:L=>L.palette.primary.main,borderRadius:L=>`${L.shape.borderRadius}px`}})]})]}),[ee,H,ne,D,j]),Y=n.useMemo(()=>W||U?!W&&U?U:W&&!U?W:e.jsx(e.Fragment,{children:e.jsx(w.SplitPane,{fixedPane:"before",minBefore:"165px",minAfter:"200px",paneBeforeProps:{style:{alignItems:"flex-start"}},paneAfterProps:{style:{overflow:"visible"}},resizerProps:{style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${X.palette.text.icon??X.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center 6.5px",minWidth:"18px"}},elementBefore:W,elementAfter:U})}):null,[W,U]),_=w.useImperativeElement(i,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>I.current}),[]);return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",gap:L=>L.spacing(.5),...o},ref:_,...C,children:Y})}));Qo.displayName="FormulaBar";const Jo=n.memo(n.forwardRef((a,i)=>{const{filter:o,commands:t,disabled:r,sx:s,floatReference:d,...u}=a,l=n.useMemo(()=>({}),[]),c=n.useMemo(()=>({commandHook:{beforeExecute:(x,f)=>d.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:d}),[r,d]),m=n.useMemo(()=>({...l,...c,variant:w.CommandButtonType.Menuitem}),[l,c]),C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:t.getCommand("sortAscending")}),e.jsx(b.CommandButton,{...m,command:t.getCommand("sortDescending")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...m,command:t.getCommand("autoFilterClear")}),[]]});return e.jsx(E.Box,{ref:i,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...s},...u,children:C})}));Jo.displayName="FilterColumnMenu";const cr=n.memo(n.forwardRef((a,i)=>{const{children:o,className:t,disabled:r,style:s,filter:d,...u}=a,l=w.useImperativeElement(i,()=>({isFilters:()=>!0}),[]);return e.jsx("div",{ref:l,className:ie("filters",t),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...s},...u,children:e.jsxs("div",{style:{flex:"1 1 100%",display:"flex",minHeight:"100px",minWidth:"220px",alignItems:"center",border:"grey solid 1px",padding:"4px 4px",overflow:"hidden",flexDirection:"column",justifyContent:"space-evenly",marginTop:"4px",marginBottom:"4px",marginLeft:"16px",marginRight:"16px"},children:[e.jsx("div",{children:d.getName()}),e.jsx("div",{children:"Filter Widget"})]})})}));cr.displayName="Filters";const en=n.memo(n.forwardRef((a,i)=>{const{children:o,sheet:t,style:r,className:s,value:d,index:u,editing:l,editable:c,disabled:m,selectedIndex:C,dragging:x,borderColor:f,borderWidth:p,activeColor:y,background:S="white",tabRadius:h=4,gridTheme:g,...k}=a,[j,v]=n.useState(()=>!!t&&t.getProtection().isLocked()),[T,M]=n.useState(()=>t?t.getTabColor():null);oe.useModelListener(t,{onProtectionChange:()=>{v(t.getProtection().isLocked())},onTabColorChange:()=>{M(t.getTabColor())},onStyleChange:()=>{M(t.getTabColor())}});const R=q.useTheme(),D=C===u;let F=null,B=null;if(T||x){let z=S;T?(B=T.toBlackOrWhite().toCSS(),z=T?.toCSS()):D||(z=R.palette.background.paper),F=e.jsx(E.Box,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:D?"50%":"100%",borderRadius:"4px",border:O=>D?`${S} solid 1px`:`${O.palette.divider} solid 1px`,background:D&&T?`linear-gradient(0deg, ${z} 0%, transparent)`:z}})}let P=null;typeof f=="string"?P=f:f?.toCSS&&(P=f.toCSS());const N=D?e.jsx(E.Box,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:z=>z.palette.primary.main}}):null;return e.jsx(q.ThemeProvider,{theme:D?g??R:R,children:e.jsx(E.Box,{ref:i,className:ie(s),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:D?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:x?"grabbing":void 0},...k,children:e.jsx(w.RoundedTab,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:h,strokeColor:D?P:"transparent",children:e.jsx(E.Button,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:D?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:x?"grabbing":void 0,color:D?"primary":B||"text.secondary",backgroundColor:D?S:"transparent","&:hover:not([disabled])":{backgroundColor:D?S:"transparent"},"& input":{color:z=>`${z.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:m,disableRipple:l,component:"div",children:e.jsxs(e.Fragment,{children:[F,e.jsxs(E.Box,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:D?void 0:"1px"},children:[o,N]}),j?e.jsx(w.DynamicIcon,{iconKey:"Lock",style:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):e.jsx(E.Box,{sx:{minHeight:"22px"}})]})]})},d+":"+u)})})})}));en.displayName="SheetTab";const tn=n.memo(n.forwardRef((a,i)=>{const{workbook:o,index:t,commands:r,scope:s="sheet",disabled:d,floatReference:u,sx:l,className:c,tabStripRef:m,...C}=a,[x,f]=n.useState(o?.getProtection());oe.useModelListener(o,{onProtectionChange:g=>{f(g?.getProtection())}});const p=n.useMemo(()=>({}),[]),y=n.useMemo(()=>({commandHook:{beforeExecute:(g,k)=>u.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:s,commandState:t,disabled:d||t===void 0,parentFloat:u}),[d,u]),S=n.useMemo(()=>({...p,...y}),[p,y]),h=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{command:r.getCommand("addSheet"),commandState:t,...S,variant:w.CommandButtonType.Menuitem}),e.jsx(b.CommandButton,{command:r.getCommand("deleteSheet"),...S,variant:w.CommandButtonType.Menuitem}),e.jsxs(b.ExhibitMenuItem,{onMouseDown:g=>{g.button===0&&g.preventDefault()},onMouseUp:()=>{Promise.resolve(u.closeAll()).then(()=>{m?.startEdit(t)})},disabled:d||!x.isStructureAllowed(),parentFloat:u,children:["Rename",s!=="sheet"?" Sheet":""]}),e.jsx(b.CommandButton,{command:r.getCommand("duplicateSheet"),...S,variant:w.CommandButtonType.Menuitem}),e.jsx(b.CommandButton,{command:r?.getCommand("protectionSheetToggle"),...S,variant:w.CommandButtonType.Menuitem}),e.jsx(ft,{variant:w.CommandButtonType.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:e.jsx(w.DynamicIcon,{iconKey:"stroke.colored"}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:ut.End},parentFloat:u}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{command:r.getCommand("hideSheet"),...S,variant:w.CommandButtonType.Menuitem})]});return e.jsx(E.Box,{ref:i,className:ie("menu",c),sx:{...l},...C,children:h})}));tn.displayName="SheetTabMenu";const on=n.memo(n.forwardRef((a,i)=>{const{workbook:o,gridStyle:t,floatReference:r,closeFloatAll:s,className:d,...u}=a,[l,c]=n.useState(o?.getSheets().getItems()),[m,C]=n.useState(o?.getProtection());oe.useModelListener(o,{onSheetsChange:f=>{c(f.getSheets().getItems())},onProtectionChange:f=>{C(f?.getProtection())}});const x=n.useMemo(()=>{const f=[],p=o.getSheets().getItems({visibility:A.ISheet.Visibility.Hidden}),y=o.getSelectedSheet();for(let S=0;S<p.length;S++){const h=p[S],g=h.getVisibility();if(g===A.ISheet.Visibility.VeryHidden)continue;const k=y===h,j=h.getProtection().isLocked(),v=h.getTabColor(),T=t?.body.fill??"transparent";let M=null,R=null,D=T;v&&(D=v.toCSS(),k||(R=v.toBlackOrWhite().toCSS()),M=e.jsx(E.Box,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:k?D:"transparent",borderRadius:"4px",border:`solid 1px ${t.header.edgeStrokeFill}`},children:e.jsx(E.Box,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:k||g===A.ISheet.Visibility.Hidden?"50%":"100%",border:B=>k?`${T} solid 1.5px`:`${B.palette.divider} solid 1px`,background:k&&v?`linear-gradient(0deg, ${D} 0%, ${T})`:D,borderRadius:"4px"}})}));let F=null;j&&(F=e.jsx(w.DynamicIcon,{iconKey:"Lock"})),g!==A.ISheet.Visibility.Visible&&(F=e.jsx(w.DynamicIcon,{iconKey:"VisibilityOff",style:{opacity:m.isStructureAllowed()?1:.7},color:"secondary"})),F&&(F=e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:F})),f.push(e.jsx(b.ExhibitMenuItem,{disabled:!m.isStructureAllowed()&&g===A.ISheet.Visibility.Hidden,sx:{color:B=>{let P=k?B.palette.primary.main:B.palette.text.secondary;return R&&(P=R),g===A.ISheet.Visibility.Hidden&&(P=Pe.alpha(P,B.palette.action.disabledOpacity)),P},borderLeft:B=>`${k?B.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",paddingTop:"4px",paddingBottom:"4px",fontWeight:k?"700":"400","&:hover":{fontWeight:"700"}},icon:k?e.jsx(b.SelectedIcon,{}):void 0,onMouseDown:B=>B.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{h.select()}catch(B){console.error(B)}})},children:e.jsxs(e.Fragment,{children:[M,e.jsxs(E.Box,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[e.jsxs(E.Box,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[h.getName(),e.jsx(E.Box,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:h.getName()})]}),F]})]})},""+S))}return f},[o,m,l,r,t]);return e.jsx(E.Box,{ref:i,className:ie("menu",d),...u,children:x})}));on.displayName="SheetsAllMenu";let Ut=!1,dr=!1,We=null;const Qn=async a=>{const i=await A.LicenseManager.getDetails();if(dr||i.isEval()){try{const o=top??window;o.SheetXL||(o.SheetXL=Object.freeze({getSelectedWorkbook:()=>We?.getWorkbook(),getSelectedSheet:()=>We?.getWorkbook().getSelectedSheet(),getSelectedRange:()=>We?.getWorkbook().getSelectedRange(),getSelectedRanges:()=>We?.getWorkbook().getSelectedRanges(),getRange:t=>We?.getWorkbook().getRange(t),getSelectedWorkbookElement:()=>We,getLicenseManager:()=>A.LicenseManager,moreExamples:()=>{console.table({"SheetXL.getRange('Sheet1!e5:f6').setValues([[110, 220], [210, 220]])":{Summary:"Set an array of values."},"SheetXL.getRange('a1:e5').setValue(100)":{Summary:"Set a single repeating value to a range."},"SheetXL.getRange('Sheet1!e5:f6').getValues()":{Summary:"Get the values as a 2d array (see forEach)."},"SheetXL.getSelectedRange().setValue(new Date())":{Summary:"Set current date/time using Javascript Date."},"SheetXL.getSelectedRange().setValue('10/23/95')":{Summary:"Set current date/time using string."},"SheetXL.getSelectedSheet().getUsedRange().getValues()":{Summary:"Get all of the values in a sheet."},"SheetXL.getSelectedRange().getStyle().update({ fill: 'accent4' })":{Summary:"Set fill to theme color 4."},"SheetXL.getRange('E:L').getStyle().update({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:"Set some columns to a modified theme color."},"SheetXL.getRange('e5:f10').getStyle().update({ style: { border: 'double blue' }})":{Summary:"Set border."},"SheetXL.getCell().getStyle().fill.toCSS()":{Summary:"Get the fill style as css for the selected cell."},"SheetXL.getRange('a1:a3').autoFill('a1:a7')":{Summary:"Autofill down."},"SheetXL.getRange('e7:i9').merge({ orientation: 'rows' })":{Summary:"Merge cells horizontally."},"SheetXL.getSelectedRange().sort({ ascending: false, hasHeader: false })":{Summary:"Sort selected cells ascending with a header."},"SheetXL.getSelectedRange().clear('all')":{Summary:"Clear the current range a different way."},"SheetXL.getSelectedSheet().getTables().add('b2:e9')":{Summary:"Create a 4x8 table at b2 for current sheet."},"SheetXL.getRange('a1:c3').copyFrom('e1:g3')":{Summary:"Copy cells."},"SheetXL.getRange('c:t').getColumnHeaders().setSize(30)":{Summary:"Set the size of columns to 30 pixels."},"SheetXL.getRange('2:3').delete()":{Summary:"Remove rows 2 and 3 and shift up."},"SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg')":{Summary:"Add an image."},"SheetXL.getSelectedSheet().getMovables().addImage('https://www.sheetxl.com/logo-text.svg', { bounds: { height: 100 } })":{Summary:"Add an image of height 100."},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue(1.50).getStyle().update({ numberFormat: '0%' }).autoFit(); }, 'Enter 150%')":{Summary:"Set value to 100 and numberformat to 0% as a single."},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue('Remind Me Later').getStyle().update({ namedStyle: 'Note'}).autoFit(); }, 'Set Reminder')":{Summary:"Set a value and style to Note style and autofit text."},"SheetXL.getSelectedWorkbook().getNames().addReference('Small_Range', 'A2:E5');":{Summary:"Add a named range."},"SheetXL.getSelectedWorkbook().getRange('a1:e5').addListener((e) => { console.log('got an update for:', e.getSource().toString()) })":{Summary:"Listen for updates at a range."}})}}))}catch(o){o instanceof DOMException||console.error(o),Ut=!0}if(We!==a&&(We=a,!Ut))try{Ut=!0,(top??window).SheetXL&&(await A.LicenseManager._validate(!0),A.LicenseManager.wasPrinted()&&(()=>{je.CommonUtils.consoleWithNoSource(`%cTip: You can access the API directly in the console.
|
|
10
|
+
Try
|
|
11
|
+
%c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
|
|
12
|
+
>%c SheetXL.moreExamples()`,"color:#ffa726;","font-family:monospace;color:#1976d2;font-size:12px;","font-family:monospace;","font-family:monospace;color:#1976d2;font-size:12px;","font-family:monospace;"),Ut=!0;const o=document.getElementById("openEditorLink");o&&o.addEventListener("click",t=>{t.preventDefault(),console.log("openScriptEditor called from console")})})())}catch(o){o instanceof DOMException||console.error(o)}}};function oo(){return oo=Object.assign?Object.assign.bind():function(a){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var t in o)({}).hasOwnProperty.call(o,t)&&(a[t]=o[t])}return a},oo.apply(null,arguments)}function nn(a,i){if(a==null)return{};var o={};for(var t in a)if({}.hasOwnProperty.call(a,t)){if(i.indexOf(t)!==-1)continue;o[t]=a[t]}return o}function no(a,i){return no=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,t){return o.__proto__=t,o},no(a,i)}function mr(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,no(a,i)}function Jn(a,i){return a.replace(new RegExp("(^|\\s)"+i+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const ea=!1,ur=n.createContext(null);var pr=function(a){return a.scrollTop},Ft="unmounted",Xe="exited",Ye="entering",lt="entered",Do="exiting",Le=(function(a){function i(t,r){var s;s=a.call(this,t,r)||this;var d,u=r&&!r.isMounting?t.enter:t.appear;return s.appearStatus=null,t.in?u?(d=Xe,s.appearStatus=Ye):d=lt:d=t.unmountOnExit||t.mountOnEnter?Ft:Xe,s.state={status:d},s.nextCallback=null,s}mr(i,a),i.getDerivedStateFromProps=function(t,r){return t.in&&r.status===Ft?{status:Xe}:null};var o=i.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(t){var r=null;if(t!==this.props){var s=this.state.status;this.props.in?s!==Ye&&s!==lt&&(r=Ye):s!==Ye&&s!==lt||(r=Do)}this.updateStatus(!1,r)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var t,r,s,d=this.props.timeout;return t=r=s=d,d!=null&&typeof d!="number"&&(t=d.exit,r=d.enter,s=d.appear!==void 0?d.appear:r),{exit:t,enter:r,appear:s}},o.updateStatus=function(t,r){if(t===void 0&&(t=!1),r!==null)if(this.cancelNextCallback(),r===Ye){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Je.findDOMNode(this);s&&pr(s)}this.performEnter(t)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Xe&&this.setState({status:Ft})},o.performEnter=function(t){var r=this,s=this.props.enter,d=this.context?this.context.isMounting:t,u=this.props.nodeRef?[d]:[Je.findDOMNode(this),d],l=u[0],c=u[1],m=this.getTimeouts(),C=d?m.appear:m.enter;!t&&!s||ea?this.safeSetState({status:lt},function(){r.props.onEntered(l)}):(this.props.onEnter(l,c),this.safeSetState({status:Ye},function(){r.props.onEntering(l,c),r.onTransitionEnd(C,function(){r.safeSetState({status:lt},function(){r.props.onEntered(l,c)})})}))},o.performExit=function(){var t=this,r=this.props.exit,s=this.getTimeouts(),d=this.props.nodeRef?void 0:Je.findDOMNode(this);r&&!ea?(this.props.onExit(d),this.safeSetState({status:Do},function(){t.props.onExiting(d),t.onTransitionEnd(s.exit,function(){t.safeSetState({status:Xe},function(){t.props.onExited(d)})})})):this.safeSetState({status:Xe},function(){t.props.onExited(d)})},o.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(t,r){r=this.setNextCallback(r),this.setState(t,r)},o.setNextCallback=function(t){var r=this,s=!0;return this.nextCallback=function(d){s&&(s=!1,r.nextCallback=null,t(d))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},o.onTransitionEnd=function(t,r){this.setNextCallback(r);var s=this.props.nodeRef?this.props.nodeRef.current:Je.findDOMNode(this),d=t==null&&!this.props.addEndListener;if(s&&!d){if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],l=u[0],c=u[1];this.props.addEndListener(l,c)}t!=null&&setTimeout(this.nextCallback,t)}else setTimeout(this.nextCallback,0)},o.render=function(){var t=this.state.status;if(t===Ft)return null;var r=this.props,s=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var d=nn(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return n.createElement(ur.Provider,{value:null},typeof s=="function"?s(t,d):n.cloneElement(n.Children.only(s),d))},i})(n.Component);function nt(){}Le.contextType=ur,Le.propTypes={},Le.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:nt,onEntering:nt,onEntered:nt,onExit:nt,onExiting:nt,onExited:nt},Le.UNMOUNTED=Ft,Le.EXITED=Xe,Le.ENTERING=Ye,Le.ENTERED=lt,Le.EXITING=Do;var Co=function(a,i){return a&&i&&i.split(" ").forEach(function(o){return r=o,void((t=a).classList?t.classList.remove(r):typeof t.className=="string"?t.className=Jn(t.className,r):t.setAttribute("class",Jn(t.className&&t.className.baseVal||"",r)));var t,r})},Fo=(function(a){function i(){for(var t,r=arguments.length,s=new Array(r),d=0;d<r;d++)s[d]=arguments[d];return(t=a.call.apply(a,[this].concat(s))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(u,l){var c=t.resolveArguments(u,l),m=c[0],C=c[1];t.removeClasses(m,"exit"),t.addClass(m,C?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(u,l)},t.onEntering=function(u,l){var c=t.resolveArguments(u,l),m=c[0],C=c[1]?"appear":"enter";t.addClass(m,C,"active"),t.props.onEntering&&t.props.onEntering(u,l)},t.onEntered=function(u,l){var c=t.resolveArguments(u,l),m=c[0],C=c[1]?"appear":"enter";t.removeClasses(m,C),t.addClass(m,C,"done"),t.props.onEntered&&t.props.onEntered(u,l)},t.onExit=function(u){var l=t.resolveArguments(u)[0];t.removeClasses(l,"appear"),t.removeClasses(l,"enter"),t.addClass(l,"exit","base"),t.props.onExit&&t.props.onExit(u)},t.onExiting=function(u){var l=t.resolveArguments(u)[0];t.addClass(l,"exit","active"),t.props.onExiting&&t.props.onExiting(u)},t.onExited=function(u){var l=t.resolveArguments(u)[0];t.removeClasses(l,"exit"),t.addClass(l,"exit","done"),t.props.onExited&&t.props.onExited(u)},t.resolveArguments=function(u,l){return t.props.nodeRef?[t.props.nodeRef.current,u]:[u,l]},t.getClassNames=function(u){var l=t.props.classNames,c=typeof l=="string",m=c?(c&&l?l+"-":"")+u:l[u];return{baseClassName:m,activeClassName:c?m+"-active":l[u+"Active"],doneClassName:c?m+"-done":l[u+"Done"]}},t}mr(i,a);var o=i.prototype;return o.addClass=function(t,r,s){var d=this.getClassNames(r)[s+"ClassName"],u=this.getClassNames("enter").doneClassName;r==="appear"&&s==="done"&&u&&(d+=" "+u),s==="active"&&t&&pr(t),d&&(this.appliedClasses[r][s]=d,(function(l,c){l&&c&&c.split(" ").forEach(function(m){return x=m,void((C=l).classList?C.classList.add(x):(function(f,p){return f.classList?!!p&&f.classList.contains(p):(" "+(f.className.baseVal||f.className)+" ").indexOf(" "+p+" ")!==-1})(C,x)||(typeof C.className=="string"?C.className=C.className+" "+x:C.setAttribute("class",(C.className&&C.className.baseVal||"")+" "+x)));var C,x})})(t,d))},o.removeClasses=function(t,r){var s=this.appliedClasses[r],d=s.base,u=s.active,l=s.done;this.appliedClasses[r]={},d&&Co(t,d),u&&Co(t,u),l&&Co(t,l)},o.render=function(){var t=this.props;t.classNames;var r=nn(t,["classNames"]);return n.createElement(Le,oo({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},i})(n.Component);Fo.defaultProps={classNames:""},Fo.propTypes={};const So=.12,Io=(a,i)=>{const o={},t=l=>{const c=l.palette?.background.default??"rgba(255,255,255,1)";return{text:{fontFamily:l.typography?.fontFamily??"Calibri",fontSize:l.typography?.fontSize??8.25,fontWeight:l.typography?.fontWeightRegular??"400",fill:l.palette.mode==="dark"?l.palette?.text?.secondary:l.palette?.text?.primary},fill:c,strokeFill:b.elevateColor(c,So,l.palette?.mode),darkMode:l.palette.mode==="dark"}},r=t(i);o.body=t(a),o.header={...o.body,strokeFill:b.elevateColor(o.body.fill,So,a.palette?.mode),fill:i&&a.palette.mode==="dark"&&i.palette.mode!==a.palette.mode?o.body.fill:b.elevateColor(o.body.fill,.055,a.palette?.mode),edgeStrokeFill:a.palette.mode==="dark"?o.body.strokeFill:b.elevateColor(o.body.fill,.328,a.palette?.mode)},o.headerHover=l=>({...o.header,strokeFill:b.elevateColor(l?.fill??o.body.fill,.22,a.palette?.mode),fill:b.elevateColor(l?.fill??o.header.fill,.065,a.palette?.mode),text:{...l?.text,fontWeight:a.typography?.fontWeightBold}});const s=b.elevateColor(a.palette.mode!=="dark"?a.palette.primary.light:a.palette.primary.main,.055,a.palette?.mode);o.headerSelect={...o.header,strokeFill:a.palette.primary.main,fill:Pe.alpha(s,.2),text:{...o.header.text,fill:a.palette.primary.main},dividerStrokeFill:Pe.alpha(s,.7)},o.headerSelectAll={...o.headerSelect,fill:Pe.alpha(s,.9),text:{...o.headerSelect.text,fill:a.palette.primary.contrastText},edgeStrokeFill:o.headerSelect.strokeFill},o.buttonSurface={...r,strokeFill:b.elevateColor(r.fill,So,i.palette?.mode),fill:i&&i.palette.mode==="dark"&&i.palette.mode!==a.palette.mode?r.fill:b.elevateColor(r.fill,.055,i.palette?.mode),edgeStrokeFill:i.palette.mode==="dark"?r.strokeFill:b.elevateColor(r.fill,.328,i.palette?.mode)},o.headerSelection={fill:a.palette?.primary?.main?Pe.alpha(a.palette?.primary?.main,.1):void 0,strokeFill:a.palette?.primary?.main},o.headerSelectionInactive={...o.headerSelection,fill:a.palette?.divider?Pe.alpha(a.palette?.divider,.05):void 0,strokeFill:"transparent"};const d=i??a,u=d.palette.mode==="dark";return o.selection={fill:d.palette?.primary?.main?Pe.alpha(d.palette?.primary?.main,.1):void 0,strokeFill:d.palette?.primary?.main},o.selectionInactive={...o.selection,fill:d.palette?.divider?Pe.alpha(d.palette?.divider,.05):void 0,strokeFill:"transparent"},o.selectionRemove={...o.selection,fill:Pe.alpha(d.palette.warning.light,.05),strokeFill:d.palette.warning.dark},i&&(o.body=t(i)),o.colorShadow=Pe.alpha(d.palette.action.active,.5),o.colorGrey=d.palette.action.active,o.filterDarkInvert=u?"hue-rotate(180deg) invert(1) brightness(95%)":"none",o},Nt=n.memo(n.forwardRef((a,i)=>{const{children:o,sx:t,parentFloat:r,...s}=a,d=w.useImperativeElement(i,()=>({}),[]),[u,l]=Ve(),c=n.useRef(null),m=n.useRef(null),[C,x]=n.useReducer(v=>v+1,0),[f,p]=n.useState(null),[y,S]=n.useState(null),[h,g]=n.useState(null),{reference:k}=b.useFloatStack({parentFloat:r,label:"overflow"});n.useLayoutEffect(()=>{m.current={refs:[]};const v=[],T=n.Children.toArray(o);let M=0;T.forEach((R,D)=>{v.push(e.jsx(E.Box,{sx:{display:"flex"},ref:F=>{M++,M===T.length&&x();const B={current:null};B.current=F,m.current.refs[D]=B},children:R},D))}),p(v)},[o,l]),n.useLayoutEffect(()=>{if(!f)return;const v=m.current.refs,T=v?v.length:0;if(!d.current||T===0)return S(null),void g(null);const M=d.current?.getBoundingClientRect(),R=[],D=[];let F=0,B=!1;for(let N=0;!B&&N<T;N++){const z=v[N];if(!z)continue;if(!z.current){B=!0;continue}const O=z.current.getBoundingClientRect();F+=O?.width,F>M.width&&(B=!0)}if(!B)return S(null),void g([]);const P=c.current?.getBoundingClientRect();F=0;for(let N=0;N<T;N++){const z=v[N];let O=!1;if(z.current){const H=z.current.getBoundingClientRect();F+=H?.width,F<M.width-P.width&&(O=!0)}O?R.push(f[N]):D.push(f[N])}S(R.length>0?R:null),g(D.length>0?D:null)},[o,f,l,k,C]);const j=w.useCallbackRef(v=>{const T=[],M=h.length;for(let D=0;D<M;D++){const F=n.Children.toArray(h[D])[0];n.Children.toArray(F.props.children?.props?.children??F.props.children).forEach((B,P)=>{const N=B,z={...N.props,key:`overflow-${D}-${P}${N.key??""}`};z.parentFloat&&v&&(z.parentFloat=v.floatReference);const O=n.cloneElement(N,z);T.push(O)})}const R=e.jsx(E.Box,{className:"overflow-palette-popup-panel",sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:D=>D.spacing(.25),paddingTop:D=>D.spacing(.5),paddingBottom:D=>D.spacing(.5),paddingLeft:D=>D.spacing(1),paddingRight:D=>D.spacing(1),overflow:"hidden"},children:T});return b.defaultCreatePopupPanel({...v,children:R})},[h]);return e.jsxs(E.Box,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...t},ref:et([d,u,i]),...s,children:[e.jsx(E.Box,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%",alignItems:"center"},children:y??f}),e.jsx(E.Box,{className:"overflow-palette-popup-button",sx:{display:h!==null&&h.length===0?"none":"flex",flex:"1 1 0"},children:e.jsx(b.ExhibitPopupIconButton,{createPopupPanel:j,ref:c,parentFloat:k,createTooltip:({children:v},T)=>e.jsx(b.ExhibitTooltip,{label:"More",description:"More toolbar options…",disabled:T,children:v}),icon:e.jsx(w.DynamicIcon,{iconKey:"MoreHorizontal"})})})]})})),fr="https://unpkg.com/@sheetxl/scripting-templates/dist",il=a=>{if(a.metadata?.name)return a.metadata.name;let i=(a.path.split("/").pop()||"").replace(/\.[^/.]+$/,"");return a.metadata?.icon==="formula"?i.toUpperCase():(i=i.replace(/([a-z])([A-Z])/g,"$1 $2"),i.replace(/[-_]/g," ").trim().split(/\s+/).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" "))},hr=async a=>{const i=ct.IOUtils.relativePath(a,"./manifest.json"),o=await fetch(i);if(!o.ok)throw new je.ChainedError(`Failed to retrieve directory at '${a}': ${o.statusText}`);const t=await o.text();if(t.trim().toLowerCase().startsWith("<!doctype html")||t.trim().toLowerCase().startsWith("<html"))throw new je.ChainedError(`Failed to retrieve directory at '${a}'`);let r;try{r=JSON.parse(t)}catch(d){throw new Error(`Failed to parse directory: ${d.message}. Ensure the file is valid JSON.`)}const s=r.map(async d=>{try{const u=ct.IOUtils.relativePath(a,d.path),l=await fetch(u);if(!l.ok)throw new Error(`Failed to fetch file at '${d.path}': ${l.statusText}`);const c=await l.text();let m=d.metadata;return m?.title||(m={title:il(d),...m}),{path:d.path,content:c,metadata:m}}catch(u){console.error(u.message)}return null});return(await Promise.all(s)).filter(d=>d!==null)},wo={marginRight:"4px"},ko="1em",ll=n.memo(a=>{const{disabled:i,snippet:o,description:t,handleInsert:r,sx:s,...d}=a;let u;const l=o.metadata?.icon;return u=l==="formula"?e.jsx(w.DynamicIcon,{iconKey:"ScriptFormula",size:ko,style:wo}):l==="macro"?e.jsx(w.DynamicIcon,{iconKey:"ScriptMacro",size:ko,style:wo}):e.jsx(w.DynamicIcon,{iconKey:"ScriptAutoStart",size:ko,style:wo}),e.jsx(b.ExhibitMenuItem,{sx:{maxWidth:"460px",display:"flex","*":{lineHeight:"1.2"},...s},disabled:i,icon:u,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(o)},onKeyDown:c=>{c.keyCode!==w.KeyCodes.Enter&&c.keyCode!==w.KeyCodes.Space||r(o)},...d,children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[e.jsx(E.Typography,{component:"div",children:o.metadata?.title??o.path}),e.jsx(E.Typography,{variant:"caption",component:"div",sx:{color:c=>Pe.alpha(c.palette.text.secondary??c.palette.text.primary,.6),overflow:"hidden",textOverflow:"ellipsis"},children:o.metadata?.summary})]})})}),sl=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,scriptPath:d=fr,...u}=a,[l,c]=n.useState([]),[m,C]=n.useState(!0),x=w.useCommands(o,["executeSelectedScript"]),f=x[0]?.context?.();n.useEffect(()=>{(async()=>{try{const y=await hr(d);c(y)}catch{}finally{C(!1)}})()},[d]);const p=n.useCallback((y,S)=>{if(m)return e.jsx("div",{children:"Loading..."});const h={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"scripts",disabled:s},g=v=>{f.getEditor()?.insertSnippet(v.content),y.closeFloat()},k=[];for(let v=0;v<l.length;v++){const T=l[v];T&&k.push(e.jsx(ll,{handleInsert:g,snippet:T},T.path))}const j=e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[k.length>0?e.jsxs(e.Fragment,{children:[e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:k}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"})]}):null,n.createElement(b.CommandButton,{...h,key:"help",command:o.getCommand("help")})]});return b.defaultCreatePopupPanel({...y,children:j})},[s,t,r,m,f]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,disabled:s,commandHook:t,scope:r,label:"Insert Script",tooltip:"Inserts a script from a set of templates.",createPopupPanel:p,icon:"ScriptInsert",...u})})),gr=n.memo(n.forwardRef((a,i)=>{const{commands:o,parentFloat:t,commandButtonProps:r,...s}=a,d=w.useCallbackRef(u=>{const{commandButtonProps:l,commandPopupProps:c}=u;return e.jsx(e.Fragment,{children:e.jsxs("div",{style:{display:"flex",flex:"1 1 100%"},children:[e.jsx("div",{children:e.jsx(Nt,{parentFloat:t,style:{},children:e.jsx(b.CommandButton,{...l,command:o?.getCommand("saveScripts")})})}),e.jsx("div",{style:{flex:"1 1 100%"}}),e.jsx("div",{children:e.jsx(Nt,{parentFloat:t,style:{},children:e.jsx(sl,{...l,commands:o})})})]})})},[o]);return e.jsx(b.CommandToolbar,{ref:i,commands:o,parentFloat:t,commandButtonProps:r,createToolbarPalette:d,...s})}));gr.displayName="ScriptEditorToolbar";const xr=n.memo(n.forwardRef((a,i)=>{const{scriptPath:o=fr,onScriptSelect:t,sx:r=w.ReactUtils.EmptyCssProperties,className:s,buttonMinWidth:d=210,buttonMinHeight:u=80,gap:l=12,...c}=a,[m,C]=n.useState([]),[x,f]=n.useState(!0),[p,y]=n.useState(null);if(n.useEffect(()=>{(async()=>{const g=[{path:null,metadata:{title:"Blank Template...",summary:"Start with an empty script."},content:""}];try{f(!0),y(null);const k=await hr(o);for(let j=0;j<k.length;j++){const v=k[j];v&&g.push(v)}}catch(k){y(k instanceof Error?k.message:"Failed to load scripts"),k instanceof je.ChainedError||console.error("Error loading scripts:",k)}finally{C(g),f(!1)}})()},[o]),x)return e.jsx(E.Box,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",className:ie(s,"script-select"),sx:{background:g=>g.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,...r},...c,children:e.jsx(E.CircularProgress,{})});let S=null;p&&(S=e.jsxs(E.Box,{display:"flex",justifyContent:"center",alignItems:"center",className:ie(s,"script-select","error-results"),sx:{background:g=>g.palette.error.light,flex:"0",zIndex:1e3,flexDirection:"column",padding:g=>g.spacing(1),border:g=>`1px solid ${g.palette.error.main}`,borderBottomLeftRadius:1,borderBottomRightRadius:1,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},...c,children:[e.jsx(E.Typography,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),e.jsx(E.Typography,{color:"error",component:"div",children:p})]}));const h=g=>{const k=g.metadata?.icon;return k==="macro"?e.jsx(w.DynamicIcon,{iconKey:"ScriptMacro",size:"1em"}):k==="formula"?e.jsx(w.DynamicIcon,{iconKey:"ScriptFormula",size:"1em"}):k==="autostart"?e.jsx(w.DynamicIcon,{iconKey:"ScriptAutoStart",size:"1em"}):null};return e.jsxs(E.Box,{ref:i,className:ie(s,"script-select"),sx:{background:g=>g.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,...r},...c,children:[e.jsxs(E.Box,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[e.jsx(E.Typography,{variant:"h6",gutterBottom:!0,children:"Script Template"}),e.jsx(E.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Choose from a template to provide a starting point to automate tasks or create user defined functions."}),e.jsx(E.Typography,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),e.jsx(E.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${d}px, 1fr))`,gap:`${l}px`,padding:2,paddingLeft:"0px",paddingRight:"0px"},children:m.map((g,k)=>e.jsxs(E.Button,{variant:"outlined",sx:{minWidth:d,minHeight:u,display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"left",padding:2,textTransform:"none",overflow:"hidden",...k===0&&{borderStyle:"dashed",marginBottom:"8px"},...k===1&&{gridColumn:"1"}},onClick:()=>t?.(g),children:[e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[e.jsx(E.Typography,{variant:"subtitle2",component:"div",children:g.metadata?.title||g.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),h(g)]}),g.metadata?.summary&&e.jsx(E.Typography,{variant:"body2",component:"div",color:"text.secondary",sx:{overflow:"hidden",display:"flex",flexDirection:"column",textOverflow:"ellipsis",alignItems:"flex-start"},children:g.metadata.summary})]},`${g.path}-${k}`))})]}),S]})}));xr.displayName="TemplateSelectPanel";const br=n.memo(n.forwardRef((a,i)=>{const{className:o,sx:t,editorProps:r,commands:s,readOnly:d=!1,frame:u,autoFocusSel:l,autoFocus:c=!0,scripts:m,...C}=a,x=q.useTheme(),[f,p]=n.useState(!1),y=n.useRef(!1),[S,h]=n.useState({message:"Loading",cursor:"",dirty:!1}),[g,k]=n.useState(null);n.useEffect(()=>{let H=!1;return k(null),(async function(){if(m&&(await m.start(),!H)){const I=m.getModules().getItems()[0]?.getSource();k({source:I||null})}})(),()=>{H=!0}},[m]);const j=n.useCallback(H=>{h(I=>({...I,...H}))},[]),v=n.useRef(null),[T,M]=n.useState(null),R=n.useRef(null),D=w.useCallbackRef(H=>{if(T)return T.focus(H),!0;if(l){const I=v.current?.querySelectorAll?.(l);if(I&&I.length>0)return I[0]?.focus?.(H),!0}return v.current?.focus?.(H),!1},[T,l,c]),F=n.useMemo(()=>e.jsx(b.LoadingPanel,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),B=n.useMemo(()=>e.jsx(E.Paper,{elevation:1,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,marginLeft:H=>H.spacing(.5),marginRight:H=>H.spacing(.5),marginTop:H=>H.spacing(1),marginBottom:H=>H.spacing(1)},children:e.jsx(gr,{commands:s})}),[x,s]),P=n.useMemo(()=>e.jsx(E.Box,{className:ie("script-status-panel","status-panel"),sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",margin:0,borderTop:`solid 1px ${x.palette.divider}`},children:e.jsxs("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"center"},children:[e.jsx(E.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:H=>H.palette.text.secondary},variant:"caption",children:S.message}),e.jsx(E.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:H=>H.palette.text.secondary},variant:"caption",children:S.dirty?"Unsaved":""}),e.jsx(E.Typography,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:H=>H.palette.text.secondary},variant:"caption",children:S.cursor})]})}),[S]),N=n.useMemo(()=>e.jsxs(E.Box,{className:ie("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[B,e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:e.jsx(oe.ScriptEditor,{ref:v,loadingPanel:F,readOnly:d,frame:u,autoFocus:c,commands:s,onStatusChange:j,darkMode:x.palette.mode==="dark",...r})}),P]}),[x,s,B,P,f,F,d,r,c,l,u,j]),z=n.useMemo(()=>{let H;return g===null?null:(g.source===null&&(H=e.jsx(xr,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:I=>{v.current?.getEditor()?.insertSnippet(I.content),k({source:I.content??""})}})),e.jsx(E.Box,{tabIndex:0,className:ie("script-workspace",o),sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",alignItems:"stretch",userSelect:"none",flexGrow:0,outline:"none"},onPointerDown:I=>{I.isDefaultPrevented()||v.current?.focus()},children:e.jsxs(E.Box,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[N,H]})}))},[B,N,o,g]),O=w.useImperativeElement(i,()=>({isScriptWorkspaceElement:()=>!0,focus:H=>{D(H)}}),[]);return e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...t},ref:O,...C,onFocus:H=>{p(!0),y.current=!0,O.current?.contains(H.target)&&H.target!==O.current&&M(H.target),H.relatedTarget&&!R.current&&(R.current=H.relatedTarget),C?.onFocus?.(H)},onBlur:H=>{O?.current?.contains(H.relatedTarget)||O?.current===H.relatedTarget||(R.current=null,y.current=!1,p(!1)),C?.onBlur?.(H)},children:z})}));br.displayName="ScriptWorkspace";const cl=(a,i)=>{const{model:o,commands:t,entryKey:r,frame:s,...d}=a;return e.jsx(br,{ref:i,readOnly:!1,commands:t,frame:s,scripts:o?.getScripts(),...d})},yr=n.memo(n.forwardRef((a,i)=>{const{commands:o,...t}=a,r=w.useCommands(o,["executeScript","showScriptEditor"]),[s,d]=n.useState([]),[u,l]=n.useState(!1),c=r[0]?.context?.();n.useEffect(()=>{const p=c?.getScripts();p&&(async()=>{l(!0);const y=await p.searchFunctions({type:"macro"});d(y),l(!1)})()},[]);const m={variant:w.CommandButtonType.Menuitem,parentFloat:a.floatReference,scope:"scripts",shortcut:null},C=[],x=s.length;for(let p=0;p<x;p++){const y=s[p];C.push(e.jsx(b.CommandButton,{...m,command:o.getCommand("executeScript"),commandState:{declaration:y},tooltipProps:{description:`Execute ${y.getName()??"macro"}`},icon:e.jsx(w.DynamicIcon,{iconKey:"ScriptMacro"}),label:y.getName()??`Script '${y.getName()}'`},`macro-${y.getName()}-${p}`))}const f=e.jsxs(E.Box,{ref:i,sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[C.length>0?e.jsxs(e.Fragment,{children:[e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:C}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"})]}):null,n.createElement(b.CommandButton,{...m,key:"show-editor",command:o.getCommand("showScriptEditor")})]});return b.defaultCreatePopupPanel({...t,children:f})}));yr.displayName="RunScriptPopupPanel";const Cr=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u="showScriptEditor",l=w.useCommands(o,["executeScript","showScriptEditor"])[0].context(),c=n.useCallback((m,C)=>{const x=e.jsx(yr,{...m,commands:C});return b.defaultCreatePopupPanel({...m,children:x})},[s,l,t,r]);return e.jsx(b.CommandPopupButton,{ref:i,commands:o,commandHook:t,createPopupPanel:c,selected:o.getCommand(u).state(),label:"Macros",tooltip:"Run or manage macros.",quickCommand:u,...d})})),dl=a=>e.jsx(b.CommandButton,{...a}),Sr=n.memo(n.forwardRef((a,i)=>{const{commands:o,parentFloat:t,commandButtonProps:r,...s}=a,[d,u]=n.useState(!1),l=w.useCommands(o,["executeScript","showScriptEditor"]),c=l[0]?.context?.();n.useEffect(()=>{const x=c?.getScripts();if(!x)return;const f=l[1],p=async()=>{if(!f)return;let h=!1;if(!f.state()){const g=await x.searchFunctions({type:"macro"}),k=g?.length??0;for(let j=0;g&&!h&&j<k;j++)h=!0}u(h||!!f.state())};p();const y=f.addPropertyListener(()=>{p()}),S=x.addListeners({onChange:()=>{p()}});return()=>{S(),y()}},[c]);const m=oe.useTaskPaneArea(),C=n.useCallback(x=>{const{commandButtonProps:f,commandPopupProps:p}=x,y=oe.DefaultTaskPaneRegistry.findContributions("ribbon/home");let S;const h=y.length;if(h>0){S=[];for(let M=0;M<h;M++){const R=y[M],D=R.createCommand?.(m);if(!D)continue;const F={command:D,...p},B=(R.createCommandButton??dl)(F);S.push(B)}}const g=e.jsx(ft,{...p,command:o.getCommand("formatFontColor"),isSplit:!0,panelProps:{disableAlpha:!0}}),k=e.jsx(ft,{...p,command:o.getCommand("formatFillColor"),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:ut.End}}),j=o.getCommand("undo")?e.jsx(e.Fragment,{children:e.jsx(Vo,{...p,quickCommand:"undo"})}):null,v=o.getCommand("find")?e.jsx(e.Fragment,{children:e.jsx(Oa,{...p})}):null;let T=null;return d&&(T=e.jsxs(e.Fragment,{children:[e.jsx(b.ExhibitDivider,{}),e.jsx(Cr,{...p})]})),e.jsxs(Nt,{parentFloat:t,children:[j,null,j?e.jsx(b.ExhibitDivider,{}):null,e.jsx(_o,{...p,command:o.getCommand("paste")}),e.jsx(b.CommandButton,{...f,command:o.getCommand("formatPainterToggle")}),e.jsx(so,{...f,command:o.getCommand("copy")}),e.jsx(b.ExhibitDivider,{}),e.jsx($a,{...p,command:o.getCommand("formatFontFamily")}),e.jsx(Aa,{...p,command:o.getCommand("formatFontSize")}),e.jsx(b.CommandButton,{...f,command:o.getCommand("formatBoldToggle")}),e.jsx(b.CommandButton,{...f,command:o.getCommand("formatItalicToggle")}),e.jsx(_a,{...p}),e.jsx(Va,{...p}),e.jsx(Fa,{...p}),k,g,e.jsx(b.ExhibitDivider,{}),e.jsx(va,{...p}),e.jsx(ja,{...p}),e.jsx(Ba,{...p}),e.jsx(Ta,{...p}),e.jsx(Ia,{...p}),e.jsx(b.ExhibitDivider,{}),e.jsx(La,{...p}),e.jsx(b.ExhibitDivider,{}),e.jsx(Ga,{command:o.getCommand("formatCellStyle"),...p}),e.jsx(cn,{command:o.getCommand("formatTableStyle"),...p}),e.jsx(b.ExhibitDivider,{}),e.jsx(zo,{...p}),e.jsx(Ho,{...p}),e.jsx(Wo,{...p}),e.jsx(b.ExhibitDivider,{}),e.jsx(mn,{...p}),e.jsx(za,{...p}),e.jsx(Lo,{...p}),e.jsx($o,{...p}),v,T,S]})},[o,l,d,m]);return e.jsx(b.CommandToolbar,{ref:i,commands:o,parentFloat:t,commandButtonProps:r,createToolbarPalette:C,...s})}));Sr.displayName="HomeToolbar";const wr=n.memo(n.forwardRef((a,i)=>{const{commands:o,parentFloat:t,commandButtonProps:r,...s}=a,d=w.useCallbackRef(u=>{const{commandButtonProps:l,commandPopupProps:c}=u;return e.jsxs(Nt,{parentFloat:t,children:[e.jsx(b.CommandButton,{...l,command:o.getCommand("insertTable")}),e.jsx(dn,{...c}),null,e.jsx(b.CommandButton,{...l,command:o.getCommand("updateHyperlink")}),e.jsx(b.CommandButton,{...l,command:o.getCommand("updateComments")})]})},[o]);return e.jsx(b.CommandToolbar,{ref:i,commands:o,parentFloat:t,commandButtonProps:r,createToolbarPalette:d,...s})}));wr.displayName="InsertToolbar";const kr=n.memo(n.forwardRef((a,i)=>{const{commands:o,parentFloat:t,commandButtonProps:r,...s}=a,d=w.useCallbackRef(u=>{const{commandButtonProps:l,commandPopupProps:c}=u;return e.jsxs(Nt,{parentFloat:t,children:[e.jsx(Na,{...c}),e.jsx(b.CommandButton,{...l,command:o.getCommand("protectionSheetToggle")}),e.jsx(b.ExhibitDivider,{}),e.jsx(Ha,{...c}),e.jsx(Ka,{...c}),e.jsx(b.ExhibitDivider,{}),e.jsx(b.CommandButton,{...l,command:o.getCommand("sheetViewToggleFormulaView"),scope:"view"}),e.jsx(b.CommandButton,{...l,command:o.getCommand("sheetViewToggleShowZeros"),scope:"view"}),e.jsx(b.ExhibitDivider,{}),e.jsx(Ua,{...c}),e.jsx(Dr,{command:o.getCommand("selectTheme"),...c}),e.jsx(b.ExhibitDivider,{}),e.jsx(Cr,{...c,scope:"view"}),e.jsx(b.ExhibitDivider,{}),e.jsx(b.CommandButton,{...l,command:o.getCommand("fullScreenToggle"),scope:"view"})]})},[o]);return e.jsx(b.CommandToolbar,{ref:i,commands:o,parentFloat:t,commandButtonProps:r,createToolbarPalette:d,...s})}));kr.displayName="ViewToolbar";const vr=a=>e.jsx(jr,{...a}),ml=n.memo(a=>{const{sx:i,...o}=a;return e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:t=>`${q.alpha(t.palette.primary.main,.35)} solid 2px`}},children:[e.jsx(E.Tab,{disableRipple:!0,onMouseDown:t=>{t.button===0&&t.preventDefault()},sx:{textTransform:"none",flex:"1 1 100%",fontWeight:t=>t.typography.fontWeightRegular,padding:"2px 6px",minHeight:"0px",minWidth:"0px",marginRight:t=>t.spacing(.5),"&.Mui-selected":{},"&.Mui-focusVisible":{},...i},...o}),e.jsx(E.Box,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),ul=n.memo(a=>{const{toolbars:i,value:o,onToolbarChange:t,sx:r,...s}=a,d=n.useMemo(()=>{const u=[];for(let l=0;l<i.length;l++)u.push(e.jsx(ml,{label:i[l].label},i[l].label));return u},[i]);return e.jsx(E.Tabs,{value:o,onChange:(u,l)=>{t?.(l)},variant:"scrollable",scrollButtons:!1,sx:{paddingLeft:u=>u.spacing(1.5),paddingRight:u=>u.spacing(1.5),paddingTop:u=>u.spacing(0),paddingBottom:u=>u.spacing(0),minHeight:"26px",alignItems:"center","& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{width:"90%",borderRadius:"4px",minWidth:"4px",backgroundColor:u=>u.palette.primary.main},"& .MuiTab-root":{marginRight:"0px"},...r},slotProps:{indicator:{children:e.jsx("span",{className:"MuiTabs-indicatorSpan"})}},...s,children:d})}),pl=n.memo(a=>{const{toolbars:i,value:o,onToolbarChange:t,selectProps:r,...s}=a,d=n.useCallback(l=>{t?.(l.target.value)},[t]),u=n.useMemo(()=>{const l=[];for(let c=0;c<i.length;c++){const m=i[c].label;l.push(e.jsx(E.MenuItem,{value:c,sx:{color:C=>{if(o===c)return C.palette.primary.main}},children:m},m))}return l},[i,o]);return e.jsx(E.FormControl,{sx:{minWidth:"125px",maxWidth:"125px","& .MuiInputBase-root":{paddingLeft:"0px",paddingRight:"0px"},"& .MuiSelect-select":{paddingTop:l=>l.spacing(.5),paddingBottom:l=>l.spacing(.5),paddingLeft:l=>l.spacing(2),color:l=>l.palette.primary.main},"& .MuiSelect-icon":{fill:l=>l.palette.text.icon??l.palette.action.active,"&:hover:not(.Mui-disabled)":{color:l=>l.palette.text.icon??l.palette.action.active}},...r},size:"small",children:e.jsx(E.Select,{value:o,onChange:d,variant:"outlined",sx:{backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`},...s,children:u})})}),jr=n.memo(n.forwardRef((a,i)=>{const{commands:o,selectWrapper:t,selectProps:r={},renderCompact:s=!1,paletteWrapper:d,toolbarsProps:u,paletteProps:l={},workbook:c,sx:m,...C}=a,x=n.useMemo(()=>{const v=[],{ref:T,...M}=u?.Home||{};v.push({label:"Home",component:e.jsx(Sr,{commands:o,...M})});const{ref:R,...D}=u?.Insert||{};v.push({label:"Insert",component:e.jsx(wr,{commands:o,...D})});const{ref:F,...B}=u?.View||{};return v.push({label:"View",component:e.jsx(kr,{commands:o,...B})}),v},[o,c]),f=n.useMemo(()=>{const v=[];for(let T=0;T<x.length;T++)v.push(n.cloneElement(x[T].component,{...x[T].component.props,key:x[T].key??x[T].label}));return v},[x]),[p,y]=n.useState(0),S=v=>{y(v)},h=n.useMemo(()=>s?e.jsx(pl,{toolbars:x,value:p,onToolbarChange:S,sx:r}):e.jsx(ul,{toolbars:x,value:p,onToolbarChange:S,sx:r}),[x,p,r,s]),{sx:g,...k}=l,j=e.jsx(E.Paper,{elevation:2,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,borderRadius:"8px",backgroundImage:`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`,marginLeft:v=>v.spacing(1),marginRight:v=>v.spacing(1),marginTop:v=>v.spacing(.5),marginBottom:v=>v.spacing(.5),...g},...k,children:f[p]});return e.jsxs(E.Box,{ref:i,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:v=>v.spacing(.5),"*":{userSelect:"none"},...m},...C,children:[t?t(h):h,d?d(j):j]})}));var ta,oa;jr.displayName="WorkbookToolbars",(function(){if(oa)return ta;oa=1;var a=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,t=/^0o[0-7]+$/i,r=parseInt,s=typeof dt=="object"&&dt&&dt.Object===Object&&dt,d=typeof self=="object"&&self&&self.Object===Object&&self,u=s||d||Function("return this")(),l=Object.prototype.toString,c=Math.max,m=Math.min,C=function(){return u.Date.now()};function x(p){var y=typeof p;return!!p&&(y=="object"||y=="function")}function f(p){if(typeof p=="number")return p;if((function(h){return typeof h=="symbol"||(function(g){return!!g&&typeof g=="object"})(h)&&l.call(h)=="[object Symbol]"})(p))return NaN;if(x(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=x(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=p.replace(a,"");var S=o.test(p);return S||t.test(p)?r(p.slice(2),S?2:8):i.test(p)?NaN:+p}ta=function(p,y,S){var h,g,k,j,v,T,M=0,R=!1,D=!1,F=!0;if(typeof p!="function")throw new TypeError("Expected a function");function B(H){var I=h,W=g;return h=g=void 0,M=H,j=p.apply(W,I)}function P(H){var I=H-T;return T===void 0||I>=y||I<0||D&&H-M>=k}function N(){var H=C();if(P(H))return z(H);v=setTimeout(N,(function(I){var W=y-(I-T);return D?m(W,k-(I-M)):W})(H))}function z(H){return v=void 0,F&&h?B(H):(h=g=void 0,j)}function O(){var H=C(),I=P(H);if(h=arguments,g=this,T=H,I){if(v===void 0)return(function(W){return M=W,v=setTimeout(N,y),R?B(W):j})(T);if(D)return v=setTimeout(N,y),B(T)}return v===void 0&&(v=setTimeout(N,y)),j}return y=f(y)||0,x(S)&&(R=!!S.leading,k=(D="maxWait"in S)?c(f(S.maxWait)||0,y):k,F="trailing"in S?!!S.trailing:F),O.cancel=function(){v!==void 0&&clearTimeout(v),M=0,h=T=g=v=void 0},O.flush=function(){return v===void 0?j:z(C())},O}})();var na,aa,ra={exports:{}},vo={};aa||(aa=1,ra.exports=(function(){if(na)return vo;na=1;var a=n,i=typeof Object.is=="function"?Object.is:function(l,c){return l===c&&(l!==0||1/l==1/c)||l!=l&&c!=c},o=a.useState,t=a.useEffect,r=a.useLayoutEffect,s=a.useDebugValue;function d(l){var c=l.getSnapshot;l=l.value;try{var m=c();return!i(l,m)}catch{return!0}}var u=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(l,c){return c()}:function(l,c){var m=c(),C=o({inst:{value:m,getSnapshot:c}}),x=C[0].inst,f=C[1];return r(function(){x.value=m,x.getSnapshot=c,d(x)&&f({inst:x})},[l,m,c]),t(function(){return d(x)&&f({inst:x}),l(function(){d(x)&&f({inst:x})})},[l]),s(m),m};return vo.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:u,vo})()),ra.exports;var ia,la,Bt={exports:{}},st={exports:{}},fl=st.exports;(function(){if(la)return Bt.exports;la=1;for(var a=(ia||(ia=1,function(){var C,x,f,p,y,S;typeof performance<"u"&&performance!==null&&performance.now?st.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(st.exports=function(){return(C()-y)/1e6},x=process.hrtime,p=(C=function(){var h;return 1e9*(h=x())[0]+h[1]})(),S=1e9*process.uptime(),y=p-S):Date.now?(st.exports=function(){return Date.now()-f},f=Date.now()):(st.exports=function(){return new Date().getTime()-f},f=new Date().getTime())}.call(fl)),st.exports),i=typeof window>"u"?dt:window,o=["moz","webkit"],t="AnimationFrame",r=i["request"+t],s=i["cancel"+t]||i["cancelRequest"+t],d=0;!r&&d<o.length;d++)r=i[o[d]+"Request"+t],s=i[o[d]+"Cancel"+t]||i[o[d]+"CancelRequest"+t];if(!r||!s){var u=0,l=0,c=[],m=1e3/60;r=function(C){if(c.length===0){var x=a(),f=Math.max(0,m-(x-u));u=f+x,setTimeout(function(){var p=c.slice(0);c.length=0;for(var y=0;y<p.length;y++)if(!p[y].cancelled)try{p[y].callback(u)}catch(S){setTimeout(function(){throw S},0)}},Math.round(f))}return c.push({handle:++l,callback:C,cancelled:!1}),l},s=function(C){for(var x=0;x<c.length;x++)c[x].handle===C&&(c[x].cancelled=!0)}}Bt.exports=function(C){return r.call(i,C)},Bt.exports.cancel=function(){s.apply(i,arguments)},Bt.exports.polyfill=function(C){C||(C=i),C.requestAnimationFrame=r,C.cancelAnimationFrame=s},Bt.exports})();var Ie={DOM_UNAVAILABLE_ERROR:"DOM is unavailable server-side. Please use this method client-side only.",FULLSCREEN_UNSUPPORTED_ERROR:"Your browser does not support Fullscreen API.",getEventsNames(){if(typeof document>"u")return null;const a=document;return"exitFullscreen"in a?["fullscreenchange","fullscreenerror"]:"webkitExitFullscreen"in a||"webkitCancelFullScreen"in a?["webkitfullscreenchange","webkitfullscreenerror"]:"mozCancelFullScreen"in a?["mozfullscreenchange","mozfullscreenerror"]:"msExitFullscreen"in a?["MSFullscreenChange","MSFullscreenError"]:null},getEventName(a){const i=this.getEventsNames();return i?a==="change"?i[0]:i[1]:null},get fullscreenEnabled(){if(typeof document>"u")return!1;const a=document;return a.fullscreenEnabled||a.webkitFullscreenEnabled||!!a.webkitCancelFullScreen||a.mozFullScreenEnabled||a.msFullscreenEnabled||!1},get fullscreenElement(){if(typeof document>"u")return null;const a=document;return a.fullscreenElement||a.webkitFullscreenElement||a.webkitCurrentFullScreenElement||a.mozFullScreenElement||a.msFullscreenElement||null},requestFullscreen(a,i){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const o=a??document.documentElement,t=o.requestFullscreen||o.webkitRequestFullscreen||o.webkitRequestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen;if(!t)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return t.call(o,i)},exitFullscreen(){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const a=document,i=a.exitFullscreen||a.webkitExitFullscreen||a.webkitCancelFullScreen||a.mozCancelFullScreen||a.msExitFullscreen;if(!i)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return i.call(a)},on(a,i){const o=this.getEventName(a);o&&document.addEventListener(o,i)},off(a,i){const o=this.getEventName(a);o&&document.removeEventListener(o,i)}};const Tr=a=>{const{workbook:i,workbookElement:o,target:t,commands:r,darkMode:s,onNewWorkbook:d=Br}=a,u=w.useNotifier(),[l,c]=n.useState(i?.getSelectedSheet()),[m,C]=n.useState(i?.getSheets().getItems()),x=w.useCallbackRef(d,[d]),f=oe.useTaskPaneArea(),p=n.useMemo(()=>[new w.SimpleCommand("activateTask",t,{label:"Activate Task",description:"Activate Task Pane.",shortcut:{key:"F6"}}),new w.SimpleCommand("workbookStatistics",t,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Shift]}}),new w.SimpleCommand("workbookStatistics",t,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Shift]}}),new w.SimpleCommand("showFormat",t,{label:"Show Format",description:"Open the format pane.",shortcut:{key:"F",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Shift]}}),new w.Command("newCellStyle",t,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later.",icon:"NewPresetStyles"}),new w.Command("deleteCellStyle",t,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new w.Command("modifyCellStyle",t,{label:"Modify Cell Style",scopedLabels:{cellStyle:"Modify"},description:"Update a style with the currently style."}),new w.SimpleCommand("find",t,{label:"Find",description:"Open the Find window.",icon:"Find",shortcut:[{key:"F",modifiers:[w.KeyModifiers.Ctrl]},{key:"F5",modifiers:[w.KeyModifiers.Shift]}]}),new w.SimpleCommand("findReplace",t,{label:"Find & Replace",description:"Open the Find & Replace window.",icon:"FindReplace",shortcut:[{key:"H",modifiers:[w.KeyModifiers.Ctrl]},{key:"H",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Alt]}]}),new w.SimpleCommand("goto",t,{label:"Go To",description:"Open the 'Go To' window.",icon:"GoTo",shortcut:[{key:"G",modifiers:[w.KeyModifiers.Ctrl]}]}),new w.SimpleCommand("workbookViewToggleExpandFormulaBar",t,{label:"Toggle Expand Formula bar",description:"Expand or collapse the formula bar.",shortcut:{key:"U",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Shift]}}),new w.SimpleCommand("workbookViewToggleShowFormulaBar",t,{label:"View Formula bar",scopedLabels:{view:"Formula Bar"},description:"Show or hide the formula bar."}),new w.SimpleCommand("workbookViewToggleShowTabs",t,{label:"View Sheet Tabs",description:"Show or hide the sheet tabs.",scopedLabels:{view:"Sheet Tabs"}}),new w.SimpleCommand("workbookViewToggleShowStatusBar",t,{label:"View Status Bar",description:"Show or hide the status bar.",scopedLabels:{view:"Status Bar"}}),new w.SimpleCommand("workbookViewToggleShowHorizontalScrollBar",t,{label:"View Horizontal Scrollbar",description:"Show or hide the horizontal scrollbar.",scopedLabels:{view:"Horizontal Scrollbar"}}),new w.SimpleCommand("workbookViewToggleShowVerticalScrollBar",t,{label:"View Vertical Scrollbar",description:"Show or hide the vertical scrollbar.",scopedLabels:{view:"Vertical Scrollbar"}}),new w.Command("hideSheet",t,{label:"Hide Sheet",scopedLabels:{sheet:"Hide"},description:"Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.",icon:"VisibilityOff"}),new w.Command("deleteSheet",t,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new w.Command("addSheet",t,{label:"Insert Sheet",scopedLabels:{sheet:"Insert"},description:"Insert sheet before the current sheet.",shortcut:[{key:"F11",modifiers:[w.KeyModifiers.Shift]},{key:"F1",modifiers:[w.KeyModifiers.Alt,w.KeyModifiers.Shift]}]}),new w.Command("duplicateSheet",t,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new w.Command("nextSheet",t,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[w.KeyModifiers.Ctrl]}]}),new w.Command("previousSheet",t,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[w.KeyModifiers.Ctrl]}]}),new w.Command("selectNextSheet",t,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Shift]}]}),new w.Command("selectPreviousSheet",t,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Shift]}]}),new w.Command("selectTheme",t,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new w.Command("selectNamed",t,{label:B=>B?.getName()??"Select Named Item",scopedLabels:{namedItem:B=>B?.getName()??"Select"},description:"Select the item."}),new w.Command("addNamedReference",t,{label:"Define Named Reference",scopedLabels:{namedItem:"Define Name…"},description:"Add a new named reference. Names can be used as a substitute for cell references.",icon:"InsertNamedRange"}),new w.Command("editNamedReference",t,{label:"Edit Named Reference…",scopedLabels:{namedItem:"Edit…"},description:"Add a new named reference. Names can be used as a substitute for cell references.",icon:"NamedRangeEdit"}),new w.Command("deleteNamedReference",t,{label:"Delete Named Reference",scopedLabels:{namedItem:"Delete"},description:"Remove the named reference.",icon:"DeleteNamedRange"}),new w.SimpleCommand("activeNameBox",t,{label:"Activate Name Box",description:"Move the focus to the name box.",shortcut:{key:"F3",modifiers:[w.KeyModifiers.Alt]}}),new w.SimpleCommand("createNamedReferenceFromSelection",t,{label:"Create from Selection",description:"Automatically generate names from the selected cells.",shortcut:{key:"F3",modifiers:[w.KeyModifiers.Ctrl,w.KeyModifiers.Shift]}}),new w.SimpleCommand("activeNameManager",t,{label:"Activate Name Manager",description:`Create, edit, delete, and find all the names used in the workbook.
|
|
13
|
+
|
|
14
|
+
Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modifiers:[w.KeyModifiers.Ctrl]}}),new w.Command("fullScreenToggle",t,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"},icon:"FullScreen"}),new w.Command("showScriptEditor",t,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",icon:"ScriptRun",shortcut:[{key:"F11",modifiers:[w.KeyModifiers.Alt]}]}),new w.Command("executeScript",t,{label:"Run Script",description:"Run the selected or last executed script.",icon:"ScriptRun",shortcut:{key:"F8"}}),new w.Command("executeSelectedScript",t,{label:"Run Script",description:"Run the selected script.",icon:"ScriptRun",shortcut:{key:"F8"}}),new w.Command("saveScripts",t,{label:"Save Script",description:"Save the current scripts.",icon:"ScriptSave"}),new w.Command("maximumWorkbookToggle",t,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[w.KeyModifiers.Ctrl]}}),new w.Command("spellCheck",t,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new w.Command("calculateAll",t,{label:"Calculate Now",description:"Recalculate all formulas.",icon:"Calculate",shortcut:{key:"F9"}}),new w.SimpleCommand("closeWorkbook",t,{label:"Close Workbook",description:"Close the workbook.",shortcut:{key:"W",modifiers:[w.KeyModifiers.Ctrl]}}),new w.SimpleCommand("newWorkbook",t,{label:"New Workbook",description:"Create a new workbook in another tab.",icon:"FileNew"})],[]),y=n.useMemo(()=>{let B=null;return B=r?r.createChildGroup(t,"workbook",!1):new w.CommandGroup(t,"workbook"),B.addCommands(p,!0),B},[r,p]),S=w.useEditMode(),h=n.useRef(null),g=w.useCallbackRef(()=>{let B,P=null;const N=y.getCommand("executeScript");if(N.update({disabled:!1,context:{getScripts:()=>i.getScripts()}}),!N)return;const z=y.getCommand("showScriptEditor");z.updateCallback(function(I=!0){P?P.close():f.activateTaskPane("scriptEditor",{})});const O=y.getCommand("executeSelectedScript");if(!O)return;const H={saveSource:async I=>{let W=null,ee=null;const X=i.getScripts();try{I&&(ee=await u.showBusy("Saving Scripts..."),W=await X.createModule({source:I})),X.addModule("scripts",W,{replace:!0}),ee?.()}catch(ne){ee?.(),console.warn("Unable to compile",ne),u.showError(ne)}return W},addContainerListener:I=>(k.current=I,()=>{k.current=null}),setSelectedFunction:I=>{B=I??h.current??null,Promise.resolve(B).then(W=>{O.update({disabled:W===null})})},quickInsertFunction:I=>{const W=`=${I.toUpperCase()}(`,ee={text:W+")",editMode:!0,initialSelection:{start:W.length,end:W.length+0}};S.setMode(X=>X?.key==="edit"?{...X,args:{...X.args}}:{key:"edit",args:{stateAndCoords:null,start:ee}})},getSelectedFunction:()=>B,setEditor:I=>{P=I??null,z.update({state:P!==null})},getEditor:()=>P,getRanges:I=>{try{return i.getRanges(I)}catch{}return null},getScripts:()=>i.getScripts()};O.update({context:H})},[y,i,o,u]),k=n.useRef(null);oe.useModelListener(i,{onBeforeSave:async()=>{await k.current?.onBeforeSave()},onProtectionChange:()=>{k.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await i.getCalculation().start(),i.getScripts().start(),k.current?.onScriptChange()))()}}),oe.useModelListener(i,{onSheetsChange:B=>{C(B.getSheets().getItems())},onViewChange(B){c(B?.getSelectedSheet())},onProtectionChange:B=>{const P={disabled:!B.getProtection().isStructureAllowed()};y.getCommand("hideSheet").update(P),y.getCommand("deleteSheet").update(P),y.getCommand("addSheet").update(P),y.getCommand("duplicateSheet").update(P),y.getCommand("selectTheme").update(P),y.getCommand("addNamedReference").update(P),y.getCommand("editNamedReference").update(P),y.getCommand("deleteNamedReference").update(P)},onScriptsChange:B=>{g()}});const{isFullscreenAvailable:j,isFullscreenEnabled:v,toggleFullscreen:T}=(function(B={}){const{target:P,onChange:N,onError:z,requestFullScreenOptions:O}=B,[H,I]=n.useState(!1),[W,ee]=n.useState(null),[X,ne]=n.useState(!1),$=n.useCallback(()=>Ie.requestFullscreen(P?.current||null,O),[P,O]),U=n.useCallback(()=>Ie.exitFullscreen(),[]),Y=n.useCallback(()=>Ie.fullscreenElement?U():$(),[$,U]),_=n.useCallback(G=>{const Q=Ie.fullscreenElement;ee(Q),ne(!!Q),N?.(G)},[N]),L=n.useCallback(G=>{const Q=Ie.fullscreenElement;ee(Q),ne(!!Q),z?.(G)},[z]);return n.useEffect(()=>{I(Ie.fullscreenEnabled)},[]),n.useEffect(()=>(Ie.on("change",_),Ie.on("error",L),()=>{Ie.off("change",_),Ie.off("error",L)}),[_,L]),{isFullscreenAvailable:H,fullscreenElement:W,isFullscreenEnabled:X,enableFullscreen:$,disableFullscreen:U,toggleFullscreen:Y}})({target:{current:o??document.body}}),M=oe.useDocThemes();n.useEffect(()=>{y.getCommand("selectTheme").update({state:()=>i.getTheme(),context:()=>({theme:i.getTheme(),themes:M,darkMode:s})})},[i?.getTheme(),s]);const R=w.useCallbackRef(async function(B,P){let N=null;const z=i.getScripts();if(B?.declaration||B?.functionName){const O=B.declaration?B.declaration.getName():B.functionName;(await z.searchFunctions({name:O})).length>0&&(N=O)}if(N)try{await z.executeMacro(N),h.current=Promise.resolve({source:null,name:N})}catch(O){return void u.showError(O)}},[i,u]);n.useEffect(()=>{y.getCommand("newCellStyle").updateCallback(B=>{u.showInput({initialValue:(()=>{let P=0;for(;;){P++;const N=`Style ${P}`;try{return i.getStyles().validateStyleName(N,!0),N}catch{}}})(),title:y.getCommand("newCellStyle")?.label("cellStyle"),description:"Enter a name for the new cell style.",inputLabel:"Style Name",inputProps:{style:{minWidth:"300px"}},options:["Ok","Cancel"],defaultOption:"Ok",onValidateInput:async(P,N)=>{let z=null;try{i.getStyles().validateStyleName(P,!1)}catch(I){z=I.message}let O=i.getStyles().getNamed(P),H=z;return!H&&O&&(H=`Update style '${O.getName()}'.`),{valid:z===null,message:H}}}).then(({input:P,option:N})=>{const z=i.getSelectedSheet().getSelectedRange();if(N!=="Ok")return;const O=i.getStyles().setNamed({name:P,style:z.getCell().getStyle()});z.getStyle().update({named:O.getName()})})}),y.getCommand("deleteCellStyle").updateCallback(B=>{B.delete()}),y.getCommand("modifyCellStyle").updateCallback(({named:B})=>{const P=i.getSelectedSheet().getSelectedRange();i.getStyles().setNamed({name:B.getName(),style:P.getCell().getStyle()})}),y.getCommand("hideSheet").updateCallback(B=>{i.getSheetAt(B).setVisibility(A.ISheet.Visibility.Hidden)}),y.getCommand("deleteSheet").updateCallback(async B=>{i.getSheetAt(B??i.getSelectedSheetIndex())?.delete()}),y.getCommand("addSheet").updateCallback(B=>{i.getSheets().add({index:B,autoSelect:!0})}),y.getCommand("duplicateSheet").updateCallback(async B=>{(await i.getSheetAt(B??i.getSelectedSheetIndex())?.duplicate())?.select()}),y.getCommand("nextSheet").updateCallback(B=>{i.getNextSheet(B??i.getSelectedSheetIndex()).select()}),y.getCommand("previousSheet").updateCallback(B=>{i.getPreviousSheet(B??i.getSelectedSheetIndex()).select()}),y.getCommand("selectNextSheet").updateCallback(B=>{i.getNextSheet(B??i.getSelectedSheetIndex()).select()}),y.getCommand("selectPreviousSheet").updateCallback(B=>{i.getPreviousSheet(B??i.getSelectedSheetIndex()).select()}),y.getCommand("selectTheme").updateCallback(B=>{i.setTheme(B)}),y.getCommand("calculateAll").updateCallback(()=>{i.getSelectedSheet().getEntireRange().calculate(!0)}),y.getCommand("closeWorkbook").updateCallback(async()=>{await u.showOptions({title:"Confirm",description:"This will close the current workbook tab. Do you want to continue?",options:["Close","Cancel"],defaultOption:"Close"})==="Close"&&window.close()}),y.getCommand("newWorkbook").updateCallback(()=>{x?.()}),y.getCommand("executeScript").updateCallback(R),y.getCommand("executeSelectedScript").updateCallback(R)},[i,u]);const D=w.useCallbackRef(async B=>{let P=0,N=null,z="Find & Replace";B?.replace&&!B?.replaceOptions?.maxCount&&(z="Replace All");const O=await u.showBusy(z);try{const H=B?.scope??"sheet";let I=null;const W=i.getSelectedSheet(),ee={from:W.getSelectedCell(),...B.findOptions};if(I=H==="sheet"?i.getSelectedSheet().find(ee):i.find(ee),B.replace){const X=i.replace(I,B.replaceText,B.replaceOptions);P=X.count,B.replaceOptions.maxCount&&(N=X.last)}else{let X=I.next();X.done||(P++,N=X.value)}N?.select({autoFocus:!1}),O?.(),!B.replaceOptions.maxCount&&P>1&&u.showMessage(`We replaced ${P} cells.`)}catch(H){O?.(),u.showError(H)}return P},[i,o]),F=w.useCallbackRef(B=>{const P={selection:()=>{const z=i.getSelectedRanges(),O=z.getCount(),H=new Array(O);for(let I=0;I<O;I++){const W=z.at(I).getFixed(!0).getCoords();H[I]=W}return i.getRanges(H)},getNames:()=>i.getNames()},N={initialValue:B,context:()=>P,onInput:async z=>{try{await z.select()}catch(O){u.showMessage(O.message,{type:w.NotifierType.Error})}}};return u.showWindow("namedDetails",N)},[u,i,o]);return n.useEffect(()=>{const B=(P=!1)=>{const N={initialValue:{findOptions:{text:i.getSelectedCell().toTextUnformatted(!0)},replace:P},context:()=>D,onKeyDown:z=>{y.findCommandByEvent(z)!==y.getCommand("find")&&y.findCommandByEvent(z)!==y.getCommand("findReplace")||z.preventDefault()},autoFocus:!0,disableAutoDestroy:!0};u.showWindow("find",N)};y.getCommand("find")?.update({disabled:!u.showWindow}).updateCallback(()=>{B()}),y.getCommand("findReplace")?.update({disabled:!u.showWindow}).updateCallback(()=>{B(!0)}),y.getCommand("activateTask")?.update({disabled:!u}).updateCallback(()=>{const P={onInput:async N=>{try{f.activateTaskPane(N)}catch(z){u.showError(z.message)}},title:y.getCommand("activateTask")?.label(),inputLabel:"Task Name",options:["Activate"]};u.showInput(P)}),y.getCommand("goto")?.update({disabled:!u}).updateCallback(()=>{const P={onInput:async N=>{try{await i.getRanges(N).select()}catch(z){u.showMessage(z.message,{type:w.NotifierType.Error})}},title:y.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};u.showInput(P)}),y.getCommand("selectNamed")?.update({disabled:!u}).updateCallback(async P=>{if(P)try{await P.select()}catch(N){u.showError(N)}}),y.getCommand("addNamedReference")?.updateCallback(async function(P){F(null)}),y.getCommand("editNamedReference")?.updateCallback(async function(P){F(P)}),y.getCommand("deleteNamedReference")?.updateCallback(async function(P){P?.delete?.()}),y.getCommand("activeNameBox")?.updateCallback(async function(){o?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[o,i,u]),oe.useModelListener(i?.getView(),{onViewChange:B=>{y.getCommand("workbookViewToggleShowFormulaBar").update({state:B.isShowFormulaBar()}).updateCallback(()=>{B.setShowFormulaBar(!B.isShowFormulaBar())}),y.getCommand("workbookViewToggleShowTabs").update({state:B.isShowTabs()}).updateCallback(()=>{B.setShowTabs(!B.isShowTabs())}),y.getCommand("workbookViewToggleShowStatusBar").update({state:B.isShowStatusBar()}).updateCallback(()=>{B.setShowStatusBar(!B.isShowStatusBar())}),y.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:B.isShowHorizontalScrollbar()}).updateCallback(()=>{B.setShowHorizontalScrollbar(!B.isShowHorizontalScrollbar())}),y.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:B.isShowVerticalScrollbar()}).updateCallback(()=>{B.setShowVerticalScrollbar(!B.isShowVerticalScrollbar())})}}),n.useEffect(()=>{y.getCommand("fullScreenToggle").update({state:v,disabled:!j,icon:v?"FullScreenOff":"FullScreen"}).updateCallback(()=>{T()})},[v,j]),n.useEffect(()=>{const B=i.getProtection().isStructureAllowed();y.getCommand("hideSheet").update({disabled:m.length<=1||!B}),y.getCommand("deleteSheet").update({disabled:m.length<=1||!B})},[m,l]),y},Br=()=>{window.open(window.origin.toString(),"sheetxl-"+A.CommonUtils.uuidV4(),"popup=true")},hl="_sheetxl-theme_4opcr_2",gl="_sheetxl-workbook_g5t6x_5",xl=a=>e.jsx(tn,{...a}),bl=a=>e.jsx(on,{...a}),yl=a=>e.jsx(en,{...a}),an=n.memo(n.forwardRef((a,i)=>{const{workbook:o,commands:t,onBeforeUserChange:r,onUserChange:s,disabled:d=!1,readOnly:u=!1,contextMenuProps:l,renderContextMenu:c=xl,sheetsAllProps:m,renderSheetsAll:C=bl,sheetTabProps:x,renderSheetTab:f,background:p="transparent",className:y,sx:S,borderWidth:h,borderColor:g,gridTheme:k,gridStyle:j,...v}=a,[T,M]=n.useState(o?.getSelectedSheetIndex()),[R,D]=n.useState(o?.getSheets().getItems()),[F,B]=n.useState(o?.getProtection());oe.useModelListener(o,{onViewChange(J){M(J?.getSelectedSheetIndex())},onSheetsChange:J=>{D(J.getSheets().getItems())},onProtectionChange:J=>{B(J?.getProtection())}});const P=u||!F.isStructureAllowed(),N=n.useMemo(()=>{const J=[];for(let K=0;K<R.length;K++)J.push(R[K].getName());return J},[R]),z=n.useCallback(J=>{r?.(J)!==!1&&(o.getSheetAt(J).select(),s?.(J))},[o,r,s]),O=n.useCallback((J,K)=>{o.getSheetAt(J).setName(K),s?.(J)},[o,s]),H=n.useCallback((J,K)=>{o.getSheetAt(J).setPosition(K),s?.(K)},[o,s]),I=w.useCallbackRef(()=>{if(r?.(T)===!1)return;const J=T+1;o.getSheets().add({name:void 0,autoSelect:!0}),s?.(J)},[o,r,s,T]),W=n.useMemo(()=>({placement:"top-start"}),[]),ee=n.useRef(null),[X,ne]=n.useState(!1),$=n.useCallback(J=>{const{closeFloatAll:K,floatReference:te}=J;return C({workbook:o,gridStyle:j,floatReference:te,closeFloatAll:K,...m})},[C,m,d,o,j]),{reference:U,component:Y}=b.useFloatStack({label:"allSheet",popperProps:W,anchor:ee.current,onOpen:()=>ne(!0),onClose:()=>ne(!1),createPopupPanel:$}),_=n.useRef(null),[L,G]=n.useState(null),Q=n.useCallback(J=>{const{floatReference:K}=J;return c?.({workbook:o,index:L?.index,tabStripRef:_.current,commands:t,disabled:d,floatReference:K,...l})},[c,l,d,o,t,L]),{reference:fe,component:re}=b.useFloatStack({label:"sheetTab",popperProps:W,anchor:{getBoundingClientRect:()=>new DOMRect(L?.left||0,L?.top||0,0,0)},onClose:()=>G(null),createPopupPanel:Q});n.useEffect(()=>{L?fe.open(0):fe.close(0)},[L]);const ue=n.useCallback((J,K)=>{J.preventDefault(),G({left:J.clientX-2,top:J.clientY-4,index:K})},[]),Se=w.useCallbackRef(J=>{let K;try{K=o?.getSheetAt(J.index)}catch{}return K?(f??yl)({sheet:K,gridTheme:k,onContextMenu:te=>{z(J.index),ue(te,J.index)},...J,...x}):null},[f,x,o,k]),Ce=n.useMemo(()=>P?null:e.jsx(b.SimpleTooltip,{disableInteractive:!0,title:"New sheet",children:e.jsx(E.IconButton,{disabled:d,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:J=>J.palette.primary.main},color:J=>J.palette.text.icon??J.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:J=>{J.button===0&&J.preventDefault()},onClick:()=>I(),children:e.jsx(w.DynamicIcon,{iconKey:"AddCircle"})})}),[d,P,I]);return e.jsxs(E.Box,{ref:i,className:ie(y),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...S},...v,children:[e.jsx(oe.TabStrip,{ref:_,selectedTabIndex:T,tabNames:N,onSelectedTabIndexChange:z,onTabNameChange:O,onTabMove:H,background:p,borderColor:g,borderWidth:h,activeColor:null,disabled:d,disableDrag:P,createScrollStartButton:b.createScrollStartButton,createScrollEndButton:b.createScrollEndButton,createScrollEdgeButton:b.createScrollEdgeButton,createTabButton:Se,createTabDivider:J=>{const{key:K,...te}=J;return e.jsx(b.ExhibitDivider,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:de=>q.alpha(de.palette.divider,.25)},...te},K)},editLabelProps:{readOnly:P,maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:J=>{o.isValidSheetNameCharacter(J.key)||J.preventDefault()},onCancel:()=>{s?.(T)}},children:e.jsx(b.SimpleTooltip,{disableInteractive:!0,title:X?"":"List all sheets",children:e.jsx(b.ExhibitIconButton,{sx:{padding:"0px",ml:.5,mr:0,mt:0,mb:0,"& svg":{transform:"scale(0.8, 1)"},color:J=>J.palette.text.icon??J.palette.action.active},ref:ee,dense:!0,outlined:!1,selected:X,color:"primary","aria-label":"menu",onMouseDown:J=>{J.button===0&&J.preventDefault()},onClick:()=>{X?U.close(0):U.open(0)},icon:e.jsx(w.DynamicIcon,{iconKey:"Menu"})})})}),e.jsx("div",{style:{borderTop:`solid ${g} ${h}px`,minWidth:"4px"}}),e.jsx("div",{style:{borderTop:`solid ${g} ${h}px`,flex:"none",display:"flex",alignItems:"center"},children:Ce}),e.jsx("div",{style:{borderTop:`solid ${g} ${h}px`,flex:1,minWidth:"24px"}}),re,Y]})}));an.displayName="WorkbookStrip";const rn=n.memo(n.forwardRef((a,i)=>{const{workbook:o,commands:t,disabled:r,sx:s,floatReference:d,className:u,...l}=a,[c,m]=n.useReducer(P=>P+1,0),[C,x]=n.useState(o.getSelectedSheet()),[f,p]=n.useState(C.getSelectedRanges()),[y,S]=n.useState(C.getSelectedCell());oe.useModelListener(o,{onSheetsChange(){x(o.getSelectedSheet())}}),oe.useModelListener(C.getSelection(),{onChange(){p(C.getSelectedRanges()),S(C.getSelectedCell())}}),w.useCommands(t,[],{onChange:()=>{m()}});const h=n.useMemo(()=>({}),[]),g=n.useMemo(()=>({commandHook:{beforeExecute:(P,N)=>d.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:d}),[r,d]),k=n.useMemo(()=>({...h,...g,variant:w.CommandButtonType.Menuitem}),[h,g]),j=n.useMemo(()=>({commands:t,variant:w.CommandButtonType.Menuitem,parentFloat:d,...g}),[t,g,d]),v=[];let T=f.isEntireRows(),M=f.isEntireColumns();f&&(T&&(v.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal"},"context:"+v.length)),v.push(n.createElement(b.CommandButton,{command:t.getCommand("hideColumns"),...k,key:"context:"+v.length})),v.push(n.createElement(b.CommandButton,{command:t.getCommand("unhideColumns"),...k,key:"context:"+v.length}))),M&&(v.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal"},"context:"+v.length)),v.push(n.createElement(b.CommandButton,{command:t.getCommand("hideRows"),...k,key:"context:"+v.length})),v.push(n.createElement(b.CommandButton,{command:t.getCommand("unhideRows"),...k,key:"context:"+v.length}))),(T||M)&&v.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal"},"context:"+v.length)),T&&(v.push(n.createElement(b.CommandButton,{command:t.getCommand("autoFitColumns"),...k,key:"context:"+v.length})),v.push(n.createElement(b.CommandButton,{...k,command:t.getCommand("resizeColumns"),key:"context:"+v.length}))),M&&(v.push(n.createElement(b.CommandButton,{command:t.getCommand("autoFitRows"),...k,key:"context:"+v.length})),v.push(n.createElement(b.CommandButton,{...k,command:t.getCommand("resizeRows"),key:"context:"+v.length}))));const R=[],D=t.getCommand("formatTableStyle"),F=D?.context()?.table();if(w.useCommand(D),!T&&!M){if(R.push(e.jsx(b.ExhibitDivider,{orientation:"horizontal"},"contextBefore:"+R.length)),y?.getHyperlink())R.push(n.createElement(b.SimpleCommandPopupButton,{...j,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+R.length,quickCommand:"openHyperlink"}));else{const P=t.getCommand("updateHyperlink");R.push(n.createElement(b.CommandButton,{command:P,...k,key:"contextBefore:"+R.length}))}if(y?.getComments())R.push(n.createElement(b.SimpleCommandPopupButton,{...j,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+R.length,quickCommand:"updateComments"}));else{const P=t.getCommand("updateComments");R.push(n.createElement(b.CommandButton,{command:P,...k,key:"contextBefore:"+R.length}))}F?R.push(n.createElement(b.SimpleCommandPopupButton,{...j,variant:w.CommandButtonType.Menuitem,key:"contextBefore:"+R.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:F,quickCommand:"editTable"})):R.push(n.createElement(b.CommandButton,{command:t.getCommand("insertTable"),...k,key:"context:"+v.length})),R.push(n.createElement(dn,{...j,key:"contextBefore:"+R.length}))}const B=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{command:t.getCommand("cut"),...k}),e.jsx(so,{command:t.getCommand("copy"),...k}),e.jsx(_o,{command:t.getCommand("paste"),...j,includePasteAllInPopup:!1}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx($o,{...j}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(zo,{commands:t,...j,disableSheet:!0}),e.jsx(Ho,{commands:t,...j,disableSheet:!0}),e.jsx(Lo,{...j}),R,v]});return e.jsx(E.Box,{ref:i,className:ie("menu",u),sx:{...s},...l,children:B})}));rn.displayName="WorkbookContextMenu";const so=n.memo(n.forwardRef((a,i)=>{const{command:o,...t}=a,r=w.useEditMode(),[s,d]=n.useState(!1),[u,l]=n.useState("info");return n.useEffect(()=>{const c=r.getMode();d(c?.key==="copy"||c?.key==="cut"),l(c?.key==="cut"?"warn":"accent")},[r]),e.jsx(b.CommandButton,{ref:i,command:o,icon:e.jsx(w.DynamicIcon,{iconKey:"copy.walking",sourceProps:{isWalking:s,themedType:u}}),...t})})),Er=n.memo(n.forwardRef((a,i)=>{const{movable:o,commands:t,disabled:r,sx:s,floatReference:d,...u}=a;oe.useModelListener(o,{onAnyChange(f){}});const l=n.useMemo(()=>({}),[]),c=n.useMemo(()=>({commandHook:{beforeExecute:(f,p)=>d.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:d}),[r,d]),m=n.useMemo(()=>({variant:w.CommandButtonType.Menuitem,...l,...c}),[l,c]),C=n.useMemo(()=>({commands:t,variant:w.CommandButtonType.Menuitem,parentFloat:d,...c}),[t,c,d]),x=e.jsxs(e.Fragment,{children:[e.jsx(so,{command:t.getCommand("copy"),...m,variant:w.CommandButtonType.Menuitem}),[],e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.SimpleCommandPopupButton,{...C,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront"}),e.jsx(b.SimpleCommandPopupButton,{...C,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack"}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...m,command:t.getCommand("toggleLockAspectRatio")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.SimpleCommandPopupButton,{...C,popupCommandKeys:["formatDrawAlignLeft","formatDrawAlignCenter","formatDrawAlignRight",null,"formatDrawAlignTop","formatDrawAlignMiddle","formatDrawAlignBottom",null,"formatDrawDistributeHorz","formatDrawDistributeVert"],label:"Align",icon:"DrawAlignLeft",tooltip:"Quickly change the placement of your drawings."}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.SimpleCommandPopupButton,{...C,popupCommandKeys:["formatAnchorTypeTwoCell","formatAnchorTypeOneCell","formatAnchorTypeAbsolute"],label:"Sizing",icon:"DrawResize",tooltip:"Determine how the drawing size will adjust as the cell sizes adjust."}),[]]});return e.jsx(E.Box,{ref:i,sx:{paddingTop:"4px",paddingBottom:"4px",...s},...u,children:x})}));Er.displayName="MovableContextMenu";const Cl=a=>e.jsx(Er,{...a}),Sl=a=>e.jsx(rn,{...a}),wl=a=>e.jsx(Jo,{...a}),kl=(a,i)=>e.jsx(Qo,{ref:i,...a}),vl=a=>e.jsx(b.LoadingPanel,{...a}),jl=(a,i)=>e.jsx(oe.SheetElement,{ref:i,...a}),Tl=a=>e.jsx(Xo,{...a}),Bl=a=>e.jsx(an,{...a}),El={fireOnModelChange:!1},sa={flex:"1 1 100%",display:"flex",boxSizing:"border-box"},ln=n.memo(n.forwardRef((a,i)=>{const{workbook:o,createWorkbookOptions:t,onNewWorkbook:r,onElementLoad:s,autoFocus:d=!1,sx:u,style:l,className:c,onFocus:m,onBlur:C,onKeyDown:x,onRepeatCommandChange:f,commands:p,showFormulaBar:y,formulaBarProps:S,renderFormulaBar:h=kl,showTabs:g,tabsProps:k,renderTabs:j=Bl,showStatusBar:v,statusBarProps:T,renderStatusBar:M=Tl,toolbarProps:R,renderToolbar:D=vr,contextMenuSx:F,renderContextMenu:B=Sl,renderFilterMenu:P=wl,renderMovableMenu:N=Cl,renderLoadingPanel:z=vl,loadingPanelProps:O,sheetProps:H,renderSheet:I=jl,mainWrapper:W,showHorizontalScrollbar:ee,showVerticalScrollbar:X,gridTheme:ne,headersTheme:$,enableDarkImages:U,...Y}=a,_=q.useTheme(),L=oe.useDocThemes(),G=n.useMemo(()=>{const V={theme:L.getDefaultTheme(),...t};return o??new A.Workbook(V)},[o]),Q=n.useRef(null),[fe,re]=n.useState(!1),ue=n.useRef(null),Se=n.useMemo(()=>e.jsx(E.Box,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:ue}),[]),[Ce,J]=n.useState(!1),[K,te]=n.useState(!1),de=n.useCallback(()=>{J(!0)},[]),ve=n.useRef(null),se=w.useImperativeElement(i,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>G,getSheetElement:()=>Q.current,getViewportElement:()=>ue.current,getFormulaBarElement:()=>ve.current,focus(){Q&&Q.current&&Q.current.focus()}}),[G]),De=n.useRef(null);n.useLayoutEffect(()=>{!Ce||!se.current||(async()=>(De.current!==s&&(await s?.({source:se.current}),De.current=s),te(!0)))()},[Ce,se.current]),Qn(se.current);const Te=n.useCallback(V=>(Q.current?.submitEdit(),!0),[]),Ne=n.useCallback(()=>{requestAnimationFrame(()=>{Q?.current?.focus()})},[]),[me,Z]=n.useState(G?.getSelectedSheet()),[le,Ke]=n.useState(G?.getProtection());oe.useModelListener(G,{onSheetsChange:V=>{Z(V?.getSelectedSheet())},onViewChange(V){Z(V?.getSelectedSheet())},onProtectionChange:V=>{Ke(V?.getProtection())}}),oe.useModelListener(G,{onRequestSelect:async(V,ae)=>new Promise(he=>{Q.current.getSheet()!==ae?Q.current.getGridElement()?.onViewChangeOnce(()=>{Q.current.getSheet()!==ae&&he(!1),he(!0)}):he(!0)})},El);const[ni,ht]=n.useReducer(V=>V+1,0),tt=G?.getView();oe.useModelListener(tt,{onViewChange:V=>{ht()}});const gt=ne??_,we=n.useMemo(()=>Io(_,gt),[_,gt]),hn=$??_,ai=n.useMemo(()=>Io(_,hn),[_,hn]),[gn,ri]=n.useState(null);n.useCallback(()=>{Q.current.focus()},[]);const pe=Tr({workbook:G,workbookElement:se.current,target:()=>Q.current,commands:p,darkMode:we.body.darkMode,onNewWorkbook:r}),xt=n.useRef(null),[mo,xn]=n.useState(!1),[bn,yn]=n.useState(null),[Cn,ii]=n.useState(w.ToolTipPlacement.Top),[bt,li]=n.useState(A.TypesUtils.EmptyBounds),uo=n.useCallback(()=>{xn(!1),yn(null)},[]),yt=n.useCallback((V,ae,he=w.ToolTipPlacement.Top)=>{li(V),ii(he),yn(ae),xt.current!==null&&setTimeout(()=>{xt.current!==null&&xt.current.update()},160),xn(!0)},[]),[ps,Sn]=n.useState("sheet"),Ue=g??tt?.isShowTabs(),qe=ee??tt?.isShowHorizontalScrollbar(),si=y??tt?.isShowFormulaBar(),zt=v??tt?.isShowStatusBar(),wn=X??tt?.isShowVerticalScrollbar(),ot=we?.header?.edgeStrokeFill||"rgb(171,171,171)",ci=n.useMemo(()=>zt?M({sheet:me,gridStyle:we,...T}):null,[M,T,zt,we,me]),di=n.useMemo(()=>D({commands:pe,workbook:se.current,...R}),[pe,D,R,_]),[mi,{width:po}]=Ve(),Ge=po===0||po>560,fo=n.useMemo(()=>{if(!Ue)return null;let V=j({background:we.body.fill,borderWidth:1,borderColor:ot,gridTheme:gt,gridStyle:we,onBeforeUserChange:Te,onUserChange:Ne,workbook:G,commands:pe,sheetTabProps:{},...k});return Ge||(V=e.jsx("div",{style:{flex:"none",display:"flex"},children:V})),V},[j,k,_,G,gt,Ge,pe,Ue]),kn=n.useCallback(V=>{const{style:ae,...he}=V;let be=null,Be=null,ye=null;if(qe&&(Be=e.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${ot} 1px`,flexDirection:"column",justifyContent:"center"},children:e.jsx(oe.SheetScrollbar,{...he,style:{paddingLeft:"4px",paddingRight:"4px",...ae},endGap:700,sheet:me,onShowTooltip:ke=>{yt({x:ke.anchor.x,y:ke.anchor.y,width:0,height:0},ke.display,ke.placement)},onCloseTooltip:()=>uo()})})),Ue&&Ge&&(ye=fo),Ue&&Ge&&!qe&&(ye=e.jsxs(E.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[ye,e.jsx(E.Box,{sx:{borderTop:`solid ${ot} 1px`,flex:"1"}})]})),ye&&qe)be=e.jsx(w.SplitPane,{position:G.getView().getTabRatio()/10+"%",onPositionChange:({percent:ke})=>{G.getView().setTabRatio(Math.round(10*ke))},minBefore:"200px",minAfter:"180px",resizerProps:{style:{minWidth:"11px",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${_.palette.text.icon??_.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center",borderTop:`solid ${ot} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:ye,elementAfter:Be});else if(qe)be=Be;else{if(!ye)return e.jsx(E.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:zt?null:`solid ${ot} 1px`}});be=ye}return e.jsx(E.Box,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:be})},[me,Te,G,we,gt,pe,Ue,qe,zt,Ge]),[Re,Ct]=n.useState(null),ui=n.useMemo(()=>({placement:"right-start",...Re?.popperProps}),[Re?.popperProps]),{reference:vn,component:pi}=b.useFloatStack({label:"contextMenu",popperProps:ui,anchor:Re?.anchor??{getBoundingClientRect:()=>new DOMRect(Re?.clientX||0,Re?.clientY||0)},onClose:()=>Ct(null),createPopupPanel:Re?.createPopupPanel});n.useEffect(()=>{Re?vn.open(0):vn.close(0)},[Re]);const fi=w.useCallbackRef((V,ae)=>{if(V?.isDefaultPrevented())return!0;V.preventDefault(),Re&&Re.anchor===V.currentTarget?Ct(null):Ct({anchor:V.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:he=>{const{floatReference:be}=he;return P({filter:ae,commands:pe,floatReference:be,sx:{...F}})}})},[P,F,pe,G,Re]),jn=w.useCallbackRef(V=>{if(V.originalEvent?.isDefaultPrevented())return!0;V.originalEvent?.preventDefault(),Ct({clientX:V.clientX,clientY:V.clientY,createPopupPanel:ae=>{const{floatReference:he}=ae;return B({commands:pe,workbook:G,floatReference:he,sx:{...F}})}})},[B,F,pe,G]),hi=w.useCallbackRef((V,ae)=>{if(V?.isDefaultPrevented())return!0;V.preventDefault(),Ct({clientX:V.clientX,clientY:V.clientY,createPopupPanel:he=>{const{floatReference:be}=he;return N({movable:ae,commands:pe,floatReference:be,sx:{...F}})}})},[N,F,pe]);n.useMemo(()=>{const V=[new w.SimpleCommand("openContextMenu",()=>Q.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[w.KeyModifiers.Shift]},{key:"ContextMenu"}]})];pe.addCommands(V,!0)},[pe]),n.useEffect(()=>{pe.getCommand("openContextMenu").updateCallback(()=>{const V=me.getSelection().getCoords().cell;Q.current?.getGridElement()?.scrollCellCoordsIntoView(V).then(ae=>{requestAnimationFrame(()=>{const he=me.getView().getZoomScale()/100,be=me.getColumnHeaders().findOffset(V.colIndex+1)*he,Be=me.getRowHeaders().findOffset(V.rowIndex+1)*he,ye=Q.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};jn({clientX:be-ye.x-ae.left+6,clientY:Be-ye.y-ae.top+6})})})})},[me]);const gi=w.useCallbackRef(V=>{pe?.dispatchToFocusedCommand(V)},[pe]),xi=w.useCallbackRef(()=>{Qn(se.current)},[G,se.current]),bi=n.useCallback(()=>{Sn("sheet")},[]),yi=n.useCallback(()=>{Sn("formulaBar")},[]),Ci=w.useCallbackRef(V=>{const{style:ae,...he}=V;return e.jsx(oe.SheetScrollbar,{style:{...ae,paddingTop:"4px",paddingBottom:"4px"},...he,sheet:me,endGap:700,onShowTooltip:be=>{yt(be.anchor,be.display,w.ToolTipPlacement.Left)},onCloseTooltip:()=>uo()})},[me]);n.useEffect(()=>{d&&Q&&Q.current&&Q.current.focus()},[]);const[Ht,ho]=n.useState(null),go=n.useCallback(V=>{pe?.getCommand("openWorkbook")&&(V.type==="dragenter"||V.type==="dragover"?V.dataTransfer?.types.includes("Files")?V.dataTransfer.files[0]?.type?.startsWith("image/")||V.dataTransfer.items[0]?.type?.startsWith("image/")||V.dataTransfer.types.length===1&&ho("Drop to open"):(V.dataTransfer?.types.includes("text/html")||V.dataTransfer?.types.includes("text/plain"),V.dataTransfer.effectAllowed="none",V.dataTransfer.dropEffect="none"):V.type==="dragleave"&&ho(null),V.preventDefault())},[pe]),Si=w.useCallbackRef(V=>{if(pe?.getCommand("openWorkbook")&&(V.preventDefault(),V.stopPropagation(),ho(null),V.dataTransfer.files&&V.dataTransfer.files.length>0)){const ae=V.dataTransfer.files[0];if(!ae)return;if(ae?.type?.startsWith("image/")){const he=Q.current?.getGridElement().getViewFromClient(V.clientX,V.clientY);if(!he)return;const be=he.getRelativePointFromClient(V.clientX,V.clientY),Be=he.toAbsoluteBounds({...be,width:0,height:0}),ye=he.getCellCoordsFromClient(V.clientX,V.clientY);if(!ye)return;pe?.getCommand("insertImageFromFile")?.execute({file:ae,options:{bounds:{x:Be.x,y:Be.y}},goto:{range:{...ye}}})}else pe?.getCommand("openWorkbook")?.execute(ae)}},[pe,Ht]),wi=n.useMemo(()=>Ht?e.jsx(E.Box,{sx:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",pointerEvents:"none",display:"flex",justifyContent:"center",alignItems:"center",background:V=>V.palette.divider,color:V=>V.palette.primary.dark},children:e.jsx(E.Typography,{variant:"h4",children:Ht})}):null,[Ht]),Tn=n.useRef(null),ki=n.useMemo(()=>e.jsx(Fo,{in:!K,nodeRef:Tn,timeout:500,classNames:"animating",unmountOnExit:!0,children:e.jsx(E.Box,{style:{display:"flex",alignItems:"center",justifyContent:"center",left:"0px",top:"0px",width:"100%",height:"100%",pointerEvents:K?"none":u?.pointerEvents,position:"absolute",boxSizing:"border-box"},children:z({ref:Tn,transitionDelay:"0",transparentBackground:!1,sx:{opacity:K?0:u?.opacity,pointerEvents:K?"none":u?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...O}})})}),[K,z,O]),vi=n.useMemo(()=>h({sx:{marginTop:V=>V.spacing(.25),marginLeft:V=>V.spacing(1),marginRight:V=>V.spacing(1)},workbook:G,sheetElement:Q.current,gridStyle:we,onFocus:yi,...S,NamedCollectionEditorProps:{restoreFocus:V=>Q.current.focus(V),...S?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:pe,...S?.NamedCollectionEditorProps?.commandPopupButtonProps}}},ve),[h,S,G,we,pe,K]),ji=n.useCallback(V=>{const{movable:ae,...he}=V,be={movable:ae,onContextMenuCapture:ke=>{hi(ke,ae)},...he},Be=ae.getContent().getType();let ye=null;if(Be==="picture")return e.jsx(oe.PictureEditor,{loadingPanel:e.jsx(b.LoadingPanel,{transitionDelay:"100",style:{position:"absolute"},sx:{border:ke=>`solid 1px ${ke.palette.action.active}`}}),picture:ae.getContent(),description:ae.getDescription()??ae?.getName(),...be});if(Be==="chart"){const ke={...be,chart:ae.getContent()};return e.jsx(oe.ChartEditor,{...ke})}if(ye=`Float of type '${Be}'.`,typeof ye=="string"){const ke={...be,description:ye};ye=e.jsx(oe.EmptyFrame,{...ke})}return e.jsx("div",{style:{position:"absolute",clipPath:"inset(0px)",display:"flex",alignItems:"stretch",justifyContent:"stretch",pointerEvents:"all"},children:ye},ae.getUUID())},[]),Bn=n.useMemo(()=>I({style:sa,onFocus:bi,gridStyle:we,headersStyle:ai,sheet:me,commands:pe,onSheetContextMenu:jn,onViewportChange:V=>{ri(V)},showScrollbars:!1,viewportComponent:Se,onRepeatCommandChange:f,onElementLoad:de,onShowColumnTooltip:V=>{yt(V.anchor,V.display,w.ToolTipPlacement.Top)},onShowRowTooltip:V=>{yt(V.anchor,V.display,w.ToolTipPlacement.Right)},onShowTooltip:V=>{yt({x:V.anchor.x,y:V.anchor.y,width:0,height:0},V.display,V.placement)},onCloseTooltip:()=>uo(),renderMovable:ji,...H,cellRenderProps:{onFilterButtonMouseDown:(V,ae)=>{H?.cellRenderProps?.onFilterButtonMouseDown(V,ae),fi(V,ae)},...H?.cellRenderProps}},Q),[pe,H,me,we,f]),Ti=n.useMemo(()=>{let V=e.jsx(w.ScrollPane,{ref:mi,style:sa,viewport:gn,touchElement:Q.current?.getGridElement()?.stage,onScrollViewport:ae=>{Q.current?.getGridElement()?.scrollTo(ae)},showHorizontalScrollbar:qe||Ue,showVerticalScrollbar:wn,createHorizontalScrollbar:kn,createVerticalScrollbar:Ci,children:Bn});return Ge||po===0||(V=e.jsxs(e.Fragment,{children:[V,fo]})),W?W(V):V},[qe,Ue,kn,wn,gn,Ge,Bn,fo,_,W]),Bi=n.useMemo(()=>e.jsx(b.SimpleTooltip,{arrow:!0,disableInteractive:!0,open:mo,title:e.jsx(E.Typography,{variant:"subtitle2",component:"div",children:bn}),placement:Cn,slotProps:{transition:{timeout:{exit:0}},popper:{popperRef:xt,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:mo?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(bt.x,bt.y,bt.width,bt.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]}},children:e.jsx(E.Box,{})}),[mo,bn,Cn,bt,xt]),Ei=n.useMemo(()=>({boxSizing:"border-box",background:V=>V.palette.mode!=="dark"?we.header.fill:V.palette.background.paper,"& *":{...b.scrollbarTheming(_),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${ot} 1px`},...u}),[u,we]),Pi=n.useMemo(()=>e.jsx(E.Box,{sx:{marginBottom:V=>V.spacing(.75)}}),[]),Ri=n.useMemo(()=>({flex:"1 1 100%",width:"100%",display:"flex",flexDirection:"column",opacity:K?void 0:0,"--sxl-app-color-high-contrast":_.palette.primary.main,"--sxl-app-color-primary":_.palette.primary.main,"--sxl-app-color-primary-dark":_.palette.primary.dark,"--sxl-app-color-primary-light":_.palette.primary.light,"--sxl-app-color-info":_.palette.info.main,"--sxl-app-color-info-dark":_.palette.info.dark,"--sxl-app-color-info-light":_.palette.info.light,"--sxl-app-color-secondary":_.palette.secondary.main,"--sxl-app-color-secondary-dark":_.palette.secondary.dark,"--sxl-app-color-secondary-light":_.palette.secondary.light,"--sxl-app-color-success":_.palette.success.main,"--sxl-app-color-success-dark":_.palette.success.dark,"--sxl-app-color-success-light":_.palette.success.light,"--sxl-app-color-warning":_.palette.warning.main,"--sxl-app-color-warning-dark":_.palette.warning.dark,"--sxl-app-color-warning-light":_.palette.warning.light,"--sxl-app-color-error":_.palette.error.main,"--sxl-app-color-error-dark":_.palette.error.dark,"--sxl-app-color-error-light":_.palette.error.light,"--sxl-app-color-text":_.palette.text.primary,"--sxl-app-color-text-secondary":_.palette.text.secondary,"--sxl-app-color-text-disabled":_.palette.text.disabled,"--sxl-app-color-background":_.palette.background.paper,"--sxl-app-color-button-surface":_.palette.grey[600],"--sxl-app-color-shadow":_.palette.action.focus,"--sxl-app-color-grey":_.palette.grey[500],"--sxl-app-filter-dark-invert":we.body.darkMode&&U?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":we.body.darkMode?`linear-gradient(${q.alpha("#fff",q.getOverlayAlpha(5))}, ${q.alpha("#fff",q.getOverlayAlpha(5))})`:void 0}),[we,_,K]),Mi=n.useMemo(()=>ie(Xa),[]);return e.jsxs(E.Paper,{className:ie("sheetxl-workbook",gl,{"Mui-focusVisible":fe},hl,c),sx:Ei,style:l,square:!1,...Y,ref:se,onFocus:V=>{re(!0),xi(),m?.(V)},onBlur:V=>{re(!1),C?.(V)},onKeyDown:V=>{gi(V),x?.(V)},onDragStart:V=>{if(V.target.src){const ae=new Image;ae.src=V.target.src,V.dataTransfer.setDragImage(ae,1,1)}},onDragEnter:go,onDragLeave:go,onDragOver:go,onDrop:Si,children:[e.jsxs("div",{className:Mi,style:Ri,children:[di,si?vi:null,Pi,Ti,ci,Bi,pi,wi]}),ki]})}));ln.displayName="WorkbookElement";const Pl=(a=!1,i=!1)=>i?null:{"& input:not(:focus):not(:hover)":{color:o=>o.palette.text.secondary},backgroundColor:o=>q.alpha(o.palette.background.paper,.6),borderRadius:o=>`${o.shape.borderRadius}px`,border:o=>`solid ${a?o.palette.divider:"transparent"} 1px`,"&.Mui-disabled":{border:o=>`solid ${a?o.palette.divider:"transparent"} 1px`},"&:focus-within:not([disabled])":{backgroundColor:o=>o.palette.background.paper},"&:hover:not([disabled])":{border:o=>`solid ${a?o.palette.text?.primary:o.palette.divider} 1px`,backgroundColor:null},"&.Mui-focusVisible":{outline:o=>`solid ${o.palette.primary.main} 1px !important`,border:o=>`1px solid ${o.palette?.primary?.main} !important`}},sn=n.memo(n.forwardRef((a,i)=>{const{sx:o,workbook:t,title:r="",placeHolder:s="Untitled",onTitleChange:d,readOnly:u=!1,hidden:l,...c}=a,[m,C]=n.useState(!1),[x,f]=n.useState(!1),[p,y]=n.useState(r??""),[S,h]=n.useState(""),[g,{width:k}]=Ve(),[j,{width:v}]=Ve(),[T,M]=n.useState(!1),R=n.useRef(null),D=n.useRef(null),F=w.useImperativeElement(i,()=>({requestWorkbookTitle:(B=null,P)=>{D.current={onAccept:B,requestReason:P?.requestReason},P?.selectAll&&R.current?.select(),R.current?.focus(P)},focus:B=>{R.current?.focus(B)}}),[]);return n.useLayoutEffect(()=>{M(r!==p),h(r),y(r)},[r]),n.useEffect(()=>{T&&k!==0&&je.CommonUtils.debounce(()=>{M(!1)},300)()},[T,k]),n.useEffect(()=>{f(p&&!ct.IOUtils.isValidWindowsFilename(p))},[p]),l?null:e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:T?"0":"1",transition:T?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:et([F,j,i]),...c,children:e.jsx(b.ExhibitTooltip,{label:D.current?.requestReason??"Workbook Name",children:e.jsxs(E.Box,{className:ie({"Mui-focusVisible":m}),sx:{visibility:k===0?"hidden":"visible",display:"block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:"12px",paddingRight:"12px",marginLeft:"2px",marginRight:"2px",paddingTop:"2px",paddingBottom:"1px",...Pl(!0,u),...o},children:[u?e.jsx(E.Typography,{variant:"subtitle1",component:"div",sx:{whiteSpace:"nowrap",fontStyle:p!==S?"italic":void 0,userSelect:"none",textOverflow:"ellipsis",lineHeight:"1.4375em",border:"transparent 1px solid",color:B=>x?B.palette.error.dark:void 0},children:r??s}):e.jsx(E.Input,{sx:{width:`${Math.min(k+3,Math.max(v,F.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:B=>x?B.palette.error.dark:void 0,fontStyle:p!==S?"italic":void 0,"& input":{paddingTop:"0px",paddingBottom:"0px",textOverflow:"ellipsis"}},disableUnderline:!0,fullWidth:!1,multiline:!1,readOnly:u,spellCheck:!1,placeholder:s,onFocus:B=>{C(!0),B.target?.select()},inputProps:{name:"input-workbook-title",autoComplete:"off",ref:R},onBlur:()=>{C(!1),x?y(S):(p!==S&&(d?.(p),p&&D.current?.onAccept?.(p,"blur")),D.current=null)},onChange:B=>{if(B.target.value.length>ct.IOUtils.MAX_WORKBOOK_NAME_SIZE)return B.stopPropagation(),void B.preventDefault();y(B.target.value)},onKeyDown:B=>{(ct.IOUtils.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(B.key)||B.target?.value.length>ct.IOUtils.MAX_WORKBOOK_NAME_SIZE)&&B.preventDefault(),B.which===w.KeyCodes.Enter||B.which===w.KeyCodes.Tab?(x?y(S):(d?.(p),p&&(D.current?.onAccept?.(p,"keydown"),D.current=null)),B.stopPropagation(),B.preventDefault(),t?.focus()):B.which===w.KeyCodes.Escape&&(p===S?t?.focus():(y(S),setTimeout(()=>{B.target?.select()},0)),D.current=null,B.stopPropagation(),B.preventDefault())},value:p}),e.jsx(E.Box,{ref:g,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:p!==S?"italic":void 0,fontFamily:B=>B.typography.fontFamily,letterSpacing:"0.00938em"},children:p||s})]})})})}));sn.displayName="WorkbookTitle";const Pr=n.memo(n.forwardRef((a,i)=>{const{title:o,commands:t,className:r,...s}=a,d=w.useNotifier(),[u,l]=n.useState(!1),[c,m]=n.useState(!1),C=n.useRef(null),[x,f]=n.useReducer(R=>R+1,0),[p,{width:y}]=Ve(),S=w.useCommands(t,["editTable"])[0].context(),h=S.table(),[g,k]=n.useState(()=>h?S.getNames().getRanges(h.getRange()):null),j=n.useMemo(()=>h?.getName()??"",[h]);oe.useModelListener(S.table(),{onAnchorCoordsChange(R){k(S.getNames().getRanges(R.getRange()))},onProtectedChange(R){f()}});const v=w.useCallbackRef(R=>{S?.table().setName(R)},[S]),T=w.useCallbackRef(R=>{S?.table().resize(R.at(0))},[S]);let M=null;return S.table()||(M=e.jsx(E.Typography,{component:"div",style:{top:"0",left:"0",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyItems:"center",justifyContent:"center"},children:"No table selected"})),e.jsx(E.Paper,{square:!0,onFocus:()=>l(!0),onBlur:R=>{C?.current?.contains(R.relatedTarget)||l(!1)},ref:et([C,p,i]),sx:{display:"flex",flexDirection:"column",flex:"1 1 auto",width:"100%",height:"100%",overflow:"auto",paddingLeft:R=>R.spacing(1.5),paddingRight:R=>R.spacing(1.5),paddingTop:R=>R.spacing(1.5),paddingBottom:R=>R.spacing(1.5),boxSizing:"border-box"},className:ie("sxl-table-details-panel",r,{"sxl-has-focus":u}),...s,children:M||e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 auto",flexDirection:"column",transition:"opacity 60ms",opacity:S.table()?1:0},children:[e.jsx(E.Box,{sx:{containerType:"inline-size",display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box",paddingTop:R=>R.spacing(2),paddingLeft:R=>R.spacing(2),paddingRight:R=>R.spacing(2)},children:e.jsxs(E.Box,{className:Yi,children:[e.jsx(Uo,{formName:"name",defaultInput:j,value:h?.getName()??"No table",onChangeInput:v,onValidate:R=>{h&&h.getName().toLowerCase()===R.toLowerCase()||S?.getNames().validateName(R)},disabled:h?.isProtected()??!0,onFocus:R=>{c||R.target?.select(),m(!0)}}),e.jsx(qo,{formName:"range",value:g,onChangeInput:T,resolvedAddress:S.getNames().getRanges.bind(S.getNames()),disabled:h?.isProtected()??!0,onFocus:R=>{c||R.target?.select(),m(!0)}})]})}),e.jsxs(E.Box,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",border:"red solid 2px",flexDirection:"column",containerType:"inline-size",gap:R=>R.spacing(.5),marginTop:R=>R.spacing(1)},children:[e.jsx(b.ExhibitDivider,{orientation:"horizontal",sx:{marginTop:R=>R.spacing(1.5),marginBottom:R=>R.spacing(.75)}}),e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",justifyContent:"start",flexDirection:"column",marginTop:R=>R.spacing(1),marginBottom:R=>R.spacing(1)},children:e.jsxs("div",{style:{display:"flex",alignItems:"start",gap:"2px"},children:[e.jsx(Ko,{table:h,styles:S.styles(),bodyStyle:S.bodyStyle(),cellHeight:30,isLive:!0}),e.jsx(cn,{command:t.getCommand("formatTableStyle"),commands:t,disabledQuickKey:!0})]})}),e.jsx(b.ExhibitDivider,{orientation:"horizontal",sx:{marginTop:R=>R.spacing(1.5),marginBottom:R=>R.spacing(.75)}}),e.jsx(Za,{disabled:h?.isProtected(),styleOptions:h?.getStyleOptions()??null,onStyleOptionsChange:R=>{h.updateStyleOptions(R)},showHeaderRow:h?.getShowHeaders(),onShowHeaderRowChange:R=>{try{h.setShowHeaders(R)}catch(D){d.showError(D)}},showTotalRow:h?.getShowTotals(),onShowTotalRowChange:R=>{try{h.setShowTotals(R)}catch(D){d.showError(D)}},showFilterButton:h?.getFilter()?h.getShowFilterButton():null,onShowFilterButtonChange:R=>{try{h.setShowFilterButton(R)}catch(D){d.showError(D)}}}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsxs(E.Box,{className:Zi,children:[e.jsx(b.CommandButton,{variant:w.CommandButtonType.Menuitem,command:t.getCommand("convertTableToRange"),commandState:h}),e.jsx(b.CommandButton,{variant:w.CommandButtonType.Menuitem,commandState:h,command:t.getCommand("deleteTable")})]})]})]})})})),Rr=(a,i)=>{const{model:o,commands:t,entryKey:r,frame:s,...d}=a;return e.jsx(Pr,{ref:i,commands:t,...d})},Mr=()=>{w.DefaultDynamicIconService.register("plugin-table",{icons:{}}),oe.DefaultTaskPaneRegistry.registerTaskPane({key:"tableDetails",getTitle:()=>"Table Details",getIcon:()=>"Table",renderTaskPane:Rr},!0)},Rl=n.memo(a=>{const{table:i,tableStyle:o,selectedTableStyleName:t,onSelectTableStyleName:r,styles:s,hasContextMenu:d=!0,bodyStyle:u,parentFloat:l,commands:c,disabled:m,commandHook:C,useCanvasPreview:x=!0,canvas:f,...p}=a,y=n.useCallback(k=>{const j={variant:w.CommandButtonType.Menuitem,commandHook:C,context:"table"},v=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...j,command:c.getCommand("formatTableStyleClearCellStyles"),commandState:o,disabled:m}),e.jsx(b.CommandButton,{...j,style:{fontWeight:550},command:c.getCommand("formatTableStyle"),commandState:{name:o.getName()},disabled:m}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...j,command:c.getCommand("setDefaultTableStyle"),commandState:o.getName(),disabled:m}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...j,command:c.getCommand("deleteTableStyle"),commandState:o?.getName(),disabled:m||!o||o.isBuiltIn()})]}),T=e.jsx(E.Box,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:v})});return b.defaultCreatePopupPanel({...k,children:T})},[c]),S=o?.getName()===t,h=n.useMemo(()=>{const k={table:i,tableStyle:o,styles:s,bodyStyle:u};return x?e.jsx(Ya,{canvas:f,...k}):e.jsx(Ko,{...k})},[i,o,s,u]);let g=e.jsx(b.ExhibitIconButton,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:k=>`solid ${S?k.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:o.getName()??"None",placement:"bottom-start"},disabled:m,icon:null,onClick:()=>{r?.(o?.getName())},...p,children:h},o.getName());return d&&(g=e.jsx(b.ContextMenu,{label:i.getStyleOptions().name,parentFloat:l,createPopupPanel:y,children:g})),g}),cn=n.memo(n.forwardRef((a,i)=>{const{commands:o,command:t,commandHook:r,selectedTable:s,onSelectTableStyleName:d,disabled:u=!1,bodyStyle:l,disabledQuickKey:c=!1,usePreviewIcon:m=!1,...C}=a;w.useCommand(t);const x=t?.context(),f=x?.styles,p=s??x?.table?.();let y="insertTable";p&&(y="editTable");const S=n.useMemo(()=>((F,B)=>{const P={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new A.Table({initialAnchor:P,styles:B,json:{name:"PreviewTable",ref:P,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:F}})})(p?.getStyleOptions(),f?.()),[f?.().getDefaultTableStyle(),p?.getStyleOptions()]),h=p??S,[g,k]=n.useState(h);n.useEffect(()=>{k(h)},[h]);const j=l??x?.bodyStyle(),v=w.useCallbackRef(F=>{d?.(F),t?.execute({name:F},r)},[t,d,r]),T=n.useRef(null),M=n.useCallback((F,B)=>{const P={onSelectTableStyleName:v,styles:f(),parentFloat:F.floatReference};T.current||(T.current=document.createElement("canvas"));const N=$=>{const U=f().getTableStyle($);return U?e.jsx(Rl,{table:g,tableStyle:U,selectedTableStyleName:g.getStyleOptions().name,bodyStyle:x.bodyStyle(),commands:B,commandHook:r,canvas:T.current,...P},$):null},z=($,U,Y=!0)=>{const _=[];for(let L=0;L<U.length;L++){const G=N(U[L]);G&&_.push(G)}return _.length===0?null:e.jsxs(E.Box,{children:[Y?e.jsx(b.ExhibitDivider,{orientation:"horizontal"}):null,e.jsx(b.ExhibitMenuHeader,{children:$},$+"-header"),e.jsx(E.Box,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:_},$+"-presets")]},$)},O=[],H=f().getCustomTableStyles(),I=[];if(H.length>0){for(let $=0;$<H.length;$++)H[$].isShownInTableStyles()&&I.push(H[$].getName());O.push(z("Custom",I,!1))}const W=[];p&&!p.getStyleOptions().name&&W.push(null);for(let $=0;$<21;$++)W.push("TableStyleLight"+($+1));O.push(z("Light",W,I.length>0));const ee=[];for(let $=0;$<28;$++)ee.push("TableStyleMedium"+($+1));O.push(z("Medium",ee));const X=[];for(let $=0;$<11;$++)X.push("TableStyleDark"+($+1));O.push(z("Dark",X));let ne=null;return p&&(ne=e.jsxs(e.Fragment,{children:[e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{variant:w.CommandButtonType.Menuitem,command:B.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:u})]})),e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:$=>`${$.shape.borderRadius}px`,paddingBottom:$=>`${$.shape.borderRadius}px`},children:[e.jsx(E.Box,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:O}),ne]})},[f,f?.().getTheme(),j,g]),R=u||!t||t.disabled(),D=n.useMemo(()=>{if(!x||!m)return t?.icon()},[g,j,R,t]);return e.jsx(b.CommandPopupButton,{ref:i,quickCommand:c?void 0:y,createPopupPanel:M,commands:o,label:t?.label(),commandState:p,commandHook:r,selected:p!==null,createTooltip:({children:F},B)=>e.jsx(b.ExhibitTooltip,{label:t?.label(),description:t?.description(),disabled:B,children:F}),disabled:R,icon:D,...C})})),Dr=n.memo(n.forwardRef((a,i)=>{const{command:o,commandHook:t,selectedTheme:r,onSelectTheme:s,disabled:d=!1,darkMode:u,label:l,icon:c,variant:m,...C}=a;w.useCommand(o);const x=o?.context()?.themes,f=r||o?.context()?.theme,p=u??o?.context()?.darkMode,y=d||o?.disabled(),S=w.useCallbackRef(g=>{s?.(g),o?.execute(g,t)},[s,t]),h=n.useCallback((g,k)=>{const{children:j,title:v,...T}=g;let M=g.children;return(y||k)&&(M=e.jsx("div",{children:M})),e.jsx(b.CommandTooltip,{command:o,placement:m===w.CommandButtonType.Toolbar?"bottom-start":"right-start",disabled:y||k,...T,children:M})},[o,y]);return e.jsx(nr,{ref:i,themes:x,selectedTheme:f,onSelectTheme:S,variant:m===w.CommandButtonType.Menuitem?b.PopupButtonType.Menuitem:b.PopupButtonType.Toolbar,createTooltip:h,disabled:y,darkMode:p,...C})})),Fr=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,...d}=a,u=w.useCommands(o,["themeMode"])[0],l=w.useCallbackRef((f,p)=>{const y={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"appearance",disabled:s},S=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...y,command:u}),e.jsx(b.CommandButton,{...y,command:p.getCommand("defaultThemeMode")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...y,command:p.getCommand("enableDarkGrid")}),e.jsx(b.CommandButton,{...y,command:p.getCommand("enableDarkImages")})]});return b.defaultCreatePopupPanel({...f,children:S})},[s,u,t,r]),c=u?.state(),m=E.useMediaQuery("(prefers-color-scheme: dark)"),C=c==="dark"||c===null&&m,x=u?.state()!==null;return e.jsx(b.CommandPopupButton,{ref:i,quickCommand:"themeMode",commands:o,commandHook:t,createPopupPanel:l,label:"Appearance",tooltip:"Change the light/dark mode to match your viewing preference. This does not affect the view for others.",onQuickClick:()=>{u?.execute(C?"light":"dark",t)},selected:x,...d})})),Ir=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,sx:d,...u}=a,l=n.useCallback((c,m)=>{const C={variant:w.CommandButtonType.Menuitem,scope:"help",commandHook:{...t,beforeExecute:(f,p)=>t?.beforeExecute?.(f,p)!==!1&&c.floatReference.closeAll()},disabled:s},x=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...C,command:m.getCommand("showKeyboardShortcuts")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...C,command:m.getCommand("gotoUrlGithub")}),e.jsx(b.CommandButton,{...C,command:m.getCommand("gotoUrlDiscord")}),e.jsx(b.CommandButton,{...C,command:m.getCommand("gotoUrlDocumentation")}),e.jsx(b.CommandButton,{...C,command:m.getCommand("gotoUrlIssue")})]});return b.defaultCreatePopupPanel({...c,children:x})},[s,t]);return e.jsx(b.CommandPopupButton,{ref:i,sx:d,commands:o,disabled:s,commandHook:t,scope:r,label:"Help",tooltip:"Help, feedback, and keyboard shortcuts.",createPopupPanel:l,icon:e.jsx(w.DynamicIcon,{iconKey:"Help",style:{transform:"scale(0.75)"}}),...u})})),dn=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r,disabled:s=!1,preferSingleMenu:d=!0,showQuickButton:u=!0,variant:l=w.CommandButtonType.Toolbar,...c}=a,m=w.useCommands(o,["insertImageFromFile","insertImageFromURL"]),{singleMenuCommand:C,allDisabled:x}=n.useMemo(()=>{let p=null,y=0;for(let S=0;S<m.length;S++)m[S]&&!m[S]?.disabled()&&(d&&l===w.CommandButtonType.Menuitem&&(p=y===0?m[S]:null),y++);return{singleMenuCommand:p,allDisabled:y===0}},[m]),f=n.useCallback((p,y)=>{const S={variant:w.CommandButtonType.Menuitem,commandHook:t,scope:"insertImage",disabled:s},h=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...S,command:y.getCommand("insertImageFromFile")}),e.jsx(b.CommandButton,{...S,command:y.getCommand("insertImageFromURL")})]});return b.defaultCreatePopupPanel({...p,children:h})},[s,t,r]);return C?e.jsx(b.CommandButton,{ref:i,variant:l,commandHook:t,disabled:s,command:C,...c}):e.jsx(b.CommandPopupButton,{ref:i,variant:l,quickCommand:"insertImageFromFile",commands:o,commandHook:t,scope:r,disabled:s||x,tooltip:"Insert a picture from the web to complement your data.",createPopupPanel:f,icon:"InsertImage",...c})})),mn=n.memo(n.forwardRef((a,i)=>{const{...o}=a;return e.jsx(b.SimpleCommandPopupButton,{ref:i,...o,popupCommandKeys:["insertFunctionSum","insertFunctionAverage","insertFunctionCount","insertFunctionMax","insertFunctionMin",null,"insertFunction"],quickCommand:"insertFunctionSum",popupScope:"insertFunction",label:"Quick Function",tooltip:"More functions."})}));mn.displayName="InsertFunctionSumCommandPopupButton";const jo=new Map([{key:"financial",label:"Financial",icon:"FormulaFinancial"},{key:"logical",label:"Logical",icon:"FormulaLogical"},{key:"text",label:"Text",icon:"FormulaText"},{key:"dateTime",label:"Date & Time",icon:"FormulaDateTime"},{key:"lookupReference",label:"Lookup & Reference",icon:"FormulaLookupReference"},{key:"mathTrig",label:"Math & Trig",icon:"FormulaMathTrig"},{key:"statDist",label:"Statistical",icon:"FormulaStatistical"},{key:"engineering",label:"Engineering",icon:"FormulaEngineering"},{key:"information",label:"Information",icon:"FormulaInformation"},{key:"cube",label:"Cube",icon:"FormulaCube"},{key:"database",label:"Database",icon:"FormulaDatabase"},{key:"web",label:"Web",icon:"FormulaWeb"},{key:"custom",label:"Custom",icon:"FormulaCustom"}].map(a=>[a.key,a])),Ml=n.memo(a=>{const{command:i,formulaFunction:o,commandHook:t,disabled:r=!1,parentFloat:s,handleInsert:d,icon:u,label:l,sx:c,...m}=a,C=new Promise(x=>{o.getDescriptor().then(f=>{x(f.getSummary())})});return e.jsx(b.ExhibitMenuItem,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...c},disabled:r,tooltipProps:{label:C,maxWidth:1e3},onMouseDown:x=>{x.button===0&&x.preventDefault()},onMouseUp:x=>{x.button===0&&d(o)},onKeyDown:x=>{x.keyCode===w.KeyCodes.Enter||(x.keyCode,w.KeyCodes.Space)},...m,children:e.jsx(E.Box,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:e.jsx(E.Typography,{component:"div",children:o.getName()})})})}),Nr=n.memo(n.forwardRef((a,i)=>{const{category:o,commands:t,commandHook:r,scope:s,sx:d,disabled:u=!1,parentFloat:l,...c}=a,m=w.useCommands(t,["insertFunction"])[0],C=n.useCallback((f,p)=>{const y=jo.get(o);if(!y)return console.warn("invalidate category",o),null;const S={commandHook:r,...f},h=e.jsx(Dl,{category:y.label,...S,commands:p});return b.defaultCreatePopupPanel({...f,children:h})},[o,m,r,s]),x=jo.get(o);return e.jsx(b.CommandPopupButton,{ref:i,commands:t,commandHook:r,createPopupPanel:C,label:x.label,tooltip:"Insert Function",icon:jo.get(o)?.icon??"FormulaGroup",...c})}));Nr.displayName="InsertFunctionCommandPopupButton";const Dl=n.memo(n.forwardRef((a,i)=>{const{commands:o,category:t,commandHook:r,...s}=a,d=w.useCommands(o,["insertFunction"]),[u,l]=n.useState([]),[c,m]=n.useState(!1);n.useEffect(()=>{(async()=>{m(!0);const S=d[0]?.context(),h=await S.searchByCategory(t);l(h),m(!1)})()},[]);const C=u.length,x=new Array(C),f=o.getCommand("insertFunction"),p=S=>{r?.beforeExecute?.(f,f?.state()),f.execute(S),r?.onExecute?.(f,f?.state())};for(let S=0;S<C;S++){const h=u[S];x[S]=e.jsx(Ml,{command:f,formulaFunction:h,handleInsert:p},`formula-${h.getName()}-${S}`)}const y=e.jsx(E.Box,{ref:i,sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:C>0?e.jsx(e.Fragment,{children:e.jsx(E.Box,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})}):null});return b.defaultCreatePopupPanel({...s,children:y})})),Or=n.memo(n.forwardRef((a,i)=>{const{sx:o,style:t,className:r,licenseKey:s,renderLoadingPanel:d,...u}=a;s&&A.LicenseManager.setLicenseKey(s);const l=n.useMemo(()=>{const m={transitionDelay:"160ms",transparentBackground:!0};return e.jsx(E.Box,{sx:o,style:{width:"100%",height:"100%",position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",...t},children:d?.(m)??e.jsx(b.LoadingPanel,{...m})})},[o,t,d]),c=n.useMemo(()=>n.lazy(async()=>await Promise.resolve().then(()=>us)),[]);return e.jsx(e.Fragment,{children:e.jsx(n.Suspense,{fallback:l,children:e.jsx(c,{...u,className:r,renderLoadingPanel:d,sx:o,style:t,ref:i})})})}));function Ar(a){var i,o,t="";if(typeof a=="string"||typeof a=="number")t+=a;else if(typeof a=="object")if(Array.isArray(a))for(i=0;i<a.length;i++)a[i]&&(o=Ar(a[i]))&&(t&&(t+=" "),t+=o);else for(i in a)a[i]&&(t&&(t+=" "),t+=i);return t}function _e(){for(var a,i,o=0,t="";o<arguments.length;)(a=arguments[o++])&&(i=Ar(a))&&(t&&(t+=" "),t+=i);return t}Or.displayName="Studio";let Fl={data:""},Il=a=>{if(typeof window=="object"){let i=(a?a.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return i.nonce=window.__nonce__,i.parentNode||(a||document.head).appendChild(i),i.firstChild}return a||Fl},Nl=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ol=/\/\*[^]*?\*\/| +/g,ca=/\n+/g,Qe=(a,i)=>{let o="",t="",r="";for(let s in a){let d=a[s];s[0]=="@"?s[1]=="i"?o=s+" "+d+";":t+=s[1]=="f"?Qe(d,s):s+"{"+Qe(d,s[1]=="k"?"":i)+"}":typeof d=="object"?t+=Qe(d,i?i.replace(/([^,])+/g,u=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,u):u?u+" "+l:l)):s):d!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=Qe.p?Qe.p(s,d):s+":"+d+";")}return o+(i&&r?i+"{"+r+"}":r)+t},Oe={},Lr=a=>{if(typeof a=="object"){let i="";for(let o in a)i+=o+Lr(a[o]);return i}return a},Al=(a,i,o,t,r)=>{let s=Lr(a),d=Oe[s]||(Oe[s]=(l=>{let c=0,m=11;for(;c<l.length;)m=101*m+l.charCodeAt(c++)>>>0;return"go"+m})(s));if(!Oe[d]){let l=s!==a?a:(c=>{let m,C,x=[{}];for(;m=Nl.exec(c.replace(Ol,""));)m[4]?x.shift():m[3]?(C=m[3].replace(ca," ").trim(),x.unshift(x[0][C]=x[0][C]||{})):x[0][m[1]]=m[2].replace(ca," ").trim();return x[0]})(a);Oe[d]=Qe(r?{["@keyframes "+d]:l}:l,o?"":"."+d)}let u=o&&Oe.g?Oe.g:null;return o&&(Oe.g=Oe[d]),((l,c,m,C)=>{C?c.data=c.data.replace(C,l):c.data.indexOf(l)===-1&&(c.data=m?l+c.data:c.data+l)})(Oe[d],i,t,u),d};function No(a){let i=this||{},o=a.call?a(i.p):a;return Al(o.unshift?o.raw?((t,r,s)=>t.reduce((d,u,l)=>{let c=r[l];if(c&&c.call){let m=c(s),C=m&&m.props&&m.props.className||/^go/.test(m)&&m;c=C?"."+C:m&&typeof m=="object"?m.props?"":Qe(m,""):m===!1?"":m}return d+u+(c??"")},""))(o,[].slice.call(arguments,1),i.p):o.reduce((t,r)=>Object.assign(t,r&&r.call?r(i.p):r),{}):o,Il(i.target),i.g,i.o,i.k)}function zr(a,i,o){return i&&(function(t,r){for(var s=0;s<r.length;s++){var d=r[s];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(t,d.key,d)}})(a.prototype,i),a}function ce(){return ce=Object.assign||function(a){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(a[t]=o[t])}return a},ce.apply(this,arguments)}function Hr(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,a.__proto__=i}function At(a,i){if(a==null)return{};var o,t,r={},s=Object.keys(a);for(t=0;t<s.length;t++)o=s[t],i.indexOf(o)>=0||(r[o]=a[o]);return r}function da(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}No.bind({g:1}),No.bind({k:1});var ma=function(){return""},Wr=n.createContext({enqueueSnackbar:ma,closeSnackbar:ma}),To="@media (max-width:599.95px)",to="@media (min-width:600px)",ua=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},un=function(a){return""+ua(a.vertical)+ua(a.horizontal)},qt=function(a){return!!a||a===0},Gt="unmounted",at="exited",rt="entering",Et="entered",pa="exiting",pn=(function(a){function i(t){var r;r=a.call(this,t)||this;var s,d=t.appear;return r.appearStatus=null,t.in?d?(s=at,r.appearStatus=rt):s=Et:s=t.unmountOnExit||t.mountOnEnter?Gt:at,r.state={status:s},r.nextCallback=null,r}Hr(i,a),i.getDerivedStateFromProps=function(t,r){return t.in&&r.status===Gt?{status:at}:null};var o=i.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(t){var r=null;if(t!==this.props){var s=this.state.status;this.props.in?s!==rt&&s!==Et&&(r=rt):s!==rt&&s!==Et||(r=pa)}this.updateStatus(!1,r)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var t=this.props.timeout,r=t,s=t;return t!=null&&typeof t!="number"&&typeof t!="string"&&(s=t.exit,r=t.enter),{exit:s,enter:r}},o.updateStatus=function(t,r){t===void 0&&(t=!1),r!==null?(this.cancelNextCallback(),r===rt?this.performEnter(t):this.performExit()):this.props.unmountOnExit&&this.state.status===at&&this.setState({status:Gt})},o.performEnter=function(t){var r=this,s=this.props.enter,d=t,u=this.getTimeouts();t||s?(this.props.onEnter&&this.props.onEnter(this.node,d),this.safeSetState({status:rt},function(){r.props.onEntering&&r.props.onEntering(r.node,d),r.onTransitionEnd(u.enter,function(){r.safeSetState({status:Et},function(){r.props.onEntered&&r.props.onEntered(r.node,d)})})})):this.safeSetState({status:Et},function(){r.props.onEntered&&r.props.onEntered(r.node,d)})},o.performExit=function(){var t=this,r=this.props.exit,s=this.getTimeouts();r?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:pa},function(){t.props.onExiting&&t.props.onExiting(t.node),t.onTransitionEnd(s.exit,function(){t.safeSetState({status:at},function(){t.props.onExited&&t.props.onExited(t.node)})})})):this.safeSetState({status:at},function(){t.props.onExited&&t.props.onExited(t.node)})},o.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(t,r){r=this.setNextCallback(r),this.setState(t,r)},o.setNextCallback=function(t){var r=this,s=!0;return this.nextCallback=function(){s&&(s=!1,r.nextCallback=null,t())},this.nextCallback.cancel=function(){s=!1},this.nextCallback},o.onTransitionEnd=function(t,r){this.setNextCallback(r);var s=t==null&&!this.props.addEndListener;this.node&&!s?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),t!=null&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},o.render=function(){var t=this.state.status;if(t===Gt)return null;var r=this.props;return(0,r.children)(t,At(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},zr(i,[{key:"node",get:function(){var t,r=(t=this.props.nodeRef)===null||t===void 0?void 0:t.current;if(!r)throw new Error("notistack - Custom snackbar is not refForwarding");return r}}]),i})(n.Component);function it(){}function fa(a,i){typeof a=="function"?a(i):a&&(a.current=i)}function Oo(a,i){return n.useMemo(function(){return a==null&&i==null?null:function(o){fa(a,o),fa(i,o)}},[a,i])}function ao(a){var i=a.timeout,o=a.style,t=o===void 0?{}:o,r=a.mode;return{duration:typeof i=="object"?i[r]||0:i,easing:t.transitionTimingFunction,delay:t.transitionDelay}}pn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:it,onEntering:it,onEntered:it,onExit:it,onExiting:it,onExited:it};var Ll="cubic-bezier(0.4, 0, 0.2, 1)",zl="cubic-bezier(0.0, 0, 0.2, 1)",Hl="cubic-bezier(0.4, 0, 0.6, 1)",$r=function(a){a.scrollTop=a.scrollTop},ha=function(a){return Math.round(a)+"ms"};function mt(a,i){a===void 0&&(a=["all"]);var o=i||{},t=o.duration,r=t===void 0?300:t,s=o.easing,d=s===void 0?Ll:s,u=o.delay,l=u===void 0?0:u;return(Array.isArray(a)?a:[a]).map(function(c){var m=typeof r=="string"?r:ha(r),C=typeof l=="string"?l:ha(l);return c+" "+m+" "+d+" "+C}).join(",")}function Vr(a){var i=(function(o){return o&&o.ownerDocument||document})(a);return i.defaultView||window}function Xt(a,i){if(i){var o=(function(t,r){var s,d=r.getBoundingClientRect(),u=Vr(r);if(r.fakeTransform)s=r.fakeTransform;else{var l=u.getComputedStyle(r);s=l.getPropertyValue("-webkit-transform")||l.getPropertyValue("transform")}var c=0,m=0;if(s&&s!=="none"&&typeof s=="string"){var C=s.split("(")[1].split(")")[0].split(",");c=parseInt(C[4],10),m=parseInt(C[5],10)}switch(t){case"left":return"translateX("+(u.innerWidth+c-d.left)+"px)";case"right":return"translateX(-"+(d.left+d.width-c)+"px)";case"up":return"translateY("+(u.innerHeight+m-d.top)+"px)";default:return"translateY(-"+(d.top+d.height-m)+"px)"}})(a,i);o&&(i.style.webkitTransform=o,i.style.transform=o)}}var _r=n.forwardRef(function(a,i){var o=a.children,t=a.direction,r=t===void 0?"down":t,s=a.in,d=a.style,u=a.timeout,l=u===void 0?0:u,c=a.onEnter,m=a.onEntered,C=a.onExit,x=a.onExited,f=At(a,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),p=n.useRef(null),y=Oo(o.ref,p),S=Oo(y,i),h=n.useCallback(function(){p.current&&Xt(r,p.current)},[r]);return n.useEffect(function(){if(!s&&r!=="down"&&r!=="right"){var g=(function(j,v){var T;function M(){for(var R=this,D=arguments.length,F=new Array(D),B=0;B<D;B++)F[B]=arguments[B];clearTimeout(T),T=setTimeout(function(){j.apply(R,F)},v)}return v===void 0&&(v=166),M.clear=function(){clearTimeout(T)},M})(function(){p.current&&Xt(r,p.current)}),k=Vr(p.current);return k.addEventListener("resize",g),function(){g.clear(),k.removeEventListener("resize",g)}}},[r,s]),n.useEffect(function(){s||h()},[s,h]),n.createElement(pn,Object.assign({appear:!0,nodeRef:p,onEnter:function(g,k){Xt(r,g),$r(g),c&&c(g,k)},onEntered:m,onEntering:function(g){var k=d?.transitionTimingFunction||zl,j=ao({timeout:l,mode:"enter",style:ce({},d,{transitionTimingFunction:k})});g.style.webkitTransition=mt("-webkit-transform",j),g.style.transition=mt("transform",j),g.style.webkitTransform="none",g.style.transform="none"},onExit:function(g){var k=d?.transitionTimingFunction||Hl,j=ao({timeout:l,mode:"exit",style:ce({},d,{transitionTimingFunction:k})});g.style.webkitTransition=mt("-webkit-transform",j),g.style.transition=mt("transform",j),Xt(r,g),C&&C(g)},onExited:function(g){g.style.webkitTransition="",g.style.transition="",x&&x(g)},in:s,timeout:l},f),function(g,k){return n.cloneElement(o,ce({ref:S,style:ce({visibility:g!=="exited"||s?void 0:"hidden"},d,{},o.props.style)},k))})});_r.displayName="Slide";var co=function(a){return n.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},a))},Wl=function(){return n.createElement(co,null,n.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
15
|
+
10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},$l=function(){return n.createElement(co,null,n.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},Vl=function(){return n.createElement(co,null,n.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
|
|
16
|
+
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
17
|
+
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},_l=function(){return n.createElement(co,null,n.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
18
|
+
0 22,12A10,10 0 0,0 12,2Z`}))},Ze={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:n.createElement(Wl,null),warning:n.createElement($l,null),error:n.createElement(Vl,null),info:n.createElement(_l,null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:_r,transitionDuration:{enter:225,exit:195}},Kl=function(a,i){return function(o,t){return t===void 0&&(t=!1),t?ce({},Ze[o],{},i[o],{},a[o]):o==="autoHideDuration"?(r=a.autoHideDuration,s=i.autoHideDuration,(d=function(u){return typeof u=="number"||u===null})(r)?r:d(s)?s:Ze.autoHideDuration):o==="transitionDuration"?(function(u,l){var c=function(m,C){return C.some(function(x){return typeof m===x})};return c(u,["string","number"])?u:c(u,["object"])?ce({},Ze.transitionDuration,{},c(l,["object"])&&l,{},u):c(l,["string","number"])?l:c(l,["object"])?ce({},Ze.transitionDuration,{},l):Ze.transitionDuration})(a.transitionDuration,i.transitionDuration):a[o]||i[o]||Ze[o];var r,s,d}};function Lt(a){return Object.entries(a).reduce(function(i,o){var t,r=o[0],s=o[1];return ce({},i,((t={})[r]=No(s),t))},{})}var Ul="notistack-SnackbarContainer",ql="notistack-Snackbar",Kr="notistack-CollapseWrapper",Gl="notistack-MuiContent",Xl=function(a){return"notistack-MuiContent-"+a},ga=Lt({root:{height:0},entered:{height:"auto"}}),Bo="0px",Ur=n.forwardRef(function(a,i){var o=a.children,t=a.in,r=a.onExited,s=n.useRef(null),d=n.useRef(null),u=Oo(i,d),l=function(){return s.current?s.current.clientHeight:0};return n.createElement(pn,{in:t,unmountOnExit:!0,onEnter:function(c){c.style.height=Bo},onEntered:function(c){c.style.height="auto"},onEntering:function(c){var m=l(),C=ao({timeout:175,mode:"enter"}),x=C.duration,f=C.easing;c.style.transitionDuration=typeof x=="string"?x:x+"ms",c.style.height=m+"px",c.style.transitionTimingFunction=f||""},onExit:function(c){c.style.height=l()+"px"},onExited:r,onExiting:function(c){$r(c);var m=ao({timeout:175,mode:"exit"}),C=m.duration,x=m.easing;c.style.transitionDuration=typeof C=="string"?C:C+"ms",c.style.height=Bo,c.style.transitionTimingFunction=x||""},nodeRef:d,timeout:175},function(c,m){return n.createElement("div",Object.assign({ref:u,className:_e(ga.root,c==="entered"&&ga.entered),style:ce({pointerEvents:"all",overflow:"hidden",minHeight:Bo,transition:mt("height")},c==="entered"&&{overflow:"visible"},{},c==="exited"&&!t&&{visibility:"hidden"})},m),n.createElement("div",{ref:s,className:Kr,style:{display:"flex",width:"100%"}},o))})});Ur.displayName="Collapse";var xa={right:"left",left:"right",bottom:"up",top:"down"},Yl=function(a){return"anchorOrigin"+un(a)},Zl=function(){};function It(a,i){return a.reduce(function(o,t){return t==null?o:function(){for(var r=arguments.length,s=new Array(r),d=0;d<r;d++)s[d]=arguments[d];var u=[].concat(s);i&&u.indexOf(i)===-1&&u.push(i),o.apply(this,u),t.apply(this,u)}},Zl)}var Ql=typeof window<"u"?n.useLayoutEffect:n.useEffect;function ba(a){var i=n.useRef(a);return Ql(function(){i.current=a}),n.useCallback(function(){return i.current.apply(void 0,arguments)},[])}var Eo,qr=n.forwardRef(function(a,i){var o=a.children,t=a.className,r=a.autoHideDuration,s=a.disableWindowBlurListener,d=s!==void 0&&s,u=a.onClose,l=a.id,c=a.open,m=a.SnackbarProps,C=m===void 0?{}:m,x=n.useRef(),f=ba(function(){u&&u.apply(void 0,arguments)}),p=ba(function(h){u&&h!=null&&(x.current&&clearTimeout(x.current),x.current=setTimeout(function(){f(null,"timeout",l)},h))});n.useEffect(function(){return c&&p(r),function(){x.current&&clearTimeout(x.current)}},[c,r,p]);var y=function(){x.current&&clearTimeout(x.current)},S=n.useCallback(function(){r!=null&&p(.5*r)},[r,p]);return n.useEffect(function(){if(!d&&c)return window.addEventListener("focus",S),window.addEventListener("blur",y),function(){window.removeEventListener("focus",S),window.removeEventListener("blur",y)}},[d,S,c]),n.createElement("div",Object.assign({ref:i},C,{className:_e(ql,t),onMouseEnter:function(h){C.onMouseEnter&&C.onMouseEnter(h),y()},onMouseLeave:function(h){C.onMouseLeave&&C.onMouseLeave(h),S()}}),o)});qr.displayName="Snackbar";var Jl=Lt({root:(Eo={display:"flex",flexWrap:"wrap",flexGrow:1},Eo[to]={flexGrow:"initial",minWidth:"288px"},Eo)}),fn=n.forwardRef(function(a,i){var o=a.className,t=At(a,["className"]);return n.createElement("div",Object.assign({ref:i,className:_e(Jl.root,o)},t))});fn.displayName="SnackbarContent";var Pt=Lt({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),ya="notistack-snackbar",Gr=n.forwardRef(function(a,i){var o=a.id,t=a.message,r=a.action,s=a.iconVariant,d=a.variant,u=a.hideIconVariant,l=a.style,c=a.className,m=s[d],C=r;return typeof C=="function"&&(C=C(o)),n.createElement(fn,{ref:i,role:"alert","aria-describedby":ya,style:l,className:_e(Gl,Xl(d),Pt.root,Pt[d],c,!u&&m&&Pt.lessPadding)},n.createElement("div",{id:ya,className:Pt.message},u?null:m,t),C&&n.createElement("div",{className:Pt.action},C))});Gr.displayName="MaterialDesignContent";var Rt,Po,Yt,Zt,Ro,es=n.memo(Gr),ts=Lt({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),os=function(a){var i=n.useRef(),o=n.useState(!0),t=o[0],r=o[1],s=It([a.snack.onClose,a.onClose]),d=n.useCallback(function(){i.current=setTimeout(function(){r(function(R){return!R})},125)},[]);n.useEffect(function(){return function(){i.current&&clearTimeout(i.current)}},[]);var u,l=a.snack,c=a.classes,m=a.Component,C=m===void 0?es:m,x=n.useMemo(function(){return(function(R){R===void 0&&(R={});var D={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(R).filter(function(F){return!D[F]}).reduce(function(F,B){var P;return ce({},F,((P={})[B]=R[B],P))},{})})(c)},[c]),f=l.open,p=l.SnackbarProps,y=l.TransitionComponent,S=l.TransitionProps,h=l.transitionDuration,g=l.disableWindowBlurListener,k=l.content,j=At(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),v=ce({direction:(u=j.anchorOrigin,u.horizontal!=="center"?xa[u.horizontal]:xa[u.vertical]),timeout:h},S),T=k;typeof T=="function"&&(T=T(j.id,j.message));var M=["onEnter","onEntered","onExit","onExited"].reduce(function(R,D){var F;return ce({},R,((F={})[D]=It([a.snack[D],a[D]],j.id),F))},{});return n.createElement(Ur,{in:t,onExited:M.onExited},n.createElement(qr,{open:f,id:j.id,disableWindowBlurListener:g,autoHideDuration:j.autoHideDuration,className:_e(ts.wrappedRoot,x.root,x[Yl(j.anchorOrigin)]),SnackbarProps:p,onClose:s},n.createElement(y,Object.assign({},v,{appear:!0,in:f,onExit:M.onExit,onExited:d,onEnter:M.onEnter,onEntered:It([M.onEntered,function(){a.snack.requestClose&&s(null,"instructed",a.snack.id)}],j.id)}),T||n.createElement(C,Object.assign({},j)))))},Mt={default:20},Qt={default:6,dense:2},Ca="."+Kr,Jt=Lt({root:(Rt={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:mt(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},Rt[Ca]={padding:Qt.default+"px 0px",transition:"padding 300ms ease 0ms"},Rt.maxWidth="calc(100% - "+2*Mt.default+"px)",Rt[To]={width:"100%",maxWidth:"calc(100% - 32px)"},Rt),rootDense:(Po={},Po[Ca]={padding:Qt.dense+"px 0px"},Po),top:{top:Mt.default-Qt.default+"px",flexDirection:"column"},bottom:{bottom:Mt.default-Qt.default+"px",flexDirection:"column-reverse"},left:(Yt={left:Mt.default+"px"},Yt[to]={alignItems:"flex-start"},Yt[To]={left:"16px"},Yt),right:(Zt={right:Mt.default+"px"},Zt[to]={alignItems:"flex-end"},Zt[To]={right:"16px"},Zt),center:(Ro={left:"50%",transform:"translateX(-50%)"},Ro[to]={alignItems:"center"},Ro)}),ns=function(a){var i=a.classes,o=i===void 0?{}:i,t=a.anchorOrigin,r=a.dense,s=a.children,d=_e(Ul,Jt[t.vertical],Jt[t.horizontal],Jt.root,o.containerRoot,o["containerAnchorOrigin"+un(t)],r&&Jt.rootDense);return n.createElement("div",{className:d},s)},as=n.memo(ns),Sa=function(a){return!(typeof a=="string"||n.isValidElement(a))},rs=(function(a){function i(o){var t;return(t=a.call(this,o)||this).enqueueSnackbar=function(r,s){if(s===void 0&&(s={}),r==null)throw new Error("enqueueSnackbar called with invalid argument");var d=Sa(r)?r:s,u=Sa(r)?r.message:r,l=d.key,c=d.preventDuplicate,m=At(d,["key","preventDuplicate"]),C=qt(l),x=C?l:new Date().getTime()+Math.random(),f=Kl(m,t.props),p=ce({id:x},m,{message:u,open:!0,entered:!1,requestClose:!1,persist:f("persist"),action:f("action"),content:f("content"),variant:f("variant"),anchorOrigin:f("anchorOrigin"),disableWindowBlurListener:f("disableWindowBlurListener"),autoHideDuration:f("autoHideDuration"),hideIconVariant:f("hideIconVariant"),TransitionComponent:f("TransitionComponent"),transitionDuration:f("transitionDuration"),TransitionProps:f("TransitionProps",!0),iconVariant:f("iconVariant",!0),style:f("style",!0),SnackbarProps:f("SnackbarProps",!0),className:_e(t.props.className,m.className)});return p.persist&&(p.autoHideDuration=void 0),t.setState(function(y){if(c===void 0&&t.props.preventDuplicate||c){var S=function(k){return C?k.id===x:k.message===u},h=y.queue.findIndex(S)>-1,g=y.snacks.findIndex(S)>-1;if(h||g)return y}return t.handleDisplaySnack(ce({},y,{queue:[].concat(y.queue,[p])}))}),x},t.handleDisplaySnack=function(r){return r.snacks.length>=t.maxSnack?t.handleDismissOldest(r):t.processQueue(r)},t.processQueue=function(r){var s=r.queue,d=r.snacks;return s.length>0?ce({},r,{snacks:[].concat(d,[s[0]]),queue:s.slice(1,s.length)}):r},t.handleDismissOldest=function(r){if(r.snacks.some(function(l){return!l.open||l.requestClose}))return r;var s=!1,d=!1;r.snacks.reduce(function(l,c){return l+(c.open&&c.persist?1:0)},0)===t.maxSnack&&(d=!0);var u=r.snacks.map(function(l){return s||l.persist&&!d?ce({},l):(s=!0,l.entered?(l.onClose&&l.onClose(null,"maxsnack",l.id),t.props.onClose&&t.props.onClose(null,"maxsnack",l.id),ce({},l,{open:!1})):ce({},l,{requestClose:!0}))});return ce({},r,{snacks:u})},t.handleEnteredSnack=function(r,s,d){if(!qt(d))throw new Error("handleEnteredSnack Cannot be called with undefined key");t.setState(function(u){return{snacks:u.snacks.map(function(l){return l.id===d?ce({},l,{entered:!0}):ce({},l)})}})},t.handleCloseSnack=function(r,s,d){t.props.onClose&&t.props.onClose(r,s,d);var u=d===void 0;t.setState(function(l){var c=l.snacks,m=l.queue;return{snacks:c.map(function(C){return u||C.id===d?C.entered?ce({},C,{open:!1}):ce({},C,{requestClose:!0}):ce({},C)}),queue:m.filter(function(C){return C.id!==d})}})},t.closeSnackbar=function(r){var s=t.state.snacks.find(function(d){return d.id===r});qt(r)&&s&&s.onClose&&s.onClose(null,"instructed",r),t.handleCloseSnack(null,"instructed",r)},t.handleExitedSnack=function(r,s){if(!qt(s))throw new Error("handleExitedSnack Cannot be called with undefined key");t.setState(function(d){var u=t.processQueue(ce({},d,{snacks:d.snacks.filter(function(l){return l.id!==s})}));return u.queue.length===0?u:t.handleDismissOldest(u)})},t.enqueueSnackbar,t.closeSnackbar,t.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:t.enqueueSnackbar.bind(da(t)),closeSnackbar:t.closeSnackbar.bind(da(t))}},t}return Hr(i,a),i.prototype.render=function(){var o=this,t=this.state.contextValue,r=this.props,s=r.domRoot,d=r.children,u=r.dense,l=u!==void 0&&u,c=r.Components,m=c===void 0?{}:c,C=r.classes,x=this.state.snacks.reduce(function(p,y){var S,h=un(y.anchorOrigin),g=p[h]||[];return ce({},p,((S={})[h]=[].concat(g,[y]),S))},{}),f=Object.keys(x).map(function(p){var y=x[p],S=y[0];return n.createElement(as,{key:p,dense:l,anchorOrigin:S.anchorOrigin,classes:C},y.map(function(h){return n.createElement(os,{key:h.id,snack:h,classes:C,Component:m[h.variant],onClose:o.handleCloseSnack,onEnter:o.props.onEnter,onExit:o.props.onExit,onExited:It([o.handleExitedSnack,o.props.onExited],h.id),onEntered:It([o.handleEnteredSnack,o.props.onEntered],h.id)})}))});return n.createElement(Wr.Provider,{value:t},d,s?Je.createPortal(f,s):f)},zr(i,[{key:"maxSnack",get:function(){return this.props.maxSnack||Ze.maxSnack}}]),i})(n.Component),Xr=function(){return n.useContext(Wr)};const is=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],handler:null,isDefault:!0},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:null},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:null}],ls=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",handler:null,isDefault:!0},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:null},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:null}];class Yr{constructor(i=is,o=ls){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...i]),this._writeFormatType=Object.freeze([...o])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const i=[],o=this._readFormatType;for(let t=0;t<o.length;t++)for(let r=0;r<o[t].exts.length;r++)i.push("."+o[t].exts[r]);return i}async writeFile(i,o,t){if(!o||!i)throw new Error("Workbook model or file name must be provided.");try{return(await import("@sheetxl/io")).WorkbookIO.writeFile(i,o,t)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(i,o){let t,r;const s=await o?.showBusy?.(`Opening${i.name?` ${i.name}`:""}...`);try{r=await import("@sheetxl/io")}catch(d){throw d}try{return await r.WorkbookIO.read({...i,progress:{async onStart(d){await i?.progress?.onStart?.(d),t=await o?.showBusy?.(`Opening '${d}'...`)}}})}catch(d){throw s?.(),t?.(),d}finally{s?.(),t?.()}}}const $e=new Yr,Ae={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},Zr=n.memo(n.forwardRef((a,i)=>{const{id:o,message:t,iconVariant:r,error:s,hideIconVariant:d,...u}=a,{closeSnackbar:l}=Xr(),c=q.useTheme(),[m,C]=n.useState(!1),x=je.ErrorUtils.collectErrorChain(s,!0)?.[0]?.error,f=x&&!(x instanceof je.ExpectedError),p=n.useCallback(()=>{C(h=>!h)},[]),y=n.useCallback(()=>{l(o)},[o,l]);let S=x?.message;return!S&&n.isValidElement(t)&&(S=t),S||typeof t!="string"||(S=t),S||(S=`Unknown Error: ${t}`),e.jsx(fn,{ref:i,className:ie(Ae.root,"error-snackbar"),children:e.jsxs(E.Card,{className:Ae.card,style:{backgroundColor:c.palette.error.dark,border:`1px solid ${c.palette.error.dark}`},children:[e.jsxs(E.CardActions,{className:Ae.actionRoot,children:[d?null:r?.error,e.jsx(E.Typography,{variant:"body2",component:"div",className:Ae.typography,children:S}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsxs("div",{className:Ae.icons,children:[f?e.jsx(E.IconButton,{"aria-label":"Show more",size:"small",className:ie(Ae.expand,{[Ae.expandOpen]:m}),onClick:p,children:e.jsx(w.DynamicIcon,{iconKey:"ExpandMore"})}):null,e.jsx(E.IconButton,{size:"small",className:Ae.expand,onClick:y,children:e.jsx(w.DynamicIcon,{iconKey:"Close",style:{transform:"scale(0.8)"}})})]})]}),f?e.jsx(E.Collapse,{in:m,timeout:"auto",children:e.jsx("div",{className:Ae.stackTraceContainer,style:{backgroundColor:c.palette.error.light,borderTop:`1px solid ${c.palette.error.main}`},children:e.jsx(b.StackTrace,{error:s,hideLineNumbers:!0})})}):null]})})}));Zr.displayName="ToastError";const Qr=n.memo(n.forwardRef((a,i)=>{const{commands:o,commandHook:t,scope:r="workbook",disabled:s=!1,...d}=a,u=w.useCallbackRef(c=>{const m={variant:w.CommandButtonType.Menuitem,parentFloat:c.floatReference,commandHook:t,scope:r,disabled:s},C=e.jsxs(e.Fragment,{children:[e.jsx(b.CommandButton,{...m,command:o.getCommand("newWorkbook")}),e.jsx(b.ExhibitDivider,{orientation:"horizontal"}),e.jsx(b.CommandButton,{...m,command:o.getCommand("openWorkbook")}),e.jsx(b.CommandPopupButton,{...m,commands:o,quickCommand:"saveWorkbook",createPopupPanel:x=>{const f={...m,parentFloat:x.floatReference,scope:"saveWorkbook"},p=[];return $e.getWriteFormats().forEach(y=>{if(y.isDefault)return;const S=y.key,h=o.getCommand(`saveWorkbookAs${S}`);h?p.push(n.createElement(b.CommandButton,{...f,key:S,command:h})):console.warn(`Unable to resolve command: 'saveWorkbookAs${S}'`)}),b.defaultCreatePopupPanel({...x,children:p,onClick:()=>{x.closeFloatAll()}})}})]});return b.defaultCreatePopupPanel({...c,children:C,onClick:x=>{x.isDefaultPrevented||c.closeFloatAll()}})},[s,o,t,r]),l="File";return e.jsx(b.CommandPopupButton,{commands:o,disabled:s,commandHook:t,scope:r,label:l,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:c=>`calc(1.25rem + ${c.spacing(2)}px)`}},...d,createPopupPanel:u,icon:e.jsx(b.LabelIcon,{className:"label",icon:null,label:l})})}));Qr.displayName="StandaloneFileCommandButton";const ss=e.jsx(b.ExhibitTooltip,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:e.jsx(E.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:e.jsx(oe.LogoNoPaddingIcon,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Jr=n.memo(n.forwardRef((a,i)=>{const{commands:o,workbook:t,logo:r=ss,mainElement:s,showFileMenu:d=!0,showAppearanceMenu:u=!0,...l}=a,{reference:c}=b.useFloatStack(),[m,{width:C}]=Ve(),x=C<530,f=d?e.jsx(Qr,{commands:o,commandHook:{beforeExecute(){c?.closeAll()},onError(h,g,k){}}}):null,p=u?e.jsx(Fr,{commands:o,commandHook:{beforeExecute(){c?.closeAll()},onError(h,g,k){}}}):null,y=n.useMemo(()=>({paddingLeft:h=>h.spacing(1),paddingRight:h=>h.spacing(1)}),[]),S=n.useRef(null);return e.jsx(E.Box,{ref:et([S,m,i]),...l,children:vr({commands:o,renderCompact:x,workbook:t,selectWrapper:h=>e.jsxs(E.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:g=>g.spacing(1),paddingLeft:g=>g.spacing(1),paddingRight:g=>g.spacing(1)},children:[e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:g=>g.spacing(.5)},children:[r,e.jsxs(E.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:g=>g.spacing(.25)},children:[f,h]})]}),e.jsx(E.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:s}),e.jsx(E.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:x&&!p?"0 0 auto":"1 1 100%"},children:p})]}),selectProps:y,toolbarsProps:{Home:{sx:{}}}})})}));Jr.displayName="StudioToolbar";const ei=n.memo(a=>{const{workbook:i,setWorkbook:o,refWorkbookTitle:t,titleWorkbook:r,setWorkbookTitle:s,titlePlaceHolder:d,children:u,undoManager:l,commands:c,importExportDisabled:m,themeOptions:C}=a,x=(y=>{const{workbook:S,setWorkbook:h,importExportDisabled:g,workbookTitle:k="export",setWorkbookTitle:j,requestWorkbookTitle:v,themeOptions:T,undoManager:M,commands:R,onExecute:D}=y,F=w.useNotifier(),B=w.useCallbackRef(T?.onModeChange,[T?.onModeChange]),P=w.useCallbackRef(T?.onEnabledDarkGridChange,[T?.onEnabledDarkGridChange]),N=w.useCallbackRef(T?.onEnabledDarkImagesChange,[T?.onEnabledDarkImagesChange]),z=w.useCallbackRef(async($=null,U=null)=>{const Y=[];let _,L=null,G=null;if(typeof $=="string"?G=$:L=$,_=L?$:await je.CommonUtils.openFileDialog(G??$e.getAllReadFormatTypeAsString().join(",")),!_)return null;const Q={source:_,createWorkbookOptions:U,onWarning:re=>{Y.push(re)}},fe=await $e.read(Q,F);return Y.length>0&&(F.showMessage("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
|
|
19
|
+
`+Y.join(`
|
|
20
|
+
`))),fe},[D,F,S]),O=w.useCallbackRef(async($,U,Y)=>{if(!U&&v){const _=await v("Enter Workbook name to "+(Y.isDefault?"Save.":`Export as ${Y.description}.`));return _!==null&&$e.writeFile(_,$,{formatType:Y.key})}return $e.writeFile(U,$,{formatType:Y.key})},[F,S,v]),H=n.useCallback(()=>({contains:$=>!0,focus(){}}),[]),I=n.useMemo(()=>{const $=[];g||($e.getWriteFormats().forEach(Y=>{const _=Y.isDefault,L={label:_?"Save Workbook":`Save Workbook as ${Y.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${Y.description}`},tags:Y.tags,description:`Save the workbook to the desktop${_?"":` as ${Y.description}`}.`,icon:"FileDownloadAsSheet"};_&&(L.shortcut={key:"S",modifiers:[w.KeyModifiers.Ctrl]},$.push(new w.Command("saveWorkbookAs",H,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[w.KeyModifiers.Shift,w.KeyModifiers.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{O(S,null,Y).catch(fe=>{F.showError(fe)})})));const G=Y.key,Q=_?"saveWorkbook":`saveWorkbookAs${G}`;G==="CSV"?L.icon="FileDownloadAsCSV":G==="Excel"&&(L.icon="FileDownloadAsExcel"),$.push(new w.Command(Q,H,L,fe=>{O(S,fe??k,Y).catch(re=>{F.showError(re)})}))}),$.push(new w.Command("openWorkbook",H,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",icon:"FileOpen",shortcut:{key:"O",modifiers:[w.KeyModifiers.Ctrl]}},async(Y=null)=>{const _={date1904:S.isDate1904(),...S.options};try{const L=await z(Y,_);if(!L)return;const G=L.title,Q=L.workbook,fe=Q.getSelectedSheet();if(L.formatType.mimeType==="text/csv"){const re=S.findValidSheetName(G);await S.doBatch(async()=>{const ue={colStart:0,rowStart:0,colEnd:0,rowEnd:0};let Se=fe.getUsedRange();if(!Se)return void F.showMessage("The file appears to be blank.");Se=Se.getUnion(ue),await S.getSheets().add({name:re,autoSelect:!0}).getRange(ue).copyFrom(Se)},`Import CSV '${G}'`)}else S?.close(),j?.(G),h(Q)}catch(L){F.showError(L)}})),$.push(new w.Command("openWorkbookFromUrl",H,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(Y){if(!Y){const _=await F.showInput({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(_.option!=="Open")return;Y=_.input}Y&&console.log("openWorkbookFromUrl",Y)})));let U=[];return T&&(U=[new w.Command("themeMode",H,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new w.Command("defaultThemeMode",H,{label:"Use System Light/Dark Mode",scopedLabels:{appearance:"Use System Default"},description:"Use the system settings to determine styling for light and dark mode."}),new w.Command("enableDarkGrid",H,{label:"Enable Dark Grid",description:"Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)."}),new w.Command("enableDarkImages",H,{label:"Enable Dark Images",description:"Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode."})]),[...$,...U,new w.SimpleCommand("help",H,{label:"Show Help",description:"Provide Help.",icon:"Documentation",shortcut:{key:"F1"}},()=>{}),new w.SimpleCommand("showKeyboardShortcuts",H,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",icon:"Keyboard",shortcut:{key:"/",modifiers:[w.KeyModifiers.Ctrl]}},()=>{}),new w.Command("gotoUrlGithub",H,{label:"Github",description:"Download examples, explore source code, and leave a star.",icon:"Github"},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new w.Command("gotoUrlDiscord",H,{label:"Discord",description:"Join our community on discord.",icon:"Discord"},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new w.Command("gotoUrlDocumentation",H,{label:"Documentation",description:"Read the documentation.",icon:"Documentation"},()=>{window?.open("https://www.sheetxl.com/docs")}),new w.Command("gotoUrlIssue",H,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request.",icon:"Ticket"},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[S,k,F,g,T,R,M]),W=n.useMemo(()=>{let $=null;return $=R?R.createChildGroup(H,"standaloneWorkbook",!1):new w.CommandGroup(H,"standaloneWorkbook"),$.addCommands(I,!0),$},[R,I]);w.useUndoManager({manager:M,commands:W});const ee=E.useMediaQuery("(prefers-color-scheme: dark)"),{themeMode:X}=b.useResolvedThemeMode();n.useEffect(()=>{if(!T||!W)return;const $=T.mode==="dark"||!T.mode&&X==="dark";W.getCommand("themeMode").update({state:T.mode??null,label:$?"Dark Mode":"Light Mode",scopedLabels:{appearance:$?"Dark Mode":"Light Mode"},icon:$?"DarkMode":"LightMode"}).updateCallback(()=>{B($?b.ThemeMode.Light:b.ThemeMode.Dark)}),W.getCommand("defaultThemeMode").update({state:!T.mode,icon:ee?"SystemDefaultDarkMode":"SystemDefaultLightMode"}).updateCallback(()=>{B(null)}),W.getCommand("enableDarkGrid").update({state:T.enableDarkGrid}).updateCallback(()=>{P(!T.enableDarkGrid)}),W.getCommand("enableDarkImages").update({state:T.enableDarkImages}).updateCallback(()=>{N(!T.enableDarkImages)})},[X,T,I]);const{showModal:ne}=b.useModal();return n.useEffect(()=>{const $=()=>new Promise((U,Y)=>{const _=n.lazy(()=>Promise.resolve().then(()=>require("./BXSBqvJbFd1zmXED.cjs"))),L=ne(_,{title:"Shortcut Keys Reference",commands:W,onDone:()=>{L.hide()},slotProps:{transition:{onExited:()=>{U(!0)}}}})});W.getCommand("showKeyboardShortcuts").updateCallback(()=>$()),W.getCommand("help").updateCallback(()=>$())},[I,W]),W})({workbook:i,setWorkbook:o,importExportDisabled:m,workbookTitle:r,setWorkbookTitle:s,commands:c,requestWorkbookTitle:y=>new Promise(S=>{t.current?t.current.requestWorkbookTitle((h,g)=>{S(h)},{selectAll:!0,requestReason:y}):S(d)}),themeOptions:C,undoManager:l,onExecute:n.useCallback(()=>{},[])}),f=n.useMemo(()=>e.jsx(Ir,{commands:x,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[x]),p={commands:x};return i&&(p.statusBarProps={childrenEnd:f}),u?n.cloneElement(u,p):null});ei.displayName="CommandsWrapper";const ti=n.memo(a=>{const{children:i}=a,o=Xr(),t=o?o.enqueueSnackbar:()=>{},r=o?o.closeSnackbar:()=>{},[s,d]=n.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),u=n.useCallback(()=>{d(h=>({...h,isMounted:!0}))},[]),l=n.useCallback(()=>{d(h=>({...h,isMounted:!1}))},[]),c={},m=b.useLazyWindow(c),C=b.useOptionsDialog(c),x=b.useInputDialog(c),f=n.useRef(new Set),p=n.useMemo(()=>{const h=(j,v)=>{if(v?.onceKey){if(f.current.has(v.onceKey))return;const M=new Set(f.current);M.add(v.onceKey),f.current=M}const T={variant:v?.type??w.NotifierType.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:v?.preventDuplicate,persist:v?.persist??v?.type===w.NotifierType.Error,action:M=>e.jsx(E.IconButton,{onClick:()=>r(M),children:e.jsx(w.DynamicIcon,{iconKey:"Cancel"})})};v?.enqueueProps&&Object.assign(T,v.enqueueProps),j||console.log("message is 'null'",v),t(j??"Alert",T)},g={showMessage:h,showBusy:(j,v)=>{let T=null;const M=new Promise(R=>{T=R});return d(R=>{const D=new Map(R.starting);return D.set(M,T),{...R,label:j,starting:D}}),M},showWindow:(j,v)=>{const T=v;return v={...v,onKeyDown:M=>{M.isDefaultPrevented()||M.isPropagationStopped()||T?.onKeyDown?.(M)}},m(j,{sort:()=>Promise.resolve().then(()=>require("./gmJVh5GO4raegeQH.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./BY_Yr3aQW5hLO-nN.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./BXpuqWQiSePSVD7I.cjs")),comments:()=>Promise.resolve().then(()=>require("./_A_9JrHZzYhVIimw.cjs")),find:()=>Promise.resolve().then(()=>require("./CyLVMzcTgEZPvYOm.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./BAcqVi4z0lEWdogG.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./DD9bJC3Knid6T5It.cjs")),resizeHeader:()=>Promise.resolve().then(()=>require("./CYeknazLzZOjQtcK.cjs"))}[j],v)},showOptions:C,showInput:x,showError:j=>{let v,T=w.NotifierType.Error,M="Unknown Error";typeof j=="string"?M=j:j instanceof Error&&(v=j,j.message&&(M=j.message)),j instanceof je.PartialError&&(T=w.NotifierType.Info),h(M,{type:T,enqueueProps:{error:v}})}},k=new w.DefaultReactNotifier;return k.setOverrides(g),k},[]);n.useEffect(()=>{s.starting.size<=0||!s.isMounted||d(h=>{const g=new Map(h.running);return h.starting.forEach((k,j)=>{const v=()=>{d(T=>{const M=new Map(T.running);return M.delete(j),{...T,running:M}})};g.set(j,v),k(v)}),{...h,starting:new Map,running:g}})},[s]);const[y,S]=n.useState(null);return n.useEffect(()=>{s.starting.size!==0||s.running.size!==0?S(e.jsx(b.LoadingPanel,{icon:e.jsx(b.AnimatedTraversingEllipsisIcon,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:s.label,onMount:u,onUnmount:l,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):S(null)},[s.starting,s.running]),e.jsxs(w.NotifierProvider,{notifier:p,children:[y,i]})});ti.displayName="SnackbarWrapper";const cs=n.memo(n.forwardRef((a,i)=>{const{children:o,title:t,taskPanes:r,onSelect:s,selected:d,registry:u=oe.DefaultTaskPaneRegistry,style:l,iconsOnly:c,className:m,...C}=a,x=n.useMemo(()=>r.map(y=>{const S=u.getRegisteredTaskPane(y);if(!S)return null;let h=S.getIcon?.();h&&(typeof h=="string"&&(h=e.jsx(w.DynamicIcon,{iconKey:h})),h=e.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:h}));const g=y===d;return e.jsx(E.Tab,{value:y,label:e.jsx(b.SimpleTooltip,{disableInteractive:!0,title:S.getTitle()??"",placement:"left-start",children:e.jsxs(E.Box,{sx:{padding:"0px 0px",writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",minWidth:"0px",color:k=>k.palette.text.secondary},children:[h&&e.jsx(E.Box,{sx:{display:"inline-block",transformOrigin:"center",color:k=>k.palette.text.secondary},children:h}),c&&h?null:e.jsx(E.Typography,{component:"div",textTransform:"none",sx:{padding:"4px 0px",color:k=>g?k.palette.primary.main:k.palette.text.secondary},children:S.getTitle()})]})}),sx:{padding:"4px 4px",minWidth:"0px",minHeight:"0px",borderRadius:"4px"},className:ie("taskpane-strip-item",{"Mui-selected":g}),onClick:()=>a.onSelect(y)},y)}),[r,d,s,u]),f=w.useImperativeElement(i,()=>({isTaskPaneStrip:()=>!0}),[]),p=n.useMemo(()=>ie("taskpane-strip",m),[m]);return e.jsx(E.Box,{ref:f,className:p,sx:{paddingLeft:"2px",paddingTop:"4px",...l},...C,children:e.jsx(E.Tabs,{orientation:"vertical",variant:"scrollable",value:d,onChange:(y,S)=>{s(S)},slotProps:{list:{sx:{gap:"2px"}},indicator:{sx:{left:"0px",right:"unset"}}},children:x})})})),ds=(a,i)=>e.jsx(cs,{ref:i,...a}),ms=n.forwardRef((a,i)=>{const{commands:o,model:t,...r}=a,s=q.useTheme(),d=`solid ${q.alpha(s.palette.divider,.2)} 1px`,u=`${s.shape.borderRadius??4}px`,l=`${s.spacing?.(.5)??4}px`,c=n.useRef(null);return e.jsx(oe.TaskPaneArea,{model:t,ref:i,frameProps:{style:{border:d,borderRadius:u,marginBottom:l}},alwaysShowStrip:!0,renderTaskPanelTitle:(m,C)=>{const{title:x,icon:f,onClose:p,readOnly:y,focused:S,...h}=m;return e.jsx(E.DialogTitle,{className:ie({"Mui-selected":S}),sx:{display:"flex",flex:"1 1 %0",color:g=>g.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:g=>`${g.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:g=>g.transitions.duration.shortest/2+"ms"},backgroundColor:g=>q.alpha(g.palette.action.hover,.03),borderBottom:g=>`solid ${q.alpha(g.palette.divider,.2)} 1px`},...h,children:e.jsxs(E.Box,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:g=>g.spacing(.25),marginBottom:g=>g.spacing(.25),marginLeft:g=>g.spacing(1),marginRight:g=>g.spacing(1)},children:[e.jsx(E.Box,{sx:{flex:"1 1 100%",paddingLeft:g=>g.spacing(1)},children:x}),e.jsx(b.ExhibitTooltip,{label:"Close",children:e.jsx(E.IconButton,{"aria-label":"close",sx:{color:g=>g.palette.text.icon??g.palette.action.active},touchRippleRef:c,onPointerDown:g=>{c.current?.start(g,{center:!1}),g.stopPropagation(),g.preventDefault()},onPointerUp:()=>{p()},children:e.jsx(w.DynamicIcon,{iconKey:"Close"})})})]})})},renderTaskPaneStrip:ds,...a,onOpen:()=>{a?.onOpen?.()},onClose:()=>{a?.onClose?.()},commands:o,...r})}),wa={flex:"1 1 100%",display:"flex",boxSizing:"border-box"},oi=n.memo(n.forwardRef((a,i)=>{const{mainElement:o,sidebarElement:t,className:r,style:s,...d}=a,u=q.useTheme(),[l,{width:c}]=Ve(),m=c>530||c===0,C=n.useRef(null);let x=null,f=4,p=13;return m?x="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(x="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",f=13,p=4),e.jsx(w.SplitPane,{ref:et([C,l,i]),className:r,style:s?{...wa,...s}:wa,...d,fixedPane:"after",position:"40%",minAfter:m?"280px":"120px",splitDirection:m?"row":"column",resizerProps:{className:"styled-resizer",style:{minWidth:m?"6px":void 0,minHeight:m?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${f}' height='${p}' viewBox='0 0 ${f} ${p}' version='1.1' fill='${u.palette.text.icon??u.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${x}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:m?"left center":"top center"}},elementBefore:o,paneBeforeProps:{style:{flexDirection:"column",marginRight:t?void 0:"6px"}},elementAfter:t,paneAfterProps:{style:{marginLeft:m?"0px":"4px",marginRight:m?"8px":"4px"}}})}));oi.displayName="StudioSplitPane",Mr(),w.DefaultDynamicIconService.register("plugin-scripts",{icons:{}}),oe.DefaultTaskPaneRegistry.registerTaskPane({key:"scriptEditor",getTitle:()=>"Script (Typescript)",getIcon:()=>"ScriptRun",renderTaskPane:cl},!0);const ro=n.memo(n.forwardRef((a,i)=>{const{className:o,sx:t,style:r,onElementLoad:s,onError:d,undoManager:u,errorPanel:l=b.ErrorPanel,onKeyDown:c,workbook:m,createWorkbookOptions:C,onWorkbookChange:x,logo:f,importExportDisabled:p=!1,themeOptions:y,autoFocus:S=!1,commands:h,title:g,onTitleChange:k,titleProps:j,renderLoadingPanel:v,...T}=a,M=n.useRef(null),R=w.useCallbackRef(x,[x]),D=w.useCallbackRef(k??j?.onTitleChange,[k??j?.onTitleChange]),F=j?.placeHolder??"Untitled",B=y?.mode,{themeMode:P,source:N}=b.useResolvedThemeMode({mode:B}),z=n.useMemo(()=>({...y,light:b.createExhibitTheme(!1,je.CommonUtils.deepMerge(y?.theme??{},y?.light??{})),dark:b.createExhibitTheme(!0,je.CommonUtils.deepMerge(y?.theme??{},y?.dark??{}))}),[y]),O=P===b.ThemeMode.Dark,[H,I]=n.useState(null);n.useEffect(()=>{I(u??new je.UndoManager)},[u]);const[W,ee]=n.useState(null),[X,ne]=n.useState(null),$=oe.useDocThemes();n.useLayoutEffect(()=>{if(!m||Object.keys(m).length===0&&!je.CommonUtils.isPromiseLike(m)){const Z={theme:$.getDefaultTheme(),...C};ne(new A.Workbook(Z))}else ne(m)},[m]),n.useLayoutEffect(()=>{if(X){if(X instanceof A.Workbook)return ee({workbook:X}),void(m!==X&&R?.(X));(async()=>{try{let Z,le=await Promise.resolve(X);le&&le.source&&(le=await $e.read(le)),le.workbook?(G(le.title),Z=le.workbook):Z=le,R?.(Z),ee({workbook:Z})}catch(Z){R?.(null),ee({error:Z})}})()}},[X]);const[U,Y]=n.useState(null);n.useEffect(()=>{if(!H||!W)return;H.clear();const Z=W?.workbook?.getTransactions();if(Z)return Z.addListener({onCommitEnd:le=>{le.getDescription()?H.addUndoOperation({description:le.getDescription(),undo:()=>(Z.revert(le.getId()),U.source?.focus(),()=>{Z.restore(le.getId()),U.source?.focus()})}):console.warn("commit has no description",le)}})},[H,W,U]);const _=w.useCallbackRef(Z=>{Z?H.setRepeatableOperation({description:Z.label(),repeat:async()=>Z.execute()}):H.setRepeatableOperation(null)},[H]),[L,G]=n.useState(g??j?.title??"");n.useEffect(()=>{G(g??j?.title??"")},[g??j?.title]),n.useEffect(()=>{D?.(L)},[L]);const[Q,fe]=n.useState(null),re=n.useMemo(()=>{const Z=()=>({contains:le=>!0,focus(){}});return h?h.createChildGroup(Z,"application",!1):new w.CommandGroup(Z,"application")},[h]),ue=w.useCallbackRef(async Z=>{fe(Z.source.getViewportElement()),Y(Z),re.activate("sheet"),await w.DefaultDynamicIconService.prefetch(),s?.(Z)},[re]);n.useEffect(()=>{U&&S&&U.source?.focus(typeof S=="object"?S:void 0)},[U]);const Se=n.useRef(null),Ce=n.useCallback(Z=>{let le=null;return j?.hidden||(le=e.jsx(sn,{...j,style:{maxWidth:"100%",...j?.style},workbook:M.current,ref:Se,title:L,placeHolder:F,onTitleChange:Ke=>{G(Ke)}})),e.jsx(Jr,{...Z,logo:f,mainElement:le,showFileMenu:!p,showAppearanceMenu:!!(z?.onEnabledDarkGridChange||z?.onEnabledDarkImagesChange||z?.onModeChange)})},[f,L,j,z,p,re]);n.useEffect(()=>{const Z=le=>le.preventDefault();return M.current?.addEventListener("wheel",Z,{passive:!1}),()=>{M.current?.removeEventListener("wheel",Z)}},[]);const J=n.useMemo(()=>{const Z={transparentBackground:!0};return e.jsx(E.Box,{sx:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",...r},children:v?.(Z)??e.jsx(b.LoadingPanel,{...Z})})},[t,r,v]),K=n.useCallback(({error:Z})=>(d?.(Z),e.jsx(l,{sx:t,style:r,error:Z??"Unable to display empty workbook."})),[t,r,d]),te=n.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-SnackbarContainer > div":{maxWidth:"100%"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-Snackbar > .error-snackbar .MuiTypography-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiCardActions-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root":{color:Z=>Z.palette.getContrastText(Z.palette.error.main)},"& .notistack-MuiContent *":{fontFamily:Z=>Z.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),[de,ve]=n.useState(null),se=n.useCallback((Z,le)=>e.jsx(ms,{ref:le,model:X,commands:re,...Z}),[re,X]),De=n.useCallback(Z=>e.jsx(oi,{mainElement:Z,sidebarElement:de}),[de]),Te=et([M,i]),Ne=n.useMemo(()=>{if(!W)return J;if(W.error||!W.workbook)return K({error:W.error});let Z=null,le=null,Ke=!1;return z&&(Z=O?z.dark:z.light,le=O&&z.enableDarkGrid?z.dark:z.light,Ke=z.enableDarkImages),e.jsx(ln,{sx:te,style:r,tabIndex:0,autoFocus:!0,workbook:W.workbook,ref:Te,renderToolbar:Ce,onElementLoad:ue,onRepeatCommandChange:_,onKeyDown:ht=>{c?.(ht)},renderLoadingPanel:v,gridTheme:le,headersTheme:Z,enableDarkImages:Ke,mainWrapper:De,className:ie(o),onContextMenu:ht=>ht.preventDefault(),...T},"WorkbookElement")},[W,L,H,J,v,z,T,Ce,te,De]);let me=e.jsx(rs,{maxSnack:3,domRoot:Q,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(Z,le,Ke)=>{M.current?.focus()},Components:{error:Zr},iconVariant:{success:e.jsx(E.SvgIcon,{style:{marginRight:"8px"},children:e.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})}),error:e.jsx(w.DynamicIcon,{iconKey:"ErrorAlert",style:{marginRight:"8px"}})},children:e.jsx(oe.TaskPaneProvider,{createArea:se,onUpdateArea:Z=>{ve(Z)},children:e.jsx(b.ModalProvider,{children:e.jsx(ti,{children:e.jsx(w.UncaughtErrorBoundary,{children:e.jsx(w.ReactErrorBoundary,{children:e.jsx(ei,{workbook:W?.workbook,setWorkbook:ne,importExportDisabled:p,titlePlaceHolder:F,titleWorkbook:L,setWorkbookTitle:G,refWorkbookTitle:Se,commands:re,undoManager:H,themeOptions:z,children:Ne})})})})})})});return z&&(me=e.jsxs(q.ThemeProvider,{theme:O?z.dark:z.light,children:[z.cssBaseline?e.jsx(E.CssBaseline,{}):null,me]})),me}));ro.displayName="EagerStudio";const us=Object.freeze(Object.defineProperty({__proto__:null,EagerStudio:ro,default:ro},Symbol.toStringTag,{value:"Module"}));exports.AppearanceCommandButton=Fr,exports.AutoColorPosition=ut,exports.BorderCommandButton=Fa,exports.BorderPopupButton=Da,exports.BorderStylePopupButton=Ma,exports.CellsDeleteCommandButton=Ho,exports.CellsFormatCommandButton=Wo,exports.CellsInsertCommandButton=zo,exports.Checkboard=Pa,exports.ClearCommandButton=Lo,exports.ColorButton=io,exports.ColorButtonList=Dt,exports.ColorCommandButton=ft,exports.ColorPanel=Ra,exports.ColorPanelType=Ea,exports.ColorPopupButton=Ao,exports.DocThemeCommandButton=Dr,exports.EagerStudio=ro,exports.FillCommandButton=za,exports.FilterColumnMenu=Jo,exports.FilterCommandButton=Vi,exports.Filters=cr,exports.FindCommandButton=Oa,exports.FontFamilyCommandButton=$a,exports.FontSizeCommandButton=Aa,exports.FormulaBar=Qo,exports.FreezeCommandButton=Na,exports.HelpCommandButton=Ir,exports.HorizontalAlignCommandButton=va,exports.InsertFunctionCommandPopupButton=Nr,exports.InsertFunctionSumCommandPopupButton=mn,exports.InsertImageCommandButton=dn,exports.MergeCommandButton=Ia,exports.NamedCollectionEditor=Zo,exports.NamedInput=Uo,exports.NumberFormatCommandButton=La,exports.PasteCommandButton=_o,exports.PresetCellStylesCommandButton=Ga,exports.PresetTableStylesCommandButton=cn,exports.RangeInput=qo,exports.SheetTab=en,exports.SheetTabMenu=tn,exports.SheetZoomScale=Go,exports.SheetsAllMenu=on,exports.SortFilterCommandButton=$o,exports.StatusBar=Xo,exports.Studio=Or,exports.StyledStrokeIcon=Mo,exports.TableDetailsPanel=Pr,exports.TableDetailsTaskPane=Rr,exports.TablePlugin=Mr,exports.TableStyleCanvasPreview=Ya,exports.TableStyleOptionsPanel=Za,exports.TableStylePreview=Ko,exports.TextEffectsCommandButton=Va,exports.TextOverflowCommandButton=Ta,exports.TextRotateCommandButton=Ba,exports.ThemeSelectButton=tr,exports.ThemeSelectPanel=or,exports.ThemeSelectPopupButton=nr,exports.UnderlineCommandButton=_a,exports.UndoRedoCommandButton=Vo,exports.VerticalAlignCommandButton=ja,exports.ViewGridLinesCommandButton=Ha,exports.ViewHeadingsCommandButton=Ka,exports.WalkingCopyCommandButton=so,exports.WorkbookContextMenu=rn,exports.WorkbookElement=ln,exports.WorkbookIO=$e,exports.WorkbookStrip=an,exports.WorkbookTitle=sn,exports.WorkbookViewCommandButton=Ua,exports._WorkbookIO=Yr,exports._extends=oo,exports._objectWithoutPropertiesLoose=nn,exports._setPrototypeOf=no,exports.clsx=_e,exports.clsx$1=ie,exports.commonjsGlobal=dt,exports.createGridStyleFromMUITheme=Io,exports.defaultNewWorkbook=Br,exports.getDefaultExportFromCjs=function(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a},exports.requirePropTypes=Ot,exports.setPrintExamplesOnLoad=a=>{dr=a},exports.useMeasure=Ve,exports.useWorkbookCommands=Tr;
|