@sheetxl/studio-mui 1.0.4 → 1.0.6

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.
Files changed (149) hide show
  1. package/browser/esm/{N5L4wQxRGEOH_wbp.mjs → 6wAcMpoIZS1ffzqR.mjs} +3 -3
  2. package/browser/esm/{DHmh3sMFGq4sRPhh.mjs → AVMBYVWPe170RO8d.mjs} +20 -20
  3. package/browser/esm/{D_r8MdiauI15ds00.mjs → B2k09pbNHOie-ZPU.mjs} +5 -5
  4. package/browser/esm/B5hj7BR72rs3Xx2-.mjs +40 -0
  5. package/browser/esm/{jDqohhLNEI6wqjo7.mjs → BK0H9A2QjD4YqPxq.mjs} +2 -2
  6. package/browser/esm/{CHfzSl32Bs6LVY3G.mjs → BMtR4PaoNnEhVh2U.mjs} +243 -245
  7. package/browser/esm/{DZngQvRDu3Qh7_uy.mjs → BVQX7HEZNPIvf0Bg.mjs} +1 -1
  8. package/browser/esm/BZWyHJnsP5yHfByl.mjs +461 -0
  9. package/browser/esm/{n1z1c9np4M3gMGCX.mjs → BaYDGaXi_5fNEPo1.mjs} +1 -1
  10. package/browser/esm/{B4vVBfkY4Oq6M196.mjs → BgOevzKxdIm3FqSz.mjs} +4 -4
  11. package/browser/esm/{BH1Qj4pv8pPWZVhO.mjs → BgvcXlX-fe99mlfa.mjs} +1 -1
  12. package/browser/esm/{BDSYU5nx_6eGxAa4.mjs → BmJRmCarQ2Y_DhcS.mjs} +6 -6
  13. package/browser/esm/{Cf6bsmEPyPpiNtxU.mjs → BnIfAdE8Qnu8RF3t.mjs} +1 -1
  14. package/browser/esm/{B130jd-PqNgY2pV8.mjs → Bu4IunF89gqzLc6A.mjs} +2 -2
  15. package/browser/esm/{B4EWee1CcAHS5vAA.mjs → BvvD5BVF5uSL-2Ow.mjs} +2 -2
  16. package/browser/esm/{CzWXYarhfF4mF8fj.mjs → Bzr0CzpORAOD9X-l.mjs} +1 -1
  17. package/browser/esm/{CEvJVwoVP9nscIcl.mjs → C-lKdgOAbn4Ycu7e.mjs} +2 -2
  18. package/browser/esm/{CFiyY-_XmW7G0_9y.mjs → C211u9yUXa4149g9.mjs} +1 -1
  19. package/browser/esm/{DoJ8N6FhUY0kYz9u.mjs → C7RPgX_8hKN1Umxm.mjs} +2 -2
  20. package/browser/esm/{DqP1sKmMsG0tKwmV.mjs → C9cBnewCaYFf2JV6.mjs} +21 -22
  21. package/browser/esm/{Cx1r__xbzz-5zZgw.mjs → CA42_0vpQwF292tA.mjs} +1 -1
  22. package/browser/esm/{D1WSqegx9Zbjc-cL.mjs → CAbY1N8X3Iryy2XC.mjs} +4 -4
  23. package/browser/esm/{k0bdGBFIHCTGANHW.mjs → CD6iCHysAki3ui3u.mjs} +4 -4
  24. package/browser/esm/{DVQZtsBbf_Fsh-B6.mjs → CFUur1yDoVOJMuo5.mjs} +1 -1
  25. package/browser/esm/{npsX_Rztx4_7rCGP.mjs → CHb2gapathcPfhdM.mjs} +5 -5
  26. package/browser/esm/{94_olh2OyEbGAcNw.mjs → CIZh3NmE8QG5ZkiA.mjs} +2 -2
  27. package/browser/esm/{BBNFlngSL8Y3242O.mjs → CImvd-NxbJGZOozE.mjs} +1 -1
  28. package/browser/esm/{Me9wSTkBepRyMDHH.mjs → CO-AxUDR6qjjgpyK.mjs} +2 -2
  29. package/browser/esm/CQ1ArTuEvBmc7W5I.mjs +695 -0
  30. package/browser/esm/{uV_YgeJoyPa9SdGV.mjs → CVNzlTdizLlhU05M.mjs} +2 -2
  31. package/browser/esm/{D2YXkXpEcP-NqHMv.mjs → CXwkm9x8MkCxPz74.mjs} +1 -1
  32. package/browser/esm/{WQaRUnIjMCkaRwsb.mjs → CZIV7UuyM5VGNrJT.mjs} +4 -4
  33. package/browser/esm/{BQTUWwRUxgqg4s6Y.mjs → CdK1lF_PdSw6YfAo.mjs} +1 -1
  34. package/browser/esm/{DoYGmNZ_X3Kvxx3K.mjs → CpgoYQ3P-S7njA7p.mjs} +2 -2
  35. package/browser/esm/{ph1FP1S-yYM0I269.mjs → CqEyDFDlQ75w1c41.mjs} +2 -2
  36. package/browser/esm/{BYUokd7Q6y5Xw36U.mjs → CqIX3rp_vI2S2KbN.mjs} +2 -2
  37. package/browser/esm/{NSuxs1P3kFsoLIMa.mjs → Csmz2j1S5pk-J0B3.mjs} +2 -2
  38. package/browser/esm/{B0q0gHDAexrBB16B.mjs → CsuFocZfRucugR3q.mjs} +1153 -922
  39. package/browser/esm/{SHaQophNZjobC_4f.mjs → Cw6wZyiZkwn9DPZn.mjs} +193 -105
  40. package/browser/esm/{m5mPoZGqgwOCQQOs.mjs → D91G6sYfKgwC24dQ.mjs} +1 -1
  41. package/browser/esm/{B1SDDlETvGUJ2Ipu.mjs → DF_ssRdRHuBueJgX.mjs} +89 -102
  42. package/browser/esm/{CWgz8hWLf3OzuMyZ.mjs → DJaMl_5NGyq62zwW.mjs} +1 -1
  43. package/browser/esm/DLixDE7fzzurotzQ.mjs +826 -0
  44. package/browser/esm/{dlNcqumPfehZG2ai.mjs → DM86XhEF4qmUnjuK.mjs} +4 -4
  45. package/browser/esm/{BrFq6SNq-qx1PYZO.mjs → DNXDqUO4_S_N8sSC.mjs} +2 -2
  46. package/browser/esm/{BMIfZN_dgjS_p-pF.mjs → DfrMUwmPoZFEFJFk.mjs} +1 -1
  47. package/browser/esm/{BESsacbR41SalUJv.mjs → Dn3ur1I_S9SlR8vu.mjs} +1 -1
  48. package/browser/esm/{CbCTAkfOjIThF31A.mjs → IUt6EgxYCpZe9iCH.mjs} +2 -2
  49. package/browser/esm/{a7OD-X4Jjp810Y6v.mjs → JNoXh3IYri5h1W3Y.mjs} +1 -1
  50. package/browser/esm/{1JW5qOuAMlejsOrm.mjs → LZ2X5C1kjiwUCDGz.mjs} +2 -2
  51. package/browser/esm/{DlZoddGNGipM3S72.mjs → MSkt-6o2ZLEiAbDl.mjs} +1 -1
  52. package/browser/esm/{MR6LXUjaCV0DShNi.mjs → bQOt-2VGBciMnvp_.mjs} +3 -3
  53. package/browser/esm/{CbC8ObddTe-7ix6F.mjs → drMcpHj_xCQ0KxuA.mjs} +4 -4
  54. package/browser/esm/{DGz8aGpEm8yfccoW.mjs → g-ScvvLFu66BzoGI.mjs} +2 -2
  55. package/browser/esm/index.mjs +299 -299
  56. package/browser/esm/{dikVMLRWr5g6T0E7.mjs → j6NYTR7qK3Ra-ctk.mjs} +2 -2
  57. package/browser/esm/qSdXw8S3Pv-_PPNl.mjs +210 -0
  58. package/browser/esm/{Bz6OaRkDOpj807bi.mjs → r8gxfS-mY5qhTMtJ.mjs} +2 -2
  59. package/browser/esm/{DVXQrjSOGoB23arZ.mjs → ro5VSIHWH1Nehr75.mjs} +1 -1
  60. package/browser/esm/tfUleloRF2hBRjjZ.mjs +996 -0
  61. package/browser/esm/vTlYAw0bvWP8B4jg.mjs +103 -0
  62. package/browser/esm/{D8RzgRnl0S1-W_Tx.mjs → vzJavAz2onbnB0zm.mjs} +1183 -1204
  63. package/browser/esm/{wwSpRKFXL9eeyQND.mjs → xaG6CESboBdgd5SL.mjs} +3 -3
  64. package/browser/esm/{B0ymykpoTxxHQosi.mjs → ze358yTiZmVH9_vX.mjs} +6 -4
  65. package/licenses/dependencies.txt +33 -33
  66. package/node/esm/5WNL9ztJdLI0VLJ7.mjs +997 -0
  67. package/node/esm/{B_7rer9pnurpMB9J.mjs → 8aFKkKyEL5n7sJAn.mjs} +12 -12
  68. package/node/esm/{DGieA81teTm8uNPr.mjs → 9Yzu2QTWzvPBNvc4.mjs} +1 -1
  69. package/node/esm/{DF5w_ZBWiRtITKLQ.mjs → BDGax8JuzpXDLe1U.mjs} +1 -1
  70. package/node/esm/{BedAzhQqTjs4BBb4.mjs → BMuPM5U4Q2kQVYTt.mjs} +251 -253
  71. package/node/esm/B_XE-SYyFRwWgVyQ.mjs +2070 -0
  72. package/node/esm/{C4esZkRHnb4HEK3k.mjs → Bap-XMVZ0X80-MNV.mjs} +2 -2
  73. package/node/esm/{DHrxhle3aK3XU-Jz.mjs → BghhH54dXAqciBpw.mjs} +2 -2
  74. package/node/esm/{Diu9L9DJzZCMtFb4.mjs → Bgsi1G5RDBa4Rnmh.mjs} +1 -1
  75. package/node/esm/{mHNl4j2rIZTqcQqb.mjs → Bj6wKB1N--BJ0A7u.mjs} +1 -1
  76. package/node/esm/{BBRSP-QRw-F0qQdJ.mjs → Bp6DyaGr7Ah4mCbj.mjs} +2 -2
  77. package/node/esm/BxIw0JqQD7Ibk44S.mjs +103 -0
  78. package/node/esm/{BRICG2VkglJJKy0X.mjs → C6J3DXYnvgXi5m4u.mjs} +1 -1
  79. package/node/esm/{Cr94rxP9x4CWSBhF.mjs → CAXzH3lCFKI5mhsY.mjs} +2 -2
  80. package/node/esm/CBpG1x4pS6pNfRR1.mjs +461 -0
  81. package/node/esm/{qYIPGp0bxwW5i6Tn.mjs → CDx7cgKCqLflEubV.mjs} +1 -1
  82. package/node/esm/{vTyr2di6cTC3sA1F.mjs → CFL1BiUsTE9X1-c8.mjs} +24 -24
  83. package/node/esm/{BRpSVGr1A8w4AG_c.mjs → CHBfOuyPAMiTojvS.mjs} +97 -110
  84. package/node/esm/{B1CcqB7Ue-EPkdE-.mjs → CJIgRvLMiUJG79DB.mjs} +1 -1
  85. package/node/esm/{Bwtmjq_jln0eMEMe.mjs → CcbjmWOlODDY8gGF.mjs} +1 -1
  86. package/node/esm/CdrSmZ9WDzkEGAXL.mjs +695 -0
  87. package/node/esm/{MNdDR5PA6J1YEtyL.mjs → Ck0jN6hnefC5Hbsk.mjs} +22 -22
  88. package/node/esm/{D13aAzbfNwj50sqn.mjs → CkGQNbOwGQPWEcUf.mjs} +2 -2
  89. package/node/esm/{4mAgDExCti1oMAez.mjs → D283LXrMqi3exI_l.mjs} +1 -1
  90. package/node/esm/DH0tw27cVxmy7-AI.mjs +40 -0
  91. package/node/esm/{CBes_pLI-7rJsre4.mjs → DJ4lhPXDGigmgQ-y.mjs} +2 -2
  92. package/node/esm/{CJszsuCXRBPNuT1A.mjs → DUZYSELfaHMSnDU2.mjs} +1 -1
  93. package/node/esm/{Bm31UyWMCsJ7z4wJ.mjs → DZYzjxDF58TKD0xV.mjs} +2 -2
  94. package/node/esm/{Bz0uw5YbQGvhlPhZ.mjs → Debl1EJrMSlRwGcN.mjs} +2 -2
  95. package/node/esm/{D2eYMCx5eAEJsfP6.mjs → Dga-nEOi0B5TjgH6.mjs} +148 -148
  96. package/node/esm/{BSZ0bAJn4ODpGusx.mjs → Diszdr1X5yDuuIzT.mjs} +1 -1
  97. package/node/esm/{suDXa2UiBKJB4nsR.mjs → Dms4poPA6WOC4jyK.mjs} +1 -1
  98. package/node/esm/{pm_LpeNYjo6Aahu3.mjs → DnjxhVMqfBhfsNHj.mjs} +14 -14
  99. package/node/esm/{D__UzirlxQlq32Rm.mjs → DsoWGkhZNfvhmpK-.mjs} +2 -2
  100. package/node/esm/DyKgKDqbquskgXEA.mjs +828 -0
  101. package/node/esm/{DlSfkSNLCwzofCfS.mjs → DzZb-LzjScchWCpk.mjs} +66 -67
  102. package/node/esm/{C1y7Z0K9Ougef8dU.mjs → MvXs13X1leYt7rBb.mjs} +2 -2
  103. package/node/esm/{DXQFo_r4CCCvIubP.mjs → SBp59gHxCkFpvNwi.mjs} +1 -1
  104. package/node/esm/{n5-pWzwq4pDS4adG.mjs → iJrkLXWLGxVhCmtE.mjs} +1 -1
  105. package/node/esm/index.mjs +3294 -3031
  106. package/node/esm/{B7_-3nxcN-ZSDQVT.mjs → l0liY9jxGCFXsxNX.mjs} +1 -1
  107. package/node/esm/{DvlZnGlon5gwQBxU.mjs → mhPcr4NaFejGRG5p.mjs} +1 -1
  108. package/node/esm/{9e9_OZYxc0ATDkNI.mjs → vfgV7wwOvzh9iYjc.mjs} +1 -1
  109. package/package.json +9 -9
  110. package/resources/locales/de/groups.cmd.json +4 -6
  111. package/resources/locales/de/ui.msg.json +164 -3
  112. package/resources/locales/en/groups.cmd.json +4 -6
  113. package/resources/locales/en/ui.msg.json +164 -3
  114. package/types/src/anomalies/AnomaliesCommands.d.ts +1 -1
  115. package/types/src/chart/ChartDetailsPanel.d.ts +34 -0
  116. package/types/src/chart/ChartDetailsTaskPane.d.ts +9 -0
  117. package/types/src/chart/ChartFormatPanel.d.ts +12 -14
  118. package/types/src/chart/command/ChartColorsCommandButton.d.ts +54 -0
  119. package/types/src/chart/command/ChartStyleCommandButton.d.ts +64 -0
  120. package/types/src/chart/command/InsertChartCommandButton.d.ts +15 -0
  121. package/types/src/chart/command/index.d.ts +2 -0
  122. package/types/src/chart/format/ChartElementFormat.d.ts +54 -0
  123. package/types/src/chart/pane/ChartPaneModel.d.ts +134 -0
  124. package/types/src/chart/pane/ChartPaneRow.d.ts +77 -0
  125. package/types/src/color/ColorSetSwatch.d.ts +34 -0
  126. package/types/src/color/index.d.ts +1 -0
  127. package/types/src/command/NumberFormatQuickButtons.d.ts +1 -1
  128. package/types/src/format/FillPanel.d.ts +1 -3
  129. package/types/src/format/FormatPanelParts.d.ts +2 -2
  130. package/types/src/format/FormatPlugin.d.ts +2 -2
  131. package/types/src/format/FormatTaskPane.d.ts +4 -10
  132. package/types/src/format/LinePanel.d.ts +0 -2
  133. package/types/src/format/editor/FormatEditor.d.ts +36 -0
  134. package/types/src/format/editor/FormatField.d.ts +97 -0
  135. package/types/src/format/editor/FormatFields.d.ts +20 -0
  136. package/types/src/format/editor/index.d.ts +4 -0
  137. package/types/src/format/index.d.ts +1 -0
  138. package/types/src/format/useFormatSelection.d.ts +0 -2
  139. package/types/src/index.d.ts +1 -1
  140. package/types/src/shape/ShapeFormatPanel.d.ts +3 -7
  141. package/types/src/workbook/DefaultRenderers.d.ts +7 -1
  142. package/browser/esm/39iN4gKrFnhPhM1Z.mjs +0 -517
  143. package/browser/esm/BWXXi0teArfwa70E.mjs +0 -72
  144. package/browser/esm/J519wp1_d0QjzPfN.mjs +0 -516
  145. package/node/esm/Bc2iZ6Qs3kHdsECK.mjs +0 -1831
  146. package/node/esm/BvKg2K2J7Us2czkC.mjs +0 -519
  147. package/node/esm/CwQPIQaC6CcVGkD2.mjs +0 -73
  148. package/node/esm/CyQekcyEfM7Engbk.mjs +0 -516
  149. package/types/src/studio/StudioSplitPane.d.ts +0 -60
@@ -0,0 +1,2070 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v1.0.6
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: MIT
6
+ */
7
+ import { AnomaliesPlugin as e, ColorSetSwatch as t, CommentsPlugin as o, DocumentTitle as r, ExternalLinksPlugin as n, FormatPlugin as a, FormulaField as i, InputField as s, NamedPlugin as l, ProtectionPlugin as c, SlicerPlugin as d, TablePlugin as p, WorkbookElement as u, createStudioThemeCSS as m, d as g, defaultRenderFormulaBar as h, defaultRenderPivotMenu as b, defaultRenderStatusBar as f, defaultRenderToolbar as k, defaultRenderWorkbookError as y, defaultRenderWorkbookLoading as x, registerStudioCommandCatalogs as w, registerStudioCommandGroups as v, t as C, tokensToMuiOptions as S, u as D } from "./index.mjs";
8
+ import { CommandRootProvider as T, DefaultTaskPaneRegistry as F, LogoNoPaddingIcon as W, PivotTablePane as E, SHAPE_ICON_PACK as P, TaskPaneArea as N, TaskPaneKey as A, TaskPaneProvider as I, ThemeRootStyles as R, ThemeStateDefaults as j, ThemeStateKey as O, WorkbookIO as B, WorkbookProvider as L, chartIconKey as M, createEditable as $, registerMovablePane as K, useDocThemes as _, useModelSync as z, useReferenceModeStore as H, useResolvedWorkbook as G, useTaskPaneArea as V, useWorkbookEncrypted as U, useWorkbookName as q, useWorkbookSaveState as X } from "@sheetxl/react";
9
+ import { Command as Y, DefaultCommandButtonRegistry as Z, DefaultIconService as J, DynamicIcon as Q, LanguageStateKey as ee, NotifierType as te, ReactErrorBoundary as oe, ReactNotifierProvider as re, ReactUtils as ne, RenderSlot as ae, ScrollUtils as ie, ThemeStyle as se, UncaughtErrorBoundary as le, createBusyHandle as ce, useCallbackRef as de, useCommands as pe, useFullscreen as ue, useImperativeElement as me, useKeyboardResize as ge, useLanguage as he, useMeasure as be, useNotifier as fe, usePersistentState as ke, useResolvedThemeMode as ye, useTranslator as xe } from "@sheetxl/utils-react";
10
+ import we, { Fragment as ve, createContext as Ce, forwardRef as Se, isValidElement as De, memo as Te, useCallback as Fe, useContext as We, useEffect as Ee, useMemo as Pe, useRef as Ne, useState as Ae } from "react";
11
+ import { AnimatedLoadingPanel as Ie, AnimatedTraversingEllipsisIcon as Re, CommandGroup as je, CommandPopupButton as Oe, ExhibitDivider as Be, ExhibitFloatProvider as Le, ExhibitIconButton as Me, ExhibitMenuHeader as $e, ExhibitMenuItem as Ke, ExhibitTooltip as _e, ModalProvider as ze, SelectedIcon as He, SimpleTooltip as Ge, StackTrace as Ve, createExhibitTheme as Ue, hideLoadingPanel as qe, lazyModal as Xe, lazyPanel as Ye, showLoadingPanel as Ze, useInputDialog as Je, useLazyWindow as Qe, useModal as et, useOptionsDialog as tt } from "@sheetxl/utils-mui";
12
+ import { Fragment as ot, jsx as rt, jsxs as nt } from "react/jsx-runtime";
13
+ import { Box as at, Card as it, CardActions as st, Collapse as lt, CssBaseline as ct, DialogTitle as dt, IconButton as pt, Paper as ut, SvgIcon as mt, Tab as gt, Tabs as ht, ThemeProvider as bt, Typography as ft, alpha as kt, useMediaQuery as yt, useTheme as xt } from "@mui/material";
14
+ import { CommonUtils as wt, DOMUtils as vt, DefaultLanguagePackService as Ct, ErrorUtils as St, ExpectedError as Dt, PartialError as Tt, defineLazyModule as Ft, formatMessage as Wt, messageKey as Et, t as Pt } from "@sheetxl/utils";
15
+ import Nt from "clsx";
16
+ import { mergeRefs as At, useMergeRefs as It } from "react-merge-refs";
17
+ import { SnackbarContent as Rt, SnackbarProvider as jt, useSnackbar as Ot } from "notistack";
18
+ var Bt = Object.defineProperty, Lt = (e, t) => {
19
+ let o = {};
20
+ for (var r in e) Bt(o, r, {
21
+ get: e[r],
22
+ enumerable: !0
23
+ });
24
+ return t || Bt(o, Symbol.toStringTag, { value: "Module" }), o;
25
+ }, Mt = Ye(Ft("studio:conditionalFormatDetailsTaskPane", () => import("./Dga-nEOi0B5TjgH6.mjs"), { select: (e) => ({ default: e.ConditionalFormatDetailsTaskPane }) }).load), $t = [
26
+ 7,
27
+ 12,
28
+ 9
29
+ ], Kt = Te((e) => {
30
+ const { preview: t, size: o = "medium" } = e, r = t.seriesColors;
31
+ return nt("svg", {
32
+ viewBox: "0 0 34 24",
33
+ "aria-hidden": !0,
34
+ focusable: !1,
35
+ style: "icon" === o ? {
36
+ display: "block",
37
+ height: "var(--icon-size, 16px)",
38
+ width: "auto",
39
+ aspectRatio: "34 / 24",
40
+ marginRight: "4px"
41
+ } : {
42
+ display: "block",
43
+ width: 34,
44
+ height: 24
45
+ },
46
+ children: [
47
+ rt("rect", {
48
+ x: .5,
49
+ y: .5,
50
+ width: 33,
51
+ height: 23,
52
+ rx: 2,
53
+ fill: "#FFFFFF",
54
+ stroke: "#D9D9D9"
55
+ }),
56
+ t.plotAreaColor ? rt("rect", {
57
+ x: 4,
58
+ y: 4,
59
+ width: 26,
60
+ height: 15,
61
+ fill: t.plotAreaColor.toCSS()
62
+ }) : null,
63
+ $t.map((e, t) => rt("rect", {
64
+ x: 6 + 8 * t,
65
+ y: 19 - e,
66
+ width: 6,
67
+ height: e,
68
+ fill: r[t % r.length]?.toCSS() ?? "#808080"
69
+ }, t)),
70
+ rt("rect", {
71
+ x: 4,
72
+ y: 19,
73
+ width: 26,
74
+ height: Math.max(1, t.lineWidth / 3),
75
+ fill: "#7F7F7F"
76
+ })
77
+ ]
78
+ });
79
+ });
80
+ Kt.displayName = "ChartStyleSwatch";
81
+ var _t = Te((e) => {
82
+ const { chart: t, selectedStyle: o = t.getChartStyle(), disabled: r, onSelectStyle: n } = e, a = xe(), i = [];
83
+ for (let e = 1; e <= 48; e++) i.push(rt(Me, {
84
+ "data-chart-style": e,
85
+ "aria-label": a("chart.style.name", { index: e }),
86
+ propsTooltip: { description: a("chart.style.name", { index: e }) },
87
+ selected: e === o,
88
+ disabled: r,
89
+ icon: rt(Kt, { preview: t.getChartStylePreview(e) }),
90
+ onClick: () => {
91
+ n(e);
92
+ }
93
+ }, e));
94
+ return nt(at, {
95
+ sx: {
96
+ display: "flex",
97
+ flexDirection: "column",
98
+ padding: "10px 16px"
99
+ },
100
+ children: [rt($e, { children: a("chart.style.title") }), rt(at, {
101
+ role: "listbox",
102
+ "aria-label": a("chart.style.title"),
103
+ sx: {
104
+ display: "grid",
105
+ gridTemplateColumns: "repeat(8, auto)",
106
+ gap: "4px"
107
+ },
108
+ children: i
109
+ })]
110
+ });
111
+ });
112
+ _t.displayName = "ChartStyleGallery";
113
+ var zt = Te(Se((e, t) => {
114
+ const { chart: o, onSelectStyle: r, tip: n, disabled: a, label: i, icon: s, ...l } = e, c = a || !o, d = o?.getChartStyle(), p = de((e) => {
115
+ r(e);
116
+ }, [r]), u = Fe(({ closeFloatAll: e }) => {
117
+ if (!o) return rt(ot, {});
118
+ return rt(_t, {
119
+ chart: o,
120
+ selectedStyle: d,
121
+ disabled: c,
122
+ onSelectStyle: (t) => {
123
+ e?.(), p(t);
124
+ }
125
+ });
126
+ }, [
127
+ o,
128
+ d,
129
+ c
130
+ ]);
131
+ return rt(Oe, {
132
+ ref: t,
133
+ renderPopupPanel: u,
134
+ renderTooltip: ({ children: e, disabled: t }) => rt(_e, {
135
+ label: n?.label,
136
+ description: n?.description,
137
+ disabled: t,
138
+ children: e
139
+ }),
140
+ label: i,
141
+ disabled: c,
142
+ selected: !1,
143
+ outlined: !s && !!o,
144
+ icon: s ?? (o && void 0 !== d ? rt(Kt, {
145
+ size: "icon",
146
+ preview: o.getChartStylePreview(d)
147
+ }) : "PresetStyles"),
148
+ ...l
149
+ });
150
+ }));
151
+ zt.displayName = "ChartStyleGalleryButton";
152
+ var Ht = Te(Se((e, t) => {
153
+ const { groupKey: o, disabled: r, label: n, icon: a, ...i } = e, s = pe(["chartStyle"])[0], l = s?.getContext()?.chart() ?? null, c = de((e) => {
154
+ s?.execute(e);
155
+ }, [s]);
156
+ return rt(zt, {
157
+ ref: t,
158
+ chart: l,
159
+ onSelectStyle: c,
160
+ tip: {
161
+ label: s?.getLabel(o),
162
+ description: s?.getDescription(o)
163
+ },
164
+ disabled: r ?? (!s || s.disabled()),
165
+ ...i
166
+ });
167
+ }));
168
+ Ht.displayName = "ChartStyleCommandButton";
169
+ var Gt = Te(Se((e, t) => {
170
+ const { groupKey: o, disabled: r, label: n, icon: a, ...i } = e, s = pe(["chartChangeType"])[0], l = s?.getState(), c = de((e) => {
171
+ s?.execute(e);
172
+ }, [s]);
173
+ return rt(g, {
174
+ ref: t,
175
+ onSelectType: c,
176
+ tip: {
177
+ label: s?.getLabel(o),
178
+ description: s?.getDescription(o)
179
+ },
180
+ icon: l ? M(l) : void 0,
181
+ disabled: r ?? (!s || s.disabled()),
182
+ ...i
183
+ });
184
+ }));
185
+ Gt.displayName = "ChangeChartTypeCommandButton";
186
+ var Vt = [
187
+ 10,
188
+ 11,
189
+ 12,
190
+ 13
191
+ ], Ut = [
192
+ 14,
193
+ 15,
194
+ 16,
195
+ 17,
196
+ 18,
197
+ 19,
198
+ 20,
199
+ 21,
200
+ 22,
201
+ 23,
202
+ 24,
203
+ 25,
204
+ 26
205
+ ], qt = (e) => Ut.includes(e), Xt = Te((e) => {
206
+ const { colors: o, variant: r, size: n } = e;
207
+ return rt(t, {
208
+ colors: o.map((e) => e.toCSS()),
209
+ variant: r,
210
+ size: n
211
+ });
212
+ });
213
+ Xt.displayName = "ChartColorsSwatch";
214
+ var Yt = Te((e) => {
215
+ const { chart: t, selectedScheme: o = t.getColorScheme(), disabled: r, onSelectScheme: n } = e, a = xe(), i = (e, a) => e.map((e, i) => rt(Me, {
216
+ "data-chart-colors": e,
217
+ "aria-label": a(i + 1),
218
+ propsTooltip: { description: a(i + 1) },
219
+ selected: e === o,
220
+ disabled: r,
221
+ icon: rt(Xt, {
222
+ variant: qt(e) ? "ramp" : "chips",
223
+ colors: t.getColorSchemePreview(e, 6)
224
+ }),
225
+ onClick: () => {
226
+ n(e);
227
+ }
228
+ }, e));
229
+ return nt(at, {
230
+ sx: {
231
+ display: "flex",
232
+ flexDirection: "column",
233
+ padding: "10px 16px"
234
+ },
235
+ children: [
236
+ rt($e, { children: a("chart.colors.colorful") }),
237
+ rt(at, {
238
+ role: "listbox",
239
+ "aria-label": a("chart.colors.colorful"),
240
+ sx: {
241
+ display: "flex",
242
+ flexDirection: "column",
243
+ alignItems: "flex-start",
244
+ gap: "2px",
245
+ marginBottom: "6px"
246
+ },
247
+ children: i(Vt, (e) => a("chart.colors.colorfulName", { index: e }))
248
+ }),
249
+ rt(Be, { orientation: "horizontal" }),
250
+ rt($e, { children: a("chart.colors.monochromatic") }),
251
+ rt(at, {
252
+ role: "listbox",
253
+ "aria-label": a("chart.colors.monochromatic"),
254
+ sx: {
255
+ display: "flex",
256
+ flexDirection: "column",
257
+ alignItems: "flex-start",
258
+ gap: "2px"
259
+ },
260
+ children: i(Ut, (e) => a("chart.colors.monochromaticName", { index: e }))
261
+ })
262
+ ]
263
+ });
264
+ });
265
+ Yt.displayName = "ChartColorsGallery";
266
+ var Zt = Te(Se((e, t) => {
267
+ const { chart: o, onSelectScheme: r, tip: n, disabled: a, label: i, icon: s, ...l } = e, c = a || !o, d = o?.getColorScheme() ?? null, p = de((e) => {
268
+ r(e);
269
+ }, [r]), u = Fe(({ closeFloatAll: e }) => {
270
+ if (!o) return rt(ot, {});
271
+ return rt(Yt, {
272
+ chart: o,
273
+ selectedScheme: d,
274
+ disabled: c,
275
+ onSelectScheme: (t) => {
276
+ e?.(), p(t);
277
+ }
278
+ });
279
+ }, [
280
+ o,
281
+ d,
282
+ c
283
+ ]);
284
+ return rt(Oe, {
285
+ ref: t,
286
+ renderPopupPanel: u,
287
+ renderTooltip: ({ children: e, disabled: t }) => rt(_e, {
288
+ label: n?.label,
289
+ description: n?.description,
290
+ disabled: t,
291
+ children: e
292
+ }),
293
+ label: i,
294
+ disabled: c,
295
+ selected: !1,
296
+ outlined: !s && !!o,
297
+ icon: s ?? (o ? rt(Xt, {
298
+ size: "icon",
299
+ variant: qt(d ?? 10) ? "ramp" : "chips",
300
+ colors: o.getColorSchemePreview(d ?? 10, 6)
301
+ }) : void 0),
302
+ ...l
303
+ });
304
+ }));
305
+ Zt.displayName = "ChartColorsGalleryButton";
306
+ var Jt = Te(Se((e, t) => {
307
+ const { groupKey: o, disabled: r, label: n, icon: a, ...i } = e, s = pe(["chartColors"])[0], l = s?.getContext()?.chart() ?? null, c = de((e) => {
308
+ s?.execute(e);
309
+ }, [s]);
310
+ return rt(Zt, {
311
+ ref: t,
312
+ chart: l,
313
+ onSelectScheme: c,
314
+ tip: {
315
+ label: s?.getLabel(o),
316
+ description: s?.getDescription(o)
317
+ },
318
+ disabled: r ?? (!s || s.disabled()),
319
+ ...i
320
+ });
321
+ }));
322
+ Jt.displayName = "ChartColorsCommandButton";
323
+ var Qt = ["lines"], eo = /^[A-Za-z_\\][\w.\\]*$/, to = /^\$?[A-Za-z]{1,3}\$?\d+$/, oo = (e) => {
324
+ const t = e?.getReferences() ?? null;
325
+ if (!e || !t || 1 !== t.getCount()) return null;
326
+ const o = e.getExpression().trim();
327
+ return eo.test(o) && !to.test(o) ? o : t;
328
+ }, ro = {
329
+ card: "_card_h0jnt_7",
330
+ actionRoot: "_actionRoot_h0jnt_11",
331
+ icons: "_icons_h0jnt_16",
332
+ expand: "_expand_h0jnt_22",
333
+ expandOpen: "_expandOpen_h0jnt_29",
334
+ stackTraceContainer: "_stackTraceContainer_h0jnt_33",
335
+ paper: "_paper_h0jnt_37",
336
+ checkIcon: "_checkIcon_h0jnt_42",
337
+ button: "_button_h0jnt_47"
338
+ }, no = Te(Se((e, t) => {
339
+ const { id: o, message: r, iconVariant: n, error: a, hideIconVariant: i, ...s } = e, l = xe(), { closeSnackbar: c } = Ot(), [d, p] = Ae(!1), u = a ? St.collectErrorChain(a, !0)?.[0]?.error : void 0, m = u && !(u instanceof Dt), g = Fe(() => {
340
+ p((e) => !e);
341
+ }, []), h = Fe(() => {
342
+ c(o);
343
+ }, [o, c]);
344
+ let b = u?.message;
345
+ return !b && De(r) && (b = r), b || "string" != typeof r || (b = r), b || (b = `Unknown Error: ${r}`), rt(Rt, {
346
+ ref: t,
347
+ className: Nt(ro.root, "error-snackbar"),
348
+ children: nt(it, {
349
+ className: ro.card,
350
+ style: {
351
+ backgroundColor: "var(--sxl-color-error)",
352
+ color: "var(--sxl-color-error-content)",
353
+ border: "1px solid var(--sxl-color-error)"
354
+ },
355
+ children: [nt(st, {
356
+ className: ro.actionRoot,
357
+ children: [
358
+ i ? null : n?.error,
359
+ rt(ft, {
360
+ variant: "body2",
361
+ component: "div",
362
+ className: ro.typography,
363
+ children: b
364
+ }),
365
+ rt("div", { style: { flex: "1 1 auto" } }),
366
+ nt("div", {
367
+ className: ro.icons,
368
+ children: [m ? rt(pt, {
369
+ "aria-label": l("toast.showMore"),
370
+ size: "small",
371
+ className: Nt(ro.expand, { [ro.expandOpen]: d }),
372
+ onClick: g,
373
+ children: rt(Q, { iconKey: "ExpandMore" })
374
+ }) : null, rt(pt, {
375
+ size: "small",
376
+ className: ro.expand,
377
+ onClick: h,
378
+ children: rt(Q, {
379
+ iconKey: "Close",
380
+ style: { transform: "scale(0.8)" }
381
+ })
382
+ })]
383
+ })
384
+ ]
385
+ }), m ? rt(lt, {
386
+ in: d,
387
+ timeout: "auto",
388
+ children: rt("div", {
389
+ className: ro.stackTraceContainer,
390
+ style: {
391
+ backgroundColor: "color-mix(in srgb, var(--sxl-color-error) 90%, var(--sxl-color-base-100))",
392
+ borderTop: "1px solid var(--sxl-color-error)"
393
+ },
394
+ children: rt(Ve, {
395
+ error: a,
396
+ hideLineNumbers: !0
397
+ })
398
+ })
399
+ }) : null]
400
+ })
401
+ });
402
+ }));
403
+ no.displayName = "ToastError";
404
+ var ao = () => {
405
+ const e = xe();
406
+ return rt(_e, {
407
+ label: "SheetXL",
408
+ description: e("logo.description"),
409
+ children: rt(at, {
410
+ component: "a",
411
+ href: "https://www.sheetxl.com",
412
+ target: "_blank",
413
+ rel: "noopener noreferrer",
414
+ sx: {
415
+ display: "inline-flex",
416
+ width: "24px",
417
+ height: "24px",
418
+ marginBottom: "4px",
419
+ marginLeft: "6px",
420
+ cursor: "pointer"
421
+ },
422
+ children: rt(W, { style: {
423
+ width: "24px",
424
+ height: "24px"
425
+ } })
426
+ })
427
+ });
428
+ }, io = rt(ao, {}), so = Te(Se((e, t) => {
429
+ const { workbook: o, className: r, logo: n = io, mainElement: a, startElement: i, endElement: s, ...l } = e, [c, { width: d }] = be(), p = d < 530, u = Ne(null), m = It([
430
+ u,
431
+ c,
432
+ t
433
+ ]);
434
+ return rt(at, {
435
+ ...l,
436
+ ref: m,
437
+ className: r,
438
+ children: k({
439
+ isCompact: p,
440
+ wrapperSelect: (e) => nt(at, {
441
+ sx: {
442
+ display: "grid",
443
+ gridTemplateColumns: "1fr auto 1fr",
444
+ flex: "1",
445
+ alignItems: "stretch",
446
+ gap: (e) => e.spacing(1),
447
+ paddingLeft: (e) => e.spacing(1),
448
+ paddingRight: (e) => e.spacing(1)
449
+ },
450
+ children: [
451
+ nt(at, {
452
+ sx: {
453
+ display: "flex",
454
+ flexDirection: "row",
455
+ alignItems: "center",
456
+ justifyContent: "start",
457
+ gap: (e) => e.spacing(.5)
458
+ },
459
+ children: [n, nt(at, {
460
+ sx: {
461
+ display: "flex",
462
+ flexDirection: "row",
463
+ alignItems: "center",
464
+ gap: (e) => e.spacing(.25)
465
+ },
466
+ children: [i, e]
467
+ })]
468
+ }),
469
+ rt(at, {
470
+ sx: {
471
+ display: "flex",
472
+ flexDirection: "row",
473
+ minWidth: 0,
474
+ overflow: "hidden",
475
+ alignItems: "center",
476
+ justifyContent: "center"
477
+ },
478
+ children: a
479
+ }),
480
+ rt(at, {
481
+ sx: {
482
+ display: "flex",
483
+ alignItems: "center",
484
+ justifyContent: "end"
485
+ },
486
+ children: s
487
+ })
488
+ ]
489
+ })
490
+ })
491
+ });
492
+ }));
493
+ so.displayName = "StudioToolbar";
494
+ var lo = (e, t) => {
495
+ const o = new URL(window.location.pathname, window.location.origin);
496
+ e && o.searchParams.set("source", e), e && t && o.searchParams.set("title", t), window.open(o.toString(), "sheetxl-" + wt.uuidV4(), "popup=true");
497
+ };
498
+ function co(e, t) {
499
+ const { workbook: o, setWorkbook: r, workbookTitle: n = "export", isDirty: a, notifier: i, refSave: s } = t;
500
+ let l = !1;
501
+ const c = async (e = null, t = null, o = null) => {
502
+ const r = [], n = {
503
+ source: e && "string" != typeof e ? e : null,
504
+ typedCreateWorkbookOptions: t ?? void 0,
505
+ onPassword: async ({ origin: e, validate: t }) => {
506
+ const o = await i.showInput({
507
+ title: Pt("dialog.password.title"),
508
+ description: Pt("dialog.password.open.description", { name: e.getName() ?? "" }),
509
+ inputType: "password",
510
+ options: [{
511
+ id: "Open",
512
+ label: () => Pt("dialog.open")
513
+ }, "Cancel"],
514
+ defaultOption: "Open",
515
+ onValidateInput: async (e, o) => void 0 === o ? { valid: !0 } : e ? await t(e) ? { valid: !0 } : {
516
+ valid: !1,
517
+ message: Pt("dialog.password.open.retry")
518
+ } : {
519
+ valid: !1,
520
+ message: Pt("dialog.password.open.required")
521
+ }
522
+ });
523
+ return "Open" === o?.option ? o.input ?? null : null;
524
+ },
525
+ progress: { onWarning: (e) => {
526
+ r.push(e);
527
+ } }
528
+ };
529
+ let a;
530
+ o && (n.progress.onStart = o);
531
+ let s = -5;
532
+ return B.read({
533
+ ...n,
534
+ progress: {
535
+ async onStart(e, t) {
536
+ await n?.progress?.onStart?.(e, t), a = await i?.showBusy?.(Pt("workbook.opening", { name: e?.getName() ?? "" })), t && a?.setProgress?.(0, t);
537
+ },
538
+ onProgress(e, t) {
539
+ if (!t) return;
540
+ const o = Math.min(100, Math.round(e / t * 100));
541
+ if (o >= 100) {
542
+ if (100 === s) return;
543
+ s = 100, a?.setProgress?.(e, t);
544
+ return;
545
+ }
546
+ o - s < 5 || (s = o, a?.setProgress?.(e, t));
547
+ },
548
+ onComplete() {
549
+ a?.(), r.length > 0 && (i.showMessage(Pt("workbook.importWarnings")), console.warn("Import warnings:\n" + r.join("\n")));
550
+ },
551
+ onWarning(e, t) {
552
+ n?.progress?.onWarning?.(e, t);
553
+ }
554
+ }
555
+ });
556
+ }, d = async (e, t, o = !1, r) => {
557
+ let a;
558
+ const s = {
559
+ format: t?.key,
560
+ progress: {
561
+ async onStart(e) {
562
+ a = await i?.showBusy?.(Pt("workbook.saving", { name: e?.getName() ?? "" }));
563
+ },
564
+ onComplete() {
565
+ a?.();
566
+ }
567
+ },
568
+ onWarnings: r ?? (async ({ warnings: e, origin: t, canCancel: o }) => {
569
+ a?.(), console.warn(`Not written to '${t.getName()}':\n${e.map((e) => ` ${e.message}`).join("\n")}`);
570
+ const r = Pt("dialog.writeWarnings.title"), n = t.getFormat(), s = (n ? (await B.getWriteFormats({ search: n }))[0] : void 0)?.description ?? n ?? "", l = Pt("dialog.writeWarnings.keep");
571
+ return o ? "Save" === await i.showOptions({
572
+ title: r,
573
+ type: te.Warning,
574
+ description: `${Pt("dialog.writeWarnings.confirm", { format: s })}\n\n${l}`,
575
+ options: [{
576
+ id: "Save",
577
+ label: () => Pt("dialog.save")
578
+ }, "Cancel"],
579
+ defaultOption: "Cancel"
580
+ }) && (a = await i?.showBusy?.(Pt("workbook.saving", { name: t?.getName() ?? "" })), !0) : (i.showOptions({
581
+ title: r,
582
+ type: te.Warning,
583
+ description: `${Pt("dialog.writeWarnings.saved", { format: s })}\n\n${l}`,
584
+ options: ["Ok"]
585
+ }), !0);
586
+ })
587
+ };
588
+ let l;
589
+ if (o) {
590
+ const o = e.getOrigin(), r = t?.exts?.[0] ?? (o.getExtension() || "sxl"), a = `${n || o.getName() || Pt("workbook.defaultName")}.${r}`;
591
+ l = await B.writeAs(e, a, {
592
+ ...s,
593
+ prompt: !0
594
+ });
595
+ } else l = await B.write(e, void 0, s);
596
+ return l;
597
+ };
598
+ let p = null;
599
+ return e.updateCommand("newWorkbook", { callback: async (e) => {
600
+ const t = B.canRead() && !a();
601
+ e?.source ? t && p ? await p({
602
+ url: e.source,
603
+ title: e.title
604
+ }) : lo(e.source, e.title) : t ? r({}) : lo();
605
+ } }), e.updateCommand("closeWorkbook", { callback: async () => {
606
+ a() && "Close" !== await i.showOptions({
607
+ title: Pt("dialog.confirm.title"),
608
+ description: Pt("dialog.unsavedChanges"),
609
+ options: [{
610
+ id: "Close",
611
+ label: () => Pt("dialog.close")
612
+ }, "Cancel"],
613
+ defaultOption: "Cancel"
614
+ }) || window.close();
615
+ } }), (async () => {
616
+ const t = await B.getWriteFormats();
617
+ if (l) return;
618
+ const n = B.canWrite(), u = B.canRead();
619
+ if (n) {
620
+ const r = (e) => {
621
+ const r = e ? t.find((t) => t.key === e) : void 0;
622
+ d(o, r, !0).catch((e) => i.showError(e));
623
+ };
624
+ e.updateCommand("saveWorkbook", { callback: () => {
625
+ d(o, void 0, !1).catch((e) => i.showError(e));
626
+ } }), s && (s.current = (e) => d(o, void 0, !1, e?.onWarnings)), e.updateCommand("saveWorkbookAs", { callback: (e) => {
627
+ r(e);
628
+ } });
629
+ for (const o of t) {
630
+ const t = o.key;
631
+ e.updateCommand(`saveWorkbookAs${t}`, {
632
+ label: () => Pt("command.saveAsFormat.label", { format: o.description }),
633
+ groupLabels: {
634
+ workbook: () => Pt("command.saveAsFormat.workbook", { format: o.description }),
635
+ saveWorkbookOptions: () => Pt("command.saveAsFormat.compact", { format: o.description })
636
+ },
637
+ tags: o.tags,
638
+ description: () => Pt("command.saveAsFormat", { format: o.description }),
639
+ icon: "CSV" === t ? "FileDownloadAsCSV" : "Excel" === t ? "FileDownloadAsExcel" : "FileDownloadAsSheet",
640
+ callback: () => {
641
+ r(t);
642
+ }
643
+ });
644
+ }
645
+ }
646
+ const m = async (e = null) => {
647
+ const t = { csv: {
648
+ date1904: o.getRuntime().isDate1904(),
649
+ ...o.options
650
+ } };
651
+ try {
652
+ let r = "";
653
+ const n = async (e) => {
654
+ r = e?.getName() ?? "";
655
+ }, a = await c(e, t, n);
656
+ if (!a) return;
657
+ const i = a.getWorksheets().getItems();
658
+ await o.doBatch(async () => {
659
+ for (let e = 0; e < i.length; e++) {
660
+ const t = i[e], n = 1 === i.length ? r : t.getName(), a = o.findValidSheetName(n);
661
+ await o.getWorksheets().add({
662
+ name: a,
663
+ autoSelect: e === i.length - 1
664
+ }).getEntireRange().copyFrom(t.getEntireRange());
665
+ }
666
+ }, Et("op.importData")), a.close();
667
+ } catch (e) {
668
+ i.showError(e);
669
+ }
670
+ };
671
+ if (e.updateCommand("insertDataFromFile", {
672
+ tags: ["noTransaction", "noRepeat"],
673
+ callback: async (e = null) => {
674
+ let t = e;
675
+ if (t || B.canRead() || (t = await (async () => {
676
+ const e = await B.getReadFormats(), t = [...new Set(e.flatMap((e) => e.exts))].map((e) => `.${e}`);
677
+ return vt.openFileDialog(t.length ? t.join(",") : "*.*");
678
+ })(), t)) return m(t);
679
+ }
680
+ }), e.updateCommand("insertDataFromURL", {
681
+ tags: ["noTransaction", "noRepeat"],
682
+ callback: async (e) => {
683
+ if (!e) {
684
+ const t = await i.showInput({
685
+ title: Pt("dialog.importFromWeb.title"),
686
+ description: Pt("dialog.importFromWeb.description"),
687
+ inputLabel: Pt("dialog.webAddress.inputLabel"),
688
+ initialValue: "https://www.sheetxl.com/docs/examples/loan-calculator.xlsx",
689
+ propsInput: { style: { minWidth: "440px" } },
690
+ options: [{
691
+ id: "Import",
692
+ label: () => Pt("dialog.import")
693
+ }]
694
+ });
695
+ if ("Import" !== t.option) return;
696
+ e = t.input;
697
+ }
698
+ if (e) try {
699
+ const t = await fetch(e);
700
+ if (!t.ok) throw new Error(`Could not fetch '${e}' (${t.status} ${t.statusText}).`);
701
+ const o = await t.blob(), r = decodeURIComponent(e.split("/").pop()?.split("?")[0] || "") || "import.xlsx";
702
+ await m(new File([o], r, { type: o.type }));
703
+ } catch (e) {
704
+ i.showError(e);
705
+ }
706
+ }
707
+ }), u) {
708
+ const t = async () => !a() || "Open" === await i.showOptions({
709
+ title: Pt("dialog.confirm.title"),
710
+ description: Pt("dialog.unsavedChanges"),
711
+ options: [{
712
+ id: "Open",
713
+ label: () => Pt("dialog.open")
714
+ }, "Cancel"],
715
+ defaultOption: "Cancel"
716
+ }), n = async (e = null) => {
717
+ const t = { csv: {
718
+ date1904: o.getRuntime().isDate1904(),
719
+ ...o.options
720
+ } };
721
+ try {
722
+ const o = await c(e, t);
723
+ if (!o) return;
724
+ r(o);
725
+ } catch (e) {
726
+ i.showError(e);
727
+ }
728
+ };
729
+ e.updateCommand("openWorkbook", { callback: async (e = null) => {
730
+ await t() && await n(e);
731
+ } }), p = async (e) => {
732
+ let o = "string" == typeof e ? e : e?.url;
733
+ const r = "string" == typeof e ? void 0 : e?.title;
734
+ if (!o) {
735
+ const e = await i.showInput({
736
+ title: Pt("dialog.openFromWeb.title"),
737
+ description: Pt("dialog.openFromWeb.description"),
738
+ inputLabel: Pt("dialog.webAddress.inputLabel"),
739
+ initialValue: "https://www.sheetxl.com/docs/examples/loan-calculator.xlsx",
740
+ propsInput: { style: { minWidth: "440px" } },
741
+ options: [{
742
+ id: "Open",
743
+ label: () => Pt("dialog.open")
744
+ }]
745
+ });
746
+ if ("Open" !== e.option) return;
747
+ o = e.input;
748
+ }
749
+ if (o && await t()) try {
750
+ const e = await fetch(o);
751
+ if (!e.ok) throw new Error(`Could not fetch '${o}' (${e.status} ${e.statusText}).`);
752
+ const t = await e.blob(), a = decodeURIComponent(o.split("/").pop()?.split("?")[0] || "") || "workbook.xlsx", i = a.match(/\.[^/.]+$/)?.[0] ?? "", s = r ? `${r}${i}` : a;
753
+ await n(new File([t], s, { type: t.type }));
754
+ } catch (e) {
755
+ i.showError(e);
756
+ }
757
+ }, e.updateCommand("openWorkbookFromUrl", { callback: p });
758
+ }
759
+ })(), () => {
760
+ l = !0, s && (s.current = null);
761
+ };
762
+ }
763
+ var po = Xe(Ft("studio:shortcutKeysDialog", () => import("./mhPcr4NaFejGRG5p.mjs")).load);
764
+ w(), C();
765
+ var uo = /* @__PURE__ */ new Set(["ui"]), mo = (e) => {
766
+ const t = (e) => {
767
+ if ("function" != typeof e) return e;
768
+ try {
769
+ return e();
770
+ } catch {
771
+ return;
772
+ }
773
+ }, o = (e, o) => {
774
+ const r = t(e);
775
+ return "string" == typeof r ? Wt(r, o, Ct.getActive()) : void 0;
776
+ }, r = [];
777
+ for (const n of e.names()) if (!uo.has(n)) for (const a of e.keys(n)) {
778
+ const i = e.resolveDefinition(n, a);
779
+ r.push({
780
+ groupKey: n,
781
+ command: {
782
+ getLabel: () => o(i?.label, i?.params) ?? a,
783
+ getIcon: () => t(i?.icon),
784
+ getDescription: () => o(i?.description, i?.params) ?? "",
785
+ getShortcut: () => t(i?.shortcut) ?? null,
786
+ getScope: () => n,
787
+ getScopeLabel: () => Y.DefaultCommandCatalogService.getScopeLabel(n)
788
+ }
789
+ });
790
+ }
791
+ return { getAllCommands: () => r };
792
+ }, go = (e) => {
793
+ const { children: t, workbook: o, setWorkbook: r, workbookTitle: n, isDirty: a, refSave: i, fullscreenTarget: s } = e, l = Y.useCommandScope(), c = fe(), { showModal: d } = et(), p = xe(), u = Ne(a);
794
+ u.current = a;
795
+ const m = de(() => {
796
+ const e = l?.getRoot().getRegistry();
797
+ if (!e) return;
798
+ const t = d(po, {
799
+ title: p("dialog.shortcutKeys.title"),
800
+ commands: mo(e),
801
+ onDone: () => t.hide(),
802
+ onLoadError: (e) => {
803
+ t.destroy(), c.showError(e);
804
+ }
805
+ });
806
+ }, [l, d]);
807
+ Ee(() => {
808
+ if (!l) return;
809
+ const e = l.getRoot().contribution();
810
+ return function(e, t) {
811
+ const o = () => t.showShortcuts();
812
+ e.updateCommand("showKeyboardShortcuts", { callback: o }), e.updateCommand("help", { callback: o });
813
+ for (const [t, o] of Object.entries({
814
+ gotoUrlGithub: "https://github.com/sheetxl/sheetxl",
815
+ gotoUrlDiscord: "https://discord.gg/NTKdwUgK9p",
816
+ gotoUrlDocumentation: "https://www.sheetxl.com/docs",
817
+ gotoUrlIssue: "https://github.com/sheetxl/sheetxl/issues"
818
+ })) e.updateCommand(t, { callback: () => {
819
+ window?.open(o);
820
+ } });
821
+ }(e, { showShortcuts: m }), () => e.remove();
822
+ }, [l, m]);
823
+ const g = yt("(prefers-color-scheme: dark)"), { themeMode: h } = ye(), [b, f] = ke(O.Mode, j[O.Mode]), [k, y] = ke(O.DarkGrid, j[O.DarkGrid]), [x, w] = ke(O.DarkImages, j[O.DarkImages]);
824
+ Ee(() => {
825
+ if (!l) return;
826
+ const e = l.getRoot().contribution();
827
+ return function(e, t) {
828
+ e.updateCommand("themeMode", {
829
+ state: t.mode ?? null,
830
+ params: { dark: t.isDark },
831
+ icon: t.isDark ? "DarkMode" : "LightMode",
832
+ callback: () => t.setMode(t.isDark ? "light" : "dark")
833
+ }), e.updateCommand("defaultThemeMode", {
834
+ state: !t.mode,
835
+ icon: t.systemDefaultDark ? "SystemDefaultDarkMode" : "SystemDefaultLightMode",
836
+ callback: () => t.setMode(null)
837
+ }), e.updateCommand("enableDarkGrid", {
838
+ state: t.enableDarkGrid,
839
+ callback: () => t.setEnableDarkGrid((e) => !e)
840
+ }), e.updateCommand("enableDarkImages", {
841
+ state: t.enableDarkImages,
842
+ callback: () => t.setEnableDarkImages((e) => !e)
843
+ });
844
+ }(e, {
845
+ mode: b,
846
+ setMode: f,
847
+ isDark: "dark" === b || !b && "dark" === h,
848
+ systemDefaultDark: g,
849
+ enableDarkGrid: k,
850
+ setEnableDarkGrid: y,
851
+ enableDarkImages: x,
852
+ setEnableDarkImages: w
853
+ }), () => e.remove();
854
+ }, [
855
+ l,
856
+ b,
857
+ h,
858
+ g,
859
+ k,
860
+ x,
861
+ f,
862
+ y,
863
+ w
864
+ ]);
865
+ const [v, C] = ke(ee.Active, null), [S, D] = Ae(() => Ct.getActive());
866
+ Ee(() => Ct.addChangeListener(D), []), Ee(() => {
867
+ v && v !== Ct.getActive() && Ct.setActive(v);
868
+ }, [v]), Ee(() => {
869
+ if (!l) return;
870
+ const e = l.getRoot().contribution();
871
+ return function(e, t) {
872
+ e.updateCommand("language", {
873
+ state: t.active,
874
+ callback: (e) => {
875
+ e && t.setActive(e);
876
+ }
877
+ });
878
+ }(e, {
879
+ active: S,
880
+ setActive: (e) => {
881
+ C(e);
882
+ }
883
+ }), () => e.remove();
884
+ }, [
885
+ l,
886
+ S,
887
+ C
888
+ ]);
889
+ const T = Pe(() => ({ current: s ?? null }), [s]), { isFullscreenAvailable: F, isFullscreenEnabled: W, toggleFullscreen: E } = ue({ target: T });
890
+ Ee(() => {
891
+ if (!l) return;
892
+ const e = l.getRoot().contribution();
893
+ return function(e, t) {
894
+ e.updateCommand("fullScreenToggle", {
895
+ state: t.isFullscreenEnabled,
896
+ disabledReasons: t.isFullscreenAvailable ? [] : [Et("reason.fullscreenUnavailable")],
897
+ icon: t.isFullscreenEnabled ? "FullScreenOff" : "FullScreen",
898
+ callback: () => {
899
+ t.toggleFullscreen();
900
+ }
901
+ });
902
+ }(e, {
903
+ isFullscreenAvailable: F,
904
+ isFullscreenEnabled: W,
905
+ toggleFullscreen: E
906
+ }), () => e.remove();
907
+ }, [
908
+ l,
909
+ F,
910
+ W,
911
+ E
912
+ ]);
913
+ const P = V(!0);
914
+ return Ee(() => {
915
+ if (!l) return;
916
+ const e = l.getRoot().contribution();
917
+ return function(e, t) {
918
+ e.updateCommand("protectWorkbook", {
919
+ tags: ["noTransaction", "noRepeat"],
920
+ callback: () => {
921
+ t(A.Protection, { args: { tab: "workbook" } });
922
+ }
923
+ });
924
+ }(e, (e, t) => P.activate(e, t)), () => e.remove();
925
+ }, [l, P]), Ee(() => {
926
+ if (!l || !o) return;
927
+ const e = l.getRoot().contribution(), t = co(e, {
928
+ workbook: o,
929
+ setWorkbook: r,
930
+ workbookTitle: n ?? void 0,
931
+ isDirty: () => u.current?.() ?? !1,
932
+ notifier: c,
933
+ refSave: i
934
+ });
935
+ return () => {
936
+ t(), e.remove();
937
+ };
938
+ }, [
939
+ l,
940
+ o,
941
+ r,
942
+ n,
943
+ c,
944
+ i
945
+ ]), t;
946
+ };
947
+ go.displayName = "StudioCommandProvider";
948
+ var ho = ({ renderWorkbook: e }) => {
949
+ const t = Y.useCommandResolver(), o = Ne(null), r = xe(), [n, a] = Ae(null), i = Fe((e) => {
950
+ const o = e.dataTransfer;
951
+ if (t && o) {
952
+ if ("dragenter" === e.type || "dragover" === e.type) {
953
+ const e = o.types, t = o.items;
954
+ let r = !1;
955
+ for (let e = 0; e < t.length; e++) if (t[e].type.startsWith("image/")) {
956
+ r = !0;
957
+ break;
958
+ }
959
+ r ? a("insertImage") : e.includes("Files") && t.length > 0 ? a("open") : (o.effectAllowed = "none", o.dropEffect = "none");
960
+ } else if ("dragleave" === e.type) {
961
+ const t = e.relatedTarget;
962
+ t && e.currentTarget.contains(t) || a(null);
963
+ }
964
+ e.preventDefault();
965
+ }
966
+ }, [t]), s = de((e) => {
967
+ e.preventDefault();
968
+ const r = n;
969
+ if (a(null), r && t && (e.stopPropagation(), e.dataTransfer.files && e.dataTransfer.files.length > 0)) {
970
+ const r = e.dataTransfer.files[0];
971
+ if (!r) return;
972
+ if (r?.type?.startsWith("image/")) {
973
+ const n = o.current?.getSheetElement()?.getGridSurface().getPaneFromClient(e.clientX, e.clientY);
974
+ if (!n) return;
975
+ const a = n.getPanePointFromPointer(e.clientX, e.clientY);
976
+ if (!a) return;
977
+ const i = n.toAbsoluteBounds({
978
+ x: a.x ?? 0,
979
+ y: a.y ?? 0,
980
+ width: 0,
981
+ height: 0
982
+ });
983
+ t.execute("insertImageFromFile", {
984
+ file: r,
985
+ options: { bounds: {
986
+ x: i.x,
987
+ y: i.y
988
+ } }
989
+ });
990
+ } else {
991
+ if (!B.canRead()) return;
992
+ const o = e.dataTransfer.items?.[0], n = "undefined" != typeof window && window.isSecureContext ? o?.getAsFileSystemHandle?.() : void 0;
993
+ n ? n.then((e) => t.execute("openWorkbook", "file" === e?.kind ? e : r)).catch(() => t.execute("openWorkbook", r)) : t.execute("openWorkbook", r);
994
+ }
995
+ }
996
+ }, [t, n]), l = Pe(() => {
997
+ if (!n) return null;
998
+ const e = "insertImage" === n;
999
+ return rt(at, {
1000
+ className: "drop-overlay",
1001
+ sx: {
1002
+ position: "absolute",
1003
+ inset: 0,
1004
+ zIndex: 1,
1005
+ boxSizing: "border-box",
1006
+ pointerEvents: "none",
1007
+ display: "flex",
1008
+ justifyContent: "center",
1009
+ alignItems: "center",
1010
+ backgroundColor: (e) => kt(e.palette.primary.main, .46),
1011
+ outline: (e) => `2px dashed ${e.palette.primary.main}`,
1012
+ outlineOffset: "-6px",
1013
+ borderRadius: 2
1014
+ },
1015
+ children: nt(ut, {
1016
+ elevation: 6,
1017
+ sx: {
1018
+ display: "flex",
1019
+ alignItems: "center",
1020
+ gap: 1.5,
1021
+ px: 3,
1022
+ py: 2,
1023
+ borderRadius: 2,
1024
+ color: "text.primary",
1025
+ "& .drop-overlay-icon": { color: "primary.main" }
1026
+ },
1027
+ children: [rt(Q, {
1028
+ iconKey: e ? "InsertImage" : "FileOpen",
1029
+ className: "drop-overlay-icon",
1030
+ size: 32
1031
+ }), rt(ft, {
1032
+ variant: "h6",
1033
+ component: "span",
1034
+ children: r(e ? "drop.insertImage" : "drop.open")
1035
+ })]
1036
+ })
1037
+ });
1038
+ }, [n, r]);
1039
+ return nt(ot, { children: [e({
1040
+ ref: o,
1041
+ onDragStart: (e) => {
1042
+ if (e.target.src) {
1043
+ const t = new Image();
1044
+ t.src = e.target.src, e.dataTransfer.setDragImage(t, 1, 1);
1045
+ }
1046
+ },
1047
+ onDragEnter: i,
1048
+ onDragLeave: i,
1049
+ onDragOver: i,
1050
+ onDrop: s
1051
+ }), l] });
1052
+ }, bo = Te((e) => {
1053
+ const { workbook: t, setWorkbook: o, refDocumentTitle: r, titleWorkbook: n, setWorkbookTitle: a, isDirty: i, initialCommandAnchor: s, renderWorkbook: l, refSave: c, host: d } = e;
1054
+ return rt(T, {
1055
+ initialAnchor: s,
1056
+ children: rt(go, {
1057
+ workbook: t,
1058
+ setWorkbook: o,
1059
+ workbookTitle: n,
1060
+ isDirty: i,
1061
+ refSave: c,
1062
+ fullscreenTarget: d,
1063
+ children: rt(ho, { renderWorkbook: l })
1064
+ })
1065
+ });
1066
+ });
1067
+ bo.displayName = "CommandsWrapper";
1068
+ var fo = {
1069
+ sort: Ft("studio:sortDialog", () => import("./DZYzjxDF58TKD0xV.mjs")).load,
1070
+ hyperlink: Ft("studio:hyperlinkDialog", () => import("./Bgsi1G5RDBa4Rnmh.mjs")).load,
1071
+ find: Ft("studio:findReplaceWindow", () => import("./l0liY9jxGCFXsxNX.mjs")).load,
1072
+ tableNew: Ft("studio:tableNewDialog", () => import("./D283LXrMqi3exI_l.mjs")).load,
1073
+ pivotTableNew: Ft("studio:pivotTableNewDialog", () => import("./Ck0jN6hnefC5Hbsk.mjs")).load,
1074
+ sparklineNew: Ft("studio:sparklineNewDialog", () => import("./C6J3DXYnvgXi5m4u.mjs")).load,
1075
+ sparklineEdit: Ft("studio:sparklineEditDialog", () => import("./DsoWGkhZNfvhmpK-.mjs")).load,
1076
+ namedDetails: Ft("studio:namedReferenceDialog", () => import("./Bj6wKB1N--BJ0A7u.mjs")).load,
1077
+ insertFunction: Ft("studio:insertFunctionDialog", () => import("./CJIgRvLMiUJG79DB.mjs")).load,
1078
+ resizeHeader: Ft("studio:resizeHeaderDialog", () => import("./iJrkLXWLGxVhCmtE.mjs")).load,
1079
+ outlineSettings: Ft("studio:outlineSettingsDialog", () => import("./9Yzu2QTWzvPBNvc4.mjs")).load,
1080
+ fillSeries: Ft("studio:fillSeriesDialog", () => import("./DUZYSELfaHMSnDU2.mjs")).load,
1081
+ workbookStatistics: Ft("studio:workbookStatisticsDialog", () => import("./Dms4poPA6WOC4jyK.mjs")).load,
1082
+ password: Ft("studio:passwordDialog", () => import("./CDx7cgKCqLflEubV.mjs")).load,
1083
+ pivotValueSettings: Ft("studio:pivotValueSettingsDialog", () => import("./BghhH54dXAqciBpw.mjs")).load
1084
+ }, ko = ["find"], yo = Te((e) => {
1085
+ const { children: t } = e, o = Ot(), r = o ? o.enqueueSnackbar : () => {}, n = o ? o.closeSnackbar : () => {}, a = Ne(/* @__PURE__ */ new Set()), i = Ne(null), s = Ne(null), [l, c] = Ae({
1086
+ label: null,
1087
+ progress: null
1088
+ }), d = xe(), p = wt.EmptyObject, u = Qe(p), m = tt(p), g = Je(p), h = Ne(!1);
1089
+ Ee(() => {
1090
+ if (h.current) return;
1091
+ h.current = !0;
1092
+ const e = window, t = e.requestIdleCallback ?? ((e) => setTimeout(e, 500)), o = e.cancelIdleCallback ?? clearTimeout, r = t(() => {
1093
+ for (const e of ko) u(e, fo[e], { prewarm: !0 }).catch(() => {});
1094
+ });
1095
+ return () => o(r);
1096
+ }, []);
1097
+ const b = Ne(/* @__PURE__ */ new Set()), f = Pe(() => {
1098
+ const e = (e, t) => {
1099
+ if (t?.onceKey) {
1100
+ if (b.current.has(t.onceKey)) return;
1101
+ const e = new Set(b.current);
1102
+ e.add(t.onceKey), b.current = e;
1103
+ }
1104
+ const o = {
1105
+ variant: t?.type ?? te.Info,
1106
+ anchorOrigin: {
1107
+ vertical: "top",
1108
+ horizontal: "center"
1109
+ },
1110
+ preventDuplicate: t?.preventDuplicate,
1111
+ persist: t?.persist ?? t?.type === te.Error,
1112
+ action: (e) => rt(pt, {
1113
+ onClick: () => n(e),
1114
+ children: rt(Q, { iconKey: "Cancel" })
1115
+ })
1116
+ };
1117
+ t?.enqueueProps && Object.assign(o, t.enqueueProps), e || console.log("message is 'null'", t), r(e ?? "Alert", o);
1118
+ };
1119
+ return {
1120
+ showMessage: e,
1121
+ showBusy: (e, t) => {
1122
+ const o = Symbol("busy");
1123
+ a.current.add(o), s.current = e, null != e && "string" != typeof e && c((t) => t.label === e ? t : {
1124
+ ...t,
1125
+ label: e
1126
+ });
1127
+ const r = ce(() => {
1128
+ a.current.delete(o) && (a.current.size > 0 || (qe(i.current), s.current = null, c((e) => null === e.label && null === e.progress ? e : {
1129
+ label: null,
1130
+ progress: null
1131
+ })));
1132
+ }, (e, t) => {
1133
+ const o = t && t > 0 && null != e ? Math.max(0, Math.min(1, e / t)) : null;
1134
+ c((e) => e.progress === o ? e : {
1135
+ ...e,
1136
+ progress: o
1137
+ });
1138
+ }, (e) => {
1139
+ s.current = e, "string" == typeof e ? Ze(i.current, e) : c((t) => ({
1140
+ ...t,
1141
+ label: e
1142
+ }));
1143
+ }), n = Ze(i.current, "string" == typeof e ? e : void 0);
1144
+ return n ? n.then(() => r) : r;
1145
+ },
1146
+ showWindow: (e, t) => {
1147
+ const o = t;
1148
+ return t = {
1149
+ ...t,
1150
+ onKeyDown: (e) => {
1151
+ e.isDefaultPrevented() || e.isPropagationStopped() || o?.onKeyDown?.(e);
1152
+ }
1153
+ }, u(e, fo[e], t);
1154
+ },
1155
+ showOptions: m,
1156
+ showInput: g,
1157
+ showError: (t) => {
1158
+ let o, r = te.Error, n = d("error.unknown");
1159
+ "string" == typeof t ? n = t : t instanceof Error && (o = t, t.message && (n = d(t.message))), t instanceof Tt && (r = te.Info), e(n, {
1160
+ type: r,
1161
+ enqueueProps: { error: o }
1162
+ });
1163
+ }
1164
+ };
1165
+ }, [d]), k = Pe(() => rt(Ie, {
1166
+ ref: i,
1167
+ autoStart: !1,
1168
+ icon: rt(Re, { sx: {
1169
+ transform: "scale(0.7)",
1170
+ marginLeft: "-6px"
1171
+ } }),
1172
+ panel: !0,
1173
+ label: l.label ?? ("string" == typeof s.current ? s.current : void 0),
1174
+ progress: l.progress,
1175
+ sx: {
1176
+ position: "absolute",
1177
+ left: "0",
1178
+ top: "0",
1179
+ width: "100%",
1180
+ height: "100%",
1181
+ zIndex: "9999",
1182
+ pointerEvents: "none"
1183
+ }
1184
+ }), [l.label, l.progress]);
1185
+ return nt(re, {
1186
+ notifier: f,
1187
+ children: [k, t]
1188
+ });
1189
+ });
1190
+ yo.displayName = "StudioNotifierProvider";
1191
+ var xo = "_StudioTaskPaneArea_x7txi_4", wo = "var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))", vo = Te(Se((e, t) => {
1192
+ const { children: o, title: r, taskPanes: n, onSelect: a, selected: i, registry: s = F, style: l, iconsOnly: c, rotateIcons: d, orientation: p = "vertical", side: u = "right", className: m, ...g } = e, h = "right" !== u, b = "horizontal" === p, f = h && !b, k = he(), y = Pe(() => n.map((e) => {
1193
+ const t = s.getRegisteredTaskPane(e);
1194
+ if (!t) return null;
1195
+ let o = t.getIcon?.();
1196
+ "string" == typeof o && (o = rt(Q, { iconKey: o }));
1197
+ const r = e === i, n = o ? rt(at, {
1198
+ sx: {
1199
+ display: "inline-block",
1200
+ transform: d && !b ? h ? "rotate(-90deg)" : "rotate(90deg)" : void 0,
1201
+ transformOrigin: "center",
1202
+ color: (e) => e.palette.text.secondary
1203
+ },
1204
+ children: o
1205
+ }) : null, l = !o || !c && r, p = rt(at, {
1206
+ sx: {
1207
+ display: "grid",
1208
+ gridTemplateColumns: l ? "1fr" : "0fr",
1209
+ opacity: l ? 1 : 0,
1210
+ transition: (e) => e.transitions.create(["grid-template-columns", "opacity"], { duration: e.transitions.duration.short })
1211
+ },
1212
+ children: rt(at, {
1213
+ sx: {
1214
+ overflow: "hidden",
1215
+ minWidth: 0,
1216
+ minHeight: 0
1217
+ },
1218
+ children: rt(ft, {
1219
+ component: "div",
1220
+ sx: {
1221
+ textTransform: "none",
1222
+ whiteSpace: "nowrap",
1223
+ transform: f ? "rotate(180deg)" : void 0,
1224
+ padding: b ? "0px 4px" : "4px 0px",
1225
+ color: (e) => r ? e.palette.primary.main : e.palette.text.secondary
1226
+ },
1227
+ children: t.getTitle()
1228
+ })
1229
+ })
1230
+ });
1231
+ return rt(gt, {
1232
+ value: e,
1233
+ label: rt(Ge, {
1234
+ disableInteractive: !0,
1235
+ title: t.getTitle() ?? "",
1236
+ placement: b ? "top" : "left-start",
1237
+ children: nt(at, {
1238
+ sx: {
1239
+ padding: "0px 0px",
1240
+ writingMode: b ? "horizontal-tb" : h ? "vertical-lr" : "vertical-rl",
1241
+ textOrientation: "mixed",
1242
+ display: "flex",
1243
+ alignItems: "center",
1244
+ justifyContent: "space-between",
1245
+ minWidth: "0px",
1246
+ color: (e) => e.palette.text.secondary
1247
+ },
1248
+ children: [f ? p : n, f ? n : p]
1249
+ })
1250
+ }),
1251
+ sx: {
1252
+ padding: "4px 4px",
1253
+ minWidth: "0px",
1254
+ minHeight: "0px",
1255
+ borderRadius: "4px"
1256
+ },
1257
+ className: Nt("taskpane-strip-item", { "Mui-selected": r }),
1258
+ onClick: () => a(e)
1259
+ }, e);
1260
+ }), [
1261
+ n,
1262
+ i,
1263
+ a,
1264
+ s,
1265
+ h,
1266
+ b,
1267
+ f,
1268
+ c,
1269
+ d,
1270
+ k
1271
+ ]), x = me(t, () => ({ isTaskPaneStrip: () => !0 }), []), w = Pe(() => Nt("taskpane-strip", `sxl-${p}`, m), [m, p]);
1272
+ return rt(at, {
1273
+ ref: x,
1274
+ className: w,
1275
+ sx: {
1276
+ paddingLeft: "2px",
1277
+ paddingRight: "2px",
1278
+ paddingTop: b ? "0px" : "4px",
1279
+ minWidth: 0,
1280
+ ...l
1281
+ },
1282
+ ...g,
1283
+ children: rt(ht, {
1284
+ orientation: p,
1285
+ variant: "scrollable",
1286
+ value: i ?? !1,
1287
+ sx: { minHeight: 0 },
1288
+ slotProps: {
1289
+ list: { sx: { gap: "2px" } },
1290
+ indicator: { sx: b ? {
1291
+ top: h ? void 0 : "0px",
1292
+ bottom: h ? "0px" : "unset"
1293
+ } : {
1294
+ left: h ? void 0 : "0px",
1295
+ right: h ? void 0 : "unset",
1296
+ bottom: h ? "0px" : void 0
1297
+ } }
1298
+ },
1299
+ children: y
1300
+ })
1301
+ });
1302
+ })), Co = (e) => {
1303
+ const { title: t, icon: o, onClose: r, readOnly: n, focused: a, ...i } = e, s = Ne(null), l = xe();
1304
+ return rt(dt, {
1305
+ className: Nt({ "Mui-selected": a }),
1306
+ sx: {
1307
+ display: "flex",
1308
+ flex: "1 1 %0",
1309
+ color: (e) => e.palette.text.secondary,
1310
+ boxSizing: "border-box",
1311
+ padding: "0 0",
1312
+ transitionProperty: "opacity",
1313
+ transitionDuration: (e) => `${e.transitions.duration.shortest}ms`,
1314
+ opacity: .7,
1315
+ "&.Mui-selected": {
1316
+ opacity: 1,
1317
+ transitionDuration: (e) => e.transitions.duration.shortest / 2 + "ms"
1318
+ },
1319
+ backgroundColor: (e) => kt(e.palette.action.hover, .03),
1320
+ borderBottom: `solid ${wo} 1px`
1321
+ },
1322
+ ...i,
1323
+ children: nt(at, {
1324
+ sx: {
1325
+ display: "flex",
1326
+ flex: "1 1 10%",
1327
+ flexDirection: "row",
1328
+ alignItems: "center",
1329
+ marginTop: (e) => e.spacing(.25),
1330
+ marginBottom: (e) => e.spacing(.25),
1331
+ marginLeft: (e) => e.spacing(1),
1332
+ marginRight: (e) => e.spacing(1)
1333
+ },
1334
+ children: [rt(at, {
1335
+ sx: {
1336
+ flex: "1 1 100%",
1337
+ paddingLeft: (e) => e.spacing(1)
1338
+ },
1339
+ children: t
1340
+ }), rt(_e, {
1341
+ label: l("taskPane.close"),
1342
+ children: rt(pt, {
1343
+ "aria-label": "close",
1344
+ sx: { color: (e) => e.palette.text.icon ?? e.palette.action.active },
1345
+ touchRippleRef: s,
1346
+ onPointerDown: (e) => {
1347
+ s.current?.start(e, { center: !1 }), e.stopPropagation(), e.preventDefault();
1348
+ },
1349
+ onPointerUp: () => {
1350
+ r();
1351
+ },
1352
+ children: rt(Q, { iconKey: "Close" })
1353
+ })
1354
+ })]
1355
+ })
1356
+ });
1357
+ }, So = Se((e, t) => {
1358
+ const { model: o, className: r, ...n } = e, a = xt(), i = `solid ${wo} 1px`, s = `${a.shape.borderRadius ?? 4}px`, l = `${a.spacing?.(.5) ?? 4}px`;
1359
+ return rt(N, {
1360
+ ref: t,
1361
+ model: o,
1362
+ propsFrame: { style: {
1363
+ border: i,
1364
+ borderRadius: s,
1365
+ marginBottom: l
1366
+ } },
1367
+ alwaysShowStrip: !0,
1368
+ componentTitle: Co,
1369
+ componentStrip: vo,
1370
+ className: Nt(xo, r),
1371
+ ...n
1372
+ });
1373
+ }), Do = () => rt("div", { style: {
1374
+ flex: "none",
1375
+ height: 0,
1376
+ borderTop: "solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px"
1377
+ } }), To = (e, t) => {
1378
+ const o = (e) => rt(we.Fragment, { children: t[e] }, e);
1379
+ if ("bottom" === e) {
1380
+ const e = t.statusBar && t.formulaBar ? rt(Do, {}, "divider") : null;
1381
+ return [
1382
+ o("toolbar"),
1383
+ o("main"),
1384
+ o("statusBar"),
1385
+ e,
1386
+ o("formulaBar")
1387
+ ];
1388
+ }
1389
+ return [
1390
+ o("toolbar"),
1391
+ o("formulaBar"),
1392
+ o("main"),
1393
+ o("statusBar")
1394
+ ];
1395
+ }, Fo = (e) => {
1396
+ const { groups: t } = e;
1397
+ return rt(at, {
1398
+ role: "menu",
1399
+ sx: {
1400
+ paddingTop: "4px",
1401
+ paddingBottom: "4px"
1402
+ },
1403
+ children: t.map((e, t) => nt(ve, { children: [t > 0 ? rt(Be, { orientation: "horizontal" }) : null, e.map((e) => rt(Ke, {
1404
+ role: void 0 === e.checked ? "menuitem" : "menuitemradio",
1405
+ "aria-checked": e.checked,
1406
+ disabled: e.disabled,
1407
+ selected: e.checked,
1408
+ icon: e.checked ? rt(He, {}) : void 0,
1409
+ onClick: e.run,
1410
+ children: e.label
1411
+ }, e.key))] }, t))
1412
+ });
1413
+ }, Wo = (e) => rt(Fo, { ...e }), Eo = (e) => {
1414
+ const { pivot: t, name: o, source: r, onError: n } = e, a = xe(), l = t.getWorksheet(), c = l.getProtection().isLocked(), d = Pe(() => ({ scope: l.getName() }), [l]), p = de((e, o) => {
1415
+ "accept" === o.reason && e !== t.getName() && t.setName(e).catch(n);
1416
+ }, [t, n]), u = de((e) => {
1417
+ if (0 === e.length || e.length > 255) throw new Dt(a("error.pivotTable.nameInvalid"));
1418
+ const o = l.getPivotTables().getByName(e);
1419
+ if (o && o.getName() !== t.getName()) throw new Dt(a("error.pivotTable.nameExists"));
1420
+ }, [
1421
+ l,
1422
+ t,
1423
+ a
1424
+ ]), m = de((e, o) => {
1425
+ if ("accept" !== o.reason) return;
1426
+ const r = oo(e);
1427
+ r && t.setSource("string" == typeof r ? r : r.at(0)).catch(n);
1428
+ }, [t, n]);
1429
+ return nt(at, {
1430
+ className: "sxl-pivot-table-header",
1431
+ sx: {
1432
+ display: "flex",
1433
+ flexDirection: "column",
1434
+ rowGap: (e) => e.spacing(1),
1435
+ paddingTop: (e) => e.spacing(1)
1436
+ },
1437
+ children: [rt(s, {
1438
+ formName: "name",
1439
+ value: o,
1440
+ changeOn: "done",
1441
+ onDone: p,
1442
+ onValidate: u,
1443
+ disabled: c
1444
+ }), rt(i, {
1445
+ grammar: "reference",
1446
+ formName: "source",
1447
+ label: a("pivotTableNew.source"),
1448
+ value: r,
1449
+ allowMulti: !1,
1450
+ home: d,
1451
+ pickAs: "absolute",
1452
+ changeOn: "done",
1453
+ onDone: m,
1454
+ disabled: c || null === r
1455
+ })]
1456
+ });
1457
+ }, Po = (e) => rt(Eo, { ...e }), No = (e) => rt(E, {
1458
+ renderMenu: Wo,
1459
+ renderFilter: b,
1460
+ renderHeader: Po,
1461
+ ...e
1462
+ }), Ao = Ye(Ft("studio:chartDetailsTaskPane", () => import("./CdrSmZ9WDzkEGAXL.mjs"), { select: (e) => ({ default: e.ChartDetailsTaskPane }) }).load), Io = Ye(Ft("studio:dataValidationDetailsTaskPane", () => import("./DJ4lhPXDGigmgQ-y.mjs"), { select: (e) => ({ default: e.DataValidationDetailsTaskPane }) }).load), Ro = Lt({
1463
+ EagerStudio: () => $o,
1464
+ default: () => $o
1465
+ });
1466
+ p(), F.registerTaskPane({
1467
+ key: A.PivotTable,
1468
+ component: No
1469
+ }, !0), (() => {
1470
+ Z.register({
1471
+ key: "changeShapeGallery",
1472
+ contributions: { shapeToolbar: {
1473
+ order: -1,
1474
+ divider: "after"
1475
+ } },
1476
+ render: (e) => rt(D, {
1477
+ ...e,
1478
+ commandKey: "changeShape",
1479
+ excludeCategories: Qt
1480
+ })
1481
+ }, !0);
1482
+ K("shape", () => import("./DH0tw27cVxmy7-AI.mjs").then((e) => e.ShapeFormatPanel));
1483
+ })(), (() => {
1484
+ F.registerTaskPane({
1485
+ key: A.ChartDetails,
1486
+ component: Ao
1487
+ }, !0);
1488
+ K("chart", () => import("./5WNL9ztJdLI0VLJ7.mjs").then((e) => e.ChartFormatPanel));
1489
+ Z.register({
1490
+ key: "chartChangeTypeOptions",
1491
+ contributions: { chartToolbar: { order: -3 } },
1492
+ render: (e) => rt(Gt, { ...e })
1493
+ }, !0);
1494
+ Z.register({
1495
+ key: "chartStyleOptions",
1496
+ contributions: { chartToolbar: { order: -2 } },
1497
+ render: (e) => rt(Ht, { ...e })
1498
+ }, !0);
1499
+ Z.register({
1500
+ key: "chartColorsOptions",
1501
+ contributions: { chartToolbar: {
1502
+ order: -1,
1503
+ divider: "after"
1504
+ } },
1505
+ render: (e) => rt(Jt, { ...e })
1506
+ }, !0);
1507
+ })(), (() => {
1508
+ const e = Y.DefaultCommandButtonRegistry, t = [];
1509
+ t.push(e.register({
1510
+ key: "changePictureOptions",
1511
+ defaultKey: "changePictureFromFile",
1512
+ members: ["changePictureFromFile", "changePictureFromURL"],
1513
+ contributions: { pictureToolbar: { order: -3 } }
1514
+ }, !0)), t.push(e.register({
1515
+ key: "pictureHyperlinkOptions",
1516
+ defaultKey: "updatePictureHyperlink",
1517
+ members: [
1518
+ "updatePictureHyperlink",
1519
+ "openPictureHyperlink",
1520
+ "deletePictureHyperlink"
1521
+ ],
1522
+ contributions: { pictureToolbar: { order: -2 } }
1523
+ }, !0)), t.push(e.register({
1524
+ key: "cropAspectOptions",
1525
+ members: [
1526
+ "cropAspect1x1",
1527
+ "-",
1528
+ "cropAspect2x3",
1529
+ "cropAspect3x4",
1530
+ "cropAspect3x5",
1531
+ "cropAspect4x5",
1532
+ "-",
1533
+ "cropAspect3x2",
1534
+ "cropAspect4x3",
1535
+ "cropAspect5x3",
1536
+ "cropAspect5x4",
1537
+ "cropAspect16x9",
1538
+ "cropAspect16x10"
1539
+ ]
1540
+ }, !0)), t.push(e.register({
1541
+ key: "cropOptions",
1542
+ members: [
1543
+ {
1544
+ key: "cropToShapeGallery",
1545
+ render: (e) => rt(D, {
1546
+ ...e,
1547
+ commandKey: "cropToShape",
1548
+ excludeCategories: Qt
1549
+ })
1550
+ },
1551
+ "cropAspectOptions",
1552
+ "-",
1553
+ "cropFill",
1554
+ "cropFit"
1555
+ ],
1556
+ contributions: { pictureToolbar: {
1557
+ order: -1,
1558
+ divider: "after"
1559
+ } }
1560
+ }, !0));
1561
+ })(), d(), F.registerTaskPane({
1562
+ key: A.DataValidation,
1563
+ component: Io
1564
+ }, !0), F.registerTaskPane({
1565
+ key: A.ConditionalFormat,
1566
+ component: Mt
1567
+ }, !0), c(), l(), n(), o(), e(), a(), v();
1568
+ var jo = () => {
1569
+ let e, t;
1570
+ const o = new Promise((o, r) => {
1571
+ e = o, t = r;
1572
+ }), r = {
1573
+ promise: o,
1574
+ settled: !1,
1575
+ resolve: (t) => {
1576
+ r.settled = !0, e(t);
1577
+ },
1578
+ reject: (e) => {
1579
+ r.settled = !0, t(e);
1580
+ }
1581
+ };
1582
+ return o.catch(() => {}), r;
1583
+ }, Oo = (e, t) => {
1584
+ if (!e) return {};
1585
+ const { colorSchemes: o, ...r } = e, n = o?.[t ? "dark" : "light"];
1586
+ return n && "object" == typeof n ? wt.deepMerge(r, n) : r;
1587
+ }, Bo = "taskPanes", Lo = Ce({ scope: null }), Mo = ({ children: e }) => {
1588
+ const { scope: t, wrapper: o } = We(Lo);
1589
+ return rt(Y.CommandScopeProvider, {
1590
+ scope: t,
1591
+ children: o ? rt(o, { children: e }) : e
1592
+ });
1593
+ }, $o = Te(Se((e, t) => {
1594
+ const { host: o, scopeClass: n, square: a, elevation: i, variant: s, onWorkbookLoad: l, onRenderSettled: c, prefetch: d, onDocumentError: p, renderDocumentError: g = y, propsDocumentError: b, propsTaskPaneArea: k, renderTaskPaneArea: w = Ko, taskPaneSide: v = "right", onKeyDown: C, workbook: D, onWorkbookChange: T, logo: F, topLeft: W, topRight: E, muiTheme: N, tokens: A, cssBaseline: M, autoFocus: K = !1, title: V, onDirtyChange: Z, propsDocumentTitle: te, renderDocumentLoading: re = x, propsDocumentLoading: ce, propsWorkbook: pe, showFormulaBar: ue, propsFormulaBar: he, renderFormulaBar: be, formulaBarPlacement: fe, virtualKeyboard: xe = "float", editable: we, showStatusBar: ve, propsStatusBar: Ce, renderStatusBar: Se, propsToolbar: De, renderToolbar: Te } = e, We = Ne(null), Ie = Ne(null), Re = Ne(null), Oe = de(() => {
1595
+ Re.current?.getNamedCollectionEditorElement?.()?.focus?.();
1596
+ }, []), Be = ((e, t = "undefined" == typeof window ? "mouse" : ne.detectIt().primaryInput) => "top" === e || "bottom" === e ? e : "touch" === t ? "bottom" : "top")(fe), Me = "bottom" === Be ? xe : "none", { inset: $e, offsetTop: Ke } = ge("resize" === Me), _e = de(p ?? (() => {}), [p]), He = de(Z ?? (() => {}), [Z]), Ge = te?.placeHolder, [Ve] = ke(O.Mode, j[O.Mode]), { themeMode: qe } = ye({ mode: Ve ?? void 0 }), [Xe] = ke(ee.Active, null), Ye = Ne(Xe);
1597
+ Ye.current = Xe;
1598
+ const Ze = Pe(() => ({
1599
+ light: Ue(!1, wt.deepMerge(Oo(N, !1), S(A?.light?.app))),
1600
+ dark: Ue(!0, wt.deepMerge(Oo(N, !0), S(A?.dark?.app)))
1601
+ }), [N, A]), Je = "dark" === qe, Qe = Pe(() => m(Ze.light, Ze.dark, `.${n}`, A), [
1602
+ Ze,
1603
+ n,
1604
+ A
1605
+ ]), et = _(), [tt, ot] = Ae(() => D ?? null);
1606
+ Ee(() => {
1607
+ ot(D ?? null);
1608
+ }, [D]);
1609
+ const [it, st] = Ae(0), lt = Ne(null);
1610
+ lt.current || (lt.current = jo());
1611
+ const dt = G(tt, {
1612
+ io: B,
1613
+ defaultTheme: et.getDefaultTheme(),
1614
+ reloadKey: it
1615
+ }), pt = "loaded" === dt.status ? dt.workbook : null, gt = Pe(() => "error" === dt.status ? {
1616
+ status: "error",
1617
+ error: dt.error
1618
+ } : "loaded" === dt.status ? {
1619
+ status: "loaded",
1620
+ workbook: dt.workbook
1621
+ } : { status: "loading" }, [dt]);
1622
+ Ee(() => {
1623
+ lt.current.settled && (lt.current = jo());
1624
+ }, [tt, it]), Ee(() => {
1625
+ if ("loaded" === gt.status) {
1626
+ const e = lt.current, t = gt.workbook;
1627
+ t.whenFontsReady().then(() => e.resolve(t), () => e.resolve(t));
1628
+ } else "error" === gt.status && (_e?.(gt.error), lt.current.reject(gt.error));
1629
+ }, [gt]);
1630
+ const [ht, ft] = Ae(null);
1631
+ pt && !ht && ft(pt);
1632
+ const kt = pt && ht && pt !== ht ? pt : null, yt = Ne(kt);
1633
+ yt.current = kt;
1634
+ const xt = Ne(ht);
1635
+ xt.current = ht;
1636
+ const vt = Ne([]), St = Fe((e) => {
1637
+ const t = xt.current;
1638
+ t && vt.current.push(t), ot(e);
1639
+ }, []);
1640
+ Ee(() => {
1641
+ const e = vt.current;
1642
+ if (0 !== e.length) {
1643
+ vt.current = e.filter((e) => e === ht);
1644
+ for (let t = 0; t < e.length; t++) {
1645
+ const o = e[t];
1646
+ if (o !== ht) try {
1647
+ o.close();
1648
+ } catch (e) {
1649
+ console.warn("Unable to close the replaced workbook", e);
1650
+ }
1651
+ }
1652
+ }
1653
+ }, [ht]);
1654
+ const Dt = we ? null : ht, Tt = H(), Ft = Pe(() => {
1655
+ const e = Dt?.getSelectedWorksheet() ?? Dt?.getWorksheets().getItems({ visibility: "veryHidden" })[0];
1656
+ return e ? $(e, { referenceMode: Tt }) : null;
1657
+ }, [Dt, Tt]), Wt = we ?? Ft, Et = Ne(Wt);
1658
+ Et.current = Wt, Ee(() => {
1659
+ if (!Wt) return;
1660
+ let e = Wt.getSession();
1661
+ return Wt.subscribe(() => {
1662
+ const t = e;
1663
+ if (e = Wt.getSession(), !t || e) return;
1664
+ if ("formula-bar" !== t.getActiveEditorId()) return;
1665
+ const o = Re.current;
1666
+ (o?.isFocusWithin?.() ?? o?.contains?.(document.activeElement)) && We.current?.focus();
1667
+ });
1668
+ }, [Wt]);
1669
+ const Pt = q(ht), { isDirty: Nt, saveState: It } = X(ht, B), Rt = U(ht), Ot = Ne(It), Bt = Ne(null);
1670
+ Ot.current = It;
1671
+ const Lt = Fe(() => Ot.current?.isDirty() ?? !1, []), Mt = Ne(gt);
1672
+ Mt.current = gt;
1673
+ const [$t, Kt] = Ae(null), _t = V ?? te?.title, [zt, Ht] = Ae(null);
1674
+ Ee(() => {
1675
+ Ht(null);
1676
+ }, [ht]);
1677
+ const Gt = _t ?? zt ?? Pt ?? "";
1678
+ Ee(() => {
1679
+ He?.(Nt);
1680
+ }, [Nt]);
1681
+ const Vt = de(T ?? (() => {}), [T]);
1682
+ Ee(() => {
1683
+ Vt?.(pt);
1684
+ }, [pt]);
1685
+ const Ut = Ne(pt);
1686
+ Ut.current = pt, z(ht, "onViewChange");
1687
+ const qt = Pe(() => rt(je, {
1688
+ groupKey: "helpOptions",
1689
+ disableHover: !0,
1690
+ sx: { padding: "0" },
1691
+ propsButton: { sx: { maxHeight: "22px" } }
1692
+ }), []), [Xt, Yt] = Ae(null), Zt = Fe((e) => {
1693
+ Yt(e);
1694
+ }, []);
1695
+ Ee(() => {
1696
+ J.prefetch([J.getActive(), P]).catch((e) => {
1697
+ console.warn("Icons could not be loaded:", e);
1698
+ });
1699
+ }, []);
1700
+ const Jt = Ne(null);
1701
+ Jt.current || (Jt.current = jo());
1702
+ const Qt = Ne(null), eo = Fe(() => Qt.current?.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? Jt.current.promise, []), to = de(async (e) => {
1703
+ const t = Ye.current;
1704
+ t && t !== Ct.getActive() && await Ct.setActive(t), await Y.DefaultCommandCatalogService.prefetch(t ?? void 0), Kt(e), Qt.current = e.source, Jt.current.settled || Jt.current.resolve(e.source.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? null), l?.(e);
1705
+ }, []), oo = Ne(null), ro = Fe((e) => {
1706
+ let t = null, o = {
1707
+ readOnly: !0,
1708
+ ...te
1709
+ };
1710
+ return te?.hidden || (t = rt(r, {
1711
+ ...o,
1712
+ style: {
1713
+ maxWidth: "100%",
1714
+ ...te?.style
1715
+ },
1716
+ workbook: e.workbook ?? We.current,
1717
+ ref: oo,
1718
+ title: Gt,
1719
+ modified: Nt,
1720
+ encrypted: Rt,
1721
+ placeHolder: Ge,
1722
+ onTitleChange: (e) => {
1723
+ Ht(e), te?.onTitleChange?.(e);
1724
+ }
1725
+ })), rt(so, {
1726
+ ...e,
1727
+ logo: F,
1728
+ mainElement: t,
1729
+ startElement: W,
1730
+ endElement: E
1731
+ });
1732
+ }, [
1733
+ F,
1734
+ Gt,
1735
+ Nt,
1736
+ Rt,
1737
+ te,
1738
+ W,
1739
+ E
1740
+ ]);
1741
+ Ee(() => {
1742
+ const e = We.current;
1743
+ if (!e) return;
1744
+ const t = (t) => {
1745
+ (t.ctrlKey || t.metaKey || "native" !== ie.getWheelOwner(t, e)) && t.preventDefault();
1746
+ };
1747
+ return e.addEventListener("wheel", t, { passive: !1 }), () => {
1748
+ e.removeEventListener("wheel", t);
1749
+ };
1750
+ }, [$t]);
1751
+ const [ao, io] = Ae(null);
1752
+ Ee(() => {
1753
+ io($t?.source?.getCommandScope?.() ?? null);
1754
+ }, [$t]);
1755
+ const lo = Pe(() => ({
1756
+ "& .SnackbarContainer-root": { position: "absolute !important" },
1757
+ "& .notistack-SnackbarContainer > div": { maxWidth: "min(100%, 720px)" },
1758
+ "& .notistack-Snackbar": { minWidth: "unset" },
1759
+ "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
1760
+ "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
1761
+ "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
1762
+ "& .notistack-MuiContent *": { fontFamily: (e) => e.typography.fontFamily },
1763
+ "& #notistack-snackbar": {
1764
+ maxWidth: "560px",
1765
+ whiteSpace: "pre-wrap"
1766
+ },
1767
+ "*": { userSelect: "none" }
1768
+ }), []), co = Pe(() => ({
1769
+ scope: ao,
1770
+ wrapper: k?.wrapperFrame
1771
+ }), [ao, k?.wrapperFrame]), po = Ne(o);
1772
+ po.current = o, me(t, () => ({
1773
+ isStudioElement: () => !0,
1774
+ save: (e) => {
1775
+ const t = Bt.current;
1776
+ return t ? t(e) : Promise.reject(/* @__PURE__ */ new Error("The studio cannot save: no workbook, or the backing store cannot write."));
1777
+ },
1778
+ getWorkbookElement: () => We.current,
1779
+ getWorkbook: () => Ut.current ?? null,
1780
+ isDirty: () => Ot.current?.isDirty() ?? !1,
1781
+ getEditable: () => Et.current,
1782
+ getFormulaBarElement: () => Re.current ?? null,
1783
+ focus: () => We.current?.focus(),
1784
+ whenReady: () => (lt.current || (lt.current = jo()), lt.current.promise),
1785
+ getWorkbookState: () => Mt.current,
1786
+ retry: () => st((e) => e + 1)
1787
+ }), [], o);
1788
+ const uo = Ne(!1), mo = de(async (e, t) => {
1789
+ t === yt.current && (uo.current = po.current?.contains(document.activeElement) ?? !0, ft(t), await to(e), c?.(e));
1790
+ }, []);
1791
+ Ee(() => {
1792
+ uo.current && (uo.current = !1, We.current?.focus());
1793
+ }, [ht]);
1794
+ const go = Fe((e) => {
1795
+ const { ref: t, ...o } = e, r = Je ? Ze.dark : Ze.light, n = "error" === gt.status && g ? rt(ae, {
1796
+ render: g,
1797
+ props: {
1798
+ ...b,
1799
+ style: {
1800
+ width: "100%",
1801
+ height: "100%",
1802
+ ...b?.style
1803
+ },
1804
+ error: gt.error
1805
+ }
1806
+ }) : null;
1807
+ if (n && !ht) return rt(ut, {
1808
+ style: {
1809
+ width: "100%",
1810
+ height: "100%",
1811
+ position: "absolute",
1812
+ display: "flex",
1813
+ alignItems: "stretch",
1814
+ justifyContent: "stretch"
1815
+ },
1816
+ children: n
1817
+ });
1818
+ let l = null;
1819
+ if (ht) {
1820
+ const e = ht, n = e.getView(), a = ue ?? n?.isShowFormulaBar(), i = ve ?? n?.isShowStatusBar(), s = $t?.source ?? We.current, p = rt(ae, {
1821
+ render: void 0 === Te ? ro : Te,
1822
+ props: {
1823
+ workbook: s,
1824
+ ...De
1825
+ }
1826
+ }), m = "bottom" === Be, g = a ? rt(ae, {
1827
+ render: void 0 === be ? h : be,
1828
+ props: {
1829
+ ref: Re,
1830
+ style: {
1831
+ marginTop: r.spacing(m ? .5 : .25),
1832
+ marginLeft: r.spacing(1),
1833
+ marginRight: r.spacing(1),
1834
+ marginBottom: r.spacing(m ? .5 : .75)
1835
+ },
1836
+ workbook: e,
1837
+ editable: Wt ?? void 0,
1838
+ placement: Be,
1839
+ floatOnKeyboard: "float" === Me,
1840
+ ...he,
1841
+ propsNamedCollectionEditor: {
1842
+ restoreFocus: (e) => s?.focus(e),
1843
+ ...he?.propsNamedCollectionEditor
1844
+ }
1845
+ }
1846
+ }) : null, b = i ? rt(ae, {
1847
+ render: void 0 === Se ? f : Se,
1848
+ props: {
1849
+ childrenEnd: qt,
1850
+ ...Ce
1851
+ }
1852
+ }) : null, y = (e, r) => rt(u, {
1853
+ ...pe,
1854
+ tabIndex: 0,
1855
+ autoFocus: !r && K,
1856
+ workbook: e,
1857
+ editable: r ? void 0 : Wt ?? void 0,
1858
+ focusNameBox: r ? void 0 : Oe,
1859
+ prefetch: !r && d,
1860
+ ref: r ? Ie : At([t, We]),
1861
+ onWorkbookLoad: r ? void 0 : to,
1862
+ onRenderSettled: r ? (t) => {
1863
+ mo(t, e);
1864
+ } : c,
1865
+ onKeyDown: (e) => {
1866
+ C?.(e);
1867
+ },
1868
+ propsWorkbookLoading: ce,
1869
+ renderWorkbookLoading: null,
1870
+ style: r ? {
1871
+ ...pe?.style,
1872
+ position: "absolute",
1873
+ inset: 0,
1874
+ visibility: "hidden"
1875
+ } : {
1876
+ flex: "1 1 100%",
1877
+ minHeight: 0,
1878
+ ...pe?.style
1879
+ },
1880
+ onContextMenu: (e) => e.preventDefault(),
1881
+ ...r ? null : o
1882
+ }, e.getId());
1883
+ l = rt("div", {
1884
+ style: {
1885
+ display: "flex",
1886
+ flexDirection: "column",
1887
+ flex: "1 1 100%",
1888
+ minWidth: 0,
1889
+ minHeight: 0
1890
+ },
1891
+ children: To(Be, {
1892
+ toolbar: p,
1893
+ formulaBar: g,
1894
+ statusBar: b,
1895
+ main: rt(Lo.Provider, {
1896
+ value: co,
1897
+ children: rt(ae, {
1898
+ render: w,
1899
+ props: {
1900
+ model: ht,
1901
+ side: v,
1902
+ persistKey: Bo,
1903
+ ...k,
1904
+ wrapperFrame: Mo,
1905
+ children: nt("div", {
1906
+ style: {
1907
+ position: "relative",
1908
+ display: "flex",
1909
+ flexDirection: "column",
1910
+ flex: "1 1 100%",
1911
+ minWidth: 0,
1912
+ minHeight: 0
1913
+ },
1914
+ children: [[y(ht, !1), kt ? y(kt, !0) : null], rt(at, {
1915
+ ref: Zt,
1916
+ sx: {
1917
+ position: "absolute",
1918
+ top: "10%",
1919
+ left: 0,
1920
+ right: 0,
1921
+ bottom: 0,
1922
+ pointerEvents: "none",
1923
+ "& > :first-of-type": { position: "relative" }
1924
+ }
1925
+ })]
1926
+ })
1927
+ }
1928
+ })
1929
+ })
1930
+ })
1931
+ });
1932
+ }
1933
+ const p = !$t && re ? rt(ae, {
1934
+ render: re,
1935
+ props: { ...ce }
1936
+ }) : null;
1937
+ return nt(ut, {
1938
+ sx: lo,
1939
+ style: {
1940
+ width: "100%",
1941
+ height: $e ? `calc(100% - ${$e}px)` : "100%",
1942
+ transform: Ke ? `translateY(${Ke}px)` : void 0,
1943
+ position: "absolute",
1944
+ display: "flex",
1945
+ alignItems: "stretch",
1946
+ justifyContent: "stretch",
1947
+ backgroundColor: "var(--sxl-color-base-200)"
1948
+ },
1949
+ className: "eager-studio",
1950
+ square: a,
1951
+ elevation: i,
1952
+ variant: s,
1953
+ children: [
1954
+ l,
1955
+ n ? rt(ut, {
1956
+ style: {
1957
+ position: "absolute",
1958
+ inset: 0,
1959
+ display: "flex",
1960
+ alignItems: "stretch",
1961
+ justifyContent: "stretch"
1962
+ },
1963
+ children: n
1964
+ }) : null,
1965
+ p ? rt("div", {
1966
+ style: {
1967
+ position: "absolute",
1968
+ inset: 0,
1969
+ display: "flex",
1970
+ alignItems: "center",
1971
+ justifyContent: "center",
1972
+ background: `var(--sxl-color-base-100, ${Je ? "#121212" : "#fff"})`
1973
+ },
1974
+ children: p
1975
+ }) : null
1976
+ ]
1977
+ });
1978
+ }, [
1979
+ gt,
1980
+ ht,
1981
+ kt,
1982
+ $t,
1983
+ Gt,
1984
+ re,
1985
+ ce,
1986
+ pe,
1987
+ a,
1988
+ i,
1989
+ s,
1990
+ qt,
1991
+ g,
1992
+ b,
1993
+ ro,
1994
+ lo,
1995
+ v,
1996
+ co,
1997
+ w,
1998
+ k,
1999
+ ue,
2000
+ he,
2001
+ be,
2002
+ Be,
2003
+ Wt,
2004
+ ve,
2005
+ Ce,
2006
+ Se,
2007
+ De,
2008
+ Te,
2009
+ Me,
2010
+ $e,
2011
+ Ke,
2012
+ Ze,
2013
+ Je
2014
+ ]);
2015
+ let ho = rt(jt, {
2016
+ maxSnack: 3,
2017
+ domRoot: Xt ?? void 0,
2018
+ anchorOrigin: {
2019
+ vertical: "bottom",
2020
+ horizontal: "right"
2021
+ },
2022
+ autoHideDuration: 3500,
2023
+ onClose: (e, t, o) => {
2024
+ We.current?.focus();
2025
+ },
2026
+ Components: { error: no },
2027
+ iconVariant: {
2028
+ success: rt(mt, {
2029
+ style: { marginRight: "8px" },
2030
+ children: rt("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" })
2031
+ }),
2032
+ error: rt(Q, {
2033
+ iconKey: "ErrorAlert",
2034
+ style: { marginRight: "8px" }
2035
+ })
2036
+ },
2037
+ children: rt(L, {
2038
+ workbook: ht,
2039
+ children: rt(I, { children: rt(ze, { children: rt(yo, { children: rt(le, { children: rt(oe, { children: rt(bo, {
2040
+ workbook: ht,
2041
+ initialCommandAnchor: eo,
2042
+ renderWorkbook: go,
2043
+ setWorkbook: St,
2044
+ titleWorkbook: Gt,
2045
+ setWorkbookTitle: Ht,
2046
+ refDocumentTitle: oo,
2047
+ isDirty: Lt,
2048
+ refSave: Bt,
2049
+ host: o
2050
+ }) }) }) }) }) })
2051
+ })
2052
+ });
2053
+ return ho = nt(bt, {
2054
+ theme: Je ? Ze.dark : Ze.light,
2055
+ children: [
2056
+ M ? rt(ct, {}) : null,
2057
+ rt(se, { css: Qe }),
2058
+ rt(R, { scopeClass: n }),
2059
+ rt(Le, {
2060
+ themeScopeClass: n,
2061
+ themeSurface: "app",
2062
+ themeMode: qe,
2063
+ children: ho
2064
+ })
2065
+ ]
2066
+ }), ho;
2067
+ }));
2068
+ $o.displayName = "EagerStudio";
2069
+ var Ko = (e) => rt(So, { ...e });
2070
+ export { $o as EagerStudio, $o as default, zt as i, oo as n, Zt as r, Ro as t };