@sheetxl/react 0.7.27 → 0.7.28-beta.2

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 (257) hide show
  1. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
  2. package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +156 -0
  3. package/browser/cjs/index.cjs +24 -24
  4. package/browser/esm/BPJdKxa9KFZWhw7o.mjs +6286 -0
  5. package/browser/esm/index.mjs +19258 -4911
  6. package/licenses/dependencies.txt +42 -214
  7. package/node/esm/CUEW3f18r-pU7F0q.mjs +9 -0
  8. package/node/esm/index.mjs +17035 -3691
  9. package/package.json +10 -11
  10. package/resources/contents.json +60 -0
  11. package/resources/locales/contents.json +114 -0
  12. package/resources/locales/de/clipboard.cmd.json +36 -0
  13. package/resources/locales/de/editor.cmd.json +128 -0
  14. package/resources/locales/de/movable.cmd.json +123 -0
  15. package/resources/locales/de/selection.cmd.json +373 -0
  16. package/resources/locales/de/sheet.cmd.json +1563 -0
  17. package/resources/locales/de/table.cmd.json +83 -0
  18. package/resources/locales/de/ui.msg.json +166 -0
  19. package/resources/locales/de/workbook.cmd.json +282 -0
  20. package/resources/locales/en/clipboard.cmd.json +36 -0
  21. package/resources/locales/en/editor.cmd.json +128 -0
  22. package/resources/locales/en/movable.cmd.json +123 -0
  23. package/resources/locales/en/selection.cmd.json +373 -0
  24. package/resources/locales/en/sheet.cmd.json +1563 -0
  25. package/resources/locales/en/table.cmd.json +83 -0
  26. package/resources/locales/en/ui.msg.json +166 -0
  27. package/resources/locales/en/workbook.cmd.json +282 -0
  28. package/types/index.d.ts +2 -1767
  29. package/types/src/border/StaticBorderRenderer.d.ts +32 -0
  30. package/types/src/border/StyledStrokePath.d.ts +14 -0
  31. package/types/src/border/index.d.ts +4 -0
  32. package/types/src/border/useBorders.d.ts +87 -0
  33. package/types/src/cell/ColumnButton.d.ts +45 -0
  34. package/types/src/cell/CornerTriangle.d.ts +27 -0
  35. package/types/src/cell/FormulaCellRenderer.d.ts +34 -0
  36. package/types/src/cell/SheetCellRenderer.d.ts +52 -0
  37. package/types/src/cell/SheetHeaderRenderer.d.ts +37 -0
  38. package/types/src/cell/index.d.ts +7 -0
  39. package/types/src/cell/useFormulaViewAnchor.d.ts +42 -0
  40. package/types/src/chart/ChartEditor.d.ts +17 -0
  41. package/types/src/chart/PresetChartTypeDescriptors.d.ts +35 -0
  42. package/types/src/chart/index.d.ts +3 -0
  43. package/types/src/chart/templates/area-stacked-percent-template.json.d.ts +10 -0
  44. package/types/src/chart/templates/area-stacked-template.json.d.ts +10 -0
  45. package/types/src/chart/templates/area-template.json.d.ts +9 -0
  46. package/types/src/chart/templates/bar-stacked-percent-template.json.d.ts +10 -0
  47. package/types/src/chart/templates/bar-stacked-template.json.d.ts +10 -0
  48. package/types/src/chart/templates/bar-template.json.d.ts +9 -0
  49. package/types/src/chart/templates/column-stacked-percent-template.json.d.ts +10 -0
  50. package/types/src/chart/templates/column-stacked-template.json.d.ts +10 -0
  51. package/types/src/chart/templates/column-template.json.d.ts +9 -0
  52. package/types/src/chart/templates/line-markers-template.json.d.ts +10 -0
  53. package/types/src/chart/templates/line-stacked-markers-template.json.d.ts +11 -0
  54. package/types/src/chart/templates/line-stacked-percent-markers-template.json.d.ts +11 -0
  55. package/types/src/chart/templates/line-stacked-percent-template.json.d.ts +10 -0
  56. package/types/src/chart/templates/line-stacked-template.json.d.ts +10 -0
  57. package/types/src/chart/templates/line-template.json.d.ts +9 -0
  58. package/types/src/chart/templates/pie-doughnut-template.json.d.ts +10 -0
  59. package/types/src/chart/templates/pie-template.json.d.ts +9 -0
  60. package/types/src/chart/templates/scatter-lines-markers-smooth-template.json.d.ts +10 -0
  61. package/types/src/chart/templates/scatter-lines-markers-template.json.d.ts +10 -0
  62. package/types/src/chart/templates/scatter-lines-smooth-template.json.d.ts +10 -0
  63. package/types/src/chart/templates/scatter-lines-template.json.d.ts +10 -0
  64. package/types/src/chart/templates/scatter-markers-template.json.d.ts +10 -0
  65. package/types/src/clipboard/ClipboardCommands.d.ts +68 -0
  66. package/types/src/clipboard/SheetClipboardLayer.d.ts +22 -0
  67. package/types/src/clipboard/index.d.ts +3 -0
  68. package/types/src/commands/Catalog.d.ts +8 -0
  69. package/types/src/commands/CommandRootProvider.d.ts +36 -0
  70. package/types/src/commands/InputClipboardCommands.d.ts +41 -0
  71. package/types/src/commands/InputClipboardInjector.d.ts +16 -0
  72. package/types/src/commands/MainFocusContext.d.ts +13 -0
  73. package/types/src/commands/PaneScopeProvider.d.ts +40 -0
  74. package/types/src/commands/createTransactionalMiddleware.d.ts +49 -0
  75. package/types/src/commands/index.d.ts +7 -0
  76. package/types/src/context/SheetContext.d.ts +18 -0
  77. package/types/src/context/WorkbookContext.d.ts +20 -0
  78. package/types/src/context/index.d.ts +3 -0
  79. package/types/src/editableLabel/EditableLabel.d.ts +28 -0
  80. package/types/src/editableLabel/index.d.ts +2 -0
  81. package/types/src/editor/EditorCommands.d.ts +98 -0
  82. package/types/src/editor/FunctionPreviewPanel.d.ts +166 -0
  83. package/types/src/editor/NamedHintPanel.d.ts +38 -0
  84. package/types/src/editor/NamedItemsPanel.d.ts +59 -0
  85. package/types/src/editor/SheetCellEditorLayer.d.ts +40 -0
  86. package/types/src/editor/SheetCellInput.d.ts +99 -0
  87. package/types/src/editor/SheetEditable.d.ts +53 -0
  88. package/types/src/editor/SheetReferenceHeaderLayer.d.ts +46 -0
  89. package/types/src/editor/SheetReferenceLayer.d.ts +55 -0
  90. package/types/src/editor/formulaCaret.d.ts +84 -0
  91. package/types/src/editor/formulaEval.d.ts +202 -0
  92. package/types/src/editor/formulaPresentation.d.ts +136 -0
  93. package/types/src/editor/formulaText.d.ts +80 -0
  94. package/types/src/editor/functionArgs.d.ts +111 -0
  95. package/types/src/editor/functionHint.d.ts +37 -0
  96. package/types/src/editor/index.d.ts +18 -0
  97. package/types/src/editor/referencePointNav.d.ts +39 -0
  98. package/types/src/editor/useFormulaHints.d.ts +126 -0
  99. package/types/src/editor/useFormulaInput.d.ts +326 -0
  100. package/types/src/editor/useProtectedEditNotice.d.ts +14 -0
  101. package/types/src/editor/useReferenceMode.d.ts +177 -0
  102. package/types/src/form/FormulaInput.d.ts +86 -0
  103. package/types/src/form/FormulaInputParts.d.ts +94 -0
  104. package/types/src/form/index.d.ts +5 -0
  105. package/types/src/form/useEditCommit.d.ts +174 -0
  106. package/types/src/form/useInputField.d.ts +86 -0
  107. package/types/src/frame/CommandContext.d.ts +179 -0
  108. package/types/src/frame/IFrame.d.ts +17 -0
  109. package/types/src/frame/index.d.ts +3 -0
  110. package/types/src/icons/LogoNoPaddingIcon.d.ts +3 -0
  111. package/types/src/icons/LogoTextNoPaddingIcon.d.ts +4 -0
  112. package/types/src/icons/WaterMark.d.ts +12 -0
  113. package/types/src/icons/chart/ChartAreaIcon.d.ts +5 -0
  114. package/types/src/icons/chart/ChartAreaStackedIcon.d.ts +5 -0
  115. package/types/src/icons/chart/ChartAreaStackedPercentIcon.d.ts +5 -0
  116. package/types/src/icons/chart/ChartBarIcon.d.ts +5 -0
  117. package/types/src/icons/chart/ChartBarStackedIcon.d.ts +5 -0
  118. package/types/src/icons/chart/ChartBarStackedPercentIcon.d.ts +5 -0
  119. package/types/src/icons/chart/ChartBubble3DIcon.d.ts +5 -0
  120. package/types/src/icons/chart/ChartBubbleIcon.d.ts +5 -0
  121. package/types/src/icons/chart/ChartColumnIcon.d.ts +5 -0
  122. package/types/src/icons/chart/ChartColumnStackedIcon.d.ts +5 -0
  123. package/types/src/icons/chart/ChartColumnStackedPercentIcon.d.ts +5 -0
  124. package/types/src/icons/chart/ChartLineIcon.d.ts +5 -0
  125. package/types/src/icons/chart/ChartLineMarkersIcon.d.ts +5 -0
  126. package/types/src/icons/chart/ChartLineStackedIcon.d.ts +5 -0
  127. package/types/src/icons/chart/ChartLineStackedMarkersIcon.d.ts +5 -0
  128. package/types/src/icons/chart/ChartLineStackedPercentIcon.d.ts +5 -0
  129. package/types/src/icons/chart/ChartLineStackedPercentMarkersIcon.d.ts +5 -0
  130. package/types/src/icons/chart/ChartPieDoughnutIcon.d.ts +5 -0
  131. package/types/src/icons/chart/ChartPieIcon.d.ts +5 -0
  132. package/types/src/icons/chart/ChartScatterLinesIcon.d.ts +5 -0
  133. package/types/src/icons/chart/ChartScatterLinesMarkersIcon.d.ts +5 -0
  134. package/types/src/icons/chart/ChartScatterLinesMarkersSmoothIcon.d.ts +5 -0
  135. package/types/src/icons/chart/ChartScatterLinesSmoothIcon.d.ts +5 -0
  136. package/types/src/icons/chart/ChartScatterMarkersIcon.d.ts +5 -0
  137. package/types/src/icons/chart/ChartWaterfallIcon.d.ts +5 -0
  138. package/types/src/icons/chart/ThemedChartIcon.d.ts +20 -0
  139. package/types/src/icons/chart/index.d.ts +50 -0
  140. package/types/src/icons/index.d.ts +4 -0
  141. package/types/src/index.d.ts +27 -0
  142. package/types/src/io/WorkbookIO.d.ts +50 -0
  143. package/types/src/io/index.d.ts +2 -0
  144. package/types/src/layer/BorderLayer.d.ts +14 -0
  145. package/types/src/layer/CellErrorLayer.d.ts +49 -0
  146. package/types/src/layer/CellFillLayer.d.ts +15 -0
  147. package/types/src/layer/ConditionalBarLayer.d.ts +41 -0
  148. package/types/src/layer/ConditionalIcons.d.ts +34 -0
  149. package/types/src/layer/ConditionalIconsLayer.d.ts +31 -0
  150. package/types/src/layer/ContextMenuLayer.d.ts +27 -0
  151. package/types/src/layer/HeaderResizerLayer.d.ts +28 -0
  152. package/types/src/layer/HeaderSelectionLayer.d.ts +89 -0
  153. package/types/src/layer/ResizeIndicator.d.ts +19 -0
  154. package/types/src/layer/SheetBackgroundLayer.d.ts +22 -0
  155. package/types/src/layer/SheetCellLayer.d.ts +49 -0
  156. package/types/src/layer/SheetColumnButtonLayer.d.ts +23 -0
  157. package/types/src/layer/SheetGridLineLayer.d.ts +22 -0
  158. package/types/src/layer/SheetHeaderCellLayer.d.ts +30 -0
  159. package/types/src/layer/SheetMovableLayer.d.ts +26 -0
  160. package/types/src/layer/SheetTableCommandLayer.d.ts +16 -0
  161. package/types/src/layer/SpillLayer.d.ts +22 -0
  162. package/types/src/layer/TableLayer.d.ts +22 -0
  163. package/types/src/layer/ValidationIndicatorLayer.d.ts +41 -0
  164. package/types/src/layer/index.d.ts +25 -0
  165. package/types/src/layer/resizeIndicatorState.d.ts +26 -0
  166. package/types/src/layer/useSheetFeatureRegions.d.ts +21 -0
  167. package/types/src/layer/useSheetVisibleCells.d.ts +60 -0
  168. package/types/src/layer/useSheetVisibleDecorations.d.ts +42 -0
  169. package/types/src/layer/useTableHeaderCells.d.ts +22 -0
  170. package/types/src/layer/useVisibleTables.d.ts +27 -0
  171. package/types/src/listener/index.d.ts +3 -0
  172. package/types/src/listener/useModelListener.d.ts +67 -0
  173. package/types/src/listener/useRangeListener.d.ts +15 -0
  174. package/types/src/movable/EmptyFrame.d.ts +16 -0
  175. package/types/src/movable/IMovableArea.d.ts +34 -0
  176. package/types/src/movable/MovableCommands.d.ts +22 -0
  177. package/types/src/movable/MovableFrame.d.ts +48 -0
  178. package/types/src/movable/MovableLayer.d.ts +77 -0
  179. package/types/src/movable/MoveableBundle.d.ts +4 -0
  180. package/types/src/movable/index.d.ts +4 -0
  181. package/types/src/picture/IPictureEditor.d.ts +39 -0
  182. package/types/src/picture/PictureEditor.d.ts +4 -0
  183. package/types/src/picture/index.d.ts +3 -0
  184. package/types/src/selection/SelectionCommands.d.ts +23 -0
  185. package/types/src/selection/SheetSelection.d.ts +53 -0
  186. package/types/src/selection/SheetSelectionLayer.d.ts +30 -0
  187. package/types/src/selection/index.d.ts +4 -0
  188. package/types/src/shape/ShapeEditor.d.ts +16 -0
  189. package/types/src/shape/index.d.ts +2 -0
  190. package/types/src/sheet/ConditionalFormatPresets.d.ts +56 -0
  191. package/types/src/sheet/ISheetElement.d.ts +233 -0
  192. package/types/src/sheet/ISheetHeaderElement.d.ts +138 -0
  193. package/types/src/sheet/NotImplemented.d.ts +3 -0
  194. package/types/src/sheet/SheetCommandProvider.d.ts +57 -0
  195. package/types/src/sheet/SheetCommands.d.ts +75 -0
  196. package/types/src/sheet/SheetElement.d.ts +15 -0
  197. package/types/src/sheet/SheetHeaderElement.d.ts +4 -0
  198. package/types/src/sheet/SheetScrollbar.d.ts +28 -0
  199. package/types/src/sheet/TopLeftCorner.d.ts +17 -0
  200. package/types/src/sheet/index.d.ts +7 -0
  201. package/types/src/slicer/SlicerEditor.d.ts +16 -0
  202. package/types/src/slicer/index.d.ts +2 -0
  203. package/types/src/tabStrip/SheetTab.d.ts +41 -0
  204. package/types/src/tabStrip/Sortable.d.ts +66 -0
  205. package/types/src/tabStrip/Tab.d.ts +19 -0
  206. package/types/src/tabStrip/TabStrip.d.ts +41 -0
  207. package/types/src/tabStrip/TabStripItem.d.ts +36 -0
  208. package/types/src/tabStrip/TabStripRow.d.ts +9 -0
  209. package/types/src/tabStrip/index.d.ts +7 -0
  210. package/types/src/table/TableCommands.d.ts +16 -0
  211. package/types/src/taskPane/ITaskPane.d.ts +72 -0
  212. package/types/src/taskPane/TaskPaneArea.d.ts +144 -0
  213. package/types/src/taskPane/TaskPaneFrame.d.ts +48 -0
  214. package/types/src/taskPane/TaskPaneRegistry.d.ts +108 -0
  215. package/types/src/taskPane/TaskPaneStrip.d.ts +33 -0
  216. package/types/src/taskPane/TaskPaneTitle.d.ts +24 -0
  217. package/types/src/taskPane/index.d.ts +7 -0
  218. package/types/src/taskPane/useTaskPane.d.ts +29 -0
  219. package/types/src/theme/DocThemesContext.d.ts +3 -0
  220. package/types/src/theme/DocThemesProvider.d.ts +15 -0
  221. package/types/src/theme/ThemeState.d.ts +19 -0
  222. package/types/src/theme/buildDocThemeCSS.d.ts +16 -0
  223. package/types/src/theme/buildOOXMLThemeCSS.d.ts +13 -0
  224. package/types/src/theme/createCSSSystemLookup.d.ts +51 -0
  225. package/types/src/theme/index.d.ts +11 -0
  226. package/types/src/theme/useAppColorScheme.d.ts +15 -0
  227. package/types/src/theme/useDocThemes.d.ts +3 -0
  228. package/types/src/theme/useGridColorScheme.d.ts +20 -0
  229. package/types/src/theme/useSystemColors.d.ts +44 -0
  230. package/types/src/undo/UndoCommands.d.ts +28 -0
  231. package/types/src/undo/UndoManagerContext.d.ts +14 -0
  232. package/types/src/undo/index.d.ts +3 -0
  233. package/types/src/workbook/DefaultRenderers.d.ts +14 -0
  234. package/types/src/workbook/GlobalWorkbookElement.d.ts +10 -0
  235. package/types/src/workbook/IWorkbookElement.d.ts +178 -0
  236. package/types/src/workbook/WindowChrome.d.ts +61 -0
  237. package/types/src/workbook/WorkbookCommandContributor.d.ts +24 -0
  238. package/types/src/workbook/WorkbookCommands.d.ts +97 -0
  239. package/types/src/workbook/WorkbookElement.d.ts +9 -0
  240. package/types/src/workbook/WorkbookStrip.d.ts +73 -0
  241. package/types/src/workbook/index.d.ts +17 -0
  242. package/types/src/workbook/resolveWorkbookInput.d.ts +27 -0
  243. package/types/src/workbook/useResolvedWorkbook.d.ts +31 -0
  244. package/types/src/workbook/useWindowChrome.d.ts +24 -0
  245. package/types/src/workbook/useWorkbookApp.d.ts +47 -0
  246. package/types/src/workbook/useWorkbookEncrypted.d.ts +15 -0
  247. package/types/src/workbook/useWorkbookFormat.d.ts +18 -0
  248. package/types/src/workbook/useWorkbookName.d.ts +13 -0
  249. package/types/src/workbook/useWorkbookSaveState.d.ts +29 -0
  250. package/browser/cjs/DNki9dGbSn_gUfd3.cjs +0 -7
  251. package/browser/cjs/Da611GSWMp5ncOGO.cjs +0 -16
  252. package/browser/cjs/F8ZECny0CwW2OV5X.cjs +0 -161
  253. package/browser/esm/BYGSBjns_83FWXAx.mjs +0 -3905
  254. package/browser/esm/CmObbQiLq9AAM7-q.mjs +0 -394
  255. package/browser/esm/Daa2g2QALCIHFgqP.mjs +0 -1377
  256. package/node/assets/style.css +0 -1
  257. package/node/esm/Bu9xI_rgkuupQ2AO.mjs +0 -11
@@ -1,33 +1,33 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6{pointer-events:none}._sheetxl-sheet_1qeq6_5 ._viewport-overlay_1qeq6_6 *{pointer-events:initial}._sheetxl-sheet_1qeq6_5 .cell-container>*{overflow:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .text-box{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .text-line{text-rendering:optimizespeed;position:absolute;vertical-align:baseline;white-space:pre}._sheetxl-sheet_1qeq6_5 .cell-container .filter-button{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:row;margin-bottom:4px}._sheetxl-sheet_1qeq6_5 .cell-container .text-debug-bounds{position:absolute;background:green;pointer-events:none;opacity:.2}._sheetxl-sheet_1qeq6_5 .cell-container .fill{position:absolute}._sheetxl-sheet_1qeq6_5 .cell-container .pending{width:6px;height:6px;top:5px;left:4px;position:absolute;border:var(--sxl-app-color-primary-dark, grey) .5px;border-style:double;border-radius:50%;background-color:var(--sxl-app-color-button-surface, grey);opacity:1;animation:_pulse_1qeq6_1 1.5s infinite alternate}@keyframes _pulse_1qeq6_1{0%{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.8}to{transform:scale(1);opacity:1}}._sheetxl-sheet_1qeq6_5 .cell-container .slider{position:absolute;width:130%;height:2px;bottom:1px;opacity:0;animation:_fadeIn_1qeq6_1 0s .5s forwards;overflow-x:hidden}._sheetxl-sheet_1qeq6_5 .cell-container .line{position:absolute;opacity:.3;background:var(--sxl-app-color-primary-light, rgb(173, 173, 173)) .5px;width:100%;height:2px}._sheetxl-sheet_1qeq6_5 .cell-container .subline{position:absolute;background:var(--sxl-app-color-primary, rgb(77, 77, 77)) .5px;opacity:.9;height:3px}._sheetxl-sheet_1qeq6_5 .cell-container .inc{animation-delay:0s;animation:_increase_1qeq6_1 3s infinite}@keyframes _fadeIn_1qeq6_1{0%{opacity:0;height:0px}to{opacity:1;height:2px}}@keyframes _increase_1qeq6_1{0%{left:-150%;width:30%;animation-timing-function:ease}to{left:100%;width:30%}}._TaskPaneArea_6dmgk_5{position:absolute;height:100%;width:100%;display:flex;flex-direction:row}._TaskPaneTitle_6dmgk_13{display:flex;box-sizing:border-box;flex:1 1 0;flex-direction:row;align-items:center;font-size:1.25rem;height:100%;width:100%;padding:8px 16px;border-bottom:solid rgba(0,0,0,.2) 1px}._TaskPaneTitle_6dmgk_13 .title{opacity:.87}._TaskPaneTitle_6dmgk_13.focused .title{opacity:1}._TaskPaneFrame_6dmgk_36{display:flex;position:relative;flex-direction:column;width:100%;box-sizing:border-box;flex:1 1 0;min-height:0;align-items:stretch;justify-content:stretch;margin-bottom:4px;border-radius:4px;overflow:hidden}._TaskPaneStrip_6dmgk_52{display:flex;flex-direction:column;gap:4px;margin-top:4px;margin-left:2px}._TaskPaneStripItem_6dmgk_60{display:flex;flex-direction:row;align-items:center;padding:4px;border-radius:4px;border:grey solid 1px}._TaskPaneStripItem_6dmgk_60.selected{font-weight:700}._sheet-scrollbar_104cg_1{margin-left:2px;margin-bottom:1px;align-items:center}._sheet-selection_12wyx_5 .fill-handle .dragging,._movable-area_314c6_5 .moveable-control-box .dragging{opacity:0}._movable-area_314c6_5 .moveable-control-box .moveable-control{width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px;background-color:var(--sxl-app-color-background, white);background-image:var(--sxl-app-image-background);border:2px solid var(--sxl-app-color-primary-dark, grey)}._movable-area_314c6_5 .moveable-control-box .moveable-line{background:var(--sxl-app-color-grey, grey)}@media (pointer: coarse){._movable-area_314c6_5 .moveable-control-box .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}._editable-input_1bqx6_6{position:absolute;left:0;top:0;width:100%;min-height:calc(100% + 1px);border:none;padding:0;outline:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.2;letter-spacing:inherit;text-transform:inherit;background:transparent}@keyframes _pop_1wyun_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_1wyun_33{0%{opacity:0}to{opacity:1}}._Wrapper_1wyun_25{display:flex;box-sizing:border-box;transform:translate3d(var(--translate-x, 0),var(--translate-y, 0),0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1));transform-origin:0 0;touch-action:manipulation}._Wrapper_1wyun_25._dragOverlay_1wyun_37{z-index:999}._Item_1wyun_47{position:relative;display:flex;align-items:center;outline:none;box-sizing:border-box;transform-origin:50% 50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale, 1))}._Item_1wyun_47:not(._withHandle_1wyun_61){touch-action:manipulation}._Item_1wyun_47._dragging_1wyun_66:not(._dragOverlay_1wyun_37){z-index:999}._Item_1wyun_47._dragOverlay_1wyun_37{cursor:inherit;animation:_pop_1wyun_1 .2s cubic-bezier(.18,.67,.6,1.22);transform:scale(var(--scale));opacity:1}._Row_1kr10_1{display:flex;box-sizing:border-box}._TabStrip_3x0dp_1::-webkit-scrollbar{display:none;height:0px}._TabStrip_3x0dp_1{overflow-y:auto;overflow-x:hidden;position:relative}._script-editor_iy654_5 .monaco-editor{position:absolute}._script-editor_iy654_5 .monaco-editor .margin-icon{display:block;width:16px;height:16px;background-size:16px;background-repeat:no-repeat;background-position:center;background-size:contain}._script-editor_iy654_5 .monaco-editor .formula{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z"/><path d="M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .macro{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M 5.1933594,1.4433594 6.3417969,2.5234375 6.2109375,2.6621094 c -3.466072,3.6769426 -3.467641,9.6565186 0,13.3339846 l 0.1308594,0.136718 -1.1484375,1.082032 -0.1328125,-0.140625 c -4.0371886,-4.28224 -4.0373752,-11.2077961 0,-15.4902346 z m 14.4726566,0 0.132812,0.140625 c 4.03717,4.2822197 4.037356,11.2058636 0,15.4882816 l -0.132812,0.140625 -1.148438,-1.080079 0.130859,-0.138671 c 3.465532,-3.675243 3.466902,-9.6542123 0,-13.3320316 L 18.517578,2.5234375 Z M 7.7597656,4.4335937 8.8769531,5.5488281 8.7421875,5.6816406 c -2.0366665,2.0366662 -2.037411,5.3404354 0,7.3769534 L 8.8769531,13.191406 7.7597656,14.310547 7.625,14.173828 C 4.9718615,11.520692 4.9723209,7.222936 7.6269531,4.5683594 Z m 9.3398434,0 0.132813,0.1347657 c 2.653779,2.6537788 2.65545,6.9500666 0,9.6054686 l -0.132813,0.136719 -1.117187,-1.119141 0.134765,-0.132812 c 2.036637,-2.035554 2.037534,-5.3391996 0,-7.3769534 L 15.982422,5.5488281 Z m -4.669921,1.7011719 c 0.811773,0 1.627703,0.304374 2.25,0.90625 1.260638,1.2198223 1.260413,3.1986104 0,4.4179684 -0.355144,0.343115 -0.779063,0.585007 -1.226563,0.732422 l -0.234375,0.07617 v 3.386719 h 0.002 v 6.048828 c 0,0.436615 -0.351565,0.791016 -0.789062,0.791016 -0.43763,0 -0.791016,-0.354618 -0.791016,-0.791016 v -3.308594 -6.126953 l -0.234375,-0.07617 c -0.448339,-0.147699 -0.871819,-0.38969 -1.226562,-0.732422 -1.2608671,-1.22004 -1.2605877,-3.1984433 0,-4.4179684 0.62227,-0.6019293 1.438264,-0.90625 2.25,-0.90625 z m 0,1.5820313 c -0.417461,0 -0.829931,0.1510762 -1.146485,0.4570312 -0.615751,0.5967629 -0.616877,1.5583713 0,2.1562499 0.314469,0.303373 0.726552,0.455078 1.146485,0.455078 0.421182,0 0.833304,-0.153008 1.148437,-0.457031 0.61548,-0.5965047 0.616739,-1.5585025 0,-2.15625 C 13.261859,7.8661993 12.846121,7.7167969 12.429688,7.7167969 Z"/></svg>');cursor:pointer}._script-editor_iy654_5 .monaco-editor .autorun{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="grey"><path d="M10 15h5.88c.27-.31.67-.5 1.12-.5.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5c-.44 0-.84-.19-1.12-.5H11.9c-.46 2.28-2.48 4-4.9 4-2.76 0-5-2.24-5-5 0-2.42 1.72-4.44 4-4.9v2.07c-1.16.41-2 1.53-2 2.83 0 1.65 1.35 3 3 3s3-1.35 3-3zm2.5-11c1.65 0 3 1.35 3 3h2c0-2.76-2.24-5-5-5s-5 2.24-5 5c0 1.43.6 2.71 1.55 3.62l-2.35 3.9c-.68.14-1.2.75-1.2 1.48 0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5c0-.16-.02-.31-.07-.45l3.38-5.63C10.49 9.61 9.5 8.42 9.5 7c0-1.65 1.35-3 3-3m4.5 9c-.64 0-1.23.2-1.72.54l-3.05-5.07C11.53 8.35 11 7.74 11 7c0-.83.67-1.5 1.5-1.5S14 6.17 14 7c0 .15-.02.29-.06.43l2.19 3.65c.28-.05.57-.08.87-.08 2.76 0 5 2.24 5 5s-2.24 5-5 5c-1.85 0-3.47-1.01-4.33-2.5h2.67c.48.32 1.05.5 1.66.5 1.65 0 3-1.35 3-3s-1.35-3-3-3"/></svg>');cursor:pointer}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- "use strict";/**
3
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.7.27
4
- *
5
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
- * License: The license can be found at https://www.sheetxl.com/license.
7
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@sheetxl/sdk"),s=require("react/jsx-runtime"),ge=require("@sheetxl/utils"),r=require("@sheetxl/utils-react"),o=require("react"),gt=require("@sheetxl/grid-react"),Kt=require("react-dom"),uo=o.memo(e=>{const{anchorLocation:t=ge.AnchorLocation.TopLeft,cellWidth:n,cellHeight:i,size:a=7,inset:l=1,darkMode:f,fill:h,propsPath:c,style:C,...M}=e,y=a,p=l;let T="red",I=[],z=[];return t===ge.AnchorLocation.TopLeft?(T=f?"rgb(255, 198, 246)":"green",I.push(p),z.push(p),I.push(p+y),z.push(p),I.push(p),z.push(p+y)):t===ge.AnchorLocation.TopRight?(T=f?"rgb(0, 255, 255)":"red",I.push(n-p),z.push(p),I.push(n-(p+y)),z.push(p),I.push(n-p),z.push(p+y)):t===ge.AnchorLocation.BottomRight?(T=f?"rgb(236, 252, 211)":"purple",I.push(n-p),z.push(i-p),I.push(n-(p+y)),z.push(i-p),I.push(n-p),z.push(i-(p+y))):t===ge.AnchorLocation.BottomLeft&&(T=f?"rgb(255, 236, 183)":"blue",I.push(p),z.push(i-p),I.push(p+y),z.push(i-p),I.push(p),z.push(i-(p+y))),s.jsx("svg",{width:`${n}`,height:`${i}`,viewBox:`0 0 ${n} ${i}`,style:{position:"absolute",width:`${n}px`,height:`${i}px`,pointerEvents:"none",...C},...M,children:s.jsx("path",{d:`M ${I[0]} ${z[0]} L ${I[1]} ${z[1]} L ${I[2]} ${z[2]} L ${I[0]} ${z[0]} Z`,fill:h??T,...c})})}),dr=e=>{const{renderBounds:t,darkMode:n,zoom:i,disabled:a,filter:l,onFilterButtonMouseDown:f,style:h,...c}=e,C=o.useMemo(()=>{let T=null;const I=l.getSortField();I&&(T=I.reverse);const z=l.getField(),D=z&&z.criteria&&z.criteria.length>0;return T===!0?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z":"m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":T===!1?D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z":"m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":D?"m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z":"M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673"},[l]),[M,y]=o.useState(!1),p=Math.min(Math.min(18,t.height-8),t.width);return s.jsx("div",{style:{width:`${p}px`,height:`${p}px`,right:"0px",boxShadow:`0px 0px 0px 0.5px var(${M&&!a?"--sxl-app-color-primary-light, rgba(0,0,0,.55)":"--sxl-app-color-border-button, grey"})`,backgroundColor:"var(--sxl-app-color-button-fill, white)",backgroundImage:"var(--sxl-app-image-background)",borderRadius:(p>12?1:0)+"px",marginRight:"2px",display:"flex",alignItems:"center",justifyContent:"center",cursor:a?void 0:"pointer",...h},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onMouseDown:T=>{f?.(T,l),T.preventDefault()},...c,children:s.jsx("svg",{width:""+15*i,height:""+15*i,viewBox:"0 0 15 15",style:{fill:`var(${M&&!a?"--sxl-app-color-primary-dark":"--sxl-app-color-button-text"}, grey)`,opacity:a?.6:1},children:s.jsx("path",{d:C})})})},ur=e=>{const{value:t,coords:n,bounds:i,children:a,style:l,range:f,zoom:h=1,view:c,bodyStyle:C,normalStyle:M,showFormulas:y,showZeros:p,docTheme:T,onLinkMouseDown:I,onFilterButtonMouseDown:z,propsFilterButton:D,renderFilterButton:_=dr,...$}=e,w=i.height/h,N=i.width/h,v=t,E=v.getValue(),q=t.getStyle(),Z=C?.darkMode??!1;let F,P;const W=E&&E.isFormulaError,pe=W&&E instanceof d.FormulaError.Parse;let de,le=y||pe;if(le)if(v.isSpillOverflow())P="";else{const re=v.getFormulaText();re?P=re:F=v.getNumberFormat(d.NumberFormat.Type.General)}else F=v.getNumberFormat();le||(de=v.getTextOverflow());const R=de?de.colBounds.width+de.leftOffset+de.rightOffset:N,te=de?de.anchorBounds.x-de.leftOffset:0,k=de?de.anchorBounds.width:N,b=de?de.anchorBounds.x:0;let ee,ne=v.getRenderHorizontalAlignment();F&&(ee=F?.formattedRuns,P=ee?.runs[0]?.text??F.displayText);const Re=v.getCalcStatus()===d.ICell.CalcStatus.Pending;let Ce=null,ye=q.getFill().toCSS(Z,i),Pe=0,ze=0;if(!q.getBorder().isEmpty()){const re=q.getBorder().getRight();!re.isNone()&&d.IBorder.BuiltInDefinitions.get(re.getStyle()).width>1&&(Pe=1);const x=q.getBorder().getBottom();!x.isNone()&&d.IBorder.BuiltInDefinitions.get(x.getStyle()).width>1&&(ze=1)}let Ae=null;if(N!==k||Pe||ze||typeof ye?.backgroundPosition=="number"){const{backgroundPosition:re,...x}=ye,B=re??0,S=c?.getScrollTopLeft(),j=B?-(i.x+(S.left??0))%B:0,se=B?-(i.y+(S.top??0))%B:0;(re!==void 0||Pe||ze||N!==k)&&(Object.keys(x).length===1&&x.background==="none"||(ye=null,Ae=s.jsx("div",{className:"fill",style:{marginLeft:`${j}px`,marginTop:`${se}px`,left:b*h,width:r.ReactUtils.boundPixel(k*h-j+1+Pe),height:r.ReactUtils.boundPixel(i.height-se+1+ze),...x}},"background")))}let Ie=null;const ue=v.getComments(),O=v.getWarnings(),xe=v.getErrors();if(ue||W||xe.length>0||O.length>0){const re={size:7*h,darkMode:Z,cellWidth:k*h+2,cellHeight:w*h+2,style:{top:-1,left:b*h-1}};Ie=Ie??[],(O.length>0||xe.length>0||W)&&Ie.push(s.jsx(uo,{anchorLocation:ge.AnchorLocation.TopLeft,...re},`indicator-${Ie.length}`)),ue&&Ie.push(s.jsx(uo,{anchorLocation:ge.AnchorLocation.TopRight,...re},`indicator-${Ie.length}`))}const Le=q.getFont();let H=F?.conditionalColor;const U=q.getAlignment(),he=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.Fill,ce=U.getHorizontal()===d.ITextFrame.HorizontalAlignment.CenterContinuous||he,me=ce||le?0:U.getRotation(),Te=v.getInsets(),ie=Te.top+Te.bottom;let qe=Te.left,g=Te.right;const je={...l,left:l.left-1,top:l.top-1,width:l.width+1+Pe,height:l.height+1+ze},Be=v.getColumnFilter(),Ee=Be&&!Be?.hasHiddenButton();let u=null;Re&&(u=s.jsxs("div",{className:"slider",children:[s.jsx("div",{className:"line"}),s.jsx("div",{className:"subline inc"})]},"pending"));const L=!(Re||Ee||Ae||a||Ie||ee?.runs.length>1||de||me%360!=0);ye?.background==="none"&&(ye=null);let K=ce||!(!de||!(de.rightIndex>0||de.leftIndex>0||de.colSpan>1));if(!K){const re=v.getSpans();(re.width>1||re.height>1)&&(K=!0)}const m={...ye,...je,pointerEvents:I?"auto":void 0};if(!ge.CommonUtils.isEmpty(P)||!ge.CommonUtils.isEmpty(F?.repeatPlaceholder)){const re=F?.canWrap??!1;let x=null,B=null,S=null,j=[],se=!0;p||le||E!==0||(se=!1);const ae=v.getTextFrame(le);if(se&&ae){let we=R-1-(qe+g);if(me){x=ae.layout().bounds;const He={x:0,y:0,width:R-1,height:w};if(ee){let ve=ee.width;if(F.repeatPlaceholder||F.repeatChars.length>0){const De=d.GeomUtils.boundsToPoints(He),be=d.GeomUtils.rotatePoints(De,-me);ve=d.GeomUtils.minBoundingRect(be).width}x={...x,width:ve}}S=d.GeomUtils.clipToOuterRect({...x,width:x.width+1+qe+g},He,me),we=S.width-1-(qe+g)+.01}let Y=null;re&&(Y={width:we});let fe=null,V=F?.repeatPlaceholder;const X=ae.layout(Y);if(x=X.bounds,le?x={...x,width:0}:ee&&(x={...x,width:F.repeatPlaceholder||F.repeatChars.length>0?we:ee.width}),me&&re){let Se=null;X.visitLines({visitTextLine:(He,ve)=>{let De=He.bounds;const be=d.GeomUtils.boundsToPoints(De),ke=d.GeomUtils.rotatePoints(be,me),Ne=d.GeomUtils.minBoundingRect(ke);De={...De,x:(Ne.width-De.width)/2,y:(Ne.height-De.height)/2},Se=Se?d.GeomUtils.unionBounds(Se,De):De}}),x={...Se,width:Se.width+qe+g}}if(!V&&v.getType()!==d.ScalarType.String&&Math.floor(x.width)>we){if(q.getNumberFormat()==="General"&&v.getType()===d.ScalarType.Number){const Se=q.measureText("0"),He=Math.floor(we/Se.width),ve=E,De=ge.CommonUtils.splitNumber(ve),be=Math.min(10,He-(Math.max(1,De.ipLength)+1)-(ve<0?1:0));if(be>=-1){const ke=`0${be>0?".":""}${"#".repeat(Math.max(0,be))}`;fe=v.getNumberFormat(ke).displayText,fe==="0"&&ve<0&&(fe="-0")}else if(Math.abs(ve)>=Math.pow(10,5)||Math.abs(ve)<=Math.pow(10,-5)){const ke=He-5-(ve<0?1:0);if(ke>=0){const Ne=`0.${"0".repeat(Math.max(0,ke-1))}E+00`;fe=v.getNumberFormat(Ne).displayText}}}fe||(V="#")}if(!V&&ee?.lastRepeatIndex>=0&&ee?.width>we&&(V="#"),V&&we>0){const Se=q.measureText(V),He=Math.floor((we||1)/(Se?.width||1));fe=He>0?V.repeat(He):"",ne=d.ITextFrame.HorizontalAlignment.Center}if(le&&(ne=d.ITextFrame.HorizontalAlignment.Left),fe){const Se=q.measureText(fe).width;Se&&(x={...x,width:Se})}if(B={...x,width:x.width+qe+g,height:x.height},me&&!re){const Se=d.GeomUtils.boundsToPoints(B),He=d.GeomUtils.rotatePoints(Se,me),ve=d.GeomUtils.minBoundingRect(He);B.width=ve.width,B.height=ve.height}ne===d.ITextFrame.HorizontalAlignment.Center||ne===d.ITextFrame.HorizontalAlignment.CenterContinuous?B.x=(R-B.width)/2:ne===d.ITextFrame.HorizontalAlignment.Right?B.x=R-B.width-.5:B.x=.5,U.getVertical()===d.ITextFrame.VerticalAlignment.Center?B.y=(w-B.height)/2:U.getVertical()===d.ITextFrame.VerticalAlignment.Bottom?B.y=w-B.height-ie:B.y=ie;const oe=L?{...$}:void 0,Fe={style:{left:l.left-1,top:l.top-1,width:l.width+1,height:l.height+1,transform:me?`rotate(${me}deg)`:void 0,cursor:I?"pointer":void 0,pointerEvents:I?"auto":void 0,zIndex:K?1:void 0,...ye},onMouseDown:I,onDoubleClick:I?Se=>{Se.stopPropagation(),Se.preventDefault()}:null,...oe};pe&&(Fe.style.textDecorationStyle="wavy",Fe.style.textDecorationColor=Z?"rgb(0, 255, 255)":"red",Fe.style.textDecorationLine="underline");const Ue=Le.getSize(),Oe=(Se,He,ve,De,be,ke,Ne,Ze=null)=>{let _e=Ue*h,Xe=ve,at=Ne?.runs?Ne.runs:[{type:d.NumberFormat.ParseRunType.Text,text:Se,width:q.measureText(Se,_e).width}];Ne&&Ne?.width!==x.width&&(x={...x,width:Ne?.width});let ot=qe;if(Ne?.lastRepeatIndex>=0&&we>Ne?.width){const Je=Ne.runs[Ne.lastRepeatIndex];if(Je){const st=[...at],wt=Math.max(0,we-1-Ne.width);let bt=0,dt="";if(wt>0){const ft=Math.floor(wt/Je.width);dt=ft>0?Je.text.repeat(ft):"",bt=wt}st[Ne.lastRepeatIndex]={type:d.NumberFormat.ParseRunType.Repeat,text:dt,width:bt},at=st,x={...x,width:Ne.width+bt}}}const $e=(Je,st,wt,bt,dt,ft,xt,Un,Yt,fn=null)=>{let Pt,jt=Xe.width;be===d.ITextFrame.HorizontalAlignment.Justify?(jt=dt,ke||(Pt="justify")):be===d.ITextFrame.HorizontalAlignment.Distributed&&(jt=dt,Pt=ke||Je.text.split(" ").length-1==0?"center":"justify");const{style:It,className:pt,...pn}=fn;let Bt=Je.text;if(be===d.ITextFrame.HorizontalAlignment.Fill&&F?.repeatChars.length===0){const ut=Math.max(1,Math.floor((Xe?.width??0)/(xt?.width??1)));Bt=Bt.repeat(ut)}let Mt=Xe.height;const At=Le.getVerticalAlignment(),Jt=At===d.IFont.VerticalAlignment.Sub,Kn=At===d.IFont.VerticalAlignment.Super;if(Jt||Kn){const ut=Le.getSuperSubScale();_e*=ut,Mt*=ut}const et={textAlign:Pt,textAlignLast:Pt,...It,...Le.toCSS(Z,h,!0),fontSize:_e*d.IFont.getDeviceScale()};L||(et.background=void 0),H&&(et.color=H.toCSS(Z));const Qt=ot+st;let Ot=Te.top+Xe.y+0;if(Jt&&(Ot+=Yt-_e),ft){const ut=(xt.x+Qt)*h+1,vt=(xt.y+Ot)*h+1;vt<0?et.marginTop=vt:et.paddingTop=vt,ut<0?(et.width=(It?.width??0)-ut,et.left=(It?.left??0)+ut):et.paddingLeft=ut,et.paddingRight=Math.max(0,(It?.width??0)-jt*h-ut),et.paddingBottom=Math.max(0,(It?.height??0)-Xe.height*h-vt),et.height=(It?.height??0)+(vt<0?-vt:0),(vt<0||ut<0)&&(et.clipPath=`inset(${vt<0?-vt:0}px 0px 0px ${ut<0?1-ut:0}px)`)}else if(et.left=(xt.x+Qt)*h+1,et.top=(xt.y+Ot)*h+1,et.width=xt.width*h,et.height=xt.height*h,me&&!re){et.left=(xt.x+st)*h+1,et.top=(xt.y+(Xe.y+0))*h+1;const ut=d.GeomUtils.centerPoint({x:ot+st,y:0,width:Je.width,height:Xe.height}),vt=d.GeomUtils.centerPoint({x:ot,y:0,width:dt,height:Xe.height}),Cn=d.GeomUtils.rotatePoints([ut],me,vt),en={x:Cn[0].x-ut.x,y:Cn[0].y-ut.y};et.left=et.left+en.x*h,et.top=et.top+en.y*h;const Dt={...Xe,x:ot,y:Te.top,width:Xe.width+(qe+g)},$n=d.GeomUtils.boundsToPoints(Dt),Wn=d.GeomUtils.rotatePoints($n,me),yn=d.GeomUtils.minBoundingRect(Wn);Dt.width=yn.width,Dt.height=yn.height;const Ht=d.GeomUtils.centerPoint(Dt),wn={x:Ht.x-vt.x,y:Ht.y-vt.y};et.left=et.left+wn.x*h,et.top=et.top+wn.y*h}et.lineHeight=Mt*h+"px";const vn=L?void 0:"text-line";j.push(s.jsx("div",{className:pt?`${pt} ${vn}`:vn,style:et,...pn,children:Bt},`text-${Xe.y}-${bt}-${wt}`))};if(U.getOverflow()===d.ITextFrame.Overflow.Shrink&&we>0){let Je=x?.width??0,st=0;for(;Je>1&&Je>we&&_e>2&&st<100;)_e*=we/Je,Je=q.measureText(Se,_e).width,st++;x={...x,width:Je}}let lt=Xe.x;be===d.ITextFrame.HorizontalAlignment.Right?lt+=x.width-Xe.width:be!==d.ITextFrame.HorizontalAlignment.Center&&be!==d.ITextFrame.HorizontalAlignment.CenterContinuous||(lt+=(x.width-Xe.width)/2),Ne?.lastRepeatIndex>=0&&(lt=Xe.x);const it=at.length;for(let Je=0;Je<it;Je++){const st=at[Je];(st.type===d.NumberFormat.ParseRunType.Text||st.type===d.NumberFormat.ParseRunType.Repeat)&&(st.type,d.NumberFormat.ParseRunType.Repeat,$e(st,lt,Je,He,be===d.ITextFrame.HorizontalAlignment.Justify||be===d.ITextFrame.HorizontalAlignment.Distributed||Ne?.lastRepeatIndex>=0?we:Xe.width,L,{x:B.x+te,y:B.y,width:st.width,height:x.height},0,De,Ze)),lt+=st.width}};fe?Oe(fe,0,{x:0,y:0,...x},X.lines[0].baseline,ne,!0,null,Fe):X.visitLines({visitTextLine:(Se,He,ve)=>{const De=Se.runs[0].text.replace(/\s+$/,""),be=He===ve-1;let ke=ne===d.ITextFrame.HorizontalAlignment.Justify&&(be||Se.runs[0].text.endsWith(`
8
- `))?d.ITextFrame.HorizontalAlignment.Left:ne,Ne=0;He>0&&(U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed||U.getVertical()===d.ITextFrame.VerticalAlignment.Justify)&&(Ne=Math.max(0,(w-(ie+3)-Se.bounds.height*ve)/(ve-1)*He)),U.getVertical()===d.ITextFrame.VerticalAlignment.Distributed&&me&&me%90==0&&me%180!=0&&(ke=d.ITextFrame.HorizontalAlignment.Distributed),ke!==d.ITextFrame.HorizontalAlignment.Justify&&ke!==d.ITextFrame.HorizontalAlignment.Distributed&&ke!==d.ITextFrame.HorizontalAlignment.Fill||(x={...x,width:we});let Ze=he||F&&(F.repeatChars.length>0||F.spacingChars.length>0)?x.width:Se.bounds.width;const _e={...Se.bounds,y:Se.bounds.y+Ne+0,width:Ze};Oe(De,He,_e,ae.lines[0].baseline,ke,be,ve===1?ee:null,L&&He>0?{...Fe,style:{...Fe.style,background:void 0}}:Fe)}})}j.length>0&&(Ce=j)}if(L)return Ce&&Ce.length>0?Ce:s.jsx("div",{style:m,...$});let A=I?"auto":je.pointerEvents,G=null;if(Ee){const re={x:b*h-1,y:-1,width:k*h+1,height:w*h+1};A="auto",G=_({renderBounds:re,darkMode:Z,className:"filter-button",disabled:!v.isEditAllowed(),zoom:h,filter:v.getColumnFilter(),onFilterButtonMouseDown:z,...D}),G&&(G=s.jsx("div",{style:{...re,position:"absolute",zIndex:2,display:"flex",alignItems:"end"},onDoubleClick:x=>{x.stopPropagation(),x.preventDefault()},children:G},"filterButton"))}Re&&!Ce&&(Ce=s.jsx("div",{style:{position:"absolute",left:0,right:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:"..."},"pending-ellipsis"));const J=[Ae,Ce,a,Ie,u,G];return s.jsx("div",{style:{...ye,...je,pointerEvents:A},...$,children:J})},Ao={text:"",placeholder:""},Do=(e,t)=>{if(e.clean().getStyle().getNumberFormat().indexOf("%")===-1)return!1;const n=t??e.dirty??"";return n.length===0||n.endsWith("%")&&!isNaN(parseFloat(n.substring(0,n.length-1)))},hl=Object.freeze([r.KeyCodes.Delete,r.KeyCodes.Home,r.KeyCodes.End]),gr=o.memo(o.forwardRef((e,t)=>{const{editState:n,onStartEdit:i,onChangeEdit:a,onSubmitEdit:l,onCancelEdit:f,onDoneEdit:h,defaultTextStyle:c,useRichStyling:C=!0,bodyStyle:M,activeCoords:y,sheet:p,commands:T,containerBounds:I,setNaturalSize:z,onFocus:D,disabled:_,style:$,zoom:w=1,linesVisible:N,autoFocus:v=!1,...E}=e,{height:q=0,width:Z=0}=I??{},F=M?.darkMode??!1,P=o.useRef(null),[W,pe]=o.useState(!1),[de,le]=o.useState(null),[R,te]=o.useState(()=>n);o.useEffect(()=>{ze.current=!1,te(n)},[n]);const k=o.useMemo(()=>{const x=R.clean();let B=x.getStyle();C||(B=B.createTemporaryStyle({font:{size:c?.fontSize}}));const S=x.getFormula(),j=B.getAlignment(),se=S?d.ITextFrame.HorizontalAlignment.Left:j.getHorizontal(),ae=j.getVertical(),we=j.getOverflow()===d.ITextFrame.Overflow.Wrap||x.getType()===d.ScalarType.String&&(se===d.ITextFrame.HorizontalAlignment.Justify||se===d.ITextFrame.HorizontalAlignment.Distributed||ae===d.ITextFrame.VerticalAlignment.Justify||ae===d.ITextFrame.VerticalAlignment.Distributed),Y=(X=>{if(!X)return Ao;const oe=X.clean();if(!oe)return Ao;let Fe=oe.getStyle()?.getQuotePrefix();if(X.dirty===void 0||X.dirty===null){let Ue="",Oe=oe.getFormulaText();Oe&&(Ue=Oe,Fe=!1),Ue||(Ue=oe.toTextUnformatted(!0)??"");let Se="";if(!X.editMode&&oe.isSpillOverflow()){const He=oe.getSpill();if(He){const ve=He.getCell(),De=ve.getFormulaText();ve.isEqual(oe)||(Se=De)}}return Fe&&(Ue="'"+Ue),{text:Ue,placeholder:Se}}return{text:X.dirty??"",placeholder:""}})(R),fe=Y.text,V=d.ITextFrame.toCSSHorizontalTextAlign(C&&!S?R.clean()?.getRenderHorizontalAlignment():d.ITextFrame.HorizontalAlignment.Left);return{style:B,isWrapped:we,textValue:fe,formula:S,frameVertAlign:ae,placeholder:Y.placeholder,insets:C?x.getInsets():ge.TypesUtils.EmptyRect,textAlign:V}},[R,c,F,w,C]),b=o.useRef(null),ee=r.useImperativeElement(t,()=>({startEdit:x=>{P.current=x?.initialSelection;const B={...n,editMode:x?.editMode??!1};x?.text!==void 0&&(B.dirty=x.text),B.editMode===n.editMode&&B.dirty===n.dirty||(te(B),Ce?.(B))},submitEdit:()=>Ae(),cancelEdit(){Ie()},autoFocus(){b.current.focus()},dispatchEvent:x=>b.current.dispatchEvent(x),focus(){b.current.focus()},getLineHeight:Re}),[i,n]);o.useLayoutEffect(()=>{if(!de||!W)return;const x=b.current;k.textValue,x&&x.setSelectionRange(de.start,de.end,de.direction)},[b.current,de,k.textValue]);const ne=o.useMemo(()=>{const x=R?.clean(),B=k.style.createTemporaryTextFrame(k.textValue,x?.getType()===d.ScalarType.String),S=C?x.getInsets().right+x.getInsets().left:0;let j=null;return k.isWrapped&&(j={width:Z-S}),B.layout(j)},[k,Z,R,C]),Re=r.useCallbackRef(()=>Math.ceil(ne?.lines[0]?.bounds.height),[ne]);o.useLayoutEffect(()=>{if(!ne)return;const x=k.style,B=x.getInsets()??ge.TypesUtils.EmptyRect,S=C?B.left+B.right:0,j=C?.04*x.getFont().getSize():1,se=Math.round(k.isWrapped?void 0:ne.bounds.width+S+j),ae=Math.round(ne.bounds.height);z?.({width:se,height:ae})},[ne,z,k,C,R]);const Ce=r.useCallbackRef(a,[a]),ye=r.useCallbackRef(x=>{if(R.dirty===x)return;const B={...R};B.dirty=x,b.current,te(B),Ce?.(B)},[R]),Pe=r.useCallbackRef(x=>{if(R.editMode===x)return;const B={...R};B.editMode=x,te(B),Ce?.(B)},[R]),ze=o.useRef(!1),Ae=r.useCallbackRef(()=>{if(ze.current)return!1;try{l?.(R),h?.(),ze.current=!0}catch{return!1}return!0},[l,R]),Ie=r.useCallbackRef(()=>{ze.current=!0,te(n),f?.(),h?.()},[f,n]),ue=r.useCallbackRef(x=>{if(!b.current)return;if(x.key,x.isDefaultPrevented(),!(x.isTrusted||x.nativeEvent.ctrlKey||x.nativeEvent.metaKey||x.nativeEvent.altKey||x.nativeEvent.isComposing||gt.STANDARD_KEY_CHARS.indexOf(x.nativeEvent.key)===-1&&x.nativeEvent.key!=="Backspace")){const Y={...R};let fe=0;return Do(Y,Y.dirty)&&!isNaN(parseFloat(x.key))?(Y.dirty?.endsWith("%")?Y.dirty=(Y.dirty.substring(0,Y.dirty.length-1)??"")+x.key+"%":Y.dirty=(Y.dirty??"")+x.key+"%",fe=Y.dirty.length-1):x.nativeEvent.key==="Backspace"?(Y.dirty="",fe=Y.dirty.length):(Y.dirty=(Y.dirty??"")+x.key,fe=Y.dirty.length),b.current.value=Y?.dirty,P.current={start:fe,end:fe,direction:"forward"},b.current?.setSelectionRange(fe,fe,"forward"),te(Y),Ce?.(Y),void x.preventDefault()}const B=x.nativeEvent.ctrlKey,S=x.nativeEvent.shiftKey,j=x.nativeEvent.altKey,se=x.nativeEvent.metaKey;if(B&&x.key==="z"&&x.stopPropagation(),x.which===r.KeyCodes.Escape)return x.preventDefault(),void Ie();if(x.which===r.KeyCodes.F2)return Pe(!0),void x.preventDefault();const ae=x.target;if(x.key==="%"&&ae.selectionStart===ae.selectionEnd&&ae.value[ae.selectionStart]==="%"&&R?.clean().getStyle().numberFormat.includes("%"))return le({start:ae.selectionStart+1,end:ae.selectionEnd+1,direction:ae.selectionDirection}),void x.preventDefault();if(x.which===r.KeyCodes.Enter){if(x.preventDefault(),se||j){const Y=k.textValue.substring(0,ae.selectionStart)+`
9
- `+k.textValue.substring(ae.selectionEnd);return ye(Y),void le({start:ae.selectionStart+1,end:ae.selectionStart+1,direction:ae.selectionDirection})}return void(Ae()&&p.getSelection().traverse(d.IRange.Orientation.Column,S))}if(x.which===r.KeyCodes.Tab)return x.preventDefault(),void(Ae()&&p.getSelection().traverse(d.IRange.Orientation.Row,S));let we=null;switch(x.which){case r.KeyCodes.Left:we=d.IRange.Direction.Left;break;case r.KeyCodes.Right:we=d.IRange.Direction.Right;break;case r.KeyCodes.Up:we=d.IRange.Direction.Up;break;case r.KeyCodes.Down:we=d.IRange.Direction.Down}if(we&&!(B||S||j||se)&&!R.editMode)return void Ae();R.editMode&&(we||hl.includes(x.which))&&x.stopPropagation()},[R,p,k]),O=o.useCallback(()=>{b.current?.focus(),setTimeout(()=>{b.current?.select()},0)},[]),xe=o.useCallback(()=>{b.current?.focus(),console.log("implement toggleRelativeReferences")},[]),Le=r.useCallbackRef(()=>{const x=b.current?.value;let B="";if(y.rowIndex>0){const S=p.getRange({rowIndex:y.rowIndex-1,colIndex:y.colIndex}).getCell();S&&(B=S.toTextUnformatted(!0))}ye(x+B)},[y,p]);o.useEffect(()=>p.getRange(y).addListener(()=>{const x={...R,clean:()=>p.getRange(y).getCell()};te(x),Ce?.(x)}),[y,p,R]);const H=o.useCallback(()=>{const x=R.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText();ye((b.current?.value??"")+x)},[p]),U=o.useCallback(()=>{const x=R.clean().createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText();ye((b.current?.value??"")+x)},[p]),he=o.useMemo(()=>({element:()=>b.current,doCopy:x=>{const B=b.current.value.substring(b.current.selectionStart,b.current.selectionEnd);if(x?.isCut){const S=b.current.value.substring(0,b.current.selectionStart)+b.current.value.substring(b.current.selectionEnd,b.current.value.length);ye(S)}return B}}),[b.current]),ce=o.useMemo(()=>({element:()=>b.current,doPaste:async(x,B)=>{const S=await x.toText?.();if(!S)return!0;const j=b.current.value.substring(0,b.current.selectionStart)+S+b.current.value.substring(b.current.selectionEnd,b.current.value.length);return ye(j),le({start:b.current.selectionStart+S.length,end:b.current.selectionStart+S.length,direction:"forward"}),!0}}),[b.current]),me=o.useMemo(()=>({contains:x=>b.current?.contains(x)||!1,focus(){b.current.focus()}}),[]),Te=o.useMemo(()=>[new r.SimpleCommand("selectAll",me,{label:"Select All",description:"Select all of the text in cell.",shortcut:{key:"a",modifiers:[r.KeyModifiers.Ctrl]}},O),new r.SimpleCommand("startEditValueAbove",me,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:'"',modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},Le),new r.SimpleCommand("startEditCurrentTime",me,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},H),new r.SimpleCommand("startEditCurrentDate",me,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},U),new r.Command("relativeReferencesToggle",me,{label:"Toggle References",description:"Toggles cell references from relative to absolute, to partially absolute, back to relative again.",shortcut:{key:"F4"}},xe),new r.Command("toggleEditorFocus",me,{label:"Toggle Editor Focus",description:"Moves focus between editors such as formula editor and inline editor.",shortcut:{key:"F2",modifiers:[r.KeyModifiers.Ctrl]}})],[]),ie=o.useMemo(()=>{let x=null;const B=()=>({contains:S=>b.current?.contains(S)||!1,focus(){b.current.focus()}});return x=T?T.createChildGroup(B,"editor",!1):new r.CommandGroup(B,"editor"),x.addCommands(Te,!0),x},[T,Te]),qe=o.useMemo(()=>({notifier:null,source:he,target:ce,commands:ie}),[he,ce,ie]);r.useCopyPaste(qe);const[g,je]=o.useState(!v);o.useEffect(()=>{je(!1)},[]);const Be=r.useCallbackRef(x=>{pe(!0),ie?.activate();const B=P.current;if(B!==!1){let S,j;const se=b.current.value;Do(R,se)&&(S=se.length-1,j=se.length-1),S=B?.start??S??se.length,j=B?.end??j??se.length,P.current=!1,le({start:S,end:j,direction:"forward"})}D?.(x)},[D,R]),Ee=k.insets;let u=Ee.left+1;const L=Ee.left+Ee.right+2-1,K=ne?.bounds.height??0;let m,A=Ee.top;k.frameVertAlign===d.ITextFrame.VerticalAlignment.Center?A=Math.max(0,(q-(Ee.top+Ee.bottom)-K)/2):k.frameVertAlign===d.ITextFrame.VerticalAlignment.Bottom&&(A=Math.max(0,q-(Ee.top+Ee.bottom)-K)),N!==void 0&&ne?.lines[0]?.bounds&&(m=ne?.lines[0]?.bounds.height*N);const G=k.style.getFont();let J=G.getSize();G.isSuperSub()&&(J*=G.getSuperSubScale()),J*=d.IFont.getDeviceScale()*w;const re=C?G.toCSS(F,w):null;return s.jsx("div",{className:"sheet-cell-editor",onMouseDown:x=>{b.current&&document.activeElement!==b.current&&requestAnimationFrame(()=>{b.current.focus()})},ref:ee,...E,style:{display:"flex",flexGrow:1,alignSelf:"stretch",height:"100%",width:"100%",maxWidth:"100%",maxHeight:"100%",cursor:"initial",...$},children:s.jsx("div",{className:"editor-placement",style:{display:"flex",flexGrow:1,position:"relative",top:A*w,left:u*w,width:`calc(100% - ${L*w}px)`,maxWidth:`calc(100% - ${L*w}px)`,height:(m??K)*w,maxHeight:(m??K)*w},children:s.jsx("textarea",{spellCheck:"false",placeholder:k.placeholder,ref:b,value:k.textValue,disabled:g,readOnly:_||p.getProtection().isReadOnly(),name:"sheet-cell-editor",autoComplete:"off",autoCapitalize:"off",style:{flex:"1 1 100%",font:"inherit",...re,fontSize:J?`${J}px`:"inherit",textAlign:k.textAlign,lineHeight:(ne?.lines[0]?.bounds.height??0)*w+"px",height:(ne?.bounds.height??0)*w,boxSizing:"border-box",padding:"0px",margin:"0px",borderWidth:0,outline:"none",resize:"none",overflow:"hidden",background:"transparent",maxHeight:"100%",maxWidth:"100%",width:"100%",userSelect:"text",position:"absolute",whiteSpace:k.isWrapped?"normal":"pre",wordWrap:"break-word"},onFocus:Be,onBlur:()=>{pe(!1)},onSelect:x=>{},onChange:x=>{b.current&&!ze.current&&(P.current=!1,ye(x.target.value),k.textValue,x.target.value,x.target.selectionStart,x.target.selectionEnd,x.target.selectionDirection,le({start:x.target.selectionStart,end:x.target.selectionEnd,direction:x.target.selectionDirection}))},onMouseDown:x=>{W&&Pe(!0)},onKeyDown:ue})})})})),hr=(e,t)=>({clean:e,dirty:t,editMode:!1}),mr=e=>{const{length:t=0,width:n=1,dashArray:i=null,dashArrayAdditional:a=null,isDouble:l=!1,isAngled:f=!1,offsetX:h=0,offsetY:c=0,isVertical:C=!1,...M}=e,y=$=>{let w=null;if($&&n>0){w="";for(let N=0;N<$.length;N++)w+=$[N],N<$.length-1&&(w+=",")}return w},p=y(i);let T=p;a&&(T=y(a));let I=n,z=t,D=null;if(l){I=Math.floor(n/2);const $=I+I/2+1;let w=null;w=C?`M ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+$)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+$)}`,D=s.jsx("path",{strokeWidth:I,strokeDasharray:T,d:w,...M})}if(f){I=n/2;const $=I+I/2;let w=T,N=null;N=C?`M ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+$)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+$)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+$)}`,D=s.jsx("path",{strokeWidth:I,strokeDasharray:w,strokeDashoffset:"1",shapeRendering:"crispEdges",d:N,...M})}let _=null;return _=C?`M ${r.ReactUtils.boundPixel(h+I/2)} ${r.ReactUtils.boundPixel(c)} L ${r.ReactUtils.boundPixel(h+I/2)} ${r.ReactUtils.boundPixel(c+z)}`:`M ${r.ReactUtils.boundPixel(h)} ${r.ReactUtils.boundPixel(c+I/2)} L ${r.ReactUtils.boundPixel(h+z)} ${r.ReactUtils.boundPixel(c+I/2)}`,s.jsxs(s.Fragment,{children:[s.jsx("path",{strokeWidth:I,strokeDasharray:p,d:_,...M}),D]})};function ro(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var Nt=parseInt(o.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const i of e){const a=ro(i,t),l=typeof a=="function";n.push(l?a:()=>ro(i,null))}return()=>{for(const i of n)i()}}}:function(e){return t=>{for(const n of e)ro(n,t)}},ml=function(){},fr=typeof window<"u",fl=fr?o.useLayoutEffect:o.useEffect,zo={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Wt=fr&&window.ResizeObserver!==void 0?function(){var e=o.useState(null),t=e[0],n=e[1],i=o.useState(zo),a=i[0],l=i[1],f=o.useMemo(function(){return new window.ResizeObserver(function(h){if(h[0]){var c=h[0].contentRect,C=c.x,M=c.y,y=c.width,p=c.height,T=c.top,I=c.left,z=c.bottom,D=c.right;l({x:C,y:M,width:y,height:p,top:T,left:I,bottom:z,right:D})}})},[]);return fl(function(){if(t)return f.observe(t),function(){f.disconnect()}},[t]),[n,a]}:function(){return[ml,zo]},pl=(e,t)=>e.colStart===t.colStart?e.rowStart-t.rowStart:e.colStart-t.colStart,vl=(e,t)=>e.rowStart===t.rowStart?e.colStart-t.colStart:e.rowStart-t.rowStart,Cl=e=>{const{key:t,points:n,range:i,stroke:a,darkMode:l,forceThinBorder:f=!1,shiftIfWide:h=!1,isVertical:c=!1,intersections:C,layout:M}=e,y=d.IBorder.BuiltInDefinitions.get(f?d.IBorder.StrokeStyle.Thin:a.getStyle());if(!y)return null;const p=n[0],T=n[1],I=n[2],z=n[3];let D=1+(c?z-T:I-p),_=0;const $=a.getColor().toRGBA(l).toString(),w=y.description.toLowerCase().includes("double");let N,v;const E=c?"rowStart":"colStart",q=c?"rowEnd":"colEnd",Z=c?T:p;if(C?.length>0){const pe=C[0];if(pe?.range[E]===i[E]){const le=d.IBorder.BuiltInDefinitions.get(pe.stroke.getStyle());_=Math.floor(le.width/2)}if(C[C.length-1]?.range[q]===i[q]){const le=d.IBorder.BuiltInDefinitions.get(C[C.length-1].stroke.getStyle());D=Math.floor(D+(le.width===2?0:le.width/2))}if(w){const le=c?"colStart":"rowStart",R=c?"colEnd":"rowEnd",te=c?M?.getRowOffset:M?.getColOffset;let k=0,b=0;N=[],v=[];const ee=C.length;for(let ne=0;ne<ee;ne++){const Re=C[ne];if(Re.stroke.getStyle()===d.IBorder.StrokeStyle.Double&&te){const Ce=te(Re.range[E])-(Z-_);Re.range[le]<i[le]&&(N.push(Ce-k),k=Ce,N.push(1),k++),Re.range[R]>i[R]&&(v.push(Ce-b),b=Ce,v.push(1),b++)}}N.length>0&&k<D&&N.push(D-k),v.length>0&&b<D&&v.push(D-b)}}let F=c?-Math.floor(y.width/2):-_,P=c?-_:-Math.floor(y.width/2);const W=h&&y.width>2?-1:0;return s.jsx(mr,{offsetX:p+F+W,offsetY:T+P+W,length:D+_,isVertical:c,stroke:$,width:y.width,dashArray:N??y.pattern,dashArrayAdditional:v,isDouble:w,isAngled:y.description.toLowerCase().includes("slant")},t)},Co=({getBorderAt:e,rendererBorder:t=Cl,getVisibleCells:n,darkMode:i,forceThinBorder:a=!1,defaultColor:l="black",shiftIfWide:f=!1})=>{const h=r.useCallbackRef(n,[n]);return{renderOverlay:o.useMemo(()=>C=>{const M=C.toClipBounds(C.getRangeCoordsBounds(),-3);if(!M)return;const y=h(C);if(y.length===0)return;const p=C.getVisibleColumnOffsets(),T=C.getVisibleRowOffsets();let I=[],z=[];const D=C.getVisibleColumns(),_=C.getVisibleRows(),$=[],w=[],N=[],v=[],E=(le,R,te,k,b,ee,ne)=>{const Re={index:k,stroke:b,visibleIndex:te,edge:ee,length:ne};le[R]||(le[R]=[]),le[R].length>0&&le[R][le[R].length-1]?.index===k?le[R][le[R].length-1]=Re:le[R].push(Re)},q=C.getVisibleRangeCoords(),Z=y.length;for(let le=0;le<Z;le++){const R=y[le],te=R.coords;if(!te)continue;const k=R?.range??{rowStart:te.rowIndex,colStart:te.colIndex,rowEnd:te.rowIndex,colEnd:te.colIndex};if(!ge.CoordUtils.isRangesIntersect(k,q)&&!ge.CoordUtils.isRangeWithinRange(k,q))continue;const b=te.colIndex,ee=te.rowIndex,ne=p[b],Re=T[ee];if(k.rowEnd!==k.rowStart){const H=T[k.rowStart]?.spanIndex??-1,U=T[k.rowEnd]?.spanIndex??T[_[_.length-1]].spanIndex+1;I.push({...k,rowStart:H,rowEnd:U})}if(k.colEnd!==k.colStart){const H=p[k.colStart]?.spanIndex??-1,U=p[k.colEnd]?.spanIndex??p[D[D.length-1]].spanIndex+1;z.push({...k,colStart:H,colEnd:U})}const Ce=R.value,ye=e(Ce,le);if(!ye||ye.isEmpty())continue;const Pe=ye.getLeft(),ze=ye.getTop(),Ae=ye.getRight(),Ie=ye.getBottom();let ue=1,O=1;if(!ne||!Re)continue;const xe=ne.spanIndex,Le=Re.spanIndex;Pe.isNone()||E($,xe,Le,ee,Pe,d.IBorder.Edge.Left,ue),ze.isNone()||E(w,Le,xe,b,ze,d.IBorder.Edge.Top,O),Ae.isNone()||E($,xe+O,Le,ee,Ae,d.IBorder.Edge.Right,ue),Ie.isNone()||E(w,Le+ue,xe,b,Ie,d.IBorder.Edge.Bottom,O)}const F=(le,R,te)=>{const k=[];return le.forEach((b,ee)=>{let ne=null;b.sort((Ce,ye)=>Ce.visibleIndex-ye.visibleIndex);const Re=b.length;for(let Ce=0;Ce<Re;Ce++){const ye=b[Ce];if(!ye?.stroke||R[ee]===void 0&&R[ee-1]===void 0)continue;let Pe=!1;if(te){const ue=I.length;for(let O=0;!Pe&&O<ue;O++){let xe=I[O];xe.colStart<=ye.index&&xe.colEnd>=ye.index&&xe.rowStart<ee&&xe.rowEnd>=ee&&(Pe=!0)}}else{const ue=z.length;for(let O=0;!Pe&&O<ue;O++){let xe=z[O];xe.rowStart<=ye.index&&xe.rowEnd>=ye.index&&xe.colStart<ee&&xe.colEnd>=ee&&(Pe=!0)}}if(Pe)continue;const ze=ye.stroke?.getColor(),Ae=ze?ze.toRGBA().toString():l,Ie=ye.stroke.getStyle()+":"+Ae;(Ie!==ne?.key||ne&&ne.visibleIndex+1<ye.visibleIndex)&&(ne&&k.push(ne),ne={key:Ie,index:R[ee]??R[ee-1]+1,visibleIndex:ye.visibleIndex,edge:ye.edge,stroke:ye.stroke,from:ye.index,to:ye.index+ye.length-1,intersections:[],length:1}),ne.to=ye.index+ye.length-1,ne.visibleIndex=ye.visibleIndex}ne&&k.push(ne)}),k};I=I.sort(vl),z=z.sort(pl);const P=F($,D,!1),W=F(w,_,!0);if(P.length===0&&W.length===0)return null;const pe=W.length;for(let le=0;le<pe;le++){const R=W[le];let te=ge.CommonUtils.findEqualOrGreater(P,R.from,b=>b.index),k=!1;for(;!k;){const b=P[te++];b&&b.index>=R.from&&b.index<=R.to+1&&b.from<=R.index&&b.to+1>=R.index&&(R.intersections.push({stroke:b.stroke,range:{rowStart:b.from,rowEnd:b.to+1,colStart:b.index,colEnd:b.index}}),b.intersections.push({stroke:R.stroke,range:{rowStart:R.index,rowEnd:R.index,colStart:R.from,colEnd:R.to+1}})),k=!b||b.index>R.to+1}}for(let le=0;le<pe;le++){const R=W[le];let te=R.stroke;const k=`rBorder:${R.index}:${R.from}:${R.to}:${R.edge}`,b={rowStart:R.index,rowEnd:R.index,colStart:R.from,colEnd:R.to+1},ee=C.getLayout(),ne=!1,Re=ee.getColOffset(b.colStart),Ce=ee.getRowOffset(b.rowStart),ye=[Re,Ce,ee.getColOffset(b.colEnd),Ce];N.push(t({key:k,points:ye,stroke:te,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:b,intersections:R.intersections,layout:ee,isVertical:ne}))}const de=P.length;for(let le=0;le<de;le++){const R=P[le];let te=R.stroke;const k=`cBorder:${R.index}:${R.from}:${R.to}:${R.edge}`,b={rowStart:R.from,rowEnd:R.to+1,colStart:R.index,colEnd:R.index},ee=C.getLayout(),ne=!0,Re=ee.getColOffset(b.colStart),Ce=[Re,ee.getRowOffset(b.rowStart),Re,ee.getRowOffset(b.rowEnd)];v.push(t({key:k,stroke:te,points:Ce,darkMode:i,forceThinBorder:a,shiftIfWide:f,range:b,intersections:R.intersections,layout:ee,isVertical:ne}))}return s.jsxs("svg",{width:`${M.width}`,height:`${M.height}`,viewBox:`0 0 ${M.width} ${M.height}`,preserveAspectRatio:"none",shapeRendering:"crispEdges",style:{position:"absolute",left:"0px",top:"0px",width:`${M.width}px`,height:`${M.height}px`,pointerEvents:"none",transitionTimingFunction:"linear",transitionDelay:"0",transitionProperty:"left, top, width, height",willChange:"left, top, width, height, stroke-dashoffset",overflow:"visible"},children:[v,N]},"borders")},[e,i])}},Lo=ge.AnchorLocation.Center,yl=Object.freeze({horizontal:!1,vertical:!1}),No=ge.TypesUtils.EmptyTopLeft,wl=(e,t)=>ge.CoordUtils.EmptyCell,bl=(e,t)=>new Promise((n,i)=>{i("StaticBorderRenderer does not support scrolling")}),xl=o.memo(e=>{const{getBorderAt:t,width:n,height:i,style:a,rowCount:l=2,columnCount:f=2,darkMode:h,forceThinBorder:c,children:C,...M}=e,y=o.useRef(null),[p,{width:T,height:I}]=Wt(),z=n??T,D=i??I,_=o.useMemo(()=>{const R=[];for(let te=0;te<l;te++)for(let k=0;k<f;k++){const b={colIndex:k,rowIndex:te};R.push({coords:b,value:b})}return R},[]),$=o.useCallback(R=>_,[_]),{renderOverlay:w}=Co({getVisibleCells:$,getBorderAt:t,darkMode:h,forceThinBorder:c}),N=Math.floor(z/f),v=Math.floor(D/l),E={getColOffset:R=>Math.ceil(R*N)+0,getRowOffset:R=>Math.ceil(R*v)+0,getColIndex:R=>Math.floor((R-0)/N)-1,getRowIndex:R=>Math.floor((R-0)/v)-1},q={rowStart:0,colStart:0,rowEnd:l,colEnd:f},Z={x:0,y:0,width:Math.max(0,z)+0,height:Math.max(0,D)+0},F=o.useMemo(()=>{const R={},te=Math.floor(z/f);for(let k=0;k<f;k++)R[k]={offset:k*te,size:te,spanIndex:k};return R},[z,D]),P=o.useMemo(()=>{const R={},te=Math.floor(D/l);for(let k=0;k<l;k++)R[k]={offset:k*te,size:te,spanIndex:k};return R},[z,D]);if(!w)return null;const W={width:z,height:D},pe={width:z,height:D},de={getStage:()=>y.current,getTotalSize:()=>W,getViewportSize:()=>pe,getLayout:()=>E,getCellCoordsAsRangeCoords:ge.CoordUtils.cellToRange,getVisibleRangeCoords:()=>q,getVisibleRows:()=>{const R=[];for(let te=0;te<l;te++)R.push(te);return R},getTotalRangeCoords:()=>q,getRelativePointFromClient:(R,te)=>({x:R,y:te}),getVisibleColumns:()=>{const R=[];for(let te=0;te<f;te++)R.push(te);return R},toClipBounds:(R,te)=>Z,toViewBounds:R=>R,toAbsoluteBounds:R=>R,getBounds:()=>Z,getInsets:()=>null,getRangeCoordsBounds:(R,te)=>null,getVisibleColumnOffsets:()=>F,getVisibleRowOffsets:()=>P,allViews:()=>({[Lo]:de}),getAnchor:()=>Lo,getZoom:()=>1,scrollCellCoordsIntoView:bl,getCellCoordsFromClient:wl,getScrollOrientation:()=>yl,getScrollTopLeft:()=>No,getFreezeTopLeft:()=>No},le=w(de);return s.jsxs("div",{style:{...a,position:"relative",display:"flex"},...M,children:[s.jsx("div",{ref:Nt([y,p]),style:{flex:"1 1 100%",display:"flex",maxWidth:"100%",maxHeight:"100%"},children:C}),le]})});function pr(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=pr(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function ct(){for(var e,t,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=pr(e))&&(i&&(i+=" "),i+=t);return i}const ql="_sheetxl-sheet_1qeq6_5",Sl="_viewport-overlay_1qeq6_6",vr=e=>{const{style:t,...n}=e??{};return s.jsxs("svg",{style:{width:"135px",height:"37px",...t},viewBox:"0 0 135 37",...n,children:[s.jsx("path",{d:"M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z",fill:"#547dbe",fillRule:"evenodd"}),s.jsx("path",{d:"M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z",fill:"#ffffff",fillRule:"evenodd"}),s.jsx("path",{d:"m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z",fill:"#547dbe",fillRule:"evenodd",strokeWidth:"0.4"}),s.jsx("path",{d:"M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z",fill:"#eb594d"}),s.jsx("path",{d:"m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z",stroke:"#eb594d",strokeWidth:"2",fill:"#f9cecb"})]})},Rl=o.memo(e=>{const{colorLicensee:t="blue",colorError:n="red",colorCredits:i="grey",credits:a="All rights reserved - Michael Ford",feature:l,style:f,...h}=e??{},[c,C]=o.useState(null);o.useEffect(()=>{(async()=>{const v=await d.LicenseManager.getDetails();C(v)})()},[]);const[M,y]=o.useState(!1),p={opacity:.65},T=o.useMemo(()=>{const v=c?.getExceptions(),E=v?.length??0;if(E===0)return null;const q=[];for(let Z=0;Z<E;Z++){const F=v[Z];q.push(s.jsx("div",{style:{opacity:.8,fontSize:"16px",textAlign:"left",color:n},children:F},Z))}return q},[c,n]);if(c===null||c.isValidFor(l))return null;const I=c.getType(),z=!T&&I.endsWith("ity"),D=c.getLicensee(),_=z?1.6:1,$=135/_,w=37/_;let N=null;return!I&&D?.length>0&&(N=s.jsx("div",{style:{opacity:.7,fontWeight:"500",fontSize:"16px",textAlign:"left",color:t},children:D})),s.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",overflow:"hidden",...f},...h,children:s.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column"},children:[M?s.jsx(vr,{style:p}):s.jsx("svg",{width:$,height:w,style:p,children:s.jsx("image",{style:{width:$,height:w},href:"https://www.sheetxl.com/watermark.svg",onError:()=>y(!0)})}),s.jsxs("div",{children:[N,T,s.jsx("div",{style:{height:"0px",fontSize:"16px",textAlign:"left",width:"0px",opacity:.8,color:i},children:a})]})]})})}),Qe=(e,t,n)=>{const i=o.useRef(t);i.current=t;const a=n?.fireOnModelChange??!0;o.useEffect(()=>{if(!e||!i.current)return;const l=Object.keys(i.current),f={},h=l.length;for(let C=0;C<h;C++){const M=l[C];f[M]=(y,p)=>{i.current[M]?.(y,p)}}const c=e.addListeners(f,n);if(a)for(let C=0;C<h;C++)f[l[C]](e);return()=>{c?.()}},[e])},En=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){const n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw new Error(`Task pane with key '${n}' is already registered.`);this._taskPanes.set(n,e)}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw new Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return ge.CommonUtils.EmptyArray;const t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,"");for(const n of this._taskPanes.values()){const i=n.contributionPoints;if(i&&i.length!==0)for(let a of i)a.startsWith(e)&&t.push(n)}return t}},Cr=o.createContext(void 0),kl={activateTaskPane(e,t){console.warn("No TaskPaneArea available to activate task pane",e,t)}},yr=()=>o.useContext(Cr)||kl,Gt={TaskPaneArea:"_TaskPaneArea_6dmgk_5",TaskPaneTitle:"_TaskPaneTitle_6dmgk_13",TaskPaneFrame:"_TaskPaneFrame_6dmgk_36",TaskPaneStrip:"_TaskPaneStrip_6dmgk_52",TaskPaneStripItem:"_TaskPaneStripItem_6dmgk_60"},yo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,icon:a,onClose:l,readOnly:f,focused:h,style:c,className:C,...M}=e,y=o.useMemo(()=>ct("taskpane-title",C,Gt.TaskPaneTitle,{focused:h}),[C,h]);return s.jsxs("div",{ref:t,className:y,style:c,...M,children:[s.jsx("div",{className:"title",style:{flex:"1 1 100%"},children:i}),s.jsx("div",{"aria-label":"close",role:"button",style:{width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onPointerDown:p=>{p.stopPropagation()},onPointerUp:()=>{l()},children:s.jsx("div",{style:{fontSize:"0.7em"},children:"✕"})})]})}));yo.displayName="TaskPaneTitle";const Ml=e=>s.jsx(yo,{...e}),Tl=o.memo(o.forwardRef((e,t)=>{const{children:n,entry:i,close:a,listenerContainer:l,model:f,commands:h,onMounted:c,onUnmounted:C,wrapperPane:M,propsPane:y,renderTaskPanelTitle:p=Ml,style:T,className:I,...z}=e,[D,_]=o.useState(null),[$,w]=o.useState(!1),N=r.useCallbackRef(a,[a]),v=o.useRef(null),E=o.useRef(null);o.useEffect(()=>(c?.(i),()=>{C?.(i)}),[i]);const q=o.useRef([]),Z=o.useMemo(()=>({addListener:W=>{const pe=l(W);return q.current.push(pe),pe},close:()=>{N?.()},focus:W=>{v.current?.focus(W)}}),[l]);o.useEffect(()=>()=>{for(const W of q.current)W();q.current=[]},[]);const F=o.useMemo(()=>(i.renderTaskPanelTitle??p)({ref:E,title:i.getTitle(),icon:null,readOnly:!1,focused:$,onClose:N,onPointerDown:W=>{}}),[i,$]),P=o.useMemo(()=>{let W=i.renderTaskPane({entryKey:i.key,model:f,commands:h,frame:Z,...y},t);return M&&(W=M(W)),W},[i,f,h,t]);return s.jsxs("div",{className:ct("taskpane-frame",I,Gt.TaskPaneFrame),tabIndex:0,ref:v,style:T,onPointerDown:async W=>{W.currentTarget.focus()},onFocus:W=>{W.relatedTarget&&!D&&_(W.relatedTarget),w(!0)},onBlur:W=>{D&&!v?.current?.contains(W.relatedTarget)&&_(null),W.relatedTarget&&w(!1)},...z,children:[s.jsx("div",{style:{flex:"0 0 auto",display:"flex",flexDirection:"column",width:"100%",alignItems:"stretch",justifyContent:"stretch"},children:F}),s.jsx("div",{className:"taskpane-frame-content",style:{flex:"1 1 auto",minHeight:0,width:"100%",overflow:"auto",height:"100%",display:"flex"},children:P})]})})),wo=o.memo(o.forwardRef((e,t)=>{const{children:n,title:i,taskPanes:a,onSelect:l,selected:f,registry:h=En,style:c,className:C,...M}=e,y=o.useMemo(()=>a.map(I=>{const z=h.getRegisteredTaskPane(I);if(!z)return null;let D=z.getIcon?.();D&&(typeof D=="string"&&(D=s.jsx(r.DynamicIcon,{iconKey:D})),D=s.jsx("span",{style:{display:"inline-block",transform:"rotate(90deg)",transformOrigin:"center"},children:D}));const _=I===f;return s.jsxs("div",{style:{writingMode:"vertical-rl",textOrientation:"mixed",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",minWidth:"0px"},className:ct("taskpane-strip-item",Gt.TaskPaneStripItem,{selected:_}),onClick:()=>e.onSelect(I),children:[D,z.getTitle()]},I)}),[a,f,l,h]),p=r.useImperativeElement(t,()=>({isTaskPaneStrip:()=>!0}),[]),T=o.useMemo(()=>ct("taskpane-strip",C,Gt.TaskPaneStrip),[C]);return s.jsx("div",{ref:p,className:T,style:c,...M,children:y})}));wo.displayName="TaskPaneStrip";const Il=e=>s.jsx(wo,{...e}),El=o.memo(o.forwardRef((e,t)=>{const{className:n="",registry:i=En,model:a,commands:l,onOpen:f,onClose:h,wrapperPane:c,propsPane:C,wrapperFrame:M,propsFrame:y,renderTaskPanelTitle:p,renderTaskPaneStrip:T=Il,alwaysShowStrip:I,style:z}=e,D=r.useCallbackRef(f,[f]),_=r.useCallbackRef(h,[h]),[$,w]=o.useState(null),N=o.useRef(null),[v,E]=o.useState([]),q=o.useRef(new Set),Z=r.useCallbackRef(async(R,te=!1)=>{const k=Array.from(q.current),b=k.length;let ee=!0;for(let ne=0;ee&&ne<b;ne++){const Re=k[ne];if(Re.onBeforeHide)try{await Promise.resolve(Re.onBeforeHide())===!1&&(ee=!1)}catch{ee=!1}}return ee},[]),F=r.useCallbackRef(R=>{const te=Array.from(q.current),k=te.length;E(b=>{const ee=b.findIndex(Re=>Re.key===R);if(ee===-1)return b;const ne=[...b];return ne.splice(ee,1),ne.length===0?(w(null),_?.(),ne):(P(ne[Math.max(ne.length-1,ee-1)].key),ne)});for(let b=0;b<k;b++){const ee=te[b];try{ee.onHide?.()}catch{}}},[_]),P=r.useCallbackRef(async R=>{const te=i.getRegisteredTaskPane(R);if(!te)return void console.warn(`Invalid taskpane '${R}'`);if(N.current===R||$&&!await Z($.key))return;const k=o.createRef();let b=s.jsx(Tl,{ref:()=>{N.current=null},entry:te,model:a,commands:l,close:async()=>{await Z(R)&&F(R)},wrapperPane:c,propsPane:C,renderTaskPanelTitle:p,listenerContainer:ne=>(q.current.add(ne),()=>{q.current.delete(ne)}),onMounted:ne=>{ne.key===R&&(N.current=null),D?.()},onUnmounted:ne=>{},...y});M&&(b=M(b));const ee={key:R,elem:b,ref:k};E(ne=>{if(ne.findIndex(Ce=>Ce.key===R)!==-1)return ne;const Re=[...ne];return Re.push(ee),Re}),w(ee),N.current=R},[$,M,C,p]);o.useEffect(()=>{$&&!N.current&&P($.key)},[y,a]);const W=r.useImperativeElement(t,()=>({activateTaskPane:P}),[i,C,a,l]),pe=o.useMemo(()=>v.map(R=>R.key),[v]),de=o.useMemo(()=>{if(pe.length<=1&&!I)return null;const R={className:Gt.TaskPaneAreaStrip,taskPanes:pe,selected:$?.key,onSelect:te=>{P(te)},registry:i};return T(R)},[pe,$,i,I]),le=$?.elem;return s.jsxs("div",{ref:W,className:ct("taskpane-area",n,Gt.TaskPaneArea),style:z,children:[le,de]})})),qn=new d.Color("transparent");function wr(e){const{sheet:t,onRepeatCommandChange:n,bodyStyle:i,commands:a,target:l,onStartEdit:f,getViewport:h}=e,c=r.useNotifier(),C=yr(),M=r.useCallbackRef(f,[f]),y=r.useCallbackRef(h,[h]),p=o.useMemo(()=>({serializer:{parse:u=>u?t?.getStyles().parseColor(u):null,stringify:u=>u?u.toString():null}}),[t]),[T,I]=r.usePersistenceState("sheet.lastBorder",null),[z,D]=r.usePersistenceState("sheet.lastFillColor",t?.getStyles().parseColor(d.IColor.Scheme.Bg2),p),[_,$]=r.usePersistenceState("sheet.lastFontColor",t?.getStyles().parseColor(t?.getStyles().getNormal().getFont().getFill()),p),w=r.useEditMode();o.useRef(w.getMode()).current=w.getMode();const[N,v]=o.useReducer(u=>u+1,0),[E,q]=o.useReducer(u=>u+1,0),Z=r.useGlobalClipboard(),F=o.useRef(null),[P,W]=o.useReducer(u=>u+1,0),[pe,de]=o.useReducer(u=>u+1,0),le=o.useRef(null),R=r.useCallbackRef(()=>{if(!t)return null;const u=le.current;if(u)return u;const L=t.getSelectedCell(),K=L.getCoords(),m=t.getSelectedRanges(),A=t.getSelectedRange(),G=t.getTables(),J=G.getItems({address:A}),re=G.getItems({address:K});let x=null;re.length>0&&(x=re[0]);const B=m.getMerges().length>0,S=m.isOverlapping();let j=!0;const se=m.getCoords(),ae=se.length;for(let we=0;j&&we<ae;we++)j=ge.CoordUtils.isSingleCell(se[we]);return u&&x===u.table&&ge.CommonUtils.isEqualArrays(J,u.tables)||requestAnimationFrame(()=>{de()}),le.current={tables:J,table:x,ranges:m,rangesCoords:se,range:A,cell:L,containsMerge:B,isOverlapping:S,isSingleCell:j},le.current},[t]),te=o.useCallback(ge.CommonUtils.debounce(W,210),[]);o.useEffect(()=>{F.current=t,W()},[t]),Qe(t.getSelection(),{onChange:()=>{le.current=null,te()}});const k=r.useCallbackRef(async(u,L,K=null,m=!1,A=!0)=>{const G=u?.getLabel?.(),J=async()=>{const S=await Promise.resolve(A&&c.showBusy(G??"Busy..."));try{await t.doBatch(async()=>L(t),G),m&&w.setMode(null),S&&S()}catch(j){if(S&&S(),!j)return;c.showError(j)}},re=[];let x=!1;const B=async()=>(re.push(J),(async()=>{if(!x){for(x=!0;re.length>0;){const S=re.shift();S&&await S()}x=!1}})());if(n){let S=null;if(K!==!1&&u){const j=K??G;S=new r.SimpleCommand(u.getKey(),l,{label:j,description:j},B)}n(S)}return B()},[t,n,c]),b=r.useCallbackRef((u,L,K=!1,m)=>(m||(m={autoSelect:!0,autoFit:!0}),k(u,A=>{const G=A.getSelectedRanges();K&&G.getStyle().update(null,m),G.getStyle().update(L,m)})),[t]),ee=r.useCallbackRef((u,L)=>{k(u,K=>{K.getSelectedRange().setHyperlink(L)})},[t]),ne=r.useCallbackRef((u,L)=>{k(u,K=>{K.getSelectedRange().setComments(L)})},[t]),Re=r.useCallbackRef((u,L)=>{k(u,K=>{K.getSelectedRanges().clear(L)})},[t]),Ce=r.useCallbackRef(async(u,L,K=!1,m=!1)=>k(u,async A=>{let G=A.getSelectedRanges();K&&(L===d.IRange.Orientation.Row?G=G.getEntireRows(m):L===d.IRange.Orientation.Column&&(G=G.getEntireColumns(m)));let J=null;const re=w.getMode()?.key;if(re==="copy"||re==="cut"){const x=await Z.getClipboard().readReference();x&&x.getItemType()==="range"&&(J=x.getItem(),J.getCoords()||(J=null))}if(J){const x=await G.insertFrom(J,{...J.getMarkOptions(),orientation:L,autoSelect:!0});!x||x.isEntireRows()||x.isEntireColumns()||x.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0}),w.setMode(null)}else G.insert({orientation:L,autoSelect:!0})},"Insert Cells",!1),[w]),ye=r.useCallbackRef(u=>t.getStyles().setDefaultTableStyle(u),[t]),Pe=r.useCallbackRef(u=>{t.getStyles().getTableStyle(u)?.delete()},[t]),ze=r.useCallbackRef((u,L)=>{k(u,async K=>{const m=K.getSelectedRange(),A=K.getSelectedCell().getCoords();let G=null,J=0;const re=A.rowIndex>0?K.getRange({rowIndex:A.rowIndex,colIndex:A.colIndex}).getExtended(d.IRange.Direction.Up):null;re&&K.getRange({colStart:A.colIndex,rowStart:re.getCoords().rowStart,colEnd:A.colIndex,rowEnd:re.getCoords().rowStart}).isContentful()&&(G=d.IRange.Direction.Up,J=A.rowIndex-re.getCoords().rowEnd);const x=A.colIndex>0?K.getRange({rowIndex:A.rowIndex,colIndex:A.colIndex-1}).getExtended(d.IRange.Direction.Left):null;if(x&&K.getRange({colStart:x.getCoords().colStart,rowStart:A.rowIndex,colEnd:x.getCoords().colStart,rowEnd:A.rowIndex}).isContentful()){const S=A.colIndex-x.getCoords().colEnd;(S<J||!G)&&(G=d.IRange.Direction.Left,J=S)}let B=null;if(G===d.IRange.Direction.Up){if(B={...re.getCoords()},(B.rowEnd===A.rowIndex||!K.getRange({colIndex:A.colIndex,rowIndex:A.rowIndex-1}).isContentful())&&B.rowStart>0&&K.getRange({colIndex:A.colIndex,rowIndex:B.rowStart-1}).isContentful()){const S=re.getExtended(d.IRange.Direction.Up);B={colStart:A.colIndex,rowStart:S.getCoords().rowStart,colEnd:A.colIndex,rowEnd:re.getCoords().rowEnd}}B.rowEnd=A.rowIndex-1}else if(G===d.IRange.Direction.Left){if(B={...x.getCoords()},(B.colEnd===A.colIndex||!K.getRange({colIndex:A.colIndex-1,rowIndex:A.rowIndex}).isContentful())&&B.colStart>0&&K.getRange({colIndex:B.colStart-1,rowIndex:A.rowIndex}).isContentful()){const S=x.getExtended(d.IRange.Direction.Left);B={colStart:S.getCoords().colStart,rowStart:A.rowIndex,colEnd:S.getCoords().colEnd,rowEnd:A.rowIndex}}B.colEnd=A.colIndex-1}if(m.size!==1&&G){const S=m.getCoords(),j=m.startIncrementalUpdates({orientation:d.IRange.Orientation.Column}),se={...B},ae=S.rowStart,we=S.rowEnd,Y=S.colStart,fe=S.colEnd,V=G===d.IRange.Direction.Up;for(let X=Y;X<=fe;X++){se.colStart=V?X:B.colStart+(X-Y),se.colEnd=V?X:B.colEnd+(X-Y);for(let oe=ae;oe<=we;oe++){se.rowStart=V?B.rowStart+(oe-ae):oe,se.rowEnd=V?B.rowEnd+(oe-ae):oe;const Fe=K.getRange(se).toString();j.pushAt(oe,X,`=${L}(${Fe})`)}}j.apply()}else{const S=B?K.getRange(B).toString():"",j=`=${L}(`;M?.({text:`${j}${S})`,editMode:!0,initialSelection:{start:j.length,end:j.length+S.length}})}},!1)},[t]),Ae=r.useCallbackRef((u,L,K=!1,m=!0)=>{k(u,async A=>{const G=R()?.table;if(G)return void G.updateStyleOptions(L);const J=A.getSelectedRanges().getFixed(!0),re=A.getSelectedRange().getDefaultSortCriteria(),x={getNames:()=>A.getNames(),table:()=>null,styles:()=>null,bodyStyle:()=>null},B={ranges:J,hasHeader:re?.options?.hasHeader??!1},S=async se=>{if(!(se=await Promise.resolve(se)))return null;const ae=await Promise.resolve(c.showBusy(u.getLabel()));try{await A.getTables().add(se.ranges.at(0),{styleName:L?.name,clearFormatting:K,hasHeader:se.hasHeader}).getRange().select(),ae()}catch(we){ae(),c.showError(we)}};if(!m)return void await S(B);const j={initialValue:B,context:()=>x,onInput:se=>{S(se)}};c.showWindow("tableNew",j)},!1,!0,!1)},[]),Ie=r.useCallbackRef(()=>i,[i]),ue=r.useCallbackRef(u=>({styles:()=>t.getStyles(),table:()=>u,bodyStyle:Ie,getNames:()=>t.getNames()}),[t]),O=r.useCallbackRef(async(u,L,K,m=!0)=>{if(!L){const G=R();if(!G)return;let J=G.range;J.size===1&&(J=J.getSurrounding());const re=G.table;re&&(L=re),await J.select()}if(!L)return;try{K&&await L.select()}catch{}if(!m)return;const A=new Promise(async(G,J)=>{u.update({context:ue(L)}),C.activateTaskPane("tableDetails",{}),G(!0)});try{if(!await A)return}catch(G){c.showError(G)}},[c]),xe=r.useCallbackRef(async(u,L,K=!1)=>{let m=null;if(L?L.isITable?m=L:L.getValue()&&(m=L.getValue()):m=R()?.table,m){if(!K){const A=m.getRange().getCoords(),G=(A.colEnd-A.colStart+1)*(A.rowEnd-A.rowStart+1);if(G>1e4&&await c.showOptions({title:"Confirm",description:`Converting a table to range with '${G}' cells will set a large number of cell styles and may affect performance.
10
- Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}k(u,async()=>{K?m.delete():m.convertToRange()},!1,!0)}},[c]),Le=r.useCallbackRef((u,L,K)=>{k(u,async m=>{const A=R();if(!A)return;const G=A.ranges;if(G.getCount()>1)throw new ge.ExpectedError("Can not sort on multiple cell ranges. Please select a single range and try again.");let J=G.at(0);J.size===1&&(J=J.getSurrounding());const re=A.cell;let x=J.getDefaultSortCriteria(d.IRange.Orientation.Row,re);if(!x){if(K)throw new ge.ExpectedError("Invalid sort selection. Sort requires a single range with data.");return}const B=async we=>{if(!(we=await Promise.resolve(we)))return;const Y=await Promise.resolve(c.showBusy(u.getLabel()));try{J.doBatch(()=>{const fe={...we,...L};J.sort(fe),J.autoFit({orientations:fe?.orientation===d.IRange.Orientation.Column?d.IRange.Orientations.Column:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},u?.getLabel?.())}catch(fe){Y(),c.showError(fe)}Y()};let S=x.options;if(!K)return void await B(S);let j=J;S.hasHeader&&(j=J.getIntersect(x.sortCoords)),j.select();const se={range:J,cell:re},ae={initialValue:S,context:()=>se,onInput:we=>{B(we)}};c.showWindow("sort",ae)},!1,!1,!1)},[c]),H=r.useCallbackRef(()=>{console.log("compactedSelection");const u=t.getSelection().getCoords(),L=t.getSelectedRanges().getFlattened().getCoords(),K=(G=>{const J=new Blob([G],{type:"application/javascript"}),re=URL.createObjectURL(J),x=new Worker(re);return URL.revokeObjectURL(re),x})("console.log('hello from worker');");setTimeout(()=>{K.terminate(),console.log("Worker terminated")},5e3);let m=-1;for(let G=0;m===-1&&G<L.length;G++)ge.CoordUtils.isCellWithinRange(u.cell,L[G])&&(m=G);if(ge.CoordUtils.isEqualRangesArrays(u.ranges,L))return;const A={cell:u.cell,ranges:L,rangeIndex:m};t.getSelection().updateCoords(A)},[t]),U=r.useCallbackRef(()=>{console.log("selectComments")},[t]),he=r.useCallbackRef(async(u=!1,L=!1)=>{let K=null;if(L)K=t.getEntireRange();else{const m=t.getSelectedRange();if(m.isEntireRange()){const A=t.getSelection().getCoords().cell,G=t.getRange(A);K=G.getSurrounding(),K.isEntireRange()&&(K=G)}else K=m.getSurrounding({contentOnly:u})}K&&await K.select()},[t]),ce=r.useCallbackRef((u,L,K)=>{k(u,async m=>{let A=m.getSelectedRanges();K&&(L===d.IRange.Orientation.Row?A=A.getEntireRows():L===d.IRange.Orientation.Column&&(A=A.getEntireColumns())),A.delete(L)},"Delete Cells")},[t]);r.useCallbackRef(async u=>{let L=null;const K=y(),m=Math.min(K.width-8,480),A=Math.min(K.height-8,288);try{t.getSelectedRanges(),L=await t.getMovables().add({bounds:{x:K.left+(K.width-m)/2,y:K.top+(K.height-A)/2,width:m,height:A},type:"chart",json:u.template}),L.select(),w.setMode(null)}catch(G){c.showError(G)}return L},[t,c]);const me=r.useCallbackRef(async(u,L,K)=>{const m=await c.showBusy(u.getLabel());try{const A=await t.getMovables().addImage(L,{autoSelect:!0,...K});return m(),w.setMode(null),A}catch(A){m();let G=A;typeof G!="string"&&(console.warn(A),G="Unable to resolve image."),c.showMessage(G,{type:r.NotifierType.Error})}},[t,c]),Te=r.useCallbackRef((u,L)=>{k(u,async K=>{const m=K.getSelectedRanges();m.doBatch(()=>{const A=L===d.IRange.Direction.Up||L===d.IRange.Direction.Down,G=m.getCoords().slice().sort(ge.CoordUtils.createRangeComparator(A?d.IRange.Orientation.Row:d.IRange.Orientation.Column));for(let J=0;J<G.length;J++){const re=G[J];let x=re;const B=K.getRange(x).getMerges();let S=0,j=0;if(B.length>0){const se=B[0];S=se.rowEnd-se.rowStart,j=se.colEnd-se.colStart}L===d.IRange.Direction.Left?x={...re,colStart:re.colEnd+j}:L===d.IRange.Direction.Right?x={...re,colEnd:re.colStart+j}:L===d.IRange.Direction.Up?x={...re,rowStart:re.rowEnd+S}:L===d.IRange.Direction.Down&&(x={...re,rowEnd:re.rowStart+S}),K.getRange(x).autoFill(re,{filler:d.AutoFill.Types.Copy}),K.getRange(re).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:u.getLabel()})})},[c]),ie=r.useCallbackRef(()=>{let u=null;const L=t.getSelectedCell().getCoords();if(L?.rowIndex>0){const K=t.getRange({rowIndex:L.rowIndex-1,colIndex:L.colIndex}).getCell();K&&(u=K.toTextUnformatted(!0))}M?.({text:u})},[t]),qe=o.useMemo(()=>[new r.Command("gridlinesToggle",l,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesRows",l,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new r.Command("sheetViewToggleGridlinesColumns",l,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new r.Command("sheetViewFormatGridlinesColor",l,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new r.Command("sheetViewToggleShowHeadings",l,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingRows",l,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new r.Command("sheetViewToggleShowHeadingColumns",l,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new r.Command("sheetViewToggleShowHeadingsNumeric",l,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("sheetViewToggleFormulaView",l,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",icon:"FormulaView",shortcut:[{key:"`",modifiers:[r.KeyModifiers.Ctrl]},{key:"`",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]}),new r.Command("sheetViewToggleShowZeros",l,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank.",icon:"ViewZero"}),new r.SimpleCommand("selectComments",l,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>U()),new r.Command("selectAll",l,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[r.KeyModifiers.Ctrl]},{key:"Space",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},(u=!1)=>he(!1,u)),new r.SimpleCommand("selectRegion",l,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},()=>he(!0,!1)),new r.SimpleCommand("breakSelection",l,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},()=>H()),new r.SimpleCommand("formatTextRotate0",l,{label:"No Text Rotation",description:"Remove all text rotation.",icon:"TextRotation315"}),new r.SimpleCommand("formatTextRotate45",l,{label:"Angle Clockwise",description:"Angle text 45 degrees downward.",icon:"TextRotation45"}),new r.SimpleCommand("formatTextRotate90",l,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left.",icon:"TextRotation90"}),new r.SimpleCommand("formatTextRotate270",l,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right.",icon:"TextRotation2702"}),new r.SimpleCommand("formatTextRotate315",l,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward.",icon:"TextRotation315"}),new r.Command("formatTextRotateCustom",l,{label:"Custom Text Rotation",description:"Angle your text using a custom angle.",icon:"TextRotationCustom"}),new r.SimpleCommand("formatTextRotateVertical",l,{label:"Vertical Text",description:"Stack text vertically.",icon:"TextRotationVertical"}),new r.SimpleCommand("sortAscending",l,{label:"Sort Ascending",scopedLabels:{sort:"Ascending",sortFilter:"Ascending"},description:"Lowest to Highest.",icon:"SortIncrease"},function(){Le(this,{reverse:!1},!1)}),new r.SimpleCommand("sortDescending",l,{label:"Sort Descending",scopedLabels:{sort:"Descending",sortFilter:"Descending"},description:"Highest to Lowest.",icon:"SortDecrease"},function(){Le(this,{reverse:!0},!1)}),new r.SimpleCommand("sortCustom",l,{label:"Custom Sort…",scopedLabels:{sort:"Custom…",sortFilter:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.",icon:"SortCustom"},function(){Le(this,{},!0)}),new r.Command("protectionSheetToggle",l,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
11
- For example, you can prevent people from editing locked cells or making formatting changes.`,icon:"Lock"}),new r.Command("formatSheetTabColor",l,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets.",icon:"stroke.colored"}),new r.Command("formatCellStyle",l,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet.",icon:"PresetStyles"},function(u){b(this,{named:u.getName()},!0)}),new r.Command("formatTableStyle",l,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table.",icon:"PresetStyles"},function(u){Ae(this,u)}),new r.Command("formatTableStyleClearCellStyles",l,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},icon:"PresetStyles",description:"Create a table or apply style to the current table and clears all cell styles."},function(u){Ae(this,u,!0)}),new r.Command("formatTableStyleClearTableStyle",l,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},icon:"ClearFormats",description:"Remove all the styling that is specific for the table."},function(){Ae(this,{name:null},!0)}),new r.Command("setDefaultTableStyle",l,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},ye),new r.Command("deleteTableStyle",l,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},Pe),new r.Command("formatBorder",l,{label:"Border",description:"Create an outline border."},function(u){b(this,{border:u})}),new r.Command("formatFillColor",l,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(u){b(this,{fill:u})}),new r.Command("formatFontColor",l,{label:"Font Color",description:"Change the color of your text."},function(u){b(this,{font:{fill:u}})}),new r.Command("formatBoldToggle",l,{label:"Bold",description:"Toggle bold formatting of text.",icon:"TextBold",shortcut:[{key:"B",modifiers:[r.KeyModifiers.Ctrl]},{key:"2",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatItalicToggle",l,{label:"Italic",description:"Toggle italic formatting of text.",icon:"TextItalic",shortcut:[{key:"I",modifiers:[r.KeyModifiers.Ctrl]},{key:"3",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedToggle",l,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",icon:"TextUnderline",shortcut:[{key:"u",modifiers:[r.KeyModifiers.Ctrl]},{key:"4",modifiers:[r.KeyModifiers.Ctrl]}]}),new r.Command("formatUnderlinedDoubleToggle",l,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text.",icon:"TextUnderlineDouble"}),new r.Command("formatUnderlinedAccountingToggle",l,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text.",icon:"TextUnderlineAccounting"}),new r.Command("formatUnderlinedAccountingDoubleToggle",l,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text.",icon:"TextUnderlineAccountingDouble"}),new r.Command("formatStrikeThroughToggle",l,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",icon:"TextStrike",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("formatSuperscriptToggle",l,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line.",icon:"TextSuperscript"}),new r.Command("formatSubscriptToggle",l,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line.",icon:"TextSubscript"}),new r.Command("formatAlignTopToggle",l,{label:"Align Top",description:"Align text to the top.",icon:"TextVerticalTop"}),new r.Command("formatTextOverflowVisibleToggle",l,{label:"Overflow Text",description:"Overflow text to the next cells.",icon:"TextHorizontalOverflow"}),new r.Command("formatTextOverflowWrapToggle",l,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required.",icon:"TextHorizontalWrap"}),new r.Command("formatTextOverflowClipToggle",l,{label:"Clip Text",description:"Clip text that falls outside of the existing cell.",icon:"TextHorizontalClip"}),new r.Command("formatTextOverflowShrinkToggle",l,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell.",icon:"TextHorizontalShrink"}),new r.Command("formatTextOverflowEllipsisToggle",l,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new r.Command("formatAlignMiddleToggle",l,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell.",icon:"TextVerticalCenter"}),new r.Command("formatAlignBottomToggle",l,{label:"Align Bottom",description:"Align text to the bottom.",icon:"TextVerticalBottom"}),new r.Command("formatAlignJustifyVerticalToggle",l,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedVerticalToggle",l,{label:"Distribute Vertically",description:"Justify your content vertically.",icon:"FormatAlignJustify"}),new r.Command("formatAlignLeftToggle",l,{label:"Align Left",description:"Align your content to the left.",icon:"FormatAlignLeft"}),new r.Command("formatAlignCenterToggle",l,{label:"Align Center",description:"Center your content.",icon:"FormatAlignCenter"}),new r.Command("formatAlignRightToggle",l,{label:"Align Right",description:"Align your content to the right.",icon:"FormatAlignRight"}),new r.Command("formatAlignJustifyToggle",l,{label:"Align Justify",description:"Justify your content.",icon:"FormatAlignJustify"}),new r.Command("formatAlignCenterContinuousToggle",l,{label:"Center Across",description:"Center your content across multiple cells.",icon:"FormatAlignCenter"}),new r.Command("formatAlignFillToggle",l,{label:"Fill Across",description:"Repeat the value to fill the entire cell.",icon:"FormatAlignJustify"}),new r.Command("formatAlignDistributedHorizontalToggle",l,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.",icon:"FormatAlignJustify"}),new r.SimpleCommand("formatFontSizeIncrease",l,{label:"Increase Font Size",description:"Make your text a bit bigger.",icon:"TextSizeIncrease",shortcut:{key:">",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.getFont().getSize(),!0)}}))}),new r.SimpleCommand("formatFontSizeDecrease",l,{label:"Decrease Font Size",description:"Make your text a bit smaller.",icon:"TextSizeDecrease",shortcut:{key:"<",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,u=>({font:{size:d.FontUtils.findNextFontSize(u.getFont().getSize(),!1)}}))}),new r.Command("formatFontFamily",l,{label:"Font",description:"Select the font your text."},function(u){b(this,{font:{family:u}})}),new r.Command("formatFontSize",l,{label:"Font Size",description:"Change the size of your text."},function(u){b(this,{font:{size:u}})}),new r.Command("formatNumberDialog",l,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[r.KeyModifiers.Ctrl]},{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},function(u,L){const K=this,m={initialValue:u??L.getState(),context:()=>L.getContext(),onInput:(A,G)=>{b(K,{numberFormat:A})}};c.showWindow("numberFormat",m)}),new r.Command("formatNumberFormat",l,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(u){b(this,{numberFormat:u})}),new r.Command("formatNumberFormatGeneralStyle",l,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,{numberFormat:d.NumberFormat.Type.General})}),new r.Command("formatNumberFormatNumberStyle",l,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,{numberFormat:"#,##0.00"})}),new r.Command("formatNumberFormatTimeStyle",l,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,{numberFormat:"h:mm AM/PM"})}),new r.Command("formatNumberFormatDateStyle",l,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,{numberFormat:"d-mmm-yy"})}),new r.Command("formatNumberFormatAccountingStyle",l,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",icon:"CurrencyDollar",shortcut:{key:"4",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(u){b(this,{numberFormat:u??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatPercentStyle",l,{label:"Percent Style",description:"Format as a percent with no decimal places.",icon:"Percent",shortcut:{key:"5",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,{numberFormat:"0%"})}),new r.Command("formatNumberFormatScientificStyle",l,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){b(this,{numberFormat:"0.00E+00"})}),new r.Command("formatNumberFormatCommaStyle",l,{label:"Comma Style",description:"Format with a thousands separator.",icon:"Comma",shortcut:{key:",",modifiers:[r.KeyModifiers.Ctrl]}},function(){b(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new r.Command("formatNumberFormatIncreaseDecimal",l,{label:"Increase Decimal",description:"Show more decimal places for a more precise value.",icon:"IncreaseDecimal2"},function(){b(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),1)}))}),new r.Command("formatNumberFormatDecreaseDecimal",l,{label:"Decrease Decimal",description:"Show few decimal places.",icon:"DecreaseDecimal2"},function(){b(this,u=>({numberFormat:d.NumberFormat.Parser.adjustDecimalPlaces(u.getNumberFormat(),-1)}))}),new r.Command("displayPlaceholdersToggle",l,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("noOp",l,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl]}},function(){}),new r.Command("displayOutlineSymbolsToggle",l,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("hideRows",l,{label:"Hide Rows",description:"Hide the rows.",icon:"HideRow",shortcut:{key:"9",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("unhideRows",l,{label:"Unhide Rows",description:"Unhide the rows.",icon:"ShowRow",shortcut:{key:"(",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("hideColumns",l,{label:"Hide Columns",description:"Hide the columns.",icon:"HideColumn",shortcut:[{key:"0",modifiers:[r.KeyModifiers.Ctrl]},{key:"0",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.Command("unhideColumns",l,{label:"Unhide Columns",description:"Unhide the columns.",icon:"ShowColumn",shortcut:{key:")",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.SimpleCommand("calculate",l,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",icon:"CalculateSheet",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl]}}),new r.Command("insertFunction",l,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",insertFunction:"More Functions..."},description:"Work with the function in the current cell.",icon:"FunctionThin",shortcut:{key:"F3",modifiers:[r.KeyModifiers.Shift]}},function(u){u&&ze(this,u.getName())}),new r.Command("insertFunctionSum",l,{label:"Quick Sum",scopedLabels:{insertFunction:"Sum"},description:"Quick sum of the cells.",icon:"FunctionSum",shortcut:{key:"=",modifiers:[r.KeyModifiers.Alt]}},function(){ze(this,"SUM")}),new r.Command("insertFunctionAverage",l,{label:"Quick Average",scopedLabels:{insertFunction:"Average"},description:"Quick average of the cells."},function(){ze(this,"AVERAGE")}),new r.Command("insertFunctionCount",l,{label:"Quick Count",scopedLabels:{insertFunction:"Count Numbers"},description:"Quick count of the cells."},function(){ze(this,"COUNT")}),new r.Command("insertFunctionMax",l,{label:"Quick Max",scopedLabels:{insertFunction:"Max"},description:"Quick maximum of the cells."},function(){ze(this,"MAX")}),new r.Command("insertFunctionMin",l,{label:"Quick Min",scopedLabels:{insertFunction:"Min"},description:"Quick minimum of the cells."},function(){ze(this,"MIN")}),new r.Command("startEditCurrentTime",l,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){M?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Medium Time"}}).toText()})}),new r.Command("startEditCurrentDate",l,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[r.KeyModifiers.Ctrl]}},function(){M?.({text:t.createTemporaryCell({value:d.DateUtils.nowWithPrecision(),style:{numberFormat:"Short Date"}}).toText()})}),new r.SimpleCommand("sheetZoomOut",l,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadSubtract",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoomIn",l,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},{key:"NumpadAdd",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("sheetZoom100",l,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("updateHyperlink",l,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",icon:"HyperlinkInset",context:()=>R().cell,shortcut:[{key:"K",modifiers:[r.KeyModifiers.Ctrl]},{key:"K",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]},async function(u,L){const K=this,m={context:()=>L.getContext(),onInput:A=>{ee(K,A)}};c.showWindow("hyperlink",m)}),new r.Command("openHyperlink",l,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[r.KeyModifiers.Ctrl]},description:"Open the hyperlink or goto another location within this document.",icon:"HyperlinkGoto",context:()=>R().cell},async(u,L)=>{const K=L.getContext();if(!K)return;const m=K.getHyperlink();if(m)try{await m.open()}catch(A){c.showError(A)}}),new r.Command("deleteHyperlink",l,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},icon:"HyperlinkDelete",description:"Remove the hyperlink.",context:()=>R().cell},function(u,L){ee(this,null)}),new r.SimpleCommand("insertNote",l,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[r.KeyModifiers.Shift]},description:"Add a note to the cell."},(u,L)=>{((K,m)=>{K?.showMessage?.(s.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[m," is not yet implemented.",s.jsx("br",{}),s.jsx("br",{}),"Please see the ",s.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/guides/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))})(c,L.getLabel())}),new r.Command("updateComments",l,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]},description:"Add a comment to the current cell.",icon:"CommentInsert",context:()=>R().cell},async function(u,L){const K=this,m={context:()=>L.getContext(),onInput:A=>{ne(K,A)}};c.showWindow("comments",m)}),new r.Command("deleteComments",l,{label:"Delete Comments",description:"Remove any comments.",icon:"CommentDelete",context:()=>R().cell},function(u,L){ne(this,null)}),new r.Command("insertImageFromFile",l,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device.",icon:"InsertImage"},async function(u=null){let L=null,K=null;typeof u=="string"?K=u:L=u?.file?u.file:u,(L||(L=await ge.CommonUtils.openFileDialog(K??"image/*"),L))&&await me(this,{file:L},u?.options)}),new r.Command("insertImageFromURL",l,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web.",icon:"InsertImage"},async function(u){if(!u){const L=await c.showInput({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",propsInput:{style:{minWidth:"440px"}},options:["Insert"]});if(L.option!=="Insert")return;u=L.input}u&&me(this,{fetch:u})}),new r.SimpleCommand("insertTable",l,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",icon:"InsertTable",shortcut:[{key:"L",modifiers:[r.KeyModifiers.Ctrl]},{key:"T",modifiers:[r.KeyModifiers.Alt,r.KeyModifiers.Ctrl]}]},function(){Ae(this)}),new r.Command("editTable",l,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features.",icon:"InsertTable"},function(u){let L=null,K=!1;u.isITable?L=u:u.getValue()&&(L=u.getValue(),K=!0),O(this,L,K)}),new r.Command("deleteTable",l,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._header_9ooz5_7{background:var(--sxl-color-base-100,#f5f5f5);color:color-mix(in srgb, var(--sxl-color-base-content,#000) 87%, transparent);line-height:1.2;font-family:var(--sxl-doc-font-minor,"Calibri", sans-serif);align-items:end;display:flex;overflow:hidden}._header_9ooz5_7._hover_9ooz5_18{background:var(--sxl-color-base-hover,#ececec)}._header_9ooz5_7._selected_9ooz5_26{background:var(--sxl-color-base-selected,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 20%, transparent));color:var(--sxl-color-base-selected-content,var(--sxl-color-primary,#1976d2))}._header_9ooz5_7._selectedAll_9ooz5_35{background:var(--sxl-color-base-emphasis,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 75%, var(--sxl-color-base-100,#f5f5f5)));color:var(--sxl-color-base-emphasis-content,var(--sxl-color-primary-content,#fff))}._movable-area_r4xkr_5{& .moveable-control-box{& .dragging{opacity:0}& .moveable-control{background-color:var(--sxl-color-base-100,white);background-image:var(--sxl-image-background);border:2px solid color-mix(in srgb, var(--sxl-color-primary) 70%, black);width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px}& .moveable-line{background:var(--sxl-color-neutral,grey)}}}@media (pointer:coarse){._movable-area_r4xkr_5{& .moveable-control-box{& .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}}}._TaskPaneArea_1m8hz_5{flex-direction:row;width:100%;height:100%;display:flex;position:absolute}._TaskPaneTitle_1m8hz_13{box-sizing:border-box;border-bottom:1px solid #0003;flex-direction:row;flex:1 1 0;align-items:center;width:100%;height:100%;padding:8px 16px;font-size:1.25rem;display:flex;& .title{opacity:.87}&.focused{& .title{opacity:1}}}._TaskPaneFrame_1m8hz_36{box-sizing:border-box;border-radius:4px;outline:none;flex-direction:column;flex:1 1 0;justify-content:stretch;align-items:stretch;width:100%;min-height:0;margin-bottom:4px;display:flex;position:relative;overflow:hidden}._TaskPaneAreaFrames_1m8hz_55{flex:100%;min-width:0;min-height:0;display:flex;position:relative}._TaskPaneAreaFrameHost_1m8hz_63{flex:100%;min-width:0;min-height:0;display:flex}._TaskPaneAreaFrameHidden_1m8hz_71{display:none}._TaskPaneStrip_1m8hz_75{scrollbar-width:thin;flex-direction:column;gap:4px;min-height:0;margin-top:4px;margin-bottom:4px;margin-left:2px;display:flex;overflow:hidden auto}._TaskPaneStripItem_1m8hz_88{writing-mode:vertical-rl;text-orientation:mixed;cursor:pointer;user-select:none;opacity:.75;border:1px solid #0000;border-radius:4px;flex-direction:row;flex:none;align-items:center;min-width:0;padding:4px;transition:opacity .12s,background-color .12s;display:flex;&:hover{opacity:1;background-color:#8080801f}&.selected{opacity:1;border-color:gray;font-weight:700}}._TaskPaneStripItemIcon_1m8hz_117{transform-origin:50%;display:inline-block;transform:rotate(90deg)}._TaskPaneStripItemLabel_1m8hz_127{opacity:0;grid-template-columns:0fr;transition:grid-template-columns .2s,opacity .15s;display:grid}._TaskPaneStripItemLabelOpen_1m8hz_134{opacity:1;grid-template-columns:1fr}._TaskPaneStripItemLabelClip_1m8hz_139{white-space:nowrap;min-width:0;min-height:0;overflow:hidden}._TaskPaneStripItemLabelText_1m8hz_146{padding-top:4px;display:inline-block}:root{--sxl-cf-bar-fade:20%}._track_1426b_17{pointer-events:none;position:absolute}._bar_1426b_22{box-sizing:border-box;position:absolute;top:0;bottom:0}._axis_1426b_30{width:1px;position:absolute;top:0;bottom:0}:root{--sxl-cf-icon-bad:#ec5753;--sxl-cf-icon-light-bad:#fc9f6e;--sxl-cf-icon-neutral:#f8cd3d;--sxl-cf-icon-light-good:#b4d67e;--sxl-cf-icon-good:#8cb354;--sxl-cf-icon-pink:#ff888a;--sxl-cf-icon-gold:#ffc000;--sxl-cf-icon-gray:light-dark(#a6a6a6,#8a8a8a);--sxl-cf-icon-black:light-dark(#333,#d9d9d9)}._clip_x7ihh_36{overflow:hidden}._clip_x7ihh_36:has(._box_x7ihh_40:hover){z-index:1;overflow:visible}._box_x7ihh_40{pointer-events:auto;cursor:default;justify-content:center;align-items:flex-end;display:flex;position:absolute;bottom:0}._glyph_x7ihh_79{transition:transform .12s ease-out,filter .12s ease-out}._box_x7ihh_40:hover ._glyph_x7ihh_79{filter:drop-shadow(0 1px 2px #00000059);transform:scale(1.18)}@media (prefers-reduced-motion:reduce){._glyph_x7ihh_79{transition:none}._box_x7ihh_40:hover ._glyph_x7ihh_79{transform:none}}._dropdown_2r2ao_8{pointer-events:auto;cursor:pointer;user-select:none;color:light-dark(#444,#ccc);background:light-dark(#f4f4f4,#3a3a3a);border:1px solid light-dark(#b8b8b8,#5a5a5a);border-radius:2px;justify-content:center;align-items:center;transition:background-color .1s ease-out;display:flex;position:absolute;top:0;bottom:0}._dropdown_2r2ao_8:hover{background:light-dark(#e4e4e4,#4a4a4a)}._dropdown_2r2ao_8:active{background:light-dark(#d4d4d4,#565656)}@media (prefers-reduced-motion:reduce){._dropdown_2r2ao_8{transition:none}}._sheet-scrollbar_104cg_1{align-items:center;margin-bottom:1px;margin-left:2px}._sheetxl-sheet_3nny_5{& ._viewport-overlay_3nny_6{pointer-events:none;& *{pointer-events:initial}}& .tile{& .text-box{position:absolute}& .text-line{text-rendering:optimizespeed;vertical-align:baseline;white-space:pre;position:absolute}& .column-button{flex-direction:row;justify-content:center;align-items:center;margin-bottom:4px;display:flex;position:absolute}& .text-debug-bounds{pointer-events:none;opacity:.2;background:green;position:absolute}& .fill{position:absolute}& .pending{border:color-mix(in srgb, var(--sxl-color-primary) 70%, black) .5px;background-color:var(--sxl-color-base-200,grey);opacity:1;border-style:double;border-radius:50%;width:6px;height:6px;animation:1.5s infinite alternate _pulse_3nny_1;position:absolute;top:5px;left:4px}& .slider{opacity:0;width:130%;height:2px;animation:0s .5s forwards _fadeIn_3nny_1;position:absolute;bottom:1px;overflow-x:hidden}& .line{opacity:.3;background:color-mix(in srgb, var(--sxl-color-primary) 80%, white) .5px;width:100%;height:2px;position:absolute}& .subline{background:var(--sxl-color-primary,#4d4d4d) .5px;opacity:.9;height:3px;position:absolute}& .inc{animation:3s infinite _increase_3nny_1}}}@keyframes _pulse_3nny_1{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.2)}to{opacity:1;transform:scale(1)}}@keyframes _fadeIn_3nny_1{0%{opacity:0;height:0}to{opacity:1;height:2px}}@keyframes _increase_3nny_1{0%{width:30%;animation-timing-function:ease;left:-150%}to{width:30%;left:100%}}._themed_f2asj_9{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem));vertical-align:middle;width:var(--chart-icon-size);height:var(--chart-icon-size);fill:currentColor;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}._themed_f2asj_9>svg{width:var(--chart-icon-size);height:var(--chart-icon-size)}._small_f2asj_36{--chart-icon-size:calc(var(--icon-size-sm,.875rem) * .875)}._medium_f2asj_37{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem))}._large_f2asj_38{--chart-icon-size:calc(var(--icon-size-lg,1.25rem) * 1.5)}._themed_f2asj_9 .current_color{fill:currentColor}._themed_f2asj_9 .background{fill:var(--sxl-color-base-100,#fff)}._themed_f2asj_9 .high_contrast{fill:var(--sxl-color-primary,#595b5e)}._themed_f2asj_9 .info{fill:var(--sxl-color-info,#3b82f6)}._themed_f2asj_9 .info_tint{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 80%, white)}._themed_f2asj_9 .info_shade{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 70%, black)}._themed_f2asj_9 .accent_tint{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 80%, white)}._themed_f2asj_9 .accent_shade{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 70%, black)}._editable-input_1u3oj_6{width:100%;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;text-transform:inherit;background:0 0;border:none;outline:none;padding:0;line-height:1.2;position:absolute;top:50%;left:0;transform:translateY(-50%)}@keyframes _pop_10yib_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_10yib_29{0%{opacity:0}to{opacity:1}}._Wrapper_10yib_21{box-sizing:border-box;transform:translate3d(var(--translate-x,0), var(--translate-y,0), 0) scaleX(var(--scale-x,1)) scaleY(var(--scale-y,1));transform-origin:0 0;touch-action:manipulation;display:flex;&._dragOverlay_10yib_33{z-index:999}}._Item_10yib_43{box-sizing:border-box;transform-origin:50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale,1));outline:none;align-items:center;display:flex;position:relative;&:not(._withHandle_10yib_57){touch-action:manipulation}&._dragging_10yib_62:not(._dragOverlay_10yib_33){opacity:var(--dragging-opacity,0);z-index:999}&._dragOverlay_10yib_33{cursor:inherit;transform:scale(var(--scale));opacity:1;animation:.2s cubic-bezier(.18,.67,.6,1.22) _pop_10yib_1}}._Row_1kr10_1{box-sizing:border-box;display:flex}._TabStrip_3x0dp_1{&::-webkit-scrollbar{height:0;display:none}position:relative;overflow:hidden auto}._sheet-tab_1cbiv_2 input{color:var(--sxl-sheet-tab-input-color,inherit);text-align:center;font-weight:500}._ghost_1cbiv_18{border:1px solid #0000;transition:background-color .12s,border-color .12s}._sheet-tab_1cbiv_2:hover ._ghost_1cbiv_18{background-color:var(--sxl-tab-hover-bg);border-color:var(--sxl-tab-hover-border)}._add-button_1b4ig_1{cursor:pointer;color:color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent);background:0 0;border:none;justify-content:center;align-items:center;margin:0 2px;padding:0;display:flex}._add-button_1b4ig_1:hover:not(:disabled){color:var(--sxl-color-primary,#1976d2)}._add-button_1b4ig_1:disabled{cursor:default;opacity:.6}._loading-panel_bjv3h_1{box-sizing:border-box;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._loading-spinner_bjv3h_10{border:3px solid color-mix(in srgb, var(--sxl-color-base-content) 44%, transparent);border-top-color:var(--sxl-color-primary,#1976d2);border-radius:50%;width:28px;height:28px;animation:.9s linear infinite _sxl-spin_bjv3h_1}@keyframes _sxl-spin_bjv3h_1{to{transform:rotate(360deg)}}:root{--icon-size:1.25rem}@media (pointer:coarse){:root{--icon-size:1.75rem}}._sheetxl-workbook_r60qk_11{outline:none;flex-direction:column;flex:100%;width:100%;min-width:0;height:100%;min-height:0;display:flex;position:relative;overflow:hidden}._sheetxl-workbook_r60qk_11 *{font-weight:400}._sheetxl-workbook_r60qk_11 .viewport-overlay{outline:none}._sheetxl-reset_r60qk_36{margin:0;padding:0;line-height:1;display:block}._sheetxl-reset_r60qk_36 table,._sheetxl-reset_r60qk_36 thead,._sheetxl-reset_r60qk_36 tbody,._sheetxl-reset_r60qk_36 tfoot,._sheetxl-reset_r60qk_36 tr,._sheetxl-reset_r60qk_36 th,._sheetxl-reset_r60qk_36 td{border-collapse:inherit;border-spacing:0;border:none;border-color:inherit;width:auto;height:auto;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0;margin:0;padding:0;display:block}._sheetxl-reset_r60qk_36 th,._sheetxl-reset_r60qk_36 td{display:inline}._viewport_r60qk_30>:first-child{position:relative}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./Bo9Kx3L_XQkGPBJ5.cjs");let t=require("@sheetxl/sdk"),n=require("react"),r=e.n(n,1);n=e.n(n);let i=require("react/jsx-runtime"),a=require("@sheetxl/utils"),o=require("@sheetxl/grid-react"),s=require("@sheetxl/utils-react"),c=require("react-dom");var l=(e,t,n)=>{let i=(0,r.useRef)(t);i.current=t;let a=(n=n?{...d,...n}:d).ignoreModelChange;(0,r.useEffect)(()=>{if(!e||!i.current)return;let t=Object.keys(i.current),r={},o=t.length;for(let e=0;e<o;e++){let n=t[e];r[n]=(e,t)=>i.current[n]?.(e,t)}let s=n?.debugText;s&&console.log(`Add: `+s);let c=e.addListeners(r,n);if(!a)for(let n=0;n<o;n++)r[t[n]]?.(e);return()=>{s&&console.log(`Remove: `+s),c?.()}},[e])};function u(e,t){let[n,i]=(0,r.useReducer)(e=>e+1,0);l(e,(0,r.useMemo)(()=>{let e=(e,t)=>{i()},n=Array.isArray(t)?t:[t],r={};for(let t of n)r[t]=e;return r},[e,...Array.isArray(t)?t:[t]]))}var d={transactional:!1,ignoreModelChange:!1},f=(e,t,n,i)=>{let a=(0,r.useRef)(n);a.current=n;let o=i?.fireOnAddressChange??!0;(0,r.useEffect)(()=>{let n=Date.now();if(!e||!t||!a.current){let e={getSource:p,getFrom:p,getTo:p,trigger:`delete`,isDataChange:!1,getTransactionId:p,isUndo:!1,timeStamp:n};a.current?.(e);return}let r=e=>{a.current?.(e)},s=e.getRange(t).addListener(r,i);if(o){let i=e.getRange(t);r({getSource:()=>i,getFrom:p,getTo:p,trigger:`modelChange`,isDataChange:!1,getTransactionId:p,isUndo:!1,timeStamp:n})}return()=>{s?.()}},[e,t])},p=()=>null,m=(0,r.createContext)(null);function h(e){let{sheet:t,children:n}=e;return(0,i.jsx)(m.Provider,{value:t,children:n})}function g(){return(0,r.useContext)(m)}var _=(0,r.createContext)(null);function v(e){let{workbook:t,children:n}=e;return u(t,[`onSelectedSheetChange`]),(0,i.jsx)(_.Provider,{value:t,children:(0,i.jsx)(h,{sheet:t?t.getSelectedSheet():null,children:n})})}function y(){return(0,r.useContext)(_)}var b=(0,r.memo)(e=>{let{anchorLocation:t=a.AnchorLocation.TopLeft,cellWidth:n=0,cellHeight:r=0,size:o=7,inset:s=1,fill:c,propsPath:l,style:u,...d}=e,f=o,p=s,m=`red`,h=[],g=[];return t===a.AnchorLocation.TopLeft?(m=`light-dark(green, rgb(255, 198, 246))`,h.push(p),g.push(p),h.push(p+f),g.push(p),h.push(p),g.push(p+f)):t===a.AnchorLocation.TopRight?(m=`light-dark(red, rgb(0, 255, 255))`,h.push(n-p),g.push(p),h.push(n-(p+f)),g.push(p),h.push(n-p),g.push(p+f)):t===a.AnchorLocation.BottomRight?(m=`light-dark(purple, rgb(236, 252, 211))`,h.push(n-p),g.push(r-p),h.push(n-(p+f)),g.push(r-p),h.push(n-p),g.push(r-(p+f))):t===a.AnchorLocation.BottomLeft&&(m=`light-dark(blue, rgb(255, 236, 183))`,h.push(p),g.push(r-p),h.push(p+f),g.push(r-p),h.push(p),g.push(r-(p+f))),(0,i.jsx)(`svg`,{width:`${n}`,height:`${r}`,viewBox:`0 0 ${n} ${r}`,style:{position:`absolute`,width:`${n}px`,height:`${r}px`,pointerEvents:`none`,...u},...d,children:(0,i.jsx)(`path`,{d:`M ${h[0]} ${g[0]} L ${h[1]} ${g[1]} L ${h[2]} ${g[2]} L ${h[0]} ${g[0]} Z`,fill:c??m,...l})})}),x=e=>{let{value:n,cell:r,bounds:o,children:s,style:c={},range:l,pane:u,normalStyle:d,showFormulas:f,showZeros:p,docTheme:m,onLinkMouseDown:h,...g}=e,_=u.getZoom(),v=o.height/_,y=o.width/_,x=n,w=x.getValue(),T=n.getStyle(),E=null,D=null,O=t.FormulaError.isError(w),k=O&&w instanceof t.FormulaError.Parse,A=f||k;if(A)if(x.isSpillOverflow())D=``;else{let e=x.getFormulaText();e?D=`=`+e:E=x.getNumberFormat(t.NumberFormat.Type.General)}else E=x.getNumberFormat();let j=null;A||(j=x.getTextOverflow());let M=j?j.colBounds.width+j.leftOffset+j.rightOffset:y,N=j?j.anchorBounds.x-j.leftOffset:0,P=j?j.anchorBounds.width:y,F=x.getRenderHorizontalAlignment(),I=null;E&&(I=E?.formattedRuns,D=I?.runs[0]?.text??E.displayText);let L=x.getCalculationStatus()===t.ICalculation.ResultStatus.Pending,R=null,z=0,B=0;if(!T.getBorder().isEmpty()){let e=T.getBorder().getRight();!e.isNone()&&(t.IBorder.BuiltInDefinitions.get(e.getStyle())?.width??0)>1&&(z=1);let n=T.getBorder().getBottom();!n.isNone()&&(t.IBorder.BuiltInDefinitions.get(n.getStyle())?.width??0)>1&&(B=1)}let V=null,H=x.getComments(),U=x.getWarnings(),W=x.getErrors();if(H||O||W.length>0||U.length>0){let e={size:7*_,cellWidth:P*_+2,cellHeight:v*_+2};V??=[],(U.length>0||W.length>0||O)&&V.push((0,i.jsx)(b,{anchorLocation:a.AnchorLocation.TopLeft,...e},`indicator-${V.length}`)),H&&V.push((0,i.jsx)(b,{anchorLocation:a.AnchorLocation.TopRight,...e},`indicator-${V.length}`))}let G=T.getFont(),K=E?.conditionalColor??null,q=T.getAlignment(),ee=q.getHorizontal()===t.ITextFrame.HorizontalAlignment.Fill,te=q.getHorizontal()===t.ITextFrame.HorizontalAlignment.CenterContinuous||ee,J=te||A?0:q.getRotation(),Y=x.getInsets(),ne=Y.top+Y.bottom,X=Y.left,re=Y.right,Z={...c,left:c.left-1,top:c.top-1,width:c.width+1+z,height:c.height+1+B},ie=null;L&&(ie=(0,i.jsxs)(`div`,{className:`slider`,children:[(0,i.jsx)(`div`,{className:`line`}),(0,i.jsx)(`div`,{className:`subline inc`})]},`pending`));let ae=!C&&!(L||h||V||s||(I?.runs.length??0)>1||j||J%360!=0),oe=te||!(!j||!(j.rightIndex>0||j.leftIndex>0||j.colSpan>1));if(!oe){let e=x.getSpans();(e.width>1||e.height>1)&&(oe=!0)}let se={...Z};if(!a.CommonUtils.isEmpty(D)||!a.CommonUtils.isEmpty(E?.errorPlaceholder)){let e=E?.canWrap??!1,n,r,o=[],s=!0;p||A||w!==0||(s=!1);let l=x.getTextFrame(A);if(s&&l){let s=M-1-(X+re),u=ee||te||E&&(E.repeatChars.length>0||E.spacingChars.length>0),d=(J||j||A||e||l.wrapped||u)&&!J?null:x.getTextPlacement({width:y,height:v},A),f=d?.rotation??null;f&&(s=f.lineLength);let p=null;e&&!f&&(p={width:s});let m=null,b=E?.errorPlaceholder,C=d?.frame??l.layout(p??void 0);if(n=C.bounds,A?n={...n,width:0}:I&&(n={...n,width:E.errorPlaceholder||E.repeatChars.length>0?s:I.width}),!b&&x.getType()!==t.ScalarType.String&&Math.floor(n.width)>s){if(T.getNumberFormat()===`General`&&x.getType()===t.ScalarType.Number){let e=T.measureText(`0`),t=Math.floor(s/e.width),n=w,r=Math.abs(n),i=n<0,o=r>=1e5||n!==0&&r<=1e-5,c=a.CommonUtils.splitNumber(n),l=e=>Math.floor(T.measureText(e).width)<=s,u=Math.min(10,t-(Math.max(1,c?.ipLength??0)+1)-+!!i);if(u>=-1){let e=`0${u>0?`.`:``}${`#`.repeat(Math.max(0,u))}`,t=x.getNumberFormat(e).displayText.replace(/\.$/,``),n=t===`0`&&i?`-0`:t;o&&!/[1-9]/.test(t)||!l(n)||(m=n)}if(!m&&o){let e=t-+!!i-5,n=t-+!!i-4,r=null;if(e>=2?r=`0.${`0`.repeat(e-1)}E+00`:n>=1&&(r=`0E+00`),r){let e=x.getNumberFormat(r).displayText;l(e)&&(m=e)}}}m||(b=`#`)}if(!b&&I&&I.lastRepeatIndex>=0&&I.width>s&&(b=`#`),b&&s>0){let e=T.measureText(b),n=Math.max(1,Math.floor((s||1)/(e?.width||1)));m=b.repeat(n),F=t.ITextFrame.HorizontalAlignment.Center}if(A&&(F=t.ITextFrame.HorizontalAlignment.Left),m){let e=T.measureText(m).width;e&&(n={...n,width:e})}r={...n,width:n.width+X+re,height:n.height},f&&(r={...f.bounds});let D=!(!d||f||m||b);f||(D?(r.x=d.bounds.x,r.y=d.bounds.y):(F===t.ITextFrame.HorizontalAlignment.Center||F===t.ITextFrame.HorizontalAlignment.CenterContinuous?r.x=(M-r.width)/2:F===t.ITextFrame.HorizontalAlignment.Right?r.x=M-r.width-.5:r.x=.5,q.getVertical()===t.ITextFrame.VerticalAlignment.Center?r.y=(v-r.height)/2:q.getVertical()===t.ITextFrame.VerticalAlignment.Bottom?r.y=v-r.height-ne:r.y=ne));let O=ae?{...g}:void 0,P={style:{left:c.left-1,top:c.top-1,width:c.width+1,height:c.height+1,transform:J&&!f?`rotate(${J}deg)`:void 0,cursor:h?`pointer`:void 0,pointerEvents:h?`auto`:void 0,zIndex:oe?1:void 0},onMouseDown:h,onDoubleClick:h?e=>{e.stopPropagation(),e.preventDefault()}:void 0,...O};k&&(P.style.textDecorationStyle=`wavy`,P.style.textDecorationColor=`light-dark(red, rgb(0, 255, 255))`,P.style.textDecorationLine=`underline`);let L=G.getSize(),R=(e,a,c,l,u,d,f,p=null)=>{let m=L*_,h=c,g=f?.runs?f.runs:[{type:t.NumberFormat.ParseRunType.Text,text:e,width:T.measureText(e,m).width}];f&&f?.width!==n.width&&(n={...n,width:f?.width});let v=D?0:X;if(f&&f.lastRepeatIndex>=0&&s>f.width){let e=f.runs[f.lastRepeatIndex];if(e){let r=[...g],i=Math.max(0,s-1-f.width),a=0,o=``;if(i>0){let t=Math.floor(i/e.width);o=t>0?e.text.repeat(t):``,a=i}r[f.lastRepeatIndex]={type:t.NumberFormat.ParseRunType.Repeat,text:o,width:a},g=r,n={...n,width:f.width+a}}}let y=(e,n,r,a,s,c,l,f,p,g=null)=>{let y,b=h.width;u===t.ITextFrame.HorizontalAlignment.Justify?(b=s,d||(y=`justify`)):u===t.ITextFrame.HorizontalAlignment.Distributed&&(b=s,y=d||e.text.split(` `).length-1==0?`center`:`justify`);let{style:x,className:C,...w}=g??{},T=e.text;if(u===t.ITextFrame.HorizontalAlignment.Fill&&E?.repeatChars.length===0){let e=Math.max(1,Math.floor((h?.width??0)/(l?.width??1)));T=T.repeat(e)}let O=h.height,k=G.getVerticalAlignment(),A=k===t.IFont.VerticalAlignment.Sub,j=k===t.IFont.VerticalAlignment.Super;if(A||j){let e=G.getSuperSubScale();m*=e,O*=e}let M={textAlign:y,textAlignLast:y,...x,...G.toCSS(`adaptive`,_,!0),fontSize:m*t.IFont.getDeviceScale()};ae||(M.background=S?`pink`:void 0),K&&(M.color=K.toCSS(`adaptive`));let N=v+n,P=(D?0:Y.top)+h.y+0;if(A&&(P+=p-m),c){let e=(l.x+N)*_+1,t=(l.y+P)*_+1;t<0?M.marginTop=t:M.paddingTop=t,e<0?(M.width=(x?.width??0)-e,M.left=(x?.left??0)+e):M.paddingLeft=e,M.paddingRight=Math.max(0,(x?.width??0)-b*_-e),M.paddingBottom=Math.max(0,(x?.height??0)-h.height*_-t),M.height=(x?.height??0)+(t<0?-t:0),(t<0||e<0)&&(M.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else M.left=(l.x+N)*_+1,M.top=(l.y+P)*_+1,M.width=l.width*_,M.height=l.height*_;M.lineHeight=O*_+`px`;let F=ae?void 0:`text-line`;o.push((0,i.jsx)(`div`,{className:C?`${C} ${F}`:F,style:M,...w,children:T},`text-${h.y}-${a}-${r}`))};if(q.getOverflow()===t.ITextFrame.Overflow.Shrink&&s>0){let t=n?.width??0,r=0;for(;t>1&&t>s&&m>2&&r<100;)m*=s/t,t=T.measureText(e,m).width,r++;n={...n,width:t}}let b=h.x;u===t.ITextFrame.HorizontalAlignment.Right?b+=n.width-h.width:u!==t.ITextFrame.HorizontalAlignment.Center&&u!==t.ITextFrame.HorizontalAlignment.CenterContinuous||(b+=(n.width-h.width)/2),f&&f.lastRepeatIndex>=0&&(b=h.x);let x=g.length;for(let e=0;e<x;e++){let i=g[e];(i.type===t.NumberFormat.ParseRunType.Text||i.type===t.NumberFormat.ParseRunType.Repeat)&&(i.type,t.NumberFormat.ParseRunType.Repeat,y(i,b,e,a,u===t.ITextFrame.HorizontalAlignment.Justify||u===t.ITextFrame.HorizontalAlignment.Distributed||f&&f.lastRepeatIndex>=0?s:h.width,ae,{x:r.x+N,y:r.y,width:i.width,height:n.height},0,l,p)),b+=i.width}};if(f){let e=f.angle,r=d.lineHeight,a=L*_,c=q.getVertical(),l=(n,s,c,l,u)=>{let d={left:s.x*_+1,top:s.y*_+1,width:c*_,height:r*_,lineHeight:r*_+`px`,transform:`rotate(${e}deg)`,transformOrigin:`0 0`,textAlign:u,textAlignLast:u,whiteSpace:u===`justify`?`normal`:void 0,cursor:h?`pointer`:void 0,pointerEvents:h?`auto`:void 0,zIndex:oe?1:void 0,...G.toCSS(`adaptive`,_,!0),fontSize:a*t.IFont.getDeviceScale()};S&&(d.background=`pink`),K&&(d.color=K.toCSS(`adaptive`)),o.push((0,i.jsx)(`div`,{className:`text-line`,style:d,onMouseDown:P.onMouseDown,onDoubleClick:P.onDoubleClick,children:l},`text-rot-${n}`))},u=(n,i)=>t.TextRotation.layoutLines([{width:n,height:r}],e,d.content,i,c);if(m||b){let e=m??b??``;l(`override`,u(n.width,F).lines[0].origin,n.width,e)}else if(I&&C.lines.length===1){let e=I.runs,n=I.width,r=F;if(I.lastRepeatIndex>=0&&s>I.width){let i=I.runs[I.lastRepeatIndex];if(i){let a=[...e],o=Math.max(0,s-I.width),c=``;if(o>0&&i.width>0){let e=Math.floor(o/i.width);c=e>0?i.text.repeat(e):``}a[I.lastRepeatIndex]={type:t.NumberFormat.ParseRunType.Repeat,text:c,width:o},e=a,n=I.width+o,r=t.ITextFrame.HorizontalAlignment.Left}}let a=u(n,r),o=0,c=[];for(let n=0;n<e.length;n++){let r=e[n];r.type!==t.NumberFormat.ParseRunType.Text&&r.type!==t.NumberFormat.ParseRunType.Repeat||!r.text||c.push((0,i.jsx)(`span`,{style:{position:`absolute`,left:o*_,top:0,whiteSpace:`pre`},children:r.text},`run-${n}`)),o+=r.width}l(`runs`,a.lines[0].origin,n,c)}else{let n=c===t.ITextFrame.VerticalAlignment.Distributed&&e%90==0&&e%180!=0,r=f.lines.length;for(let e=0;e<r;e++){let i=f.lines[e],a=C.lines[e],o=a.runs[0].text.replace(/\s+$/,``),s=e===r-1,c,u=i.size.width;F!==t.ITextFrame.HorizontalAlignment.Justify||s||a.runs[0].text.endsWith(`
3
+ `)?(F===t.ITextFrame.HorizontalAlignment.Distributed||n)&&(u=f.lineLength,c=s||o.split(` `).length-1==0?`center`:`justify`):(u=f.lineLength,c=`justify`),l(`${e}`,i.origin,u,o,c)}}}else m||b?R(m??b??``,0,{...n,x:n.x??0,y:n.y??0},C.lines[0].baseline,F,!0,null,P):C.visitLines({visitTextLine:(e,r,i)=>{let a=e.runs[0].text.replace(/\s+$/,``),o=r===i-1,c=F===t.ITextFrame.HorizontalAlignment.Justify&&(o||e.runs[0].text.endsWith(`
4
+ `))?t.ITextFrame.HorizontalAlignment.Left:F,u=0;r>0&&(q.getVertical()===t.ITextFrame.VerticalAlignment.Distributed||q.getVertical()===t.ITextFrame.VerticalAlignment.Justify)&&(u=Math.max(0,(v-(ne+3)-e.bounds.height*i)/(i-1)*r)),q.getVertical()===t.ITextFrame.VerticalAlignment.Distributed&&J&&J%90==0&&J%180!=0&&(c=t.ITextFrame.HorizontalAlignment.Distributed),c!==t.ITextFrame.HorizontalAlignment.Justify&&c!==t.ITextFrame.HorizontalAlignment.Distributed&&c!==t.ITextFrame.HorizontalAlignment.Fill||(n={...n,width:s});let d=ee||E&&(E.repeatChars.length>0||E.spacingChars.length>0)?n.width:e.bounds.width,f={...e.bounds,y:e.bounds.y+u+0,width:d};R(a,r,f,l.lines[0].baseline,c,o,i===1?I:null,ae&&r>0?{...P,style:{...P.style,background:void 0}}:P)}})}o.length>0&&(R=o),S&&!ae&&R&&(R=[R,(0,i.jsx)(`div`,{style:{left:r.x*_,top:r.y*_,width:r.width*_,height:r.height*_}},`text-debug-bounds`)])}if(ae)return R&&R.length>0?R:(0,i.jsx)(`div`,{style:se,...g});L&&!R&&(R=(0,i.jsx)(`div`,{style:{position:`absolute`,left:0,right:0,top:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:`...`},`pending-ellipsis`));let ce=null;if(C){let e=x.getTextPlacement({width:y,height:v},A);e&&(ce=(0,i.jsx)(`div`,{style:{position:`absolute`,left:e.bounds.x*_+1,top:e.bounds.y*_+1,width:e.bounds.width*_,height:e.bounds.height*_,outline:`1px solid rgba(0,120,255,0.8)`,background:`rgba(0,120,255,0.08)`,pointerEvents:`none`}},`placement-debug`))}let le=[R,s,V,ie,ce];return(0,i.jsx)(`div`,{style:{...Z,zIndex:oe?1:void 0},...g,children:le})},S=!1,C=!1,w=(e,t)=>{if(t<=0||t>e.length||!`/*^&<>=:,+-( `.includes(e[t-1]))return!1;let n=t;for(;n<e.length&&e[n]===` `;)n++;return n>=e.length||`/*^&<>=:,)`.includes(e[n])},T=e=>e.length>0&&`=+-`.includes(e[0]),E=e=>+(e[0]===`=`),D=e=>e.isReference&&e.referenceIndex!==void 0?o.PICKER_COLORS[e.referenceIndex%o.PICKER_COLORS.length]:e.type===`error`?`var(--sxl-color-error, light-dark(#a31515, #ce9178))`:void 0,O=(e,t,n)=>{let r=n;for(let n=0;n<e.length;n++){let i=(e[n].text??``).length;if(t>=r&&t<=r+i)return n;r+=i}return-1},k=(e,t,n)=>{let r=n,i=-1,a=-1;for(let n of e){let e=(n.text??``).length;n.referenceIndex===t&&(i<0&&(i=r),a=r+e),r+=e}return i<0?null:{start:i,end:a}},A=(e,t,n,r)=>{if(!T(t))return null;try{let i=e.createFormula(t,r),a=-1,o=`self`,s=-1,c=E(t);for(let e of i.getTokens()){let t=(e.text??``).length;if(e.referenceIndex!==void 0&&e.refSide&&n>=c&&n<=c+t){a=e.referenceIndex,o=e.refSide,s=c+t;break}c+=t}if(a<0)return null;let l=i.setReferenceModeAt(a,o),u=t.slice(0,E(t))+l.getExpression();return{value:u,caret:s+(u.length-t.length)}}catch{return null}},j=e=>{let{cell:n,tokens:r,zoom:a,style:o,...s}=e,c=n.getStyle(),l=c.getFont(),u=n.getInsets(),d=c.getAlignment().getVertical(),f=d===t.ITextFrame.VerticalAlignment.Top?`flex-start`:d===t.ITextFrame.VerticalAlignment.Center?`center`:`flex-end`,p=[];for(let e=0;e<r.length;e++){let t=r[e],n=D(t);p.push(n===void 0?(0,i.jsx)(`span`,{children:t.text??``},e):(0,i.jsx)(`span`,{style:{color:n},children:t.text??``},e))}return(0,i.jsxs)(`div`,{...s,style:{position:`absolute`,inset:0,display:`flex`,alignItems:f,justifyContent:`flex-start`,overflow:`hidden`,whiteSpace:`pre`,pointerEvents:`none`,paddingLeft:(u.left+1)*a,paddingTop:u.top*a,paddingBottom:u.bottom*a,...l.toCSS(`adaptive`,a,!0),fontSize:l.getSize()*a*t.IFont.getDeviceScale(),...o},children:[`=`,p]})};j.displayName=`FormulaCellRenderer`;var M=(e,t,n)=>{u(e,[`onSelectionChange`]);let i=t?e.getSelection().getCoords().cell:null;return(0,r.useMemo)(()=>{if(!t||!i)return null;try{let t={rowIndex:i.rowIndex,colIndex:i.colIndex},n=e.getRange(t).getCell();if(n.isSpillOverflow())return null;let r=n.getFormulaText();if(r==null)return null;let a=e.getName(),o=e.getCalculation().createFormula(`=`+r,{...t,scope:a}),s=o.getTokens();if(s.length===0)return null;let c=[];try{let e=o.getReferences();c=e?e.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[]}catch{}return{coords:t,cell:n,tokens:s,ranges:c}}catch{return null}},[e,t,i,n])};function N(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=N(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function P(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=N(e))&&(r&&(r+=` `),r+=t);return r}var F=`M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673`,I=e=>{let{renderBounds:t,zoom:n,disabled:a,column:o,onColumnButtonMouseDown:s,style:c,...l}=e,[d,f]=(0,r.useState)(!1);u(o.getTable(),[`onAnyChange`]);let p=F,m=o?o.getFilter():null,h=o?o.getSort():null,g=h?h.getCriteria():null,_=m&&m.getCondition(),v=g?g.reverse??!1:null;p=!0===v?_?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z`:`m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:!1===v?_?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z`:`m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:_?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:F;let y=Math.min(Math.min(18,t.height-8),t.width);return(0,i.jsx)(`div`,{style:{width:`${y}px`,height:`${y}px`,right:`1px`,boxShadow:`0px 0px 0px 0.5px `+(d&&!a?`color-mix(in srgb, var(--sxl-color-primary) 80%, white)`:`var(--sxl-color-base-300, grey)`),backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,borderRadius:+(y>12)+`px`,marginRight:`2px`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:a?void 0:`pointer`,...c},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onPointerDown:e=>{s?.(e,o),e.stopPropagation(),e.preventDefault()},...l,children:(0,i.jsx)(`svg`,{width:``+15*n,height:``+15*n,viewBox:`0 0 15 15`,style:{fill:d&&!a?`color-mix(in srgb, var(--sxl-color-primary) 70%, black)`:`var(--sxl-color-base-content, grey)`,opacity:a?.6:1},children:(0,i.jsx)(`path`,{d:p})})})},L=`_header_9ooz5_7`,R=`_hover_9ooz5_18`,z=`_selected_9ooz5_26`,B=`_selectedAll_9ooz5_35`,V=()=>!1,H=(0,r.memo)(e=>{let{index:t,value:n,zoomScale:o=100,headerText:s=e=>`${e}`,verticalPadding:c=0,horizontalPadding:l=0,isSelected:u=V,isSelectedAll:d=V,cell:f,bounds:p,range:m,axis:h,pane:g,onColumnButtonMouseDown:_,propsColumnButton:v,renderColumnButton:y=I,className:b,style:x={},...S}=e,C=g.getZoom(),w=n?.getColumn(),T=w&&!w.isHiddenButton(),E=(0,r.useRef)(null),[D,O]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=null,t=g.addReactEventListener(`pointermove`,t=>{let{clientX:n,clientY:r}=t;e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{if(!E.current)return;let e=E.current.getBoundingClientRect(),t=n>=e.left&&n<=e.right&&r>=e.top&&r<=e.bottom;O(t)})}),n=g.addReactEventListener(`pointerleave`,()=>{e&&cancelAnimationFrame(e),O(!1)});return()=>{e&&cancelAnimationFrame(e),t?.(),n?.()}},[g]),(0,r.useEffect)(()=>{if(!D)return;let e=e=>{let t=E.current;if(!t)return;let n=t.getBoundingClientRect();(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&O(!1)};return document.addEventListener(`pointermove`,e,!0),()=>document.removeEventListener(`pointermove`,e,!0)},[D]);let k=o/100,A=u?.(t)||!1,j=d?.(t)||!1,M=h===a.RangeAxis.Column,N=s(t),F=M?`center`:`end`,H=0,U=null;if(T){H=4,F=`start`;let e={x:p.x-1,y:-1,width:p.width+1-H,height:p.height+1};U=(0,i.jsx)(`div`,{style:{...e,position:`absolute`,zIndex:2,display:`flex`,alignItems:`end`,justifyContent:`end`,flexDirection:`row`},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,r.createElement)(y,{renderBounds:e,className:`column-button`,disabled:!1,zoom:C,column:w,onColumnButtonMouseDown:_,...v,style:{pointerEvents:`auto`,...v?.style,backgroundColor:`var(--sxl-color-base-100, white)`,marginBottom:`4px`,backgroundImage:void 0}})},`columnButton`)}return(0,i.jsxs)(`div`,{ref:E,className:P(b,L,{[R]:D,[z]:A&&!j,[B]:j}),style:{fontSize:`calc(var(--sxl-doc-font-size, 11pt) * ${k})`,justifyContent:F,paddingLeft:H,paddingBottom:`${k}px`,paddingRight:M?void 0:`4px`,...x,left:x.left,top:x.top,width:x.width,height:x.height},...S,children:[N,U]})});H.displayName=`SheetHeaderRenderer`;var U=()=>{let e=null,t=new Set;return{getMode:()=>e,setMode:n=>{let r=typeof n==`function`?n(e):n;r!==e&&(e=r,t.forEach(e=>e()))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}},W=U(),G=()=>W.getMode(),K=e=>W.setMode(e),q=(0,r.createContext)(null),ee=()=>(0,r.useContext)(q)??W,te=()=>{let e=ee();return(0,r.useSyncExternalStore)(e.subscribe,e.getMode,e.getMode),e},J=e=>!e||e===`none`||e===`transparent`,Y=(e,t,n,r)=>{let i=e.getStyle().getFill()?.toCSS(n)?.background;return J(i)&&(i=t.getStyles().getNormal().getFill().toCSS(n)?.background),J(i)&&(i=r??`#ffffff`),i},ne=(e,t,n)=>{if(!e||!t)return n;try{return e.getSheet(t)??n}catch{return n}},X=(e,t=e.getWorkbook())=>n=>{if(t?.getProtection().isReadOnly())throw Error(`Cannot start an edit session on a write-protected (read-only) workbook.`);let r=ne(t,n.scope,e),i={rowIndex:n.rowIndex,colIndex:n.colIndex},o=r.getRange(i);return o.getCell().isEditAllowed()?{clean:()=>{let e=r.getRange(i).getCell();return e.isSpillOverflow()?e.createCell({value:null}):e},commit:(e,t)=>{let n=t?.broadcast?r.getSelection().getRanges():o,s=((e,t,n)=>{if(typeof t!=`string`||t.charAt(0)!==`=`||t.length<2)return t;try{let r=e.getCalculation().createFormula(t,n);r.isValid()||(r=r.autoCorrect()??r);let i=r.getExpression({canonical:!0});return i?`=`+i:t}catch{return t}})(r,e,i),c=e.replace(/\s+/g,` `),l=c.length>20?`${c.slice(0,20)}…`:c;n.setValue(s,{description:(0,a.t)(`op.typeInto`,{text:l,range:n.toString()}),autoFit:!0})}}:null},re=(e,t)=>{let n=e.getWorkbook(),r=t?.referenceMode??{getMode:G,setMode:K},i,{anchor:c,notifySessionChange:l}=((e,t,n)=>{let r=()=>{let r=n();return r?ne(t,r.getCoords().scope,e):t?.getSelectedSheet()??e},i=null,a=null,o=null,s=()=>{let e=r();e!==i&&(a?.(),i=e,a=e.getSelection().addListeners({onChange:()=>o?.()}),o?.())};return{anchor:{getCoords:()=>{let e=r();return{...e.getSelection().getCoords().cell,scope:e.getName()}},subscribe:e=>{o=e,s();let n=t?.addListeners({onSelectedSheetChange:()=>s()})??null;return()=>{a?.(),n?.(),o=null}}},notifySessionChange:s}})(e,n,()=>i?.getSession()??null);return i=new o.DefaultEditable(c,X(e,n),{revertAnchor:t=>{ne(n,t.scope,e).getSelection().clearAndModify({rowIndex:t.rowIndex,colIndex:t.colIndex})}}),i.subscribe(()=>l()),(e=>{let t=null,n=null,r=t=>{var n;t?(0,s.setEditMode)({key:`edit`,description:(n=t.getState().mode,n===`edit`?(0,a.t)(`editMode.edit`):(0,a.t)(`editMode.enter`)),args:{editable:e},onModeChange:t=>{t?.args?.editable!==e&&queueMicrotask(()=>e.cancel())}}):(0,s.setEditMode)(t=>t?.args?.editable===e?null:t)};e.subscribe(()=>{let i=e.getSession();t?.(),t=null,i&&(n=i.getState().mode,t=i.subscribe(()=>{let e=i.getState().mode;e!==n&&(n=e,r(i))})),r(i)})})(i),((e,t,n,r)=>{e.subscribe(()=>{let i=e.getSession(),a=r.getMode();if(i){if(!a){let a=ne(n,i.getCoords().scope,t).getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});r.setMode({mode:`show`,selection:a,activeInput:null,allowMulti:!0,onDone:({reason:t})=>{t===`cancel`?e.cancel():e.commit()}})}}else if(a&&(r.setMode(null),a.mode===`point`&&n)){let e=a.selection.getSheet();e&&!e.isDeleted()&&n.getSelectedSheet()!==e&&e.getSelection().getRanges().select({scrollIntoView:!0,autoFocus:!0})}})})(i,e,n,r),((e,t,n)=>{t&&t.addListeners({onSelectedSheetChange:()=>{let r=e.getSession();if(!r)return;let i=t.getSelectedSheet();i&&i.getName()!==r.getCoords().scope&&n.getMode()?.mode!==`point`&&e.commit()}})})(i,n,r),i},Z={position:`fixed`,transform:`translate(-50%, -100%)`,pointerEvents:`none`,zIndex:12e3,maxWidth:`24rem`,padding:`2px 8px`,borderRadius:`4px`,border:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`,background:`var(--sxl-color-base-100, rgb(255,255,255))`,color:`var(--sxl-color-base-content, rgb(37,36,35))`,fontFamily:`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,fontSize:`0.85em`,lineHeight:1.4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,boxShadow:`0 2px 8px rgba(0,0,0,0.18)`},ie=(e,t)=>{let n=(0,r.useRef)(!1),i=(0,r.useRef)(e);i.current=e;let a=(0,r.useRef)(t);a.current=t;let o=(0,r.useRef)(null),s=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{s.current?.()},[]);let c=(0,r.useCallback)(e=>{if(e?.button!==void 0&&e.button!==0||(o.current=e?.clientX!==void 0&&e?.clientY!==void 0?{x:e.clientX,y:e.clientY}:null,n.current))return;n.current=!0;let t=()=>{n.current=!1,s.current=null,window.removeEventListener(`pointerup`,t,!0),window.removeEventListener(`pointercancel`,t,!0),a.current?.()};s.current=t,window.addEventListener(`pointerup`,t,!0),window.addEventListener(`pointercancel`,t,!0),i.current?.()},[]),l=(0,r.useCallback)(e=>{if(n.current)return!0;let t=o.current;return!!t&&(Math.abs(e.clientX-t.x)<=3&&Math.abs(e.clientY-t.y)<=3||(o.current=null,!1))},[]);return(0,r.useMemo)(()=>({isDragging:()=>n.current,blocksHover:l,begin:c}),[l,c])},ae=e=>!!e&&e.selectionStart!==null&&e.selectionEnd!==null&&e.selectionStart!==e.selectionEnd,oe=(e,t)=>{let n=e[t]?.evalIndex;if(n===void 0)return null;let r=t,i=t;for(;r>0;){let t=e[r-1].evalIndex;if(t===void 0||t<n)break;r--}for(;i<e.length-1;){let t=e[i+1].evalIndex;if(t===void 0||t<n)break;i++}return{lo:r,hi:i,evalIndex:n}},se=(e,t,n,r,i,a)=>{if(!e||e.length===0||r>=i)return null;let o=t,s=-1,c=-1,l=t,u=t;for(let t=0;t<e.length;t++){let n=(e[t].text??``).length,a=o;o+=n,n!==0&&e[t].type!==`whitespace`&&a<i&&o>r&&(s<0&&(s=t,l=a),c=t,u=o)}if(s<0)return null;let d=null,f=null;for(let t=s;t<=c;t++){let n=oe(e,t);n&&((!f||n.evalIndex<f.evalIndex)&&(f=n),n.lo<=s&&n.hi>=c&&(!d||n.hi-n.lo<d.hi-d.lo)&&(d=n))}if(d&&d.lo===s&&d.hi===c)return{lo:s,hi:c,start:l,end:u,fragment:null,evalIndex:d.evalIndex};if(a&&l>=r&&u<=i){let e=n.slice(l,u);if(a(e))return{lo:s,hi:c,start:l,end:u,fragment:e,evalIndex:0}}let p=d??f;if(!p)return null;let m=le(e,t,p.lo,p.hi);return{lo:p.lo,hi:p.hi,start:m.start,end:m.end,fragment:null,evalIndex:p.evalIndex}},ce=e=>{if(!e)return null;let t=e.length-1;for(;t>=0&&e[t].evalIndex===void 0;)t--;return t<0?null:{lo:0,hi:t,evalIndex:0}},le=(e,t,n,r)=>{let i=t,a=t;for(let t=0;t<e.length&&(t===n&&(a=i),i+=(e[t].text??``).length,t!==r);t++);return{start:a,end:i}},ue=e=>e===`,`?{decimal:`,`,column:`;`,row:`|`}:{decimal:`.`,column:`,`,row:`;`},Q=(e,n,r)=>{if(e==null)return`0`;if(t.FormulaError.isError(e))return String(e);let i=typeof e;if(i===`number`){if(!Number.isFinite(e))return null;let t=String(e);return n.decimal===`.`?t:t.replace(`.`,n.decimal)}return i===`boolean`?e?r.t:r.f:i===`string`?`"${e.replace(/"/g,`""`)}"`:null},de=(e,n,r={t:`TRUE`,f:`FALSE`})=>{if(t.FormulaError.isError(e,t.FormulaError.Code.Parse))return null;let i=e;if(e!=null&&typeof i?.getRowCount==`function`){let e=i.getRowCount(),t=i.getColumnCount(),a=e*t;if(a===0||a>1024)return null;if(a===1)return Q(i.getValueAt(0,0),n,r);let o=[];for(let a=0;a<e;a++){let e=[];for(let o=0;o<t;o++){let t=Q(i.getValueAt(a,o),n,r);if(t===null)return null;e.push(t)}o.push(e.join(n.column))}return`{${o.join(n.row)}}`}return Q(e,n,r)},$=e=>e==null?``:(t.FormulaError.isError(e),String(e)),fe=e=>{if(e==null)return`0`;if(t.FormulaError.isError(e,t.FormulaError.Code.Parse))return null;if(t.FormulaError.isError(e))return String(e);let n=typeof e;if(n===`number`||n===`boolean`||n===`string`)return String(e);let r=e;if(typeof r?.getRowCount==`function`){let e=r.getRowCount(),t=r.getColumnCount(),n=e*t;if(n<=1)return $(r.getValueAt?.(0,0));if(n>12)return`{${e}×${t}}`;let i=[];for(let n=0;n<e;n++){let e=[];for(let i=0;i<t;i++)e.push($(r.getValueAt(n,i)));i.push(e.join(`, `))}return`{${i.join(`; `)}}`}return String(e)},pe=!1,me=()=>pe,he=(e,t,n)=>{if(e.nativeEvent.isComposing||t?.mode!==`point`)return!1;let r=t.selection;if(!r)return!1;let i=e.which===s.KeyCodes.Left?a.Direction.Left:e.which===s.KeyCodes.Right?a.Direction.Right:e.which===s.KeyCodes.Up?a.Direction.Up:e.which===s.KeyCodes.Down?a.Direction.Down:null,o=e.ctrlKey||e.metaKey,c=e.which===s.KeyCodes.Space?o&&e.shiftKey?a.AxisSelection.Both:o?a.AxisSelection.Column:e.shiftKey?a.AxisSelection.Row:null:null;if(i===null&&c===null)return!1;e.preventDefault(),e.stopPropagation();let l=r.getSheet().getName(),u=r.getCoords(),d=u.ranges??[],f=u.rangeIndex??-1;pe=!0;try{if(f<0){let e={rowStart:u.cell.rowIndex,colStart:u.cell.colIndex,rowEnd:u.cell.rowIndex,colEnd:u.cell.colIndex,scope:n};r.updateCoords({cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:n},ranges:[...d,e],rangeIndex:d.length})}else{let e=d[f];e&&(e.scope??l)!==n&&r.updateCoords({...u,ranges:d.map((e,t)=>t===f?{...e,scope:n}:e)})}}finally{pe=!1}return c===null?r.navigate(i,e.shiftKey,o):r.selectRegion({axis:c,contentOnly:!1}),!0},ge=e=>{let t=(0,r.useRef)(e);t.current=e;let[n,i]=(0,r.useState)(e.initialText??``),[a,o]=(0,r.useState)(null),[c,l]=(0,r.useState)(!1),u=(0,r.useRef)(n),d=(0,r.useRef)(n),f=(0,r.useRef)(n),p=(0,r.useRef)(!1),m=(0,r.useRef)(null),h=(0,r.useRef)(null),g=(0,r.useRef)(!1),_=(0,r.useRef)(!1),v=(0,r.useRef)(!0),y=e=>{u.current=e,i(e),g.current=!0;let n=e!==d.current;p.current=n,l(n),v.current&&t.current.onChangeText?.(e)},b=e=>{m.current=e,o(e)},x=(0,s.useCallbackRef)(e=>{let{parse:n,changeOn:r=`live`,onChange:i}=t.current,{value:a,error:o}=n(e);o?b(o):(b(null),a!==void 0&&(h.current=a,r!==`done`&&i?.(a)))},[]),S=(0,s.useCallbackRef)(e=>{let{onDone:n}=t.current;n&&(e.reason!==`cancel`&&m.current||(n(h.current,e),e.reason!==`cancel`&&(d.current=u.current,p.current=!1,l(!1))))},[]),C=e=>{y(e),b(null),x(e)},w=(0,s.useCallbackRef)(()=>{C(d.current)},[]),T=(0,s.useCallbackRef)(()=>{C(f.current)},[]),E=(0,s.useCallbackRef)((e,t)=>{d.current=e,t!==void 0&&(h.current=t);let n=g.current;v.current=!1;try{y(e)}finally{v.current=!0}g.current=n,b(null)},[]),D=(0,s.useCallbackRef)(()=>{f.current=u.current,g.current=!1},[]),O=(0,s.useCallbackRef)(()=>{_.current=!1},[]),k=(0,s.useCallbackRef)(()=>{let e=_.current;return _.current=!1,e},[]);return{text:n,error:a,dirty:c,textRef:u,committedTextRef:d,baselineTextRef:f,dirtyRef:p,errorRef:m,touchedRef:g,lastValidRef:h,setText:y,setError:b,liveChange:x,notifyDone:S,revertToCommitted:w,revertToBaseline:T,resetCommitted:E,beginSession:D,handleDoneKeys:(0,s.useCallbackRef)(e=>{let{changeOn:n=`live`,session:r}=t.current;return e.key===`Escape`?(r.isActive()&&g.current?(e.preventDefault(),e.stopPropagation(),r.end({reason:`cancel`,key:`Escape`})):!r.isActive()&&p.current&&(e.preventDefault(),e.stopPropagation(),w()),!0):e.key!==`Enter`||e.altKey||e.ctrlKey||e.metaKey?!(e.key!==`Tab`||e.altKey||e.ctrlKey||e.metaKey)&&(_.current=!0,m.current?r.isActive()?r.end({reason:`cancel`,key:`Tab`,shiftKey:e.shiftKey}):w():r.isActive()?r.end({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}):p.current&&S({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}),!0):m.current?(e.preventDefault(),e.stopPropagation(),!0):n===`done`?(e.preventDefault(),e.stopPropagation(),r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0):(_.current=!0,r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):p.current&&S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0)},[]),handleTextKeys:(0,s.useCallbackRef)(e=>!!s.Command.isCaretKey(e)&&(e.stopPropagation(),!0),[]),resetBlurGuard:O,consumeBlurGuard:k,commit:(0,s.useCallbackRef)(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`accept`}):S({reason:`accept`})},[]),cancel:(0,s.useCallbackRef)(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`cancel`}):(w(),S({reason:`cancel`}))},[])}},_e=e=>e.length>t.ICalculation.MAX_EXPRESSION_LENGTH,ve=e=>{let t=[],n=0,r=!1;for(let i=0;i<e.length;i++){let a=e[i];a===`'`?r=!r:a!==`,`||r||(t.push({text:e.slice(n,i),start:n,end:i}),n=i+1)}return t.push({text:e.slice(n),start:n,end:e.length}),t},ye=(e,t,n)=>{let r=t.trim();if(!r)return null;let i=e=>{if(!e||e.getCount()!==1)return null;let t=e.at(0),n=t.getCoords();return{rowStart:n.rowStart,colStart:n.colStart,rowEnd:n.rowEnd,colEnd:n.colEnd,scope:t.getSheet().getName()}};try{let t=n?.scope&&!r.includes(`!`)?e.getSheet(n.scope):null;return i(t?t.getRanges(r):e.getRanges(r))}catch{}try{let t=e.getSelectedSheet().getCalculation().createFormula(`=`+r,n);return t.isValid()&&t.isReferenceOnly()?i(t.getReferences()):null}catch{return null}},be=(e,t,n,r)=>{let i=t.trim();if(!i)return null;let a=!T(i);if(a&&!r)return null;try{let r=e.getSelectedSheet().getCalculation().createFormula(a?`=`+t:t,n),i=r.getTokens();if(i.length===0)return{tokens:[],ranges:[]};let o=[];try{let t=r.getReferences(),i=n?.scope??e.getSelectedSheet().getName();o=t?t.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??i}:null):[]}catch{}return{tokens:i,ranges:o}}catch{return{tokens:[],ranges:[]}}},xe=(e,t,n)=>{if(!n||!e)return t.toString();try{let r=t.getCoords(),i=t.getSheet?.()?.getName()??n;if(!r.every(e=>!e||(e.scope??i)===n))return t.toString();let a=e.getSheet(n);return a?a.getRanges(r).toString():t.toString()}catch{return t.toString()}},Se=(e,t)=>{let n=e.trim();if(!n)return e;let r=(T(n)?n.slice(E(n)):n).trim();return r?t?r:`=`+r:e},Ce=(e,t,n,r,i)=>{if(e==null)return``;let a=r?.scope??null,o=t===`formula`,s=i===`bare`;if(typeof e==`string`)return i===`literal`?e:o?Se(e,s):e;try{if(e.isICellRanges){let t=xe(n,e,a);return o?Se(t,s):t}if(!o){let t=e.getReferences();return t?xe(n,t,a):``}let t=e.getExpression();return t?Se(t,s):``}catch{return``}},we=(e,n=`formula`)=>{let{value:i,onChange:o,onChangeText:c,changeOn:l=`live`,allowMulti:u=!1,allowCrossSheet:d=!0,disabled:f=!1,onDone:p,home:m,equals:h=`optional`,pickAs:g=`relative`}=e,_=y(),v=e.workbook===void 0?_:e.workbook,b=n===`formula`,x=h!==`required`&&h!==`literal`,S=te(),[C,D]=(0,r.useState)(!1),[O,j]=(0,r.useState)(!1),M=(0,r.useRef)(null),N=(0,r.useRef)(null),P=(0,r.useRef)(!1),F=(0,r.useRef)(!1),I=(0,r.useRef)(!1),L=(0,r.useRef)(v??null);L.current=v??null;let R=(0,r.useRef)(m);R.current=m;let[z,B]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(!v)return;let e=!0;return Promise.resolve(v.whenCalculationReady()).then(()=>{e&&B(e=>e+1)}).catch(()=>{}),()=>{e=!1}},[v]);let[V]=(0,r.useState)(()=>Ce(i,n,v??null,m,h)),H=ge({initialText:V,parse:e=>se(e),changeOn:l,onChange:o,onChangeText:c,onDone:p,session:{isActive:()=>F.current,end:e=>xe(e)}}),{text:U,error:W,dirty:G,textRef:K,committedTextRef:q,baselineTextRef:ee,dirtyRef:J,errorRef:Y,lastValidRef:ne,setText:X,setError:re,liveChange:Z,notifyDone:ie}=H,ae=()=>R.current?.scope??L.current?.getSelectedSheet()?.getName()??null,oe=e=>{let t=ae();if(!t)return!0;try{return(e.getReferences()?.getCoords()??[]).every(e=>!e||(e.scope??t)===t)}catch{return!0}},se=e=>{let t=e.trim();if(!t)return{value:null,error:null};let n=L.current;if(!n)return{error:null};let r=n.getSelectedSheet().getCalculation();if(!b){if(t.startsWith(`=`))return{error:(0,a.messageKey)(`referenceInput.invalid`)};try{let e=r.createFormula(`=`+t,R.current);if(e.isValid()&&e.isReferenceOnly()&&e.getReferences())return d||oe(e)?{value:e,error:null}:{error:(0,a.messageKey)(`referenceInput.crossSheet`)}}catch{}return{error:(0,a.messageKey)(`referenceInput.invalid`)}}if(h===`required`&&!T(t))return{error:(0,a.messageKey)(`formulaInput.equalsRequired`)};if(h===`literal`&&!T(t))return{error:null};let i=T(t)?t:`=`+t;try{let e=r.createFormula(i,R.current);return e.isValid()?d||oe(e)?{value:e,error:null}:{error:(0,a.messageKey)(`referenceInput.crossSheet`)}:{error:(0,a.messageKey)(`formulaInput.invalid`)}}catch{return{error:(0,a.messageKey)(`formulaInput.invalid`)}}};(0,r.useEffect)(()=>{if(z===0)return;let e=K.current;if(!e.trim())return;if(J.current)return void Z(e);let{value:t,error:n}=se(e);re(n),t&&(ne.current=t)},[z]);let ce=_e(U),le=ce?(e=>{let n=e.slice(0,t.ICalculation.MAX_EXPRESSION_LENGTH),r=n.lastIndexOf(`,`);return`${r>0?n.slice(0,r):n}…`})(U):U,ue=(0,r.useMemo)(()=>b&&!ce&&v?be(v,U,R.current,x):null,[b,ce,v,U,z,x]),Q=b?E(U):0,de=(0,r.useMemo)(()=>ue&&ue.tokens.length!==0&&ue.tokens.map(e=>e.text??``).join(``)===U.slice(Q)?ue.tokens:null,[ue,U,Q]),$=(0,s.useCallbackRef)(()=>{let e=N.current;if(!e||!v)return;let t=K.current;if(_e(t))return;if(b){let n=be(v,t,R.current,x),r=n?.ranges??[],i=M.current?.selectionStart??t.length,o=-1;if(n){let e=E(t);for(let t of n.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&i>=e&&i<=e+n){o=t.referenceIndex;break}e+=n}o>=0&&(o>=r.length||!r[o])&&(o=-1)}let s=v.getSelectedSheet(),c={...s.getSelection().getCoords().cell,scope:s.getName()},l=r.some(Boolean)?{cell:c,ranges:r,rangeIndex:o}:{cell:c,ranges:a.CoordUtils.EmptyRanges,rangeIndex:-1};P.current=!0;try{e.updateCoords(l)}finally{P.current=!1}return}let n=t.trim()?ve(t):[],r=n.map(e=>ye(v,e.text,R.current)),i=-1;if(u){if(r.length){let e=M.current?.selectionStart??t.length,r=n.findIndex(t=>e>=t.start&&e<=t.end),a=r>=0&&!n[r].text.trim();i=r<0||a?-1:r}}else i=r.length?0:-1;i>=0&&!r[i]&&(i=-1);let o=v.getSelectedSheet(),s={...o.getSelection().getCoords().cell,scope:o.getName()};P.current=!0;try{e.updateCoords({cell:s,ranges:r,rangeIndex:i})}finally{P.current=!1}},[v,u,b]),pe=(e,t)=>{let n=L.current;if(!n)return null;let r=t?((e,t,n)=>{let r=t.trim().replace(/^=\s*/,``).trim();if(!r)return null;try{let t=e.getSelectedSheet().getCalculation().createFormula(`=`+r,n);if(!t.isValid()||!t.isReferenceOnly())return null;let i=t.getReferences()?.getCoords(),a=i?.length===1?i[0]:void 0;return a?{$rowStart:!!a.$rowStart,$colStart:!!a.$colStart,$rowEnd:!!a.$rowEnd,$colEnd:!!a.$colEnd}:null}catch{return null}})(n,t,R.current):null,i=g===`absolute`,a=R.current?.scope??null,o=e.scope??a;if(!o)return null;if(o!==a)return((e,t,n,r)=>{if(!t?.scope)return null;try{let i={rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowEnd,colEnd:t.colEnd,scope:t.scope};if(r)return e.getRanges([{...i,...r}]).toString();let a=e.getRanges([i]);return(n?a.getFixed(!0):a).toString()}catch{return null}})(n,{...e,scope:o},i,r);try{let t=n.getSheet(o);if(!t)return null;let a={rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd};if(r)return t.getRanges([{...a,...r}]).toString();let s=t.getRange(a);return(i?s.getFixed(!0):s).toString()}catch{return null}};(0,r.useEffect)(()=>{if(!C)return;let e=N.current;return e&&v?e.addListeners({onChange:()=>{if(P.current||me())return;let t=e.getCoords(),n=t.rangeIndex??-1,r=n>=0?t.ranges?.[n]:null;if(b){let e=n>=0?t.ranges?.[n]:null;if(!e)return;let r=K.current,i=M.current,a=be(v,r,R.current,x),o=a?.ranges.length??0,s=a&&n<o?k(a.tokens,n,E(r)):null,c=pe(e,s?r.slice(s.start,s.end):null);if(c==null)return;let l,u;if(a)if(n<o){if(!s)return;l=r.slice(0,s.start)+c+r.slice(s.end),u=s.start+c.length}else{let e=i?.selectionStart??r.length,t=i?.selectionEnd??r.length,n=(e>0&&!`/*^&<>=:,+-( `.includes(r[e-1])?`,`:``)+c;l=r.slice(0,e)+n+r.slice(t),u=e+n.length}else{if(r.trim())return;l=(h===`bare`?``:`=`)+c,u=l.length}X(l),Oe(!0),Z(l),requestAnimationFrame(()=>{M.current?.setSelectionRange?.(u,u),$()});return}if(!r)return;let i=K.current,a=i.trim()?ve(i):[],o=n>=0&&n<a.length&&a[n].text.trim()?a[n]:!u&&a.length===1&&a[0].text.trim()?a[0]:null,s=pe(r,o?.text??null);if(!s)return;let c,l;if(n>=0&&n<a.length&&a[n].text.trim()){let e=a[n],t=e.text.match(/^\s*/)?.[0]??``;c=i.slice(0,e.start)+t+s+i.slice(e.end),l=e.start+t.length+s.length}else if(u){let e=i.replace(/\s+$/,``);c=(e?e.endsWith(`,`)?`${e} `:`${e}, `:``)+s,l=c.length}else c=s,l=c.length;X(c),Oe(!0),Z(c),requestAnimationFrame(()=>{M.current?.setSelectionRange?.(l,l),$()})}}):void 0},[C,v,u,b,g,h,Z,$]);let xe=(0,s.useCallbackRef)(e=>{e.reason===`cancel`&&H.revertToBaseline(),Ae();let t=M.current;t&&typeof document<`u`&&document.activeElement!==t&&(I.current=!0,t.focus()),ie(e)},[ie,Z]),Se=(0,r.useRef)(null);Se.current||={insertText:e=>{let t=M.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length,i=t.value.slice(0,n)+e+t.value.slice(r);X(i),Z(i),requestAnimationFrame(()=>t.setSelectionRange(n+e.length,n+e.length))},selectAll:()=>{M.current?.select()},setSelection:e=>{M.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{M.current?.focus()},toggleReferences:()=>{let e=M.current,t=L.current;if(!e||!t||_e(K.current))return;let n=e.value,r=e.selectionStart??n.length;try{let i=t.getSelectedSheet().getCalculation();if(b){if(!T(n))return;let t=A(i,n,r,R.current);if(!t)return;X(t.value),Z(t.value),F.current&&$(),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret));return}let a=ve(n).find(e=>r>=e.start&&r<=e.end);if(!a)return;let o=(a.text.match(/^\s*/)?.[0]??``).length,s=a.text.trim();if(!s)return;let c=a.start+o,l=Math.min(Math.max(r-c,0),s.length),u=A(i,`=`+s,l+1);if(!u)return;let d=n.slice(0,c)+u.value.slice(1)+n.slice(c+s.length),f=c+(u.caret-1);X(d),Z(d),F.current&&$(),requestAnimationFrame(()=>e.setSelectionRange(f,f))}catch{}}};let we=(0,r.useRef)(!1),Te=()=>{we.current||(we.current=!0,console.warn(`[sheetxl] ${n} input has no workbook (pass the 'workbook' prop or wrap in a WorkbookProvider) — picking, select-current, and validation are disabled; the field degrades to plain text.`))},Ee=()=>{let e=K.current,t=M.current?.selectionStart??e.length;if(!e.trim())return{kind:`insert`,at:t};let n=L.current;if(n){let r=be(n,e,R.current,x);if(r){let n=E(e);for(let e=0;e<r.ranges.length;e++){if(!r.ranges[e])continue;let i=k(r.tokens,e,n);if(i&&t>=i.start&&t<=i.end)return{kind:`replace`,start:i.start,end:i.end}}}}return w(e,t)?{kind:`insert`,at:t}:null},De=()=>Ee()!==null,Oe=e=>{if(j(e),!b||!F.current)return;let t=N.current;S.setMode(n=>n&&n.selection===t&&n.mode!==(e?`point`:`show`)?{...n,mode:e?`point`:`show`}:n)},ke=(0,s.useCallbackRef)(()=>{if(f||F.current||_e(K.current))return;if(!v)return void Te();H.beginSession();let e=v.getSelectedSheet().getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});N.current=e,F.current=!0,D(!0);let t=!b||De();j(t),S.setMode({mode:t?`point`:`show`,selection:e,activeInput:Se.current,allowMulti:!!b||u,scope:d?void 0:ae()??void 0,onDone:xe}),$()},[f,v,u,d,b]),Ae=(0,s.useCallbackRef)(()=>{if(!F.current)return;F.current=!1,D(!1);let e=N.current;N.current=null,S.setMode(t=>t&&t.selection===e?null:t)},[]),je=S.getMode();(0,r.useEffect)(()=>{F.current&&N.current&&je?.selection!==N.current&&(F.current=!1,D(!1),N.current=null)},[je]),(0,r.useEffect)(()=>()=>{Ae()},[Ae]),(0,r.useEffect)(()=>{let e=Ce(i,n,L.current,R.current,h),t=i==null||typeof i==`string`||i.isICellRanges?se(e).value??null:i;H.resetCommitted(e,t),F.current&&$()},[i]);let Me=(0,s.useCallbackRef)(e=>{F.current||ke(),X(e.target.value),b?Oe(De()):l===`done`&&j(!1),Z(e.target.value),F.current&&$()},[ke,Z,$,l]),Ne=(0,s.useCallbackRef)(e=>{if(H.resetBlurGuard(),!(e.key!==`F2`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void Oe(!O);if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void Se.current?.toggleReferences();if(F.current&&O){let t=S.getMode(),n=v?.getSelectedSheet()?.getName();if(t&&n&&he(e,t,n))return}H.handleDoneKeys(e)||H.handleTextKeys(e)},[O,v]),Pe=(0,s.useCallbackRef)(e=>{H.resetBlurGuard(),I.current?I.current=!1:ke()},[ke]),Fe=(0,s.useCallbackRef)(e=>{let t=H.consumeBlurGuard(),n=e.relatedTarget;(n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)||b&&!O)&&(Ae(),!t&&J.current&&ie({reason:`accept`}))},[Ae,ie,b,O]),Ie=(0,s.useCallbackRef)(e=>{F.current&&l===`done`&&!b&&j(!1)},[l,b]),Le=(0,s.useCallbackRef)(e=>{F.current&&(b&&Oe(De()),$())},[$,b]),Re=(0,s.useCallbackRef)((e,t)=>{F.current||ke(),X(e),Z(e),F.current&&$(),t!==void 0&&requestAnimationFrame(()=>M.current?.setSelectionRange?.(t,t))},[ke,Z,$]),ze=(0,s.useCallbackRef)(()=>{F.current?xe({reason:`accept`}):(M.current?.focus(),ke())},[ke,xe]),Be=(0,s.useCallbackRef)(()=>{if(!v)return void Te();let e=v.getSelectedSheet().getSelectedRanges(),t=e?.getCount()??0;if(!t)return;if(b){let t=Ee();if(!t)return;let n=M.current,r=K.current,i=e.at(0),a=i.getCoords(),o=pe({rowStart:a.rowStart,colStart:a.colStart,rowEnd:a.rowEnd,colEnd:a.colEnd,scope:i.getSheet().getName()},t.kind===`replace`?r.slice(t.start,t.end):null);if(!o)return;let s,c;if(t.kind===`replace`)s=r.slice(0,t.start)+o+r.slice(t.end),c=t.start+o.length;else{let e=n?.selectionStart??r.length,t=n?.selectionEnd??r.length,i=(e>0&&!`/*^&<>=:,+-( `.includes(r[e-1])?`,`:``)+o;s=r.slice(0,e)+i+r.slice(t),c=e+i.length}X(s),Z(s),F.current&&$(),requestAnimationFrame(()=>n?.setSelectionRange?.(c,c));return}let n=[];for(let r=0;r<t;r++){let t=e.at(r),i=t.getCoords(),a=pe({rowStart:i.rowStart,colStart:i.colStart,rowEnd:i.rowEnd,colEnd:i.colEnd,scope:t.getSheet().getName()});a&&n.push(a)}if(!n.length)return;let r=u?n.join(`, `):n[0];X(r),Z(r),F.current&&$()},[v,u,b,g,Z,$]),Ve=(0,s.useCallbackRef)(()=>{H.revertToCommitted(),F.current&&$()},[$]),He=(0,r.useMemo)(()=>b||ce||!U.trim()||!v?[]:ve(U).map(e=>({text:e.text,start:e.start,end:e.end,valid:!!ye(v,e.text,R.current)})),[b,ce,U,v,z]),Ue=(0,s.useCallbackRef)(async e=>{let t=v,n=He[e]?.text.trim();if(!t||!n)return null;try{return fe(await t.getSelectedSheet().getCalculation().createFormula(`=`+n).evaluate())}catch{return null}},[v,He]),We=(0,s.useCallbackRef)(()=>{try{return ne.current?.getReferences()??null}catch{return null}},[]);return{inputProps:{value:le,readOnly:ce,onChange:Me,onKeyDown:Ne,onFocus:Pe,onBlur:Fe,onMouseDown:Ie,onSelect:Le,ref:e=>{M.current=e}},text:U,overLength:ce,segments:He,tokens:de,tokenBase:Q,error:W,dirty:G,engaged:C,pointArmed:O,togglePoint:ze,engage:ke,replaceText:Re,selectCurrent:Be,canSelectCurrent:!b||De(),revert:Ve,commit:H.commit,cancel:H.cancel,getRanges:We,evaluateSegment:Ue}},Te={function:`Function`,named:`NamedRange`,table:`Table`},Ee=8,De=e=>{let{items:t,selectedIndex:n,selectedSummary:a,onSelect:o,onHighlight:c,maxVisibleRows:l=Ee}=e,u=(0,r.useRef)(null);return(0,r.useLayoutEffect)(()=>{(u.current?.children[n])?.scrollIntoView?.({block:`nearest`})},[n]),t.length===0?null:(0,i.jsx)(`div`,{ref:u,role:`listbox`,style:{maxHeight:22*l,overflowY:`auto`,width:`20rem`,padding:`2px 0`,fontFamily:`var(--sxl-font-family)`,fontSize:12,lineHeight:1.5,color:`var(--sxl-color-base-content, rgb(37,36,35))`},children:t.map((e,t)=>{let r=t===n;return(0,i.jsxs)(`div`,{role:`option`,"aria-selected":r,onMouseDown:n=>{n.preventDefault(),o(e,t)},onMouseMove:()=>{r||c?.(t)},style:{cursor:`pointer`,background:r?`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`:`transparent`},children:[(0,i.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:22,padding:`0 10px`},children:[(0,i.jsx)(s.DynamicIcon,{iconKey:e.iconKey??Te[e.kind??`function`],size:16,style:{color:`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,flex:`0 0 auto`}}),(0,i.jsx)(`span`,{style:{fontWeight:600,color:`var(--sxl-color-primary, rgb(33,115,70))`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name}),e.category&&(0,i.jsx)(`span`,{style:{marginLeft:`auto`,flex:`0 0 auto`,color:`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`},children:e.category})]}),r&&a&&(0,i.jsx)(`div`,{title:a,style:{padding:`0 10px 4px 34px`,fontSize:11,lineHeight:`14px`,color:`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:a})]},e.name)})})};De.displayName=`NamedItemsPanel`;var Oe=e=>{let t=/(\d+)$/.exec(e);return t?{base:e.slice(0,-t[1].length),n:parseInt(t[1],10)}:{base:e,n:1}},ke=e=>!!e&&e.trim()!==``,Ae=`var(--sxl-color-base-content, rgb(37,36,35))`,je=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,Me=`var(--sxl-color-primary, rgb(33,115,70))`,Ne=`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,Pe=`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif)`,Fe={color:Me,fontWeight:700},Ie=[],Le=(e,t)=>{let n=e.length?Math.min(t,e.length-1):-1,r=[];return e.forEach((e,i)=>{let a=e.getName(),o=e.getRepeatingTypes();if(o){let e=o.length,{base:s,n:c}=Oe(a),l=Math.max(0,t-i),u=c+Math.floor(l/e),d=i===n?l%e:-1,f=(t,n)=>{let r=`${e===1?s:t.getName()}${n}`;return n>c||t.isOptional()?`[${r}]`:r};o.forEach((t,n)=>{r.push({key:`${i}s${n}`,param:t,descKey:e===1?a:`${a}.${t.getName()}`,isRepeat:!1,optional:u>c||t.isOptional(),active:n===d,label:f(t,u),ellipsisBefore:n===0&&u>c})}),r.push({key:`${i}next`,param:o[0],descKey:e===1?a:`${a}.${o[0].getName()}`,isRepeat:!0,optional:!0,active:!1,label:`[${e===1?s:o[0].getName()}${u+1}]`,ellipsisAfter:!0});return}if(e.isRest()){let{base:o,n:s}=Oe(a),c=s+Math.max(0,t-i),l=i===n,u=c>s;r.push({key:`${i}a`,param:e,descKey:a,isRepeat:!1,optional:u,active:l,label:u?`[${o}${c}]`:`${o}${c}`,ellipsisBefore:c>s}),r.push({key:`${i}b`,param:e,descKey:a,isRepeat:!0,optional:!0,active:!1,label:`[${o}${c+1}]`,ellipsisAfter:!0})}else{let t=e.isOptional();r.push({key:`${i}`,label:t?`[${a}]`:a,param:e,descKey:a,isRepeat:!1,optional:t,active:i===n})}}),r},Re=e=>(0,i.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,onMouseDown:e=>e.preventDefault(),onClick:e.onClick,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,padding:0,border:`none`,borderRadius:4,background:`transparent`,color:je,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:e.children}),ze=({up:e})=>(0,i.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,i.jsx)(`path`,{d:e?`M2.5 7.5 L6 4 L9.5 7.5`:`M2.5 4.5 L6 8 L9.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Be=()=>(0,i.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,i.jsx)(`path`,{d:`M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})}),Ve={number:(0,a.messageKey)(`functionPreview.typeName.number`),string:(0,a.messageKey)(`functionPreview.typeName.string`),boolean:(0,a.messageKey)(`functionPreview.typeName.boolean`),error:(0,a.messageKey)(`functionPreview.typeName.error`),richData:(0,a.messageKey)(`functionPreview.typeName.richData`),null:(0,a.messageKey)(`functionPreview.typeName.null`)},He=e=>{let t=e.getScalarType();return t&&t!==`*`?Ve[t]:(0,a.messageKey)(`functionPreview.anyValue`)},Ue=e=>{let{param:t,repeat:n=!1,optional:r=!1,showType:a=!0,size:o=15,style:c}=e,l=(0,s.useTranslator)(),u=He(t),d=u===`functionPreview.anyValue`?l(u):l(`functionPreview.type`,{type:l(u)}),f={color:je};return(0,i.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:3,flex:`0 0 auto`,...c},children:[n&&(0,i.jsx)(s.DynamicIcon,{iconKey:`Repeat`,title:l(`functionPreview.repeatable`),size:o,style:f}),r&&(0,i.jsx)(s.DynamicIcon,{iconKey:`DataArray`,title:l(`functionPreview.optional`),size:o,style:f}),a&&(0,i.jsx)(s.DynamicIcon,{iconKey:`DataObject`,title:d,size:o,style:f})]})};Ue.displayName=`FunctionArgIcons`;var We=({hint:e,wrap:t=!1})=>{let n=Le(e.params,e.argIndex),a=e.argSeparator??`,`,o=[];for(let e of n)e.ellipsisBefore&&o.push({key:`${e.key}-lead`,text:`…`,active:!1}),o.push({key:e.key,text:e.label,active:e.active}),e.ellipsisAfter&&o.push({key:`${e.key}-trail`,text:`…`,active:!1});return(0,i.jsxs)(`span`,{style:{whiteSpace:t?`normal`:`nowrap`,fontFamily:Ne,cursor:`default`},children:[(0,i.jsx)(`span`,{style:{fontWeight:600,color:Me},children:e.nameLocal??e.name}),`(`,o.map((e,t)=>(0,i.jsxs)(r.default.Fragment,{children:[t>0?(0,i.jsx)(`span`,{style:{color:je},children:`${a} `}):null,(0,i.jsx)(`span`,{style:e.active?Fe:{color:je},children:e.text})]},e.key)),`)`]})};We.displayName=`FunctionSignature`;var Ge=({hint:e,descriptor:t,showParameters:n=!0})=>{let{name:r,argIndex:a,params:o}=e,s=n?Le(o,a):Ie,c=t?.name===r,l=c?t.summary:void 0;return l||s.length!==0?(0,i.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,padding:`8px 10px 10px`,fontFamily:Pe},children:[l&&(0,i.jsx)(`div`,{style:{color:Ae},children:l}),s.length>0&&(0,i.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:s.map(e=>{let n=(e=>c?t.params?.[e.descKey]?.description:void 0)(e);return(0,i.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:1,opacity:e.active?1:.6},children:[(0,i.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,i.jsx)(`span`,{style:{fontFamily:Ne,fontWeight:e.active?700:600,color:e.active?Me:Ae,whiteSpace:`nowrap`},children:e.label}),(0,i.jsx)(Ue,{param:e.param,repeat:e.isRepeat,optional:e.optional,style:{marginLeft:`auto`}})]}),n&&(0,i.jsx)(`div`,{style:{color:je},children:n})]},e.key)})})]}):null};Ge.displayName=`FunctionPreviewContent`;var Ke=e=>{let{hint:t,collapsed:n,onToggle:r,onClose:a}=e,o=(0,s.useTranslator)(),c=o(n?`functionPreview.expand`:`functionPreview.collapse`);return(0,i.jsxs)(`div`,{role:`button`,"aria-expanded":!n,onMouseDown:e=>e.preventDefault(),onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 6px 5px 10px`,cursor:`pointer`,borderBottom:n?`none`:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`},children:[(0,i.jsx)(`div`,{style:{flex:1,minWidth:0,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:(0,i.jsx)(We,{hint:t})}),(0,i.jsx)(Re,{label:c,onClick:e=>{e.stopPropagation(),r()},children:(0,i.jsx)(ze,{up:!n})}),a&&(0,i.jsx)(Re,{label:o(`functionPreview.close`),onClick:e=>{e.stopPropagation(),a()},children:(0,i.jsx)(Be,{})})]})};Ke.displayName=`FunctionPreviewHeader`;var qe=e=>{let{hint:t,descriptor:n,onClose:r}=e,[a,o]=(0,s.usePersistenceState)(`editor.functionPreview.collapsed`,!1);return(0,i.jsxs)(`div`,{style:{minWidth:300,maxWidth:460,fontFamily:Pe,fontSize:12,lineHeight:`16px`,color:Ae},children:[(0,i.jsx)(Ke,{hint:t,collapsed:a,onToggle:()=>o(e=>!e),onClose:r}),(0,i.jsx)(`div`,{style:{display:`grid`,gridTemplateRows:a?`0fr`:`1fr`,transition:`grid-template-rows 160ms ease`},children:(0,i.jsx)(`div`,{style:{overflow:`hidden`,minHeight:0},children:(0,i.jsx)(Ge,{hint:t,descriptor:n})})})]})};qe.displayName=`FunctionPreviewPanel`;var Je=e=>{let{list:t,preview:n}=e;return t&&t.items.length>0?(0,i.jsx)(De,{items:t.items,selectedIndex:t.selectedIndex,selectedSummary:t.selectedSummary,onSelect:t.onSelect,onHighlight:t.onHighlight}):n?(0,i.jsx)(qe,{hint:n.hint,descriptor:n.descriptor}):null};Je.displayName=`NamedHintPanel`;var Ye=(e,t,n=1)=>{let r=n;for(let n of e){let e=(n.text??``).length;if(e>0&&t>r&&t<=r+e)return{token:n,start:r};r+=e}return null},Xe=(e,t,n=1)=>{let r=n;for(let n of e){let e=(n.text??``).length;if(e>0&&t>r&&t<=r+e)return n.type===`function`?{name:n.value,argIndex:0}:n.type===`paren`&&n.text===`)`||n.context?.type===`table`?null:n.type===`separator`&&n.context?.name?{name:n.context.name,argIndex:n.context.argIndex+1}:n.context?.name?{name:n.context.name,argIndex:Math.max(0,n.context.argIndex)}:null;r+=e}return null},Ze=e=>{let n=(0,r.useRef)(e);n.current=e;let[a,o]=(0,r.useState)(null),[c,l]=(0,r.useState)(null),[u,d]=(0,r.useState)([]),[f,p]=(0,r.useState)(0),m=(0,r.useRef)(null),[h,g]=(0,r.useState)(null),_=(0,r.useRef)(u);_.current=u;let v=(0,r.useRef)(null),y=(e,t,n)=>{if(v.current!==null){if(v.current===e.text)return null;v.current=null}return((e,t,n,r)=>{let i=Ye(e,t,n);if(!i||!i.token.isLookup)return null;let a=i.start+(i.token.text??``).length;return r[a]===`(`?null:{start:i.start,end:a}})(t,n,E(e.text),e.text)},b=(0,s.useCallbackRef)(()=>{let e=n.current,r=e.active?e.getCalculation():null,i=e.getTokens();if(!e.active||!i||!r)return void o(null);let a=e.getCaret(),s=E(e.text);if(y(e,i,a))return void o(null);let c=Xe(i,a,s),l=c?r.getFunctions().getByName(c.name):null;if(!l||!c)return void o(null);let u=l.getName(),d=(0,t.getLanguagePack)()?.functions?.[u]??u,f=(0,t.getLocaleProfile)(e.getLocale()??`en`).listSeparator,p=c.argIndex;o(e=>e&&e.name===u&&e.argIndex===p?e:{name:u,nameLocal:d,argSeparator:f,argIndex:p,params:l.getDeclaration().getParameters()})},[]),x=(0,s.useCallbackRef)(()=>{let e=n.current,r=()=>{m.current=null,_.current.length&&d([])},i=e.active?e.getCalculation():null,a=e.getTokens();if(!e.active||!a||!i)return void r();let o=e.getCaret(),s=y(e,a,o);if(!s)return void r();let c=((e,n,r)=>{let i=n.toUpperCase(),a=[];try{let n=(0,t.getLanguagePack)()?.functions,r=e=>n?.[e]??e;a=e.getFunctions().getItems().map(e=>({name:r(e.getName()),canonical:e.getName()})).filter(e=>e.name.toUpperCase().startsWith(i)||e.canonical.toUpperCase().startsWith(i)).map(e=>({name:e.name,kind:`function`})).sort((e,t)=>e.name.localeCompare(t.name)).slice(0,50)}catch{a=[]}try{let e=r?.getItems()??[],t=new Set(a.map(e=>e.name.toUpperCase()));for(let n of e){let e=n.getName();e.toUpperCase().startsWith(i)&&(t.has(e.toUpperCase())||a.push({name:e,kind:n.getType()===`table`?`table`:`named`}))}}catch{}return a.sort((e,t)=>e.name.localeCompare(t.name))})(i,e.text.slice(s.start,o),e.getNames?.()??null);if(c.length===0)return void r();m.current=s;let l=_.current;(l.length!==c.length||l.some((e,t)=>e.name!==c[t].name))&&(d(c),p(0))},[]),S=(0,s.useCallbackRef)(()=>{b(),x()},[]),C=(0,s.useCallbackRef)(e=>{let t=n.current,r=m.current;if(!r)return;let i=t.text,a=(e.kind??`function`)===`function`,o=i[r.end]===`(`,s=e.name+(a&&!o?`(`:``),c=i.slice(0,r.start)+s+i.slice(r.end),l=r.start+(a?e.name.length+1:s.length);d([]),v.current=c,t.applyText(c,l)},[]),w=(0,s.useCallbackRef)(e=>{let t=_.current.length;if(t===0)return!1;switch(e.which){case s.KeyCodes.Down:return e.preventDefault(),e.stopPropagation(),p(e=>(e+1)%t),!0;case s.KeyCodes.Up:return e.preventDefault(),e.stopPropagation(),p(e=>(e-1+t)%t),!0;case s.KeyCodes.Enter:case s.KeyCodes.Tab:return e.preventDefault(),e.stopPropagation(),C(_.current[Math.min(T.current,t-1)]),!0;case s.KeyCodes.Escape:return e.preventDefault(),e.stopPropagation(),m.current=null,d([]),!0;default:return!1}},[]),T=(0,r.useRef)(f);T.current=f;let D=(0,s.useCallbackRef)(()=>{m.current=null,v.current=null,_.current.length&&d([]),o(null)},[]),O=(0,r.useCallback)(()=>{let e=n.current,t=e.getCaret(),r=e.getTokens();if(!r)return t;let i=E(e.text);if(_.current.length>0){let e=Ye(r,t,i);return e?e.start:t}let a=((e,t,n)=>{let r=n,i=[],a=null;for(let n of e){if(r>=t)break;let e=r;n.type===`function`?a=e:n.type===`paren`&&n.text===`(`?(i.push(a??-1),a=null):(n.type===`paren`&&n.text===`)`&&i.pop(),a=null),r=e+(n.text??``).length}for(let e=i.length-1;e>=0;e--)if(i[e]>=0)return i[e];return null})(r,t,i);if(a!==null)return a;let o=Ye(r,t,i);return o?o.start:t},[]),k=a?.name??null;(0,r.useEffect)(()=>{if(!k)return void l(null);let e=!1;return(n.current.getCalculation()?.getFunctions().getByName(k))?.getDescriptor().then(t=>{e||l({name:k,summary:t.getSummary(),params:t.getParameters()})}).catch(()=>{e||l(null)}),()=>{e=!0}},[k]);let A=u[f]??null,j=A?.name??null,M=A?.kind??`function`;(0,r.useEffect)(()=>{if(!j)return void g(null);if(M!==`function`){let e=n.current.getNames?.()?.getItems()??[];g((e=>{if(!e)return null;let t=e.getComment?.();if(t)return t;try{let t=e.getRanges?.()?.toString();if(t)return t}catch{}let n=e.getValue?.();return typeof n==`string`?n:null})(e.find(e=>e.getName()===j)??null));return}let e=!1;return(n.current.getCalculation()?.getFunctions().getByName(j))?.getDescriptor().then(t=>{e||g(t.getSummary())}).catch(()=>{e||g(null)}),()=>{e=!0}},[j,M]);let{hoveredTokenIndex:N,text:P}=e,F=(0,r.useCallback)(()=>{let e=u.length>0?{items:u,selectedIndex:f,selectedSummary:h??void 0,onSelect:C,onHighlight:p}:null,t=n.current.getTokens(),r=N!=null&&t&&a?((e,t,n,r)=>{if(t<0||t>=e.length)return null;let i=n;for(let n=0;n<=t;n++)i+=(e[n].text??``).length;let a=Xe(e,i,n);return a&&a.name===r?a.argIndex:null})(t,N,E(P),a.name):null,o=a?{hint:r===null?a:{...a,argIndex:r},descriptor:c}:null;return e||o?(0,i.jsx)(Je,{list:e,preview:o}):null},[u,f,h,a,c,C,N,P]);return{active:!!a||u.length>0,update:S,handleKeyDown:w,dismiss:D,getAnchorOffset:O,renderPanel:F}},Qe=`0.6em`,$e=`calc(${Qe} + 1px)`,et=()=>{let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=requestAnimationFrame(()=>t(!0));return()=>cancelAnimationFrame(e)},[]),(0,i.jsx)(`span`,{"aria-hidden":!0,style:{display:`inline-block`,width:0,overflow:`visible`,verticalAlign:`baseline`},children:(0,i.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`baseline`,width:Qe,margin:`0 0 -1px 1px`,opacity:e?.6:0,transition:`opacity 0.2s ease-out`},children:(0,i.jsx)(`svg`,{viewBox:`0 0 10 3`,width:`100%`,style:{display:`block`,overflow:`visible`},children:(0,i.jsx)(`path`,{d:`M1.5 0.5v2h8v-2`,fill:`none`,stroke:`#a3a3a3`,strokeWidth:1,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`})})})})},tt=new Set([`number`,`string`,`boolean`]),nt=`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 45%, transparent)`,rt={backgroundColor:s.INPUT_SELECTION_TINT,borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${nt}`},it={borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${nt}`},at=[`#0431fa`,`#319331`,`#7b3814`],ot=[`#ffd700`,`#da70d6`,`#179fff`],st=e=>{let t=e%at.length;return`light-dark(${at[t]}, ${ot[t]})`},ct={display:`inline-block`,width:0,overflow:`visible`,whiteSpace:`pre`},lt=e=>({display:`inline-block`,transform:`scale(1.15)`,transformOrigin:`center 78%`,opacity:.7,fontWeight:700,color:e}),ut=`var(--sxl-color-error, #d93025)`,dt={matchOf:new Map,depthOf:new Map,unmatched:new Set},ft=e=>{if(!e)return dt;let t=new Map,n=new Map,r=new Set,i=[];return e.forEach((e,a)=>{if(e.type===`paren`){if(e.text===`(`)n.set(a,i.length),i.push(a);else if(e.text===`)`){let e=i.pop();e===void 0?r.add(a):(t.set(a,e),t.set(e,a),n.set(a,n.get(e)))}}}),{matchOf:t,depthOf:n,unmatched:r}},pt=(e,t,n,r)=>{let i=r,a=-1,o=-1;for(let t=0;t<e.length;t++){let r=e[t],s=(r.text??``).length;r.type!==`paren`||r.text!==`(`&&r.text!==`)`||(n===i+s?a=t:n===i&&(o=t)),i+=s}let s=a>=0?a:o;if(s<0)return null;let c=t.get(s);return c===void 0?null:s<c?[s,c]:[c,s]},mt=(e,t)=>e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1],ht=(e,t,n)=>{let r=new Set;if(e){let t=1/0;for(let r=e.lo;r<=e.hi;r++){let e=n.depthOf.get(r);e!==void 0&&e<t&&(t=e)}if(t===1/0)return r;for(let i=e.lo;i<=e.hi;i++){if(n.depthOf.get(i)!==t)continue;let a=n.matchOf.get(i);if(!(a===void 0||a<e.lo||a>e.hi)){r.add(i),r.add(a);break}}return r}return t&&(r.add(t[0]),r.add(t[1])),r},gt={placement:`bottom-start`,followAnchor:!0},_t=(e,n,r)=>{let i=e.getSheet(),a=i.getRange(n).toString();return r&&r!==i.getName()?t.AddressUtils.sheetAndRangeToString(t.AddressUtils.sheetNameToString(r),a):a},vt=(e,t)=>{try{let n={rowStart:t.rowStart,rowEnd:t.rowEnd,colStart:t.colStart,colEnd:t.colEnd,scope:t.scope};return e.getSheet().getNames().getByRanges([n],{includeParts:!0})[0]??null}catch{return null}},yt=e=>{let{selection:n,fillNone:l}=e,u=e=>{let{open:u,mode:d,clean:f,dirty:p,token:m,autoFocus:h,initialSelection:g,zoom:_,cellSize:v,readOnly:y,onDirtyChange:b,onModeChange:x,onCommit:S,onCancel:C,onNaturalSize:j,editable:M,placeholder:N,maxContentWidth:P,lineHeight:F}=e,I=f?f():null,L=p??(I?(e=>{let t=e.getFormulaText();if(t)return`=`+t;let n=e.getText({useFormattingCategory:!0})??``;return e.getStyle().getQuotePrefix()?`'`+n:n})(I):``),R=T(L),z=E(L),B=(0,r.useRef)(null),V=(0,r.useRef)(null),H=(0,o.usePendingCaret)(B,L),U=(0,r.useRef)(I);U.current=I;let[W,G]=(0,r.useState)(!1),[K,q]=(0,r.useState)(0),[ee,J]=(0,r.useState)(void 0),[Y,ne]=(0,r.useState)(null),[X,re]=(0,r.useState)(0),Q=(0,r.useRef)(null),$=(0,r.useRef)(null),pe=(0,r.useRef)(!1),ge=(0,r.useRef)(null),_e=te(),ve=_e.getMode(),ye=ve?.dragging??!1,be=ve?.draggingIndex??null,[xe,Se]=(0,r.useState)(null),[Ce,we]=(0,r.useState)(null),Te=(0,r.useRef)(null),Ee=(0,r.useRef)(xe);Ee.current=xe;let De=I?.getType(),Oe=(De===t.ScalarType.Number||De===t.ScalarType.Null)&&I.getStyle().getNumberFormat().includes(`%`),ke=e=>{if(!Oe)return null;let t=e.replace(/%/g,``);return t.length===0||isNaN(Number(t))?null:{value:t+`%`,caret:t.length}},Ae=(0,r.useRef)(0);(0,r.useLayoutEffect)(()=>{if(!u||!h)return;let e=B.current;if(!e||(e.focus(),Ae.current===m))return;Ae.current=m;let t=ke(L);if(t&&t.value!==L)return H(t.caret),void b(t.value);let n=e.value.length,r=_e.getMode()?.selection?.getCoords()?.rangeIndex??-1,i=r>=0&&jt?k(jt.tokens,r,z):null,a=i?{start:i.end,end:i.end,direction:`forward`}:g??{start:n,end:n,direction:`forward`};e.setSelectionRange(a.start,a.end,a.direction)},[m,u,h]);let je=I?I.getStyle():null,Me=je?je.getFont():null,Ne=Me?Me.toCSS(`adaptive`,_):{},Pe=Me?Me.toCSS(`adaptive`,1):{};l&&(Pe.color=`inherit`,Pe.fontStyle=`inherit`,Pe.fontWeight=`inherit`,Pe.textDecoration=`inherit`,Ne.color=`inherit`,Ne.fontStyle=`inherit`,Ne.fontWeight=`inherit`,Ne.textDecoration=`inherit`);let Fe=(I&&L[0]!==`=`?t.ITextFrame.toCSSHorizontalTextAlign(I.getRenderHorizontalAlignment()):`left`)??`left`,Ie=je?.getAlignment(),Le=Ie?.getOverflow()===t.ITextFrame.Overflow.Wrap,Re=Ie?(e=>{switch(e){case t.ITextFrame.VerticalAlignment.Center:return`center`;case t.ITextFrame.VerticalAlignment.Bottom:return`flex-end`;default:return`flex-start`}})(Ie.getVertical()):`flex-start`,ze=!!v,Be=(Le||!ze)&&!R,Ve=R,He=ze&&I&&v?I.getTextPlacement(v):null,Ue=I?I.getInsets():null,We=He?.lineHeight??F,Ge=W?Math.min(X,L.length):L.length,Ke=R&&w(L,Ge),qe=Ke&&Ge>=L.length;(0,r.useLayoutEffect)(()=>{let e=Ue?Ue.left+Ue.right:4,t,n;if(Be){let e=B.current;if(!e)return;let r=e.style.height;e.style.height=`auto`,n=e.scrollHeight/_,e.style.height=r,t=0}else{let r=V.current;if(!r)return;n=r.offsetHeight,t=r.offsetWidth+e}q(n),j?.({width:t,height:n})},[L,Be,_,j,Ue?.left,Ue?.right,Ve,P,qe]);let Je=(0,o.useEditorKeymap)({mode:d,value:L,onDirtyChange:b,onModeChange:x,onCommit:S,onCancel:C,onNavigate:e=>{n.navigate(e)},onTraverse:(e,t)=>{n.traverse(e,t)},setCaret:H}),Ye=(0,r.useRef)(b);Ye.current=b;let Xe=(0,r.useRef)(null);Xe.current||={insertText:e=>{let t=B.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length;Ye.current(t.value.slice(0,n)+e+t.value.slice(r));let i=n+e.length;requestAnimationFrame(()=>t.setSelectionRange(i,i))},selectAll:()=>{B.current?.select()},setSelection:e=>{B.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{B.current?.focus()},toggleReferences:()=>{let e=B.current,t=U.current;if(!e||!t)return;let n=e.value,r=e.selectionStart??n.length,i=A(t.getSheet().getCalculation(),n,r,Tt(t));i&&(Ye.current(i.value),requestAnimationFrame(()=>e.setSelectionRange(i.caret,i.caret)))}};let Qe=Ze({text:L,getTokens:()=>Mt.current?.tokens??null,active:W,getCaret:()=>B.current?.selectionStart??B.current?.value.length??0,getCalculation:()=>U.current?.getSheet().getCalculation()??null,getNames:()=>U.current?.getSheet().getNames()??null,getLocale:()=>U.current?.getSheet().getWorkbook()?.getLocale()??null,applyText:(e,t)=>{Ye.current(e),requestAnimationFrame(()=>B.current?.setSelectionRange(t,t))},hoveredTokenIndex:xe?.ti??null}),{caretAnchor:nt}=(0,s.useTextareaCaretRect)(B),at=(0,r.useMemo)(()=>nt(Qe.getAnchorOffset,0),[nt,Qe.getAnchorOffset]),ot=(0,r.useRef)(null),dt=(0,r.useCallback)(e=>!!ot.current?.contains(e),[]),yt=(0,s.useFloatStack)({label:`formula-editor-hint`,anchor:at,autoFocus:!1,disableClickAway:dt,propsPopper:gt,createPopupPanel:Qe.renderPanel}),bt=yt.reference,xt=Qe.active&&!_e.getMode()?.dragging;(0,r.useEffect)(()=>{xt?bt.open(0):bt.close(0)},[xt,bt]);let St=(0,s.useEditMode)(),Ct=(0,r.useRef)(St);Ct.current=St;let wt=()=>{if(M)return M.getSession();let e=Ct.current.getMode();return e?.key===`edit`?e.args.editable.getSession():null},Tt=e=>({...e.getCoords(),scope:wt()?.getCoords().scope??e.getSheet().getName()}),Et=_e.getMode(),Dt=Et?.selection??null,Ot=!!Et&&Et.activeInput===Xe.current;(0,r.useEffect)(()=>{if(u)return wt()?.registerEditor(Xe.current)},[u,m]),(0,r.useEffect)(()=>{W&&wt()?.setActiveEditor(Xe.current)},[W,u,m]);let kt=ze?{position:`absolute`,left:(Ue?.left??0)*_,top:(Ue?.top??0)*_,right:(Ue?.right??0)*_,bottom:(Ue?.bottom??0)*_,display:`flex`,flexDirection:`column`,justifyContent:Re}:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,justifyContent:`flex-start`},At=(0,r.useRef)(null),jt=(0,r.useMemo)(()=>{let e=U.current;if(!e||!R)return null;try{let t=e.getSheet().getCalculation().createFormula(L,Tt(e)),n=t.getTokens();if(n.length===0)return{tokens:[],ranges:[],valid:!1};let r=[];try{let n=t.getReferences(),i=wt()?.getCoords().scope??e.getSheet().getName();r=n?n.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??i}:null):[]}catch{}return{tokens:n,ranges:r,valid:t.isValid()}}catch{return{tokens:[],ranges:[],valid:!1}}},[L]),Mt=(0,r.useRef)(jt);Mt.current=jt;let Nt=(0,r.useMemo)(()=>jt&&jt.tokens.map(e=>e.text??``).join(``)===L.slice(z)?jt.tokens:null,[jt,L,z]),Pt=!!Nt,Ft=(0,r.useMemo)(()=>ft(Nt??null),[Nt]),It=(0,r.useMemo)(()=>ht(xe?{lo:xe.lo,hi:xe.hi}:null,Y,Ft),[Y,xe,Ft]),Lt=(0,s.useCallbackRef)(()=>{let e=B.current?.selectionStart??L.length;re(e);let t=Nt;if(!t)return J(void 0),void ne(null);let n=E(L),r=O(t,e,n);J(r>=0?D(t[r]):void 0);let i=W?pt(t,Ft.matchOf,e,n):null;ne(e=>mt(e,i)?e:i)},[Nt,L,W,Ft]);(0,r.useEffect)(()=>{Lt()},[Lt,Nt,W]);let Rt=(0,s.useCallbackRef)(()=>{Te.current=null,Se(null)},[]),zt=(0,s.useCallbackRef)(()=>{Ee.current?.fromSelection||Rt()},[]),Bt=ie(()=>Rt(),()=>Ut()),Vt=(0,s.useCallbackRef)(e=>{let t=At.current;if(!Pt||!jt||!t)return void Rt();if(Bt.blocksHover(e)||ae(B.current))return void zt();let n=e.clientX,r=e.clientY,i=t.querySelectorAll(`[data-ti]`),a=-1,o=null;for(let e=0;e<i.length;e++){let t=i[e].getBoundingClientRect();if(n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom){a=Number(i[e].getAttribute(`data-ti`)),o=t;break}}let s=jt.tokens;if(a<0){let e=t.querySelector(`[data-eq]`),i=e?.getBoundingClientRect();if(!e||!i||n<i.left||n>i.right||r<i.top||r>i.bottom)return void Rt();let a=ce(s);if(!a)return void Rt();let o=a.hi;if(Te.current===`root`)return;Te.current=`root`;let c=t.querySelector(`[data-ti="${o}"]`)?.getBoundingClientRect(),l=c&&Math.abs(c.top-i.top)<1?{left:i.left,right:c.right,top:i.top}:{left:i.left,right:i.right,top:i.top};Se({rect:l,evalIndex:0,ti:-1,lo:0,hi:o,overEq:!0});return}let c=s[a];if(!c||c.type===`whitespace`)return void Rt();let l=oe(s,a);if(!l){if(tt.has(c.type)&&c.text){let e=`literal:${a}`;if(e===Te.current)return;if(Te.current=e,!o)return void Rt();let t={left:o.left,right:o.right,top:o.top};Se({rect:t,evalIndex:-1,ti:a,lo:a,hi:a,literal:c.text})}else Rt();return}let u=`${l.evalIndex}:${l.lo}:${l.hi}`;if(u===Te.current)return;Te.current=u;let d=t.querySelector(`[data-ti="${l.lo}"]`),f=t.querySelector(`[data-ti="${l.hi}"]`),p=d?.getBoundingClientRect(),m=f?.getBoundingClientRect(),h=p&&m&&Math.abs(m.top-p.top)<1?{left:p.left,right:m.right,top:p.top}:o?{left:o.left,right:o.right,top:o.top}:null;h?Se({rect:h,evalIndex:l.evalIndex,ti:a,lo:l.lo,hi:l.hi}):Rt()},[Pt,jt]),Ht=(0,s.useCallbackRef)(e=>{let t=U.current;if(!t)return!1;try{return t.getSheet().getCalculation().createFormula(`=`+e,Tt(t)).isValid()}catch{return!1}},[]),Ut=(0,s.useCallbackRef)(()=>{let e=()=>{Ee.current?.fromSelection&&Rt()},t=B.current,n=At.current;if(!(t&&n&&Pt&&jt&&W))return void e();if(Bt.isDragging())return;let r=t.selectionStart??0,i=t.selectionEnd??0;if(r===i)return void e();let a=se(jt.tokens,z,L,r,i,Ht);if(!a)return void e();let o=`sel:${a.lo}:${a.hi}:${a.fragment??a.evalIndex}`;if(o===Te.current)return;Te.current=o;let s=n.querySelector(`[data-ti="${a.lo}"]`)?.getBoundingClientRect(),c=n.querySelector(`[data-ti="${a.hi}"]`)?.getBoundingClientRect(),l=s&&c&&Math.abs(c.top-s.top)<1?{left:s.left,right:c.right,top:s.top}:s?{left:s.left,right:s.right,top:s.top}:null;l?Se({rect:l,ti:-1,lo:a.lo,hi:a.hi,fromSelection:!0,evalIndex:a.fragment===null?a.evalIndex:-1,literal:a.fragment??void 0}):Rt()},[Pt,jt,z,L,W]);(0,r.useEffect)(()=>{W||Rt()},[W,Rt]);let Wt=xe?.evalIndex??null,Gt=xe?.literal??null;(0,r.useEffect)(()=>{let e=U.current;if(!e||Gt===null&&(Wt===null||!T(L)))return void we(null);let t=!1;try{let n=e.getSheet().getCalculation(),r=Gt===null?n.createFormula(L,Tt(e)):n.createFormula(`=`+Gt,Tt(e));Promise.resolve(Gt===null?r.evaluate({evalIndex:Wt}):r.evaluate()).then(e=>{t||we(fe(e))}).catch(()=>{t||we(null)})}catch{we(null)}return()=>{t=!0}},[Wt,Gt,L]),(0,r.useEffect)(()=>{Rt()},[L,Rt]),(0,r.useLayoutEffect)(()=>{let e=$.current;if(e)return $.current=null,Q.current=null,void B.current?.setSelectionRange(e.start,e.end);let t=Q.current;t!==null&&(Q.current=null,B.current?.setSelectionRange(t,t))},[L]);let Kt=(0,s.useCallbackRef)((e,t)=>{let n=U.current;if(n&&T(L))try{let r=n.getSheet().getCalculation().createFormula(L,Tt(n)),i=E(L),a=k(r.getTokens(),e,i);if(!a)return;let o=r.getReferences()?.getCoords()?.[e],s={colStart:t.colStart,rowStart:t.rowStart,colEnd:t.colEnd,rowEnd:t.rowEnd,$colStart:o?.$colStart,$rowStart:o?.$rowStart,$colEnd:o?.$colEnd,$rowEnd:o?.$rowEnd},c=vt(n,t)??_t(n,s,t.scope),l=L.slice(0,a.start)+c+L.slice(a.end);if(l!==L){let e=l.length-L.length,t=W?B.current?.selectionStart??L.length:null;Q.current=t===null||t>=a.start&&t<=a.end?a.end+e:t<=a.start?t:t+e}Ye.current(l)}catch{}},[L]),qt=(0,s.useCallbackRef)(e=>{let t=U.current;if(t&&T(L))try{let n=vt(t,e)??_t(t,{colStart:e.colStart,rowStart:e.rowStart,colEnd:e.colEnd,rowEnd:e.rowEnd},e.scope),r;if(W)r={start:B.current?.selectionStart??L.length,end:B.current?.selectionEnd??L.length};else{let e=ge.current;r=e!==null&&e<=L.length?{start:e,end:e}:{start:L.length,end:L.length}}if(jt&&r.start===r.end){let e=E(L),t=e;for(let n of jt.tokens){let i=(n.text??``).length;if(n.referenceIndex!==void 0&&r.start>=t&&r.start<=t+i){let t=k(jt.tokens,n.referenceIndex,e);t&&(r={start:t.end,end:t.end});break}t+=i}}let i=(r.start>0&&!`/*^&<>=:,+-( `.includes(L[r.start-1])?`,`:``)+n,a=L.slice(0,r.start)+i+L.slice(r.end);Q.current=r.start+i.length,W||(ge.current=r.start+i.length),Ye.current(a)}catch{}},[L,W,jt]),Jt=(0,r.useRef)(0);Jt.current=jt?.ranges.length??0;let Yt=(0,s.useCallbackRef)(()=>{let e=_e.getMode();if(!e||e.activeInput!==Xe.current||!W)return;let t=e.selection,n=U.current,r=jt?.ranges??null,i=B.current?.selectionStart??L.length,o=-1;if(r&&jt){let e=E(L);for(let t of jt.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&i>=e&&i<=e+n){o=t.referenceIndex;break}e+=n}o>=r.length&&(o=-1),o>=0&&!r[o]&&(o=-1)}let s=o>=0,c=R&&w(L,i)&&!s&&!!jt,l=c||s&&!!jt;ge.current=c?i:null;let u=r??[],d=n?{rowIndex:n.getCoords().rowIndex,colIndex:n.getCoords().colIndex,scope:n.getSheet().getName()}:a.CoordUtils.EmptyCell,f;if(c)f={cell:d,ranges:u,rangeIndex:-1};else if(u.some(Boolean)){let e=(o>=0?u[o]:null)??u.find(Boolean);f={cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:e.scope},ranges:u,rangeIndex:o}}else f={cell:d,ranges:a.CoordUtils.EmptyRanges,rangeIndex:-1};pe.current=!0;try{t.updateCoords(f)}finally{pe.current=!1}let p=l?`point`:`show`;e.mode!==p&&_e.setMode(e=>e&&e.mode!==p?{...e,mode:p}:e)},[jt,L,d,W]),Xt=St.getMode()?.key??null;(0,r.useEffect)(()=>{Yt(),Qe.update()},[Yt,Qe.update,jt,W,L,u,Xt,d,Ot,Dt]),(0,r.useEffect)(()=>{W&&Et&&Et.activeInput!==Xe.current&&_e.setMode(e=>e&&{...e,activeInput:Xe.current})},[W,Et]),(0,r.useEffect)(()=>{u&&Et&&!Et.activeInput&&_e.setMode(e=>e&&!e.activeInput?{...e,activeInput:Xe.current}:e)},[u,Et]),(0,r.useEffect)(()=>{u||(ge.current=null)},[u]),(0,r.useEffect)(()=>()=>{_e.setMode(e=>e&&e.activeInput===Xe.current?{...e,activeInput:null}:e)},[]),(0,r.useEffect)(()=>{if(Ot&&Dt)return Dt.addListeners({onChange:e=>{if(pe.current||me())return;let t=e.getCoords(),n=t.rangeIndex??-1;n<0||!t.ranges||n>=t.ranges.length||(n<Jt.current?Kt(n,t.ranges[n]):qt(t.ranges[n]))}})},[Ot,Dt,Kt,qt]);let Zt=Ne.color,Qt=ze?0:2,$t={boxSizing:`border-box`,paddingTop:0,paddingBottom:0,paddingLeft:Qt,paddingRight:Pt&&qe?`calc(${Qt}px + ${$e})`:Qt,margin:0,whiteSpace:Be||Ve?`pre-wrap`:`pre`,wordBreak:Ve?`break-all`:Be?`break-word`:`normal`,textAlign:Fe,...Ne,...We?{lineHeight:We*_+`px`}:null};return(0,i.jsxs)(`div`,{ref:ot,style:{position:`relative`,flex:`1 1 100%`,minWidth:0},onMouseDown:e=>{let t=B.current;if(!t||e.target===t||!dt(e.target))return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.clientY<n.top?0:t.value.length;t.focus(),t.setSelectionRange(r,r),d!==`edit`&&x(`edit`)},onPointerDown:e=>{e.stopPropagation()},children:[(0,i.jsx)(`div`,{style:kt,children:(0,i.jsxs)(`div`,{style:{position:`relative`,flex:ze?`0 0 auto`:`1 1 100%`,width:`100%`,minWidth:0,...je&&!l?je.getFill()?.toCSS(`adaptive`):a.CommonUtils.EmptyObject},children:[!!N&&!L&&(0,i.jsx)(`div`,{"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...$t,color:Zt,opacity:.55},children:N}),Pt&&(0,i.jsxs)(`div`,{ref:At,"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...$t},children:[(()=>{let e=ye&&be!==null&&Nt.some(e=>e.referenceIndex===be),t=Ke&&!qe?Ge:-1,n=z,r=Nt.map(e=>{let t=n;return n+=(e.text??``).length,t}),a=z===1?(0,i.jsx)(`span`,{"data-eq":!0,style:{color:Zt,opacity:e?.5:void 0},children:`=`},`eq`):null,o=Nt.map((n,a)=>{let o=Ft.unmatched.has(a),s=It.has(a),c=Ft.depthOf.get(a),l=o||c===void 0||n.isReference?void 0:st(c),u=o?ut:l??D(n),d=e&&n.referenceIndex!==be,f;(u||s||o||d)&&(f={},u&&(f.color=u),o&&(f.fontWeight=`bold`),d&&(f.opacity=.5),s&&(f.color=`transparent`));let p=n.text??``,m=t>=r[a]&&t<r[a]+p.length;return(0,i.jsxs)(`span`,{"data-ti":a,style:f,children:[s&&(0,i.jsx)(`span`,{"aria-hidden":!0,style:ct,children:(0,i.jsx)(`span`,{style:lt(u??Zt??`inherit`),children:n.text})}),m?(0,i.jsxs)(i.Fragment,{children:[p.slice(0,t-r[a]),(0,i.jsx)(et,{}),p.slice(t-r[a])]}):p]},a)});if(!xe)return(0,i.jsxs)(i.Fragment,{children:[a,o]});let{lo:s,hi:c,overEq:l}=xe,u=xe.fromSelection?it:rt,d=[...l||!a?[]:[a],...o.slice(0,s)],f=[...l&&a?[a]:[],...o.slice(s,c+1)],p=o.slice(c+1);return(0,i.jsxs)(i.Fragment,{children:[d,(0,i.jsx)(`span`,{className:`formula-eval-run`,style:u,children:f},`eval-run`),p]})})(),qe&&(0,i.jsx)(et,{})]}),(0,i.jsx)(`textarea`,{ref:B,value:L,spellCheck:!1,autoComplete:`off`,autoCapitalize:`off`,name:`cell-editor`,readOnly:y,style:{position:`relative`,display:`block`,width:`100%`,height:ze?K?K*_:void 0:`100%`,border:`none`,outline:`none`,resize:`none`,overflow:`hidden`,background:`transparent`,userSelect:`text`,...$t,color:Zt,...Pt?{WebkitTextFillColor:`transparent`}:null,caretColor:ee??`auto`,...xe&&!xe.fromSelection?{[s.INPUT_SELECTION_VAR]:`transparent`}:null},onChange:e=>{let t=ke(e.target.value);if(t)return requestAnimationFrame(()=>B.current?.setSelectionRange(t.caret,t.caret)),void b(t.value);b(e.target.value)},onSelect:()=>{Yt(),Qe.update(),Lt(),Ut()},onScroll:e=>{let t=At.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft,Rt(),Ut())},onMouseMove:Vt,onMouseLeave:zt,onPointerDown:e=>{e.stopPropagation(),Bt.begin(e),xt&&!yt.isOpen&&bt.open(0),d!==`edit`&&x(`edit`)},onKeyDown:e=>{if(!Qe.handleKeyDown(e))return e.which===s.KeyCodes.Escape&&yt.isOpen?(e.preventDefault(),e.stopPropagation(),void bt.close(0)):void((e=>{if(e.which!==s.KeyCodes.F9||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return!1;let n=B.current,r=U.current;if(!n||!r||y||!R||!jt||jt.tokens.length===0)return!1;let i=n.selectionStart??0,a=n.selectionEnd??0,o;if(i!==a)o=se(jt.tokens,z,L,i,a,Ht);else{let e=ce(jt.tokens);o=e?{...e,...le(jt.tokens,z,e.lo,e.hi),fragment:null}:null}if(!o)return!1;e.preventDefault(),e.stopPropagation();let c=L,l=r.getSheet().getCalculation(),u=Tt(r),d=ue((0,t.getLocaleProfile)(r.getSheet().getWorkbook()?.getLocale()??null??`en`).decimal),f=(0,t.getLanguagePack)(),p={t:f?.booleans?.true??`TRUE`,f:f?.booleans?.false??`FALSE`};return(async()=>{let e=null,t=``;try{if(e=de(o.fragment===null?await l.createFormula(c,u).evaluate({evalIndex:o.evalIndex}):await l.createFormula(`=`+o.fragment,u).evaluate(),d,p),e===null||(t=c.slice(0,o.start)+e+c.slice(o.end),!l.createFormula(t,u).isValid()))return}catch{return}let n=B.current;n&&n.value===c&&($.current={start:o.start,end:o.start+e.length},s.ReactUtils.replaceRangeText(n,o.start,o.end,e))})(),!0})(e)||(e=>{if(d===`edit`||!Ot||!Et)return!1;let t=U.current?.getSheet(),n=(t?.getWorkbook()?.getSelectedSheet()??t)?.getName();return!!n&&he(e,Et,n)})(e)||Je(e))},onFocus:()=>{G(!0),wt()?.setActiveEditor(Xe.current)},onBlur:e=>{let t=bt.floatElement?.();t&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||G(!1)}})]})}),(0,i.jsxs)(`div`,{ref:V,"aria-hidden":!0,style:{position:`absolute`,top:0,left:0,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,...Pe,...We?{lineHeight:`${We}px`}:null,...Ve&&P!==void 0?{whiteSpace:`pre-wrap`,wordBreak:`break-all`,width:`max-content`,maxWidth:Math.max(1,P-(Ue?Ue.left+Ue.right:4))}:null},children:[(()=>{if(L.length===0)return` `;if(L.endsWith(`
5
+ `))return L+` `;if(!Pt||qe)return L;let e=(L.codePointAt(L.length-2)??0)>65535?2:1;return(0,i.jsxs)(i.Fragment,{children:[L.slice(0,-e),(0,i.jsx)(`span`,{style:{display:`inline-block`,minWidth:$e},children:L.slice(-e)})]})})(),Pt&&qe&&(0,i.jsx)(`span`,{style:{display:`inline-block`,width:`0.6em`,marginLeft:`1px`}})]}),!1,yt.component,xe&&Ce!==null&&(0,c.createPortal)((0,i.jsx)(`div`,{"aria-hidden":!0,style:{...Z,left:(xe.rect.left+xe.rect.right)/2,top:xe.rect.top-6},children:Ce}),document.body)]})};return u.displayName=`SheetCellInput`,u};function bt(e,t,n={}){let{mode:r=`edit`,initialSelection:i}=n;e.startEdit(e.getAnchor().getCoords(),{dirty:t,mode:r,initialSelection:i})}function xt(e,t){let n=e.getSession()?.getActiveEditor();return!!n&&(n.insertText(t),!0)}function St(e,t,n={}){xt(e,t)||bt(e,t,n)}function Ct(e,n,r,i){let{autoRange:a,direction:o}=function(e){let n=e.getSelectedCell().getCoords(),r=null,i=0,a=n.rowIndex>0?e.getRange({rowIndex:n.rowIndex,colIndex:n.colIndex}).getExtended(t.IRange.Direction.Up):null;a&&e.getRange({colStart:n.colIndex,rowStart:a.getCoords().rowStart,colEnd:n.colIndex,rowEnd:a.getCoords().rowStart}).isContentful()&&(r=t.IRange.Direction.Up,i=n.rowIndex-a.getCoords().rowEnd);let o=n.colIndex>0?e.getRange({rowIndex:n.rowIndex,colIndex:n.colIndex-1}).getExtended(t.IRange.Direction.Left):null;if(o&&e.getRange({colStart:o.getCoords().colStart,rowStart:n.rowIndex,colEnd:o.getCoords().colStart,rowEnd:n.rowIndex}).isContentful()){let e=n.colIndex-o.getCoords().colEnd;(e<i||!r)&&(r=t.IRange.Direction.Left,i=e)}let s=null;if(r===t.IRange.Direction.Up&&a){if(s={...a.getCoords()},(s.rowEnd===n.rowIndex||!e.getRange({colIndex:n.colIndex,rowIndex:n.rowIndex-1}).isContentful())&&s.rowStart>0&&e.getRange({colIndex:n.colIndex,rowIndex:s.rowStart-1}).isContentful()){let e=a.getExtended(t.IRange.Direction.Up);s={colStart:n.colIndex,rowStart:e.getCoords().rowStart,colEnd:n.colIndex,rowEnd:a.getCoords().rowEnd}}s.rowEnd=n.rowIndex-1}else if(r===t.IRange.Direction.Left&&o){if(s={...o.getCoords()},(s.colEnd===n.colIndex||!e.getRange({colIndex:n.colIndex-1,rowIndex:n.rowIndex}).isContentful())&&s.colStart>0&&e.getRange({colIndex:s.colStart-1,rowIndex:n.rowIndex}).isContentful()){let e=o.getExtended(t.IRange.Direction.Left);s={colStart:e.getCoords().colStart,rowStart:n.rowIndex,colEnd:e.getCoords().colEnd,rowEnd:n.rowIndex}}s.colEnd=n.colIndex-1}return{autoRange:s,direction:r}}(n),s=n.getSelectedRange();if(i===`caret`||s.size===1||!o||!a){let t=a?n.getRange(a).toString():``,o=`=${r}(`,s=`${o}${t})`;i===`caret`?xt(e,s):bt(e,s,{mode:`edit`,initialSelection:{start:o.length,end:o.length+t.length}});return}let{rowStart:c,rowEnd:l,colStart:u,colEnd:d}=s.getCoords(),f=o===t.IRange.Direction.Up;s.doBatch(async()=>{let e=s.createSparseBuilder({axis:t.IRange.Axis.Column}),i={...a};for(let t=u;t<=d;t++){i.colStart=f?t:a.colStart+(t-u),i.colEnd=f?t:a.colEnd+(t-u);for(let o=c;o<=l;o++)i.rowStart=f?a.rowStart+(o-c):o,i.rowEnd=f?a.rowEnd+(o-c):o,e.pushAt(o,t,`=${r}(${n.getRange(i).toString()})`)}e.apply()})}var wt=[[`insertFunctionSum`,`SUM`],[`insertFunctionAverage`,`AVERAGE`],[`insertFunctionCount`,`COUNT`],[`insertFunctionMax`,`MAX`],[`insertFunctionMin`,`MIN`]];function Tt(e,n){let{editable:r,sheet:i,flavor:a}=n,o=e=>{e!=null&&(a===`caret`?xt(r,e):bt(r,e))};e.updateCommand(`insertCurrentTime`,{tags:[`noTransaction`],callback:()=>o(i.createCell({value:t.DateUtils.nowWithPrecision(),style:{numberFormat:`Medium Time`}}).getText())}),e.updateCommand(`insertCurrentDate`,{tags:[`noTransaction`],callback:()=>o(i.createCell({value:t.DateUtils.nowWithPrecision(),style:{numberFormat:`Short Date`}}).getText())}),e.updateCommand(`insertValueAbove`,{tags:[`noTransaction`],callback:()=>{let e=i.getSelectedCell().getCoords();if(!e||e.rowIndex<=0)return;let t=i.getRange({rowIndex:e.rowIndex-1,colIndex:e.colIndex}).getCell();if(!t)return;let n=t.getFormulaText();o(n?`=${n}`:t.getText({useFormattingCategory:!0}))}});for(let[t,n]of wt)e.updateCommand(t,{tags:[`noTransaction`],callback:()=>Ct(r,i,n,a)});return()=>{}}function Et(e,t){let{editable:n}=t;return e.updateCommand(`relativeReferencesToggle`,{callback:()=>{(n.getSession()?.getActiveEditor())?.toggleReferences()}}),e.updateCommand(`toggleEditorFocus`,{callback:()=>{let e=n.getSession();if(!e)return;let t=e.getEditors();if(t.length<2)return;let r=e.getActiveEditor();t[((r?t.indexOf(r):-1)+1)%t.length]?.focus()}}),()=>{}}function Dt(e,t){let{editable:n,sheet:r,active:i=!0}=t;if(!i)return()=>{};let a=Tt(e,{editable:n,sheet:r,flavor:`caret`}),o=Et(e,{editable:n});return()=>{a(),o()}}var Ot=e=>{let t=(0,s.useNotifier)(),n=(0,s.useTranslator)(),i=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{i.current=!1},[e]),(0,s.useCallbackRef)(()=>{e.getProtection().isLocked()&&!i.current&&(i.current=!0,t?.showMessage?.(n(`error.sheet.protectedSheet`),{type:s.NotifierType.Error}))},[e,t])},{CommandScopeProvider:kt}=s.Command,At=Object.freeze({x:0,y:0,width:0,height:0});function jt(e){let{sheet:t,editable:n,darkMode:a,alignment:c=`left`,alignWidth:l=2,zIndex:u,onEditRejected:d,className:f,style:p,...m}=e,h=(0,o.useGridPaneOptional)(),g=Ot(t),_=d??g,v=(0,r.useMemo)(()=>yt({selection:t.getSelection()}),[t]),y=(0,s.useBoundSyncExternalStore)(n,e=>e.getSession()),b=(0,s.useOptionalBoundSyncExternalStore)(y,e=>e.getState()),x=!b||!b.coords.scope||b.coords.scope===t.getName(),S=(0,r.useMemo)(()=>({editable:n,sheet:t,active:!!b}),[n,t,b]),[C,w]=(0,r.useState)(null),T=(0,s.useCallbackRef)(e=>{w(t=>t&&t.width===e.width&&t.height===e.height?t:e)},[]),E=(0,s.useCallbackRef)(e=>{if(n.getSession())return;let t=n.getAnchor().getCoords();if(!t)return;let r=(0,o.startEventFromKey)(e.nativeEvent);r&&(e.nativeEvent.key!==`Process`&&e.nativeEvent.keyCode!==229&&e.preventDefault(),e.stopPropagation(),n.startEdit(t,r)||_())},[n,_]),D=(0,s.useCallbackRef)(e=>{if(n.getSession())return;let r=h?.getCellFromPointer(e.clientX,e.clientY),i=r?{...r,scope:t.getName()}:n.getAnchor().getCoords();i&&(n.startEdit(i,{mode:`edit`})||_())},[h,n,t,_]),O=(0,s.useCallbackRef)(e=>n.commit(e),[n]),k=(0,s.useCallbackRef)(()=>{n.cancel()},[n]);(0,r.useEffect)(()=>{b&&h&&x&&h.scrollCellCoordsIntoView(b.coords)},[b?.token,x]);let A=b?b.coords:n.getAnchor().getCoords(),j=A?{rowIndex:A.rowIndex,colIndex:A.colIndex}:null,M=null,N=!1,F=!1;if(h&&j){let e=h.getRangeFromCell(j);if(F=h.toClipBounds(h.getBoundsFromRange({rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowStart,colEnd:e.colStart}))!==null,b){let e=(0,o.expandEditorBounds)(h,j,C,c,l);M=e?.bounds??null,N=e?.inView??!1}else M=h.getBoundsFromRange(e)}let I,L=null;if(h&&j){let e=h.getBoundsFromRange(h.getRangeFromCell(j)),t=h.getZoom()||1;if(e){L={width:e.width/t,height:e.height/t};let n=h.getSurfaceSize();n?.width&&(I=Math.max(e.width,n.width-e.x-l)/t)}}let R=!!b&&!!M&&N&&x,z=`inline:${t.getId()}:${h?.getAnchor()??``}`,B=(0,s.useCallbackRef)(()=>{n.getSession()?.setActiveEditorId(z)},[n,z]),V=y?.getActiveEditorId()??null,H=!V||V===z,U={open:!!b,mode:b?.mode??`enter`,coords:b?.coords??null,clean:b?.clean??null,dirty:b?.dirty,token:b?.token??0,autoFocus:(b?.autoFocus??!0)&&H&&R&&F,initialSelection:b?.initialSelection,zoom:h?.getZoom()??1,cellSize:L,onDirtyChange:e=>y?.setDirty(e),onModeChange:e=>y?.setMode(e),onCommit:O,onCancel:k,onNaturalSize:T},W=A&&x?Y(t.getRange(A).getCell(),t,a,`var(--sxl-color-base-100)`):`transparent`;return(0,i.jsx)(kt,{spec:{scopeName:{key:`layer:editor`,name:`editor`},contributor:{dynamic:Dt},data:S},order:(0,o.useLayer)().zIndex,children:(0,i.jsx)(o.Layer,{className:P(f,`editor`),onKeyDown:E,onDoubleClick:D,children:M||b?(0,i.jsx)(o.VirtualDiv,{...m,bounds:M??At,alignWidth:l,keepMounted:!0,onFocus:B,style:{borderColor:`var(--sxl-color-primary, rgb(33, 115, 70))`,...p,display:`flex`,overflow:`hidden`,background:W,boxShadow:R?`rgba(60,64,67,.35) 2px 2px 6px 3px`:`none`,opacity:+!!R,pointerEvents:R?`auto`:`none`},children:(0,i.jsx)(v,{...U,editable:n,maxContentWidth:I})}):null})})}jt.displayName=`SheetCellEditorLayer`;var Mt=class{constructor(e){this._listeners=new Set,this._removeSdkListener=null,this._sel=e}get selection(){return this._sel}getSelection(){return this._sel.getCoords()}setSelection(e){this._sel.updateCoords(e)}navigate(e,t=!1,n=!1,r){this._sel.navigate(e,t,n,r)}traverse(e=a.RangeAxis.Row,t=!1,n){this._sel.traverse(e,t,n)}modify(e,t){this._sel.modify(e,t)}append(e,t=e){this._sel.append(e,t)}deselect(e){let t=this._sel.getCoords();if(!t.ranges||t.ranges.length===0)return;let n=[],r=-1,i=t.cell;for(let o of t.ranges){if(a.CoordUtils.isRangesIntersect(o,e)){let i=a.CommonUtils.subtractRect({top:o.rowStart,left:o.colStart,bottom:o.rowEnd+1,right:o.colEnd+1},{top:e.rowStart,left:e.colStart,bottom:e.rowEnd+1,right:e.colEnd+1});for(let e of i){let i={rowStart:e.top,colStart:e.left,rowEnd:e.bottom-1,colEnd:e.right-1};n.push(i),a.CoordUtils.isCellWithinRange(t.cell,i)&&(r=n.length-1)}}else n.push(o);if(n.length>0&&r===-1&&a.CoordUtils.isCellWithinRange(t.cell,o)){r=n.length-1;let e=n[n.length-1];i={rowIndex:e.rowStart,colIndex:e.colStart}}}this._sel.updateCoords({cell:i,rangeIndex:r,ranges:n})}getCoords(){return this._sel.getCoords().cell}subscribe(e){return this._listeners.add(e),this._listeners.size===1&&(this._removeSdkListener=this._sel.addListeners({onChange:()=>{this._listeners.forEach(e=>e())}})),()=>{this._listeners.delete(e),this._listeners.size===0&&(this._removeSdkListener?.(),this._removeSdkListener=null)}}};function Nt(e,t){let{navigation:n,sheet:r}=t;if(!n)return()=>{};let i=[...n.getBindings().keys()].map(e=>({key:e,callback:()=>{n.invoke(e)}}));r&&i.push({key:`traverseSelectionCorners`,callback:()=>{r.getSelection().traverseCorners()}});for(let t of i){let{key:n,...r}=t;e.updateCommand(n,r)}return()=>{}}var Pt=({sheet:e,isActive:n=!0,onShowTooltip:c,onCloseTooltip:l,className:d,...f})=>{let p=(0,s.useNotifier)(),m=(0,s.useTranslator)(),h=(0,s.useEditMode)(),g=(0,o.useGridPane)(),[_,v]=(0,r.useState)(null),y=!!s.Command.useCommandScope(),b=(0,r.useMemo)(()=>({navigation:_,sheet:e}),[_,e]),x=(0,s.useCallbackRef)(c,[c]),S=(0,s.useCallbackRef)(l,[l]),[C]=s.Command.useCommands([`pasteFormats`]),w=(0,s.useCallbackRef)(async()=>{h.getMode()?.key===`formatPainter`&&(await C?.execute(),h.setMode(null))},[h,C]),T=(0,r.useMemo)(()=>new Mt(e.getSelection()),[e]),E=(0,s.useCallbackRef)(()=>e.getUsedRange()?.getCoords()??a.CoordUtils.EmptyRange,[e]),D=(0,s.useCallbackRef)(t=>{let n=e.getTables().getItems();for(let e=0;e<n.length;e++){let r=n[e];if(a.CoordUtils.isCellWithinRange(t,r.getRange().getCoords()))return r.getDataRange().getCoords()}return null},[e]),O=(0,s.useCallbackRef)(t=>{e.scrollTo({colStart:t.colIndex,colEnd:t.colIndex,rowStart:t.rowIndex,rowEnd:t.rowIndex},{})},[e]);u(e,[`onProtectionChange`,`onSelectionChange`]);let k=h.getMode(),A=k?.key===`edit`,j=k?.key===`copy`||k?.key===`cut`,M=k?.key===`fill`,N=e.getSelectedRanges().getCount(),F=e.getProtection().isLocked(),I=n&&N<=1&&!A&&!F,L=s.ReactUtils.detectIt().supportsTouchEvents,R=L&&n&&!A&&N<=1,z=I&&!L&&(!k||j||M),B=r.default.useMemo(()=>{if(!L)return;let e=Math.max(2,Math.round(2*s.ReactUtils.getDevicePixelRatio()));return{border:{alignWidth:e},inner:{alignWidth:e}}},[L]),V=(0,s.useCallbackRef)((e,t)=>{h.setMode(Vt(t))},[h]),H=(0,s.useCallbackRef)((e,t,n)=>{h.setMode(Vt(n))},[h]),U=(0,s.useCallbackRef)(()=>{h.setMode(null)},[h]),W=(0,s.useCallbackRef)(async(n,r)=>{let i=await p?.showBusy?.(m(`op.autoFill`));try{await e.doBatch(()=>{e.getRange(n).autoFill(r,{snap:!0}),e.getRange(r).autoFit({axes:t.IRange.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:(0,a.messageKey)(`op.autoFill`),autoSelect:!0})}catch(e){p?.showError?.(e)}finally{i?.()}},[e,p]),G=(0,s.useCallbackRef)((t,n)=>e.getRange(t).autoFill(n,{preview:!0,snap:!0}).getCoords(),[e]),K=(0,s.useCallbackRef)((n,r)=>{if(!c)return;h.setMode(Bt);let i=Ft(n,r);try{let o=e.getRange(n).autoFill(r,{preview:!0,snap:!0}),c=o.getCell({rowIndex:i===t.IRange.Direction.Up?r.rowStart:r.rowEnd,colIndex:i===t.IRange.Direction.Left?r.colStart:r.colEnd}),l=c.getSpans(),u=l.width>1||l.height>1?c.getExtrusions():null,d=u?o.getCell({rowIndex:u.rowStart,colIndex:u.colStart}):c;if(d.isEmpty())return void S?.();let f=d.getText({hideStringPrefix:!0});if(!f)return void S?.();let p=u??a.CoordUtils.cellToRange(c.getCoords()),m=g.getMetrics(),h=g.getPanePointFromPointer(0,0);if(!h)return void S?.();let _=0,v=0,y=s.ToolTipPlacement.Bottom;if(i===t.IRange.Direction.Down){_=m.getColOffset(p.colEnd+1)-h.x;let e=m.getRowOffset(p.rowEnd),t=m.getRowOffset(p.rowEnd+1);v=t-(t-e)/2-h.y,y=s.ToolTipPlacement.Right}else if(i===t.IRange.Direction.Right){v=m.getRowOffset(p.rowEnd+1)-h.y;let e=m.getColOffset(p.colEnd),t=m.getColOffset(p.colEnd+1);_=t-(t-e)/2-h.x,y=s.ToolTipPlacement.Bottom}else if(i===t.IRange.Direction.Up){_=m.getColOffset(p.colEnd+1)-h.x;let e=m.getRowOffset(p.rowStart),t=m.getRowOffset(p.rowStart+1);v=t-(t-e)/2-h.y,y=s.ToolTipPlacement.Right}else if(i===t.IRange.Direction.Left){v=m.getRowOffset(p.rowEnd+1)-h.y;let e=m.getColOffset(p.colStart),t=m.getColOffset(p.colStart+1);_=t-(t-e)/2-h.x,y=s.ToolTipPlacement.Bottom}x({anchor:{x:_,y:v},display:f,placement:y})}catch(e){p?.showError?.(e)}},[e,p,h,g,c]),q=(0,s.useCallbackRef)(()=>{h.setMode(null),S?.()},[h]),ee=(0,s.useCallbackRef)(async(n,r,i)=>{if(a.CoordUtils.isEqualRanges(n,r))return;let o=e.getRange(r);if(p?.showOptions){let e=o.getDifferences(n),t=!1,r=e?.getCount()??0;for(let n=0;!t&&n<r;n++)t=e.at(n).isContentful();if(t&&await p.showOptions({title:m(`dialog.confirm.title`),description:m(`selection.replaceData`),options:[{id:`Replace`,label:()=>m(`selection.replace`)},`Cancel`],defaultOption:`Replace`})!==`Replace`)return void T.setSelection({cell:{rowIndex:n.rowStart,colIndex:n.colStart},rangeIndex:0,ranges:[n]})}let s=!i.ctrlKey,c=i.shiftKey,l=c?s?(0,a.messageKey)(`op.insertMovedCells`):(0,a.messageKey)(`op.insertCopiedCells`):s?(0,a.messageKey)(`op.moveCells`):(0,a.messageKey)(`op.copyCells`),u=await p?.showBusy?.(l);try{let r=e.getRange(n);await o.doBatch(async()=>{c?await o.insertFrom(n,{isCut:s,undoRange:r}):await o.copyFrom(n,{isCut:s,undoRange:r}),r.autoFit({skipCustomSize:!0,axes:t.IRange.AxisSelection.Row,minContent:!0}),o.autoFit({skipCustomSize:!0,axes:t.IRange.AxisSelection.Row,minContent:!0})},{description:l,autoSelect:!0})}catch(e){p?.showError?.(e)}finally{u?.()}},[e,p,T]);return(0,i.jsxs)(s.Command.CommandScopeProvider,{spec:{scopeName:{key:`layer:selection`,name:`selection`},contributor:{dynamic:Nt},data:b},order:(0,o.useLayer)().zIndex,children:[(0,i.jsx)(o.SelectionLayer,{className:P(d,`selection`),selection:T,...f,singleStyle:B,getContentBounds:E,getRegionBounds:D,scrollIntoView:O,enabledMove:I,onMove:ee,onMoveStart:V,onMoveUpdate:H,onMoveEnd:U,enableFill:z,snapFillDestination:G,onFill:W,onFillPreview:K,onFillEnd:q,onSelectionEnd:w,disableKeyboard:y,ref:v}),R&&(0,i.jsx)(o.SelectionTouchGrips,{selection:T})]})};Pt.displayName=`SheetSelectionLayer`;var Ft=(e,n)=>n.rowEnd>e.rowEnd?t.IRange.Direction.Down:n.rowStart<e.rowStart?t.IRange.Direction.Up:n.colEnd>e.colEnd?t.IRange.Direction.Right:t.IRange.Direction.Left,It={key:`dragCut`,description:(0,a.messageKey)(`editMode.dragCut`),cursor:`move`},Lt={key:`dragCutInsert`,description:(0,a.messageKey)(`editMode.dragCutInsert`),cursor:`copy`},Rt={key:`dragCopy`,description:(0,a.messageKey)(`editMode.dragCopy`)},zt={key:`dragCopyInsert`,description:(0,a.messageKey)(`editMode.dragCopyInsert`),cursor:`move`},Bt={key:`fill`,description:(0,a.messageKey)(`editMode.fill`),cursor:`crosshair`},Vt=e=>e.ctrlKey&&e.shiftKey?zt:e.ctrlKey?Rt:e.shiftKey?Lt:It,Ht=(e,t)=>Object.assign(Object.create(e),{setSelection:n=>{let r=e.getSelection(),i=n.ranges,a=n.rangeIndex??-1;i&&a>=0&&a<i.length&&i[a]&&i[a]!==r?.ranges?.[a]&&i[a].scope!==t&&(n={...n,ranges:i.map((e,n)=>n===a?{...e,scope:t}:e)}),e.setSelection(n)}});function Ut(e){let{sheet:t,sheetView:n,className:a,onKeyDown:c,...l}=e,u=te(),d=u.getMode(),f=d?.selection??null,p=f?.getSheet().getName(),m=t.getName(),h=p===m,g=!!d?.scope&&d.scope!==m,_=M(t,(n?.isShowFormulas()??!1)&&!f),v=(0,r.useMemo)(()=>{if(!_||!_.ranges.some(Boolean))return null;let e=t.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});return e.updateCoords({cell:{rowIndex:_.coords.rowIndex,colIndex:_.coords.colIndex,scope:m},ranges:_.ranges,rangeIndex:-1}),new Mt(e)},[t,_,m]),y=(0,s.useCallbackRef)((e,t)=>{u.setMode(n=>n&&{...n,dragging:e,draggingIndex:e&&t!==null?t:void 0})},[]),b=(0,s.useCallbackRef)(e=>{if(c?.(e),e.defaultPrevented)return;let t=u.getMode();if(t?.mode!==`point`||t.scope&&t.scope!==m||he(e,t,m))return;if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)){if(!t.activeInput||e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),t.activeInput.toggleReferences();return}if(!t.onDone)return;let n=e.key;n!==`Enter`&&n!==`Tab`&&n!==`Escape`||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||(e.preventDefault(),e.stopPropagation(),t.onDone({reason:n===`Escape`?`cancel`:`accept`,key:n,shiftKey:e.shiftKey,altKey:e.altKey}))},[c,m]),x=(0,r.useMemo)(()=>f?Ht(new Mt(f),m):null,[f,m]),S=(0,s.useOptionalBoundSyncExternalStore)(x,e=>e.getSelection()),C=e=>!!e&&(e.scope===void 0&&h||e.scope===m),w=!!S?.ranges?.some(C),T=!g&&d?.mode===`point`;return d?!x||!S||!(w||T)?null:(0,i.jsx)(o.RangesPickerLayer,{className:P(a,`reference-picker`),selection:x,getRangeStyle:(e,t)=>{let n=S.ranges?.[e];return n&&C(n)?(0,o.defaultRangeStyle)(e):null},...l,animated:(S.rangeIndex??-1)>=0,enabledMove:!0,disableDraw:!T,allowMulti:!1!==d?.allowMulti,onDragActiveChange:y,onKeyDown:b}):!v||!_?null:(0,i.jsx)(o.RangesPickerLayer,{className:P(a,`reference-picker`,`formula-view`),selection:v,getRangeStyle:(e,t)=>{let n=_.ranges[e];return n&&n.scope===m?(0,o.defaultRangeStyle)(e):null},...l,animated:!1,disableDraw:!0,allowMulti:!1,anchors:Wt,onKeyDown:c})}Ut.displayName=`SheetReferenceLayer`;var Wt=[],Gt=Object.freeze([]),Kt=e=>{let t=(0,o.useGridPane)(),[n,i]=(0,r.useReducer)(e=>e+1,0),a=(0,r.useMemo)(()=>({}),[n]);l(e,{onTablesChange:()=>i(),onAutoTableChange:()=>i(),onLayoutChange:()=>i(),onInvalidated:()=>i()},qt);let s=t.getVisibleRange(),c=(0,r.useMemo)(()=>{if(!s)return Gt;let t=e.getTables().getItems({address:s});return t.length>0?t:Gt},[e,s?.rowStart,s?.colStart,s?.rowEnd,s?.colEnd,n]);return(0,r.useEffect)(()=>{if(c.length===0)return;let e=c.map(e=>e.addListeners({onAnyChange:()=>i()},Jt));return()=>{for(let t of e)t?.()}},[c]),{visibleTables:c,cacheToken:a}},qt={transactional:!1,ignoreModelChange:!0},Jt={transactional:!1},Yt={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Xt=(e,n)=>{let i=(0,o.useGridPane)(),a=n?.showFormulas??!1,c=n?.showZeros??!0,u=n?.contentOnly??!1,[d,p]=(0,r.useReducer)(e=>e+1,0),m=(0,r.useMemo)(()=>({}),[d,a,c,u]),h=(0,r.useRef)(new Map),g=(0,r.useRef)({showFormulas:a,showZeros:c,contentOnly:u});g.current.showFormulas===a&&g.current.showZeros===c&&g.current.contentOnly===u||(g.current={showFormulas:a,showZeros:c,contentOnly:u},h.current.clear());let _=i.getVisibleRange();return f(e,(0,r.useMemo)(()=>_?{rowStart:_.rowStart,colStart:_.colStart,rowEnd:_.rowEnd,colEnd:_.colEnd}:null,[_?.rowStart,_?.colStart,_?.rowEnd,_?.colEnd]),e=>{e.isDataChange&&(h.current.clear(),p())},Zt),l(e,{onConditionalFormatsChange:()=>{h.current.clear(),p()}},{ignoreModelChange:!0}),{getVisibleCells:(0,s.useCallbackRef)((n,r)=>{let i=h.current,o=r??n.getVisibleRange();if(!o)return[];let s=`${o.rowStart}:${o.colStart}:${o.rowEnd}:${o.colEnd}`,l=i.get(s);if(l)return l;let d=[];return e.getRange(o).forEach((e,n)=>{let r=n.getCoords(),i=n.getCell();if(!(e=>{if(e.isEmpty())return!1;if(u){let t=e.getConditionalDecorations();if(!1===t.dataBar?.showValue||!1===t.iconSet?.showValue)return!1}let n=e.getSpans();if(n.width>1||n.height>1||!u&&e.getStyle().hasVisibleStyling()||a&&e.getFormula()!==null)return!0;let r=e.getValue();return r!==null&&!(!c&&r===0&&e.getType()===t.ScalarType.Number)})(i))return;let o=a?null:i.getExtrusions();d.push({cell:r,value:i,range:o??void 0})},Yt),i.set(s,d),i.size>12&&i.delete(i.keys().next().value),d},[e,a,c,u]),cacheToken:m}},Zt={fireOnAddressChange:!1,transactional:!1},Qt={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},$t=(e,t)=>{let n=(0,o.useGridPane)(),[i,a]=(0,r.useReducer)(e=>e+1,0),c=(0,r.useMemo)(()=>({}),[i,t]),u=(0,r.useRef)(new Map),d=(0,s.useCallbackRef)(()=>{u.current.clear(),a()},[]);l(e,{onConditionalFormatsChange:d},{ignoreModelChange:!0});let p=n.getVisibleRange();return f(e,(0,r.useMemo)(()=>p?{rowStart:p.rowStart,colStart:p.colStart,rowEnd:p.rowEnd,colEnd:p.colEnd}:null,[p?.rowStart,p?.colStart,p?.rowEnd,p?.colEnd]),e=>{e.isDataChange&&d()},tn),{getVisibleDecorations:(0,s.useCallbackRef)((n,r)=>{let i=u.current,a=r??n.getVisibleRange();if(!a)return en;let o=`${a.rowStart}:${a.colStart}:${a.rowEnd}:${a.colEnd}`,s=i.get(o);if(s)return s;let c=e.getRange(a),l=en;if(c.getConditionalFormats().length>0){let e=[];c.forEach((n,r)=>{let i=r.getCell(),a=i.getConditionalDecorations();if(!a[t])return;let o=i.getSpans(),s=o.width>1||o.height>1?i.getRange().getCoords():void 0;e.push({cell:r.getCoords(),value:i,range:s,decorations:a})},Qt),e.length>0&&(l=e)}return i.set(o,l),i.size>12&&i.delete(i.keys().next().value),l},[e,t]),cacheToken:c}},en=[],tn={fireOnAddressChange:!1,transactional:!1},nn=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{sheet:r,getVisibleCells:c,className:l,style:d,...f}=e,p=(0,o.useGridPane)();u(r,[`onStyleChange`,`onLayoutChange`]);let m=(0,s.useCallbackRef)(c,[c]),h=p.getPaneBounds();if(h.width===0||h.height===0)return null;if(!p.toClipBounds(p.getBoundsFromRange(),-3))return;let g=m(p),_=g?g.length:0;if(_===0)return;let v=null,y=p.getVisibleRange();for(let e=0;e<_;e++){let t=g[e],n=t.cell;if(!n)continue;let r=t.value,i=t?.range;if(i){let e=r.getSpans();e.height===1&&e.width===1&&(i=null)}let o=i?{...i}:a.CoordUtils.cellToRange(n);if(!a.CoordUtils.isRangesIntersect(o,y)&&!a.CoordUtils.isRangeWithinRange(o,y))continue;let s=r.getStyle().getFill();s.hasVisibleStyling()&&(o.value=s,v||=[],v.push(o))}if(!v)return;let b=a.CoordUtils.mergeRangeCoordValues(v,2,(e,t)=>{let n=e[0].value,r=e[1].value;if(n.isEqual(r))return t}),x=[],S=b.length;for(let e=0;e<S;e++){let n=b[e],r=n.value,a=r.getType()===t.IFill.Type.Pattern?r.toCSSMask(`adaptive`):null,s,c=null;if(a)s=a.base,c=(0,i.jsx)(`div`,{style:{position:`absolute`,inset:0,...a.marks}});else{let e=p.getBoundsFromRange(n);s=r.toCSS(`adaptive`,e)}x.push((0,i.jsx)(o.VirtualDiv,{range:n,clipInsets:-10,coverGridlines:!0,style:{pointerEvents:`none`,...s},children:c},`fill-${e}`))}return(0,i.jsx)(o.Layer,{...f,className:P(l,`fills`),children:(0,i.jsx)(o.VirtualDiv,{fill:!0,ref:n,style:{pointerEvents:`none`,overflow:`visible`,...d},children:x})})})),rn={error:`rgb(200,40,40)`,warning:`rgb(200,140,0)`},an=(0,r.memo)(e=>{let{sheet:t,placement:n={side:`r`,align:`start`},offset:r=6,alignOffset:c=2,openDelay:l=300,closeDelay:u=150,renderTip:d,className:f,...p}=e,m=(0,s.useEditMode)(),h=m.getMode()?.key===`edit`,g=(0,s.useCallbackRef)(e=>{let n=m.getMode();if(n?.key===`edit`){let r=n.args?.editable.getSession()?.getState().coords;if(r&&a.CoordUtils.isEqualCells({...r,scope:r.scope??t.getName()},{...e,scope:t.getName()}))return null}let r=t.getCell(e),i=r.getErrors(),o=r.getWarnings(),s=i.length?`error`:o.length?`warning`:null;return s?{range:r.getRange().getCoords(),data:{kind:s,message:(s===`error`?i:o).join(`
6
+ `)}}:null},[t,m]);return(0,i.jsx)(o.HoverTipLayer,{...p,className:P(f,`cell-error`),probe:g,placement:n,offset:r,alignOffset:c,openDelay:l,closeDelay:u,dismiss:h,children:({range:e,data:t,tipProps:n,state:r})=>{return d?d({range:e,message:t.message,kind:t.kind,state:r}):(0,i.jsx)(`div`,{...n,style:{...(a=t.kind,{font:`11px/1.5 system-ui, sans-serif`,color:`white`,background:rn[a],padding:`3px 8px`,borderRadius:4,maxWidth:260,whiteSpace:`pre-line`,boxShadow:`0 2px 8px rgba(0,0,0,0.35)`,cursor:`default`}),...n.style},children:t.message});var a}})});an.displayName=`CellErrorLayer`;var on=e=>{let{length:t=0,width:n=1,dashArray:r=null,dashArrayAdditional:a=null,isDouble:o=!1,isAngled:c=!1,offsetX:l=0,offsetY:u=0,isVertical:d=!1,...f}=e,p=e=>{let t=null;if(e&&n>0){t=``;for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=`,`)}return t},m=p(r),h=m;a&&(h=p(a));let g=s.ReactUtils.getDevicePixelRatio(),_=(e,t,n,r)=>{let i=s.ReactUtils.snapLineCenter(e,r/g,g),a=s.ReactUtils.snapDeviceEdge(t,g),o=s.ReactUtils.snapDeviceEdge(n,g);return d?`M ${i} ${a} L ${i} ${o}`:`M ${a} ${i} L ${o} ${i}`},v=n,y=t,b=null;if(o){v=Math.floor(n/2);let e=(d?l:u)+(v+v/2+1)/g,t=d?u:l;b=(0,i.jsx)(`path`,{strokeWidth:v/g,strokeDasharray:h??void 0,d:_(e,t,t+y,v),...f})}if(c){v=n/2;let e=h,t=(d?l:u)+(v+v/2)/g,r=d?u:l;b=(0,i.jsx)(`path`,{strokeWidth:v/g,strokeDasharray:e??void 0,strokeDashoffset:`1`,d:_(t,r,r+y,v),...f})}let x=(d?l:u)+v/2/g,S=d?u:l;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`path`,{strokeWidth:v/g,strokeDasharray:m??void 0,d:_(x,S,S+y,v),...f}),b]})};function sn(e,t){if(typeof e==`function`)return e(t);e&&(e.current=t)}var cn=parseInt(r.version.split(`.`)[0],10)>=19?function(e){return t=>{let n=[];for(let r of e){let e=sn(r,t),i=typeof e==`function`;n.push(i?e:()=>sn(r,null))}return()=>{for(let e of n)e()}}}:function(e){return t=>{for(let n of e)sn(n,t)}},ln=function(){};function un(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function dn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var fn=typeof window<`u`,pn=fn?n.useLayoutEffect:n.useEffect,mn=function(e){var t=window.history,n=t[e];t[e]=function(t){var r=n.apply(this,arguments),i=new Event(e.toLowerCase());return i.state=t,window.dispatchEvent(i),r}};fn&&(mn(`pushState`),mn(`replaceState`));var hn=function(e){var t=window.history,n=t.state,r=t.length,i=window.location;return{trigger:e,state:n,length:r,hash:i.hash,host:i.host,hostname:i.hostname,href:i.href,origin:i.origin,pathname:i.pathname,port:i.port,protocol:i.protocol,search:i.search}},gn=fn&&typeof Event==`function`?function(){var e=(0,n.useState)(hn(`load`)),t=e[0],r=e[1];return(0,n.useEffect)(function(){var e=function(){return r(hn(`popstate`))},t=function(){return r(hn(`pushstate`))},n=function(){return r(hn(`replacestate`))};return un(window,`popstate`,e),un(window,`pushstate`,t),un(window,`replacestate`,n),function(){dn(window,`popstate`,e),dn(window,`pushstate`,t),dn(window,`replacestate`,n)}},[]),t}:function(){return{trigger:`load`,length:1}},_n={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0},vn=fn&&window.ResizeObserver!==void 0?function(){var e=(0,n.useState)(null),t=e[0],r=e[1],i=(0,n.useState)(_n),a=i[0],o=i[1],s=(0,n.useMemo)(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,i=t.width,a=t.height,s=t.top,c=t.left,l=t.bottom,u=t.right;o({x:n,y:r,width:i,height:a,top:s,left:c,bottom:l,right:u})}})},[]);return pn(function(){if(t)return s.observe(t),function(){s.disconnect()}},[t]),[r,a]}:function(){return[ln,_n]},yn=({getBorderAt:e,rendererBorder:n=bn,getVisibleCells:o,forceThinBorder:c=!1,defaultColor:l=`black`})=>{let u=(0,s.useCallbackRef)(o,[o]);return{renderLayer:(0,r.useMemo)(()=>(r,o)=>{if(!e)return null;let d=o.toClipBounds(o.getBoundsFromRange(),-3);if(!d)return;let f=u(o);if(!f||f.length===0)return;let p=[],m=[],h=o.getVisibleColumns(),g=o.getVisibleRows(),_=h.map(e=>e.index),v=g.map(e=>e.index),y=new Map(_.map((e,t)=>[e,t])),b=new Map(v.map((e,t)=>[e,t])),x=[],S=[],C=[],w=[],T=(e,t,n,r,i,a,o)=>{let s={index:r,stroke:i,visibleIndex:n,edge:a,length:o};e[t]||(e[t]=[]);let c=e[t],l=c.length,u=c[l-1];l>0&&u?.index===r?c[l-1]=s:c.push(s)},E=o.getVisibleRange(),D=f.length;for(let n=0;n<D;n++){let r=f[n],i=r.cell;if(!i)continue;let o=r?.range??{rowStart:i.rowIndex,colStart:i.colIndex,rowEnd:i.rowIndex,colEnd:i.colIndex};if(!a.CoordUtils.isRangesIntersect(o,E)&&!a.CoordUtils.isRangeWithinRange(o,E))continue;let s=i.colIndex,c=i.rowIndex,l=y.get(s),u=b.get(c);if(o.rowEnd!==o.rowStart){let e=b.get(o.rowStart)??-1,t=b.get(o.rowEnd)??g.length;p.push({...o,rowStart:e,rowEnd:t})}if(o.colEnd!==o.colStart){let e=y.get(o.colStart)??-1,t=y.get(o.colEnd)??h.length;m.push({...o,colStart:e,colEnd:t})}let d=r.value,_=e(d,n);if(!_||_.isEmpty())continue;let v=_.getLeft(),C=_.getTop(),w=_.getRight(),D=_.getBottom();if(l===void 0||u===void 0)continue;let O=l,k=u;v.isNone()||T(x,O,k,c,v,t.IBorder.Edge.Left,1),C.isNone()||T(S,k,O,s,C,t.IBorder.Edge.Top,1),w.isNone()||T(x,O+1,k,c,w,t.IBorder.Edge.Right,1),D.isNone()||T(S,k+1,O,s,D,t.IBorder.Edge.Bottom,1)}let O=(e,t,n)=>{let r=[];return e.forEach((e,i)=>{let a=null;e.sort((e,t)=>e.visibleIndex-t.visibleIndex);let o=e.length;for(let s=0;s<o;s++){let o=e[s];if(!o?.stroke||t[i]===void 0&&t[i-1]===void 0)continue;let c=!1;if(n){let e=p.length;for(let t=0;!c&&t<e;t++){let e=p[t];e.colStart<=o.index&&e.colEnd>=o.index&&e.rowStart<i&&e.rowEnd>=i&&(c=!0)}}else{let e=m.length;for(let t=0;!c&&t<e;t++){let e=m[t];e.rowStart<=o.index&&e.rowEnd>=o.index&&e.colStart<i&&e.colEnd>=i&&(c=!0)}}if(c)continue;let u=o.stroke?.getColor(),d=u?u.toCSS(`adaptive`):l,f=o.stroke.getStyle()+`:`+d;(!a||f!==a.key||a.visibleIndex+1<o.visibleIndex)&&(a&&r.push(a),a={key:f,index:t[i]??t[i-1]+1,visibleIndex:o.visibleIndex,edge:o.edge,stroke:o.stroke,from:o.index,to:o.index+o.length-1,intersections:[],startExtend:0,endExtend:0,length:1}),a.to=o.index+o.length-1,a.visibleIndex=o.visibleIndex}a&&r.push(a)}),r};p=p.sort(a.CoordUtils.rowFirstRangeComparator),m=m.sort(a.CoordUtils.columnFirstRangeComparator);let k=O(x,_,!1),A=O(S,v,!0);if(k.length===0&&A.length===0)return null;let j=s.ReactUtils.getDevicePixelRatio(),M=o.getMetrics(),N=(e,n,r)=>{let i=r===t.IBorder.Edge.Right||r===t.IBorder.Edge.Bottom?`trailing`:`leading`;return s.ReactUtils.edgeCenter(e,i,n,j)},P=A.length;for(let e=0;e<P;e++){let n=A[e],r=a.CommonUtils.findEqualOrGreater(k,n.from,e=>e.index);for(;r>0&&k[r-1].index>=n.from;)r--;let i=!1;for(;!i;){let e=k[r++];if(e&&e.index>=n.from&&e.index<=n.to+1&&e.from<=n.index&&e.to+1>=n.index){n.intersections.push({stroke:e.stroke,edge:e.edge,range:{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}}),e.intersections.push({stroke:n.stroke,edge:n.edge,range:{rowStart:n.index,rowEnd:n.index,colStart:n.from,colEnd:n.to+1}});let r=e.index===n.from||e.index===n.to+1,i=n.index===e.from||n.index===e.to+1;if(r&&i){let r=t.IBorder.BuiltInDefinitions.get(e.stroke.getStyle())?.width??1,i=t.IBorder.BuiltInDefinitions.get(n.stroke.getStyle())?.width??1,a=r/2/j,o=i/2/j,s=M.getColOffset(e.index),c=N(s,r,e.edge);e.index===n.to+1?n.endExtend=c+a-s:n.startExtend=s-(c-a);let l=M.getRowOffset(n.index),u=N(l,i,n.edge);n.index===e.to+1?e.endExtend=u+o-l:e.startExtend=l-(u-o)}}i=!e||e.index>n.to+1}}for(let e=0;e<P;e++){let t=A[e],r=t.stroke,i=`rBorder:${t.index}:${t.from}:${t.to}:${t.edge}`,a={rowStart:t.index,rowEnd:t.index,colStart:t.from,colEnd:t.to+1},s=o.getMetrics(),l=s.getColOffset(a.colStart),u=s.getRowOffset(a.rowStart),d=[l,u,s.getColOffset(a.colEnd),u];C.push(n({key:i,points:d,stroke:r,forceThinBorder:c,range:a,edge:t.edge,intersections:t.intersections,startExtend:t.startExtend,endExtend:t.endExtend,metrics:s,isVertical:!1}))}let F=k.length;for(let e=0;e<F;e++){let t=k[e],r=t.stroke,i=`cBorder:${t.index}:${t.from}:${t.to}:${t.edge}`,a={rowStart:t.from,rowEnd:t.to+1,colStart:t.index,colEnd:t.index},s=o.getMetrics(),l=s.getColOffset(a.colStart),u=[l,s.getRowOffset(a.rowStart),l,s.getRowOffset(a.rowEnd)];w.push(n({key:i,stroke:r,points:u,forceThinBorder:c,range:a,edge:t.edge,intersections:t.intersections,startExtend:t.startExtend,endExtend:t.endExtend,metrics:s,isVertical:!0}))}let I=d.width,L=d.height;return(0,i.jsxs)(`svg`,{width:`${I}`,height:`${L}`,viewBox:`0 0 ${I} ${L}`,preserveAspectRatio:`none`,style:{position:`absolute`,left:`0px`,top:`0px`,width:`${I}px`,height:`${L}px`,pointerEvents:`none`,willChange:`left, top, width, height, stroke-dashoffset`,overflow:`visible`},children:[w,C]},`borders`)},[e])}},bn=e=>{let{key:n,points:r,range:a,stroke:o,forceThinBorder:c=!1,isVertical:l=!1,edge:u,intersections:d,startExtend:f=0,endExtend:p=0,metrics:m}=e,h=t.IBorder.BuiltInDefinitions.get(c?t.IBorder.StrokeStyle.Thin:o.getStyle());if(!h)return null;let g=s.ReactUtils.getDevicePixelRatio(),_=r[0],v=r[1],y=r[2],b=r[3],x=l?`rowStart`:`colStart`,S=l?v:_,C=f,w=(l?b-v:y-_)+p,T=o.getColor().toCSS(`adaptive`),E=h.description.toLowerCase().includes(`double`),D=h.description.toLowerCase().includes(`slant`),O,k,A=e=>{if(!e)return 0;let n=t.IBorder.BuiltInDefinitions.get(e.stroke.getStyle()),r=e.edge===t.IBorder.Edge.Right||e.edge===t.IBorder.Edge.Bottom;return n&&n.width%2==0&&r?1/g:0};if(d&&d.length>0&&E){let e=l?`colStart`:`rowStart`,n=l?`colEnd`:`rowEnd`,r=l?m?.getRowOffset:m?.getColOffset,i=0,o=0;O=[],k=[];let s=d.length;for(let c=0;c<s;c++){let s=d[c];if(s.stroke.getStyle()===t.IBorder.StrokeStyle.Double&&r){let t=r(s.range[x])-(S-C)+A(s);s.range[e]<a[e]&&t-i>=0&&(O.push(t-i),O.push(1/g),i=t+1/g),s.range[n]>a[n]&&t-o>=0&&(k.push(t-o),k.push(1/g),o=t+1/g)}}O.length>0&&i<w&&O.push(w-i),k.length>0&&o<w&&k.push(w-o)}let j=u===t.IBorder.Edge.Right||u===t.IBorder.Edge.Bottom?`trailing`:`leading`,M=s.ReactUtils.edgeTrailingShift(j,h.width,g),N=l?-h.width/2/g+M:-C,P=l?-C:-h.width/2/g+M;return(0,i.jsx)(on,{offsetX:_+N,offsetY:v+P,length:w+C,isVertical:l,stroke:T,width:h.width,dashArray:O??h.pattern,dashArrayAdditional:k,isDouble:E,isAngled:D},n)},xn=a.AnchorLocation.Center,Sn=Object.freeze({horizontal:!1,vertical:!1}),Cn=a.TypesUtils.EmptyTopLeft,wn=(e,t)=>a.CoordUtils.EmptyCell,Tn=(e,t)=>new Promise((e,t)=>{t(`StaticBorderRenderer does not support scrolling`)}),En=(0,r.memo)(e=>{let{getBorderAt:t,width:n,height:o,style:s,rowCount:c=2,columnCount:l=2,forceThinBorder:u,children:d,...f}=e,p=(0,r.useRef)(null),[m,{width:h,height:g}]=vn(),_=n??h,v=o??g,y=(0,r.useMemo)(()=>{let e=[];for(let t=0;t<c;t++)for(let n=0;n<l;n++){let r={colIndex:n,rowIndex:t};e.push({cell:r,value:r})}return e},[]),{renderLayer:b}=yn({getVisibleCells:(0,r.useCallback)(e=>y,[y]),getBorderAt:t,forceThinBorder:u}),x=Math.floor(_/l),S=Math.floor(v/c),C={getColOffset:e=>e*_/l+0,getRowOffset:e=>e*v/c+0,getColIndex:e=>Math.floor((e-0)/x)-1,getRowIndex:e=>Math.floor((e-0)/S)-1},w={rowStart:0,colStart:0,rowEnd:c,colEnd:l},T={x:0,y:0,width:Math.max(0,_)+0,height:Math.max(0,v)+0},E={left:0,top:0,right:0,bottom:0},D=l>0?Math.floor(_/l):0,O=c>0?Math.floor(v/c):0,k=e=>e<0||e>=l?null:{index:e,offset:e*D,size:D},A=e=>e<0||e>=c?null:{index:e,offset:e*O,size:O};if(!b)return null;let j={width:_,height:v},M={width:_,height:v},N={addReactEventListener:()=>()=>{},getElement:()=>p.current,focus:e=>{p.current?.focus(e)},invalidate:Dn,setPointerCapture(e){p.current?.setPointerCapture(e)},releasePointerCapture(e){p.current?.releasePointerCapture(e)},getTotalSize:()=>j,getSurfaceSize:()=>M,getMetrics:()=>C,getRangeFromCell:e=>a.CoordUtils.cellToRange(e),getVisibleRange:()=>w,getVisibleRows:()=>{let e=[];for(let t=0;t<c;t++)e.push(A(t));return e},getPaneRange:()=>w,getTotalRange:()=>w,getPanePointFromPointer:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{let e=[];for(let t=0;t<l;t++)e.push(k(t));return e},toClipBounds:(e,t)=>T,toPaneBounds:e=>e,toAbsoluteBounds:e=>e,getPaneBounds:()=>T,getInsets:()=>E,getBoundsFromRange:(e,t)=>T,getColumnSize:k,getRowSize:A,getAllPanes:()=>({[xn]:N}),getAnchor:()=>xn,getZoom:()=>1,scrollTo:(e,t)=>Promise.resolve(a.TypesUtils.EmptyTopLeft),scrollCellCoordsIntoView:Tn,getCellFromPointer:wn,getPaneFromPointer:()=>N,getScrollOrientation:()=>Sn,getScrollTopLeft:()=>Cn,getFreezeTopLeft:()=>Cn},P=b(a.CommonUtils.EmptyObject,N);return(0,i.jsxs)(`div`,{style:{...s,position:`relative`,display:`flex`},...f,children:[(0,i.jsx)(`div`,{ref:cn([p,m]),style:{flex:`1 1 100%`,display:`flex`,maxWidth:`100%`,maxHeight:`100%`},children:d}),P]})}),Dn=()=>{},On=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,className:a,...c}=e,l=(0,o.useGridPane)();u(n,[`onStyleChange`,`onLayoutChange`]);let{renderLayer:d}=yn({getVisibleCells:r,getBorderAt:(0,s.useCallbackRef)((e,t)=>e.getStyle().getBorder(),[])});if(l.getPaneBounds().width===0||l.getPaneBounds().height===0)return null;let f=d?.(c,l);return f&&l?(0,i.jsx)(o.Layer,{...c,className:P(a,`borders`),children:(0,i.jsx)(o.VirtualDiv,{fill:!0,style:{pointerEvents:`none`},children:f})}):null})),kn=(0,r.memo)(e=>{let{sheet:t,sheetView:n,renderCell:a,propsCellRender:c,editable:l,className:d,...f}=e,p=(0,o.useGridPane)(),m=(0,s.useNotifier)();u(n,[`onZoomScaleChange`]);let h=n.isShowFormulas(),g=n.isShowZeros(),{getVisibleCells:_,cacheToken:v}=Xt(t,{showFormulas:h,showZeros:g,contentOnly:!0}),y=(0,s.useCallbackRef)(e=>{let{value:n,key:i,...a}=e,o,s=n;if(!s){let n=e.range;if(!n||(s=t.getRange({rowIndex:n.rowStart,colIndex:n.colStart}).getCell(),s.isEmpty()))return null}s.getHyperlink()&&(o=async e=>{if(c?.onLinkMouseDown?.(e),e.button===0&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await s.getHyperlink()?.open()}catch(e){m.showError?.(e instanceof Error?e:String(e))}}});let{onColumnButtonMouseDown:l,propsColumnButton:u,renderColumnButton:d,...f}=c??{},p=t.getStyles();return(0,r.createElement)(x,{...a,key:i,docTheme:p.getTheme(),normalStyle:p.getNormal(),showFormulas:h,showZeros:g,onLinkMouseDown:o,...f,value:s})},[t,h,g]),b=a??y,S=(0,s.useOptionalBoundSyncExternalStore)(l,e=>e.getSession()),C=M(t,h,v),w=S?.getCoords()??C?.coords??null,T=null;if(C&&!S){let e={rowIndex:C.coords.rowIndex,colIndex:C.coords.colIndex},t=p.getBoundsFromRange(p.getRangeFromCell(e));t&&(T=(0,i.jsx)(o.VirtualDiv,{bounds:t,className:`formula-view-anchor`,style:{pointerEvents:`none`},children:(0,i.jsx)(j,{cell:C.cell,tokens:C.tokens,zoom:p.getZoom()||1})}))}return T||_(p).length!==0?(0,i.jsxs)(o.Layer,{...f,className:P(d,`cells`),children:[(0,i.jsx)(o.CellTileDiv,{renderCell:b,getVisibleCells:_,cacheToken:v,suppressCell:w}),T]}):null});kn.displayName=`SheetCellLayer`;var An=(0,r.memo)(e=>{let{sheet:t,onColumnButtonMouseDown:n,propsColumnButton:a,renderColumnButton:c=I,...l}=e,{cacheToken:u}=Kt(t),d=(0,s.useCallbackRef)((e,n)=>{let r=n??e.getVisibleRange();if(!r)return[];let i=t.getTables().getItems({address:r}),a=t.getAutoTable(),o=a&&a.getRange().getIntersect(r)?[...i,a]:i;if(o.length===0)return[];let s=[],c=o.length;for(let e=0;e<c;e++){let n=o[e];if(n.isDeleted())continue;let r=n.getHeaderRowRange()?.getCoords();if(!r)continue;let i=n.getColumns(),a=i.length;for(let e=0;e<a;e++){let n=i[e];if(n.isHiddenButton())continue;let a={rowIndex:r.rowStart,colIndex:r.colStart+n.getIndex()};s.push({cell:a,value:t.getRange(a).getCell()})}}return s},[t]),f=(0,s.useCallbackRef)(e=>{let{value:t,style:o,pane:s,key:l}=e,u=t,d=u?.getColumn();if(!d||!o)return null;let f={x:0,y:0,width:o.width,height:o.height},p=(0,r.createElement)(c,{renderBounds:f,className:`column-button`,disabled:!u.isEditAllowed(),zoom:s.getZoom(),column:d,onColumnButtonMouseDown:n,...a,style:{pointerEvents:`auto`,...a?.style}});return p?(0,i.jsx)(`div`,{style:{...o,position:`absolute`,display:`flex`,alignItems:`end`},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:p},l):null},[n,a,c]);return(0,i.jsx)(o.CellLayer,{...l,className:`column-buttons`,renderCell:f,getVisibleCells:d,cacheToken:u})});An.displayName=`SheetColumnButtonLayer`;var jn=(e,t)=>{if(e===void 0&&t===void 0)return;let n={};return e!==void 0&&(n.stroke=e),t!==void 0&&(n.strokeDasharray=t),n},Mn=(0,r.memo)(e=>{let{sheet:n,sheetView:a,className:s,...c}=e;u(n,[`onStyleChange`]),u(a,[`onZoomScaleChange`]);let{getVisibleCells:l,cacheToken:d}=Xt(n,{showFormulas:a.isShowFormulas()}),f=(a?.getZoomScale()??100)/100,p=a.isShowColumnGridlines(),m=a.isShowRowGridlines(),h=(0,r.useMemo)(()=>({vertical:p&&f>=.4,horizontal:m&&f>=.4}),[p,m,f]),g=a?.getGridLineColor(),_=n.getStyles().getNormal(),v=_.getBorder(),y=_.getFill().getType()===t.IFill.Type.None,b=g?.toCSS(`adaptive`)??`var(--sxl-color-base-300)`,x=e=>e.isNone()?y?void 0:`none`:e.getColor().toCSS(`adaptive`),S=x(v.getBottom().isNone()?v.getTop():v.getBottom()),C=x(v.getRight().isNone()?v.getLeft():v.getRight()),w=g?`1,1`:void 0,T=(0,r.useMemo)(()=>jn(S,w),[S,w]),E=(0,r.useMemo)(()=>jn(C,w),[C,w]);return(0,i.jsx)(o.GridlineLayer,{...c,className:P(s,`gridlines`),showGridLines:h,gridLineColor:b,propsRows:T,propsColumns:E,getVisibleCells:l,cacheToken:d})});Mn.displayName=`SheetGridLineLayer`;var Nn=`data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=`,Pn=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,disabled:a,style:o,picture:c,description:l,tile:u,offsetX:d=0,offsetY:f=0,isDragging:p,onHide:m,onShow:h,onKeyDownCapture:g,onFocus:_,onBlur:v,loadingPanel:y,...b}=e,[x,S]=(0,r.useState)(!1),[C,w]=(0,r.useState)(null),[T,E]=(0,r.useState)(null),[D,O]=(0,r.useState)(null);(0,r.useEffect)(()=>{E(null),c.getDetails().then(e=>{S(!1),E(e.asUrl()),e.asSVGText?.()&&O(e.asSVGText())}).catch(e=>{console.warn(e),S(!0),E(Nn),O(null)})},[c]);let k=(0,s.useImperativeElement)(t,()=>({isPictureEditor:()=>!0}),[]),A=(0,r.useMemo)(()=>{if(T||D)return u?(0,i.jsx)(`div`,{style:{backgroundPosition:`${d}px ${f}px`,backgroundImage:`url(${T})`,backgroundRepeat:`repeat`,backgroundSize:`auto`,width:`100%`,height:`100%`,filter:`var(--sxl-image-filter)`}}):(0,i.jsx)(`img`,{style:{flex:`1`,width:`100%`,height:`100%`,border:x?`var(--sxl-color-neutral, grey) solid 1px`:void 0,backgroundColor:x?`var(--sxl-color-base-100, white)`:void 0,boxShadow:x?`0px 0px 3px var(--sxl-color-error, red)`:void 0,objectFit:x?`contain`:void 0,opacity:+!!C,filter:`var(--sxl-image-filter)`},draggable:!1,src:T??void 0,onLoad:()=>{w(!0)},onError:({currentTarget:e})=>{console.log(`error`),e.onerror=null,E(Nn),S(!0)},alt:l??`${c.getType()}`})},[C,c,T,D,p,u,d,f]);if(!c.isDeleted())return(0,i.jsxs)(`div`,{className:`picture-editor`,style:{position:`relative`,display:`flex`,flex:`1 1 100%`,filter:p?`drop-shadow(1px 1px 1.5px var(--sxl-color-shadow, rgba(0, 0, 0, .25)))`:void 0,...o,width:`100%`,height:`100%`},tabIndex:0,...b,onKeyDownCapture:e=>{g?.(e)},ref:k,children:[C||x?void 0:y,A]})}));Pn.displayName=`PictureEditor`;var Fn=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{sheet:a,className:s,style:c,...u}=e,d=(0,o.useGridPane)(),[f,p]=(0,r.useState)(()=>a.getPicture()),m=(0,r.useMemo)(()=>{let e=a.getStyles();return e.getNormal().getFill().getType()===t.IFill.Type.None?{backgroundColor:`var(--sxl-sys-color-window)`}:e.getNormal().getFill().toCSS(`adaptive`)},[a]);l(a,{onStyleChange:()=>{p(a.getPicture())}});let h=d?.getPaneBounds();if(!d||!h||h.width===0||h.height===0)return null;let g=d.getBoundsFromRange({rowStart:0,colStart:0,rowEnd:0,colEnd:0});return(0,i.jsx)(o.Layer,{...u,className:P(s,`background`),children:(0,i.jsx)(o.VirtualDiv,{fill:!0,ref:n,style:{pointerEvents:`none`,...m,...c},children:f?(0,i.jsx)(Pn,{picture:f,tile:!0,offsetX:g?.x??0,offsetY:g?.y??0}):null})})}));Fn.displayName=`SheetBackgroundLayer`;var In=e=>e.getSelectedRuns().map(e=>`${e.min}-${e.max}:${e.value?`A`:`s`}`).join(`|`),Ln=(0,r.memo)(e=>{let{header:t,renderCell:n,className:a,...s}=e,[c,u]=(0,r.useReducer)(e=>e+1,0),d=(0,r.useMemo)(()=>({}),[c]);l(t,{onSizesChange:()=>u()},{ignoreModelChange:!0});let f=(0,r.useRef)(In(t));return l(t.getSheet()?.getSelection(),{onChange:()=>{let e=In(t);e!==f.current&&(f.current=e,u())}}),(0,i.jsx)(o.CellLayer,{...s,className:P(a,t.getAxis()===`row`?`headers row`:`headers column`),renderCell:n,cacheToken:d})});Ln.displayName=`SheetHeaderCellLayer`;var Rn=Object.freeze({x:0,y:0,width:0,height:0}),zn={ignoreModelChange:!0},Bn=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,movable:s,overrideBounds:c,onRefLoad:u,onRefUnload:d,onHide:f,onShow:p,onUnFocus:m,isDragging:h,dragStart:g,style:_,disabled:v,renderMovable:y,onReposition:b,...x}=e,S=(0,o.useGridPane)(),[C,w]=(0,r.useState)(null),[T,E]=(0,r.useState)(!1),[,D]=(0,r.useReducer)(e=>e+1,0),O=(0,r.useRef)(null),k=c??s.getBounds(),A=k?S.toPaneBounds(k):Rn;(0,r.useLayoutEffect)(()=>{s.isSelected()&&!h&&b?.()},[b,s,h,A.x,A.y,A.width,A.height]),l(s,{onBoundsChange:()=>{D()},onSelectionChange:()=>{let e=!!O.current&&a.DOMUtils.hasFocus(O.current,!0);!T&&!e||s.isSelected()||(S.focus(),m?.())}}),l(s,{onRequestFocus:()=>O.current?a.DOMUtils.whenFocus(O.current,!0):Promise.resolve(!1)},zn),(0,r.useEffect)(()=>{let e=O.current;if(e)return u(e),()=>{d(e)}},[]);let j=(0,r.useMemo)(()=>{let{width:e,height:t}=A;return y({movable:s,disabled:v,isDragging:h,style:{position:`relative`,left:0,top:0,width:e,height:t},onHide:f,onShow:p})},[S,s,A.width,A.height,v,h]);return(0,i.jsx)(`div`,{className:`movable`,tabIndex:0,ref:cn([O,t]),style:{display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,position:`absolute`,maxWidth:`auto`,maxHeight:`auto`,minWidth:`auto`,minHeight:`auto`,left:A.x,top:A.y,width:A.width,height:A.height,..._},onMouseDown:async e=>{let t=e.shiftKey||e.ctrlKey,n=s.isSelected(),r=e.currentTarget;t&&n?s.unselect():(n&&!t||await s.select({addToSelection:t}),g(e.nativeEvent,r),r.focus())},onFocus:e=>{e.relatedTarget&&!C&&w(e.relatedTarget),E(!0)},onBlur:e=>{C&&!O?.current?.contains(e.relatedTarget)&&w(null),e.relatedTarget&&E(!1)},...x,children:j})})),Vn=`_movable-area_r4xkr_5`,Hn=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{movables:c,movablesView:u,renderMovable:d,transactional:f,onUnFocus:p,onFocus:m,disabled:h=!1,disableDrag:g=!1,disableResize:_=!1,className:v,style:y,renderDirections:b=[`nw`,`n`,`ne`,`w`,`e`,`sw`,`s`,`se`],onFirstRender:x,...S}=e,C=(0,o.useGridPane)(),w=C.getPaneBounds(),T=C.getVisibleRange(),E=`${T.rowStart}:${T.colStart}:${T.rowEnd}:${T.colEnd}`,D=(0,s.useCallbackRef)(x,[x]),O=(0,s.useCallbackRef)(p,[p]),k=(0,s.useCallbackRef)(m,[m]),[A,j]=(0,r.useState)([]),[M,N]=(0,r.useState)(!1),[F,I]=(0,r.useState)(!1),L=(0,r.useRef)(!0),R=(0,r.useRef)(new Map),z=(0,r.useRef)(new Map),B=(0,r.useRef)(new Map),V=(0,r.useRef)(new Map),H=(0,r.useRef)(null),[U,W]=(0,o.useSurfaceState)(`movable-drag`,null),G=(0,r.useRef)(null),K=(0,r.useRef)(``),q=(0,r.useCallback)(e=>{G.current=e,W(e)},[W]),ee=(0,r.useRef)(new Map),te=(0,r.useRef)({onRequestFocus:e=>($(e),Promise.resolve(!1))}),J=(0,r.useRef)(null),Y=(0,r.useRef)(null),[ne,X]=(0,r.useReducer)(e=>e+1,0);(0,r.useLayoutEffect)(()=>{X()},[c]),l(c,{onCollectionChange:()=>{let e=c.getItems({address:C.getVisibleRange(),ignoreHidden:!0}),t=ee.current;t.forEach(e=>{e()}),t.clear();let n=te.current,r=e.length;for(let i=0;i<r;i++){let r=e[i];if(r.isDeleted())continue;let a=r.addListeners(n);t.set(r,a)}X()},onInvalidated:()=>{X()}}),l(u,{onMovableSelectionChange(e){Z(),X()}});let re=(0,r.useCallback)(()=>{Y.current?.updateRect()},[]),Z=()=>{let e=[],t=u.getMovableSelection();t.forEach(n=>{let r=B.current.get(n);r&&t.indexOf(n)!==-1&&e.push(r)}),j(t=>a.CommonUtils.isEqualArrays(t,e)?t:e)},ie=(0,r.useRef)(null),ae=(0,r.useRef)(null),oe=(0,r.useMemo)(()=>(ae.current||=new Promise(e=>{ie.current=e}),ae.current),[]),se=(0,r.useRef)(null),ce=(0,s.useCallbackRef)(async(e,t)=>{se.current=t??null,await(async()=>!(!await oe.then()||!Y.current))()&&se.current===t&&Y.current.dragStart(e,t)},[A]),[le,ue]=(0,r.useState)(!1),Q=(0,r.useRef)(null),de=(0,r.useRef)(null),$=(0,s.useCallbackRef)(async(e=null)=>{if(e||=u.getMovableSelection()[0],!e)return O?.(),!1;let t=B.current.get(e);return t?(await a.DOMUtils.whenFocus(t),t.focus(),de.current=t,Q.current=null,!0):(Q.current=e,!1)},[u]);(0,r.useEffect)(()=>{le&&A.length>0&&de.current!==A[0]&&$(),L.current&&=(D?.(),!1)},[A]);let fe=(0,r.useMemo)(()=>{let e=c.getItems({address:C.getVisibleRange(),ignoreHidden:!0});if(e.length===0&&R.current.size===0&&!U)return null;let t=(t,n,r,a=!0)=>{let o=t.isSelected(),s=U?U[t.getId()]??null:null,c=!!s||o&&(F||M);return(0,i.jsx)(Bn,{tabIndex:r,movable:t,overrideBounds:s,onRefLoad:e=>{Q.current===t&&(e.focus(),de.current=e,Q.current=null),B.current.set(t,e),z.current.set(e,t),n.rendered=!0,Z()},onRefUnload:e=>{B.current.delete(t),z.current.delete(e),n.rendered=!1,Z()},onUnFocus:O,onHide:e=>{n.onHide=e},onShow:e=>{n.onShow=e},isDragging:c,disabled:h,renderMovable:d,onReposition:re,dragStart:ce,onMouseUp:()=>{se.current=null,V.current.size>0&&(N(!1),I(!1),me())},style:{opacity:s?.7:a?M&&o?.7:void 0:0,zIndex:c?t.getZIndex()+e.length:void 0,pointerEvents:a?void 0:`none`,cursor:F&&o?`grabbing`:h||g?`initial`:`move`,boxShadow:!o||F&&!M?void 0:`1px 1px 2px 2px rgba(0,0,0,.15)`}},`movable-${t.getId()}`)},n=R.current,r=new Map,a=[],o=()=>({frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;let n=++t.visibilityRequestId;requestAnimationFrame(()=>{let r=R.current.get(e);r&&n===t.visibilityRequestId&&(t.onShow?.(e),r.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;let n=++t.visibilityRequestId,r=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==r&&(t.shown=!1,R.current.delete(e),X())},visibilityRequestId:0}),s=e.length;for(let i=0;i<s;i++){let s=e[i];if(s.isDeleted())continue;let c=n.get(s)??o();c.previewOnly=!1,c.frame=t(s,c,i,!0),a.push(c.frame),c.doShow(s,c),n.delete(s),r.set(s,c)}let l=[];return u.getMovableSelection().forEach(e=>{if(r.has(e))return;let i=n.get(e),a=!!U?.[e.getId()];if(i){if(i.previewOnly&&!a)return}else{if(!a)return;i=o(),i.previewOnly=!0}i.frame=t(e,i,-1,!1),l.push(i.frame),n.delete(e),r.set(e,i)}),n.forEach((e,i)=>{e.frame=t(i,e,-1,!1),l.push(e.frame),e.doHide(i,e),n.delete(i),r.set(i,e)}),R.current=r,Z(),[...l,...a]},[ne,C,E,U,d,h,g,_,M,F]),pe=(0,s.useCallbackRef)((e,n)=>{K.current=`${n} ${A.length===1?t.TextUtils.capitalize(z.current?.get(A[0])?.getContent().getType()??``):`Drawings`}`,V.current.clear();let r=A.length;for(let e=0;e<r;e++){let t=A[e],n=z.current?.get(t);if(!n){console.warn(`invalid element`,n);continue}let r=n.getBounds();r&&V.current.set(t,{movable:n,startBounds:C.toPaneBounds(r)})}H.current?.();let i={capture:!0,once:!0},a=()=>ge();window.addEventListener(`pointerup`,a,i),H.current=()=>window.removeEventListener(`pointerup`,a,i)},[C,A]),me=(0,r.useCallback)(()=>{let e=G.current,t=V.current;if(V.current=new Map,!e||t.size===0)return void q(null);let n=!1;if(t.forEach(t=>{let r=e[t.movable.getId()];r&&!a.CommonUtils.isEqualBounds(r,t.movable.getBounds()??void 0)&&(n=!0)}),!n)return void q(null);let r=f.beginCommit({description:K.current});try{let n=[];t.forEach(t=>{let r=e[t.movable.getId()];r&&t.movable.setBounds(r),n.push(t.movable)}),r.commit({viewAfter:{view:u,movableSelection:n}})}catch(e){console.warn(e),r.rollback()}q(null)},[f,u,q]),he=(0,r.useCallback)(()=>{H.current?.(),H.current=null,V.current=new Map,q(null)},[q]),ge=(0,s.useCallbackRef)(()=>{H.current=null,se.current=null,V.current.size!==0&&(N(!1),I(!1),me())},[me]),_e=(0,r.useRef)(null);(0,r.useEffect)(()=>{_e.current&&(_e.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[_e.current]);let ve=(0,s.useImperativeElement)(n,()=>({isMovableLayer:()=>!0,focusMovable:$,focus:()=>{$()}}),[u]),[ye,be]=(0,r.useState)(null),xe=(0,r.useCallback)(e=>{e&&be(e)},[]),[Se,Ce]=(0,r.useState)(null),we=(0,r.useRef)(!1),Te=(0,r.useRef)(!1),Ee=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(h||A.length===0||Ee.current||we.current)return;if(Te.current)return void requestAnimationFrame(()=>{Y.current&&J.current&&Y.current.refTargets.length>0&&(Ee.current=!0,ie.current?.(!0),Y.current.updateRect()),j([...A])});we.current=!0;let e=(0,r.lazy)(async()=>{try{let e=await Promise.resolve().then(()=>require("./Pl04-kDEQSO8_qFU.cjs"));return we.current=!1,Te.current=!0,j([...A]),e}catch(e){throw console.warn(e),ie.current?.(!1),e}});Ce(e)},[A,h,g,_]);let De=(0,r.useMemo)(()=>!Se||h?null:(0,i.jsx)(r.Suspense,{children:(0,i.jsx)(Se,{className:P({dragging:M||F||!!U,resizing:M,moving:F}),container:null,ref:Y,target:Y.current?A:[],draggable:!h&&!g,resizable:!h&&!_,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:b,onResizeStart:e=>{pe(e.target,(0,a.messageKey)(`op.resizeMovable`))},onResize:e=>{if(V.current.size===0)return void e.stopDrag();N(!0);let t=e.direction[0]!==0&&e.direction[1]!==0,n={},r=0,i=0,a=A.length;for(let o=0;o<a;o++){let a=A[o],s=V.current.get(a),c=z.current.get(a);if(!s||!c){console.warn(`invalid element`);continue}let l=e.dist[0],u=e.dist[1],d=e.drag.dist[0],f=e.drag.dist[1],p=s.startBounds.width,m=s.startBounds.height;o===0?(r=p,i=m):(l*=p/r,d*=p/r,u*=m/i,f*=m/i);let h={...s.startBounds};if(h.width=Math.max(0,p+l),h.height=Math.max(0,m+u),e.direction[0]===-1&&(h.width=Math.max(0,Math.min(s.startBounds.x+p,p-d))),e.direction[1]===-1&&(h.height=Math.max(0,Math.min(s.startBounds.y+m,m-f))),t&&(c.isLockAspectRatio()||e.inputEvent?.shiftKey)){let e=p/m,t=h.width/h.height;t>e?h.height=h.width/e:t<e&&(h.width=h.height*e)}e.direction[0]===-1&&(h.x=Math.max(0,Math.min(s.startBounds.x+p,s.startBounds.x+p-h.width))),e.direction[1]===-1&&(h.y=Math.min(s.startBounds.y+m,s.startBounds.y+m-h.height)),n[s.movable.getId()]=C.toAbsoluteBounds(h)}q(n)},onResizeEnd:e=>{N(!1),me()},onDragStart:e=>{pe(e.target,(0,a.messageKey)(`op.moveMovable`))},onDrag:e=>{if(V.current.size===0)return void e.stopDrag();I(!0);let t={};for(let n=0;n<A.length;n++){let r=A[n],i=V.current.get(r);i?t[i.movable.getId()]=C.toAbsoluteBounds({...i.startBounds,x:i.startBounds.x+e.translate[0],y:i.startBounds.y+e.translate[1]}):console.warn(`invalid element`)}q(t)},onDragEnd:e=>{},onMouseUp:e=>{}})}),[ne,Se,A,C,h,g,_,M,F,U]);return De||fe?(0,i.jsx)(o.Layer,{className:P(v,`movable-area`),onPointerDown:e=>{e.button===0&&u.getMovableSelection().length!==0&&(u.selectMovables([]),O?.())},children:(0,i.jsx)(o.VirtualDiv,{fill:!0,className:Vn,style:{pointerEvents:`none`,...y,overflow:`hidden`,willChange:`transform`},ref:cn([ve,_e,xe]),...S,children:(0,i.jsx)(`div`,{className:`movable-scroll`,style:{position:`absolute`,left:0,top:0,width:w.width,height:w.height},...S,children:(0,i.jsxs)(`div`,{ref:J,style:{position:`absolute`,pointerEvents:`auto`},onFocus:e=>{k?.(),ue(!0)},onBlur:e=>{ue(!1)},onKeyDownCapture:e=>{if(e.isDefaultPrevented())return;let t=e.nativeEvent.ctrlKey,n=e.nativeEvent.altKey,r=e.nativeEvent.shiftKey;if(e.which===s.KeyCodes.Escape){if(V.current.size>0)return Y.current?.stopDrag(),N(!1),I(!1),he(),void e.preventDefault();let t=u.getMovableSelection(),n=[...t];A.forEach(e=>{if(n.length===0)return;let t=z.current.get(e);if(!t)return;let r=n.indexOf(t);n.splice(r,1)}),n.length!==t.length&&u.selectMovables(n),n.length===0&&O?.(),e.preventDefault();return}let i=.1,o=e=>{c.updateSelected(t=>{t.setRotation(t.getRotation()+e)},(0,a.messageKey)(`op.rotateMovable`))},l=(e,t=!0)=>{c.updateSelected(n=>{let r=n.getBounds();if(!r)return;let i=1+e;t||(i=1/i);let a=Math.sqrt(r.width**2+r.height**2),o=Math.atan2(r.height,r.width),s=i*a;if(s<10)return;let c=s*Math.cos(o),l=s*Math.sin(o),u={x:r.x+(r.width-c)/2,y:r.y+(r.height-l)/2,width:c,height:l};n.setBounds(u)},(0,a.messageKey)(`op.resizeMovable`))},d=e=>{c.updateSelected(t=>{let n=t.getBounds();if(!n)return;let r={x:n.x+(e.x??0),y:n.y+(e.y??0),width:n.width+(e.width??0),height:n.height+(e.height??0)};t.setBounds(r)},(0,a.messageKey)(`op.nudgeMovable`))};if(e.which===s.KeyCodes.Delete)c.updateSelected(e=>{e.delete()},(0,a.messageKey)(`op.deleteMovable`)),e.preventDefault();else if(e.key===`a`&&t){let t=u.getMovableSelection();u.selectMovables(c.getItems(),!0),u.selectMovables(t,!0),e.preventDefault()}else e.key===`ArrowLeft`?(r?l(i,!1):n?o(-10):d({x:t?-10:-1}),e.preventDefault()):e.key===`ArrowRight`?(r?l(i,!0):n?o(10):d({x:t?10:1}),e.preventDefault()):e.key===`ArrowUp`?(r?l(i,!0):d({y:t?-10:-1}),e.preventDefault()):e.key===`ArrowDown`&&(r?l(i,!1):d({y:t?10:1}),e.preventDefault())},onPointerDown:e=>{e.stopPropagation()},children:[fe,De]})})})}):null})),Un=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,disabled:a,style:c,movable:l,description:u,isDragging:d,onHide:f,onShow:p,...m}=e;(0,r.useEffect)(()=>{},[u]);let h=(0,s.useImperativeElement)(t,()=>({isEmptyFrame:()=>!0}),[]),[g,{height:_,width:v}]=vn(),y=(0,o.useGridPane)();return(0,i.jsx)(`div`,{className:`unknown-editor`,...m,ref:cn([h,g]),style:{width:`100%`,height:`100%`,border:`var(--sxl-color-neutral, grey) solid 1px`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:y.getZoom(),display:`flex`,position:`relative`,filter:a?`blur(1px)`:void 0,boxShadow:d?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0,overflow:`hidden`,wordBreak:`break-word`,...c},children:u})})),Wn=e=>{let t=2**53-1,n=2**53-1,r=0,i=0;for(let a of e){let e=a.getBounds();e&&(t=Math.min(e.x,t),n=Math.min(e.y,n),r=Math.max(e.x+e.width,r),i=Math.max(e.y+e.height,i))}return{x:t,y:n,width:r-t,height:i-n}},Gn=(e,t=!0)=>{let n=[],r=t?`x`:`y`,i=t?`y`:`x`,a=t?`width`:`height`,o=0,s=2**53-1,c=0;for(let t of e){let e=t.getBounds();e&&(o+=e[a],s=Math.min(e[r],s),c=Math.max(e[r]+e[a],c),n.push({bounds:e,movable:t}))}let l=(c-s-o)/(e.length-1);n.sort((e,t)=>e.bounds[r]===t.bounds[r]?e.bounds[i]-t.bounds[i]:e.bounds[r]-t.bounds[r]);let u=new Map;u.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){let t=n[e-1].bounds,i={...n[e].bounds};i[r]=t[r]+t[a]+l,n[e].bounds=i,u.set(n[e].movable,i)}return u.set(n[n.length-1].movable,n[n.length-1].bounds),u};function Kn(e,n){let r=n.sheet;if(!r)return()=>{};let i=n,o=i?.notifier,s=i?.editModeHandler,c=(t,n,i,a)=>{e.updateCommand(t,{tags:[`noTransaction`,`noRepeat`],callback:()=>((e,t,n)=>{let i=r.getView();if(i.getMovableSelection().length!==0)try{r.doBatch(()=>{let e=i.getMovableSelection();if(e.length===0)return;let r=n?.(e);for(let n of e)t(n,r)},{description:e}),s?.setMode(null)}catch(e){o?.showError?.(e)}})(n,i,a)})},l=!1,u=()=>{r.getView().getMovableSelection().length===0?l&&=(e.remove(),!1):(l||=(c(`moveToFront`,(0,a.messageKey)(`op.bringToFront`),e=>e.moveToFront()),c(`moveForward`,(0,a.messageKey)(`op.bringForward`),e=>e.moveForward()),c(`moveToBack`,(0,a.messageKey)(`op.sendToBack`),e=>e.moveToBack()),c(`moveBackward`,(0,a.messageKey)(`op.sendBackward`),e=>e.moveBackward()),c(`toggleLockAspectRatio`,(0,a.messageKey)(`op.lockAspectRatio`),e=>e.setLockAspectRatio(!e.isLockAspectRatio())),c(`formatAnchorTypeTwoCell`,(0,a.messageKey)(`op.anchor`),e=>e.setAnchorType(t.IAnchored.Type.TwoCell)),c(`formatAnchorTypeOneCell`,(0,a.messageKey)(`op.anchor`),e=>e.setAnchorType(t.IAnchored.Type.OneCell)),c(`formatAnchorTypeAbsolute`,(0,a.messageKey)(`op.anchor`),e=>e.setAnchorType(t.IAnchored.Type.Absolute)),c(`formatDrawAlignLeft`,(0,a.messageKey)(`op.alignLeft`),(e,t)=>e.setBounds({x:t.x}),Wn),c(`formatDrawAlignCenter`,(0,a.messageKey)(`op.alignCenter`),(e,t)=>e.setBounds({x:(t.width-e.getBounds().width)/2+t.x}),Wn),c(`formatDrawAlignRight`,(0,a.messageKey)(`op.alignRight`),(e,t)=>e.setBounds({x:t.width-e.getBounds().width+t.x}),Wn),c(`formatDrawAlignTop`,(0,a.messageKey)(`op.alignTop`),(e,t)=>e.setBounds({y:t.y}),Wn),c(`formatDrawAlignMiddle`,(0,a.messageKey)(`op.alignMiddle`),(e,t)=>e.setBounds({y:(t.height-e.getBounds().height)/2+t.y}),Wn),c(`formatDrawAlignBottom`,(0,a.messageKey)(`op.alignBottom`),(e,t)=>e.setBounds({y:t.height-e.getBounds().height+t.y}),Wn),c(`formatDrawDistributeHorz`,(0,a.messageKey)(`op.distributeHorizontally`),(e,t)=>e.setBounds(t.get(e)),e=>Gn(e,!0)),c(`formatDrawDistributeVert`,(0,a.messageKey)(`op.distributeVertically`),(e,t)=>e.setBounds(t.get(e)),e=>Gn(e,!1)),!0),(()=>{let n=r.getView().getMovableSelection()[0]??null;e.updateCommand(`formatAnchorTypeTwoCell`,{state:n?.getAnchorType?.()===t.IAnchored.Type.TwoCell}),e.updateCommand(`formatAnchorTypeOneCell`,{state:n?.getAnchorType?.()===t.IAnchored.Type.OneCell}),e.updateCommand(`formatAnchorTypeAbsolute`,{state:n?.getAnchorType?.()===t.IAnchored.Type.Absolute}),e.updateCommand(`toggleLockAspectRatio`,{state:n?.isLockAspectRatio()??!1})})())};return u(),r.getView().addListeners({onMovableSelectionChange:u})}var{CommandScopeProvider:qn}=s.Command,Jn=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{sheet:n,className:a,propsMovable:c,renderMovable:l}=e;u(n,[`onProtectionChange`]);let d=!n.getProtection().isObjectsAllowed();(0,r.useEffect)(()=>{d&&n.getView().getMovableSelection().length>0&&n.getView().selectMovables([])},[d,n]);let f=(0,s.useNotifier)(),p=(0,s.useEditMode)(),m=(0,r.useMemo)(()=>({sheet:n,notifier:f,editModeHandler:p}),[n,f,p]);return(0,i.jsx)(qn,{spec:{scopeName:{key:`layer:movable`,name:`movable`},contributor:{dynamic:Kn},data:m},order:(0,o.useLayer)().zIndex,children:(0,i.jsx)(Hn,{ref:t,className:P(a,`movable`),movables:n.getMovables(),disableResize:d,disableDrag:d,disabled:d,movablesView:n.getView(),transactional:n,renderMovable:l,...c,onFocus:()=>{c?.onFocus?.()}})})})),Yn=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){let n=e.key.toLowerCase();if(!t&&this._taskPanes.has(n))throw Error(`Task pane with key '${n}' is already registered.`);this._taskPanes.set(n,function(e){let{getTitle:t,getIcon:n}=e,r=e.key;return{...e,getTitle:()=>{let n=s.Command.DefaultCommandRegistry.findByKey(r)?.def;return typeof n?.label==`string`?n.label:a.DefaultLanguagePackService.lookup(`cmd.${r}.label`)??t.call(e)},getIcon:()=>{let t=s.Command.DefaultCommandRegistry.findByKey(r)?.def;return typeof t?.icon==`string`?t.icon:n?.call(e)}}}(e))}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return a.CommonUtils.EmptyArray;let t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,``);for(let n of this._taskPanes.values()){let r=n.contributionPoints;if(r&&r.length!==0)for(let i of r)i=i.toLowerCase().replace(/\/+$/g,``),i.startsWith(e)&&t.push(n)}return t}},Xn=(0,r.createContext)(void 0),Zn={activate(e,t){console.warn(`No TaskPaneArea available to activate task pane`,e,t)},getActive:()=>null,getOpen:()=>a.CommonUtils.EmptyArray,close:e=>a.CommonUtils.DonePromise,addListener:()=>()=>{}},Qn=(e=!1)=>{let t=(0,r.useContext)(Xn),[n,i]=(0,r.useReducer)(e=>e+1,0);return(0,r.useEffect)(()=>{if(!e&&t)return t.addListener({onChange:()=>{i()}})},[t]),t||Zn},$n={TaskPaneArea:`_TaskPaneArea_1m8hz_5`,TaskPaneTitle:`_TaskPaneTitle_1m8hz_13`,TaskPaneFrame:`_TaskPaneFrame_1m8hz_36`,TaskPaneAreaFrames:`_TaskPaneAreaFrames_1m8hz_55`,TaskPaneAreaFrameHost:`_TaskPaneAreaFrameHost_1m8hz_63`,TaskPaneAreaFrameHidden:`_TaskPaneAreaFrameHidden_1m8hz_71`,TaskPaneStrip:`_TaskPaneStrip_1m8hz_75`,TaskPaneStripItem:`_TaskPaneStripItem_1m8hz_88`,TaskPaneStripItemIcon:`_TaskPaneStripItemIcon_1m8hz_117`,TaskPaneStripItemLabel:`_TaskPaneStripItemLabel_1m8hz_127`,TaskPaneStripItemLabelOpen:`_TaskPaneStripItemLabelOpen_1m8hz_134`,TaskPaneStripItemLabelClip:`_TaskPaneStripItemLabelClip_1m8hz_139`,TaskPaneStripItemLabelText:`_TaskPaneStripItemLabelText_1m8hz_146`},er=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,title:a,icon:o,onClose:s,readOnly:c,focused:l,side:u=`right`,style:d,className:f,...p}=e;return(0,i.jsxs)(`div`,{ref:t,className:(0,r.useMemo)(()=>P(`taskpane-title`,f,$n.TaskPaneTitle,{focused:l}),[f,l]),style:d,...p,children:[(0,i.jsx)(`div`,{className:`title`,style:{flex:`1 1 100%`},children:a}),(0,i.jsx)(`div`,{"aria-label":`close`,role:`button`,style:{width:24,height:24,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},onPointerDown:e=>{e.stopPropagation()},onPointerUp:()=>{s()},children:(0,i.jsx)(`div`,{style:{fontSize:`0.7em`},children:`✕`})})]})}));er.displayName=`TaskPaneTitle`;var tr=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,entry:a,close:o,listenerContainer:c,model:l,args:u,onMounted:d,onUnmounted:f,wrapperPane:p,propsPane:m,componentTitle:h=er,style:g,className:_,...v}=e,[y,b]=(0,r.useState)(null),[x,S]=(0,r.useState)(null),C=(0,s.useCallbackRef)(o,[o]),w=(0,s.useLanguage)(),T=(0,r.useRef)(null),E=(0,r.useRef)(null);(0,r.useEffect)(()=>(d?.(a),()=>{f?.(a)}),[a]);let D=(0,r.useRef)([]),O=(0,r.useMemo)(()=>({addListener:e=>{let t=c?.(e)??(()=>{});return D.current.push(t),t},close:()=>{C?.()},focus:e=>{T.current?.focus(e)}}),[c]);(0,r.useEffect)(()=>()=>{for(let e of D.current)e();D.current=[]},[]);let k=(0,r.useMemo)(()=>(0,i.jsx)(a.componentTitle??h,{ref:E,title:a.getTitle(),icon:null,readOnly:!1,focused:x!==null,onClose:C,onPointerDown:e=>{}}),[a,h,x,w]),A=(0,r.useMemo)(()=>{let e=a.component,n=p,r=(0,i.jsx)(e,{entryKey:a.key,model:l,args:u,frame:O,ref:t,...m});return n&&(r=(0,i.jsx)(n,{children:r})),r},[a,l,u,O,t,p]);return(0,i.jsxs)(`div`,{className:P(`taskpane-frame`,_,$n.TaskPaneFrame),tabIndex:0,ref:T,style:g,onPointerDown:async e=>{let t=e.currentTarget;t.contains(document.activeElement)||t.focus()},onFocus:e=>{e.relatedTarget&&!y&&b(e.relatedTarget),S(e.currentTarget)},onBlur:e=>{y&&!T?.current?.contains(e.relatedTarget)&&b(null),e.relatedTarget&&S(null)},...v,children:[(0,i.jsx)(`div`,{style:{flex:`0 0 auto`,display:`flex`,flexDirection:`column`,width:`100%`,alignItems:`stretch`,justifyContent:`stretch`},children:k}),(0,i.jsx)(`div`,{className:`taskpane-frame-content`,style:{flex:`1 1 auto`,minHeight:0,width:`100%`,overflow:`auto`,height:`100%`,display:`flex`},children:A})]})}));tr.displayName=`TaskPaneFrame`;var nr=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,title:a,side:o=`right`,taskPanes:c,onSelect:l,selected:u,registry:d=Yn,style:f,iconsOnly:p,className:m,...h}=e,g=(0,r.useMemo)(()=>c.map(e=>{let t=d.getRegisteredTaskPane(e);if(!t)return null;let n=t.getIcon?.();typeof n==`string`&&(n=(0,i.jsx)(s.DynamicIcon,{iconKey:n}));let r=t.getTitle(),a=e===u,o=!n||!p&&a;return(0,i.jsxs)(`div`,{title:o?void 0:r,className:P(`taskpane-strip-item`,$n.TaskPaneStripItem,{selected:a}),onClick:()=>l(e),children:[n?(0,i.jsx)(`span`,{className:$n.TaskPaneStripItemIcon,children:n}):null,(0,i.jsx)(`span`,{className:P($n.TaskPaneStripItemLabel,{[$n.TaskPaneStripItemLabelOpen]:o}),children:(0,i.jsx)(`span`,{className:$n.TaskPaneStripItemLabelClip,children:(0,i.jsx)(`span`,{className:$n.TaskPaneStripItemLabelText,children:r})})})]},e)}),[c,u,l,d,p,(0,s.useLanguage)()]);return(0,i.jsx)(`div`,{ref:(0,s.useImperativeElement)(t,()=>({isTaskPaneStrip:()=>!0}),[]),className:(0,r.useMemo)(()=>P(`taskpane-strip`,m,$n.TaskPaneStrip),[m]),style:f,...h,children:g})}));nr.displayName=`TaskPaneStrip`;var rr=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{className:n=``,registry:a=Yn,model:o,onOpen:c,onClose:l,wrapperPane:u,propsPane:d,wrapperFrame:f,propsFrame:p,componentTitle:m,componentStrip:h=nr,alwaysShowStrip:g,side:_=`right`,style:v}=e,y=_!==`right`,b=(0,s.useCallbackRef)(c,[c]),x=(0,s.useCallbackRef)(l,[l]),[S,C]=(0,r.useState)(null),w=(0,r.useRef)(null),[T,E]=(0,r.useState)([]),[D,O]=(0,r.useState)({}),k=(0,s.useCallbackRef)((e,t)=>{O(n=>{if(n[e]===t)return n;let r={...n};return t===void 0?delete r[e]:r[e]=t,r})},[]),A=(0,r.useRef)(new Set),j=(0,r.useRef)(new Set),M=(0,s.useCallbackRef)(()=>{let e=Array.from(j.current);for(let t of e)try{t.onChange?.()}catch(e){console.error(`Error in TaskPaneArea listener:`,e)}},[]),N=(0,s.useCallbackRef)(async(e,t=!1)=>{let n=Array.from(A.current),r=n.length,i=!0;for(let e=0;i&&e<r;e++){let t=n[e];if(t.onBeforeHide)try{!1===await Promise.resolve(t.onBeforeHide())&&(i=!1)}catch{i=!1}}return i},[]),F=(0,s.useCallbackRef)(e=>{let t=Array.from(A.current),n=t.length,r=T.findIndex(t=>t.key===e);if(r===-1)return;let i=[...T];if(i.splice(r,1),k(e,void 0),E(i),i.length===0)C(null),w.current=null,x?.();else{let e=i[Math.min(r,i.length-1)];C(e),w.current=e.key,e.keepMounted&&requestAnimationFrame(()=>e.refPaneEl?.current?.focus?.())}for(let e=0;e<n;e++){let n=t[e];try{n.onHide?.()}catch{}}},[x,T]),I=(0,s.useCallbackRef)(async(e,t)=>{let n=a.getRegisteredTaskPane(e);if(!n)return void console.warn(`Invalid taskpane '${e}'`);if(w.current===e)return void k(e,t?.args);if(S&&!await N(S.key))return;let s=T.find(t=>t.key===e);if(s)return k(e,t?.args),C(s),w.current=e,void(s.keepMounted&&requestAnimationFrame(()=>s.refPaneEl?.current?.focus?.()));k(e,t?.args);let c=(0,r.createRef)(),l={current:null},f={key:e,elem:(0,i.jsx)(tr,{ref:e=>{l.current=e,e===null&&(w.current=null)},entry:n,model:o,close:async()=>{await N(e)&&F(e)},wrapperPane:u,propsPane:d,componentTitle:m,listenerContainer:e=>(A.current.add(e),()=>{A.current.delete(e)}),onMounted:t=>{t.key===e&&(w.current=null),b?.()},onUnmounted:e=>{},...p}),ref:c,keepMounted:n.keepMounted,refPaneEl:l};E(t=>{if(t.findIndex(t=>t.key===e)!==-1)return t;let n=[...t];return n.push(f),n}),C(f),w.current=e},[S,T,d,m]);(0,r.useEffect)(()=>{S&&!w.current&&I(S.key,{args:D[S.key]}),M()},[p,o,T,S,D]);let L=(0,s.useImperativeElement)(t,()=>{let e=Object.freeze(T.map(e=>e.key));return{activate:I,getActive:()=>S?.key??null,getOpen:()=>e,async close(e){await N(e)&&F(e)},addListener:e=>(j.current.add(e),()=>{j.current.delete(e)})}},[a,d,o,S,T]),R=(0,r.useMemo)(()=>{if(T.length<=1&&!g)return null;let e={className:$n.TaskPaneAreaStrip,taskPanes:Object.freeze(T.map(e=>e.key)),selected:S?.key,side:_,onSelect:e=>{I(e)},registry:a};return(0,i.jsx)(h,{...e})},[T,S,a,g,_,h]),z=e=>(0,r.cloneElement)(e.elem,{model:o,args:D[e.key],propsPane:d,wrapperPane:u,componentTitle:m,...p}),B=S?.key??null,V=f,H=T.length===0?null:(0,i.jsx)(`div`,{className:$n.TaskPaneAreaFrames,style:{display:`flex`,flex:`1 1 100%`,minWidth:0,minHeight:0,position:`relative`},children:T.map(e=>{let t=e.key===B;return t||e.keepMounted?(0,i.jsx)(`div`,{className:P($n.TaskPaneAreaFrameHost,!t&&$n.TaskPaneAreaFrameHidden),style:{display:t?`flex`:`none`,flex:`1 1 100%`,minWidth:0,minHeight:0},children:V?(0,i.jsx)(V,{children:z(e)}):z(e)},e.key):null})}),U=y?R:H,W=y?H:R;return(0,i.jsxs)(`div`,{ref:L,className:P(`taskpane-area`,n,$n.TaskPaneArea),style:v,children:[U,W]})}));rr.displayName=`TaskPaneArea`;var ir=`white`,ar=`black`,or=(e,t)=>{let n=e.getStyle().getProperties(),r=n.headerRow?.fill?.background??n.wholeTable?.border?.top?.color?.toString();if(r&&t){let e=t.getStyles().parseColor(r);if(e)return e.toCSS(`adaptive`)}return`var(--sxl-color-neutral, grey)`},sr={font:`11px/1.5 system-ui, sans-serif`,color:`white`,padding:`1px 8px`,borderRadius:4,whiteSpace:`nowrap`,boxShadow:`0 1px 4px rgba(0,0,0,0.3)`,cursor:`default`},cr=({handleProps:e,size:t,background:n})=>{let r=t/2-1.5,a=t/3;return(0,i.jsx)(`div`,{...e,style:{...e.style,width:t,height:t},children:(0,i.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,style:{display:`block`,overflow:`visible`},children:(0,i.jsx)(`path`,{shapeRendering:`crispEdges`,d:`M ${r-a} ${r} L ${r} ${r} L ${r} ${r-a}`,stroke:n,strokeWidth:2,strokeLinejoin:`miter`,fill:`none`})})})},lr=(e,t)=>({rowStart:e.rowStart,colStart:e.colStart,rowEnd:Math.max(e.rowStart,t.rowIndex),colEnd:Math.max(e.colStart,t.colIndex)}),ur=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${ar}' fill='${ir}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`,dr=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${ar}' fill='${ir}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,fr=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${ar}' fill='${ir}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,pr=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{sheet:n,onEditTable:c,className:u,...d}=e,f=(0,o.useGridPane)(),{visibleTables:p,cacheToken:m}=Kt(n),h=Qn(),g=(0,s.useCallbackRef)(async e=>{c?await c(e):(await e.select(),h.activate(`tableDetails`,{}))},[c]),[_,v]=(0,r.useState)(null),[y,b]=(0,r.useState)(null),[x,S]=(0,r.useState)(null),C=(0,o.useHoverIntent)({openDelay:0,closeDelay:400}),[w,T]=(0,r.useState)(null),E=(0,r.useRef)(null),[D,O]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),j=(0,r.useRef)(!1),M=(0,s.useCallbackRef)(e=>{e.preventDefault(),e.stopPropagation();let t=f.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});r.length===1&&r[0].select()},[f,n]),N=(0,s.useCallbackRef)(e=>{e.preventDefault(),e.stopPropagation();let t=f.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});if(r.length===1){let e=r[0].getRange().getCoords(),i={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};n.getRange(i).select()}},[f,n]),F=(0,s.useCallbackRef)(e=>{e.preventDefault(),e.stopPropagation();let t=f.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let r=n.getTables().getItems({address:t});if(r.length===1){let e=r[0].getRange().getCoords(),i={colStart:t.colIndex,rowStart:e.rowStart,colEnd:t.colIndex,rowEnd:e.rowEnd};n.getRange(i).select()}},[f,n]);l(n?.getSelection(),{onChange(e){v(n.getSelection().getCoords().cell)}}),(0,r.useEffect)(()=>{let e=null;if(p&&_){let t=p.length;for(let n=0;n<t&&!e;n++){let t=p[n];if(t.isDeleted())continue;let r=t.getRange().getCoords();a.CoordUtils.isCellWithinRange(_,r)&&(e=t)}}b(e)},[_,p]);let I=(0,s.useCallbackRef)(e=>{if(j.current)return;let t=null;if(p){let n=p.length;for(let r=0;!t&&r<n;r++){let n=p[r];if(n.isClosed()||n.isDeleted())continue;let i=n.getRange().getCoords(),a=f.getBoundsFromRange(i),o=f.getPanePointFromPointer(e.clientX,e.clientY);if(!o)continue;let s=o.x,c=o.y;if(s>=a.x&&s<=a.x+a.width&&c>=a.y&&c<=a.y+a.height){let e=f.getSurfaceSize();s<=0||c<=0||s>=e.width||c>=e.height||(t=n)}}}S(t);let n=t?t.getName():null;t&&n!==E.current&&T(t),E.current=n,C.setTarget(n)},[f,p]),L=(0,s.useCallbackRef)(()=>{j.current||(S(null),E.current=null,C.setTarget(null))},[]),R=(0,r.useMemo)(()=>{if(!p||p.length===0)return null;let e=[],t=p.length;for(let r=0;r<t;r++){let t=p[r];if(t.isDeleted())continue;let a=t===x,s=t===y,c=t.getRange().getCoords(),l=f.getBoundsFromRange(c),u;if(a||s){let e=t.getStyle().getProperties(),r=e.headerRow?.fill?.background??e.wholeTable?.border?.top?.color?.toString();if(r&&n){let e=n.getStyles().parseColor(r);e&&(u=e.toCSS(`adaptive`))}u||=`var(--sxl-color-shadow, rgba(0,0,0,.15))`}e.push((0,i.jsx)(`div`,{style:{position:`absolute`,left:l.x,top:l.y,width:Math.min(16,l.width),height:l.height,pointerEvents:`all`,cursor:dr},onMouseDown:N},`table-select-row-${t.getName()}`)),e.push((0,i.jsx)(`div`,{style:{position:`absolute`,left:l.x,top:l.y,width:l.width,height:Math.min(7,l.height),pointerEvents:`all`,cursor:ur},onMouseDown:F},`table-select-column-${t.getName()}`)),e.push((0,i.jsx)(`div`,{style:{position:`absolute`,left:l.x,top:l.y,width:Math.min(16,l.width),height:Math.min(16,l.height),pointerEvents:`all`,cursor:fr},onMouseDown:M},`table-select-${t.getName()}`)),e.push((0,i.jsx)(o.RangeRect,{range:c,stroke:u??`var(--sxl-color-neutral, grey)`,propsStrokePath:{strokeWidth:.5,style:{willChange:`opacity, filter`,transition:`opacity 80ms ease-in-out, filter 80ms ease-in-out`,opacity:s||a?1:0,filter:a?`drop-shadow(0px 0px 1px ${u})`:void 0}}},`table-outline-${t.getName()}`))}return e},[n,f,x,y,p,m]),z=C.open&&w&&!w.isDeleted()?(0,i.jsx)(o.StickyFloat,{anchor:{range:w.getRange().getCoords()},placement:{side:`r`,align:`start`},offset:4,whenOff:`clamp`,children:(0,i.jsxs)(`div`,{...C.tipProps,onPointerDown:async e=>{g&&g(w),e.stopPropagation()},style:{...sr,...C.tipProps.style,background:or(w,n),cursor:`pointer`,padding:`2px 6px`,display:`inline-flex`,alignItems:`center`,gap:6},children:[(0,i.jsx)(`span`,{children:w.getName()}),(0,i.jsx)(s.DynamicIcon,{iconKey:`Table`,size:14})]})}):null,B=f.getVisibleRange(),V=(p??[]).map(e=>{if(e.isDeleted())return null;let t=e.getRange().getCoords();return a.CoordUtils.isCellWithinRange({rowIndex:t.rowEnd,colIndex:t.colEnd},B)?(0,i.jsx)(o.DragHandle,{range:e===k&&D?D:t,anchor:`br`,size:12,background:or(e,n),renderHandle:cr,onDragStart:()=>{j.current=!0,A(e)},onDragMove:(e,n)=>O(lr(t,n)),onDragEnd:(n,r)=>{j.current=!1,A(null),O(null);let i=lr(t,r);if(i.rowEnd!==t.rowEnd||i.colEnd!==t.colEnd)try{e.resize(i)}catch{}}},`table-resize-${e.getName()}`):null}),H=k&&D?(0,i.jsx)(o.RangeRect,{range:D,stroke:or(k,n),alignWidth:1}):null;return(0,i.jsxs)(o.Layer,{onMouseMove:I,onMouseLeave:L,className:P(u,`table`),children:[R,H,V,z]})}));function mr(e,t){let{manager:n,notifier:r}=t;if(!n)return()=>{};let i={undoManager:n},o=()=>{let t=n.getTopUndoDescription(),o=n.getTopRedoDescription();e.updateCommand(`undo`,{context:i,callback:e=>{try{n.undo(e??1)}catch(e){r?.showError?.(e)}},disabledReasons:n.hasUndo()?[]:[(0,a.messageKey)(`reason.nothingToUndo`)],params:{hasAction:!!t,action:t?(0,a.t)(t):``}}),e.updateCommand(`redo`,{context:i,callback:e=>{try{n.redo(e??1)}catch(e){r?.showError?.(e)}},disabledReasons:n.hasRedo()?[]:[(0,a.messageKey)(`reason.nothingToRedo`)],params:{hasAction:!!o,action:o?(0,a.t)(o):``}})};o();let s=n.addListener({onStackChange:o});return()=>{s()}}var hr=(0,r.createContext)(null),gr=()=>(0,r.useContext)(hr),_r=(e,t)=>!!e&&(e.getTags?.()??[]).includes(t);function vr(e){let{transaction:t,notifier:n,manager:r}=e,i=e.isRepeatable??(e=>!_r(e,`noRepeat`)),a=Promise.resolve();return e=>(o,s)=>{if(_r(s,`noTransaction`))return e(o,s);let c=a.then(async()=>{let a=s?.getLabel?.()??void 0,c=n?await Promise.resolve(n.showBusy(a??`Working…`)):null;try{let n;return await t.doBatch(async()=>{n=await e(o,s)},a),r&&s&&i(s)&&r.setRepeatableOperation({description:a??`last action`,repeat:()=>{s.execute(o)}}),n}catch(e){e&&n?.showError?.(e)}finally{c?.()}});return a=c.then(()=>{},()=>{}),c}}var yr=s.ReactUtils.isEditable,br=[`copy`,`cut`,`paste`,`selectAll`,`undo`,`redo`];function xr(e){let{clipboard:t}=e,n=new Set(e.keys??br);return(e,r)=>{if(!n.has(e)||!yr(r))return;let i=r;switch(e){case`copy`:return{callback:()=>async function(e,t){let n=Tr(e);n&&await t.writeText(n)}(i,t.getClipboard()),disabledReasons:Cr(i)?[]:[(0,a.messageKey)(`reason.noSelection`)]};case`cut`:return{callback:()=>async function(e,t){let n=Tr(e);n&&(await t.writeText(n),function(e){if(!(typeof document<`u`&&document.execCommand(`delete`))&&Sr(e)){let t=e.selectionStart??0,n=e.selectionEnd??t;if(t===n)return;e.setRangeText(``,t,n,`end`),e.dispatchEvent(new Event(`input`,{bubbles:!0}))}}(e))}(i,t.getClipboard()),disabledReasons:Cr(i)?[]:[(0,a.messageKey)(`reason.noSelection`)]};case`paste`:return{callback:()=>async function(e,t){let n=await t.readText();n&&function(e,t){if(Sr(e)){let n=e.selectionStart??e.value.length;s.ReactUtils.replaceRangeText(e,n,e.selectionEnd??n,t);return}typeof document<`u`&&document.execCommand(`insertText`,!1,t)}(e,n)}(i,t.getClipboard())};case`selectAll`:return{callback:()=>function(e){Sr(e)?e.select():typeof document<`u`&&document.execCommand(`selectAll`)}(i),disabledReasons:wr(i)?[]:[(0,a.messageKey)(`reason.nothingToSelect`)]};case`undo`:return{callback:()=>Er(`undo`)};case`redo`:return{callback:()=>Er(`redo`)};default:return}}}function Sr(e){let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`}function Cr(e){if(Sr(e))return(e.selectionStart??0)!==(e.selectionEnd??0);let t=typeof window<`u`?window.getSelection():null;return!!t&&!t.isCollapsed&&t.toString().length>0}function wr(e){return Sr(e)?e.value.length>0:(e.textContent??``).length>0}function Tr(e){return Sr(e)?e.value.substring(e.selectionStart??0,e.selectionEnd??0):(typeof window<`u`?window.getSelection()?.toString():``)??``}function Er(e){typeof document<`u`&&document.execCommand(e)}var{useCommandResolver:Dr}=s.Command,Or=()=>{let e=(0,s.useGlobalClipboard)(),t=(0,r.useRef)(e);t.current=e;let n=(0,r.useMemo)(()=>xr({clipboard:{getClipboard:()=>t.current.getClipboard()}}),[]),i=Dr();return(0,r.useEffect)(()=>{if(!i)return;let e=i.addResolveInjector(n),t=()=>i.invalidate();return document.addEventListener(`selectionchange`,t),()=>{e(),document.removeEventListener(`selectionchange`,t)}},[i,n]),null};Or.displayName=`InputClipboardInjector`;var kr=(0,r.createContext)(null);function Ar(){return(0,r.useContext)(kr)}var{CommandScopeContext:jr,CommandChainContext:Mr,useCommandScope:Nr,LayerActivation:Pr}=s.Command,Fr=({pane:e,children:t})=>{let n=Nr(),a=e.getAnchor(),o=(0,r.useMemo)(()=>n?new Pr(n.createChild(`pane:${a}`)):null,[n,a]);return(0,r.useEffect)(()=>{let e=o?.getBase();return()=>e?.dispose()},[o]),(0,r.useEffect)(()=>{if(o)return s.Command.attachWhenReady({get current(){return e.getElement()??null}},e=>o.getBase().attachElement(e,o))},[e,o]),o?(0,i.jsx)(Mr.Provider,{value:o,children:(0,i.jsx)(jr.Provider,{value:o.getBase(),children:t})}):t};Fr.displayName=`PaneScopeProvider`;var Ir={"chart.type.area":`Area Chart`,"chart.type.areaStacked":`Stacked Area Chart`,"chart.type.areaStackedPercent":`Percentage Area Chart`,"chart.type.bar":`Bar Chart`,"chart.type.barStacked":`Bar Stacked Chart`,"chart.type.barStackedPercent":`Bar Percent Chart`,"chart.type.bubble":`Bubble Chart`,"chart.type.bubble3D":`3D Bubble Chart`,"chart.type.column":`Column Chart`,"chart.type.columnStacked":`Stacked Column Chart`,"chart.type.columnStackedPercent":`Stacked Percentage Column Chart`,"chart.type.line":`Line Chart`,"chart.type.lineMarkers":`Line with Markers Chart`,"chart.type.lineStacked":`Stacked Line Chart`,"chart.type.lineStackedMarkers":`Line Stacked with Markers Chart`,"chart.type.lineStackedPercent":`Stacked Percentage Line Chart`,"chart.type.lineStackedPercentMarkers":`Line Percentage with Markers Chart`,"chart.type.pie":`Pie Chart`,"chart.type.pieDoughnut":`Pie Doughnut Chart`,"chart.type.scatterLines":`Scatter Chart with Lines`,"chart.type.scatterLinesMarkers":`Scatter Chart with Markers and Lines`,"chart.type.scatterLinesMarkersSmooth":`Scatter Chart with Markers and Smooth Lines`,"chart.type.scatterLinesSmooth":`Scatter Chart with Smooth Lines`,"chart.type.scatterMarkers":`Scatter Chart with Markers`,"clipboard.pasting":`Pasting...`,"dialog.activate":`Activate`,"dialog.activateTask.inputLabel":`Task Name`,"dialog.activateTask.title":`Activate Task`,"dialog.confirm.title":`Confirm`,"dialog.goTo":`Go To`,"dialog.goTo.inputLabel":`Location`,"dialog.goTo.title":`Go To`,"dialog.insert":`Insert`,"dialog.insertImage.description":`Enter the web address for the image to insert.`,"dialog.insertImage.inputLabel":`Address`,"dialog.insertImage.title":`Insert Image from Web`,"dialog.newCellStyle.description":`Enter a name for the new cell style.`,"dialog.newCellStyle.inputLabel":`Style Name`,"dialog.newCellStyle.title":`New Cell Style`,"dialog.password.description":`Enter the password to unprotect this sheet.`,"dialog.password.title":`Password Required`,"dialog.unprotect":`Unprotect`,"editMode.copy":`'Copy' Select destination and press ENTER or choose Paste.`,"editMode.cut":`'Cut' Select destination and press ENTER or choose Paste.`,"editMode.dragCopy":`Drag selection to copy cell contents.`,"editMode.dragCopyInsert":`Drag selection to insert copied cell contents.`,"editMode.dragCut":`Drag selection to move cell contents.`,"editMode.dragCutInsert":`Drag selection to insert cell contents.`,"editMode.edit":`Edit`,"editMode.enter":`Enter`,"editMode.fill":`Drag selection to extend series or fill.`,"editMode.formatPainter":`Use the mouse to apply the copied format to another selection.`,"error.clipboard.perms":`You do not have permissions to access the clipboard.
7
+ All copy and paste operations will be limited to the browser tab.`,"error.clipboard.safari":`The Safari browser does not support advanced copy and paste.
8
+ Copy and paste will be limited to within the browser tab.
12
9
 
13
- The table and table specific styling will be removed but the values will be preserved.`,icon:"InsertTable"},function(u){xe(this,u,!0)}),new r.Command("convertTableToRange",l,{label:"Convert To Range",description:`Convert the table into a normal range of cells.
10
+ Please use Chrome or Edge if external copy and paste is required.`,"error.insertImage.unresolved":`Unable to resolve image.`,"error.removeDuplicates.multipleRanges":`Can not perform Remove Duplicates on multiple cell ranges. Please select a single range and try again.`,"error.sort.invalidSelection":`Invalid sort selection. Sort requires a single range with data.`,"error.sort.multipleRanges":`Can not sort on multiple cell ranges. Please select a single range and try again.`,"error.textToColumns.multipleRanges":`Can not perform Text to Columns on multiple cell ranges. Please select a single range and try again.`,"findReplace.replaced":`We replaced {count} cells.`,"formulaInput.equalsRequired":`Formula must start with '='.`,"formulaInput.invalid":`Invalid Formula`,"formulaTrace.noDependents":`No formulas refer to the selected cells.`,"formulaTrace.noPrecedents":`The selected cells have no formulas that refer to other cells.`,"functionPreview.anyValue":`Any value`,"functionPreview.close":`Close`,"functionPreview.collapse":`Collapse`,"functionPreview.expand":`Expand`,"functionPreview.optional":`Optional`,"functionPreview.repeatable":`Repeatable`,"functionPreview.type":`Type: {type}`,"functionPreview.typeName.boolean":`logical`,"functionPreview.typeName.error":`error`,"functionPreview.typeName.null":`empty`,"functionPreview.typeName.number":`number`,"functionPreview.typeName.richData":`data`,"functionPreview.typeName.string":`text`,"namedInput.invalid":`Invalid Name`,"op.alignBottom":`Align Bottom`,"op.alignCenter":`Align Center`,"op.alignLeft":`Align Left`,"op.alignMiddle":`Align Middle`,"op.alignRight":`Align Right`,"op.alignTop":`Align Top`,"op.anchor":`Anchor`,"op.bringForward":`Bring Forward`,"op.bringToFront":`Bring to Front`,"op.convertTableToRange":`Convert Table to Range`,"op.copyCells":`Copy Cells`,"op.deleteMovable":`Delete`,"op.deleteTable":`Delete Table`,"op.distributeHorizontally":`Distribute Horizontally`,"op.distributeVertically":`Distribute Vertically`,"op.findReplace":`Find & Replace`,"op.insertMovedCells":`Insert Moved Cells`,"op.lockAspectRatio":`Lock Aspect Ratio`,"op.mergeCells":`Merge Cells`,"op.moveCells":`Move Cells`,"op.moveMovable":`Move`,"op.nudgeMovable":`Nudge`,"op.numberFormat":`Number Format`,"op.resizeColumnsNamed":`{count, plural, one {Resize Column ''{name}''} other {Resize Columns ''{name}''}}`,"op.resizeMovable":`Resize`,"op.resizeRowsNamed":`{count, plural, one {Resize Row ''{name}''} other {Resize Rows ''{name}''}}`,"op.rotateMovable":`Rotate`,"op.sendBackward":`Send Backward`,"op.sendToBack":`Send to Back`,"op.sortCustom":`Custom Sort`,"op.typeInto":`Type ''{text}'' into {range}`,"op.unmergeCells":`Unmerge Cells`,"op.updateComment":`Update Comment`,"op.updateHyperlink":`Update Hyperlink`,"reason.alreadyTable":`The selection is already in a table.`,"reason.continuousSpan":`Not available with continuous / fill alignment.`,"reason.entireColumn":`Not available when entire columns are selected.`,"reason.entireRow":`Not available when entire rows are selected.`,"reason.freezeOrigin":`Select a cell below and/or right of where the panes should freeze.`,"reason.mergeUnavailable":`Merge is not available for this selection.`,"reason.mixedSelection":`Not available for a mixed full / partial selection.`,"reason.noFreeze":`No frozen panes.`,"reason.noMerge":`No merged cells in the selection.`,"reason.noPreviousSearch":`Nothing has been searched for yet.`,"reason.noSelection":`Nothing is selected.`,"reason.noTableStyle":`No table style to clear.`,"reason.nothingToRedo":`Nothing to redo.`,"reason.nothingToSelect":`Nothing to select.`,"reason.nothingToUndo":`Nothing to undo.`,"reason.notImplemented":`Not yet implemented.`,"reason.overlap":`Not available for an overlapping selection.`,"reason.sheetLocked":`The sheet is locked.`,"reason.sheetProtected":`The sheet is protected.`,"reason.singleColumn":`Select a single column.`,"reason.sortRange":`Sort requires a single range.`,"reason.tableAmbiguous":`Select cells within a single table.`,"reason.tableBodyRows":`Select rows within the table body.`,"referenceInput.cancel":`Cancel`,"referenceInput.commit":`Commit`,"referenceInput.crossSheet":`Reference must be on the same sheet`,"referenceInput.invalid":`Invalid Reference`,"referenceInput.selectCurrent":`Select Current Range`,"resizeIndicator.height":`Height`,"resizeIndicator.hiddenDisplay":`{label}: Hidden`,"resizeIndicator.sizeDisplay":`{label}: {unit} ({px} pixels)`,"resizeIndicator.width":`Width`,"scrollbar.column":`Column: {title}`,"scrollbar.row":`Row: {title}`,"selection.replace":`Replace`,"selection.replaceData":`There is already data here. Do you want to replace it?`,"sheet.merge":`Merge`,"sheet.mergeCellsWarning":`Merging cells will only keep the upper-left value. Some data will be discarded. Continue?`,"table.columns.compact":`{count, plural, one{Table Column} other{# Table Columns}}`,"table.convert":`Convert`,"table.convertToRangeWarning":`Converting a table to range with ''{count}'' cells will set a large number of cell styles and may affect performance.
11
+ Continue?`,"table.deleteColumns":`{count, plural, one{Delete Table Column} other{Delete # Table Columns}}`,"table.deleteColumns.description":`Delete the selected table columns, shifting cells left only within the table.`,"table.deleteRows":`{count, plural, one{Delete Table Row} other{Delete # Table Rows}}`,"table.deleteRows.description":`Delete the selected table rows, shifting cells up only within the table.`,"table.insertColumns":`{count, plural, one{Insert Table Column} other{Insert # Table Columns}}`,"table.insertColumns.description":`Insert columns to the left of the selection, shifting cells right only within the table.`,"table.insertRows":`{count, plural, one{Insert Table Row} other{Insert # Table Rows}}`,"table.insertRows.description":`Insert rows above the selection, shifting cells down only within the table.`,"table.rows.compact":`{count, plural, one{Table Row} other{# Table Rows}}`,"workbook.untitled":`Untitled`,"workbookStrip.newSheet":`New sheet`},Lr=[{sourceId:`clipboard`,catalog:{scope:`app`,label:`Application`,tag:`en`,version:1,commands:{cut:{label:`Cut`,description:`Remove the selection and put it on the clipboard so you can paste it somewhere else.`,icon:`cut`,shortcut:[`ctrl+X`,`shift+Delete`]},copy:{label:`Copy`,description:`Put a copy of the selection on the clipboard so you can paste it somewhere else.`,icon:`copy`,shortcut:[`ctrl+C`,`ctrl+Insert`]},paste:{label:`Paste`,description:`Add content on the clipboard to your document.`,icon:`paste.yellow`,shortcut:[`ctrl+V`,`shift+Insert`]}}}},{sourceId:`editor`,catalog:{scope:`editor`,label:`Cell Editor`,tag:`en`,version:1,commands:{relativeReferencesToggle:{label:`Toggle References`,description:`Toggle cell references from relative to absolute, to partially absolute, back to relative again.`,shortcut:`F4`,tags:[`editor`]},toggleEditorFocus:{label:`Toggle Editor Focus`,description:`Move focus between editors such as the formula editor and the inline editor.`,shortcut:`ctrl+F2`,tags:[`editor`]},insertFunctionSum:{label:`Quick Sum`,description:`Quick sum of the cells.`,groupLabels:{insertFunctionSumOptions:`Sum`},icon:`FunctionSum`,shortcut:`alt+=`,tags:[`mutator`],borrow:[`sheet`]},insertFunctionAverage:{label:`Quick Average`,description:`Quick average of the cells.`,groupLabels:{insertFunctionSumOptions:`Average`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionCount:{label:`Quick Count`,description:`Quick count of the cells.`,groupLabels:{insertFunctionSumOptions:`Count Numbers`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMax:{label:`Quick Max`,description:`Quick maximum of the cells.`,groupLabels:{insertFunctionSumOptions:`Max`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMin:{label:`Quick Min`,description:`Quick minimum of the cells.`,groupLabels:{insertFunctionSumOptions:`Min`},tags:[`mutator`],borrow:[`sheet`]},insertCurrentTime:{label:`Current Time`,description:`Insert the current time.`,shortcut:`ctrl+shift+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertCurrentDate:{label:`Current Date`,description:`Insert the current date.`,shortcut:`ctrl+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertValueAbove:{label:`Copy From Above`,description:`Copy the value from the cell above the active cell into the cell or the formula bar.`,shortcut:[`ctrl+Quote`,`ctrl+shift+"`],tags:[`mutator`],borrow:[`sheet`]}}}},{sourceId:`movable`,catalog:{scope:`movable`,label:`Objects`,tag:`en`,version:1,commands:{moveToFront:{label:`Bring to Front`,description:`Move to the front of all of the other drawings.`,icon:`DrawToFront`,shortcut:`ctrl+shift+BracketRight`},moveForward:{label:`Bring Forward`,description:`Move forward one layer in the z order.`,icon:`DrawMoveForward`,shortcut:`ctrl+BracketRight`},moveToBack:{label:`Send to Back`,description:`Move to the back of all of the other drawings.`,icon:`DrawToBack`,shortcut:`ctrl+shift+BracketLeft`},moveBackward:{label:`Send Backward`,description:`Move backwards one layer in the z order.`,icon:`DrawMoveBackward`,shortcut:`ctrl+BracketLeft`},toggleLockAspectRatio:{label:`Lock Aspect Ratio`,description:`Toggle whether the aspect ratio should be maintained when resizing from corners.`,icon:`DrawAspect`},formatAnchorTypeTwoCell:{label:`Move and size with cells`,description:`Set your drawing to move and resize when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeOneCell:{label:`Move but don't size with cells`,description:`Set your drawing to only move when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeAbsolute:{label:`Don't move or size with cells`,description:`Set your drawing to never move or resize when underling sheet resizes.`,icon:`DrawResize`},formatDrawAlignLeft:{label:`Align Left`,description:`Align the selected drawings to the left.`,icon:`DrawAlignLeft`},formatDrawAlignCenter:{label:`Align Center`,description:`Align the selected drawings vertically relative to each other.`,icon:`DrawAlignCenter`},formatDrawAlignRight:{label:`Align Right`,description:`Align the selected drawings to the right.`,icon:`DrawAlignRight`},formatDrawAlignTop:{label:`Align Top`,description:`Align the selected drawings to the top.`,icon:`DrawAlignTop`},formatDrawAlignMiddle:{label:`Align Middle`,description:`Align the selected drawings horizontally relative to each other.`,icon:`DrawAlignMiddle`},formatDrawAlignBottom:{label:`Align Bottom`,description:`Align the selected drawings to the bottom.`,icon:`DrawAlignBottom`},formatDrawDistributeHorz:{label:`Distribute Horizontally`,description:`Distribute the selected drawings horizontally with equal spacing between each.`,icon:`DrawDistributeHorz`},formatDrawDistributeVert:{label:`Distribute Vertically`,description:`Distribute the selected drawings vertically with equal spacing between each.`,icon:`DrawDistributeVert`},formatDrawFlipHorz:{label:`Flip Horizontally`,description:`Flip the selected drawings horizontally.`},formatDrawFlipVert:{label:`Flip Vertically`,description:`Flip the selected drawings vertically.`},formatDrawGroup:{label:`Group`,description:`Group the selected drawings into a single drawing.`,icon:`DrawGroup`},formatDrawUngroup:{label:`Ungroup`,description:`Break the group of a drawing into individual drawings.`,icon:`DrawUngroup`},formatDrawSwapShapes:{label:`Swap Shapes`,description:`Swap the positions of the swap.`},formatDrawSwapShapesHorz:{label:`Swap Shapes Horizontally`,description:`Swap the positions of the swap horizontally.`},formatDrawSwapShapesVert:{label:`Swap Shapes Vertically`,description:`Swap the positions of the swap vertically.`}}}},{sourceId:`selection`,catalog:{scope:`selection`,label:`Selection`,tag:`en`,version:1,commands:{moveToPageDown:{label:`Page Down`,description:`Shift viewport down one page.`,shortcut:`PageDown`,tags:[`selection`]},selectToPageDown:{label:`Select To Page Down`,description:`Shift viewport and select down one page.`,shortcut:`shift+PageDown`,tags:[`selection`]},moveToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`alt+PageDown`,tags:[`selection`]},selectToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`shift+alt+PageDown`,tags:[`selection`]},moveToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`PageUp`,tags:[`selection`]},selectToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`shift+PageUp`,tags:[`selection`]},moveToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`alt+PageUp`,tags:[`selection`]},selectToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`shift+alt+PageUp`,tags:[`selection`]},selectColumn:{label:`Select Column`,description:`Select the columns for the selected cells.`,shortcut:`ctrl+Space`,tags:[`selection`]},selectRow:{label:`Select Row`,description:`Select the rows for the selected cells.`,shortcut:`shift+Space`,tags:[`selection`]},selectToColumnStart:{label:`Select To Column Start`,description:`Select the columns to the beginning of the sheet.`,tags:[`selection`]},selectToColumnEnd:{label:`Select To Column End`,description:`Select the columns to the end of the sheet.`,tags:[`selection`]},moveToRowStart:{label:`Move to Row Home`,description:`Move to the beginning of the row.`,shortcut:`Home`,tags:[`selection`]},selectToRowStart:{label:`Select to Row Home`,description:`Select to the beginning of the row.`,shortcut:`shift+Home`,tags:[`selection`]},moveToGridStart:{label:`Move to Grid Home`,description:`Move to the beginning of the grid.`,shortcut:`ctrl+Home`,tags:[`selection`]},selectToGridStart:{label:`Select to Grid Home`,description:`Select to the beginning of the grid.`,shortcut:`ctrl+shift+Home`,tags:[`selection`]},moveToRowEnd:{label:`Move to Row End`,description:`Move to the end of the row.`,shortcut:`End`,tags:[`selection`]},selectToRowEnd:{label:`Select to Row End`,description:`Select to the end of the row.`,shortcut:`shift+End`,tags:[`selection`]},moveToGridEnd:{label:`Move to Grid End`,description:`Move to the end of the grid.`,shortcut:`ctrl+End`,tags:[`selection`]},selectToGridEnd:{label:`Select to Grid End`,description:`Select to the end of the grid.`,shortcut:`ctrl+shift+End`,tags:[`selection`]},scrollToActiveCoords:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell.`,shortcut:`ctrl+Backspace`,tags:[`selection`]},scrollToActiveCoordsClearSelection:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell and clear selection.`,shortcut:`shift+Backspace`,tags:[`selection`]},traverseSelectionRight:{label:`Traverse Right`,description:`Traverse the selection moving rightward.`,shortcut:`Tab`,tags:[`selection`]},traverseSelectionLeft:{label:`Traverse Left`,description:`Traverse the selection moving leftward.`,shortcut:`shift+Tab`,tags:[`selection`]},traverseSelectionDown:{label:`Traverse Down`,description:`Traverse the selection moving downward.`,shortcut:[`Enter`,`NumpadEnter`],tags:[`selection`]},traverseSelectionUp:{label:`Traverse Up`,description:`Traverse the selection moving upward.`,shortcut:[`shift+Enter`,`shift+NumpadEnter`],tags:[`selection`]},moveLeft:{label:`Move Left`,description:`Move active cell to the left.`,shortcut:`ArrowLeft`,tags:[`selection`]},selectLeft:{label:`Select Left`,description:`Extend selection left.`,shortcut:`shift+ArrowLeft`,tags:[`selection`]},moveContentfulLeft:{label:`Move Left Contentful`,description:`Move left to the next cell with content.`,shortcut:`ctrl+ArrowLeft`,tags:[`selection`]},selectContentfulLeft:{label:`Select Left Contentful`,description:`Extend selection left to the next cell with content.`,shortcut:`ctrl+shift+ArrowLeft`,tags:[`selection`]},moveRight:{label:`Move Right`,description:`Move active cell to the right.`,shortcut:`ArrowRight`,tags:[`selection`]},selectRight:{label:`Select Right`,description:`Extend selection right.`,shortcut:`shift+ArrowRight`,tags:[`selection`]},moveContentfulRight:{label:`Move Right Contentful`,description:`Move right to the next cell with content.`,shortcut:`ctrl+ArrowRight`,tags:[`selection`]},selectContentfulRight:{label:`Select Right Contentful`,description:`Extend selection right to the next cell with content.`,shortcut:`ctrl+shift+ArrowRight`,tags:[`selection`]},moveUp:{label:`Move Up`,description:`Move active cell to the up.`,shortcut:`ArrowUp`,tags:[`selection`]},selectUp:{label:`Select Up`,description:`Extend selection up.`,shortcut:`shift+ArrowUp`,tags:[`selection`]},moveContentfulUp:{label:`Move Up Contentful`,description:`Move up to the next cell with content.`,shortcut:`ctrl+ArrowUp`,tags:[`selection`]},selectContentfulUp:{label:`Select Up Contentful`,description:`Extend selection up to the next cell with content.`,shortcut:`ctrl+shift+ArrowUp`,tags:[`selection`]},moveDown:{label:`Move Down`,description:`Move active cell to the down.`,shortcut:`ArrowDown`,tags:[`selection`]},selectDown:{label:`Select Down`,description:`Extend selection down.`,shortcut:`shift+ArrowDown`,tags:[`selection`]},moveContentfulDown:{label:`Move Down Contentful`,description:`Move down to the next cell with content.`,shortcut:`ctrl+ArrowDown`,tags:[`selection`]},selectContentfulDown:{label:`Select Down Contentful`,description:`Extend selection down to the next cell with content.`,shortcut:`ctrl+shift+ArrowDown`,tags:[`selection`]},traverseSelectionPreviousRange:{label:`Traverse Previous Range`,description:`Traverse the selection to the previous range.`,shortcut:`ctrl+alt+ArrowLeft`,tags:[`selection`]},traverseSelectionNextRange:{label:`Traverse Next Range`,description:`Traverse the selection to the next range.`,shortcut:`ctrl+alt+ArrowRight`,tags:[`selection`]},traverseSelectionCorners:{label:`Traverse Corners`,description:`Traverse the selection through the corners of the selected range.`,shortcut:`ctrl+.`,tags:[`selection`]}}}},{sourceId:`sheet`,catalog:{scope:`sheet`,label:`Sheet`,tag:`en`,version:1,commands:{gridlinesToggle:{label:`Gridlines`,description:`Toggle whether the lines between rows and columns in the sheet are displayed.`,groupLabels:{view:`Gridlines`}},sheetViewToggleGridlinesRows:{label:`Row Gridlines`,description:`Toggle whether the lines between rows in the sheet are displayed.`,groupLabels:{view:`Row Gridlines`,gridlinesOptions:`Rows`}},sheetViewToggleGridlinesColumns:{label:`Column Gridlines`,description:`Toggle whether the lines between columns in the sheet are displayed.`,groupLabels:{view:`Columns Gridlines`,gridlinesOptions:`Columns`}},sheetViewFormatGridlinesColor:{label:`Gridlines Color`,description:`Color the rows and column gridlines.`},sheetViewToggleShowHeadings:{label:`Headings`,description:`Toggle whether the row and column headings are displayed.`,groupLabels:{view:`Headings`}},sheetViewToggleShowHeadingRows:{label:`Row Headings`,description:`Toggle whether the row headings are displayed.`,groupLabels:{view:`Row Headings`,headingsOptions:`Rows`}},sheetViewToggleShowHeadingColumns:{label:`Column Headings`,description:`Toggle whether the column headings are displayed.`,groupLabels:{view:`Columns Headings`,headingsOptions:`Columns`}},sheetViewToggleShowHeadingsNumeric:{label:`Numeric Headers`,description:`Toggle whether cell headings show numbers or A1 conventions.`,shortcut:`ctrl+shift+h`},sheetViewToggleFormulaView:{label:`Show Formulas`,description:`Toggle whether cells show formula or values.`,icon:`FormulaView`,shortcut:"ctrl+`"},sheetViewToggleShowZeros:{label:`Show Zeros`,description:`Toggle whether cell with zero value shows '0' or blank.`,icon:`ViewZero`},selectComments:{label:`Select Comments`,description:`Select the cells with comments.`,shortcut:`ctrl+shift+O`},selectAll:{label:`Select All`,description:`Select the closest data or the entire sheet if no data is nearby.`,shortcut:[`ctrl+A`,`ctrl+shift+Space`]},selectRegion:{label:`Select Region`,description:`Select the closest data.`,shortcut:`ctrl+shift+*`},clearHiddenSelection:{label:`Select Visible Cells`,description:`Break the selection around hidden rows and columns, leaving only the visible cells selected.`,shortcut:`alt+Semicolon`},formatTextRotate0:{label:`No Text Rotation`,description:`Remove all text rotation.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotate45:{label:`Angle Clockwise`,description:`Angle text 45 degrees downward.`,icon:`TextRotation45`,tags:[`mutator`]},formatTextRotate90:{label:`Rotate Text Down`,description:`Angle your text so that it aligns with the left.`,icon:`TextRotation90`,tags:[`mutator`]},formatTextRotate270:{label:`Rotate Text Up`,description:`Angle your text so that it aligns with the right.`,icon:`TextRotation2702`,tags:[`mutator`]},formatTextRotate315:{label:`Angle Counterclockwise`,description:`Angle text 45 degrees upward.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotateCustom:{label:`Custom Text Rotation`,description:`Angle your text using a custom angle.`,icon:`TextRotationCustom`,tags:[`mutator`],groupLabels:{textRotateOptions:`Custom`}},formatTextRotateVertical:{label:`Vertical Text`,description:`Stack text vertically.`,icon:`TextRotationVertical`,tags:[`mutator`]},sortAscending:{label:`Sort Ascending`,description:`Lowest to Highest.`,groupLabels:{sortOptions:`Ascending`,sortFilterOptions:`Ascending`},icon:`SortIncrease`,tags:[`mutator`]},sortDescending:{label:`Sort Descending`,description:`Highest to Lowest.`,groupLabels:{sortOptions:`Descending`,sortFilterOptions:`Descending`},icon:`SortDecrease`,tags:[`mutator`]},sortCustom:{label:`Custom Sort…`,description:`Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.`,groupLabels:{sortOptions:`Custom…`,sortFilterOptions:`Custom…`},icon:`SortCustom`,tags:[`mutator`]},protectionSheetToggle:{label:`{locked, select, true{Unprotect Sheet} other{Protect Sheet}}`,description:`Prevent unwanted changes from others by limiting their ability to edit.
12
+ For example, you can prevent people from editing locked cells or making formatting changes.`,groupLabels:{sheet:`{locked, select, true{Unprotect} other{Protect}}`},icon:`Lock`,params:{locked:!1}},formatSheetTabColor:{label:`Tab Color`,description:`Color the tab to help differentiate for other sheets.`,icon:`stroke.colored`},formatCellStyle:{label:`Cell Styles`,description:`A colorful style is a great way to make important data stand out on the sheet.`,groupLabels:{cellStyle:`Apply`},icon:`PresetStyles`,tags:[`mutator`]},formatTableStyle:{label:`{hasTable, select, true{Apply Table Style} other{Format as Table}}`,description:`Create a table or apply style to the current table.`,groupLabels:{tableStyleOptions:`Apply (Keep Styles)`},icon:`PresetStyles`,tags:[`mutator`],params:{hasTable:!1}},formatTableStyleClearCellStyles:{label:`Format as Table (Clear Styles)`,description:`Create a table or apply style to the current table and clears all cell styles.`,groupLabels:{tableStyleOptions:`Apply (Clear Styles)`},icon:`PresetStyles`},setDefaultTableStyle:{label:`Set Default Table Style`,description:`Sets the default table style used when a table is inserted.`,groupLabels:{tableStyleOptions:`Set As Default`}},deleteTableStyle:{label:`Delete Table Style`,description:`Remove the current table style.`,groupLabels:{tableStyleOptions:`Delete`}},formatBorder:{label:`Border`,description:`Create an outline border.`,tags:[`mutator`]},formatFillColor:{label:`Fill Color`,description:`Color the background of the cells to make them stand out.`,icon:`fill.colored`,tags:[`mutator`]},formatFontColor:{label:`Font Color`,description:`Change the color of your text.`,icon:`text.colored`,tags:[`mutator`]},formatBoldToggle:{label:`Bold`,description:`Toggle bold formatting of text.`,icon:`TextBold`,shortcut:[`ctrl+B`,`ctrl+2`],tags:[`mutator`]},formatItalicToggle:{label:`Italic`,description:`Toggle italic formatting of text.`,icon:`TextItalic`,shortcut:[`ctrl+I`,`ctrl+3`],tags:[`mutator`]},formatUnderlinedToggle:{label:`Underline`,description:`Underline the text.`,groupLabels:{underlineOptions:`Single`},icon:`TextUnderline`,shortcut:[`ctrl+u`,`ctrl+4`],tags:[`mutator`]},formatUnderlinedDoubleToggle:{label:`Double Underline`,description:`Double underline the text.`,groupLabels:{underlineOptions:`Double`},icon:`TextUnderlineDouble`},formatUnderlinedAccountingToggle:{label:`Accounting Underline`,description:`Use accounting underline for the text.`,groupLabels:{underlineOptions:`Accounting`},icon:`TextUnderlineAccounting`},formatUnderlinedAccountingDoubleToggle:{label:`Double Accounting Underline`,description:`Use accounting double underline the text.`,groupLabels:{underlineOptions:`Double Accounting`},icon:`TextUnderlineAccountingDouble`},formatStrikeThroughToggle:{label:`Strikethrough`,description:`Toggle strike-through formatting of text.`,icon:`TextStrike`,shortcut:`ctrl+5`,tags:[`mutator`]},formatSuperscriptToggle:{label:`Superscript`,description:`Format your text to be smaller and sit at the top of the line.`,icon:`TextSuperscript`,tags:[`mutator`]},formatSubscriptToggle:{label:`Subscript`,description:`Format your text to be smaller and sit at the bottom of the line.`,icon:`TextSubscript`,tags:[`mutator`]},formatAlignTopToggle:{label:`Align Top`,description:`Align text to the top.`,icon:`TextVerticalTop`,tags:[`mutator`]},formatTextOverflowVisibleToggle:{label:`Overflow Text`,description:`Overflow text to the next cells.`,icon:`TextHorizontalOverflow`,tags:[`mutator`]},formatTextOverflowWrapToggle:{label:`Wrap Text`,description:`Wrap text with the existing cell and increase the height as required.`,icon:`TextHorizontalWrap`,tags:[`mutator`]},formatTextOverflowClipToggle:{label:`Clip Text`,description:`Clip text that falls outside of the existing cell.`,icon:`TextHorizontalClip`,tags:[`mutator`]},formatTextOverflowShrinkToggle:{label:`Shrink Text`,description:`Shrink the text font to fit within existing cell.`,icon:`TextHorizontalShrink`,tags:[`mutator`]},formatTextOverflowEllipsisToggle:{label:`Ellipsis Text`,description:`Add a trailing '…' to the text to indicate text is partially hidden.`},formatAlignMiddleToggle:{label:`Align Middle`,description:`Align text so that it is centered between the top and bottom of the cell.`,icon:`TextVerticalCenter`,tags:[`mutator`]},formatAlignBottomToggle:{label:`Align Bottom`,description:`Align text to the bottom.`,icon:`TextVerticalBottom`,tags:[`mutator`]},formatAlignJustifyVerticalToggle:{label:`Justify Vertically`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedVerticalToggle:{label:`Distribute Vertically`,description:`Justify your content vertically.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignLeftToggle:{label:`Align Left`,description:`Align your content to the left.`,icon:`FormatAlignLeft`,tags:[`mutator`]},formatAlignCenterToggle:{label:`Align Center`,description:`Center your content.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignRightToggle:{label:`Align Right`,description:`Align your content to the right.`,icon:`FormatAlignRight`,tags:[`mutator`]},formatAlignJustifyToggle:{label:`Align Justify`,description:`Justify your content.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignCenterContinuousToggle:{label:`Center Across`,description:`Center your content across multiple cells.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignFillToggle:{label:`Fill Across`,description:`Repeat the value to fill the entire cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedHorizontalToggle:{label:`Distribute Horizontally`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatFontSizeIncrease:{label:`Increase Font Size`,description:`Make your text a bit bigger.`,icon:`TextSizeIncrease`,shortcut:`ctrl+shift+>`,tags:[`mutator`,`quickAction`]},formatFontSizeDecrease:{label:`Decrease Font Size`,description:`Make your text a bit smaller.`,icon:`TextSizeDecrease`,shortcut:`ctrl+shift+<`,tags:[`mutator`,`quickAction`]},formatFontFamily:{label:`Font`,description:`Select the font your text.`,tags:[`mutator`]},formatFontSize:{label:`Font Size`,description:`Change the size of your text.`,tags:[`mutator`]},formatNumberDialog:{label:`Custom Number Format`,description:`Create a custom number format.`,groupLabels:{numberFormatOptions:`Custom`},shortcut:[`ctrl+1`,`ctrl+alt+1`]},formatNumberFormat:{label:`Number Format`,description:`Choose the format for your cells, such as percentage, currency, date or time.`,tags:[`mutator`]},formatNumberFormatGeneralStyle:{label:`General Style`,description:`Remove all specific formatting.`,shortcut:`ctrl+shift+Backquote`,tags:[`mutator`]},formatNumberFormatNumberStyle:{label:`Number Style`,description:`Format as number with two decimals and comma.`,shortcut:`ctrl+shift+1`,tags:[`mutator`]},formatNumberFormatTimeStyle:{label:`Time Style`,description:`Format as time with hour and minute, and AM or PM.`,shortcut:`ctrl+shift+2`,tags:[`mutator`]},formatNumberFormatDateStyle:{label:`Date Style`,description:`Format as date with day, month, and year.`,shortcut:`ctrl+shift+3`,tags:[`mutator`]},formatNumberFormatAccountingStyle:{label:`Accounting Style`,description:`Format as Dollars, Euros, or other currency.`,icon:`CurrencyDollar`,shortcut:`ctrl+shift+4`,tags:[`mutator`,`quickAction`]},formatNumberFormatPercentStyle:{label:`Percent Style`,description:`Format as a percentage.`,icon:`Percent`,shortcut:`ctrl+shift+5`,tags:[`mutator`,`quickAction`]},formatNumberFormatScientificStyle:{label:`Scientific Style`,description:`Format as a scientific number with two decimal places .`,shortcut:`ctrl+shift+6`,tags:[`mutator`]},formatNumberFormatCommaStyle:{label:`Comma Style`,description:`Format with a thousands separator.`,icon:`Comma`,shortcut:`ctrl+,`,tags:[`mutator`,`quickAction`]},formatNumberFormatIncreaseDecimal:{label:`Increase Decimal`,description:`Show more decimal places for a more precise value.`,icon:`IncreaseDecimal2`,tags:[`mutator`,`quickAction`]},formatNumberFormatDecreaseDecimal:{label:`Decrease Decimal`,description:`Show few decimal places.`,icon:`DecreaseDecimal2`,tags:[`mutator`,`quickAction`]},displayPlaceholdersToggle:{label:`Display Placeholders`,description:`Switch between hiding objects, displaying objects, and displaying placeholders for objects.`,shortcut:`ctrl+6`},noOp:{label:`Do nothing`,description:`Do Nothing.`,shortcut:`ctrl+7`},displayOutlineSymbolsToggle:{label:`Display Outline Symbols`,description:`Display or hide the outline symbols.`,shortcut:`ctrl+8`},hideRows:{label:`{count, plural, one{Hide Row} other{Hide # Rows}}`,description:`Hide the rows.`,icon:`HideRow`,shortcut:`ctrl+9`,tags:[`mutator`],params:{count:1}},unhideRows:{label:`Unhide Rows`,description:`Unhide the rows.`,icon:`ShowRow`,shortcut:`ctrl+shift+(`,tags:[`mutator`]},hideColumns:{label:`{count, plural, one{Hide Column} other{Hide # Columns}}`,description:`Hide the columns.`,icon:`HideColumn`,shortcut:[`ctrl+0`,`ctrl+alt+0`],tags:[`mutator`],params:{count:1}},unhideColumns:{label:`Unhide Columns`,description:`Unhide the columns.`,icon:`ShowColumn`,shortcut:`ctrl+shift+)`,tags:[`mutator`]},calculate:{label:`Calculate Sheet`,description:`Recalculate the formulas on the current sheet.`,icon:`CalculateSheet`,shortcut:[`shift+F9`,`ctrl+=`]},insertFunctionDialog:{label:`Insert Function`,description:`Work with the function in the current cell.`,groupLabels:{insertFunctionSumOptions:`Function…`},icon:`FunctionThin`,shortcut:`shift+F3`,borrow:[`workbook`],tags:[`mutator`]},sheetZoomOut:{label:`Zoom Out`,description:`Zoom out to see less detail but more area.`,shortcut:[`ctrl+alt+-`,`ctrl+alt+NumpadSubtract`]},sheetZoomIn:{label:`Zoom In`,description:`Zoom in to see more detail but less area.`,shortcut:[`ctrl+alt+=`,`ctrl+alt+NumpadAdd`]},sheetZoom100:{label:`Zoom 100%`,description:`Zoom document to 100%.`,shortcut:`ctrl+alt+o`},sheetZoom200:{label:`Zoom 200%`,description:`Zoom document to 200%.`},sheetZoom75:{label:`Zoom 75%`,description:`Zoom document to 75%.`},sheetZoom50:{label:`Zoom 50%`,description:`Zoom document to 50%.`},sheetZoom25:{label:`Zoom 25%`,description:`Zoom document to 25%.`},sheetZoomCustom:{label:`Custom Zoom`,description:`Zoom document to a custom scale.`,groupLabels:{sheetZoomOptions:`Custom`}},updateHyperlink:{label:`Link`,description:`Create a hyperlink to either another webpage or another location within this document.`,groupLabels:{contextMenu:`Insert Link…`,hyperlinkOptions:`Edit…`},icon:`HyperlinkInsert`,shortcut:[`ctrl+K`,`ctrl+alt+K`]},openContextMenu:{label:`Context Menu`,description:`Open the context menu.`,shortcut:[`shift+F10`,`ContextMenu`]},openHyperlink:{label:`Open Link`,description:`Open the hyperlink or goto another location within this document.`,groupLabels:{hyperlinkOptions:`Open`},icon:`HyperlinkGoto`,shortcut:`ctrl+Enter`},deleteHyperlink:{label:`Delete Link`,description:`Remove the hyperlink.`,groupLabels:{hyperlinkOptions:`Delete`},icon:`HyperlinkDelete`},insertNote:{label:`Insert Note`,description:`Add a note to the cell.`,groupLabels:{contextMenu:`Insert Note…`},shortcut:`shift+F2`},updateComments:{label:`Comments`,description:`Add a comment to the current cell.`,groupLabels:{contextMenu:`Insert Comments…`},icon:`CommentInsert`,shortcut:`ctrl+alt+M`,tags:[`mutator`]},deleteComments:{label:`Delete Comments`,description:`Remove any comments.`,icon:`CommentDelete`,tags:[`mutator`]},insertImageFromFile:{label:`Insert Image`,description:`Insert a picture from your device.`,groupLabels:{contextMenu:`Insert Image…`,insertImageOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},insertImageFromURL:{label:`Insert Image From Web`,description:`Insert a picture from the web.`,groupLabels:{insertImageOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},manageDataValidation:{label:`Data Validation`,description:`Manage data validation rules to limit the type of data entered in a cell.`,groupLabels:{contextMenu:`Data Validation…`},icon:`DataValidation`},manageConditionalFormat:{label:`Conditional Formatting`,description:`Manage conditional formatting rules to change how cells look based on their values.`,groupLabels:{contextMenu:`Conditional Formatting…`,conditionalFormatOptions:`Manage Rules…`},icon:`ConditionalFormatOptions`},conditionalFormatNewRule:{label:`New Conditional Formatting Rule`,description:`Create a new conditional formatting rule for the selected cells.`,groupLabels:{conditionalFormatOptions:`New Rule…`}},conditionalFormatGreaterThan:{label:`Highlight Cells Greater Than`,description:`Highlight cells whose value is greater than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Greater Than…`},tags:[`mutator`]},conditionalFormatLessThan:{label:`Highlight Cells Less Than`,description:`Highlight cells whose value is less than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Less Than…`},tags:[`mutator`]},conditionalFormatBetween:{label:`Highlight Cells Between`,description:`Highlight cells whose value is between two values you set.`,groupLabels:{conditionalFormatHighlightOptions:`Between…`},tags:[`mutator`]},conditionalFormatEqualTo:{label:`Highlight Cells Equal To`,description:`Highlight cells whose value equals a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Equal To…`},tags:[`mutator`]},conditionalFormatTextContains:{label:`Highlight Cells with Text that Contains`,description:`Highlight cells whose text contains a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Text that Contains…`},tags:[`mutator`]},conditionalFormatDateOccurring:{label:`Highlight Cells with a Date Occurring`,description:`Highlight cells whose date falls in a period you set.`,groupLabels:{conditionalFormatHighlightOptions:`A Date Occurring…`},tags:[`mutator`]},conditionalFormatDuplicateValues:{label:`Highlight Duplicate Values`,description:`Highlight cells whose value appears more than once in the selection.`,groupLabels:{conditionalFormatHighlightOptions:`Duplicate Values…`},tags:[`mutator`]},conditionalFormatTopItems:{label:`Highlight Top 10 Items`,description:`Highlight the highest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10 Items…`},tags:[`mutator`]},conditionalFormatTopPercent:{label:`Highlight Top 10%`,description:`Highlight the top percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10%…`},tags:[`mutator`]},conditionalFormatBottomItems:{label:`Highlight Bottom 10 Items`,description:`Highlight the lowest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10 Items…`},tags:[`mutator`]},conditionalFormatBottomPercent:{label:`Highlight Bottom 10%`,description:`Highlight the bottom percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10%…`},tags:[`mutator`]},conditionalFormatAboveAverage:{label:`Highlight Above Average`,description:`Highlight values above the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Above Average…`},tags:[`mutator`]},conditionalFormatBelowAverage:{label:`Highlight Below Average`,description:`Highlight values below the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Below Average…`},tags:[`mutator`]},conditionalFormatDataBar:{label:`Data Bars`,description:`Add a colored bar to each cell whose length represents its value.`,groupLabels:{conditionalFormatOptions:`Data Bars`},tags:[`mutator`]},conditionalFormatColorScale:{label:`Color Scales`,description:`Color each cell along a gradient according to its value.`,groupLabels:{conditionalFormatOptions:`Color Scales`},tags:[`mutator`]},conditionalFormatIconSet:{label:`Icon Sets`,description:`Show an icon in each cell according to its value.`,groupLabels:{conditionalFormatOptions:`Icon Sets`},tags:[`mutator`]},conditionalFormatClearSelection:{label:`Clear Rules from Selected Cells`,description:`Remove the conditional formatting rules that touch the selected cells.`,groupLabels:{conditionalFormatClearOptions:`From Selected Cells`},tags:[`mutator`]},conditionalFormatClearSheet:{label:`Clear Rules from Entire Sheet`,description:`Remove every conditional formatting rule on this sheet.`,groupLabels:{conditionalFormatClearOptions:`From Entire Sheet`},tags:[`mutator`]},manageProtectedRange:{label:`Allow Edit Ranges`,description:`Manage ranges that stay editable while the sheet is protected.`,groupLabels:{contextMenu:`Allow Edit Ranges…`},icon:`Lock`},dataRemoveDuplicates:{label:`Remove Duplicates`,description:`Remove duplicate rows from a sheet.`,icon:`DataRemoveDuplicates`,tags:[`mutator`]},dataTextToColumns:{label:`Text to Columns`,description:`Split a single columns of text into multiple columns.`,icon:`DataTextToColumns`,tags:[`mutator`]},insertTable:{label:`Insert Table`,description:`Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.`,groupLabels:{contextMenu:`Insert Table…`},icon:`TableInsert`,shortcut:[`ctrl+L`]},editTable:{label:`Edit Table…`,description:`Edit the table to adjust formatting, sorting, filtering, or other advanced features.`,groupLabels:{tableOptions:`Edit…`,namedItem:`Edit…`},icon:`TableInsert`},deleteTable:{label:`Delete Table`,description:`Remove the table.
14
13
 
15
- The values and the formatting are preserved.`,icon:"InsertTable"},function(u){xe(this,u,!1)}),new r.Command("tableTotalRowToggle",l,{label:"Toggle Table Total Row",description:"Toggle Total Row on/off.",scopedLabels:{table:"Total Row"},shortcut:{key:"T",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}},function(){const u=this.getContext().table();u&&u.setShowTotals(!u.getShowTotals())}),new r.Command("tableHeaderRowToggle",l,{label:"Toggle Table Header Row",description:"Toggle Header Row on/off.",scopedLabels:{table:"Header Row"}},function(){const u=this.getContext().table();u&&u.setShowHeaders(!u.getShowHeaders())}),new r.Command("autoFilterToggle",l,{label:"Toggle Filter",scopedLabels:{filter:"Filter",sortFilter:"Filter"},description:"Toggle Auto Filter on/off.",icon:"FilterToggle",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){const u=this.getContext().table();u&&u.setShowFilterButton(!u.getShowFilterButton())}),new r.Command("autoFilterReapply",l,{label:"Reapply Filter",scopedLabels:{filter:"Reapply",sortFilter:"Reapply"},description:"Reapply the filter and sort with the latest changes.",icon:"FilterReapply",shortcut:{key:"L",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}}),new r.Command("autoFilterClear",l,{label:"Clear Filter",scopedLabels:{filter:"Clear",sortFilter:"Clear"},description:"Clear the filters criteria from the current filter..",icon:"FilterClear"}),new r.SimpleCommand("startEditValueAbove",l,{label:"Copy From Above",description:"Copy the value from the cell above the active cell into the cell or the formula bar.",shortcut:[{key:"Quote",modifiers:[r.KeyModifiers.Ctrl]},{key:'"',modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}]},ie),new r.Command("formatPainterToggle",l,{label:"Format Painter",description:"Apply style to another part of your workbook.",icon:"FormatPaint.yellow"}),new r.SimpleCommand("insertCells",l,{label:"Insert Cells",scopedLabels:{insertCells:"At Selection"},description:"Inserts cells at the current selection.",icon:"InsertCells",shortcut:{key:"=",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){Ce(this)}),new r.SimpleCommand("insertCellsShiftRight",l,{label:"Insert Cells (Shift Right)",scopedLabels:{insertCells:"Shift Right"},description:"Insert cells to the left and shift the current cells to the right.",icon:"InsertCellsRight"},function(){Ce(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("insertCellsShiftDown",l,{label:"Insert Cells (Shift Down)",scopedLabels:{insertCells:"Shift Down"},description:"Insert cells above and shift the current cells downward.",icon:"InsertCellsDown"},function(){return Ce(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("insertRows",l,{label:"Insert Row(s)",scopedLabels:{insertCells:"Row(s)"},description:"Insert a row above the current position.",icon:"InsertRow"},function(){return Ce(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("insertColumns",l,{label:"Insert Column(s)",scopedLabels:{insertCells:"Column(s)"},description:"Insert a column before the current position.",icon:"InsertColumn2"},function(){return Ce(this,d.IRange.Orientation.Column,!0)}),new r.SimpleCommand("insertRowsAfter",l,{label:"Insert Row Below",scopedLabels:{insertCells:"Row Below"},description:"Insert a row below the current position."},function(){return Ce(this,d.IRange.Orientation.Row,!0,!0)}),new r.SimpleCommand("insertColumnsAfter",l,{label:"Insert Column After",scopedLabels:{insertCells:"Column After"},description:"Insert a column after the current position."},function(){return Ce(this,d.IRange.Orientation.Column,!0,!0)}),new r.SimpleCommand("deleteCells",l,{label:"Delete Cells",scopedLabels:{deleteCells:"At Selection"},description:"Delete the cells.",icon:"DeleteCells",shortcut:{key:"-",modifiers:[r.KeyModifiers.Ctrl]}},function(){return ce(this)}),new r.SimpleCommand("deleteCellsShiftUp",l,{label:"Delete Cells (Shift Up)",scopedLabels:{deleteCells:"Shift up"},description:"Delete cells the current current downward.",icon:"DeleteCellsUp"},function(){return ce(this,d.IRange.Orientation.Row)}),new r.SimpleCommand("deleteCellsShiftLeft",l,{label:"Delete Cells (Shift Left)",scopedLabels:{deleteCells:"Shift Left"},description:"Delete cells the current cells to the right.",icon:"DeleteCellsLeft"},function(){return ce(this,d.IRange.Orientation.Column)}),new r.SimpleCommand("deleteRows",l,{label:"Delete Rows",scopedLabels:{deleteCells:"Rows"},description:"Delete the rows at the current selection.",icon:"DeleteRows"},function(){return ce(this,d.IRange.Orientation.Row,!0)}),new r.SimpleCommand("deleteColumns",l,{label:"Delete Columns",scopedLabels:{deleteCells:"Columns"},description:"Delete the columns at the current selection.",icon:"DeleteColumns"},function(){return ce(this,d.IRange.Orientation.Column,!0)}),new r.SimpleCommand("flashFill",l,{label:"Flash Fill",description:"Do a flash fill.",shortcut:[{key:"e",modifiers:[r.KeyModifiers.Ctrl]},{key:"e",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Alt]}]}),new r.SimpleCommand("fillDown",l,{label:"Fill Down",description:"Copy the top-most value from the selection to the bottom of the selection.",icon:"FillDown",shortcut:{key:"d",modifiers:[r.KeyModifiers.Ctrl]}},function(){return Te(this,d.IRange.Direction.Down)}),new r.SimpleCommand("fillRight",l,{label:"Fill Right",description:"Copy the left-most value from the selection to the right of the selection.",icon:"FillRight",shortcut:[{key:"r",modifiers:[r.KeyModifiers.Ctrl]}]},function(){return Te(this,d.IRange.Direction.Right)}),new r.SimpleCommand("fillUp",l,{label:"Fill Up",description:"Copy the bottom-most value from the selection to the top of the selection.",icon:"FillUp"},function(){return Te(this,d.IRange.Direction.Up)}),new r.SimpleCommand("fillLeft",l,{label:"Fill Left",description:"Copy the right-most value from the selection to the left of the selection.",icon:"FillLeft"},function(){return Te(this,d.IRange.Direction.Left)}),new r.SimpleCommand("formatBorderAddOutline",l,{label:"Add Outline Border",description:"Apply an outline border.",shortcut:{key:"7",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return b(this,{border:{left:{style:d.IBorder.StrokeStyle.Thin,color:null},top:{style:d.IBorder.StrokeStyle.Thin,color:null},right:{style:d.IBorder.StrokeStyle.Thin,color:null},bottom:{style:d.IBorder.StrokeStyle.Thin,color:null}}})}),new r.SimpleCommand("formatBorderClearOutline",l,{label:"Remove Outline Border",description:"Remove the outline border.",shortcut:{key:"_",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){return b(this,{border:null})}),new r.SimpleCommand("formatIndentDecrease",l,{label:"Decrease Indent",description:"Move your content closer to the border.",icon:"FormatIndentDecrease"},function(){return b(this,u=>{const L=u.getAlignment().getIndent()-1;return{alignment:{indent:L>0?L:0}}})}),new r.SimpleCommand("formatIndentIncrease",l,{label:"Increase Indent",description:"Move your content further from the border.",icon:"FormatIndentIncrease"},function(){return b(this,u=>{const L={alignment:{indent:u.getAlignment().getIndent()+1}};return u.getAlignment().getHorizontal()===d.ITextFrame.HorizontalAlignment.General&&(L.alignment.horizontal=d.ITextFrame.HorizontalAlignment.Left),L})}),new r.Command("mergeToggle",l,{label:"Merge",description:"Combine and center the contents into a single cell.",icon:"MergeAll",shortcut:{key:"m",modifiers:[r.KeyModifiers.Ctrl]}}),new r.SimpleCommand("mergeHorizontal",l,{label:"Merge Horizontally",description:"Combine the contents into horizontal rows.",icon:"MergeHorizontal"}),new r.SimpleCommand("mergeVertical",l,{label:"Merge Vertically",description:"Combine the contents into vertical columns.",icon:"MergeVertical"}),new r.SimpleCommand("unmerge",l,{label:"Unmerge",description:"Split merged cells into multiple cells.",icon:"MergeUnMerge"}),new r.SimpleCommand("clearContents",l,{label:"Clear Contents",scopedLabels:{clear:"Contents"},icon:"ClearContents",description:`Clear only the contents in the cells.
14
+ The table and table specific styling will be removed but the values will be preserved.`,groupLabels:{tableOptions:`Delete`,namedItem:`Delete`},icon:`TableInsert`,tags:[`mutator`]},convertTableToRange:{label:`Convert To Range`,description:`Convert the table into a normal range of cells.
16
15
 
17
- The formatting is not cleared.`,shortcut:{key:"Delete"}},function(){Re(this,d.ICell.Content.Values)}),new r.SimpleCommand("clearFormats",l,{label:"Clear Formats",scopedLabels:{clear:"Formats"},icon:"ClearFormats",description:"Clear only the formatting that is applied to the cells."},function(){Re(this,d.ICell.Content.Formats)}),new r.SimpleCommand("clearHyperlinks",l,{label:"Clear Hyperlinks",scopedLabels:{clear:"Hyperlinks"},description:"Clear only the hyperlinks in the cells."},function(){Re(this,d.ICell.Content.Hyperlinks)}),new r.SimpleCommand("clearComments",l,{label:"Clear Comments",scopedLabels:{clear:"Comments"},description:"Clear the comments from the cells."},function(){Re(this,d.ICell.Content.Comments)}),new r.SimpleCommand("clearAll",l,{label:"Clear All",scopedLabels:{clear:"All"},icon:"ClearAll",description:`Clears everything from the cells.
16
+ The values and the formatting are preserved.`,icon:`TableInsert`},tableFilterToggle:{label:`Sort & Filter`,description:`Toggle Auto Table on/off.`,groupLabels:{filterOptions:`Filter`,sortFilterOptions:`Sort & Filter`},icon:`FilterToggle`,shortcut:`ctrl+shift+L`},formatPainterToggle:{label:`Format Painter`,description:`Apply style to another part of your workbook.`,icon:`FormatPaint.yellow`},insertCells:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{{mode, select, copy{Insert Copied Cells} cut{Insert Cut Cells} other{Insert Cells}}{shift, select, right{ (Shift Right)} down{ (Shift Down)} other{}}}}`,description:`Inserts cells at the current selection.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied At Selection} cut{Cut At Selection} other{At Selection}}`},icon:`InsertCells`,shortcut:`ctrl+shift+Equal`,params:{mode:`none`,shift:`none`,span:`none`,count:1}},insertCellsShiftRight:{label:`{span, select, columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{Insert Cells (Shift Right)}}`,description:`Insert cells to the left and shift the current cells to the right.`,groupLabels:{insertCellsOptions:`{span, select, columns{{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}} other{Shift Right}}`},icon:`InsertCellsRight`,params:{mode:`none`,span:`none`,count:1}},insertCellsShiftDown:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} other{Insert Cells (Shift Down)}}`,description:`Insert cells above and shift the current cells downward.`,groupLabels:{insertCellsOptions:`{span, select, rows{{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}} other{Shift Down}}`},icon:`InsertCellsDown`,params:{mode:`none`,span:`none`,count:1}},insertRows:{label:`{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}`,description:`Insert a row above the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}`},icon:`InsertRow`,params:{count:1,mode:`none`}},insertColumns:{label:`{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}`,description:`Insert a column before the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}`},icon:`InsertColumn2`,params:{count:1,mode:`none`}},insertRowsAfter:{label:`{mode, select, copy{Insert Copied Rows Below} cut{Insert Cut Rows Below} other{{count, plural, one{Insert Row Below} other{Insert # Rows Below}}}}`,description:`Insert a row below the current position.`,groupLabels:{insertCellsOptions:`Row Below`},params:{count:1,mode:`none`}},insertColumnsAfter:{label:`{mode, select, copy{Insert Copied Columns After} cut{Insert Cut Columns After} other{{count, plural, one{Insert Column After} other{Insert # Columns After}}}}`,description:`Insert a column after the current position.`,groupLabels:{insertCellsOptions:`Column After`},params:{count:1,mode:`none`}},deleteCells:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells{shift, select, left{ (Shift Left)} up{ (Shift Up)} other{}}}}`,description:`Delete the cells.`,groupLabels:{deleteCellsOptions:`At Selection`},icon:`DeleteCells`,shortcut:`ctrl+Minus`,params:{span:`none`,count:1,shift:`none`}},deleteCellsShiftUp:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} other{Delete Cells (Shift Up)}}`,description:`Delete cells the current current downward.`,groupLabels:{deleteCellsOptions:`{span, select, rows{{count, plural, one{Row} other{# Rows}}} other{Shift up}}`},icon:`DeleteCellsUp`,params:{span:`none`,count:1}},deleteCellsShiftLeft:{label:`{span, select, columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells (Shift Left)}}`,description:`Delete cells the current cells to the right.`,groupLabels:{deleteCellsOptions:`{span, select, columns{{count, plural, one{Column} other{# Columns}}} other{Shift Left}}`},icon:`DeleteCellsLeft`,params:{span:`none`,count:1}},deleteRows:{label:`{count, plural, one{Delete Row} other{Delete # Rows}}`,description:`Delete the rows at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Row} other{# Rows}}`},icon:`DeleteRows`,params:{count:1}},deleteColumns:{label:`{count, plural, one{Delete Column} other{Delete # Columns}}`,description:`Delete the columns at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Column} other{# Columns}}`},icon:`DeleteColumns`,params:{count:1}},flashFill:{label:`Flash Fill`,description:`Do a flash fill.`,shortcut:[`ctrl+e`,`ctrl+alt+e`]},fillDown:{label:`Fill Down`,description:`Copy the top-most value from the selection to the bottom of the selection.`,icon:`FillDown`,shortcut:[`ctrl+d`,`ctrl+alt+d`],tags:[`mutator`]},fillRight:{label:`Fill Right`,description:`Copy the left-most value from the selection to the right of the selection.`,icon:`FillRight`,shortcut:[`ctrl+r`],tags:[`mutator`]},fillUp:{label:`Fill Up`,description:`Copy the bottom-most value from the selection to the top of the selection.`,icon:`FillUp`,tags:[`mutator`]},fillLeft:{label:`Fill Left`,description:`Copy the right-most value from the selection to the left of the selection.`,icon:`FillLeft`,tags:[`mutator`]},formatBorderAddOutline:{label:`Add Outline Border`,description:`Apply an outline border.`,shortcut:`ctrl+shift+7`,tags:[`mutator`]},formatBorderClearOutline:{label:`Remove Outline Border`,description:`Remove the outline border.`,shortcut:`ctrl+shift+_`,tags:[`mutator`]},formatIndentDecrease:{label:`Decrease Indent`,description:`Move your content closer to the border.`,icon:`FormatIndentDecrease`,tags:[`mutator`,`quickAction`]},formatIndentIncrease:{label:`Increase Indent`,description:`Move your content further from the border.`,icon:`FormatIndentIncrease`,tags:[`mutator`,`quickAction`]},mergeToggle:{label:`Merge`,description:`Combine and center the contents into a single cell.`,icon:`MergeAll`,shortcut:`ctrl+m`},mergeHorizontal:{label:`Merge Horizontally`,description:`Combine the contents into horizontal rows.`,icon:`MergeHorizontal`},mergeVertical:{label:`Merge Vertically`,description:`Combine the contents into vertical columns.`,icon:`MergeVertical`},unmerge:{label:`Unmerge`,description:`Split merged cells into multiple cells.`,icon:`MergeUnMerge`},clearContents:{label:`Clear Contents`,description:`Clear only the contents in the cells.
18
17
 
19
- All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){Re(this)}),new r.Command("freezeToggle",l,{label:"Freeze Panes",description:"Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).",icon:"FreezeBoth"}),new r.Command("freezeToggleHorizontal",l,{label:"Freeze Top Rows",description:"Keep the top rows visible while scrolling through the rest of the sheet.",icon:"FreezeRows"}),new r.Command("freezeToggleVertical",l,{label:"Freeze Left Columns",description:"Keep the left columns visible while scrolling through the rest of the sheet.",icon:"FreezeColumns"}),new r.SimpleCommand("unfreeze",l,{label:"Unfreeze Panes",description:"Unfreeze both the rows and columns.",icon:"MergeUnMerge"}),new r.SimpleCommand("autoFitRows",l,{label:"Autofit Rows",description:"Adjust the rows to the best height.",icon:"RowsResizeAuto"}),new r.SimpleCommand("resizeRows",l,{label:"Resize Rows",description:"Resize the rows to the specified height.",icon:"RowsResize"}),new r.SimpleCommand("autoFitColumns",l,{label:"Autofit Columns",description:"Adjust the columns to the best width.",icon:"ColumnsResizeAuto"}),new r.SimpleCommand("resizeColumns",l,{label:"Resize Columns",description:"Resize the columns to the specified width.",icon:"ColumnsResize"})],[]),g=o.useMemo(()=>{let u=null;return u=a?a.createChildGroup(l,"sheet",!1):new r.CommandGroup(l,"sheet"),u.addCommands(qe,!0),u},[a,qe]);r.useCommands(a,null,{onChange:()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=w.getMode()?.key==="formatPainter";g.getCommand("formatPainterToggle").update({disabled:u||!a?.getCommand("copy"),state:()=>L}).updateCallback(()=>L?void w.setMode(null):g.getCommand("copy").execute({editMode:{key:"formatPainter",description:"Use the mouse to apply the copied format to another selection.",cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}}))}},[w,N,a]),Qe(t.getView(),{onFreezeSplitChange:()=>{q()}});const je=()=>{g.getCommand("sheetViewFormatGridlinesColor").update({state:()=>t.getView().getGridLineColor(),context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:t.getStyles().parseColor(i.strokeFill),schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})}),g.getCommand("formatSheetTabColor").updateCallback(u=>{t.setTabColor(u)}).update({state:()=>t?.getTabColor()??qn,context:()=>({onColorSelect:u=>{},darkMode:i.darkMode,autoColor:qn,schemeLookup:t.getStyles().schemeLookup(),recentColors:()=>t.getStyles().recentColors(),addRecentColor:u=>t.getStyles().addRecentColor(u),clearRecentColors:()=>t.getStyles().clearRecentColors()})})},Be=()=>{g.getCommand("formatBorder").update({context:()=>({onBorderSelect:u=>{I(u)},darkMode:i.darkMode,quickBorder:T,autoColor:t.getStyles().getNormal().getFont().getFill(),autoStyle:d.IBorder.StrokeStyle.Thin,createTemporaryBorder:u=>t.getStyles().getNormal().createTemporaryStyle({border:u}).getBorder(),schemeLookup:t.getStyles().schemeLookup()})})};o.useEffect(()=>{Be()},[T]),o.useEffect(()=>{const u=!t.getProtection().isInsertHyperlinksAllowed(),L=R(),K=L?.cell.getHyperlink();g.getCommand("openHyperlink").update({disabled:!K}),g.getCommand("deleteHyperlink").update({disabled:u||!K});const m=K?"Edit":"Insert",A="Link";g.getCommand("updateHyperlink").update({label:()=>`${m} ${A}`,icon:()=>m==="Edit"?"HyperlinkEdit":"HyperlinkInsert",scopedLabels:{contextMenu:`${m} ${A}…`,insert:`${A}…`,hyperlink:`${m}…`},disabled:u})},[P,N]),o.useEffect(()=>{const u=R(),L=u?.cell.getComments(),K=()=>L?"Edit":"Insert",m=()=>L?"Comments":"Comment";g.getCommand("updateComments").update({label:()=>`${K()} ${m()}`,icon:()=>L?"CommentEdit":"CommentInsert",scopedLabels:{contextMenu:`${K()} ${m()}…`,insert:`${m()}…`}})},[P,N]),Qe(t,{onViewChange:()=>{const u=t.getView();g.getCommand("sheetViewToggleFormulaView").update({state:u.isShowFormulas()}),g.getCommand("sheetViewToggleShowZeros").update({state:u.isShowZeros()}),g.getCommand("gridlinesToggle").update({state:u.isShowColumnGridlines()||u.isShowRowGridlines()}),g.getCommand("sheetViewToggleGridlinesColumns").update({state:u.isShowColumnGridlines()}),g.getCommand("sheetViewToggleGridlinesRows").update({state:u.isShowRowGridlines()}),g.getCommand("sheetViewToggleShowHeadings").update({state:u.isShowColumnHeaders()||u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingColumns").update({state:u.isShowColumnHeaders()}),g.getCommand("sheetViewToggleShowHeadingRows").update({state:u.isShowRowHeaders()}),g.getCommand("sheetViewToggleShowHeadingsNumeric").update({state:()=>t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero}),je()},onTabColorChange:()=>{je()},onMergesChange:()=>{q()},onMovablesChange:()=>{q()},onTablesChange:()=>{q()},onProtectionChange:()=>{q(),v()},onStyleChange:()=>{je(),Be(),q()}}),o.useEffect(()=>{je(),Be()},[i]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=R(),K=L.table,m=L.tables,A=m.length>0&&!K||u,G=ue(K),J={context:G};g.getCommand("editTable").update(J),g.getCommand("deleteTable").update(J),g.getCommand("convertTableToRange").update(J);const re={context:G,disabled:A};g.getCommand("formatTableStyle").update({label:K?"Apply Table Style":"Format As Table",...re}),g.getCommand("formatTableStyleClearCellStyles").update(re),g.getCommand("deleteTableStyle").update(re),g.getCommand("convertTableToRange").update(re),g.getCommand("insertTable").update({disabled:A||m.length>0});const x={context:G,disabled:A||m.length===0};g.getCommand("tableHeaderRowToggle").update(x),g.getCommand("tableTotalRowToggle").update(x),g.getCommand("autoFilterToggle").update(x),g.getCommand("formatTableStyleClearTableStyle").update({...x,disabled:x.disabled||!K||K.getStyleOptions().name===null})},[pe,N]),o.useEffect(()=>{g.getCommand("sheetZoomOut").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale(),!1)})}),g.getCommand("sheetZoomIn").updateCallback(()=>{t.getView().update({zoomScale:ge.CommonUtils.findNextStep(t.getView().getZoomScale())})}),g.getCommand("sheetZoom100").updateCallback(()=>{t.getView().update({zoomScale:100})}),g.getCommand("gridlinesToggle").updateCallback(()=>{const u=t.getView().isShowColumnGridlines()&&t.getView().isShowRowGridlines();t.getView().update({showColumnGridlines:!u,showRowGridlines:!u})}),g.getCommand("sheetViewToggleGridlinesRows").updateCallback(()=>{t.getView().update({showRowGridlines:!t.getView().isShowRowGridlines()})}),g.getCommand("sheetViewToggleGridlinesColumns").updateCallback(()=>{t.getView().update({showColumnGridlines:!t.getView().isShowColumnGridlines()})}),g.getCommand("sheetViewFormatGridlinesColor").updateCallback(u=>{t.getView().update({gridLineColor:u})}),g.getCommand("sheetViewToggleShowHeadings").updateCallback(()=>{const u=t.getView().isShowColumnHeaders()&&t.getView().isShowRowHeaders();t.getView().update({showColumnHeaders:!u,showRowHeaders:!u})}),g.getCommand("sheetViewToggleShowHeadingColumns").updateCallback(()=>{t.getView().update({showColumnHeaders:!t.getView().isShowColumnHeaders()})}),g.getCommand("sheetViewToggleShowHeadingRows").updateCallback(()=>{t.getView().update({showRowHeaders:!t.getView().isShowRowHeaders()})}),g.getCommand("sheetViewToggleShowHeadingsNumeric").updateCallback(()=>{const u=t.getView().getColumnHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero&&t.getView().getRowHeaderStyle()===d.ISheetView.HeaderTextStyle.Zero;t.getView().update({columnHeaderStyle:u?d.ISheetView.HeaderTextStyle.A1:d.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:u?d.ISheetView.HeaderTextStyle.One:d.ISheetView.HeaderTextStyle.Zero})}),g.getCommand("sheetViewToggleFormulaView").updateCallback(()=>{t.getView().update({showFormulas:!t.getView().isShowFormulas()})}),g.getCommand("sheetViewToggleShowZeros").updateCallback(()=>{t.getView().update({showZeros:!t.getView().isShowZeros()})}),g.getCommand("calculate").updateCallback(()=>{t.getEntireRange().calculate(!0)}),g.getCommand("insertFunction").update({context:()=>({searchByCategory:async u=>{const L=t.getWorkbook();if(!L)return ge.CommonUtils.EmptyArray;const K=await L.getScripts().searchFunctions({category:u,includeBuiltIn:!0});return K.sort((m,A)=>m.getName().localeCompare(A.getName())),K}})})},[t]),o.useEffect(()=>{const u=R()?.cell.getCoords(),L=t.getView().getFreezePanes(),K=()=>L.coords.rowIndex!==0,m=()=>L.coords.colIndex!==0,A=()=>L.coords.rowIndex!==0||L.coords.colIndex!==0;g.getCommand("freezeToggle").updateCallback(()=>{A()?t.getView().setFreezePanes(null):A()?m()?t.getView().setFreezePanes({coords:{rowIndex:u.rowIndex}}):K()&&t.getView().setFreezePanes({coords:{colIndex:u.colIndex}}):t.getView().setFreezePanes({coords:u})}).update({state:A,disabled:()=>!u||!A()&&u.rowIndex===0&&u.colIndex===0}),g.getCommand("freezeToggleHorizontal").updateCallback(()=>{t.getView().setFreezePanes({coords:{rowIndex:K()?0:u.rowIndex}})}).update({state:K,disabled:()=>!u||!K()&&u.rowIndex===0}),g.getCommand("freezeToggleVertical").updateCallback(()=>{t.getView().setFreezePanes({coords:{colIndex:m()?0:u.colIndex}})}).update({state:m,disabled:()=>!u||!m()&&u.colIndex===0}),g.getCommand("unfreeze").updateCallback(()=>{t.getView().setFreezePanes(null)}).update({disabled:()=>!A()})},[E,P,t,i]);const Ee=t?.getSelectedCell().getStyle();return o.useEffect(()=>{const u=Ee.getFont(),L=Ee.getAlignment(),K=L.getHorizontal(),m=L.getVertical(),A=L.getOverflow(),G=L.getRotation();g.getCommand("formatCellStyle").update({context:()=>({styles:()=>t.getStyles(),named:()=>R().cell.getStyle(!0).getNamed(),bodyStyle:Ie,createTemporaryCell:be=>t.createTemporaryCell(be)})}),g.getCommand("formatFillColor").update({state:()=>{let be=null;const ke=Ee.getFill();return ke?.getType()===d.IFill.Type.Solid?be=ke.getColor():ke?.getType()===d.IFill.Type.Gradient?be=ke.getStops()?.[0]?.getColor():ke?.getType()===d.IFill.Type.Pattern&&(be=ke.getBackground()),be},icon:()=>s.jsx(r.DynamicIcon,{iconKey:"fill.colored"}),context:()=>{const be=t.getStyles();return{onColorSelect:ke=>{D(ke??qn)},darkMode:i.darkMode,quickColor:z,autoColor:qn,schemeLookup:be.schemeLookup(),recentColors:be.recentColors(),addRecentColor:ke=>be.addRecentColor(ke),clearRecentColors:()=>be.clearRecentColors()}}}),g.getCommand("formatFontColor").update({state:()=>u.toJSON()?.fill?u.getFill():null,icon:()=>s.jsx(r.DynamicIcon,{iconKey:"text.colored"}),context:()=>{const be=t.getStyles();return{onColorSelect:ke=>{$(ke)},darkMode:i.darkMode,quickColor:_,autoColor:be.getNormal().getFont().getFill(),schemeLookup:be.schemeLookup(),recentColors:be.recentColors(),addRecentColor:ke=>be.addRecentColor(ke),clearRecentColors:()=>be.clearRecentColors()}}}),g.getCommand("formatNumberFormat").update({state:()=>Ee.getNumberFormat(),context:()=>R().cell}),g.getCommand("formatNumberDialog").update({state:()=>Ee.getNumberFormat(),context:()=>R().cell}),g.getCommand("formatFontFamily").update({state:()=>u.getFamily()}),g.getCommand("formatFontSize").update({state:()=>u.getSize()});const J=function(){const be=u.getWeight()||0;return!isNaN(be)&&be>500};g.getCommand("formatBoldToggle").updateCallback(function(){b(this,{font:{weight:J()?400:700}})}).update({state:J});const re=function(){return u.getStyle()===d.IFont.Style.Italic};g.getCommand("formatItalicToggle").updateCallback(function(){b(this,{font:{style:re()?d.IFont.Style.Normal:d.IFont.Style.Italic}})}).update({state:re}),g.getCommand("formatStrikeThroughToggle").updateCallback(function(){b(this,{font:{strike:!u.getStrike()}})}).update({state:u.getStrike()}),g.getCommand("formatUnderlinedToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Single?d.IFont.UnderlineStyle.Single:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Single}),g.getCommand("formatUnderlinedDoubleToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.Double?d.IFont.UnderlineStyle.Double:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.Double}),g.getCommand("formatUnderlinedAccountingToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.SingleAccounting?d.IFont.UnderlineStyle.SingleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.SingleAccounting}),g.getCommand("formatUnderlinedAccountingDoubleToggle").updateCallback(function(){b(this,{font:{underline:u.getUnderline()!==d.IFont.UnderlineStyle.DoubleAccounting?d.IFont.UnderlineStyle.DoubleAccounting:d.IFont.UnderlineStyle.None}})}).update({state:u.getUnderline()===d.IFont.UnderlineStyle.DoubleAccounting}),g.getCommand("formatSuperscriptToggle").updateCallback(function(){b(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Super?d.IFont.VerticalAlignment.Super:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Super}),g.getCommand("formatSubscriptToggle").updateCallback(function(){b(this,{font:{verticalAlign:u.getVerticalAlignment()!==d.IFont.VerticalAlignment.Sub?d.IFont.VerticalAlignment.Sub:d.IFont.VerticalAlignment.Baseline}})}).update({state:u.getVerticalAlignment()===d.IFont.VerticalAlignment.Sub});const x=()=>A===d.ITextFrame.Overflow.Visible;g.getCommand("formatTextOverflowVisibleToggle").updateCallback(function(){b(this,{alignment:{overflow:(x(),d.ITextFrame.Overflow.Visible)}})}).update({state:x});const B=()=>A===d.ITextFrame.Overflow.Wrap;g.getCommand("formatTextOverflowWrapToggle").updateCallback(function(){b(this,{alignment:{overflow:B()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Wrap}})}).update({state:B});const S=function(){return A===d.ITextFrame.Overflow.Clip};g.getCommand("formatTextOverflowClipToggle").updateCallback(function(){b(this,{alignment:{overflow:S()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Clip}})}).update({state:S});const j=function(){return A===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowShrinkToggle").updateCallback(function(){b(this,{alignment:{overflow:j()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Shrink}})}).update({state:j});const se=function(){return A===d.ITextFrame.Overflow.Shrink};g.getCommand("formatTextOverflowEllipsisToggle").updateCallback(function(){b(this,{alignment:{overflow:se()?d.ITextFrame.Overflow.Visible:d.ITextFrame.Overflow.Ellipsis}})}).update({state:se,disabled:!0});const ae=function(){return m===d.ITextFrame.VerticalAlignment.Top};g.getCommand("formatAlignTopToggle").updateCallback(function(){b(this,{alignment:{vertical:ae()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Top}})}).update({state:ae});const we=function(){return m===d.ITextFrame.VerticalAlignment.Center};g.getCommand("formatAlignMiddleToggle").updateCallback(function(){b(this,{alignment:{vertical:we()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Center}})}).update({state:we});const Y=function(){return m===d.ITextFrame.VerticalAlignment.Bottom};g.getCommand("formatAlignBottomToggle").updateCallback(function(){b(this,{alignment:{vertical:(Y(),d.ITextFrame.VerticalAlignment.Bottom)}})}).update({state:Y});const fe=function(){return m===d.ITextFrame.VerticalAlignment.Justify};g.getCommand("formatAlignJustifyVerticalToggle").updateCallback(function(){b(this,{alignment:{vertical:fe()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Justify}})}).update({state:fe});const V=function(){return m===d.ITextFrame.VerticalAlignment.Distributed};g.getCommand("formatAlignDistributedVerticalToggle").updateCallback(function(){b(this,{alignment:{vertical:V()?d.ITextFrame.VerticalAlignment.Bottom:d.ITextFrame.VerticalAlignment.Distributed}})}).update({state:V});const X=function(){return K===d.ITextFrame.HorizontalAlignment.Left};g.getCommand("formatAlignLeftToggle").updateCallback(function(){b(this,{alignment:{horizontal:X()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Left}})}).update({state:X});const oe=function(){return K===d.ITextFrame.HorizontalAlignment.Center};g.getCommand("formatAlignCenterToggle").updateCallback(function(){b(this,{alignment:{horizontal:oe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Center}})}).update({state:oe});const Fe=function(){return K===d.ITextFrame.HorizontalAlignment.CenterContinuous};g.getCommand("formatAlignCenterContinuousToggle").updateCallback(function(){const be={alignment:{horizontal:Fe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.CenterContinuous,rotation:null}};b(this,be)}).update({state:Fe});const Ue=function(){return K===d.ITextFrame.HorizontalAlignment.Fill};g.getCommand("formatAlignFillToggle").updateCallback(function(){const be={alignment:{horizontal:Ue()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Fill,rotation:null}};b(this,be)}).update({state:Ue});const Oe=function(){return K===d.ITextFrame.HorizontalAlignment.Distributed};g.getCommand("formatAlignDistributedHorizontalToggle").updateCallback(function(){b(this,{alignment:{horizontal:Oe()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Distributed}})}).update({state:Oe});const Se=function(){return K===d.ITextFrame.HorizontalAlignment.Right};g.getCommand("formatAlignRightToggle").updateCallback(function(){b(this,{alignment:{horizontal:Se()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Right}})}).update({state:Se});const He=function(){return K===d.ITextFrame.HorizontalAlignment.Justify};g.getCommand("formatAlignJustifyToggle").updateCallback(function(){b(this,{alignment:{horizontal:He()?d.ITextFrame.HorizontalAlignment.General:d.ITextFrame.HorizontalAlignment.Justify}})}).update({state:He});const ve=!t.getProtection().isFormatCellsAllowed(),De=K===d.ITextFrame.HorizontalAlignment.CenterContinuous||K===d.ITextFrame.HorizontalAlignment.Fill;g.getCommand("formatTextRotate0").updateCallback(function(be){b(this,{alignment:{rotation:0}})}).update({disabled:ve||De,state:G===0}),g.getCommand("formatTextRotate45").updateCallback(function(be){b(this,{alignment:{rotation:be??1?45:0}})}).update({disabled:ve||De,state:G===45}),g.getCommand("formatTextRotate90").updateCallback(function(be){b(this,{alignment:{rotation:be??1?90:0}})}).update({disabled:ve||De,state:G===90}),g.getCommand("formatTextRotate270").updateCallback(function(be){b(this,{alignment:{rotation:be??1?270:0}})}).update({disabled:ve||De,state:G===270}),g.getCommand("formatTextRotate315").updateCallback(function(be){b(this,{alignment:{rotation:be??1?315:0}})}).update({disabled:ve||De,state:G===315}),g.getCommand("formatTextRotateCustom").updateCallback(function(be){b(this,{alignment:{rotation:be}})}).update({disabled:ve||De,state:G??0})},[Ee,t,i,z,_]),o.useEffect(()=>{const u=!t.getProtection().isFormatCellsAllowed(),L=R(),K=L.containsMerge,m=L.tables.length===0&&!L.isOverlapping&&(K||!L.isSingleCell),A=async($e,lt)=>{k(lt,async it=>{const Je=async(wt=!1)=>{const bt=await Promise.resolve(c.showBusy(lt.getLabel()));try{const dt=it.getSelectedRanges();if(dt.merge({orientations:$e,discardMultipleValues:wt}),$e===d.IRange.Orientations.Both){const ft={alignment:{horizontal:d.ITextFrame.HorizontalAlignment.Center}};dt.getStyle().update(ft)}}catch(dt){throw dt}finally{bt?.()}};let st;try{await Je()}catch(wt){if(wt.type!=="discardMultipleValues")throw wt;st=!0}if(st&&c.showOptions){if(await c.showOptions({title:"Confirm",description:"Merging cells will only keep the upper-left value. Some data will be discarded. Continue?",options:["Merge","Cancel"],defaultOption:"Merge"})!=="Merge")return;await Je(!0)}},void 0,void 0,!1)},G=$e=>{k($e,async lt=>{try{const it=lt.getSelectedRanges();it.unmerge();const Je={alignment:{horizontal:null}};it.getStyle().update(Je)}catch(it){throw it}})};g.getCommand("mergeToggle").updateCallback(function(){ge.CoordUtils.isSingleCell(t.getSelectedRange().getCoords())||(K?G(this):A(d.IRange.Orientations.Both,this))}).update({state:K,disabled:!m||u}),g.getCommand("mergeHorizontal").updateCallback(function(){A(d.IRange.Orientations.Column,this)}).update({disabled:!m||u}),g.getCommand("mergeVertical").updateCallback(function(){A(d.IRange.Orientations.Row,this)}).update({disabled:!m}),g.getCommand("unmerge").updateCallback(function(){G(this)}).update({disabled:!K||!m||u});const J={disabled:u};g.getCommand("hideRows").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!0)})}).update(J),g.getCommand("hideColumns").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!0)})}).update(J),g.getCommand("unhideRows").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getRowHeaders().setHidden(!1)})}).update(J),g.getCommand("unhideColumns").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().getColumnHeaders().setHidden(!1)})}).update(J),g.getCommand("autoFitRows").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Row})})}).update(J),g.getCommand("resizeRows").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Row,getUnitText:()=>"Pt"},lt={initialValue:{size:20,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getRowHeaders().setSize(it.size+it.unit):g.getCommand("autoFitRows").execute()}};c.showWindow("resizeHeader",lt)}).update(J),g.getCommand("autoFitColumns").updateCallback(function(){k(this,$e=>{$e.getSelectedRanges().autoFit({orientations:d.IRange.Orientations.Column})})}).update(J),g.getCommand("resizeColumns").updateCallback(function(){const $e={getOrientation:()=>d.IRange.Orientation.Column,getUnitText:()=>"Pt"},lt={initialValue:{size:100,unit:"Px"},context:()=>$e,onInput:(it,Je)=>{Je!=="Autofit"?t.getSelectedRanges().getColumnHeaders().setSize(it.size+it.unit):g.getCommand("autoFitColumns").execute()}};c.showWindow("resizeHeader",lt)}).update(J);let re=!1,x=0,B=!1,S=!1,j=0,se=!1;const ae=L.ranges;ae&&!u&&(re=ae.isEntireColumnsAny(),B=re&&!ae.isEntireColumns(),x=ae.getColumnCount(),S=ae.isEntireRowsAny(),se=S&&!ae.isEntireRows(),j=ae.getRowCount());const we={disabled:u||ae&&ae.getCount()!==1};g.getCommand("sortAscending").update(we),g.getCommand("sortDescending").update(we);const Y=L.isOverlapping,fe={disabled:re||u||Y},V={disabled:S||u||Y},X=re||u||Y||se,oe=S||u||Y||B;let Fe="",Ue="",Oe="",Se="",He="",ve="",De="",be="",ke="",Ne="",Ze="",_e="",Xe="";x>1&&(Fe=x+" ",Ue="s",Y||(Ne=ve=Fe,Ze=De=Ue)),j>1&&(Oe=j+" ",Se="s",Y||(_e=be=Oe,Xe=ke=Se)),w.getMode()?.key==="copy"?(He=be=ve="Copied ",De=ke="s"):w.getMode()?.key==="cut"&&(He=be=ve="Cut ",De=ke="s");let at="",ot="";if(ae){const $e=ae.getDefaultShiftOrientation()===d.IRange.Orientation.Column;at=` (${$e?"Shift Right":"Shift Down"})`,ot=` (${$e?"Shift Left":"Shift up"})`,g.getCommand("deleteCells").update({label:`Delete Cells${ot}`})}g.getCommand("insertCells").update({label:`Insert ${He}Cells${at}`,scopedLabels:{insertCells:`${He}At Selection`}}),g.getCommand("insertCellsShiftRight").update(fe),g.getCommand("deleteCellsShiftLeft").update(fe),g.getCommand("deleteCellsShiftUp").update(V),g.getCommand("insertCellsShiftDown").update(V),g.getCommand("insertRows").update({label:`Insert ${be}Row${ke}`,scopedLabels:{insertCells:`${be}Row${ke}`},disabled:oe}),g.getCommand("insertRowsAfter").update({label:`Insert ${be}Row${ke} Below`,disabled:oe}),g.getCommand("hideRows").update({label:`Hide ${Oe}Row${ke}`}),g.getCommand("insertColumns").update({label:`Insert ${ve}Column${De}`,scopedLabels:{insertCells:`${ve}Column${De}`},disabled:X}),g.getCommand("insertColumnsAfter").update({label:`Insert ${ve}Column${De} After`,disabled:X}),g.getCommand("hideColumns").update({label:`Hide ${Fe}Column${De}`}),g.getCommand("deleteRows").update({label:`Delete ${_e}Row${Xe}`,scopedLabels:{deleteCells:`${_e}Row${Xe}`},disabled:oe}),g.getCommand("deleteColumns").update({label:`Delete ${Ne}Column${Ze}`,scopedLabels:{deleteCells:`${Ne}Column${Ze}`},disabled:X})},[E,P,N,w,c]),o.useEffect(()=>{const u=t.getProtection(),L=t.getProtection().isLocked(),K=!u.isFormatCellsAllowed(),m={disabled:K};g.getCommand("protectionSheetToggle").updateCallback(async(re,x)=>{let B=null;try{if(L){let S=null;if(u.hasPassword()){const j=await c.showInput({title:"Password Required",description:"Enter a password to unprotected",options:["Unprotect","Cancel"],defaultOption:"Unprotect",inputType:"password"});if(j.option!=="Unprotect")return;S=j.input}B=await Promise.resolve(c.showBusy(x.getLabel())),await u.unlock(S)}else B=await Promise.resolve(c.showBusy(x.getLabel())),await u.lock();B?.()}catch(S){B?.(),c.showError(S)}}).update({state:L,label:()=>L?"Unprotect Sheet":"Protect Sheet",scopedLabels:{sheet:L?"Unprotect":"Protect"}}),g.getCommand("deleteTable").update(m),g.getCommand("sortAscending").update(m),g.getCommand("sortDescending").update(m),g.getCommand("sortCustom")?.update(m),g.getCommand("updateComments").update(m),g.getCommand("deleteComments").update(m),g.getCommand("insertChart")?.update(m),g.getCommand("insertImageFromFile").update(m),g.getCommand("insertImageFromURL").update(m),g.getCommand("formatBorder").update(m),g.getCommand("formatFillColor").update(m),g.getCommand("formatFontColor").update(m),g.getCommand("formatBoldToggle").update(m),g.getCommand("formatItalicToggle").update(m),g.getCommand("formatUnderlinedToggle").update(m),g.getCommand("formatStrikeThroughToggle").update(m),g.getCommand("formatSuperscriptToggle").update(m),g.getCommand("formatSubscriptToggle").update(m),g.getCommand("formatAlignTopToggle").update(m),g.getCommand("formatTextOverflowVisibleToggle").update(m),g.getCommand("formatTextOverflowWrapToggle").update(m),g.getCommand("formatTextOverflowClipToggle").update(m),g.getCommand("formatTextOverflowShrinkToggle").update(m),g.getCommand("formatAlignMiddleToggle").update(m),g.getCommand("formatAlignBottomToggle").update(m),g.getCommand("formatAlignDistributedVerticalToggle").update(m),g.getCommand("formatAlignJustifyVerticalToggle").update(m),g.getCommand("formatAlignLeftToggle").update(m),g.getCommand("formatAlignCenterToggle").update(m),g.getCommand("formatAlignRightToggle").update(m),g.getCommand("formatAlignJustifyToggle").update(m),g.getCommand("formatAlignCenterContinuousToggle").update(m),g.getCommand("formatAlignDistributedHorizontalToggle").update(m),g.getCommand("formatAlignFillToggle").update(m),g.getCommand("formatFontSizeIncrease").update(m),g.getCommand("formatFontSizeDecrease").update(m),g.getCommand("formatFontFamily").update(m),g.getCommand("formatFontSize").update(m),g.getCommand("formatNumberFormat").update(m),g.getCommand("formatNumberFormatGeneralStyle").update(m),g.getCommand("formatNumberFormatNumberStyle").update(m),g.getCommand("formatNumberFormatTimeStyle").update(m),g.getCommand("formatNumberFormatDateStyle").update(m),g.getCommand("formatNumberFormatAccountingStyle").update(m),g.getCommand("formatNumberFormatPercentStyle").update(m),g.getCommand("formatNumberFormatScientificStyle").update(m),g.getCommand("formatNumberFormatCommaStyle").update(m),g.getCommand("formatNumberFormatIncreaseDecimal").update(m),g.getCommand("formatNumberFormatDecreaseDecimal").update(m),g.getCommand("hideColumns").update(m),g.getCommand("unhideColumns").update(m),g.getCommand("hideRows").update(m),g.getCommand("unhideRows").update(m),g.getCommand("insertFunctionSum").update(m),g.getCommand("insertFunctionAverage").update(m),g.getCommand("insertFunctionCount").update(m),g.getCommand("insertFunctionMax").update(m),g.getCommand("insertFunctionMin").update(m),g.getCommand("insertFunction").update(m),g.getCommand("startEditCurrentTime").update(m),g.getCommand("startEditCurrentDate").update(m),g.getCommand("startEditValueAbove").update(m),g.getCommand("fillDown").update(m),g.getCommand("fillRight").update(m),g.getCommand("fillUp").update(m),g.getCommand("fillLeft").update(m),g.getCommand("formatCellStyle").update(m),g.getCommand("formatTableStyle").update(m),g.getCommand("formatPainterToggle").update(m),g.getCommand("formatBorderAddOutline").update(m),g.getCommand("formatBorderClearOutline").update(m),g.getCommand("formatIndentDecrease").update(m),g.getCommand("formatIndentIncrease").update(m),g.getCommand("clearContents").update(m),g.getCommand("clearFormats").update(m),g.getCommand("clearAll").update(m),g.getCommand("clearComments").update(m),g.getCommand("clearHyperlinks").update(m),g.getCommand("autoFilterClear").update(m),g.getCommand("autoFilterReapply").update(m);const A=Ee.getAlignment().getHorizontal(),G=A===d.ITextFrame.HorizontalAlignment.CenterContinuous||A===d.ITextFrame.HorizontalAlignment.Fill,J={disabled:K||G};g.getCommand("formatTextRotate0").update(J),g.getCommand("formatTextRotate45").update(J),g.getCommand("formatTextRotate90").update(J),g.getCommand("formatTextRotate270").update(J),g.getCommand("formatTextRotate315").update(J),g.getCommand("formatTextRotateCustom").update(J),g.getCommand("formatTextRotateVertical").update(J)},[E]),g}const Fl="_sheet-scrollbar_104cg_1",bo=o.memo(o.forwardRef((e,t)=>{const{style:n=r.ReactUtils.EmptyCssProperties,orientation:i,sheet:a,onShowTooltip:l,onCloseTooltip:f,onScrollOffset:h,showCustomScrollButtons:c,offset:C=0,totalSize:M=0,viewportSize:y=0,className:p,endGap:T,...I}=e;if(!a)throw new Error("SheetScrollbar needs an ISheet");const z=r.useCallbackRef(l,[l]),D=r.useCallbackRef(f,[f]),_=o.useRef(null),$=Nt([_,t]),w=i===r.ScrollbarOrientation.Vertical,[N,v]=o.useState(()=>{const Ae=a.getView().getTopLeft();return w?Ae.top:Ae.left}),E=()=>{const Ae=a.getView().getFreezePanes();return w?Ae.coords.rowIndex===0?{shift:0,scroll:0}:{shift:a.getRowHeaders().findOffset(Ae.coords.rowIndex)-Ae.topLeft.top,scroll:Ae.topLeft.top}:Ae.coords.colIndex===0?{shift:0,scroll:0}:{shift:a.getColumnHeaders().findOffset(Ae.coords.colIndex)-Ae.topLeft.left,scroll:Ae.topLeft.left}},[q,Z]=o.useState(E),[F,P]=o.useState(null),[W,pe]=o.useState(!1),de=i===r.ScrollbarOrientation.Vertical?a.getRowHeaders():a.getColumnHeaders(),le=()=>{const Ae=a.getUsedRange()?.getCoords()??ge.CoordUtils.EmptyRange,Ie=a.getSelection().getCoords().cell;return{colIndex:Math.max(Ae.colEnd,Ie.colIndex),rowIndex:Math.max(Ae.rowEnd,Ie.rowIndex)}},[R,te]=o.useState(le),k=R?(w?R.rowIndex:R.colIndex)+1:0,b=()=>{const Ae=le();ge.CoordUtils.isEqualCells(R,Ae)||te(Ae)};Qe(a.getView(),{onFreezeSplitChange:()=>{Z(E)}}),Qe(a.getSelection(),{onChange:b}),Qe(a,{onUsedRangeChange:b}),o.useEffect(()=>{te(le())},[a]);const ee=C-q.scroll,ne=y-q.shift,Re=M-(q.shift+q.scroll),Ce=de.findOffset(k)*(a.getView().getZoomScale()/100)-(q.scroll+q.shift);o.useEffect(()=>{if(!F)return W&&D?.(),void pe(!1);ze(w,N,ne,T,F,a,de,q)},[w,C,N,ne,T,q,i,F,de,W,a]);const ye=r.useCallbackRef((Ae,Ie,ue)=>{v(Ae);const O=Ae+q.scroll,xe=Ie+q.shift,Le=ue+q.shift+q.scroll;h?.(O,xe,Le)},[h,q]),Pe=o.useCallback((Ae,Ie,ue,O,xe,Le,H,U)=>{const he=H.getTextAt(H.findIndex(Ie/(Le.getView().getZoomScale()/100)+U.scroll+U.shift)),ce={...xe,display:(i===r.ScrollbarOrientation.Vertical?"Row":"Column")+": "+he};if(_.current){const me=_.current.querySelector('[role="slider"]');if(me){const Te=me.getBoundingClientRect();Ae?ce.anchor.y=Te.top+Te.height/2:ce.anchor.x=Te.left+Te.width/2}}pe(!0),z?.(ce)},[]),ze=r.useCallbackRef(ge.CommonUtils.debounce(Pe,90),[]);return o.useMemo(()=>s.jsx(r.VirtualScrollbar,{ref:$,className:ct(p,Fl),style:n,offset:ee,viewportSize:ne,totalSize:Re,orientation:i,showCustomScrollButtons:c,onMouseDown:Ae=>{P({anchor:{x:Ae.clientX,y:Ae.clientY}}),Ae.preventDefault()},onScrollOffset:ye,onMouseOut:()=>{P(null)},onMouseUp:()=>{P(null)},minSize:Ce,...I}),[p,ee,ne,Re,i,c,n,Ce,T])}));bo.displayName="SheetScrollbar";const Po=(e,t,n=null)=>{const i=[];for(let a=0;a<e.length;a++)if(e[a].value.isSelectedAll){if(e[a].min===e[a].max&&e[a].min===n)continue;i.push({address:{min:e[a].min,max:e[a].max},update:t})}return i},jo=o.memo(o.forwardRef((e,t)=>{const{sheetHeader:n,gridRef:i,sheetElement:a,commands:l,oppositeSize:f=30,containerWidth:h,containerHeight:c,headerText:C,freezeStart:M,gridStyle:y,verticalPadding:p,horizontalPadding:T,onSheetContextMenu:I,onResizeHeadersStart:z,onResizeHeaders:D,onResizeHeadersEnd:_,onResizeHeadersDown:$,onResizeHeadersUp:w,scrollPoint:N,onSelectionStart:v,onSelectionEnd:E}=e,q=o.useMemo(()=>n.getOrientation(),[n]),Z=o.useRef(null),[F,P]=o.useReducer(S=>S+1,0),[W,pe]=o.useReducer(S=>S+1,0),de=n?.getSheet(),le=o.useRef(!1);o.useLayoutEffect(()=>{le.current=!0},[n]);const R=o.useMemo(()=>n.getEntireRange().getCoords().max+1,[n]),te=o.useMemo(()=>{const S=q===d.IRange.Orientation.Column;return{left:S?N.left:0,top:S?0:N.top}},[N]),[k,b]=o.useState(de?.getView().getZoomScale()/100),[ee,ne]=o.useState(null);Qe(n,{onSizesChange:S=>{b(de?.getView().getZoomScale()/100),Te(ce())}});const Re=o.useCallback(()=>{Z.current?.invalidate(),pe()},[]),Ce=o.useCallback(ge.CommonUtils.debounce(()=>{Re()},10),[]),[ye,Pe]=o.useState(null);Qe(n.getSheet(),{onSelectionChange(){Pe(de?.getSelection().getCoords()),Ce()},onProtectionChange(){Re()},onViewChange(){Ce()}}),o.useLayoutEffect(()=>{Te(ce())},[q,k,f]),o.useLayoutEffect(()=>{ne(null),b(n?.getSheet().getView().getZoomScale()/100),Te(ce())},[n]);const ze=o.useCallback(S=>n.at(S)?.isHidden()||n.at(S)?.getSize()===0,[n]),Ae=o.useCallback((S,j)=>n.hiddenHeadersAt(S,j),[ze]),Ie=r.useCallbackRef(S=>n.isSelected(S),[n]),ue=r.useCallbackRef(S=>n.isSelectedAll(S),[n]),O=o.useCallback(()=>n.getMinSize(),[n]),xe=o.useCallback(()=>n.getMaxSize(),[n]),Le=r.useCallbackRef((S,j,se)=>{j/=k;const ae={size:j=Math.max(O(),Math.min(ge.CommonUtils.roundAccurately(j,O()),xe())),hidden:!1},we=[];if(j<=0&&(ae.hidden=!0,ae.size=se),we.push({address:{min:S,max:S},update:ae}),j<0){const Y=q===d.IRange.Orientation.Column,fe=Y?me.getColOffset:me.getRowOffset,V=Y?me.getColIndex:me.getRowIndex,X=fe(S);let oe=V(X+j);const Fe=fe(oe);Fe===X+j?oe--:we.push({address:{min:oe,max:oe},update:{size:X-Fe+j}}),S-oe>1&&we.push({address:{min:oe+1,max:S-1},update:{hidden:!0}})}n.updateHeaderPairs(we),D?.(S,j,se)},[F,n,k,D]),H=r.useCallbackRef((S,j,se)=>{const ae=q===d.IRange.Orientation.Column;let we=null,Y={min:S,max:S};if(n.isSelectedAll(S)){const fe=n.getSelectedRuns();fe.length>1?we="Resize "+(ae?"Columns":"Rows"):Y=fe[0];const V={hidden:j<=0,size:(j<=0?se:j)/k};n.updateHeaderPairs(Po(fe,V,S))}if(Y){const fe=Y.max-Y.min+1;let V;V=fe===1?n.getRange(Y).at(0).getDisplayText():n.getRange(Y).toString(),we=`Resize ${ae?"Column":"Row"}${fe>1?"s":""} '${V}'`}_?.(S,j,we)},[F,n,_]),U=r.useCallbackRef((S,j)=>{const se=q===d.IRange.Orientation.Column;z(S,j,`Resize ${se?"Column":"Row"}(s)`)},[z]),he=r.useCallbackRef(S=>{let j=!1;const se=q===d.IRange.Orientation.Column,ae=n.getSheet().getEntireRange().getCoords(),we=[],Y=n.getSelectedRuns(),fe=V=>{let X;X=se?{colStart:V.min,rowStart:ae.rowStart,colEnd:V.max,rowEnd:ae.rowEnd}:{colStart:ae.colStart,rowStart:V.min,colEnd:ae.colEnd,rowEnd:V.max},we.push(X)};for(let V=0;V<Y.length;V++){const X=Y[V];X.value.isSelectedAll&&(X.min<=S&&X.max>=S&&(j=!0),fe(X))}if(j||fe({min:S,max:S}),n.getSheet().getRanges(we).autoFit({orientations:se?d.IRange.Orientations.Column:d.IRange.Orientations.Row}),ze(S)){const V={hidden:null},X=Po(Y,V);j||X.push({address:S,update:V}),n.updateHeaderPairs(X)}_?.(S,null,"Resize Column(s)")},[F,n,_,ze]),ce=()=>{const S=q===d.IRange.Orientation.Column;return{getColOffset:j=>S?n.findOffset(j):j===0?0:f/k,getColIndex:j=>S?n.findIndex(j):0,getRowOffset:j=>S?j===0?0:f/k:n.findOffset(j),getRowIndex:j=>S?0:n.findIndex(j)}},[me,Te]=o.useState(()=>ce()),ie=o.useCallback((S,j)=>S.nativeEvent.which!==r.MouseButtonCodes.Right||!ue(q===d.IRange.Orientation.Column?j.colIndex:j.rowIndex),[q,ue]),qe=r.useCallbackRef(S=>{a.focusSheet()},[a]),g=r.useCallbackRef(S=>{de?.getSelection().updateCoords(S)},[de]),{...je}=gt.useSelection({gridRef:i,commands:null,layout:me,selection:ye,fillHandleBorderColor:y.body.fill,selectionBackgroundColor:y.selection.fill,selectionBorderColor:y.selection.strokeFill,selectionRemoveBackgroundColor:y.selectionRemove.fill,selectionRemoveBorderColor:y.selectionRemove.strokeFill,disableTouchSelection:!0,onSelectionChange:g,canSelectionSpanMergedCells:S=>{const j=de.getRange(S);return j.isEntireColumns()||j.isEntireRows()}}),Be=r.useCallbackRef(()=>{v?.();const S=de?.getSelection();S&&S.setAdjusting(S.getCoords())},[de,v]),Ee=r.useCallbackRef(async()=>{de?.getSelection().setAdjusting(null),E?.()},[de,E]),{...u}=gt.useHeaderSelection({orientation:q,headerCount:R,gridRef:Z,gridMainRef:i,newSelection:je?.newSelection,modifySelection:je?.modifySelection,appendSelection:je?.appendSelection,clearSelections:je?.clearSelections,pointerDownInterceptor:ie,onPointerUp:qe,onDragStart:Be,onDragEnd:Ee}),L=y.selection?.strokeFill;o.useEffect(()=>{if(!Z.current)return void ne(null);const S=q===d.IRange.Orientation.Column,j=n.getSelectedRuns(),se=n.isProtected()?null:Le,ae=(Y,fe,V)=>{if(V)return S?s.jsx("div",{style:{position:"absolute",borderBottom:`${y.headerSelection.strokeWidth}px solid ${L}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,left:`${r.ReactUtils.boundPixel(V.x-y.headerSelection.strokeWidth)}px`,width:`${r.ReactUtils.boundPixel(V.width+y.headerSelection.strokeWidth+1,!0)}px`,height:f+y.headerSelection.strokeWidth-.5+"px"}},Y):s.jsx("div",{style:{position:"absolute",borderRight:`${y.headerSelection.strokeWidth}px solid ${L}`,pointerEvents:"none",top:`${r.ReactUtils.boundPixel(V.y-y.headerSelection.strokeWidth)}px`,left:`${r.ReactUtils.boundPixel(-y.headerSelection.strokeWidth/2)}px`,width:f+y.headerSelection.strokeWidth-.5+"px",height:`${r.ReactUtils.boundPixel(V.height+y.headerSelection.strokeWidth+1,!0)}px`}},Y)},we=(Y,fe,V)=>{const X={x:0,y:0,width:0,height:0};if(S){const oe=V.toClipBounds(V.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:Y,colEnd:Math.min(R,fe)}),gt.SELECTION_CLIP_INSETS);if(!oe)return;X.x=oe.x,X.width=oe.width}else{const oe=V.toClipBounds(V.getRangeCoordsBounds({rowStart:Y,rowEnd:Math.min(R,fe),colStart:0,colEnd:0}),gt.SELECTION_CLIP_INSETS);if(!oe)return;X.y=oe.y,X.height=oe.height}return{x:X.x,y:X.y,width:X.width,height:X.height}};ne([Y=>{let fe=null,V=S?Y.getVisibleColumns():Y.getVisibleRows();const X=S?Y.getTotalRangeCoords().colStart:Y.getTotalRangeCoords().rowStart;V.length>0&&V[0]>X&&(V=[V[0]-1,...V]);let oe=[];const Fe=[],Ue=V.length;for(let ke=0;ke<Ue;ke++){const Ne=V[ke],Ze=ke<Ue-1?V[ke+1]:Ne+Ae(Ne+1,!1)+1,_e=Ne+1!==Ze;if(!fe||fe.max<Ne)if(j.length>0&&j[j.length-1].max>=Ne){const ot=ge.CommonUtils.findEqualOrGreater(j,Ne,$e=>$e.max);fe=j[ot]}else fe=null;let Xe=!1,at=!1;if(fe?.value&&(fe.min<=Ne||fe.min<=Ze&&!_e)&&(Xe=!0,at=fe.value.isSelectedAll),Ne===X){let ot=!1,$e=!1;fe?.value&&fe.min<=Ne&&(ot=!0,$e=fe.value.isSelectedAll),Ne>0&&Fe.push({index:Ne-1,isNextHidden:_e,isSelected:ot,isSelectedAll:$e,disabledResize:!0})}if(at&&oe.push(Fe.length),Fe.push({index:Ne,isHidden:ke===0&&Ae(Ne,!1)>0,isNextHidden:_e,isSelected:Xe,isSelectedAll:at,onDividerMouseDown:$,onDividerResizeStart:U,onDividerResize:se,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:he}),_e){let ot=!1,$e=!1;if(fe&&fe.min>=Ne&&fe.max<=Ze-1&&fe.value.isSelectedAll&&oe.push(Fe.length),!(fe?.value&&fe.max>=Ze))if(j.length>0&&j[j.length-1].max>=Ze){const lt=ge.CommonUtils.findEqualOrGreater(j,Ze,it=>it.max);fe=j[lt]}else fe=null;fe?.value&&fe.min<=Ze&&(ot=fe.value.isSelected,$e=fe.value.isSelectedAll),Ze>0&&Fe.push({index:Ze-1,isHidden:!0,isSelected:ot,isSelectedAll:$e,onDividerMouseDown:$,onDividerResizeStart:U,onDividerResize:se,onDividerMouseUp:w,onDividerResizeEnd:H,onDividerAutoFit:he})}}if(oe.length>0){let ke=oe.length-1;if(oe.length>0){const _e=Fe[oe[ke]].index;let Xe=null;S?(Xe=Y.getRangeCoordsBounds({rowStart:0,rowEnd:0,colStart:_e,colEnd:_e}),Xe.x+Xe.width>Y.getBounds().width&&(ke-=1,ke===0&&(ke=-1))):(Xe=Y.getRangeCoordsBounds({rowStart:_e,rowEnd:_e,colStart:0,colEnd:0}),Xe.y+Xe.height>Y.getBounds().height&&(ke-=1,ke===0&&(ke=-1)))}const Ne=j?.[j.length-1],Ze=Y.getAnchor();if(Ze==="t"||Ze==="l"){const _e=Fe[oe[Math.max(0,oe.length-1)]];_e.showTouchDivider=Ne&&Ne.max<=_e.index}else ke>=0&&(Fe[oe[ke]].showTouchDivider=!0)}const{header:Oe,headerSelect:Se,headerSelectAll:He,headerHover:ve}=y??{},De=Fe.length,be=new Array(De);for(let ke=0;ke<De;ke++)be[ke]=s.jsx(gt.HeaderDivider,{orientation:q,view:Y,headerStyle:Oe,headerStyleSelect:Se,headerStyleSelectAll:He,headerStyleHover:ve,disabled:n.isProtected(),...Fe[ke]},`divider${ke}`);return be},Y=>{const fe=[],V=j.length;for(let X=0;j&&X<V;X++)fe.push(ae(`selection:${Y.getAnchor()}:${X}`,0,we(j[X].min,j[X].max,Y)));return fe}])},[W,!0,L,y,me,R,M,F,k]),o.useEffect(()=>{Z.current?.invalidate()},[F]);const K=r.useCallbackRef(S=>C?C(S):n.getTextAt(S),[C,n]),m=r.useCallbackRef(S=>{const{header:j,headerSelect:se,headerSelectAll:ae,headerHover:we}=y??{},{range:Y,key:fe,...V}=S;return s.jsx(gt.HeaderRenderer,{orientation:q,index:q===d.IRange.Orientation.Column?Y.colStart:Y.rowStart,isSelected:Ie,isSelectedAll:ue,zoomScale:100*k,headerText:K,headerStyle:j,headerStyleSelect:se,headerStyleSelectAll:ae,headerStyleHover:we,verticalPadding:p,horizontalPadding:T,...V},fe)},[F,R,y,k,n]),A=r.useEditMode(),G=o.useMemo(()=>{const S="white",j="black",se={};if(r.ReactUtils.detectIt().primaryInput!=="touch"){let ae=q===d.IRange.Orientation.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${j}' fill='${S}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${j}' fill='${S}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;A.getMode()?.key==="formatPainter"&&(ae=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${j}' fill='${S}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),se.cursor=ae}return se.backgroundColor=y?.header?.fill||"transparent",se},[q,F,A,y]),J=r.useImperativeElement(t,()=>({scrollTo:S=>{Z.current?.scrollTo(S)},forceRender:()=>{P()},getGridElement:()=>Z.current}),[]),re=o.useCallback(S=>{u.onPointerDown(S)},[u]),x=o.useCallback(S=>{const j=u.getCellCoordsFromClient(S.clientX,S.clientY);if(!j||!I)return;const se=q===d.IRange.Orientation.Column;I({originalEvent:S,clientX:S.clientX,clientY:S.clientY,rowIndex:se?-1:j.rowIndex,colIndex:se?j.colIndex:-1}),S.stopPropagation(),S.preventDefault()},[u,I]),B=o.useMemo(()=>{const S=q===d.IRange.Orientation.Column;return s.jsx("div",{ref:J,children:s.jsx(gt.Grid,{className:"sheet-header",style:G,ref:Z,scrollPoint:te,columnCount:S?R:1,rowCount:S?1:R,width:S?h:f,height:S?f:c,freezeLeft:S?M:void 0,freezeTop:S?void 0:M,hiddenColumnsAt:S?Ae:void 0,hiddenRowsAt:S?void 0:Ae,showGridLines:!1,layout:me,clipCells:!1,allowOverlaysOverflow:!0,enableMouseWheel:!1,onContextMenu:x,onPointerDown:re,zoom:k,renderCell:m,renderOverlays:ee})})},[ee,me,h,c,te,G,W]);return o.useEffect(()=>{le.current=!1,Z.current?.invalidate(),pe()},[n,y]),B})),Al=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,getVisibleCells:a,gridStyle:l}=e,f=r.useCallbackRef((C,M)=>C.getStyle().getBorder(),[]),{renderOverlay:h}=Co({getVisibleCells:a,getBorderAt:f,darkMode:l.body.darkMode,shiftIfWide:!0}),c=h(n);return c&&n?c:null})),Dl={key:"copy",description:"'Copy' Select destination and press ENTER or choose Paste."},zl={key:"cut",description:"'Cut' Select destination and press ENTER or choose Paste."},Ll={type:d.ICell.Content.Values},Nl={fitDestination:!0,type:d.ICell.Content.Formats},Pl={fitDestination:!0,type:d.ICell.Content.Formulas},jl={transpose:!0},Bl={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getA1({$colIndex:!0,$rowIndex:!0})}`})},br=({element:e,sheet:t,sheetView:n,commands:i,onClipboardUpdate:a,onPaste:l,renderSelection:f=gt.defaultSelectionRenderer,copyForegroundColor:h="rgb(33, 115, 70)",cutForegroundColor:c="rgb(33, 115, 70)",copyBackgroundColor:C="white",cutBackgroundColor:M="white",...y})=>{const p=r.useCallbackRef(f,[f]),T=o.useRef(null),I=r.useEditMode(),z=I.getMode(),D=o.useMemo(()=>({element:e,doCopy:v=>{const E=t.getSelectedRanges().getSnapshot(v);return new d.RangeClipboardItem(E)}}),[t,n,e]),_=o.useMemo(()=>({element:e,importFromExternal:async(v,E)=>{const q=new d.ExternalRangeClipboardItem(v,E,t.getStyles(),t.isDate1904());return await q.parse()?q:null},doPaste:async(v,E)=>{if(v?.getItemType()!=="range")return;E?.contentsOnly&&delete(E={...E,type:d.ICell.Content.Values}).contentsOnly;const q=v.getItem(),Z=q.getName();let F=t.getSelectedRange();if(Z==="HTML"&&F.size>1){const P=q?.getCoords();P&&ge.CoordUtils.isSingleCell(P)&&(F=F.getResizeTo(1,1))}return await F.doBatch(async()=>{const P=await F.copyFrom(q,E);!P||P.isEntireRows()||P.isEntireColumns()||P.autoFit({orientations:d.IRange.Orientations.Row,minContent:!0})},{description:"Paste"+(Z?` ${Z}`:""),autoSelect:!0}),!0}}),[t,n,e]),{clipboard:$,...w}=r.useCopyPaste({...y,source:D,commands:i,target:_,onClipboardUpdate:v=>{const E=v?.getItemType()==="range"?v:null;if(E){const q=v.editMode?.(),Z={...v?.isCut?.()?zl:Dl,...q,args:{isClipboard:!0,...q?.args},onModeChange:F=>{F?.args?.isClipboard||$.clear(!0),q?.onModeChange?.(F)}};I.setMode(Z)}T.current=E,a?.(E)},onPaste:(v,E)=>{if(v?.getItemType()!=="range")return;let q=I.getMode()?.key==="cut"||v.isCut?.();if(!q&&I.getMode()?.key==="copy"){const Z=v.getItem().getCoords(),F=t.getSelectedRanges().getCoords();let P=!1;if(!P&&Z&&F&&v.getItem().getSource?.()===t)for(let W=0;!P&&W<F.length;W++)P=ge.CoordUtils.isRangesIntersect(Z,F[W]);q=P}q&&I.setMode(null),e?.()?.focus(),l?.(v,E)}});o.useMemo(()=>{const v=e;if(!i)return;const E=[new r.Command("pasteValues",v,{label:"Paste Values",scopedLabels:{paste:"Values"},description:`Paste only the values of the selected cells.
18
+ The formatting is not cleared.`,groupLabels:{clearOptions:`Contents`},icon:`ClearContents`,shortcut:`Delete`,tags:[`mutator`]},clearFormats:{label:`Clear Formats`,description:`Clear only the formatting that is applied to the cells.`,groupLabels:{clearOptions:`Formats`},icon:`ClearFormats`,tags:[`mutator`]},clearHyperlinks:{label:`Clear Hyperlinks`,description:`Clear only the hyperlinks in the cells.`,groupLabels:{clearOptions:`Hyperlinks`},tags:[`mutator`]},clearComments:{label:`Clear Comments`,description:`Clear the comments from the cells.`,groupLabels:{clearOptions:`Comments`},tags:[`mutator`]},clearAll:{label:`Clear All`,description:`Clears everything from the cells.
20
19
 
21
- The formatting is not applied.`,icon:"PasteValues",shortcut:{key:"V",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}}),new r.Command("pasteFormats",v,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
20
+ All contents and formatting are removed.`,groupLabels:{clearOptions:`All`},icon:`ClearAll`,shortcut:`ctrl+shift+Delete`,tags:[`mutator`]},freezeToggle:{label:`Freeze Panes`,description:`Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).`,icon:`FreezeBoth`},freezeToggleHorizontal:{label:`Freeze Top Rows`,description:`Keep the top rows visible while scrolling through the rest of the sheet.`,icon:`FreezeRows`},freezeToggleVertical:{label:`Freeze Left Columns`,description:`Keep the left columns visible while scrolling through the rest of the sheet.`,icon:`FreezeColumns`},unfreeze:{label:`Unfreeze Panes`,description:`Unfreeze both the rows and columns.`,icon:`MergeUnMerge`},autoFitRows:{label:`Autofit Rows`,description:`Adjust the rows to the best height.`,icon:`RowsResizeAuto`,tags:[`mutator`]},resizeRows:{label:`Resize Rows`,description:`Resize the rows to the specified height.`,icon:`RowsResize`,tags:[`mutator`]},autoFitColumns:{label:`Autofit Columns`,description:`Adjust the columns to the best width.`,icon:`ColumnsResizeAuto`,tags:[`mutator`]},resizeColumns:{label:`Resize Columns`,description:`Resize the columns to the specified width.`,icon:`ColumnsResize`,tags:[`mutator`]},pasteValues:{label:`Paste Values`,description:`Paste only the values of the selected cells.
22
21
 
23
- The content is not applied.`,icon:"PasteFormats"}),new r.Command("pasteFormulas",v,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied.",icon:"PasteFormulas"}),new r.Command("pasteTranspose",v,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped.",icon:"PasteTranspose"}),new r.Command("pasteLinks",v,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells.",icon:"PasteLinks"})];i.addCommands(E,!0)},[i,e]),o.useEffect(()=>{if(!i)return;const v={disabled:!t.getProtection().isFormatCellsAllowed()};i.getCommand("pasteValues").updateCallback(E=>w.paste({...Ll,...E})).update(v),i.getCommand("pasteFormats").updateCallback((E,q)=>w.paste({...Nl,description:q.getLabel(),...E})).update(v),i.getCommand("pasteFormulas").updateCallback((E,q)=>w.paste({...Pl,description:q.getLabel(),...E})).update(v),i.getCommand("pasteTranspose").updateCallback((E,q)=>w.paste({...jl,description:q.getLabel(),...E})).update(v),i.getCommand("pasteLinks").updateCallback((E,q)=>w.paste({...Bl,description:q.getLabel(),...E})).update(v),i.getCommand("cut").update(v),i.getCommand("paste").update(v)},[t,i]);const N=o.useMemo(()=>{if(!z||!T.current)return;const v=z.key;if(v!=="copy"&&v!=="cut"&&v!=="formatPainter")return;const E=T.current.getItem();if(E.getSource()!==t)return;const q=T.current.isCut?.(),Z=q?M:C,F=q?c:h,P=E.getCoords(),W=P?[P]:null;return W&&W.length!==0?pe=>{const de=[];for(let le=0;le<W.length;le++){const R=W[le],te=pe.toClipBounds(pe.getRangeCoordsBounds(R,{top:0,left:0,right:1,bottom:1}),gt.SELECTION_CLIP_INSETS);te&&(de.push(p({range:R,key:`copy-selection-background-${le}`,x:te.x,y:te.y,width:Math.max(te.width,0),height:Math.max(te.height,0),stroke:Z,strokeWidth:2})),de.push(p({range:R,key:`copy-selection-foreground-${le}`,x:te.x+(te.width<=2?-1:0),y:te.y,width:Math.max(te.width,3),height:Math.max(te.height,3),stroke:F,strokeWidth:2,isAnimatedStroke:!0})))}return de}:null},[z,t,n,h,C,c,M]);return{...w,clipboard:$,overlays:N}},Ol=o.memo(o.forwardRef((e,t)=>{const{view:n,element:i,sheet:a,gridStyle:l,commands:f}=e,h=l.body??{},c=a.getView(),{overlays:C}=br({element:i,sheet:a,sheetView:c,commands:f,copyForegroundColor:l.selection.strokeFill,copyBackgroundColor:h.fill,cutForegroundColor:l.selectionRemove.strokeFill,cutBackgroundColor:h.fill});return Qe(a?.getSelection(),{onChange(M){}}),o.useEffect(()=>{n?.getStage()},[n?.getStage()]),C&&n?C(n):null})),Hl="_sheet-selection_12wyx_5",Vl={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},Ul={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},Kl={key:"dragCopy",description:"Drag selection to copy cell contents."},$l={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},Bo=(e,t)=>t.ctrlKey&&t.shiftKey?$l:t.ctrlKey?Kl:t.shiftKey?Ul:Vl,Wl={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},Gl=o.memo(o.forwardRef((e,t)=>{const{view:n,commands:i,className:a,onFirstRender:l,onShowTooltip:f,onCloseTooltip:h,sheet:c,gridRef:C,gridStyle:M,isActive:y,...p}=e,T=n?.getBounds(),I=r.useCallbackRef(f,[f]),z=r.useCallbackRef(h,[h]),[D,_]=o.useState(()=>c?.getSelection().getCoords()),$=r.useCallbackRef(H=>{ge.CoordUtils.isEqualSelectionCoords(H,D)||c&&c.getSelection().updateCoords(H)},[c,D]),w=r.useEditMode(),N=o.useRef(null),[v,E]=o.useState(c?.getProtection().isLocked()),[q,Z]=o.useState(c?.getView().getMovableSelection().length>0),F=r.ReactUtils.detectIt().primaryInput==="touch",P=!F&&y,W=w.getMode()?.args?.stateAndCoords?.coords??null,pe=W!==null||q,de=r.useCallbackRef(H=>{const U=ge.CoordUtils.cellToRange(H);if(c.isClosed())return U;const he=c.getRange(U,{ignoreHidden:!0}).getMerges();return he.length===0?U:he[0]},[c]),le=r.useCallbackRef((H,U,he,ce,me,Te)=>{const ie=c.getSelectedRange().getExtended(ce,H).getCoords();switch(ce){case d.IRange.Direction.Up:return ie.rowStart;case d.IRange.Direction.Down:return ie.rowEnd;case d.IRange.Direction.Left:return ie.colStart;case d.IRange.Direction.Right:return ie.colEnd}},[c]),R=r.useCallbackRef(()=>{const H=c.getUsedRange()?.getCoords(),U=c.getRowHeaders().getUsedRange()?.getCoords(),he=c.getColumnHeaders().getUsedRange()?.getCoords();return{...H,colEnd:Math.max(H?.colEnd??0,he?.max??0),rowEnd:Math.max(H?.rowEnd??0,U?.max??0)}},[c]),te=r.useCallbackRef((H,U)=>c.getRowHeaders().hiddenHeadersAt(H,U),[c]),k=r.useCallbackRef((H,U)=>c.getColumnHeaders().hiddenHeadersAt(H,U),[c]),b=r.useCallbackRef(H=>c.getRange(H,{ignoreHidden:!0}).getMerges(),[c]),ee=r.useCallbackRef(H=>{c?.getSelection().setAdjusting(H)},[c]),ne=r.useCallbackRef(async()=>{c?.getSelection().setAdjusting(null),w.getMode()?.key==="formatPainter"&&(await i?.getCommand("pasteFormats")?.execute({}),w.setMode(null))},[w,D,c,i]),Re=o.useMemo(()=>{const H=w.getMode();return H?.key==="cut"||H?.key==="copy"},[w]);Qe(c?.getView(),{onMovableSelectionChange:()=>{Z(c.getView().getMovableSelection().length>0)}}),Qe(c?.getSelection(),{onChange(H){const U=c.getSelection().getCoords();_(U)}}),Qe(c,{onProtectionChange:()=>{E(c.getProtection().isLocked())}});const{body:Ce={}}=M||{},ye=r.useNotifier(),Pe=n.getLayout(),ze=!(P&&D.ranges.length<=1&&W===null&&!v&&(!w.getMode()||Re)),{cursor:Ae,renderOverlay:Ie,onPointerDown:ue}=gt.useSelection({gridRef:C,commands:i,layout:Pe,getCellCoordsAsRangeCoords:de,selection:D,fillHandleBorderColor:Ce.fill,selectionBackgroundColor:y?M.selection.fill:M.selectionInactive.fill,selectionBorderColor:y?M.selection.strokeFill:M.selectionInactive.strokeFill,selectionRemoveBackgroundColor:y?M.selectionRemove.fill:M.selectionInactive.fill,selectionRemoveBorderColor:y?M.selectionRemove.strokeFill:M.selectionInactive.strokeFill,disableFillDrag:ze,disableMoveDrag:F||!(y&&D.ranges.length<=1&&W===null&&!v),disableTouchSelection:pe,onSelectionChange:$,onSelectionDragStart:ee,onSelectionDragEnd:ne,onMoveDragStart:(H,U,he)=>{w.setMode(Bo(0,he))},onMoveDragUpdate:(H,U,he)=>{w.setMode(Bo(0,he))},onMoveDragEnd:(H,U)=>{w.setMode(null)},onMoveDragDone:async(H,U,he)=>{if(ge.CoordUtils.isEqualRanges(H,U))return;const ce=c.getRange(U);if(ye?.showOptions){const g=ce.getDifferences(H);let je=!1;const Be=g.getCount();for(let Ee=0;!je&&Ee<Be;Ee++)je=g.at(Ee).isContentful();if(je&&await ye?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const me=!he.ctrlKey,Te=he.shiftKey,ie=Te?me?"Insert Moved Cells":"Insert Copied Cells":me?"Move Cells":"Copy Cells",qe=await ye?.showBusy?.(ie);try{const g=c.getRange(H);await ce.doBatch(async()=>{Te?await ce.insertFrom(H,{isCut:me,undoRange:g}):await ce.copyFrom(H,{isCut:me,undoRange:g}),g.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0}),ce.autoFit({skipCustomSize:!0,orientations:d.IRange.Orientations.Row,minContent:!0})},{description:ie,autoSelect:!0})}catch(g){ye?.showError?.(g)}finally{qe?.()}},contentfulCellFinder:le,hiddenRowsAt:te,hiddenColumnsAt:k,mergedRanges:b,getDataCoords:R,canSelectionSpanMergedCells:H=>{const U=c.getRange(H);return U.isEntireColumns()||U.isEntireRows()},onFill:async(H,U)=>{const he="Auto Fill",ce=await ye?.showBusy?.(he);try{await c.doBatch(()=>{c.getRange(H).autoFill(U),c.getRange(U).autoFit({orientations:d.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:he,autoSelect:!0})}catch(me){ye?.showError?.(me)}finally{N.current=null,ce?.()}},onFillPreview:(H,U,he)=>{if(C.current&&I){w.setMode(Wl);try{N.current?.direction!==he&&(N.current=null,c.getRange(H).autoFill(U,{previewOnly:Be=>{N.current={callback:Be,direction:he}}}));const ce=N.current?.callback?.(U);if(!ce||ce.isEmpty())return;const me=ce.toText();if(!me)return;const Te=ge.CoordUtils.cellToRange(ce.getCoords()),ie=n.getRelativePointFromClient(0,0);let qe=0,g=0,je=r.ToolTipPlacement.Bottom;if(he===d.IRange.Direction.Down){qe=Pe.getColOffset(Te.colEnd+1)-ie.x;const Be=Pe.getRowOffset(Te.rowEnd),Ee=Pe.getRowOffset(Te.rowEnd+1);g=Ee-(Ee-Be)/2-ie.y,je=r.ToolTipPlacement.Right}else if(he===d.IRange.Direction.Right){g=Pe.getRowOffset(Te.rowEnd+1)-ie.y;const Be=Pe.getColOffset(Te.colEnd),Ee=Pe.getColOffset(Te.colEnd+1);qe=Ee-(Ee-Be)/2-ie.x,je=r.ToolTipPlacement.Bottom}else if(he===d.IRange.Direction.Up){qe=Pe.getColOffset(Te.colEnd+1)-ie.x;const Be=Pe.getRowOffset(Te.rowStart),Ee=Pe.getRowOffset(Te.rowStart+1);g=Ee-(Ee-Be)/2-ie.y,je=r.ToolTipPlacement.Right}else if(he===d.IRange.Direction.Left){g=Pe.getRowOffset(Te.rowEnd+1)-ie.y;const Be=Pe.getColOffset(Te.colStart),Ee=Pe.getColOffset(Te.colStart+1);qe=Ee-(Ee-Be)/2-ie.x,je=r.ToolTipPlacement.Bottom}I({anchor:{x:qe,y:g},display:me,placement:je})}catch(ce){ye?.showError?.(ce)}}},onFillDone:()=>{N.current=null,w.setMode(null),z?.()}}),O=r.useCallbackRef(H=>{ue(r.ReactUtils.createSyntheticEvent(H))},[ue,W]);o.useEffect(()=>{const H=n?.getStage();if(H)return H.addEventListener("pointerdown",O),()=>{H.removeEventListener("pointerdown",O)}},[n?.getStage()]);const xe=r.useImperativeElement(t,()=>({}),[]),Le=o.useRef(null);return s.jsx("div",{className:ct(a,"sheet-selection",Hl),style:{position:"absolute",width:T?.width,height:T?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:Nt([xe,Le]),...p,children:Ie(n)})})),Sn=Object.freeze({x:0,y:0,width:0,height:0}),_l={fireOnModelChange:!1},Zl=o.memo(o.forwardRef((e,t)=>{const{children:n,view:i,movable:a,onRefLoad:l,onRefUnload:f,onHide:h,onShow:c,onUnFocus:C,isDragging:M,updateFrameBounds:y,dragStart:p,style:T,disabled:I,renderMovable:z,...D}=e,[_,$]=o.useState(Sn),[w,N]=o.useState(null),[v,E]=o.useState(!1),q=o.useRef(null);o.useLayoutEffect(()=>{if(a.isClosed())return;const F=a.getBounds();if(!F)return;const P=i.toViewBounds(F);$(P??Sn),y(P??Sn)},[i?.getBounds()]),Qe(a,{onBoundsChange:F=>{const P=F.getBounds();if(!P)return;const W=i.toViewBounds(P);$(W??Sn),y(W)},onSelectionChange:()=>{const F=ge.CommonUtils.hasFocus(q.current,!0);!v&&!F||a.isSelected()||C()}}),Qe(a,{onRequestFocus:()=>ge.CommonUtils.whenFocus(q.current,!0)},_l),o.useEffect(()=>{const F=q.current;return l(F),()=>{f(F)}},[]);const Z=o.useMemo(()=>{if(!_)return null;let{width:F,height:P}=_;return z({view:i,movable:a,disabled:I,isDragging:M,style:{position:"relative",left:0,top:0,width:F,height:P},onHide:h,onShow:c})},[i,a,_.width,_.height,I,M]);return s.jsx("div",{className:"movable",tabIndex:0,ref:Nt([q,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:_.x,top:_.y,width:_.width,height:_.height,...T},onMouseDown:async F=>{const P=F.shiftKey||F.ctrlKey,W=a.isSelected(),pe=F.currentTarget;P&&W?a.unselect():(W&&!P||await a.select({addToSelection:P}),p(F.nativeEvent,pe),pe.focus())},onFocus:F=>{F.relatedTarget&&!w&&N(F.relatedTarget),E(!0)},onBlur:F=>{w&&!q?.current?.contains(F.relatedTarget)&&N(null),F.relatedTarget&&E(!1)},...D,children:Z})})),Xl="_movable-area_314c6_5",xr=o.memo(o.forwardRef((e,t)=>{const{view:n,movables:i,movablesView:a,renderMovable:l,transactional:f,onUnFocus:h,onFocus:c,disabled:C=!1,disableDrag:M=!1,disableResize:y=!1,className:p,style:T,renderDirections:I=["nw","n","ne","w","e","sw","s","se"],onFirstRender:z,...D}=e,_=n.getBounds(),$=r.useCallbackRef(z,[z]),w=r.useCallbackRef(h,[h]),N=r.useCallbackRef(c,[c]),[v,E]=o.useState([]),[q,Z]=o.useState(!1),[F,P]=o.useState(!1),W=o.useRef(!0),pe=o.useRef(new Map),de=o.useRef(new Map),le=o.useRef(new Map),R=o.useRef(new Map),te=o.useRef(new Map),k=o.useRef({onRequestFocus:m=>(he(m),null)}),b=o.useRef(null),ee=o.useRef(null),ne=o.useRef(null),[Re,Ce]=o.useReducer(m=>m+1,0);o.useLayoutEffect(()=>{Ce()},[n,i]),Qe(i,{onCollectionChange:()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0}),A=te.current;A.forEach(J=>{J()}),A.clear();const G=k.current;for(let J=0;J<m.length;J++){const re=m[J];if(re.isClosed())continue;const x=re.addListeners(G);A.set(re,x)}Ce()},onInvalidated:()=>{Ce()}}),Qe(a,{onMovableSelectionChange(m){Pe(),Ce()}});const ye=o.useCallback((m,A)=>{const G=le.current.get(m);ne.current&&(ne.current.getTargets().forEach(J=>{if(J===G)return J.style.left=A.x+"px",J.style.top=A.y+"px",J.style.width=A.width+"px",void(J.style.height=A.height+"px")}),ne.current.updateRect())},[]),Pe=()=>{const m=[],A=a.getMovableSelection();A.forEach(G=>{const J=le.current.get(G);J&&A.indexOf(G)!==-1&&m.push(J)}),E(G=>ge.CommonUtils.isEqualArrays(G,m)?G:m)},ze=o.useRef(null),Ae=o.useRef(null),Ie=o.useMemo(()=>(Ae.current||(Ae.current=new Promise(m=>{ze.current=m})),Ae.current),[]),ue=o.useRef(null),O=r.useCallbackRef(async(m,A)=>{ue.current=A,await(async()=>!(!await Ie.then()||!ne.current))()&&ue.current===A&&ne.current.dragStart(m,A)},[v]),[xe,Le]=o.useState(!1),H=o.useRef(null),U=o.useRef(null),he=r.useCallbackRef(async(m=null)=>{if(m||(m=a.getMovableSelection()[0]),!m)return w?.(),!1;const A=le.current.get(m);A?(await ge.CommonUtils.whenFocus(A),A.focus(),U.current=A,H.current=null):H.current=m},[a]);o.useEffect(()=>{xe&&v.length>0&&U.current!==v[0]&&he(),W.current&&($?.(),W.current=!1)},[v]);const ce=o.useMemo(()=>{const m=i.getItems({address:n.getVisibleRangeCoords(),ignoreHidden:!0});if(m.length===0&&pe.current.size===0)return null;const A=(B,S,j,se=!0)=>{const ae=B.isSelected(),we={tabIndex:j,view:n,movable:B,onRefLoad:Y=>{H.current===B&&(Y.focus(),U.current=Y,H.current=null),le.current.set(B,Y),de.current.set(Y,B),S.rendered=!0,Pe()},onRefUnload:Y=>{le.current.delete(B),de.current.delete(Y),S.rendered=!1,Pe()},onUnFocus:w,onHide:Y=>{S.onHide=Y},onShow:Y=>{S.onShow=Y},isDragging:ae&&(F||q),disabled:C,renderMovable:l,updateFrameBounds:Y=>{ye(B,Y)},dragStart:O,onMouseUp:()=>{if(ue.current=null,ee.current){Z(!1),P(!1);let Y=!1;R.current?.forEach(fe=>{ge.CommonUtils.isEqualBounds(fe.movable.getBounds(),fe.startBounds)||(Y=!0)}),Y?Te():ie()}},style:{opacity:se?q&&ae?.7:void 0:0,zIndex:q&&ae?B.getZIndex()+m.length:void 0,pointerEvents:se?void 0:"none",cursor:F&&ae?"grabbing":C||M?"initial":"move",boxShadow:!ae||F&&!q?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(Zl,{...we},`movable-${B.getUUID()}`)},G=pe.current,J=new Map,re=[];for(let B=0;B<m.length;B++){const S=m[B];if(S.isClosed())continue;let j=G.get(S);j||(j={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(se,ae)=>{if(!ae||ae.shown===!0)return;ae.shown=!0;const we=++ae.visibilityRequestId;requestAnimationFrame(()=>{const Y=pe.current.get(se);Y&&we===ae.visibilityRequestId&&(ae.onShow?.(se),Y.shown=!0)})},doHide:async(se,ae)=>{if(!ae||ae?.shown===!1)return;ae.shown=!1;const we=++ae.visibilityRequestId,Y=await Promise.resolve(ae.onHide?.(se));we===ae.visibilityRequestId&&Y!==!1&&(ae.shown=!1,pe.current.delete(se),Ce())},visibilityRequestId:0}),j.frame=A(S,j,B,!0),re.push(j.frame),j.doShow(S,j),G.delete(S),J.set(S,j)}const x=[];return a.getMovableSelection().forEach(B=>{const S=G.get(B);S&&(S.frame=A(B,S,-1,!1),x.push(S.frame),G.delete(B),J.set(B,S))}),G.forEach((B,S)=>{B.frame=A(S,B,-1,!1),x.push(B.frame),B.doHide(S,B),G.delete(S),J.set(S,B)}),pe.current=J,Pe(),[...x,...re]},[Re,n,l,C,M,y,q,F]),me=r.useCallbackRef((m,A)=>{const G=`${A} ${v.length===1?d.TextUtils.capitalize(de.current?.get(v[0]).getContent().getType()):"Drawings"}`;ee.current&&(console.warn(`Transaction ${ee.current.getDescription()} is being replaced by ${G}`),ee.current.rollback(),ee.current=null),ee.current=f.beginCommit({description:G}),R.current.clear();for(let J=0;J<v.length;J++){const re=v[J],x=de.current?.get(re);x?R.current.set(re,{movable:x,startBounds:n.toViewBounds(x.getBounds())}):console.warn("invalid element",x)}},[f,n,v]),Te=o.useCallback(()=>{if(!ee.current)return;const m=[];R.current?.forEach(A=>{m.push(A.movable)}),ee.current.commit({viewAfter:{view:a,movableSelection:m}}),R.current.clear(),ee.current=null},[]),ie=o.useCallback(()=>{ee.current&&(ee.current.rollback(),ee.current=null)},[]),qe=o.useRef(null);o.useEffect(()=>{qe.current&&(qe.current.onscroll=m=>{m.preventDefault(),m.srcElement.scrollTop=0,m.srcElement.scrollLeft=0})},[qe.current]);const g=r.useImperativeElement(t,()=>({isMovableArea:()=>!0,focusMovable:he,focus:()=>{he()}}),[a]),[je,Be]=o.useState(null),Ee=o.useRef(!1),u=o.useRef(!1),L=o.useRef(!1);o.useEffect(()=>{if(C||v.length===0||L.current||Ee.current)return;if(u.current)return void requestAnimationFrame(()=>{ne.current&&b.current&&ne.current.refTargets.length>0&&(L.current=!0,ze.current?.(!0)),E([...v])});Ee.current=!0;const m=o.lazy(async()=>{try{const A=await Promise.resolve().then(()=>require("./F8ZECny0CwW2OV5X.cjs"));return Ee.current=!1,u.current=!0,E([...v]),A}catch(A){return console.warn(A),ze.current?.(!1),null}});Be(m)},[v,C,M,y]);const K=o.useMemo(()=>!je||C?null:s.jsx(o.Suspense,{children:s.jsx(je,{className:ct({dragging:q||F,resizing:q,moving:F}),container:null,ref:ne,target:ne.current?v:[],draggable:!C&&!M,resizable:!C&&!y,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:I,onResizeStart:m=>{me(m.target,"Resize")},onResize:m=>{if(!ee.current)return m.stopDrag(),void Ce();Z(!0);const A=m.direction[0]!==0&&m.direction[1]!==0;let G=0,J=0;for(let re=0;re<v.length;re++){const x=v[re],B=R.current.get(x),S=de.current.get(x);if(!B||!S){console.warn("invalid element");continue}let j=m.dist[0],se=m.dist[1],ae=m.drag.dist[0],we=m.drag.dist[1],Y=B.startBounds.width,fe=B.startBounds.height;re===0?(G=Y,J=fe):(j*=Y/G,ae*=Y/G,se*=fe/J,we*=fe/J);const V={...B.startBounds};if(V.width=Math.max(0,Y+j),V.height=Math.max(0,fe+se),m.direction[0]===-1&&(V.width=Math.max(0,Math.min(B.startBounds.x+Y,Y-ae))),m.direction[1]===-1&&(V.height=Math.max(0,Math.min(B.startBounds.y+fe,fe-we))),A&&(S.isLockAspectRatio()||m.inputEvent?.shiftKey)){const X=Y/fe,oe=V.width/V.height;oe>X?V.height=V.width/X:oe<X&&(V.width=V.height*X)}m.direction[0]===-1&&(V.x=Math.max(0,Math.min(B.startBounds.x+Y,B.startBounds.x+Y-V.width))),m.direction[1]===-1&&(V.y=Math.min(B.startBounds.y+fe,B.startBounds.y+fe-V.height)),B.movable.setBounds(n.toAbsoluteBounds(V))}},onResizeEnd:m=>{Z(!1),Te()},onDragStart:m=>{me(m.target,"Move")},onDrag:m=>{if(!ee.current)return m.stopDrag(),void Ce();P(!0);for(let A=0;A<v.length;A++){const G=v[A],J=R.current.get(G);J?J.movable.setBounds(n.toAbsoluteBounds({...J.startBounds,x:J.startBounds.x+m.translate[0],y:J.startBounds.y+m.translate[1]})):console.warn("invalid element")}},onDragEnd:m=>{},onMouseUp:m=>{}})}),[Re,je,v,n,C,M,y,q,F]);return s.jsx("div",{className:ct(p,"movable-area",Xl),style:{width:_.width,height:_.height,...T,position:"absolute",overflow:"hidden",willChange:"transform"},ref:Nt([g,qe]),...D,children:s.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:_.width,height:_.height},...D,children:s.jsxs("div",{ref:b,style:{position:"absolute",pointerEvents:"auto"},onFocus:m=>{N?.(),Le(!0)},onBlur:m=>{Le(!1)},onKeyDownCapture:m=>{if(m.isDefaultPrevented())return;const A=m.nativeEvent.ctrlKey,G=m.nativeEvent.altKey,J=m.nativeEvent.shiftKey;if(m.which===r.KeyCodes.Escape){const j=a.getMovableSelection();let se=[...j];return v.forEach(ae=>{if(se.length===0)return;const we=de.current.get(ae);let Y=se.indexOf(we);se.splice(Y,1)}),se.length!==j.length&&a.selectMovables(se),se.length===0&&w?.(),void m.preventDefault()}const re=.1,x=j=>{i.updateSelected(se=>{se.setRotation(se.getRotation()+j)},"Rotate")},B=(j,se=!0)=>{i.updateSelected(ae=>{const we=ae.getBounds();let Y=1+j;se||(Y=1/Y);const fe=Math.sqrt(Math.pow(we.width,2)+Math.pow(we.height,2)),V=Math.atan2(we.height,we.width),X=Y*fe;if(X<10)return;const oe=X*Math.cos(V),Fe=X*Math.sin(V),Ue={x:we.x+(we.width-oe)/2,y:we.y+(we.height-Fe)/2,width:oe,height:Fe};ae.setBounds(Ue)},"Resize")},S=j=>{i.updateSelected(se=>{const ae=se.getBounds(),we={x:ae.x+(j.x??0),y:ae.y+(j.y??0),width:ae.width+(j.width??0),height:ae.height+(j.height??0)};se.setBounds(we)},"Nudge")};if(m.which===r.KeyCodes.Delete)i.updateSelected(j=>{j.delete()},"Delete"),m.preventDefault();else if(m.key==="a"&&A){const j=a.getMovableSelection();a.selectMovables(i.getItems(),!0),a.selectMovables(j,!0),m.preventDefault()}else m.key==="ArrowLeft"?(J?B(re,!1):G?x(-10):S({x:A?-10:-1}),m.preventDefault()):m.key==="ArrowRight"?(J?B(re,!0):G?x(10):S({x:A?10:1}),m.preventDefault()):m.key==="ArrowUp"?(J?B(re,!0):S({y:A?-10:-1}),m.preventDefault()):m.key==="ArrowDown"&&(J?B(re,!1):S({y:A?10:1}),m.preventDefault())},children:[ce,K]})})})})),Ut=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,i=0,a=0;for(let l=0;l<e.length;l++){const f=e[l].getBounds();t=Math.min(f.x,t),n=Math.min(f.y,n),i=Math.max(f.x+f.width,i),a=Math.max(f.y+f.height,a)}return{x:t,y:n,width:i-t,height:a-n}},Oo=(e,t=!0)=>{const n=[],i=t?"x":"y",a=t?"y":"x",l=t?"width":"height";let f=0,h=Number.MAX_SAFE_INTEGER,c=0;for(let y=0;y<e.length;y++){const p=e[y],T=p.getBounds();f+=T[l],h=Math.min(T[i],h),c=Math.max(T[i]+T[l],c),n.push({bounds:T,movable:p})}const C=(c-h-f)/(e.length-1);n.sort((y,p)=>{const T=y.bounds[i],I=p.bounds[i];return T!==I?T-I:y.bounds[a]-p.bounds[a]});const M=new Map;M.set(n[0].movable,n[0].bounds);for(let y=1;y<n.length-1;y++){const p=n[y-1].bounds,T={...n[y].bounds};T[i]=p[i]+p[l]+C,n[y].bounds=T,M.set(n[y].movable,T)}return M.set(n[n.length-1].movable,n[n.length-1].bounds),M},qr=e=>{const{movables:t,movablesView:n,transactional:i,commands:a,target:l,onRepeatCommandChange:f}=e,h=r.useNotifier(),c=r.useEditMode();o.useRef(c.getMode()).current=c.getMode();const C=r.useCallbackRef(async(w,N,v=null,E=!0)=>{const q=async()=>{const Z=await Promise.resolve(h?.showBusy?.(w.getLabel()));try{await N();const F=v??w?.getLabel?.();if(f){let P=null;w&&F!==!1&&(P=new r.SimpleCommand(w.getKey(),l,{label:F,description:F},q)),f(P)}Z?.(),E&&c.setMode(null)}catch(F){Z?.(),h?.showError?.(F)}};await q()},[f,h]),[M,y]=o.useReducer(w=>w+1,0),p=r.useCallbackRef((w,N,v)=>{if(!n)return;const E=n.getMovableSelection();if(E.length===0)return;let q="Drawings";if(E.length===1){const F=E[0];q=d.TextUtils.capitalize(F.getContent().getType())??"Drawing"}const Z=`${w.getLabel()} ${q}`;C(w,()=>{let F=null;i&&(F=i.beginCommit(Z));const P=n.getMovableSelection();if(P.length===0)return;const W=v?.(P);for(let pe=0;pe<P.length;pe++){const de=P[pe];N(de,W)}F?.commit()})},[n,i]),[T,I]=o.useState(n.getMovableSelection()[0]??null),[z,D]=o.useState(!T||T?.isProtected()),_=o.useMemo(()=>[new r.Command("moveToFront",l,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",icon:"DrawToFront",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,w=>{w.moveToFront()})}),new r.Command("moveForward",l,{label:"Bring Forward",description:"Move forward one layer in the z order.",icon:"DrawMoveForward",shortcut:{key:"BracketRight",modifiers:[r.KeyModifiers.Ctrl]}},function(){p(this,w=>{w.moveForward()})}),new r.Command("moveToBack",l,{label:"Send to Back",description:"Move to the back of all of the other drawings.",icon:"DrawToBack",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl,r.KeyModifiers.Shift]}},function(){p(this,w=>{w.moveToBack()})}),new r.Command("moveBackward",l,{label:"Send Backward",description:"Move backwards one layer in the z order.",icon:"DrawMoveBackward",shortcut:{key:"BracketLeft",modifiers:[r.KeyModifiers.Ctrl]}},function(){p(this,w=>{w.moveBackward()})}),new r.Command("toggleLockAspectRatio",l,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners.",icon:"DrawAspect"},function(){p(this,w=>{w.setLockAspectRatio(!w.isLockAspectRatio())})}),new r.Command("formatAnchorTypeTwoCell",l,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes.",icon:"DrawResize"},function(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.TwoCell)})}),new r.Command("formatAnchorTypeOneCell",l,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes.",icon:"DrawResize"},function(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.OneCell)})}),new r.Command("formatAnchorTypeAbsolute",l,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes.",icon:"DrawResize"},function(){p(this,w=>{w.setAnchorType(d.IAnchored.Type.Absolute)})}),new r.Command("formatDrawAlignLeft",l,{label:"Align Left",description:"Align the selected drawings to the left.",icon:"DrawAlignLeft"},function(){p(this,(w,N)=>{w.setBounds({x:N.x})},Ut)}),new r.Command("formatDrawAlignCenter",l,{label:"Align Center",description:"Align the selected drawings vertically relative to each other.",icon:"DrawAlignCenter"},function(){p(this,(w,N)=>{w.setBounds({x:(N.width-w.getBounds().width)/2+N.x})},Ut)}),new r.Command("formatDrawAlignRight",l,{label:"Align Right",description:"Align the selected drawings to the right.",icon:"DrawAlignRight"},function(){p(this,(w,N)=>{w.setBounds({x:N.width-w.getBounds().width+N.x})},Ut)}),new r.Command("formatDrawAlignTop",l,{label:"Align Top",description:"Align the selected drawings to the top.",icon:"DrawAlignTop"},function(){p(this,(w,N)=>{w.setBounds({y:N.y})},Ut)}),new r.Command("formatDrawAlignMiddle",l,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other.",icon:"DrawAlignMiddle"},function(){p(this,(w,N)=>{w.setBounds({y:(N.height-w.getBounds().height)/2+N.y})},Ut)}),new r.Command("formatDrawAlignBottom",l,{label:"Align Bottom",description:"Align the selected drawings to the bottom.",icon:"DrawAlignBottom"},function(){p(this,(w,N)=>{w.setBounds({y:N.height-w.getBounds().height+N.y})},Ut)}),new r.Command("formatDrawDistributeHorz",l,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each.",icon:"DrawDistributeHorz"},function(){p(this,(w,N)=>{w.setBounds(N.get(w))},w=>Oo(w))}),new r.Command("formatDrawDistributeVert",l,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each.",icon:"DrawDistributeVert"},function(){p(this,(w,N)=>{w.setBounds(N.get(w))},w=>Oo(w,!1))}),new r.Command("formatDrawFlipHorz",l,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new r.Command("formatDrawFlipVert",l,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new r.Command("formatDrawGroup",l,{label:"Group",description:"Group the selected drawings into a single drawing.",icon:"DrawGroup"}),new r.Command("formatDrawUngroup",l,{label:"Ungroup",description:"Break the group of a drawing into individual drawings.",icon:"DrawUngroup"}),new r.Command("formatDrawSwapShapes",l,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new r.Command("formatDrawSwapShapesHorz",l,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new r.Command("formatDrawSwapShapesVert",l,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[n,T]);o.useEffect(()=>{},[c]);const $=o.useMemo(()=>{let w=null;return w=a?a.createChildGroup(l,"movable",!1):new r.CommandGroup(l,"movable"),w.addCommands(_,!0),w},[a,_]);return Qe(T,{onAnyChange:()=>{$.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===d.IAnchored.Type.TwoCell}),$.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===d.IAnchored.Type.OneCell}),$.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===d.IAnchored.Type.Absolute}),$.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===d.IAnchored.Type.Absolute}),$.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:w=>{D(w.isProtected())},onDelete:()=>{}}),Qe(n,{onMovableSelectionChange:()=>{const w=n.getMovableSelection()[0]??null;I(w),D(!w||w.isProtected()),y()}}),Qe(t,{onCollectionChange:()=>{y()}}),o.useEffect(()=>{const w={disabled:z};$.getCommand("formatAnchorTypeTwoCell").update(w),$.getCommand("formatAnchorTypeOneCell").update(w),$.getCommand("formatAnchorTypeAbsolute").update(w),$.getCommand("toggleLockAspectRatio").update(w);const N=t.getCount(),v=n.getMovableSelection(),E=z||N<=1||v.length===0;let q={disabled:E},Z=q;if(!E&&v.length===1){const W=v[0];W.getZIndex()===0&&(q={disabled:!0}),W.getZIndex()===N-1&&(Z={disabled:!0})}$.getCommand("moveToFront").update(Z),$.getCommand("moveForward").update(Z),$.getCommand("moveToBack").update(q),$.getCommand("moveBackward").update(q);const F={disabled:z||v.length<=1};$.getCommand("formatDrawAlignLeft").update(F),$.getCommand("formatDrawAlignCenter").update(F),$.getCommand("formatDrawAlignRight").update(F),$.getCommand("formatDrawAlignTop").update(F),$.getCommand("formatDrawAlignMiddle").update(F),$.getCommand("formatDrawAlignBottom").update(F),$.getCommand("formatDrawFlipHorz").update(F),$.getCommand("formatDrawFlipVert").update(F),$.getCommand("formatDrawGroup").update(F),$.getCommand("formatDrawUngroup").update(F),$.getCommand("formatDrawSwapShapes").update(F),$.getCommand("formatDrawSwapShapesHorz").update(F),$.getCommand("formatDrawSwapShapesVert").update(F);const P={disabled:z||v.length<=2};$.getCommand("formatDrawDistributeHorz").update(P),$.getCommand("formatDrawDistributeVert").update(P)},[M,z,M]),$},Yl=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,description:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const M=r.useImperativeElement(t,()=>({isEmptyFrame:()=>!0}),[]),[y,{height:p,width:T}]=Wt();return s.jsx("div",{...C,ref:Nt([M,y]),children:s.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",filter:i?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:s.jsx("div",{style:{textAlign:"center"},children:a})})})})),Jl=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,propsMovable:a,renderMovable:l,commands:f,target:h,onRepeatCommandChange:c}=e,C=qr({movables:i.getMovables(),movablesView:i?.getView(),transactional:i,onRepeatCommandChange:c,commands:f,target:h});o.useEffect(()=>{n?.getStage()},[n?.getStage()]);const M=o.useMemo(()=>s.jsx(xr,{ref:t,view:n,movables:i.getMovables(),disableResize:!i.getProtection().isObjectsAllowed(),disableDrag:!i.getProtection().isObjectsAllowed(),movablesView:i.getView(),transactional:i,renderMovable:l,...a,onFocus:()=>{C.activate(),a?.onFocus?.()}},"movable-area"),[i,a,f,C]);return M&&n?M:null})),Ql=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,gridStyle:a,getCellEditor:l,showProtectedError:f,setEditingCoords:h,commands:c}=e,C=r.useEditMode(),[M,y]=o.useState(null),[p,T]=o.useState(null),[I,z]=o.useState(null),[D,_]=o.useState(null),[$,w]=o.useState(null);o.useLayoutEffect(()=>{if(I===null)return _(null),void w(null);const k=()=>{const b=i.getRange(I).getCell(),ee=b.getStyle();let ne,Re=ee.getFill()?.toCSS(a.body.darkMode);Re.background!=="none"&&Re.background!=="transparent"||(Re=i.getStyles().getNormal().getFill().toCSS(a.body.darkMode)),Re.background!=="none"&&Re.background!=="transparent"||(Re={background:a.body.fill}),_({style:Re}),b&&!b.getFormula()&&(ne=b?.getRenderHorizontalAlignment()),w(ne??r.HorizontalAlignment.Left)};return k(),i.getRange(I).addListener(()=>{k()})},[i,I,a?.body]);const N=r.useCallbackRef(()=>{let k=p.editState.dirty??"";if(p.editState.dirty!==void 0){const b=d.TextUtils.clampString(k);try{const ee=p.sheet.getRange(p.coords),ne=`Typing '${b}' into ${ee.toString()}`;return ee.setValue(k,{description:ne,autoFit:!0}),z(null),T(null),C.setMode(null),h(null),!0}catch(ee){throw ge.Notifier.error(new Error(`Unable to enter '${b}'.`,{cause:ee})),ee}}},[i,p]),v=r.useCallbackRef(k=>i.getRange(k).getCell().getExtrusions()??ge.CoordUtils.cellToRange(k),[i]),E=r.useCallbackRef(k=>{let b=d.IRange.Orientation.Row,ee=!1;k!==d.IRange.Direction.Up&&k!==d.IRange.Direction.Down||(b=d.IRange.Orientation.Column),k!==d.IRange.Direction.Left&&k!==d.IRange.Direction.Up||(ee=!0),i.getSelection().traverse(b,ee)},[i]),q=o.useCallback((k,b)=>{if(l)return l(k,b);if(!i)return null;const{ref:ee,...ne}=k;return s.jsx(gr,{ref:ee,...ne,sheet:i,bodyStyle:a?.body,activeCoords:b,commands:c,onChangeEdit:Re=>{const Ce={sheet:i,coords:b,editState:Re};C.setMode(ye=>({...ye,description:Ce.editState.editMode?"Edit":"Enter",args:{...ye?.args,stateAndCoords:Ce}}))},editState:p.editState})},[i,D,l,p,I]),{renderOverlay:Z,startEdit:F,submitEdit:P,cancelEdit:W,onKeyboardEventNative:pe,onPointerEventNative:de}=gt.useKeyboardEditorOverlay({view:n,activeCoords:M,getCellEditor:q,canEdit:()=>{const k=i.getProtection();if(k.isReadOnly())return!1;const b=k.isLocked();return b&&f(),!b},onBeforeStartEdit:k=>{const b=hr(()=>i.getRange(k).getCell()),ee={sheet:i,coords:k,editState:Object.freeze(b)};C.setMode({key:"edit",args:{stateAndCoords:ee}}),T(ee)},onStartEdit:k=>{z(k),h(k)},onSubmitEdit:N,onCancelEdit:k=>{z(null),T(null),C.setMode(null),h(null)},onDoneEdit:k=>{C.setMode(null)},onNavigate:E,propsContainer:D,borderStrokeFill:a.selection?.strokeFill,borderStrokeWidth:i?.getSelection().getCoords().ranges?.length>1?1:2,alignment:$,getRangeCoords:v});Qe(i.getSelection(),{onChange(k){y(i.getSelection().getCoords().cell)}});const le=r.useCallbackRef(k=>{de(k),I&&P()},[de,W,I]),R=o.useCallback(k=>{de(k)},[de]),te=o.useCallback(k=>{pe(k)},[pe]);return o.useEffect(()=>{const k=n?.getStage();if(k)return k.addEventListener("pointerdown",le),k.addEventListener("dblclick",R),k.addEventListener("keydown",te),()=>{k.removeEventListener("pointerdown",le),k.removeEventListener("dblclick",R),k.removeEventListener("keydown",te)}},[n?.getStage()]),o.useEffect(()=>{const k=C.getMode(),b=k?.key;b==="edit"||b==="enter"?p?k.args?.cancel?W():k.args?.submit?P():T(k.args?.stateAndCoords):F(k.args?.start):I&&W()},[C]),Z(n,t)})),Sr="white",Rr="black",ei=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Rr}' fill='${Sr}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,ti=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Rr}' fill='${Sr}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,ni=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i}=e,[a,l]=o.useState(i.getTables().getCount()>0),[f,h]=o.useState(null),[c,C]=o.useState(null),[M,y]=o.useState(null),[p,T]=o.useState(null),I=r.useCallbackRef(()=>{if(i.getTables().getCount()>0){l(!0);const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)}else l(!1),h(null)},[i,n]),z=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const E=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:E});q.length===1&&q[0].select()},[n,i]),D=r.useCallbackRef(v=>{v.preventDefault(),v.stopPropagation();const E=n.getCellCoordsFromClient(v.clientX,v.clientY),q=i.getTables().getItems({address:E});if(q.length===1){const Z=q[0].getRange().getCoords(),F={colStart:Z.colStart,rowStart:E.rowIndex,colEnd:Z.colEnd,rowEnd:E.rowIndex};i.getRange(F).select()}},[n,i]),_=r.useCallbackRef(()=>{if(!a)return;const v=i.getTables().getItems({address:n.getVisibleRangeCoords()});h(v.length>0?v:null)},[i,a,n]);Qe(i?.getSelection(),{onChange(v){C(i.getSelection().getCoords().cell)}}),Qe(M,{onAnyChange(v){I(),_()}}),Qe(p,{onAnyChange(v){_()}}),Qe(i,{onTablesChange(v){I(),_()},onInvalidated(v){I(),_()}});const $=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(_,300),300),[]);o.useEffect(()=>{$()},[n]),o.useEffect(()=>{let v=null;if(f)for(let E=0;E<f.length&&!v;E++){const q=f[E],Z=q.getRange().getCoords();d.CoordUtils.isCellWithinRange(c,Z)&&(v=q)}y(v)},[c,f]);const w=r.useCallbackRef(v=>{let E=null;if(f)for(let q=0;q<f.length;q++){const Z=f[q],F=Z.getRange().getCoords();let P=n.getRangeCoordsBounds(F);const W=n.getRelativePointFromClient(v.clientX,v.clientY),pe=W.x,de=W.y;if(pe>=P.x&&pe<=P.x+P.width&&de>=P.y&&de<=P.y+P.height){const le=n.getViewportSize();pe<=0||de<=0||pe>=le.width||de>=le.height||(E=Z)}}T(E)},[n,f]);if(o.useEffect(()=>{const v=n?.getStage();if(v&&f)return v.addEventListener("mousemove",w),v.addEventListener("mouseleave",w),()=>{v.removeEventListener("mousemove",w),v.removeEventListener("mouseleave",w)}},[f,n?.getStage()]),!n||!f||f.length===0)return null;const N=[];for(let v=0;v<f.length;v++){const E=f[v];if(E.isClosed())continue;const q=E===p,Z=E===M,F=E.getRange().getCoords(),P=n.getRangeCoordsBounds(F);let W;if(q||Z){const pe=E.getStyle().getProperties(),de=pe.headerRow?.fill?.background??pe.wholeTable?.border?.top?.color?.toString();if(de&&i){const le=i.getStyles().parseColor(de);le&&(W=le.toCSS())}W||(W="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}N.push(s.jsx("div",{style:{position:"absolute",left:P.x,top:P.y,width:Math.min(16,P.width),height:P.height,pointerEvents:"all",cursor:ei},onMouseDown:D},`table-select-row-${E.getName()}`)),N.push(s.jsx("div",{style:{position:"absolute",left:P.x,top:P.y,width:Math.min(16,P.width),height:Math.min(16,P.height),pointerEvents:"all",cursor:ti},onMouseDown:z},`table-select-${E.getName()}`)),N.push(s.jsx(gt.Selection,{x:P.x,y:P.y,width:P.width,height:P.height,range:F,strokeWidth:Z?.5:0,stroke:W??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:q?`${W} 0px 0px 1px 1px`:void 0}},`table-outline-${E.getName()}`))}return N})),oi=o.memo(o.forwardRef((e,t)=>{const{view:n,sheet:i,animationTime:a=60}=e,[l,f]=o.useState(null),[h,c]=o.useState(null),C=o.useRef(null),M=r.useCallbackRef(()=>{const D=i.getSelectedCell(),_=D.getSpill()?.getCoords()??null;ge.CoordUtils.isEqualRanges(_,l)||(c(_?{transition:l?"move":"in",bounds:n.getRangeCoordsBounds(_),coords:_}:{transition:"out",bounds:n.getRangeCoordsBounds(l),coords:l}),f(_))},[i,n,l]);o.useEffect(()=>(C.current&&(clearTimeout(C.current),C.current=null),h&&(C.current=setTimeout(()=>{c(null),C.current=null},a)),()=>{C.current&&(clearTimeout(C.current),C.current=null)}),[h,a]);const y=o.useMemo(()=>ge.CommonUtils.debounce(ge.CommonUtils.throttle(M,80),80),[]);if(Qe(i?.getSelection(),{onChange(D){y()}}),Qe(i,{onSpillsChange(D){M()},onInvalidated(D){M()}}),!n||!l&&!h)return null;const p=i.getRange(l).getValue()instanceof d.FormulaError.Spill,T=[];let I=h?.bounds??n.getRangeCoordsBounds(l);if(h&&!ge.CommonUtils.isEqualBounds(h.bounds,n.getRangeCoordsBounds(h.coords))&&c(null),I=n.toClipBounds(I,-10),!I)return;const z="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return T.push(s.jsx(gt.Selection,{x:I.x,y:I.y,width:I.width,height:I.height,range:l,strokeWidth:1,stroke:z,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:p?"6 3":void 0,opacity:h?.transition==="out"?0:1,transition:h?.transition?h.transition==="in"||h.transition==="out"?`opacity ${1.5*a}ms ease-in-out`:`left ${a}ms ease-out, top ${a}ms ease-out, width ${a}ms ease-out, height ${a}ms ease-out`:"none",boxShadow:`${z} 0px 0px 4px 0px`}},"spill-outline}")),T})),ri={position:"absolute",top:0,left:0,bottom:0,right:0},Ho=(e,t)=>{const n={...e},i=t?.getNormal().getFont(),a=i?.toCSS(),l={text:{fontFamily:a?.fontFamily,fontSize:i?.getSize()}},f=n.body=ge.CommonUtils.mergeContentful(e.body,l);return n.body=ge.CommonUtils.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},f),n.buttonSurface=ge.CommonUtils.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=ge.CommonUtils.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=ge.CommonUtils.mergeContentful(n.header,l),n.headerSelect=ge.CommonUtils.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=ge.CommonUtils.mergeContentful(n.headerSelect,l),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=ge.CommonUtils.mergeContentful(n.headerSelectAll,l),n},li={fireOnModelChange:!1},Vo={},kr=o.memo(o.forwardRef((e,t)=>{const{sheet:n,gridStyle:i=Vo,headersStyle:a=Vo,onSheetContextMenu:l,showColumnHeaders:f,propsColumnHeader:h,showRowHeaders:c,propsRowHeader:C,showScrollbars:M=!0,propsScrollPane:y,onViewportChange:p,commands:T,onRepeatCommandChange:I,overlays:z,renderMovable:D,viewportComponent:_,onElementLoad:$,getCellEditor:w,onFocus:N,onBlur:v,style:E=r.ReactUtils.EmptyCssProperties,onShowTooltip:q,onShowColumnTooltip:Z,onShowRowTooltip:F,onCloseTooltip:P,propsGrid:W,propsCellRender:pe,...de}=e;if(o.useEffect(()=>{d.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[le,R]=o.useReducer(Q=>Q+1,0),[te,{width:k,height:b}]=Wt(),ee=r.useCallbackRef(q,[q]),ne=r.useCallbackRef(Z,[Z]),Re=r.useCallbackRef(F,[F]),Ce=r.useCallbackRef(P,[P]),ye=o.useRef(!1);o.useLayoutEffect(()=>{ye.current=!0},[n]);const Pe=n?.getStyles(),ze=o.useMemo(()=>Ho(i,Pe),[i,Pe]),Ae=o.useMemo(()=>Ho(a,Pe),[a,Pe]),{body:Ie={},buttonSurface:ue={}}=ze,{header:O={},headerSelect:xe={},headerSelectAll:Le={}}=Ae,H=o.useRef(null),[U,he]=o.useState(()=>n?.getView()),ce=(U?.getZoomScale()??100)/100,me=o.useMemo(()=>({vertical:U.isShowColumnGridlines()&&ce>=.4,horizontal:U.isShowRowGridlines()&&ce>=.4}),[U?.isShowColumnGridlines(),U?.isShowRowGridlines(),ce]),Te=o.useMemo(()=>{if(U?.getGridLineColor())return{strokeDasharray:"1,1"}},[U?.getGridLineColor(),ze]),ie=f??U?.isShowColumnHeaders(),qe=c??U?.isShowRowHeaders(),[g,je]=o.useState({width:0,height:0}),Be=o.useMemo(()=>{let Q=40,Me=20;const Ke=n?.getStyles().getNormal().getFont();if(g.width>0&&g.height>0){const Ve=Ke?.toCSS()?.fontFamily??ze.header.text.fontFamily,Ge=Ke?.getSize()??ze.header.text.fontSize,We=d.IFont.getSharedMeasurer()(""+g.height,Math.ceil(Ge*d.IFont.getDeviceScale()),Ve);Q=We.width,Me=We.lineHeight}return{width:Math.round(Q+5),height:Math.round(Me+3)}},[g,ze?.header.text,n]),Ee=qe?ce*Be.width:O.edgeStrokeWidth,u=ie?ce*Be.height:O.edgeStrokeWidth,L=Math.max(k,(n?.getColumnHeaders().getDefaultSize()??Be.width)+Ee+1),K=Math.max(b,(n?.getRowHeaders().getDefaultSize()??Be.height)+u+1),m=o.useRef(new Map),A=o.useRef(null),G=()=>({getColOffset:Q=>n.getColumnHeaders().findOffset(Q),getColIndex:Q=>n.getColumnHeaders().findIndex(Q),getRowOffset:Q=>n.getRowHeaders().findOffset(Q),getRowIndex:Q=>n.getRowHeaders().findIndex(Q)}),[J,re]=o.useState(()=>G()),[x,B]=o.useState(!1),[S,j]=o.useState(null),se=!0,ae=ze.selection?.strokeFill,we=o.useCallback(()=>Mt.current,[]),[Y,fe]=o.useState(),V=r.useCallbackRef(Q=>{fe(Q);const Me=n?n.getView():null;Me&&Me.setTopLeft(Q?{left:Q.left,top:Q.top}:null),p?.(Q)},[n,p]),X=o.useRef(null);o.useEffect(()=>{if(!Y||!n)return;const Q=n.getRangeAtBounds({x:Y.left,y:Y.top,width:Y.width,height:Y.height});X.current?.(),X.current=Q.addListener(()=>{const Me=Q.getCoords();H?.current?.invalidate(Me)})},[Y,n]);const[oe,Fe]=o.useState(()=>n?.getView().getTopLeft()),Ue=r.useCallbackRef(Q=>{const Me=ge.CoordUtils.cellToRange(Q);if(n.isClosed())return Me;const Ke=n.getRange(Me,{ignoreHidden:!0}).getMerges();return Ke.length===0?Me:Ke[0]},[n]),Oe=Q=>{if(!Q||Q.coords.colIndex===0&&Q.coords.rowIndex===0)return null;const Me={};return Q.coords.colIndex>0&&(Me[ge.AnchorLocation.Left]={index:Q.coords.colIndex,scrollOffset:Q.topLeft.left}),Q.coords.rowIndex>0&&(Me[ge.AnchorLocation.Top]={index:Q.coords.rowIndex,scrollOffset:Q.topLeft.top}),Me},[Se,He]=o.useState(()=>Oe(n.getView().getFreezePanes())),ve=r.useEditMode(),De=o.useCallback(()=>H.current,[]),be=r.useCallbackRef(Q=>{ve.setMode(Me=>Me?.key==="edit"?{...Me,args:{...Me.args}}:{key:"edit",args:{stateAndCoords:null,start:Q}})},[]),ke=r.useCallbackRef(()=>Y,[Y]),Ne=wr({sheet:n,commands:T,target:De,onRepeatCommandChange:I,bodyStyle:Ie,onStartEdit:be,getViewport:ke}),[Ze,_e]=o.useState(n.getSelection().isEntire()),[Xe,at]=o.useState(U?.getMovableSelection().length>0),ot=S!==null||Xe,$e=null,[lt,it]=o.useState(!1);o.useEffect(()=>{it(!1)},[n.getProtection()]);const Je=r.useNotifier(),st=r.useCallbackRef(()=>{lt||(it(!0),Je.showMessage?.(s.jsxs("span",{children:["This sheet is protected.",s.jsx("br",{}),"To make a change, unprotect the sheet. You might be requested to enter a password."]}),{type:r.NotifierType.Error}))},[Je,lt]),wt=o.useMemo(()=>{const Q=ve.getMode();return Q?.cursor?Q.cursor:null},[$e,ve]),[bt,dt]=o.useState(null),ft=o.useRef(!1),[xt,Un]=o.useState([]),Yt=o.useRef(null),[fn,Pt]=o.useState(ge.TypesUtils.EmptyTopLeft),[jt,It]=o.useState(ge.TypesUtils.EmptyTopLeft);o.useEffect(()=>{Pt({left:oe?.left,top:0})},[oe?.left]),o.useEffect(()=>{It({left:0,top:oe?.top})},[oe?.top]),Qe(n?.getView(),{onFreezeSplitChange:()=>{He(Oe(n.getView().getFreezePanes()))},onTopLeftChange:()=>{Fe(n.getView().getTopLeft())},onMovableSelectionChange:()=>{at(n.getView().getMovableSelection().length>0)}}),Qe(n?.getSelection(),{onChange:()=>{_e(n.getSelection().isEntire())}}),Qe(n,{onViewChange(){he(n.getView()),re(G())},onLayoutChange:()=>{const Q=n.getEntireRange();je({height:Q.getRowCount(),width:Q.getColumnCount()}),re(G())},onStyleChange:()=>{At()},onMovablesChange:()=>{},onInvalidated:()=>{At()}}),Qe(n,{onRequestScrollIntoView:async(Q,Me)=>{if(!Me)return;const Ke={colIndex:Me?.coords?.colStart,rowIndex:Me?.coords?.rowStart};return await H.current?.scrollCellCoordsIntoView(Ke,Me?.scroll),!0},onRequestFocus:()=>ge.CommonUtils.whenFocus(Mt.current)},li);const pt=o.useRef(!1),pn=o.useMemo(()=>{const Q=ge.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&ne?.(Ve)})},32),Me=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:0,rowEnd:g.height,colStart:Ve,colEnd:Ve})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getColOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.x+tt.width,rt.getColOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===ge.AnchorLocation.Left||Tt===ge.AnchorLocation.Center||Tt===ge.AnchorLocation.Right)){const to=ge.CommonUtils.roundAccurately(Ge*ge.CommonUtils.getDPI(),0),bn=ge.CommonUtils.roundAccurately(n?.getColumnWidthAsFontUnit(Ge/ce),2).toFixed(2),no="Width: "+(Ge?bn+" ("+to+" pixels)":"Hidden"),tn=Gn.current.getGridElement().getRelativePointFromClient(0,0),Vt=0-tn.y,xn=0-tn.y+u,oo=tn.x-tt.x;Q({anchor:{x:nt-oo,y:Vt,width:yt-nt,height:xn-Vt},display:no})}const zt=[0,0,0,tt.height],Yn={style:{boxShadow:`0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},Jn={x:nt-1,y:0,width:1,height:tt.height},Qn={style:{boxShadow:`-0.5px 0px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},eo={x:yt-1,y:0,width:1,height:tt.height};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Me(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Me(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Me(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},...h}},[n,h,u,bt]),Bt=o.useMemo(()=>{const Q=ge.CommonUtils.debounce(Ve=>{requestAnimationFrame(()=>{ft.current&&Re?.(Ve)})},32),Me=(Ve,Ge)=>{ft.current=!0,dt([We=>{if(!We.toClipBounds(We.getRangeCoordsBounds({rowStart:Ve,rowEnd:Ve,colStart:0,colEnd:g.width})))return;const rt=We.getLayout(),nt=Math.max(0,rt.getRowOffset(Ve)),tt=We.getBounds(),yt=Math.min(tt.y+tt.height,rt.getRowOffset(Ve+1)),Tt=We.getAnchor();if(Ge!==null&&(Tt===ge.AnchorLocation.Top||Tt===ge.AnchorLocation.Center||Tt===ge.AnchorLocation.Bottom)){const to=Math.floor(10*ge.CommonUtils.getDPI())/10,bn=ge.CommonUtils.roundAccurately(Ge*to,0),no=ge.CommonUtils.roundAccurately(bn/ce/(n?.getRowHeaders().getScaleFactor()*ge.CommonUtils.getDPI()),2).toFixed(2),tn="Height: "+(Ge?no+" ("+bn+" pixels)":"Hidden"),Vt=Ht.current.getGridElement().getRelativePointFromClient(0,0),xn=0-Vt.x,oo=0-Vt.x+Ee,gl=Vt.y-tt.y;Q({anchor:{x:xn,y:nt-gl,width:oo-xn,height:yt-nt},display:tn})}const zt=[0,0,tt.width,0],Yn={style:{boxShadow:`0px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},Jn={x:0,y:nt-1,width:tt.width,height:1},Qn={style:{boxShadow:`0px -0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:ae}},eo={x:0,y:yt-1,width:tt.width,height:1};return s.jsxs(o.Fragment,{children:[s.jsx(gt.SVGLine,{linePoints:zt,bounds:Jn,...Yn}),s.jsx(gt.SVGLine,{linePoints:zt,bounds:eo,...Qn})]},"resize-dividers")}])};let Ke=null;return{onResizeHeadersStart:(Ve,Ge,We)=>{Ke=n.beginCommit(We),pt.current=!1,Me(Ve,Ge)},onResizeHeaders:(Ve,Ge,We)=>{pt.current=!1,Me(Ve,Ge)},onResizeHeadersDown:(Ve,Ge)=>{pt.current=!0,setTimeout(()=>{pt.current&&Me(Ve,Ge)},360)},onResizeHeadersEnd:(Ve,Ge,We)=>{Ke?.commit({description:We}),Ke=null,pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},onResizeHeadersUp:Ve=>{pt.current=!1,requestAnimationFrame(()=>Ce?.()),ft.current=!1,dt(null)},...C}},[n,C,Ee]),Mt=r.useImperativeElement(t,()=>{const Q=Ke=>{n?.getView()&&n.getView().selectMovables([]),A.current=null,H?.current?.focus(Ke)},Me=async(Ke=null)=>{if(Ke||(Ke=n?.getView().getMovableSelection()[0]),!Ke)return!1;const Ve=Ke.getAnchorCoords();if(!Ve)return!1;const Ge=H.current?.getViewFromCellCoords({colIndex:Ve.colStart,rowIndex:Ve.rowStart});if(!Ge)return!1;const We=Ge.getAnchor();n?.getView().getMovableSelection().indexOf(Ke)===-1&&n?.getView().selectMovables([Ke]);let rt=m.current?.get(We);return rt?.current?(await rt.current.focusMovable(Ke),!0):(A.current={movable:Ke,anchor:We},!0)};return{getGridElement:()=>H.current,getRowHeaderElement:()=>Ht.current,getColumnHeaderElement:()=>Gn.current,rowHeaderHeight:()=>u,colHeaderWidth:()=>Ee,startEdit:be,submitEdit:()=>{ve.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,submit:!0}})},cancelEdit:()=>{ve.setMode(Ke=>Ke?.key!=="edit"?Ke:{key:"edit",args:{stateAndCoords:null,cancel:!0}})},isEditing:S!==null,focus:Ke=>{n?.getView().getMovableSelection().length>0&&Me()||Q(Ke)},focusSheet:Q,focusMovable:Me,contains:Ke=>H?.current?.contains?.(Ke),invalidate:At,isSheetElement:()=>!0,getSheet:()=>n}},[n]),At=o.useCallback(Q=>{ye.current||(H?.current?.invalidate(Q),R?.())},[]);o.useEffect(()=>{At()},[ze]);const Jt=Ze?Le.edgeStrokeFill:O.fill,Kn=Ze?xe.fill:typeof ze.headerHover=="function"?ze.headerHover(O)?.fill:O.fill,et=o.useMemo(()=>_?s.jsx("div",{className:ct("sheetxl-viewport-overlay",Sl),style:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute"},children:_}):s.jsx(s.Fragment,{}),[_]);let Qt=null;ie&&qe&&(Qt=s.jsxs("div",{tabIndex:-1,className:"top-left-corner",style:{padding:"2 2",position:"absolute",height:`${u}px`,width:`${Ee}px`,zIndex:1,boxSizing:"border-box",cursor:"cell"},onMouseDown:Q=>{let Me=!Q.ctrlKey;Ne?.getCommand("selectAll")?.execute(!Me||Q.button!==0),Q.nativeEvent.which===r.MouseButtonCodes.Right?l?.({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:-1,colIndex:-1}):H.current?.focus()},children:[s.jsx("div",{style:{height:u-5+"px",width:u-5+"px",clipPath:`path('M${u-5} 0 L0 ${u-5} L${u-5} ${u-5} L${u-5} 0 Z')`,borderRight:`2px solid ${Jt}`,borderBottom:`2px solid ${Jt}`,background:`${Kn}`,boxSizing:"border-box",position:"absolute",right:"2px",bottom:"2px"}}),s.jsx("div",{style:{position:"absolute",height:`${u}px`,width:`${Ee}px`,boxSizing:"border-box",borderRight:`solid 1px ${O.strokeFill}`,borderBottom:`solid 1px ${O.strokeFill}`,right:"-1px",bottom:"-1px"}})]}));const Ot=r.useCallbackRef(({_left:Q,_top:Me})=>{},[]),vn=r.useCallbackRef(Q=>{if(!l)return;const Me=H.current.getViewFromClient(Q.clientX,Q.clientY)?.getCellCoordsFromClient(Q.clientX,Q.clientY);Me&&(l({originalEvent:Q,clientX:Q.clientX,clientY:Q.clientY,rowIndex:Me.rowIndex,colIndex:Me.colIndex}),Q.stopPropagation(),Q.preventDefault())},[l]),ut=r.useCallbackRef(Q=>{if(!(!Q.shiftKey&&(Q.ctrlKey||Q.metaKey)))return;const{deltaY:Me}=Q;return Me>0?Ne.getCommand("sheetZoomOut")?.execute():Me<0&&Ne.getCommand("sheetZoomIn")?.execute(),Me===0},[Ne]);o.useEffect(()=>{Un(null),Yt.current=null,ft.current=!1,dt(null);const Q=n?.getView().getTopLeft();Ot(Q),H.current?.scrollTo(Q),Fe(Q),he(n.getView()),He(Oe(n.getView().getFreezePanes())),re(G()),R()},[n?.getView()]);const vt=o.useCallback((Q,Me)=>n.getRowHeaders().hiddenHeadersAt(Q,Me),[n]),Cn=o.useCallback((Q,Me)=>n.getColumnHeaders().hiddenHeadersAt(Q,Me),[n]),en=r.useCallbackRef(Q=>{const Me=Q.getVisibleRangeCoords();if(!Me)return null;const Ke=[];return n.getRange(Me).forEach((Ve,Ge)=>{const We=Ge.getCoords(),rt=Ge.getCell();(nt=>{if(nt.isEmpty())return!1;const tt=nt.getSpans();if(tt.width>1||tt.height>1||nt.getStyle().hasVisibleStyling()||U.isShowFormulas()&&nt.getFormula()!==null)return!0;const yt=nt.getValue();return yt!==null&&!(!U.isShowZeros()&&yt===0&&nt.getType()===d.ScalarType.Number)})(rt)&&Ke.push({coords:We,value:rt,range:U.isShowFormulas()?null:rt.getExtrusions()})},{ignoreHidden:!0,includeMergeOverflow:!0}),Ke},[n,U.isShowZeros(),U.isShowFormulas(),S]);o.useEffect(()=>{const Q=[];z&&Q.push(...z),bt&&Q.push(...bt),ge.CommonUtils.isEqualArrays(Q,Yt.current)||(Yt.current=Q,Un(Q))},[z,bt,ze]);const Dt=o.useMemo(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px ${i?.body?.fill}`},propsPath:{stroke:i?.body?.text?.fill??"black"}}),[ze?.header?.edgeStrokeFill]),$n=r.useCallbackRef(Q=>{Q.isDefaultPrevented()||Q.isPropagationStopped()||(A.current=null,n?.getView().getMovableSelection().length>0&&n.getView().selectMovables([]))},[n]),Wn=o.useMemo(()=>{const Q=ve.getMode();return Q?.key==="cut"||Q?.key==="copy"},[ve]),yn=r.useCallbackRef(async Q=>{const Me=ve.getMode();return Q.keyCode===r.KeyCodes.Escape&&Me?(Q.preventDefault(),void ve.setMode(null)):Q.keyCode===r.KeyCodes.Enter&&Wn?(Q.preventDefault(),await Ne?.getCommand("paste")?.execute(),void ve.setMode(null)):void Ne?.dispatchToFocusedCommand(Q)},[Ne,ve]),Ht=o.useRef(null),wn=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Ee+O.edgeStrokeWidth}px`,minWidth:`${Ee+O.edgeStrokeWidth}px`,borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2"},children:s.jsx(jo,{ref:Ht,sheetElement:Mt.current,gridRef:H,freezeStart:Se?.[ge.AnchorLocation.Top],oppositeSize:Ee,containerWidth:Ee,containerHeight:K,sheetHeader:n.getRowHeaders(),gridStyle:Ae,verticalPadding:Math.max(0,Math.floor(n.getStyles().getNormal().getFont().getSize()/10)),scrollPoint:jt,onSheetContextMenu:l,tabIndex:-1,style:{position:"relative",flex:"0",top:`${u+1}px`,width:`${Ee+O.edgeStrokeWidth}px`,minWidth:`${Ee+O.edgeStrokeWidth}px`,borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,height:`calc(100% - ${u}px)`,boxSizing:"border-box",zIndex:"2",...Bt?.style},...Bt})}),[Ee,u,K,n,jt,Se?.[ge.AnchorLocation.Top],ze,se,l,O.fill,C]),Gn=o.useRef(null),ll=o.useMemo(()=>s.jsx("div",{tabIndex:-1,style:{position:"relative",left:"0px",width:"100%",height:`${u+O.edgeStrokeWidth}px`,minHeight:`${u+O.edgeStrokeWidth}px`,borderBottom:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"},children:s.jsx(jo,{ref:Gn,sheetElement:Mt.current,gridRef:H,freezeStart:Se?.[ge.AnchorLocation.Left],oppositeSize:u,containerWidth:L,containerHeight:u,sheetHeader:n.getColumnHeaders(),gridStyle:Ae,scrollPoint:fn,onSheetContextMenu:l,...pn,style:{...pn?.style,position:"relative",left:"0px",width:"100%",height:`${u+O.edgeStrokeWidth}px`,minHeight:`${u+O.edgeStrokeWidth}px`,borderBottom:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,boxSizing:"border-box",zIndex:"1"}})}),[u,L,n,fn,Se?.[ge.AnchorLocation.Left],ze,O.fill,se,l,h]),il=r.useCallbackRef(Q=>{const{value:Me,key:Ke,...Ve}=Q;let Ge=Me,We=S;if(!We||We.colIndex===Q.coords.colIndex&&We.rowIndex===Q.coords.rowIndex||(We=null),!Ge){const tt=Q.range;if(Ge=n.getRange({rowIndex:tt.rowStart,colIndex:tt.colStart}).getCell(),Ge.isEmpty())return null}let rt=null;Ge.getHyperlink()&&(rt=async tt=>{if(pe?.onLinkMouseDown?.(tt),tt.button===0&&!tt.isDefaultPrevented()){tt.stopPropagation(),tt.preventDefault();try{await Ge.getHyperlink()?.open()}catch(yt){Je.showError?.(yt)}}}),We&&We.colIndex===Q.range.colStart&&We.rowIndex===Q.range.rowStart&&(Ge=Ge.createTemporaryCell({value:null}));const nt=n.getStyles();return o.createElement(ur,{...Ve,key:Ke,bodyStyle:Ie,docTheme:nt.getTheme(),normalStyle:nt.getNormal(),showFormulas:U.isShowFormulas(),showZeros:U.isShowZeros(),onLinkMouseDown:rt,...pe,value:Ge})},[n,J,Ie,S,U?.isShowFormulas(),U.isShowZeros()]),al=o.useCallback(Q=>{const{key:Me,ref:Ke,...Ve}=Q;return[s.jsx(Al,{ref:Ke,getVisibleCells:en,sheet:n,gridStyle:ze,...Ve},`border-${Me}`),s.jsx(ni,{ref:Ke,sheet:n,commands:Ne,...Ve},`table-${Me}`),s.jsx(oi,{ref:Ke,sheet:n,...Ve},`spill-${Me}`),s.jsx(Gl,{ref:Ke,sheet:n,commands:Ne,onShowTooltip:ee,onCloseTooltip:Ce,gridStyle:ze,gridRef:H,isActive:se,...Ve},`selection-${Me}`),s.jsx(Ol,{ref:Ke,sheet:n,commands:Ne,gridStyle:ze,element:we,...Ve},`copy-paste-${Me}`),s.jsx(Jl,{ref:Ke,sheet:n,commands:Ne,target:De,renderMovable:D,propsMovable:{onUnFocus:()=>{Mt.current.focus()}},...Ve},`movable-${Me}`),s.jsx(Ql,{ref:Ke,sheet:n,commands:Ne,gridStyle:ze,getCellEditor:w,showProtectedError:st,setEditingCoords:j,...Ve},`editor-${Me}`)]},[n,H.current,ze,w,Ne,Je]),[Io,sl]=o.useState(!1),cl=o.useMemo(()=>{if(L===0||K===0)return null;const Q=n.getStyles().getNormal(),Me=Q.getFont(),Ke=Q.getFill(),Ve=Q.getBorder(),Ge=Q.getFill().getType()===d.IFill.Type.None;let We=Te,rt=Te;const nt=(yt,Tt,zt)=>zt?{stroke:Ve.getBottom().isNone()?"none":yt.getColor().toRGBA(Ie.darkMode).toString(),...Tt}:Tt;rt=nt(Ve.getBottom(),rt,!Ve.getBottom().isNone()),rt=nt(Ve.getTop(),rt,!Ve.getTop().isNone()),We=nt(Ve.getRight(),We,!Ve.getRight().isNone()),We=nt(Ve.getLeft(),We,!Ve.getLeft().isNone());let tt=U?.getGridLineColor()?.toRGBA(Ie.darkMode).toString()??Ie.strokeFill;return Ge||(rt=nt(Ve.getBottom(),rt,!0),rt=nt(Ve.getTop(),rt,!0),We=nt(Ve.getRight(),We,!0),We=nt(Ve.getLeft(),We,!0)),s.jsx(gt.Grid,{className:"sheetxl-sheet-primary",style:{...ri,...Ke.toCSS(Ie.darkMode),...Me.toCSS(Ie.darkMode,ce),"--sxl-app-color-background":Ie.fill,"--sxl-app-color-shadow":ze.colorShadow,"--sxl-app-color-grey":ze.colorGrey,"--sxl-app-color-button-fill":ue.fill,"--sxl-app-color-button-text":ue.text?.fill,"--sxl-app-color-button-border":ue.edgeStrokeFill,"--sxl-app-color-primary-dark":ze.selection.strokeFill},ref:H,zoom:ce,...W,onFirstRender:yt=>{sl(!0),W?.onFirstRender?.(yt),Ne?.activate()},showGridLines:me,gridLineColor:tt,propsGridLineColumns:We,propsGridLineRows:rt,freezeLeft:Se?.[ge.AnchorLocation.Left],propsFreezeLeft:Dt,freezeTop:Se?.[ge.AnchorLocation.Top],propsFreezeTop:Dt,width:L,height:K,columnCount:g.width,rowCount:g.height,cursor:wt??$e??"cell",clipCells:!0,layout:J,renderCell:il,renderOverlay:al,getCellCoordsAsRangeCoords:Ue,hiddenRowsAt:vt,hiddenColumnsAt:Cn,getVisibleCells:en,onWheelScroll:ut,onPointerDown:$n,onKeyDown:yn,onViewportChange:V,onImmediateScroll:Ot,scrollPoint:oe,propsStage:{onFocus:()=>{Ne?.activate()}},renderOverlays:xt})},[le]);o.useEffect(()=>{ye.current||R()},[J,Se,ce,Ne,oe?.left,oe?.top,Ie,W,L,K,wt,xt,se,$e]);let _n={flex:"1 1 100%",display:"flex",alignContent:"stretch",position:"relative"};M||(_n={..._n,...E});const dl=o.useMemo(()=>{const Q=n.getStyles().getTheme(),Me=Q.getColorScheme(),Ke=Q.getFontScheme();return{"--sxl-doc-color-dk1":Me.getDk1().toCSS(Ie.darkMode),"--sxl-doc-color-dk2":Me.getDk2().toCSS(Ie.darkMode),"--sxl-doc-color-lt1":Me.getLt1().toCSS(Ie.darkMode),"--sxl-doc-color-lt2":Me.getLt2().toCSS(Ie.darkMode),"--sxl-doc-color-accent1":Me.getAccent1().toCSS(Ie.darkMode),"--sxl-doc-color-accent2":Me.getAccent2().toCSS(Ie.darkMode),"--sxl-doc-color-accent3":Me.getAccent3().toCSS(Ie.darkMode),"--sxl-doc-color-accent4":Me.getAccent4().toCSS(Ie.darkMode),"--sxl-doc-color-accent5":Me.getAccent5().toCSS(Ie.darkMode),"--sxl-doc-color-accent6":Me.getAccent6().toCSS(Ie.darkMode),"--sxl-doc-color-hlink":Me.getHlink().toCSS(Ie.darkMode),"--sxl-doc-color-fol-hlink":Me.getFolHlink().toCSS(Ie.darkMode),"--sxl-doc-font-major":Ke.getMajorFont(),"--sxl-doc-font-minor":Ke.getMinorFont()}},[n.getStyles().getTheme()]),Eo=r.useCallbackRef(Q=>{const{style:Me,...Ke}=Q;return s.jsx(bo,{...Ke,style:{paddingLeft:"4px",paddingRight:"4px",...Me},sheet:n})},[n]);let Zn=s.jsx("div",{style:_n,onTouchStart:()=>{Fo()},onFocus:Q=>{B(!0),N?.(Q)},onBlur:Q=>{B(!1),v?.(Q)},ref:Mt,...de,children:s.jsx("div",{className:ct("sheetxl-sheet",ql),style:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",flex:"1 1 100%",zIndex:"0",...dl},children:s.jsxs("div",{style:{display:"flex",flexDirection:"row",flex:"1 1 100%"},children:[Qt,wn,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden",position:"relative"},children:[ll,s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 100%",position:"relative",borderRight:`solid ${O.edgeStrokeWidth}px ${O.edgeStrokeFill}`,backgroundColor:Ie.fill},ref:te,onContextMenu:vn,children:[cl,et,s.jsx(Rl,{style:{position:"absolute",right:24,bottom:4},colorLicensee:ze?.selection?.strokeFill,colorCredits:ze?.body?.text?.fill})]})]})]})})});M&&(Zn=s.jsx(r.ScrollPane,{style:{flex:"1 1 100%",overflow:"hidden",background:`${O.fill}`,minHeight:2*Be.height,minWidth:2*Be.width,...E},viewport:Y,touchElement:H.current?.stage,disableTouch:ot,onScrollViewport:Q=>{H.current?.scrollTo(Q)},renderScrollbarHorizontal:Eo,renderScrollbarVertical:Eo,...y,children:Zn})),o.useEffect(()=>{ye.current=!1,R?.(),x&&Mt.current?.focus()},[n]);const[Xn,ul]=o.useState(!1),Fo=r.useCallbackRef(()=>{Xn||ul(!0)},[Xn]);return o.useEffect(()=>{if(Io)return typeof $=="function"&&$(),r.ReactUtils.detectIt().primaryInput==="touch"&&Fo(),()=>{}},[$,Io,Xn]),Zn}));kr.displayName="SheetElement";const Uo="data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=",Mr=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,style:a,picture:l,description:f,isDragging:h,view:c,onHide:C,onShow:M,onKeyDownCapture:y,onFocus:p,onBlur:T,loadingPanel:I,...z}=e,[D,_]=o.useState(!1),[$,w]=o.useState(null),[N,v]=o.useState(null),[E,q]=o.useState(null);o.useEffect(()=>{v(null),l.getDetails().then(P=>{_(!1),v(P.asUrl()),P.asSVGText?.()&&q(P.asSVGText())}).catch(P=>{console.warn(P),_(!0),v(Uo),q(null)})},[l]);const Z=r.useImperativeElement(t,()=>({isPictureEditor:()=>!0}),[]),F=o.useMemo(()=>{if(N||E)return s.jsx("img",{style:{flex:"1",width:"100%",height:"100%",border:D?"var(--sxl-app-color-grey, grey) solid 1px":void 0,backgroundColor:D?"var(--sxl-app-color-background, white)":void 0,boxShadow:D?"0px 0px 3px var(--sxl-app-color-error, red)":void 0,objectFit:D?"contain":void 0,opacity:$?1:0,filter:"var(--sxl-app-filter-dark-invert)"},draggable:!1,src:N,onLoad:()=>{w(!0)},onError:({currentTarget:P})=>{console.log("error"),P.onerror=null,v(Uo),_(!0)},alt:f??`${l.getType()}`})},[$,l,N,E,h]);if(!l.isClosed())return s.jsxs("div",{className:"picture-editor",style:{position:"relative",display:"flex",flex:"1 1 100%",filter:h?"drop-shadow(1px 1px 1.5px var(--sxl-app-color-shadow, rgba(0, 0, 0, .25)))":void 0,...a,width:"100%",height:"100%"},tabIndex:0,...z,onKeyDownCapture:P=>{y?.(P)},ref:Z,children:[$||D?void 0:I,F]})}));Mr.displayName="PictureEditor";const ii=o.memo(o.forwardRef((e,t)=>{const{children:n,disabled:i,chart:a,view:l,isDragging:f,onHide:h,onShow:c,...C}=e;o.useEffect(()=>{},[a]);const M=r.useImperativeElement(t,()=>({isChartEditor:()=>!0}),[]),[y,{height:p,width:T}]=Wt();if(!a.isClosed())return s.jsx("div",{...C,ref:Nt([M,y]),children:s.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:l.getZoom(),display:"flex",position:"relative",border:"var(--sxl-app-color-grey, grey) solid 1px",filter:i?"blur(1px)":void 0,boxShadow:f?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:s.jsx("div",{style:{textAlign:"center"},children:a.getDescription()})})})})),ai="_editable-input_1bqx6_6",si=e=>s.jsx("input",{...e}),Tr=o.memo(o.forwardRef((e,t)=>{const{style:n={},className:i,value:a="",onSubmit:l,onChange:f,onCancel:h,renderInput:c=si,styleHover:C={},dragging:M,maxLength:y,disabled:p=!1,readOnly:T=!1,...I}=e,[z,D]=o.useState(!1),[_,$]=o.useState(!1),[w,N]=o.useState(a);o.useEffect(()=>{N(a)},[a]);const v=o.useRef(null),[E,q]=o.useState(null),Z=r.useNotifier(),F=o.useCallback(function(te){const k=te.message;E!==k&&(Z?.showMessage?.(k,{type:r.NotifierType.Error}),q(k))},[Z,E]),P=o.useCallback(te=>{let k=!1;try{k=l?.(te)??!0}catch(b){F(b)}return k?(v.current=null,$(!1),N(te),k):(setTimeout(()=>{v.current?.focus()},0),k)},[l]),W=r.useCallbackRef(()=>{N(a),v.current=null,$(!1),h?.()},[h,a]),pe=o.useMemo(()=>{if(!_)return null;const te={className:ct(ai),autoFocus:!0,spellCheck:!1,name:"editable-label",autoComplete:"off",maxLength:y,type:"text",value:w,onFocus:k=>{v.current||(v.current=k.target,setTimeout(()=>{k.target?.select()},0))},onBlur:k=>{v.current&&P(w)},onChange:k=>{_&&N(k.target.value)},onMouseDown:k=>k.stopPropagation(),onKeyDown:k=>k.code==="Escape"?(k.preventDefault(),void W()):k.code==="Enter"?(k.preventDefault(),void P(k.target.value)):void(k.code!=="Tab"?k.stopPropagation():P(k.target.value))};return s.jsx(s.Fragment,{children:c(te)})},[_,w,P,W,c,p]),[de,le]=o.useState();o.useLayoutEffect(()=>{let te=Object.assign({},n);(M||z)&&(te=Object.assign(te,C)),le(te)},[M,z,C,n]),o.useEffect(()=>{pe&&f?.(w)},[pe,f,w]);const R=r.useImperativeElement(t,()=>({startEdit(){p||T||$(!0)},cancel(){W()}}),[]);return s.jsxs("div",{...I,ref:R,style:{flexDirection:"column",display:"flex",...de},className:ct(i),children:[s.jsxs("div",{style:{position:"relative",boxSizing:"content-box",whiteSpace:"pre",userSelect:"none",display:"flex",justifyContent:"center"},onDoubleClick:()=>{p||T||$(!0)},onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:[s.jsx("div",{className:"editable-label-container",style:{textAlign:"center",display:"flex",minHeight:"1em",opacity:_?0:1},children:w}),pe]}),s.jsx("div",{style:{whiteSpace:"pre",position:"relative",maxHeight:"0px",height:"0px",visibility:"hidden",marginLeft:"1px",marginRight:"1px",overflow:"hidden",...C},children:w})]})})),jn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Zt(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xo(e){return"nodeType"in e}function Ct(e){var t,n;return e?Zt(e)?e:xo(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function qo(e){const{Document:t}=Ct(e);return e instanceof t}function gn(e){return!Zt(e)&&e instanceof Ct(e).HTMLElement}function Ir(e){return e instanceof Ct(e).SVGElement}function _t(e){return e?Zt(e)?e.document:xo(e)?qo(e)?e:gn(e)||Ir(e)?e.ownerDocument:document:document:document}const Rt=jn?o.useLayoutEffect:o.useEffect;function Bn(e){const t=o.useRef(e);return Rt(()=>{t.current=e}),o.useCallback(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t.current==null?void 0:t.current(...i)},[])}function cn(e,t){t===void 0&&(t=[e]);const n=o.useRef(e);return Rt(()=>{n.current!==e&&(n.current=e)},t),n}function rn(e,t){const n=o.useRef();return o.useMemo(()=>{const i=e(n.current);return n.current=i,i},[...t])}function Fn(e){const t=Bn(e),n=o.useRef(null),i=o.useCallback(a=>{a!==n.current&&t?.(a,n.current),n.current=a},[]);return[n,i]}function An(e){const t=o.useRef();return o.useEffect(()=>{t.current=e},[e]),t.current}let lo={};function hn(e,t){return o.useMemo(()=>{if(t)return t;const n=lo[e]==null?0:lo[e]+1;return lo[e]=n,e+"-"+n},[e,t])}function Er(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,f)=>{const h=Object.entries(f);for(const[c,C]of h){const M=l[c];M!=null&&(l[c]=M+e*C)}return l},{...t})}}const $t=Er(1),dn=Er(-1);function On(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function Dn(e){if((function(t){if(!t)return!1;const{TouchEvent:n}=Ct(t.target);return n&&t instanceof n})(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return(function(t){return"clientX"in t&&"clientY"in t})(e)?{x:e.clientX,y:e.clientY}:null}const Lt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Lt.Translate.toString(e),Lt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:i}=e;return t+" "+n+"ms "+i}}}),Ko="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ci(e){return e.matches(Ko)?e:e.querySelector(Ko)}const di={display:"none"};function ui(e){let{id:t,value:n}=e;return o.createElement("div",{id:t,style:di},n)}function gi(e){let{id:t,announcement:n,ariaLiveType:i="assertive"}=e;return o.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":i,"aria-atomic":!0},n)}const Fr=o.createContext(null),hi={draggable:`
22
+ The formatting is not applied.`,groupLabels:{pasteOptions:`Values`},icon:`PasteValues`,shortcut:`ctrl+shift+V`},pasteFormats:{label:`Paste Formatting`,description:`Paste only the formats of the selected cells.
23
+
24
+ The content is not applied.`,groupLabels:{pasteOptions:`Formatting`},icon:`PasteFormats`},pasteFormulas:{label:`Paste Formulas`,description:`Paste only the formulas of the selected cells. The values and formatting is not applied.`,groupLabels:{pasteOptions:`Formulas`},icon:`PasteFormulas`},pasteTranspose:{label:`Paste Transpose`,description:`Paste with the rows and columns flipped.`,groupLabels:{pasteOptions:`Transpose`},icon:`PasteTranspose`},pasteLinks:{label:`Paste Links`,description:`Paste as formula references to the original cells.`,groupLabels:{pasteOptions:`Links`},icon:`PasteLinks`},undo:{label:`Undo`,icon:`Undo`,shortcut:`ctrl+z`,borrow:[`workbook`],description:`{hasAction, select, true{Undo {action}} other{Undo the last action.}}`,params:{hasAction:!1,action:``}},redo:{label:`Redo`,icon:`Redo`,shortcut:[`ctrl+y`,`F4`,`alt+Enter`],borrow:[`workbook`],description:`{hasAction, select, true{Redo {action}} other{Repeat the last action or undo the redo.}}`,params:{hasAction:!1,action:``}}}}},{sourceId:`table`,catalog:{scope:`table`,label:`Table`,tag:`en`,version:1,commands:{tableStyleOptions:{label:`Table Style Options`,description:`Toggle which structural elements (header, total, banded rows/columns, filter) the table shows.`},tableTotalRowToggle:{label:`Toggle Table Total Row`,description:`Toggle Total Row on/off.`,groupLabels:{tableStyleOptions:`Total Row`},shortcut:`ctrl+alt+T`},tableHeaderRowToggle:{label:`Toggle Table Header Row`,description:`Toggle Header Row on/off.`,groupLabels:{tableStyleOptions:`Header Row`}},tableBandedRowsToggle:{label:`Toggle Table Banded Rows`,description:`Toggle Banded Rows on/off.`,groupLabels:{tableStyleOptions:`Banded Rows`}},tableFirstColumnToggle:{label:`Toggle Table First Column`,description:`Toggle First Column on/off.`,groupLabels:{tableStyleOptions:`First Column`}},tableLastColumnToggle:{label:`Toggle Table Last Column`,description:`Toggle Last Column on/off.`,groupLabels:{tableStyleOptions:`Last Column`}},tableBandedColumnsToggle:{label:`Toggle Table Banded Columns`,description:`Toggle Banded Columns on/off.`,groupLabels:{tableStyleOptions:`Banded Columns`}},tableFilterRefresh:{label:`Reapply Sort & Filter`,description:`Reapply the sort and filter with the latest changes.`,groupLabels:{filterOptions:`Reapply`,sortFilterOptions:`Reapply`},icon:`FilterReapply`,shortcut:`ctrl+alt+L`},tableFilterClear:{label:`Clear Sort & Filter`,description:`Clear the sort and filters criteria from the current area..`,groupLabels:{filterOptions:`Clear`,sortFilterOptions:`Clear`},icon:`FilterClear`},formatTableStyleClearTableStyle:{label:`Clear Table Style`,description:`Remove all the styling that is specific for the table.`,groupLabels:{tableStyleOptions:`Clear Style`},icon:`ClearFormats`}}}},{sourceId:`workbook`,catalog:{scope:`workbook`,label:`Workbook`,tag:`en`,version:1,commands:{addSheet:{label:`Insert Sheet`,description:`Insert sheet before the current sheet.`,groupLabels:{sheet:`Insert`},shortcut:[`shift+F11`,`shift+alt+F1`]},deleteSheet:{label:`Delete Sheet`,description:`Delete the sheet and all the data.`,groupLabels:{sheet:`Delete`}},duplicateSheet:{label:`Duplicate Sheet`,description:`Duplicate the current sheet.`,groupLabels:{sheet:`Duplicate`}},hideSheet:{label:`Hide Sheet`,description:`Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.`,groupLabels:{sheet:`Hide`},icon:`VisibilityOff`},nextSheet:{label:`Next Sheet`,description:`Activate the next sheet.`,groupLabels:{sheet:`Next`},shortcut:`ctrl+PageDown`},previousSheet:{label:`Previous Sheet`,description:`Activate the previous sheet.`,groupLabels:{sheet:`Previous`},shortcut:`ctrl+PageUp`},selectNextSheet:{label:`Select Next Sheet`,description:`Select the next sheet.`,groupLabels:{sheet:`Select Next`},shortcut:`ctrl+shift+PageDown`},selectPreviousSheet:{label:`Select Previous Sheet`,description:`Select the previous sheet.`,groupLabels:{sheet:`Select Previous`},shortcut:`ctrl+shift+PageUp`},workbookViewToggleShowFormulaBar:{label:`View Formula bar`,description:`Show or hide the formula bar.`,groupLabels:{view:`Formula Bar`}},workbookViewToggleShowTabs:{label:`View Sheet Tabs`,description:`Show or hide the sheet tabs.`,groupLabels:{view:`Sheet Tabs`}},workbookViewToggleShowStatusBar:{label:`View Status Bar`,description:`Show or hide the status bar.`,groupLabels:{view:`Status Bar`}},workbookViewToggleShowHorizontalScrollBar:{label:`View Horizontal Scrollbar`,description:`Show or hide the horizontal scrollbar.`,groupLabels:{view:`Horizontal Scrollbar`}},workbookViewToggleShowVerticalScrollBar:{label:`View Vertical Scrollbar`,description:`Show or hide the vertical scrollbar.`,groupLabels:{view:`Vertical Scrollbar`}},workbookViewToggleExpandFormulaBar:{label:`Toggle Expand Formula bar`,description:`Expand or collapse the formula bar.`,shortcut:`ctrl+shift+U`},locale:{label:`Regional Format`,description:`The regional format used for numbers and dates. This is saved with the workbook.`,icon:`Locale`},newCellStyle:{label:`New Cell Style…`,description:`Create a new named style can can be quickly used later.`,groupLabels:{cellStyle:`New Cell Style`},icon:`NewPresetStyles`},deleteCellStyle:{label:`Delete Cell Style`,description:`Remove a named style that is no longer needed.`,groupLabels:{cellStyle:`Delete`}},modifyCellStyle:{label:`Modify Cell Style`,description:`Update a style with the currently style.`,groupLabels:{cellStyle:`Modify`}},find:{label:`Find`,description:`Open the Find window.`,icon:`Find`,shortcut:[`ctrl+F`,`shift+F5`]},findReplace:{label:`Find & Replace`,description:`Open the Find & Replace window.`,icon:`FindReplace`,shortcut:[`ctrl+H`,`ctrl+alt+H`]},findNext:{label:`Find Next`,description:`Find the next match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`shift+F4`},findPrevious:{label:`Find Previous`,description:`Find the previous match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`ctrl+shift+F4`},goto:{label:`Go To`,description:`Open the 'Go To' window.`,icon:`GoTo`,shortcut:`ctrl+G`},selectNamed:{label:`Select Named`,description:`Select the named item.`},addNamedReference:{label:`Define Named Reference`,description:`Add a new named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Define Name…`},icon:`InsertNamedRange`},editNamedReference:{label:`Edit Named Reference…`,description:`Add a new named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Edit…`},icon:`NamedRangeEdit`},deleteNamedReference:{label:`Delete Named Reference`,description:`Remove the named reference.`,groupLabels:{namedItem:`Delete`},icon:`DeleteNamedRange`},insertFunction:{label:`Insert Function`,description:`Insert a function into the current cell.`,icon:`FunctionThin`},selectTheme:{label:`Theme`,description:`Select a theme that coveys a style suitable for your data.`},calculateAll:{label:`Calculate Now`,description:`Recalculate the formulas whose values are out of date, on every sheet.`,icon:`Calculate`,shortcut:`F9`},calculateFull:{label:`Calculate Full`,description:`Recalculate every formula in the workbook, including those already up to date. Use this to replace the values a file was opened with.`,icon:`Calculate`,shortcut:`ctrl+alt+F9`},selectDirectPrecedents:{label:`Select Direct Precedents`,description:`Select the cells directly referenced by the formulas in the selection.`,shortcut:`ctrl+[`},selectPrecedents:{label:`Select All Precedents`,description:`Select all cells that contribute to the formulas in the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+{`},selectDirectDependents:{label:`Select Direct Dependents`,description:`Select the cells with formulas that directly reference the selection.`,shortcut:`ctrl+]`},selectDependents:{label:`Select All Dependents`,description:`Select all cells that are eventually affected by the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+}`},maximumWorkbookToggle:{label:`Maximize`,description:`Toggle showing the workbook maximized.`,shortcut:`ctrl+F10`},activeNameBox:{label:`Activate Name Box`,description:`Move the focus to the name box.`,shortcut:`alt+F3`},activeNameManager:{label:`Name Manager`,description:`Create, edit, delete, and find all the names used in the workbook.
25
+
26
+ Names can be used as a substitute for cell references.`,shortcut:`ctrl+F3`,icon:`NamedManager`},createNamedReferenceFromSelection:{label:`Create from Selection`,description:`Automatically generate names from the selected cells.`,shortcut:`ctrl+shift+F3`},spellCheck:{label:`Spell Check`,description:`Check the workbook for spelling mistakes.`,shortcut:`F7`},workbookStatistics:{label:`Workbook Statistics`,description:`Show the workbook statistics.`,shortcut:`ctrl+shift+G`},showFormat:{label:`Show Format`,description:`Open the format pane.`,shortcut:`ctrl+shift+F`}}}}],{DefaultCommandCatalogService:Rr}=s.Command,zr=!1;function Br(){zr||(zr=!0,Rr.registerFromManifest(`@sheetxl/react`,{}.url,{messages:Ir,catalogs:Lr}))}Br();var{CommandScope:Vr,DefaultCommandRegistry:Hr,FocusActivation:Ur,CommandRegistryContext:Wr,CommandScopeContext:Gr,CommandAnchorProvider:Kr,CommandFallbackProvider:qr,useCommandScope:Jr}=s.Command,Yr=({initialAnchor:e,children:t})=>Jr()?(0,i.jsx)(i.Fragment,{children:t}):(0,i.jsx)(Xr,{initialAnchor:e,children:t});Yr.displayName=`CommandRootProvider`;var Xr=({initialAnchor:e,children:t})=>{let n=(0,r.useRef)(e),{root:a,registry:o,studioTracker:s}=(0,r.useMemo)(()=>{let e=Hr,t=new Vr(`app`,null,{registry:e});return{root:t,registry:e,studioTracker:new Ur(t,n.current)}},[]);return(0,r.useEffect)(()=>(a.connect(),()=>a.dispose()),[a]),(0,i.jsx)(Wr.Provider,{value:o,children:(0,i.jsx)(kr.Provider,{value:s,children:(0,i.jsx)(Gr.Provider,{value:a,children:(0,i.jsxs)(Kr,{tracker:s,keyBindings:`synthetic`,debounce:100,children:[(0,i.jsx)(Or,{}),(0,i.jsx)(qr,{children:t})]})})})})};Xr.displayName=`CommandRootProviderOwn`;var Zr=`workbookToolbars`,Qr={key:`tableStyleOptions`,showLabel:!0,members:[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`,`tableFilterToggle`]},$r={key:`tableToolbar`,contributions:{[Zr]:{order:1}},members:[`editTable`,`-`,`tableStyleOptions`,`-`,`sortOptions`,`filterOptions`,`-`,`dataRemoveDuplicates`,{key:`convertTableToRange`,showLabel:!0},`-`,`formatTableStyle`]},ei=0,ti=()=>{ei>0&&--ei===0&&(s.Command.DefaultCommandButtonRegistry.get(`tableToolbar`)&&s.Command.DefaultCommandButtonRegistry.unregister(`tableToolbar`),s.Command.DefaultCommandButtonRegistry.get(`tableStyleOptions`)&&s.Command.DefaultCommandButtonRegistry.unregister(`tableStyleOptions`))},ni=(e,t)=>e?[t]:[];function ri(e,n){let r=n.sheet;if(!r)return()=>{};let i=n.notifier,o=()=>{let e=r.getSelectedRanges();if(e.getCount()!==1)return null;let t=e.at(0).getCoords();for(let e of r.getTables().getItems()){let n=e.getRange().getCoords();if(t.rowStart>=n.rowStart&&t.rowEnd<=n.rowEnd&&t.colStart>=n.colStart&&t.colEnd<=n.colEnd)return e}return null},c=e=>{let t=e.getDataRange().getCoords(),n=r.getSelectedRange().getCoords(),i=Math.min(Math.max(n.rowStart,t.rowStart),t.rowEnd),a=Math.min(Math.max(n.rowEnd,t.rowStart),t.rowEnd);return{index:i-t.rowStart,count:a-i+1,valid:n.rowStart>=t.rowStart&&n.rowEnd<=t.rowEnd}},l=e=>{let t=e.getRange().getCoords(),n=r.getSelectedRange().getCoords(),i=Math.min(Math.max(n.colStart,t.colStart),t.colEnd),a=Math.min(Math.max(n.colEnd,t.colStart),t.colEnd);return{index:i-t.colStart,count:a-i+1}},u=e=>()=>{let t=o(),n=t?c(t):null;return(0,a.t)(e,{count:n?.valid?n.count:1})},d=e=>()=>{let t=o();return(0,a.t)(e,{count:t?l(t).count:1})},f=()=>{let e=o();e&&c(e).valid&&r.getSelectedRange().insert({axis:t.IRange.Axis.Row,span:!0})},p=()=>{let e=o();e&&c(e).valid&&r.getSelectedRange().delete({axis:t.IRange.Axis.Row,span:!0})},m=()=>{o()&&r.getSelectedRange().insert({axis:t.IRange.Axis.Column,span:!0})},h=()=>{o()&&r.getSelectedRange().delete({axis:t.IRange.Axis.Column,span:!0})},g=()=>r.getSelectedRanges().getDefaultShiftAxis()===t.IRange.Axis.Column,_=()=>{let t=o();e.updateCommand(`tableTotalRowToggle`,{state:t?.isShowTotals()??!1}),e.updateCommand(`tableHeaderRowToggle`,{state:t?.isShowHeaders()??!1}),e.updateCommand(`tableBandedRowsToggle`,{state:t?.isShowBandedRows()??!1}),e.updateCommand(`tableFirstColumnToggle`,{state:t?.isShowHighlightFirstColumn()??!1}),e.updateCommand(`tableLastColumnToggle`,{state:t?.isShowHighlightLastColumn()??!1}),e.updateCommand(`tableBandedColumnsToggle`,{state:t?.isShowBandedColumns()??!1});let n=ni(!r.getProtection().isFormatCellsAllowed(),(0,a.messageKey)(`reason.sheetProtected`));if(e.updateCommand(`formatTableStyleClearTableStyle`,{disabledReasons:[...n,...ni(!t||t.getStyleOptions().name===null,(0,a.messageKey)(`reason.noTableStyle`))]}),t){let n=ni(!c(t).valid,(0,a.messageKey)(`reason.tableBodyRows`));e.updateCommand(`insertCellsShiftDown`,{disabledReasons:n}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:n});let r=g()?[]:n;e.updateCommand(`insertCells`,{disabledReasons:r}),e.updateCommand(`deleteCells`,{disabledReasons:r})}},v=null,y=null,b=e=>{e!==v&&(y?.(),y=null,v=e,e&&(y=e.addListeners({onAnyChange:()=>{x!==null&&_()}},{transactional:!1})))},x=null,S=()=>{let t=o();b(t);let c=t?`table`:r.getAutoTable()?`auto`:null;c!==x&&(x!==null&&e.remove(),c===null?ti():(x===null&&ei++===0&&(s.Command.DefaultCommandButtonRegistry.register(Qr,!0),s.Command.DefaultCommandButtonRegistry.register($r,!0)),e.use(vr({transaction:r,notifier:i,manager:n.manager})),e.updateCommand(`tableTotalRowToggle`,{callback:()=>{let e=o();e&&e.setShowTotals(!e.isShowTotals())}}),e.updateCommand(`tableHeaderRowToggle`,{callback:()=>{let e=o();e&&e.setShowHeaders(!e.isShowHeaders())}}),e.updateCommand(`tableBandedRowsToggle`,{callback:()=>{let e=o();e&&e.setShowBandedRows(!e.isShowBandedRows())}}),e.updateCommand(`tableFirstColumnToggle`,{callback:()=>{let e=o();e&&e.setShowHighlightFirstColumn(!e.isShowHighlightFirstColumn())}}),e.updateCommand(`tableLastColumnToggle`,{callback:()=>{let e=o();e&&e.setShowHighlightLastColumn(!e.isShowHighlightLastColumn())}}),e.updateCommand(`tableBandedColumnsToggle`,{callback:()=>{let e=o();e&&e.setShowBandedColumns(!e.isShowBandedColumns())}}),e.updateCommand(`tableFilterRefresh`,{callback:()=>{(o()??r.getAutoTable())?.applySortsAndFilters()}}),e.updateCommand(`tableFilterClear`,{callback:e=>{if(e)return e.getFilter()?.delete(),void e.getSort()?.delete();(o()??r.getAutoTable())?.deleteSortsAndFilters()}}),e.updateCommand(`formatTableStyleClearTableStyle`,{tags:[`noTransaction`],callback:()=>{o()?.updateStyleOptions({name:null})},context:()=>({styles:()=>r.getStyles(),table:()=>o(),getNames:()=>r.getNames(),resolveRanges:e=>(r.getWorkbook()??r).getRanges(e).getFixed(!0)})}),c===`table`&&(e.updateCommand(`insertCellsShiftDown`,{label:u((0,a.messageKey)(`table.insertRows`)),groupLabels:{insertCellsOptions:u((0,a.messageKey)(`table.rows.compact`))},description:()=>(0,a.t)(`table.insertRows.description`),icon:`InsertRow`,callback:f}),e.updateCommand(`deleteCellsShiftUp`,{label:u((0,a.messageKey)(`table.deleteRows`)),groupLabels:{deleteCellsOptions:u((0,a.messageKey)(`table.rows.compact`))},description:()=>(0,a.t)(`table.deleteRows.description`),icon:`DeleteRows`,callback:p}),e.updateCommand(`insertCellsShiftRight`,{label:d((0,a.messageKey)(`table.insertColumns`)),groupLabels:{insertCellsOptions:d((0,a.messageKey)(`table.columns.compact`))},description:()=>(0,a.t)(`table.insertColumns.description`),icon:`InsertColumn2`,callback:m}),e.updateCommand(`deleteCellsShiftLeft`,{label:d((0,a.messageKey)(`table.deleteColumns`)),groupLabels:{deleteCellsOptions:d((0,a.messageKey)(`table.columns.compact`))},description:()=>(0,a.t)(`table.deleteColumns.description`),icon:`DeleteColumns`,callback:h}),e.updateCommand(`insertCells`,{label:()=>(g()?d((0,a.messageKey)(`table.insertColumns`)):u((0,a.messageKey)(`table.insertRows`)))(),groupLabels:{insertCellsOptions:()=>(g()?d((0,a.messageKey)(`table.columns.compact`)):u((0,a.messageKey)(`table.rows.compact`)))()},description:()=>g()?(0,a.t)(`table.insertColumns.description`):(0,a.t)(`table.insertRows.description`),callback:()=>{g()?m():f()}}),e.updateCommand(`deleteCells`,{label:()=>(g()?d((0,a.messageKey)(`table.deleteColumns`)):u((0,a.messageKey)(`table.deleteRows`)))(),groupLabels:{deleteCellsOptions:()=>(g()?d((0,a.messageKey)(`table.columns.compact`)):u((0,a.messageKey)(`table.rows.compact`)))()},description:()=>g()?(0,a.t)(`table.deleteColumns.description`):(0,a.t)(`table.deleteRows.description`),callback:()=>{g()?h():p()}}))),x=c),c!==null&&_()};S();let C=r.getSelection().addListeners({onChange:S}),w=r.addListeners({onTablesChange:S,onAutoTableChange:S,onProtectionChange:S});return()=>{C(),w(),b(null),x!==null&&(ti(),x=null)}}var{CommandScopeProvider:ii}=s.Command,ai=(0,r.memo)(e=>{let{sheet:t}=e,n=(0,s.useNotifier)(),a=gr(),c=(0,r.useMemo)(()=>({sheet:t,notifier:n,manager:a??void 0}),[t,n,a]);return(0,i.jsx)(ii,{spec:{scopeName:{key:`layer:table`,name:`table`},contributor:{dynamic:ri},data:c},order:(0,o.useLayer)().zIndex})});ai.displayName=`SheetTableCommandLayer`;var oi=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{sheet:c,animationTime:u=60,className:d,style:f,...p}=e,m=(0,o.useGridPane)(),[h,g]=(0,r.useState)(null),[_,v]=(0,r.useState)(null),y=(0,r.useRef)(null),b=(0,s.useCallbackRef)(()=>{let e=c.getSelectedCell().getSpill()?.getCoords()??null;a.CoordUtils.isEqualRanges(e,h)||(v(e?{transition:h?`move`:`in`,coords:e}:{transition:`out`,coords:h}),g(e))},[c,m,h]);(0,r.useEffect)(()=>(y.current&&=(clearTimeout(y.current),null),_&&(y.current=setTimeout(()=>{v(null),y.current=null},u)),()=>{y.current&&=(clearTimeout(y.current),null)}),[_,u]);let x=(0,r.useMemo)(()=>a.TimerUtils.debounce(a.TimerUtils.throttle(b,80),80),[]);if(l(c?.getSelection(),{onChange(e){x()}}),l(c,{onSpillsChange(e){b()},onInvalidated(e){b()}}),!m)return null;let S=h??_?.coords;if(!S)return null;let C=!!h&&c.getRange(h).getValue()instanceof t.FormulaError.Spill;return(0,i.jsx)(o.Layer,{className:P(d,`spill-outline`),children:(0,r.createElement)(o.RangeRect,{...p,key:`spill-outline`,range:S,alignWidth:1,stroke:`color-mix(in srgb, var(--sxl-color-primary) 70%, black)`,clipInsets:-10,style:{...f,opacity:_?.transition===`out`?0:1},propsStrokePath:{strokeDasharray:C?`6 3`:void 0,style:{filter:`drop-shadow(0px 0px 2px color-mix(in srgb, color-mix(in srgb, var(--sxl-color-primary) 80%, white) 80%, transparent))`}}})})})),si=`var(--sxl-cf-icon-bad)`,ci=`var(--sxl-cf-icon-light-bad)`,li=`var(--sxl-cf-icon-neutral)`,ui=`var(--sxl-cf-icon-light-good)`,di=`var(--sxl-cf-icon-good)`,fi=`var(--sxl-cf-icon-pink)`,pi=`var(--sxl-cf-icon-gold)`,mi=`var(--sxl-cf-icon-gray)`,hi=`var(--sxl-cf-icon-black)`,gi=(e,t)=>({iconKey:`cf:${e}`,color:t}),_i=[`arrowDown`,`arrowRight`,`arrowUp`],vi=[`arrowDown`,`arrowDownRight`,`arrowUpRight`,`arrowUp`],yi=[`arrowDown`,`arrowDownRight`,`arrowRight`,`arrowUpRight`,`arrowUp`],bi=[si,li,di],xi=[si,ci,ui,di],Si=[si,ci,li,ui,di],Ci=(e,t)=>e.map((e,n)=>gi(e,t[n])),wi=(e,t)=>e.map(e=>gi(e,t)),Ti=(e,t)=>t.map(t=>gi(e,t)),Ei=[`rating0`,`rating1`,`rating2`,`rating3`,`rating4`],Di={[t.IStyle.IconSet.Arrows3]:Ci(_i,bi),[t.IStyle.IconSet.ArrowsGray3]:wi(_i,mi),[t.IStyle.IconSet.Flags3]:Ti(`flag`,bi),[t.IStyle.IconSet.Signs3]:Ci([`diamond`,`triangleUp`,`circle`],bi),[t.IStyle.IconSet.Symbols3]:Ci([`circleCross`,`circleExclamation`,`circleCheck`],bi),[t.IStyle.IconSet.Symbols3_2]:Ci([`cross`,`exclamation`,`check`],bi),[t.IStyle.IconSet.TrafficLights3]:Ti(`circle`,bi),[t.IStyle.IconSet.TrafficLights3_2]:Ti(`circleRimmed`,bi),[t.IStyle.IconSet.Triangles3]:Ci([`triangleDownSharp`,`dash`,`triangleUpSharp`],bi),[t.IStyle.IconSet.Stars3]:wi([`star0`,`star1`,`star2`],pi),[t.IStyle.IconSet.Arrows4]:Ci(vi,xi),[t.IStyle.IconSet.ArrowsGray4]:wi(vi,mi),[t.IStyle.IconSet.Rating4]:wi(Ei.slice(1),mi),[t.IStyle.IconSet.RedToBlack4]:Ti(`circle`,[si,fi,mi,hi]),[t.IStyle.IconSet.TrafficLights4]:Ti(`circleRimmed`,[hi,si,li,di]),[t.IStyle.IconSet.Arrows5]:Ci(yi,Si),[t.IStyle.IconSet.ArrowsGray5]:wi(yi,mi),[t.IStyle.IconSet.Quarters5]:wi([`quarters0`,`quarters1`,`quarters2`,`quarters3`,`quarters4`],hi),[t.IStyle.IconSet.Rating5]:wi(Ei,mi),[t.IStyle.IconSet.Boxes5]:wi([`boxes0`,`boxes1`,`boxes2`,`boxes3`,`boxes4`],hi)},Oi=(e,t)=>Di[e]?.[t]??null,ki=Object.freeze([]),Ai=`_track_1426b_17`,ji=`_bar_1426b_22`,Mi=`_axis_1426b_30`,Ni=(0,r.memo)(e=>{let{sheet:t,margin:n=1,className:r,style:c,...l}=e,u=(0,o.useGridPane)(),{getVisibleDecorations:d}=$t(t,`dataBar`),f=d(u);if(f.length===0)return null;let p=Math.max(1,Math.round(n*(u.getZoom()||1))),m=1/s.ReactUtils.getDevicePixelRatio(),h={top:p+m,left:p+m,right:p,bottom:p},g=[];for(let e=0;e<f.length;e++){let{cell:t,range:n,decorations:r}=f[e],s=r.dataBar;s&&g.push((0,i.jsx)(o.VirtualDiv,{range:n??a.CoordUtils.cellToRange(t),clipInsets:-10,style:{pointerEvents:`none`},children:(0,i.jsx)(Pi,{bar:s,inset:h})},`bar-${t.rowIndex}-${t.colIndex}`))}return g.length===0?null:(0,i.jsx)(o.Layer,{...l,className:P(r,`conditional-bars`),children:(0,i.jsx)(o.VirtualDiv,{fill:!0,style:{pointerEvents:`none`,overflow:`visible`,...c},children:g})})});Ni.displayName=`ConditionalBarLayer`;var Pi=({bar:e,inset:t})=>{let{value:n,axis:r,gradient:a,direction:o}=e,s=n<r,c=100*Math.min(n,r),l=100*Math.abs(n-r),u=(s?e.negativeColor:void 0)??e.color,d=(s?e.negativeBorderColor:void 0)??e.borderColor,f=o===`rightToLeft`,p=a?`linear-gradient(to ${s===f?`right`:`left`}, ${u}, color-mix(in srgb, ${u} var(--sxl-cf-bar-fade), transparent))`:u,m=f?{right:`${c}%`}:{left:`${c}%`};return(0,i.jsxs)(`div`,{className:P(Ai,`conditional-bar-track`),style:t,children:[l>0?(0,i.jsx)(`div`,{className:P(ji,`conditional-bar`),style:{...m,width:`${l}%`,background:p,border:d?`1px solid ${d}`:void 0}}):null,e.axisColor&&r>0&&r<1?(0,i.jsx)(`div`,{className:P(Mi,`conditional-bar-axis`),style:{...f?{right:100*r+`%`}:{left:100*r+`%`},background:e.axisColor}}):null]})},Fi=`_clip_x7ihh_36`,Ii=`_box_x7ihh_40`,Li=`_glyph_x7ihh_79`,Ri=(0,r.memo)(e=>{let{sheet:t,className:n,style:r,...c}=e,l=(0,o.useGridPane)(),{getVisibleDecorations:u}=$t(t,`iconSet`),d=u(l);if(d.length===0)return null;let f=l.getZoom()||1,p=[];for(let e=0;e<d.length;e++){let{cell:t,range:n,value:r,decorations:c}=d[e],l=c.iconSet;if(!l)continue;let u=Oi(l.set,l.index);if(!u)continue;let m=r.getStyle(),h=m.getInsets(),g=m.measureText(``).lineHeight*f,_=m.getAlignment().getVertical(),v=zi[_]??`flex-end`,y=Bi[_]??`center bottom`;p.push((0,i.jsx)(o.VirtualDiv,{range:n??a.CoordUtils.cellToRange(t),clipInsets:-10,className:Fi,style:{pointerEvents:`none`},children:(0,i.jsx)(`div`,{className:Ii,style:{left:h.left*f,top:h.top*f,bottom:h.bottom*f,width:g,alignItems:v},children:(0,i.jsx)(s.DynamicIcon,{className:Li,iconKey:u.iconKey,size:g,style:{color:u.color,transformOrigin:y}})})},`icon-${t.rowIndex}-${t.colIndex}`))}return p.length===0?null:(0,i.jsx)(o.Layer,{...c,className:P(n,`conditional-icons`),children:(0,i.jsx)(o.VirtualDiv,{fill:!0,style:{pointerEvents:`none`,overflow:`visible`,...r},children:p})})});Ri.displayName=`ConditionalIconsLayer`;var zi={[t.ITextFrame.VerticalAlignment.Top]:`flex-start`,[t.ITextFrame.VerticalAlignment.Center]:`center`,[t.ITextFrame.VerticalAlignment.Bottom]:`flex-end`,[t.ITextFrame.VerticalAlignment.Justify]:`center`,[t.ITextFrame.VerticalAlignment.Distributed]:`center`},Bi={[t.ITextFrame.VerticalAlignment.Top]:`center top`,[t.ITextFrame.VerticalAlignment.Center]:`center`,[t.ITextFrame.VerticalAlignment.Bottom]:`center bottom`,[t.ITextFrame.VerticalAlignment.Justify]:`center`,[t.ITextFrame.VerticalAlignment.Distributed]:`center`},Vi=`_dropdown_2r2ao_8`,Hi={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Ui=(0,r.memo)(e=>{let{sheet:t,markSize:n=7,dropdownWidth:r=17,onOpenDropdown:c,className:l,style:d,...f}=e,p=(0,o.useGridPane)(),m=Gi(t);u(t,[`onSelectionChange`]);let h=p.getZoom()||1,g=[],_=m(p);for(let e=0;e<_.length;e++){let t=_[e],r=p.getBoundsFromRange(p.getRangeFromCell(t));r&&g.push((0,i.jsx)(o.VirtualDiv,{range:a.CoordUtils.cellToRange(t),clipInsets:-10,style:{pointerEvents:`none`},children:(0,i.jsx)(b,{anchorLocation:a.AnchorLocation.TopRight,size:n*h,cellWidth:r.width,cellHeight:r.height,fill:`light-dark(red, rgb(0, 255, 255))`})},`invalid-${t.rowIndex}-${t.colIndex}`))}let v=Wi(t);if(v){let{coords:e,dataValidation:t}=v;g.push((0,i.jsx)(o.VirtualDiv,{range:a.CoordUtils.cellToRange(e),clipInsets:-10,style:{pointerEvents:`none`},children:(0,i.jsx)(`div`,{className:Vi,style:{right:0,width:r*h},role:`button`,"aria-haspopup":`listbox`,onMouseDown:n=>{n.button===0&&(n.stopPropagation(),n.preventDefault(),c?.(e,t))},children:(0,i.jsx)(s.DynamicIcon,{iconKey:`ExpandMore`,size:r*h*.75})})},`dropdown-${e.rowIndex}-${e.colIndex}`))}return g.length===0?null:(0,i.jsx)(o.Layer,{...f,className:P(l,`validation-indicators`),children:(0,i.jsx)(o.VirtualDiv,{fill:!0,style:{pointerEvents:`none`,overflow:`visible`,...d},children:g})})});Ui.displayName=`ValidationIndicatorLayer`;var Wi=e=>{let t=e.getSelectedCell(),n=t.getDataValidation();if(!n||n.isHideDropdown()||!n.getRenderHints().includes(`list`))return null;let r=t.getCoords();return r?{coords:r,dataValidation:n}:null},Gi=e=>{let t=(0,o.useGridPane)(),[,n]=(0,r.useReducer)(e=>e+1,0),i=(0,r.useRef)(new Map),a=(0,s.useCallbackRef)(()=>{i.current.clear(),n()},[]);l(e,{onDataValidationsChange:a},{ignoreModelChange:!0});let c=t.getVisibleRange();return f(e,(0,r.useMemo)(()=>c?{rowStart:c.rowStart,colStart:c.colStart,rowEnd:c.rowEnd,colEnd:c.colEnd}:null,[c?.rowStart,c?.colStart,c?.rowEnd,c?.colEnd]),e=>{e.isDataChange&&a()},qi),(0,s.useCallbackRef)((t,n)=>{let r=i.current,a=n??t.getVisibleRange();if(!a)return Ki;let o=`${a.rowStart}:${a.colStart}:${a.rowEnd}:${a.colEnd}`,s=r.get(o);if(s)return s;let c=e.getRange(a),l=Ki;if(c.getDataValidations().length>0){let e=[];c.forEach((t,n)=>{let r=n.getCell().getDataValidation();if(!r)return;let i=n.getCoords();r.getAlertAt(i.rowIndex,i.colIndex)&&e.push(i)},Hi),e.length>0&&(l=e)}return r.set(o,l),r.size>12&&r.delete(r.keys().next().value),l},[e])},Ki=[],qi={fireOnAddressChange:!1,transactional:!1},Ji=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{selection:a,adapter:c,axis:l,entireCoords:u,edgeSize:d=1,edgeColor:f=`var(--sxl-color-base-300)`,scrollIntoView:p,renderBorders:m=!0,preserveFocus:h=!1,replaceActive:g=!1,allowMulti:_=!0,onPointerDownInterceptor:v,onSelectionStart:y,onSelectionEnd:b,zIndex:x,className:S,style:C,...w}=e,T=(0,o.useGridPane)(),E=l===t.IRange.Axis.Column?T.getPaneBounds().height:T.getPaneBounds().width,D=(0,r.useMemo)(()=>c??new Mt(a),[c,a]);(0,s.useOptionalBoundSyncExternalStore)(D,e=>e.getSelection());let O=(0,o.useHeaderSelectionPointer)(D,{axis:l,entireRange:u,scrollIntoView:p,replaceActive:g,allowMulti:_,preserveFocus:h,onPointerDownInterceptor:v,onDragStart:(0,s.useCallbackRef)(()=>{y?.(),a.setAdjusting(a.getCoords())},[a,y]),onDragEnd:(0,s.useCallbackRef)(()=>{a.setAdjusting(null),b?.()},[a,b]),onPointerUp:(0,s.useCallbackRef)(()=>{h||T.focus()},[T,h])}),k=m?a.getSelectedRuns(l):null,A=T.getAnchor(),j=[];if(m){j.push(Yi(`edge:${A}`,l,E,d,f));for(let e=0;k&&e<k.length;e++){let t=k[e],n=Zi(t.min,t.max,l,T);n&&j.push(Xi(`selection:${A}:${e}`,n,l,E))}}return(0,i.jsx)(o.Layer,{...w,onPointerDown:O.onPointerDown,onPointerMove:O.onPointerMove,onPointerUp:O.onPointerUp,children:(0,i.jsx)(o.VirtualDiv,{fill:!0,className:P(S,`header-selection`),style:{pointerEvents:`none`,...C},ref:n,children:j})})})),Yi=(e,n,r,a,o)=>{let c=s.ReactUtils.getDevicePixelRatio(),l=a/c,u=s.ReactUtils.snapDeviceEdge(r-l,c);return(0,i.jsx)(`div`,{className:`header-selection-edge`,style:n===t.IRange.Axis.Column?{position:`absolute`,background:o,pointerEvents:`none`,left:0,width:`100%`,top:`${u}px`,height:`${l}px`}:{position:`absolute`,background:o,pointerEvents:`none`,top:0,height:`100%`,left:`${u}px`,width:`${l}px`}},e)},Xi=(e,n,r,a)=>{if(!n)return;let o=`var(--sxl-color-primary)`,c=s.ReactUtils.getDevicePixelRatio(),l=2/c,u=s.ReactUtils.edgeCenter(a,`leading`,2,c),d;if(r===t.IRange.Axis.Column){let e=s.ReactUtils.edgeCenter(n.x,`leading`,2,c);d={position:`absolute`,background:o,pointerEvents:`none`,top:u-l/2+`px`,height:`${l}px`,left:e-l/2+`px`,width:`${s.ReactUtils.edgeCenter(n.x+n.width,`trailing`,2,c)-e+l}px`}}else{let e=s.ReactUtils.edgeCenter(n.y,`leading`,2,c);d={position:`absolute`,background:o,pointerEvents:`none`,left:u-l/2+`px`,width:`${l}px`,top:e-l/2+`px`,height:`${s.ReactUtils.edgeCenter(n.y+n.height,`trailing`,2,c)-e+l}px`}}return(0,i.jsx)(`div`,{className:`header-selection-border`,style:d},e)},Zi=(e,n,r,i)=>{let a={x:0,y:0,width:0,height:0};if(r===t.IRange.Axis.Column){let t=i.toClipBounds(i.getBoundsFromRange({colStart:e,rowStart:0,colEnd:n,rowEnd:0}),o.SELECTION_CLIP_INSETS);if(!t)return null;a.x=t.x,a.width=t.width}else{let t=i.toClipBounds(i.getBoundsFromRange({colStart:0,rowStart:e,colEnd:0,rowEnd:n}),o.SELECTION_CLIP_INSETS);if(!t)return null;a.y=t.y,a.height=t.height}return{x:a.x,y:a.y,width:a.width,height:a.height}},Qi=e=>`resize-indicator:`+(e===t.IRange.Axis.Column?`col`:`row`),$i=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{sheetHeader:c,isColumn:u,oppositeSize:d=30,onResizeHeadersStart:f,onResizeHeaders:p,onResizeHeadersEnd:m,onResizeHeadersDown:h,onResizeHeadersUp:g}=e,_=(0,o.useGridPane)(),[v,y]=(0,r.useState)(c.getSelectedRuns()),[b,x]=(0,r.useReducer)(e=>e+1,0),S=(0,s.useTranslator)(),C=(0,r.useCallback)(a.TimerUtils.debounce(()=>{x()},10),[]);l(c?.getSheet(),{onSelectionChange(e){let t=c.getSelectedRuns();y(t),C()},onProtectionChange(){x()},onViewChange(){C()}});let[w,T]=(0,r.useState)(c?.getSheet().getView().getZoomScale()/100),E=u?t.IRange.Axis.Column:t.IRange.Axis.Row,[,D]=(0,o.useSurfaceState)(Qi(E),null),O=(0,r.useRef)(null),k=(0,r.useRef)(null),A=(0,r.useCallback)(()=>{k.current&&=(clearTimeout(k.current),null)},[]);(0,r.useEffect)(()=>A,[A]),l(c,{onSizesChange:e=>{T(c?.getSheet().getView().getZoomScale()/100)}});let j=(0,r.useCallback)(e=>c.at(e)?.isHidden()||c.at(e)?.getSize()===0,[c]),M=(0,r.useCallback)((e,t)=>c.hiddenHeadersAt(e,t),[j]),N=(0,r.useCallback)(()=>c.getMinSize(),[c]),P=(0,r.useCallback)(()=>c.getMaxSize(),[c]),F=(0,s.useCallbackRef)((e,n,r)=>{n/=w;let i={size:n=Math.max(N(),Math.min(a.CommonUtils.roundAccurately(n,N())??n,P())),hidden:!1},o=[];n<=0&&(i.hidden=!0,i.size=r),o.push({address:{min:e,max:e},update:i});let s=_.getMetrics();if(n<0){let r=E===t.IRange.Axis.Column,i=r?s.getColOffset:s.getRowOffset,a=r?s.getColIndex:s.getRowIndex,c=i(e),l=a(c+n),u=i(l);u===c+n?l--:o.push({address:{min:l,max:l},update:{size:c-u+n}}),e-l>1&&o.push({address:{min:l+1,max:e-1},update:{hidden:!0}})}c.updateHeaderPairs(o),D({index:e,sizePX:n}),p?.(e,n,r)},[b,_,c,w,p]),I=(0,s.useCallbackRef)((e,n,r)=>{let i=E===t.IRange.Axis.Column,o=null,s={min:e,max:e};if(c.isSelectedAll(e)){let t=c.getSelectedRuns();t.length>1?o=i?(0,a.messageKey)(`op.resizeColumns`):(0,a.messageKey)(`op.resizeRows`):s=t[0];let l={hidden:n<=0,size:(n<=0?r:n)/w};c.updateHeaderPairs(ea(t,l,e))}if(s){let e=s.max-s.min+1,t;t=e===1?c.getRange(s).at(0).getText():c.getRange(s).toString(),o=S(i?`op.resizeColumnsNamed`:`op.resizeRowsNamed`,{count:e,name:t})}O.current?.commit({description:o??void 0}),O.current=null,D(null),m?.(e,n,o)},[b,S,c,m]),L=(0,s.useCallbackRef)((e,n)=>{let r=E===t.IRange.Axis.Column?(0,a.messageKey)(`op.resizeColumns`):(0,a.messageKey)(`op.resizeRows`);O.current=c.getSheet().beginCommit(r),A(),D({index:e,sizePX:n}),f?.(e,n,r)},[E,c]),R=(0,s.useCallbackRef)((e,t)=>{A(),k.current=setTimeout(()=>{k.current=null,D({index:e,sizePX:t})},360),h?.(e,t)},[h]),z=(0,s.useCallbackRef)(e=>{A(),D(null),g?.(e)},[g]),B=(0,s.useCallbackRef)(e=>{let n=!1,r=E===t.IRange.Axis.Column,i=c.getSheet().getEntireRange().getCoords(),o=[],s=c.getSelectedRuns(),l=e=>{let t;t=r?{colStart:e.min,rowStart:i.rowStart,colEnd:e.max,rowEnd:i.rowEnd}:{colStart:i.colStart,rowStart:e.min,colEnd:i.colEnd,rowEnd:e.max},o.push(t)},u=s.length;for(let t=0;t<u;t++){let r=s[t];r.value&&(r.min<=e&&r.max>=e&&(n=!0),l(r))}n||l({min:e,max:e}),c.getSheet().getRanges(o).autoFit({axes:r?t.IRange.AxisSelection.Column:t.IRange.AxisSelection.Row}),A(),D(null),m?.(e,null,(0,a.messageKey)(`op.resizeColumns`))},[b,c,m,j]),V=c.isProtected()?void 0:F,H=null,U=(u?_.getVisibleColumns():_.getVisibleRows()).map(e=>e.index),W=u?_.getPaneRange().colStart:_.getPaneRange().rowStart;U.length>0&&U[0]>W&&(U=[U[0]-1,...U]);let G=[],K=[],q=U.length;for(let e=0;e<q;e++){let t=U[e],n=e<q-1?U[e+1]:t+M(t+1,!1)+1,r=t+1!==n;(!H||H.max<t)&&(H=v.length>0&&v[v.length-1].max>=t?v[a.CommonUtils.findEqualOrGreater(v,t,e=>e.max)]:null);let i=!1,o=!1;if(H&&(H.min<=t||H.min<=n&&!r)&&(i=!0,o=H.value??!1),t===W){let e=!1,n=!1;H&&H.min<=t&&(e=!0,n=H.value??!1),t>0&&K.push({index:t-1,isNextHidden:r,isSelected:e,isSelectedAll:n,disabledResize:!0})}if(o&&G.push(K.length),K.push({index:t,isHidden:e===0&&M(t,!1)>0,isNextHidden:r,isSelected:i,isSelectedAll:o,onDividerMouseDown:R,onDividerResizeStart:L,onDividerResize:V,onDividerMouseUp:z,onDividerResizeEnd:I,onDividerAutoFit:B}),r){let e=!1,r=!1;H&&H.min>=t&&H.max<=n-1&&H.value&&G.push(K.length),H&&H.max>=n||(H=v.length>0&&v[v.length-1].max>=n?v[a.CommonUtils.findEqualOrGreater(v,n,e=>e.max)]:null),H&&H.min<=n&&(e=!0,r=H.value??!1),n>0&&K.push({index:n-1,isHidden:!0,isSelected:e,isSelectedAll:r,onDividerMouseDown:R,onDividerResizeStart:L,onDividerResize:V,onDividerMouseUp:z,onDividerResizeEnd:I,onDividerAutoFit:B})}}if(G.length>0){let e=G.length-1;if(G.length>0){let t=K[G[e]].index,n=null;u?(n=_.getBoundsFromRange({rowStart:0,rowEnd:0,colStart:t,colEnd:t}),n.x+n.width>_.getPaneBounds().width&&(--e,e===0&&(e=-1))):(n=_.getBoundsFromRange({rowStart:t,rowEnd:t,colStart:0,colEnd:0}),n.y+n.height>_.getPaneBounds().height&&(--e,e===0&&(e=-1)))}let t=v?.[v.length-1],n=_.getAnchor();if(n===`t`||n===`l`){let e=K[G[Math.max(0,G.length-1)]];e.showTouchDivider=!!t&&t.max<=e.index}else e>=0&&(K[G[e]].showTouchDivider=!0)}let ee=K.length,te=Array(ee);for(let e=0;e<ee;e++)te[e]=(0,i.jsx)(o.HeaderDividerAnchor,{...K[e],axis:E,disabled:c.isProtected()},`divider${e}`);return(0,i.jsx)(o.Layer,{children:te})})),ea=(e,t,n=null)=>{let r=[],i=e.length;for(let a=0;a<i;a++){let i=e[a];if(!i.value)continue;let o=i.min,s=i.max;o===s&&o===n||r.push({address:{min:o,max:s},update:t})}return r},ta=`var(--sxl-color-primary)`,na=`var(--sxl-color-base-100)`,ra={side:`b`,align:`center`},ia={side:`r`,align:`center`},aa=(0,r.memo)(e=>{let{sheet:n}=e,c=(0,o.useGridPane)(),l=(0,s.useTranslator)(),[u]=(0,o.useSurfaceState)(Qi(t.IRange.Axis.Column),null),[d]=(0,o.useSurfaceState)(Qi(t.IRange.Axis.Row),null),f=!!u,p=u??d;if(!p)return null;let{index:m,sizePX:h}=p,g=h===0,_=n.getEntireRange().getCoords(),v=f?{rowStart:0,rowEnd:_.rowEnd,colStart:m,colEnd:m}:{rowStart:m,rowEnd:m,colStart:0,colEnd:_.colEnd},y=null;if(c.toClipBounds(c.getBoundsFromRange(v))){let e=c.getMetrics(),t=c.getPaneBounds(),n=f?Math.max(0,e.getColOffset(m)):Math.max(0,e.getRowOffset(m)),a=f?Math.min(t.x+t.width,e.getColOffset(m+1)):Math.min(t.y+t.height,e.getRowOffset(m+1)),s,l,u,d;if(f){let e=t.height;s=[0,0,0,e],l=`-0.5px 0px 0px 0px ${na}`,u={x:n-1,y:0,width:1,height:e},d={x:a,y:0,width:1,height:e}}else{let e=t.width;s=[0,0,e,0],l=`0px -0.5px 0px 0px ${na}`,u={x:0,y:n-1,width:e,height:1},d={x:0,y:a,width:e,height:1}}let p={propsPath:{stroke:ta,strokeWidth:`2px`}},h={style:{boxShadow:l},propsPath:{stroke:ta,strokeWidth:`2px`,strokeDasharray:`0 0 8 4`}};y=(0,i.jsxs)(r.Fragment,{children:[g?void 0:(0,i.jsx)(o.LineSVG,{linePoints:s,bounds:u,...p}),(0,i.jsx)(o.LineSVG,{linePoints:s,bounds:d,...h})]},`resize-dividers`)}let b=null;if(h!==null){let e=Math.floor(10*a.DOMUtils.getDPI())/10,t=a.CommonUtils.roundAccurately(h*e,0)??0,r=f?n.getColumnHeaders():n.getRowHeaders(),s=(n.getView()?.getZoomScale()??100)/100,c=(a.CommonUtils.roundAccurately(t/s/(r?.getScaleFactor()*a.DOMUtils.getDPI()),2)??0).toFixed(2),u=l(f?`resizeIndicator.width`:`resizeIndicator.height`),d=g?l(`resizeIndicator.hiddenDisplay`,{label:u}):l(`resizeIndicator.sizeDisplay`,{label:u,unit:c,px:t});b=(0,i.jsx)(o.StickyFloat,{anchor:{range:f?{colStart:m,colEnd:m,rowStart:0,rowEnd:0}:{rowStart:m,rowEnd:m,colStart:0,colEnd:0}},placement:f?ra:ia,whenOff:`clamp`,style:oa,children:d})}return y||b?(0,i.jsxs)(i.Fragment,{children:[b,y]}):null});aa.displayName=`ResizeIndicator`;var oa={font:`11px/1.5 system-ui, sans-serif`,color:`var(--sxl-color-base-content, white)`,background:`var(--sxl-color-base-100, rgb(60,60,60))`,padding:`2px 6px`,borderRadius:3,border:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.2))`,boxShadow:`0 2px 8px rgba(0,0,0,0.35)`,whiteSpace:`nowrap`,pointerEvents:`none`},{CommandScopeProvider:sa}=s.Command,ca=(e,t)=>(e.updateCommand(`openContextMenu`,{callback:()=>{t.openAtSelectedCell()}}),()=>{}),la=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{sheet:n,onSheetContextMenu:a,className:s,...c}=e,l=(0,o.useGridPane)(),u=(0,r.useCallback)(e=>{let t=l.getCellFromPointer(e.clientX,e.clientY);t&&a&&(a({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[l,a]),d=(0,r.useCallback)(()=>{if(!l||!a)return;let e=n.getSelection().getCoords().cell;l.scrollCellCoordsIntoView(e).then(t=>{requestAnimationFrame(()=>{let n=l.getMetrics().getColOffset(e.colIndex+1),r=l.getMetrics().getRowOffset(e.rowIndex+1),i=l.getPanePointFromPointer(0,0)||{x:0,y:0};a({clientX:n-i.x-(t.left??0)+6,clientY:r-i.y-(t.top??0)+6})})})},[l,n,a]),f=(0,r.useMemo)(()=>({openAtSelectedCell:d}),[d]);return(0,i.jsx)(sa,{spec:{scopeName:`layer:contextmenu`,contributor:{dynamic:ca},data:f},order:(0,o.useLayer)().zIndex,children:(0,i.jsx)(o.Layer,{onContextMenu:u,className:P(s,`contextMenu`),...c})})}));function ua(e){let{axis:t,entireCoords:n,scrollIntoView:a,className:o,...s}=e,c=te().getMode(),l=c?.selection??null,u=g()?.getName(),d=(0,r.useMemo)(()=>{if(!l)return null;let e=new Mt(l);return u?Ht(e,u):e},[l,u]);return c&&c.mode===`point`&&l?c.scope&&c.scope!==u?null:(0,i.jsx)(Ji,{className:P(o,`reference-header`),selection:l,adapter:d,axis:t,entireCoords:n,scrollIntoView:a,renderBorders:!1,preserveFocus:!0,replaceActive:!0,allowMulti:!1!==c.allowMulti,...s}):null}la.displayName=`ContextMenuLayer`,ua.displayName=`SheetReferenceHeaderLayer`;var da=e=>{let{style:t,...n}=e??{};return(0,i.jsxs)(`svg`,{style:{width:`135px`,height:`37px`,...t},viewBox:`0 0 135 37`,...n,children:[(0,i.jsx)(`path`,{d:`M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z`,fill:`#547dbe`,fillRule:`evenodd`}),(0,i.jsx)(`path`,{d:`M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z`,fill:`#ffffff`,fillRule:`evenodd`}),(0,i.jsx)(`path`,{d:`m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z`,fill:`#547dbe`,fillRule:`evenodd`,strokeWidth:`0.4`}),(0,i.jsx)(`path`,{d:`M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z`,fill:`#eb594d`}),(0,i.jsx)(`path`,{d:`m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z`,stroke:`#eb594d`,strokeWidth:`2`,fill:`#f9cecb`})]})},fa=(0,r.memo)(e=>{let{colorLicensee:n=`blue`,colorError:a=`red`,colorCredits:o=`grey`,credits:s=`All rights reserved - Michael Ford`,feature:c,style:l,...u}=e??{},[d,f]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{let e=await t.LicenseManager.getDetails();f(e)})()},[]);let[p,m]=(0,r.useState)(!1),h={opacity:.65},g=(0,r.useMemo)(()=>{let e=d?.getExceptions(),t=e?.length??0;if(t===0)return null;let n=[];for(let r=0;r<t;r++){let t=e[r];n.push((0,i.jsx)(`div`,{style:{opacity:.8,fontSize:`16px`,textAlign:`left`,color:a},children:t},r))}return n},[d,a]);if(d===null||d.isValidFor(c??``))return null;let _=d.getType(),v=!g&&_.endsWith(`ity`),y=d.getLicensee(),b=v?1.6:1,x=135/b,S=37/b,C=null;return!_&&(y?.length??0)>0&&(C=(0,i.jsx)(`div`,{style:{opacity:.7,fontWeight:`500`,fontSize:`16px`,textAlign:`left`,color:n},children:y})),(0,i.jsx)(`div`,{style:{pointerEvents:`none`,display:`flex`,flexDirection:`column`,overflow:`hidden`,...l},...u,children:(0,i.jsxs)(`div`,{style:{position:`relative`,display:`flex`,flexDirection:`column`},children:[p?(0,i.jsx)(da,{style:h}):(0,i.jsx)(`svg`,{width:x,height:S,style:h,children:(0,i.jsx)(`image`,{style:{width:x,height:S},href:`https://www.sheetxl.com/watermark.svg`,onError:()=>m(!0)})}),(0,i.jsxs)(`div`,{children:[C,g,(0,i.jsx)(`div`,{style:{height:`0px`,fontSize:`16px`,textAlign:`left`,width:`0px`,opacity:.8,color:o},children:s})]})]})})}),pa={key:`copy`,description:(0,a.messageKey)(`editMode.copy`)},ma={key:`cut`,description:(0,a.messageKey)(`editMode.cut`)},ha={type:t.ICell.Content.Values},ga={fitDestination:!0,type:t.ICell.Content.Formats},_a={fitDestination:!0,type:t.ICell.Content.Formulas},va={transpose:!0},ya={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getAddress({$colIndex:!0,$rowIndex:!0})}`})};function ba(e,n){let r=n.sheet,i=n,{notifier:o,editModeHandler:s,globalClipboard:c,element:l}=n,u={element:l,doCopy:e=>new t.RangeClipboardItem(r.getSelectedRanges().getSnapshot(e))},d={element:l,importFromExternal:async(e,n)=>{let i=r.getSelectedRange().getTopLeft().getCoords(),a=new t.ExternalRangeClipboardItem(r.getRuntime(),e,{colIndex:i.colStart,rowIndex:i.rowStart},n,r.getStyles());return await a.parse()?a:null},doPaste:async(e,n)=>{if(e?.getItemType()!==`range`)return!1;n?.contentsOnly&&delete(n={...n,type:t.ICell.Content.Values}).contentsOnly;let i=e.getItem?.();if(!i)return!1;let o=i.getName?.(),s=r.getSelectedRange();if(o===`HTML`&&s.size>1){let e=i.getCoords?.();e&&a.CoordUtils.isSingleCell(e)&&(s=s.getResizeTo(1,1))}return await s.doBatch(async()=>{let e=await s.copyFrom(i,{...n});!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({axes:t.IRange.AxisSelection.Row,minContent:!0})},{description:o?(0,a.t)(`op.pasteNamed`,{name:o}):(0,a.messageKey)(`op.paste`),autoSelect:!0}),!0}},f=async e=>{if(u.element?.())try{await(async e=>{if(!u.element)return;let t=c.getClipboard(),n=u.doCopy?.(e);typeof n==`string`?await t.writeText(n):await t.writeReference(n)})(e??{})}catch(e){o?.showError(e)}},p=async(e,t,n)=>{try{if(!1===await e.doPaste?.(t,n))return;((e,t)=>{if(e?.getItemType()!==`range`)return;let n=s.getMode()?.key===`cut`||e.isCut?.();if(!n&&s.getMode()?.key===`copy`){let t=e.getItem?.()?.getCoords?.(),i=r.getSelectedRanges().getCoords(),o=!1;if(t&&i&&e.getItem?.()?.getSource?.()===r)for(let e=0;!o&&e<i.length;e++)o=a.CoordUtils.isRangesIntersect(t,i[e]);n=o}n&&s.setMode(null),l?.()?.focus(),i.onPaste?.(e,t)})(t,n)}catch(e){o?.showError(e)}},m=async(e,t,n)=>{let r=d.element?.();if(r&&await a.DOMUtils.whenFocus(r),!e&&!t)return;let i=await o?.showBusy?.((0,a.t)(`clipboard.pasting`));if(t)try{await p(d,t,n),i?.();return}catch(e){i?.(),o?.showError(e)}if(!e)return void i?.();let s=d.importFromExternal;s||=()=>({getItemType:()=>`text`,toText:()=>e?.text??``,isClipboardItem:!0});let c=null;try{c=await s(e,{isCut:!1})}catch(e){i?.(),o?.showError(e)}if(c)try{let e=await Promise.resolve(c);await p(d,e,n),i?.()}catch(e){i?.(),o?.showError(e)}else i?.()},h=async e=>{if(!d.element)return;let t=c.getClipboard();try{let n=await t.readReference();if(n)return void await m(null,n,e??{});let r=[];r[0]=await a.ClipboardUtils.readStringFromClipboard(t,a.MimeType.Plain),r[1]=await a.ClipboardUtils.readHTMLFromClipboard(t,a.MimeType.Html),r[2]=await a.ClipboardUtils.readBlobFromClipboard(t,a.MimeType.Png);let i={text:r[0]??null,html:r[1]??null,image:r[2]??null};await m(i,null,e??{})}catch(e){if(e?.message===`Document is not focused.`)return;o?.showError(e)}};e.updateCommand(`copy`,{callback:()=>f()}),e.updateCommand(`cut`,{callback:()=>f({isCut:!0})}),e.updateCommand(`paste`,{callback:()=>h()}),e.updateCommand(`pasteValues`,{callback:e=>h({...ha,...e})}),e.updateCommand(`pasteFormats`,{callback:(e,t)=>h({...ga,description:t?.getLabel(),...e})}),e.updateCommand(`pasteFormulas`,{callback:(e,t)=>h({..._a,description:t?.getLabel(),...e})}),e.updateCommand(`pasteTranspose`,{callback:(e,t)=>h({...va,description:t?.getLabel(),...e})}),e.updateCommand(`pasteLinks`,{callback:(e,t)=>h({...ya,description:t?.getLabel(),...e})}),e.updateCommand(`formatPainterToggle`,{state:s.getMode()?.key===`formatPainter`,callback:()=>{if(s.getMode()?.key!==`formatPainter`)return f({editMode:{key:`formatPainter`,description:(0,a.messageKey)(`editMode.formatPainter`),cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}});s.setMode(null)}});let g=[`cut`,`paste`,`pasteValues`,`pasteFormats`,`pasteFormulas`,`pasteTranspose`,`pasteLinks`,`formatPainterToggle`],_=()=>{let t=r.getProtection().isFormatCellsAllowed()?[]:[(0,a.messageKey)(`reason.sheetProtected`)];for(let n of g)e.updateCommand(n,{disabledReasons:t})};_();let v=c.getClipboard(),y=async()=>{s.getMode()?.key!==`edit`&&(e=>{let t=e?.getItemType()===`range`?e:null;if(t){let n=e.editMode?.(),r={...e?.isCut?.()?ma:pa,...n,args:{isClipboard:!0,reference:t,...n?.args},onModeChange:e=>{e?.args?.isClipboard||c.getClipboard().clear(!0),n?.onModeChange?.(e)}};s.setMode(r)}i.onClipboardUpdate?.(t)})(await v.readReference())},b={safari:(0,a.messageKey)(`error.clipboard.safari`),perms:(0,a.messageKey)(`error.clipboard.perms`)},x=e=>o?.showMessage?.((0,a.t)(b[e.code]),{onceKey:`clipboard.features`}),S=()=>x(a.InternalClipboard.ErrorMessages.PermsRead),C=()=>x(a.InternalClipboard.ErrorMessages.PermsWrite);v.addEventListener(`clipboardchange`,y),v.addEventListener(`clipboarderrorread`,S),v.addEventListener(`clipboarderrorwrite`,C);let w=r.addListeners({onProtectionChange:_,onInvalidated:_});return()=>{v.removeEventListener(`clipboardchange`,y),v.removeEventListener(`clipboarderrorread`,S),v.removeEventListener(`clipboarderrorwrite`,C),w()}}var{CommandScopeProvider:xa,useCommandExecute:Sa}=s.Command,Ca=({sheet:e,className:t,...n})=>{let a=(0,s.useNotifier)(),c=(0,s.useEditMode)(),l=(0,s.useGlobalClipboard)(),u=(0,o.useGridPane)(),d=Sa(),f=c.getMode(),p=(0,r.useMemo)(()=>({sheet:e,notifier:a,editModeHandler:c,globalClipboard:l,element:u.getElement}),[e,a,c,l,u]),m=f?.key,h=m===`copy`||m===`cut`||m===`formatPainter`,g=f?.args?.reference,_=g?.getItem?.(),v=_?.getSource()===e,y=_?.getCoords?.();return(0,i.jsx)(xa,{spec:{scopeName:`layer:clipboard`,contributor:{dynamic:ba},data:p},order:(0,o.useLayer)().zIndex,children:(0,i.jsx)(o.Layer,{onKeyDown:async e=>{let t=c.getMode()?.key,n=t===`copy`||t===`cut`;(n||t===`formatPainter`)&&(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),c.setMode(null)):n&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),await d(`paste`),c.setMode(null)))},...n,className:P(t,`clipboard`),children:h&&g&&v&&y&&(0,i.jsx)(o.RangeRect,{range:y,alignWidth:2,stroke:g.isCut?.()?`var(--sxl-color-warning)`:`var(--sxl-color-primary)`,animatedStroke:!0,clipInsets:o.SELECTION_CLIP_INSETS})})})};Ca.displayName=`SheetClipboardLayer`;var wa=(0,r.createContext)(null);wa.displayName=`DocThemesContext`;var Ta=()=>{let e=(0,r.useContext)(wa),[n]=(0,r.useState)(()=>new t.ThemeCollection);return(0,r.useMemo)(()=>e||n,[e])},Ea=e=>{let n=e?.prefix??t.SYSTEM_COLOR_CSS_PREFIX,r=new Map,i=null,a=(a,o=!1)=>{if(typeof document>`u`)return null;let s=e?.element?.()??document.body;if(!s)return null;let c=`${a}|${o?`d`:`l`}`;if(r.has(c))return r.get(c);let l=(e=>(i||(i=document.createElement(`span`),i.setAttribute(`aria-hidden`,`true`),i.style.cssText=`position:absolute;width:0;height:0;visibility:hidden;pointer-events:none;`),i.parentElement!==e&&e.appendChild(i),i))(s);if(!l)return r.set(c,null),null;let u=n+a.toLowerCase();if(!getComputedStyle(l).getPropertyValue(u).trim())return r.set(c,null),null;l.style.color=o?`var(${u}-dark, var(${u}))`:`var(${u})`;let d=getComputedStyle(l).color;l.style.color=``;let f=(e=>{let n=e?e.match(/[\d.]+/g):null;if(!n||n.length<3)return null;let r=n.length>=4?`rgba(${n[0]},${n[1]},${n[2]},${n[3]})`:`rgb(${n[0]},${n[1]},${n[2]})`;try{return t.Color.parse(r)}catch{return null}})(d);return r.set(c,f),f};return a.invalidate=()=>{r.clear(),t.Color.invalidateSystemColors()},a},Da=`sxl-system-colors`,Oa=()=>{if(typeof document>`u`||document.getElementById(Da))return;let e=t.Color.getSystemColorDefaults(),n=Object.keys(e).map(n=>`${t.SYSTEM_COLOR_CSS_PREFIX}${n}:${e[n]};`).join(``),r=document.createElement(`style`);r.id=Da,r.textContent=`:root{${n}}`,document.head.appendChild(r)},ka=()=>{(0,r.useMemo)(()=>{Oa()},[])},Aa=null,ja=[[t.IColor.Named.Window,`var(--sxl-color-base-100)`],[t.IColor.Named.Menu,`var(--sxl-color-base-100)`],[t.IColor.Named.BtnFace,`var(--sxl-color-base-100)`],[t.IColor.Named.InfoBk,`var(--sxl-color-base-100)`],[t.IColor.Named.ScrollBar,`var(--sxl-color-base-100)`],[t.IColor.Named.AppWorkspace,`var(--sxl-color-base-100)`],[t.IColor.Named.Background,`var(--sxl-color-base-100)`],[t.IColor.Named.WindowText,`var(--sxl-color-base-content)`],[t.IColor.Named.MenuText,`var(--sxl-color-base-content)`],[t.IColor.Named.BtnText,`var(--sxl-color-base-content)`],[t.IColor.Named.InfoText,`var(--sxl-color-base-content)`],[t.IColor.Named.CaptionText,`var(--sxl-color-base-content)`],[t.IColor.Named.GrayText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[t.IColor.Named.InactiveCaptionText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[t.IColor.Named.Highlight,`var(--sxl-color-primary)`],[t.IColor.Named.ActiveCaption,`var(--sxl-color-primary)`],[t.IColor.Named.HotLight,`var(--sxl-color-primary)`],[t.IColor.Named.HighlightText,`var(--sxl-color-primary-content)`],[t.IColor.Named.BtnHighlight,`var(--sxl-color-base-200)`],[t.IColor.Named.Light3d,`var(--sxl-color-base-200)`],[t.IColor.Named.InactiveCaption,`var(--sxl-color-base-200)`],[t.IColor.Named.ActiveBorder,`var(--sxl-color-base-300)`],[t.IColor.Named.InactiveBorder,`var(--sxl-color-base-300)`],[t.IColor.Named.WindowFrame,`var(--sxl-color-base-300)`],[t.IColor.Named.BtnShadow,`var(--sxl-color-neutral)`],[t.IColor.Named.DkShadow3d,`var(--sxl-color-neutral)`]],Ma={};for(let[e,t]of ja)Ma[`sys-color-${e.toLowerCase()}`]=t;var Na={light:Ma,dark:Ma},Pa=(e=`sxl-defaults`,t)=>(0,s.buildThemeCSS)({app:Na,surfaces:{grid:Na,header:Na},layer:e,scope:t}),Fa=(e,t)=>{let n=``;if(e&&(n=e.includes(` `)?`"${e}"`:e),t)for(let e=0;e<t.length;e++)n.length>0&&(n+=`, `),n+=t[e];return n},Ia=(e,t)=>{let n=t??[];return e===`Aptos Narrow`?[`Calibri`,...n]:n},La=(e,t,n)=>{let r=e.getColorScheme(),i=e.getFontScheme();return{"doc-color-dk1":r.getDk1().toCSS(n),"doc-color-dk2":r.getDk2().toCSS(n),"doc-color-lt1":r.getLt1().toCSS(n),"doc-color-lt2":r.getLt2().toCSS(n),"doc-color-accent1":r.getAccent1().toCSS(n),"doc-color-accent2":r.getAccent2().toCSS(n),"doc-color-accent3":r.getAccent3().toCSS(n),"doc-color-accent4":r.getAccent4().toCSS(n),"doc-color-accent5":r.getAccent5().toCSS(n),"doc-color-accent6":r.getAccent6().toCSS(n),"doc-color-hlink":r.getHlink().toCSS(n),"doc-color-fol-hlink":r.getFolHlink().toCSS(n),"doc-font-major":Fa(i.getMajorFont(),Ia(i.getMajorFont(),i.getMajorFallbacks())),"doc-font-minor":Fa(i.getMinorFont(),Ia(i.getMinorFont(),i.getMinorFallbacks())),"doc-font-size":`${t}pt`}},Ra=(e,t=11,n=`sxl-defaults`,r)=>(0,s.buildThemeCSS)({app:{light:La(e,t,!1),dark:La(e,t,!0)},layer:n,scope:r}),za={Mode:`themeMode`,DarkGrid:`enableDarkGrid`,DarkImages:`enableDarkImages`},Ba=e=>{let[t]=(0,s.usePersistenceState)(za.Mode,null),[n]=(0,s.usePersistenceState)(za.DarkGrid,!1),{themeMode:r}=(0,s.useResolvedThemeMode)({mode:e??t??void 0});return e||(r===`dark`&&n?`dark`:`light`)},Va=()=>{let[e]=(0,s.usePersistenceState)(za.Mode,null),{themeMode:t}=(0,s.useResolvedThemeMode)({mode:e??void 0});return t},Ha=`_sheet-scrollbar_104cg_1`,Ua=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{style:n=s.ReactUtils.EmptyCssProperties,orientation:o,sheet:c,onShowTooltip:u,onCloseTooltip:d,onScrollOffset:f,showCustomScrollButtons:p,offset:m=0,totalSize:h=0,viewportSize:g=0,className:_,endGap:v,...y}=e;if(!c)throw Error(`SheetScrollbar needs an ISheet`);let b=(0,s.useCallbackRef)(u,[u]),x=(0,s.useCallbackRef)(d,[d]),S=(0,r.useRef)(null),C=cn([S,t]),w=o===s.ScrollbarOrientation.Vertical,T=(0,s.useTranslator)(),[E,D]=(0,r.useState)(()=>{let e=(c.getView().getZoomScale()??100)/100,t=c.getView().getTopLeft();return(w?t.top:t.left)*e}),O=()=>{let e=c.getView().getFreezePanes(),t=(c.getView().getZoomScale()??100)/100;if(w){let n=e.coords?.rowIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.top??0;return{shift:(c.getRowHeaders().getOffset(n)-r)*t,scroll:r*t}}{let n=e.coords?.colIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.left??0;return{shift:(c.getColumnHeaders().getOffset(n)-r)*t,scroll:r*t}}},[k,A]=(0,r.useState)(O),[j,M]=(0,r.useState)(null),[N,F]=(0,r.useState)(!1),I=o===s.ScrollbarOrientation.Vertical?c.getRowHeaders():c.getColumnHeaders(),L=()=>{let e=c.getUsedRange()?.getCoords()??a.CoordUtils.EmptyRange,t=c.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[R,z]=(0,r.useState)(L),B=R?(w?R.rowIndex:R.colIndex)+1:0,V=()=>{let e=L();a.CoordUtils.isEqualCells(R,e)||z(e)};l(c.getView(),{onFreezePaneChange:()=>{A(O)}}),l(c.getSelection(),{onChange:V}),l(c,{onUsedRangeChange:V}),(0,r.useEffect)(()=>{z(L())},[c]);let H=m-k.scroll,U=g-k.shift,W=h-(k.shift+k.scroll),G=I.getOffset(B)*(c.getView().getZoomScale()/100)-(k.scroll+k.shift);(0,r.useEffect)(()=>{if(!j)return N&&x?.(),void F(!1);ee(w,E,U,v,j,c,I,k)},[w,m,E,U,v,k,o,j,I,N,c]);let K=(0,s.useCallbackRef)((e,t,n)=>{D(e);let r=e+k.scroll,i=t+k.shift,a=n+k.shift+k.scroll;f?.(r,i,a)},[f,k]),q=(0,r.useCallback)((e,t,n,r,i,a,c,l)=>{let u=c.getTextAt(c.getIndex(t/(a.getView().getZoomScale()/100)+l.scroll+l.shift)),d={...i,display:o===s.ScrollbarOrientation.Vertical?T(`scrollbar.row`,{title:u}):T(`scrollbar.column`,{title:u})},f=i.element??S.current?.querySelector(`[role="slider"]`);if(f){let t=f.getBoundingClientRect();d.anchor=e?{x:t.left,y:t.top+t.height/2}:{x:t.left+t.width/2,y:t.top}}d.anchor&&(F(!0),b?.(d))},[T]),ee=(0,s.useCallbackRef)(a.TimerUtils.debounce(q,0),[q]),te=(0,s.useCallbackRef)(e=>{M(e.dragging?{element:e.element}:null)},[]);return(0,r.useMemo)(()=>(0,i.jsx)(s.VirtualScrollbar,{ref:C,className:P(_,Ha),style:n,offset:H,viewportSize:U,totalSize:W,orientation:o,showCustomScrollButtons:p,onMouseDown:e=>{e.preventDefault()},onScrollOffset:K,minSize:G,onThumbDrag:te,...y}),[_,H,U,W,o,p,n,G,v])}));Ua.displayName=`SheetScrollbar`;var Wa=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{sheetHeader:a,oppositeSize:c=30,edgeSize:u=1,edgeColor:d=`var(--sxl-color-base-300)`,headerText:f,freezeStart:p,colorScheme:m,verticalPadding:h,horizontalPadding:g,onSheetContextMenu:_,onResizeHeadersStart:v,onResizeHeaders:y,onResizeHeadersEnd:b,onResizeHeadersDown:x,onResizeHeadersUp:S,viewport:C,onSelectionStart:w,onSelectionEnd:T,propsCellRender:E,style:D,className:O,...k}=e,A=(0,r.useMemo)(()=>a.getAxis(),[a]),j=(0,s.useCallbackRef)(v,[v]),M=(0,s.useCallbackRef)(y,[y]),N=(0,s.useCallbackRef)(b,[b]),F=(0,s.useCallbackRef)(x,[x]),I=(0,s.useCallbackRef)(S,[S]),L=(0,r.useRef)(null),[R,z]=(0,r.useReducer)(e=>e+1,0),B=a?.getSheet(),V=(0,r.useRef)(!1);(0,r.useLayoutEffect)(()=>{V.current=!0},[a]);let[U,W]=(0,r.useState)(0),[G,K]=(0,r.useState)(B?.getView().getZoomScale()/100);l(a,{onSizesChange:e=>{K(B?.getView().getZoomScale()/100),ne(J()),W(a.getEntireRange().getCoords().max+1)}}),(0,r.useLayoutEffect)(()=>{K(a?.getSheet().getView().getZoomScale()/100),ne(J())},[a,c]);let q=(0,r.useCallback)((e,t)=>a.hiddenHeadersAt(e,t),[(0,r.useCallback)(e=>a.at(e)?.isHidden()||a.at(e)?.getSize()===0,[a])]),ee=(0,s.useCallbackRef)(e=>a.isSelected(e),[a]),te=(0,s.useCallbackRef)(e=>a.isSelectedAll(e),[a]),J=()=>{let e=A===t.IRange.Axis.Column;return{getColOffset:t=>e?a.getOffset(t):t===0?0:c/G,getColIndex:t=>e?a.getIndex(t):0,getRowOffset:t=>e?t===0?0:c/G:a.getOffset(t),getRowIndex:t=>e?0:a.getIndex(t)}},[Y,ne]=(0,r.useState)(()=>J()),X=(0,r.useMemo)(()=>(0,i.jsx)($i,{sheetHeader:a,isColumn:A===t.IRange.Axis.Column,oppositeSize:c,onResizeHeadersStart:j,onResizeHeaders:M,onResizeHeadersEnd:N,onResizeHeadersDown:F,onResizeHeadersUp:I},`header-resizer-layer-${A}-[${a.getSheet().getId()}]`),[a,c,A,R]),re=(0,s.useCallbackRef)(e=>{let n=A===t.IRange.Axis.Column;_?.({...e,rowIndex:n?-1:e.rowIndex,colIndex:n?e.colIndex:-1})},[A,_]),Z=(0,s.useCallbackRef)(e=>{B?.scrollTo({colStart:e.colIndex,colEnd:e.colIndex,rowStart:e.rowIndex,rowEnd:e.rowIndex},{})},[B]),ie=(0,r.useMemo)(()=>(0,i.jsx)(Ji,{selection:a.getSheet().getSelection(),axis:A,entireCoords:a.getSheet().getEntireRange().getCoords(),edgeSize:u,edgeColor:d,scrollIntoView:Z,onPointerDownInterceptor:(e,n)=>!(e.button===2&&a.isSelectedAll(A===t.IRange.Axis.Column?n.colIndex:n.rowIndex)),onSelectionStart:w,onSelectionEnd:T},`header-selection-layer-${A}-[${a.getSheet().getId()}]`),[a,U,p,u,d,Z]),ae=(0,r.useMemo)(()=>(0,i.jsx)(ua,{axis:A,entireCoords:a.getSheet().getEntireRange().getCoords(),scrollIntoView:Z},`header-reference-layer-${A}-[${a.getSheet().getId()}]`),[a,U,p,A,Z]),oe=(0,r.useMemo)(()=>_?(0,i.jsx)(la,{sheet:a.getSheet(),onSheetContextMenu:re},`context-menu-layer-${A}-[${a.getSheet().getId()}]`):null,[a,_,R]),se=(0,s.useCallbackRef)(e=>f?f(e):a.getTextAt(e),[f,a]),ce=(0,s.useCallbackRef)(e=>{let{range:n,key:r,...o}=e,s=A===t.IRange.Axis.Column?n?.colStart??e.cell.colIndex:n?.rowStart??e.cell.rowIndex,c=a.at(s);return(0,i.jsx)(H,{axis:A,index:s,isSelected:ee,isSelectedAll:te,zoomScale:100*G,headerText:se,verticalPadding:h,horizontalPadding:g,onColumnButtonMouseDown:E?.onColumnButtonMouseDown,propsColumnButton:E?.propsColumnButton,renderColumnButton:E?.renderColumnButton,...o,value:c},`${r}-${A}-[${a.getSheet().getId()}]`)},[R,E,U,G,a]),le=(0,s.useEditMode)(),ue=(0,s.useImperativeElement)(n,()=>({scrollTo:e=>{L.current?.scrollTo(e)},forceRender:()=>{z()},getGridSurface:()=>L.current}),[]),Q=(0,r.useMemo)(()=>{if(C)return A===t.IRange.Axis.Column?new s.AxisViewport(C,new s.Viewport,!0,!1,C):new s.AxisViewport(new s.Viewport,C,!1,!0,C)},[C,A]),de=m===`dark`?`dark`:`light`,$=(0,r.useMemo)(()=>{let e={overflow:`visible`,...(B?.getStyles().getNormal().getFont()).toCSS(`adaptive`,1),...D},n=`white`,r=`black`;if(s.ReactUtils.detectIt().primaryInput!==`touch`){let i=A===t.IRange.Axis.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${r}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${r}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;le.getMode()?.key===`formatPainter`&&(i=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${r}' fill='${n}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),e.cursor=i}e.backgroundColor=`var(--sxl-color-base-100)`;let i=A===t.IRange.Axis.Column;return e.boxSizing=`border-box`,e.width=i?`100%`:c,e.height=i?c:`100%`,e.contain=`size layout style`,e.clipPath=i?`inset(-9999px 0px -9999px 0px)`:`inset(0px -9999px 0px -9999px)`,e},[A,le,m,D,c,R]),fe=(0,r.useMemo)(()=>[(0,i.jsx)(Ln,{header:a,renderCell:ce},`header-cells-${A}-[${a.getSheet().getId()}]`),ie,ae,X,oe],[X,ie,ae,oe,a,ce,A]),pe=(0,r.useMemo)(()=>{let e=A===t.IRange.Axis.Column;return(0,i.jsx)(o.GridSurface,{ref:cn([ue,L]),className:P(O,`sheet-header`),style:$,...(0,s.themeSurfaceProps)(`header`,de),viewport:Q,columnCount:e?U:1,rowCount:e?1:U,freezeLeft:e?p:void 0,freezeTop:e?void 0:p,hiddenColumnsAt:e?q:void 0,hiddenRowsAt:e?void 0:q,metrics:Y,...k,children:fe})},[U,fe,Y,Q,$,O,de,k]);return(0,r.useEffect)(()=>{V.current=!1,L.current?.invalidate()},[a]),pe})),Ga=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{sheet:n,colorScheme:a,className:o,style:c,width:u,height:d,onMouseDown:f,...p}=e,[m,h]=(0,r.useState)(n.getSelection().isEntire()),[g,_]=(0,r.useState)(!1),[v]=(0,s.useCommands)(`selectAll`);l(n?.getSelection(),{onChange:()=>{h(n.getSelection().isEntire()),_(n.getSelection().hasTopOrLeft())}});let y=a===`dark`?`dark`:`light`,b=m?`var(--sxl-color-primary)`:`var(--sxl-color-base-100)`,x=m?`color-mix(in srgb, var(--sxl-color-primary) 20%, transparent)`:`var(--sxl-color-base-hover)`,S=`var(--sxl-color-base-300)`,C=s.ReactUtils.getDevicePixelRatio(),w=e=>e/C+`px`;return(0,i.jsxs)(`div`,{tabIndex:-1,className:P(o,`top-left-corner`),...(0,s.themeSurfaceProps)(`header`,y),...p,onMouseDown:e=>{v?.execute(e.ctrlKey||e.button!==0),f?.(e)},style:{gridColumn:`1 / 2`,gridRow:`1 / 2`,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxSizing:`border-box`,position:`relative`,cursor:`cell`,zIndex:100,borderRight:`solid ${w(1)} ${S}`,borderBottom:`solid ${w(1)} ${S}`,...c},ref:t,children:[(0,i.jsx)(`div`,{style:{height:d-5+`px`,width:d-5+`px`,clipPath:`path('M${d-5} 0 L0 ${d-5} L${d-5} ${d-5} L${d-5} 0 Z')`,borderRight:`${w(2)} solid ${b}`,borderBottom:`${w(2)} solid ${b}`,background:`${x}`,boxSizing:`border-box`,position:`absolute`,right:w(2),bottom:w(2)}}),(0,i.jsx)(`div`,{style:{position:`absolute`,right:w(-2),bottom:w(-2),width:w(g?2:1),height:w(g?2:1),background:g?`var(--sxl-color-primary)`:`var(--sxl-color-base-300)`}})]})}));Ga.displayName=`TopLeftCorner`;var Ka=Object.freeze([{key:`lightRedFillDarkRedText`,style:{font:{color:`#9C0006`},fill:{type:`solid`,color:`#FFC7CE`}}},{key:`yellowFillDarkYellowText`,style:{font:{color:`#9C6500`},fill:{type:`solid`,color:`#FFEB9C`}}},{key:`greenFillDarkGreenText`,style:{font:{color:`#006100`},fill:{type:`solid`,color:`#C6EFCE`}}},{key:`lightRedFill`,style:{fill:{type:`solid`,color:`#FFC7CE`}}},{key:`redText`,style:{font:{color:`#9C0006`}}},{key:`redBorder`,style:{border:{[t.IBorder.Edge.Left]:{style:t.IBorder.StrokeStyle.Thin,color:`#9C0006`},[t.IBorder.Edge.Top]:{style:t.IBorder.StrokeStyle.Thin,color:`#9C0006`},[t.IBorder.Edge.Right]:{style:t.IBorder.StrokeStyle.Thin,color:`#9C0006`},[t.IBorder.Edge.Bottom]:{style:t.IBorder.StrokeStyle.Thin,color:`#9C0006`}}}}]),qa=`#F8696B`,Ja=`#FFEB84`,Ya=`#63BE7B`,Xa=`#FCFCFF`,Za=`#5A8AC6`,Qa=`#FFEF9C`,$a=e=>{let n=e.map((n,r)=>r===0?{type:t.IConditionalFormat.ColorStopType.Min,color:n}:r===e.length-1?{type:t.IConditionalFormat.ColorStopType.Max,color:n}:{type:t.IConditionalFormat.ColorStopType.Percentile,value:50,color:n});return{type:t.IConditionalFormat.ScaleType.ColorScale,stops:n}},eo=Object.freeze([$a([Ya,Ja,qa]),$a([qa,Ja,Ya]),$a([Ya,Xa,qa]),$a([qa,Xa,Ya]),$a([Za,Xa,qa]),$a([qa,Xa,Za]),$a([Xa,qa]),$a([qa,Xa]),$a([Ya,Xa]),$a([Xa,Ya]),$a([Ya,Qa]),$a([Qa,Ya])]),to=Object.freeze([`#638EC6`,`#63C384`,`#FF555A`,`#FFB628`,`#008AEF`,`#D6007B`]),no=(e,n)=>({type:t.IConditionalFormat.ScaleType.DataBar,stops:[{type:t.IConditionalFormat.ColorStopType.AutoMin},{type:t.IConditionalFormat.ColorStopType.AutoMax}],color:e,...n?{gradient:!0,borderColor:e}:null}),ro=Object.freeze([...to.map(e=>no(e,!0)),...to.map(e=>no(e,!1))]),io=()=>structuredClone(eo[1]),ao=()=>structuredClone(ro[0]),oo=e=>{let n=[];for(let r=0;r<e;r++)n.push({type:t.IConditionalFormat.ColorStopType.Percent,value:Math.round(100*r/e)});return n},so=()=>({type:t.IConditionalFormat.ScaleType.IconSet,iconSet:t.IStyle.IconSet.TrafficLights3,stops:oo(3)}),co=Object.freeze([{key:`directional`,sets:[t.IStyle.IconSet.Arrows3,t.IStyle.IconSet.ArrowsGray3,t.IStyle.IconSet.Triangles3,t.IStyle.IconSet.Arrows4,t.IStyle.IconSet.ArrowsGray4,t.IStyle.IconSet.Arrows5,t.IStyle.IconSet.ArrowsGray5]},{key:`shapes`,sets:[t.IStyle.IconSet.TrafficLights3,t.IStyle.IconSet.TrafficLights3_2,t.IStyle.IconSet.TrafficLights4,t.IStyle.IconSet.Signs3,t.IStyle.IconSet.RedToBlack4]},{key:`indicators`,sets:[t.IStyle.IconSet.Symbols3,t.IStyle.IconSet.Symbols3_2,t.IStyle.IconSet.Flags3]},{key:`ratings`,sets:[t.IStyle.IconSet.Stars3,t.IStyle.IconSet.Rating4,t.IStyle.IconSet.Rating5,t.IStyle.IconSet.Quarters5,t.IStyle.IconSet.Boxes5]}]),lo=(e,t)=>e?[t]:[],uo=new Set([`formatTextRotate0`,`formatTextRotate45`,`formatTextRotate90`,`formatTextRotate270`,`formatTextRotate315`,`formatTextRotateCustom`,`formatTextRotateVertical`]),fo=new Set([`dataTextToColumns`,`sortAscending`,`sortDescending`]);function po(e,n){let r=()=>n.getView();e.updateCommand(`gridlinesToggle`,{callback:()=>{let e=r().isShowColumnGridlines()&&r().isShowRowGridlines();r().update({showColumnGridlines:!e,showRowGridlines:!e})}}),e.updateCommand(`sheetViewToggleGridlinesRows`,{callback:()=>{r().setShowRowGridlines(!r().isShowRowGridlines())}}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{callback:()=>{r().setShowColumnGridlines(!r().isShowColumnGridlines())}}),e.updateCommand(`sheetViewFormatGridlinesColor`,{callback:e=>{r().setGridLineColor(e)},context:()=>({...ho(n),autoColor:null,onColorSelect:()=>{}})}),e.updateCommand(`sheetViewToggleShowHeadings`,{callback:()=>{let e=r().isShowColumnHeaders()&&r().isShowRowHeaders();r().update({showColumnHeaders:!e,showRowHeaders:!e})}}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{callback:()=>{r().setShowColumnHeaders(!r().isShowColumnHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{callback:()=>{r().setShowRowHeaders(!r().isShowRowHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{callback:()=>{let e=r(),n=e.getColumnHeaderStyle()===t.ISheetView.HeaderTextStyle.Zero&&e.getRowHeaderStyle()===t.ISheetView.HeaderTextStyle.Zero;e.update({columnHeaderStyle:n?t.ISheetView.HeaderTextStyle.A1:t.ISheetView.HeaderTextStyle.Zero,rowHeaderStyle:n?t.ISheetView.HeaderTextStyle.One:t.ISheetView.HeaderTextStyle.Zero})}}),e.updateCommand(`sheetViewToggleFormulaView`,{callback:()=>{r().setShowFormulas(!r().isShowFormulas())}}),e.updateCommand(`sheetViewToggleShowZeros`,{callback:()=>{r().setShowZeros(!r().isShowZeros())}}),e.updateCommand(`calculate`,{callback:()=>{n.calculate()}}),e.updateCommand(`sheetZoomOut`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomOut()}}),e.updateCommand(`sheetZoomIn`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomIn()}}),e.updateCommand(`sheetZoom100`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(100)}}),e.updateCommand(`sheetZoom200`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(200)}}),e.updateCommand(`sheetZoom75`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(75)}}),e.updateCommand(`sheetZoom50`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(50)}}),e.updateCommand(`sheetZoom25`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(25)}}),e.updateCommand(`sheetZoomCustom`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{r().setZoomScale(e??100)}});let i=()=>(r().getFreezePanes().coords?.rowIndex??0)!==0,o=()=>(r().getFreezePanes().coords?.colIndex??0)!==0;e.updateCommand(`freezeToggle`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=n.getSelectedCell().getCoords();i()||o()?r().setFreezePanes(null):r().setFreezePanes({coords:e})}}),e.updateCommand(`freezeToggleHorizontal`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=n.getSelectedCell().getCoords();r().setFreezePanes({coords:{rowIndex:i()?0:e.rowIndex}})}}),e.updateCommand(`freezeToggleVertical`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=n.getSelectedCell().getCoords();r().setFreezePanes({coords:{colIndex:o()?0:e.colIndex}})}}),e.updateCommand(`unfreeze`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setFreezePanes(null)}});let s=()=>{let s=r(),c=s.getColumnHeaderStyle()===t.ISheetView.HeaderTextStyle.Zero&&s.getRowHeaderStyle()===t.ISheetView.HeaderTextStyle.Zero;e.updateCommand(`gridlinesToggle`,{state:s.isShowColumnGridlines()||s.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{state:s.isShowColumnGridlines()}),e.updateCommand(`sheetViewToggleGridlinesRows`,{state:s.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleShowHeadings`,{state:s.isShowColumnHeaders()||s.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{state:s.isShowColumnHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{state:s.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{state:c}),e.updateCommand(`sheetViewToggleFormulaView`,{state:s.isShowFormulas()}),e.updateCommand(`sheetViewToggleShowZeros`,{state:s.isShowZeros()}),e.updateCommand(`sheetViewFormatGridlinesColor`,{state:s.getGridLineColor()});let l=s.getZoomScale();e.updateCommand(`sheetZoom200`,{state:l===200}),e.updateCommand(`sheetZoom100`,{state:l===100}),e.updateCommand(`sheetZoom75`,{state:l===75}),e.updateCommand(`sheetZoom50`,{state:l===50}),e.updateCommand(`sheetZoom25`,{state:l===25}),e.updateCommand(`sheetZoomCustom`,{state:l});let u=n.getSelectedCell().getCoords();if(!u)return;let d=i(),f=o(),p=d||f;e.updateCommand(`freezeToggle`,{state:p,disabledReasons:p||u.rowIndex!==0||u.colIndex!==0?[]:[(0,a.messageKey)(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleHorizontal`,{state:d,disabledReasons:d||u.rowIndex!==0?[]:[(0,a.messageKey)(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleVertical`,{state:f,disabledReasons:f||u.colIndex!==0?[]:[(0,a.messageKey)(`reason.freezeOrigin`)]}),e.updateCommand(`unfreeze`,{disabledReasons:p?[]:[(0,a.messageKey)(`reason.noFreeze`)]})};s();let c=n.addListeners({onViewChange:s}),l=n.getSelection().addListeners({onChange:s});return()=>{c(),l()}}var mo=new t.Color(`transparent`);function ho(e){let t=e.getStyles();return{schemeLookup:t.schemeLookup(),recentColors:()=>t.recentColors(),addRecentColor:e=>t.addRecentColor(e),clearRecentColors:()=>t.clearRecentColors()}}function go(e,n,r){e.updateCommand(`dataRemoveDuplicates`,{callback:async e=>{let t=n.getSelectedRanges();t.getCount()>1?r?.showError(new a.ExpectedError((0,a.t)(`error.removeDuplicates.multipleRanges`))):t.at(0).removeDuplicates({autoSelect:!0,...e})}}),e.updateCommand(`dataTextToColumns`,{callback:async e=>{let t=n.getSelectedRanges();if(t.getCount()>1)return void r?.showError(new a.ExpectedError((0,a.t)(`error.textToColumns.multipleRanges`)));let i=typeof e==`string`?{delimiter:e}:e;t.at(0).textToColumns({autoSelect:!0,...i})}});let i=async(e,i,o,s)=>{let c=i,l=n.getSelectedRange(),u=n.getSelectedCell(),d=u.getCoords(),f,p=null;if(c){let e=c.getRange().getCoords();p=n.getTables().getItems({address:{colIndex:e.colStart,rowIndex:e.rowStart}})[0]??n.getAutoTable(),p&&!p.getRange().getIntersect(e)&&(p=null)}else if(p=n.getTables().getItems({address:n.getSelectedCell().getCoords()})[0]??n.getAutoTable(),p){let e=p.getRange();e.getIntersect(d)?c=p.getSortAt(d.colIndex-e.getCoords().colStart):p=null}if(c){let e=c,t=p;f=n=>{if(o&&t)return void t.sort({...n,description:s});let r={...n};delete r.sorts,e.setCriteria(r)},u=e.getRange().getCell(),l=t?t.getRange():e.getRange()}else{let r=n.getSelectedRanges();if(r.getCount()>1)throw new a.ExpectedError((0,a.t)(`error.sort.multipleRanges`));let i=r.at(0);i.size===1&&(i=i.getSurrounding()),l=i,f=n=>{i.doBatch(()=>{let r={...n,...e};i.sort(r),i.autoFit({axes:r?.axis===t.IRange.Axis.Column?t.IRange.AxisSelection.Column:t.IRange.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},s)}}let m=async e=>{if(!e)return;let t=await Promise.resolve(r?.showBusy?.((0,a.t)(s))??null);try{f(e)}catch(e){t?.(),r?.showError?.(e);return}t?.()},h=l.getDefaultSortCriteria(t.IRange.Axis.Row,u);if(!h){if(o)throw new a.ExpectedError((0,a.t)(`error.sort.invalidSelection`));return}if(!o)return void await m({...h.options,...e});let g=l,_=h.options;_.hasHeader&&(g=l.getIntersect(h.sortCoords)),g.select();let v={range:l,cell:u},y={initialValue:_,context:()=>v,onInput:e=>{e&&m(e)}};r?.showWindow?.(`sort`,y)};return e.updateCommand(`sortAscending`,{tags:[`noTransaction`],callback:e=>i({reverse:!1},e,!1,(0,a.messageKey)(`op.sortAscending`))}),e.updateCommand(`sortDescending`,{tags:[`noTransaction`],callback:e=>i({reverse:!0},e,!1,(0,a.messageKey)(`op.sortDescending`))}),e.updateCommand(`sortCustom`,{tags:[`noTransaction`],callback:e=>i({},e,!0,(0,a.messageKey)(`op.sortCustom`))}),()=>{}}function _o(e,t,n,r,i){let o=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null,s=(e,r=!1)=>{let i=o();if(i)return void i.updateStyleOptions(e);let s=t.getSelectedRanges().getFixed(!0),c=t.getSelectedRange().getDefaultSortCriteria(),l={getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0),table:()=>null,styles:()=>null},u={initialValue:{ranges:s,hasHeader:c?.options?.hasHeader??!1},context:()=>l,onInput:n=>{var i;(i=n??null)&&t.doBatch(async()=>{let n=i.ranges.at(0);r&&n.getStyle().clear(),await t.getTables().add(n,{hasHeader:i.hasHeader,properties:{style:e?.name}}).getRange().select()},{description:(0,a.messageKey)(`op.insertTable`)})}};n?.showWindow?.(`tableNew`,u)};e.updateCommand(`insertTable`,{tags:[`noTransaction`],callback:()=>s()});let c=()=>({styles:()=>t.getStyles(),table:()=>o(),getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)});e.updateCommand(`formatTableStyle`,{tags:[`noTransaction`],callback:e=>s(e),context:c}),e.updateCommand(`formatTableStyleClearCellStyles`,{tags:[`noTransaction`],callback:e=>s(e,!0),context:c}),e.updateCommand(`editTable`,{tags:[`noTransaction`,`noRepeat`],callback:async n=>{let i=null,a=!1;if(n?.isITable?i=n:n?.getValue?.()&&(i=n.getValue(),a=!0),!i){let e=t.getSelectedRange();e.size===1&&(e=e.getSurrounding()),i=o(),await e.select()}if(!i)return;let s=i;if(a)try{await s.select()}catch{}let c={styles:()=>t.getStyles(),table:()=>s,getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)};e.updateCommand(`editTable`,{context:()=>c}),r?.(`tableDetails`)}});let l=async(e,r)=>{let i=(e=>e?e.isITable?e:e.getValue?.()??null:o())(e);if(i){if(!r){let e=i.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4&&n?.showOptions&&await n.showOptions({title:(0,a.t)(`dialog.confirm.title`),description:(0,a.t)(`table.convertToRangeWarning`,{count:t}),options:[{id:`Convert`,label:()=>(0,a.t)(`table.convert`)},`Cancel`],defaultOption:`Convert`})!==`Convert`)return}await t.doBatch(()=>{r?i.delete():i.convertToRange()},{description:r?(0,a.messageKey)(`op.deleteTable`):(0,a.messageKey)(`op.convertTableToRange`)})}};e.updateCommand(`deleteTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>l(e,!0)}),e.updateCommand(`convertTableToRange`,{tags:[`noTransaction`,`noRepeat`],callback:e=>l(e,!1)}),e.updateCommand(`setDefaultTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().setDefaultTableStyle(e)}}),e.updateCommand(`deleteTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().getTableStyle(e)?.delete()}});let u=()=>{let n=o(),r=t.getTables().getItems({address:t.getSelectedRange()}),i=[...lo(!t.getProtection().isFormatCellsAllowed(),(0,a.messageKey)(`reason.sheetProtected`)),...lo(r.length>0&&!n,(0,a.messageKey)(`reason.tableAmbiguous`))];e.updateCommand(`formatTableStyle`,{params:{hasTable:!!n},disabledReasons:i}),e.updateCommand(`formatTableStyleClearCellStyles`,{disabledReasons:i}),e.updateCommand(`insertTable`,{disabledReasons:[...i,...lo(r.length>0,(0,a.messageKey)(`reason.alreadyTable`))]})};u();let d=()=>{e.updateCommand(`editTable`,{state:i?.getActive()===`tableDetails`})};d();let f=i?.addListener({onChange:d}),p=t.getSelection().addListeners({onChange:u}),m=t.addListeners({onTablesChange:u,onProtectionChange:u});return()=>{p(),m(),f?.()}}function vo(e,n){let r=n.sheet;if(!r)return()=>{};let i=n,o=i?.notifier;e.use(vr({transaction:r,notifier:o,manager:i?.manager})),e.updateCommand(`protectionSheetToggle`,{tags:[`noTransaction`,`noRepeat`],callback:async(e,t)=>{let n=r.getProtection(),i=null;try{if(n.isLocked()){let e=null;if(n.hasPassword()){let t=await o?.showInput({title:(0,a.t)(`dialog.password.title`),description:(0,a.t)(`dialog.password.description`),options:[{id:`Unprotect`,label:()=>(0,a.t)(`dialog.unprotect`)},`Cancel`],defaultOption:`Unprotect`,inputType:`password`});if(t?.option!==`Unprotect`)return;e=t.input}i=await Promise.resolve(o?.showBusy(t?.getLabel?.())??null),await n.unlock(e??void 0)}else i=await Promise.resolve(o?.showBusy(t?.getLabel?.())??null),await n.lock();i?.()}catch(e){i?.(),o?.showError(e)}}}),e.updateCommand(`manageDataValidation`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{i?.activateTaskPane?.(`dataValidationDetails`)}}),e.updateCommand(`manageConditionalFormat`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{i?.activateTaskPane?.(`conditionalFormatDetails`)}}),e.updateCommand(`conditionalFormatNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{i?.activateTaskPane?.(`conditionalFormatDetails`,{args:{insert:!0}})}});let c=e=>{r.getConditionalFormats().add(r.getSelectedRanges(),e)},l=e=>({tags:[`noTransaction`,`noRepeat`],callback:()=>{i?.activateTaskPane?.(`conditionalFormatDetails`,{args:{draft:{condition:e,style:structuredClone(Ka[0].style)}}})}}),u=t.ICondition.BuiltInOperatorNames,d=t.ICondition.BuiltInSelectorNames;e.updateCommand(`conditionalFormatGreaterThan`,l({selector:d.Number,operator:u.GreaterThan,param:10})),e.updateCommand(`conditionalFormatLessThan`,l({selector:d.Number,operator:u.LessThan,param:10})),e.updateCommand(`conditionalFormatBetween`,l({selector:d.Number,operator:u.Between,param:{from:10,to:20}})),e.updateCommand(`conditionalFormatEqualTo`,l({selector:d.Number,operator:u.EqualTo,param:10})),e.updateCommand(`conditionalFormatTextContains`,l({selector:d.Text,operator:u.TextContains,param:``})),e.updateCommand(`conditionalFormatDateOccurring`,l({operator:u.TimePeriod,param:{type:t.ICondition.TimePeriodType.Today}})),e.updateCommand(`conditionalFormatDuplicateValues`,l({operator:u.Not,param:{operator:u.Unique}})),e.updateCommand(`conditionalFormatTopItems`,l({operator:u.TopN,param:{top:!0,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatTopPercent`,l({operator:u.TopN,param:{top:!0,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatBottomItems`,l({operator:u.TopN,param:{top:!1,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatBottomPercent`,l({operator:u.TopN,param:{top:!1,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatAboveAverage`,l({operator:u.Average,param:{type:t.ICondition.AverageType.Above}})),e.updateCommand(`conditionalFormatBelowAverage`,l({operator:u.Average,param:{type:t.ICondition.AverageType.Below}})),e.updateCommand(`conditionalFormatDataBar`,{callback:e=>{c({scale:e?structuredClone(e):ao()})}}),e.updateCommand(`conditionalFormatColorScale`,{callback:e=>{c({scale:e?structuredClone(e):io()})}}),e.updateCommand(`conditionalFormatIconSet`,{callback:()=>{c({scale:so()})}}),e.updateCommand(`conditionalFormatClearSelection`,{callback:()=>{let e=r.getConditionalFormats(),t=new Set;for(let n of r.getSelectedRanges().getCoords())for(let r of e.getItems({address:n}))t.add(r);for(let e of t)e.delete()}}),e.updateCommand(`conditionalFormatClearSheet`,{callback:()=>{for(let e of r.getConditionalFormats().getItems())e.delete()}}),e.updateCommand(`manageProtectedRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{i?.activateTaskPane?.(`protectedRangeDetails`)}});let f=async e=>{let n=n=>{r.doBatch(()=>{let i=r.getSelectedRanges();i.merge({axes:e,discardMultipleValues:n}),e===t.IRange.AxisSelection.Both&&i.getStyle().update({alignment:{horizontal:t.ITextFrame.HorizontalAlignment.Center}})},{description:(0,a.messageKey)(`op.mergeCells`)})};try{n(!1)}catch(e){if(e?.type===`discardMultipleValues`&&o?.showOptions){if(await o.showOptions({title:(0,a.t)(`dialog.confirm.title`),description:(0,a.t)(`sheet.mergeCellsWarning`),options:[{id:`Merge`,label:()=>(0,a.t)(`sheet.merge`)},`Cancel`],defaultOption:`Merge`})!==`Merge`)return;try{n(!0)}catch(e){o?.showError?.(e)}}else o?.showError?.(e)}},p=()=>{r.doBatch(()=>{let e=r.getSelectedRanges();e.unmerge(),e.getStyle().update({alignment:{horizontal:null}})},{description:(0,a.messageKey)(`op.unmergeCells`)})};e.updateCommand(`mergeToggle`,{tags:[`noTransaction`],callback:()=>{a.CoordUtils.isSingleCell(r.getSelectedRange().getCoords())||(r.getSelectedRanges().getMerges().length===0?f(t.IRange.AxisSelection.Both):p())}}),e.updateCommand(`mergeHorizontal`,{tags:[`noTransaction`],callback:()=>{f(t.IRange.AxisSelection.Column)}}),e.updateCommand(`mergeVertical`,{tags:[`noTransaction`],callback:()=>{f(t.IRange.AxisSelection.Row)}}),e.updateCommand(`unmerge`,{tags:[`noTransaction`],callback:()=>p()});let m=e.getKeysByTag(`mutator`),h=()=>{let n=r.getProtection(),o=n.isLocked(),s=!n.isFormatCellsAllowed(),c=lo(s,(0,a.messageKey)(`reason.sheetProtected`));e.updateCommand(`protectionSheetToggle`,{state:o,params:{locked:o}});let l=r.getSelectedRanges(),u=r.getSelectedRange(),d=l.getCoords(),f=l.getMerges().length>0,p=l.isOverlapping(),h=!0;for(let e=0;h&&e<d.length;e++)h=a.CoordUtils.isSingleCell(d[e]);let g=d.length===1&&d[0].colStart===d[0].colEnd,_=!(r.getTables().getItems({address:u}).length>0)&&!p&&(f||!h),v=!1,y=!1,b=!1,x=!1;s||(v=l.isEntireColumnsAny(),y=v&&!l.isEntireColumns(),b=l.isEntireRowsAny(),x=b&&!l.isEntireRows());for(let t of m)uo.has(t)||fo.has(t)||e.updateCommand(t,{disabledReasons:c});let S=r.getSelectedCell().getStyle().getAlignment().getHorizontal(),C=S===t.ITextFrame.HorizontalAlignment.CenterContinuous||S===t.ITextFrame.HorizontalAlignment.Fill;for(let t of uo)e.updateCommand(t,{disabledReasons:[...c,...lo(C,(0,a.messageKey)(`reason.continuousSpan`))]});e.updateCommand(`dataTextToColumns`,{disabledReasons:[...c,...lo(!g,(0,a.messageKey)(`reason.singleColumn`)),...lo(o,(0,a.messageKey)(`reason.sheetLocked`))]});let w=[...c,...lo(l.getCount()!==1,(0,a.messageKey)(`reason.sortRange`))];e.updateCommand(`sortAscending`,{disabledReasons:w}),e.updateCommand(`sortDescending`,{disabledReasons:w});let T=lo(!_,(0,a.messageKey)(`reason.mergeUnavailable`));e.updateCommand(`mergeToggle`,{state:f,disabledReasons:[...c,...T]}),e.updateCommand(`mergeHorizontal`,{disabledReasons:[...c,...T]}),e.updateCommand(`mergeVertical`,{disabledReasons:[...c,...T]}),e.updateCommand(`unmerge`,{disabledReasons:[...c,...lo(!f,(0,a.messageKey)(`reason.noMerge`)),...T]});let E=lo(p,(0,a.messageKey)(`reason.overlap`)),D=[...c,...lo(b,(0,a.messageKey)(`reason.entireColumn`)),...E,...lo(y,(0,a.messageKey)(`reason.mixedSelection`))],O=[...c,...lo(v,(0,a.messageKey)(`reason.entireRow`)),...E,...lo(x,(0,a.messageKey)(`reason.mixedSelection`))];e.updateCommand(`insertCellsShiftDown`,{disabledReasons:D}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:D}),e.updateCommand(`insertCellsShiftRight`,{disabledReasons:O}),e.updateCommand(`deleteCellsShiftLeft`,{disabledReasons:O});let k=[...c,...lo(b,(0,a.messageKey)(`reason.entireRow`)),...E,...lo(y,(0,a.messageKey)(`reason.mixedSelection`))],A=[...c,...lo(v,(0,a.messageKey)(`reason.entireColumn`)),...E,...lo(x,(0,a.messageKey)(`reason.mixedSelection`))];for(let t of[`insertRows`,`insertRowsAfter`,`deleteRows`])e.updateCommand(t,{disabledReasons:k});for(let t of[`insertColumns`,`insertColumnsAfter`,`deleteColumns`])e.updateCommand(t,{disabledReasons:A});let j=i?.editModeHandler?.getMode()?.key,M=j===`copy`?`copy`:j===`cut`?`cut`:`none`,N=p?1:l.getRowCount(),P=p?1:l.getColumnCount(),F=l.getDefaultShiftAxis()===t.IRange.Axis.Column,I=v&&!y,L=b&&!x,R=I?`rows`:L?`columns`:`none`,z=L?P:N;e.updateCommand(`insertCells`,{params:{mode:M,shift:F?`right`:`down`,span:R,count:z}}),e.updateCommand(`deleteCells`,{params:{shift:F?`left`:`up`,span:R,count:z}}),e.updateCommand(`insertCellsShiftDown`,{params:{mode:M,span:I?`rows`:`none`,count:N}}),e.updateCommand(`deleteCellsShiftUp`,{params:{span:I?`rows`:`none`,count:N}}),e.updateCommand(`insertCellsShiftRight`,{params:{mode:M,span:L?`columns`:`none`,count:P}}),e.updateCommand(`deleteCellsShiftLeft`,{params:{span:L?`columns`:`none`,count:P}});for(let t of[`insertRows`,`insertRowsAfter`])e.updateCommand(t,{params:{mode:M,count:N}});for(let t of[`insertColumns`,`insertColumnsAfter`])e.updateCommand(t,{params:{mode:M,count:P}});e.updateCommand(`deleteRows`,{params:{count:N}}),e.updateCommand(`deleteColumns`,{params:{count:P}}),e.updateCommand(`hideRows`,{params:{count:l.getRowCount()}}),e.updateCommand(`hideColumns`,{params:{count:l.getColumnCount()}})};h();let g=r.addListeners({onProtectionChange:h,onStyleChange:h,onInvalidated:h,onClose:()=>e.remove()}),_=r.getSelection().addListeners({onChange:h}),v=po(e,r),y=function(e,n,r,i){let o=(e,t=!1,r)=>{let i=r??{autoSelect:!0,autoFit:!0},a=n.getSelectedRanges();t&&a.getStyle().update(null,i),a.getStyle().update(e,i)},s=()=>n.getSelectedCell().getStyle().getFont(),c=()=>n.getSelectedCell().getStyle().getAlignment(),l=()=>{let e=s().getWeight();return!isNaN(e)&&e>500};e.updateCommand(`formatBoldToggle`,{callback:()=>{o({font:{weight:l()?400:700}})}}),e.updateCommand(`formatItalicToggle`,{callback:()=>{o({font:{style:s().getStyle()===t.IFont.Style.Italic?t.IFont.Style.Normal:t.IFont.Style.Italic}})}}),e.updateCommand(`formatStrikeThroughToggle`,{callback:()=>{o({font:{strike:!s().getStrike()}})}});let u=(n,r)=>{e.updateCommand(n,{callback:()=>{o({font:{underline:s().getUnderline()===r?t.IFont.UnderlineStyle.None:r}})}})};u(`formatUnderlinedToggle`,t.IFont.UnderlineStyle.Single),u(`formatUnderlinedDoubleToggle`,t.IFont.UnderlineStyle.Double),u(`formatUnderlinedAccountingToggle`,t.IFont.UnderlineStyle.SingleAccounting),u(`formatUnderlinedAccountingDoubleToggle`,t.IFont.UnderlineStyle.DoubleAccounting);let d=(n,r)=>{e.updateCommand(n,{callback:()=>{o({font:{verticalAlign:s().getVerticalAlignment()===r?t.IFont.VerticalAlignment.Baseline:r}})}})};d(`formatSuperscriptToggle`,t.IFont.VerticalAlignment.Super),d(`formatSubscriptToggle`,t.IFont.VerticalAlignment.Sub);let f=(n,r)=>{e.updateCommand(n,{callback:()=>{o({alignment:{overflow:c().getOverflow()===r?t.ITextFrame.Overflow.Visible:r}})}})};f(`formatTextOverflowVisibleToggle`,t.ITextFrame.Overflow.Visible),f(`formatTextOverflowWrapToggle`,t.ITextFrame.Overflow.Wrap),f(`formatTextOverflowClipToggle`,t.ITextFrame.Overflow.Clip),f(`formatTextOverflowShrinkToggle`,t.ITextFrame.Overflow.Shrink),e.updateCommand(`formatTextOverflowEllipsisToggle`,{callback:()=>{o({alignment:{overflow:c().getOverflow()===t.ITextFrame.Overflow.Ellipsis?t.ITextFrame.Overflow.Visible:t.ITextFrame.Overflow.Ellipsis}})},disabledReasons:[(0,a.messageKey)(`reason.notImplemented`)]});let p=(n,r)=>{e.updateCommand(n,{callback:()=>{o({alignment:{vertical:c().getVertical()===r?t.ITextFrame.VerticalAlignment.Bottom:r}})}})};p(`formatAlignTopToggle`,t.ITextFrame.VerticalAlignment.Top),p(`formatAlignMiddleToggle`,t.ITextFrame.VerticalAlignment.Center),p(`formatAlignBottomToggle`,t.ITextFrame.VerticalAlignment.Bottom),p(`formatAlignJustifyVerticalToggle`,t.ITextFrame.VerticalAlignment.Justify),p(`formatAlignDistributedVerticalToggle`,t.ITextFrame.VerticalAlignment.Distributed);let m=(n,r,i=!1)=>{e.updateCommand(n,{callback:()=>{let e=c().getHorizontal()===r?t.ITextFrame.HorizontalAlignment.General:r;o({alignment:i?{horizontal:e,rotation:null}:{horizontal:e}})}})};m(`formatAlignLeftToggle`,t.ITextFrame.HorizontalAlignment.Left),m(`formatAlignCenterToggle`,t.ITextFrame.HorizontalAlignment.Center),m(`formatAlignCenterContinuousToggle`,t.ITextFrame.HorizontalAlignment.CenterContinuous,!0),m(`formatAlignFillToggle`,t.ITextFrame.HorizontalAlignment.Fill,!0),m(`formatAlignDistributedHorizontalToggle`,t.ITextFrame.HorizontalAlignment.Distributed),m(`formatAlignRightToggle`,t.ITextFrame.HorizontalAlignment.Right),m(`formatAlignJustifyToggle`,t.ITextFrame.HorizontalAlignment.Justify),e.updateCommand(`formatBorder`,{callback:e=>{o({border:e})}}),e.updateCommand(`formatFillColor`,{callback:e=>{o({fill:e})}}),e.updateCommand(`formatFontColor`,{callback:e=>{o({font:{color:e}})}}),e.updateCommand(`formatFillColor`,{context:()=>({...ho(n),autoColor:mo,quickColor:i?.getLastFillColor?.()??void 0,onColorSelect:e=>i?.setLastFillColor?.(e??mo)})}),e.updateCommand(`formatFontColor`,{context:()=>({...ho(n),autoColor:n.getStyles().getNormal().getFont().getColor(),quickColor:i?.getLastFontColor?.()??void 0,onColorSelect:e=>i?.setLastFontColor?.(e)})}),e.updateCommand(`formatBorder`,{context:()=>{let e=n.getStyles();return{autoColor:e.getNormal().getFont().getColor(),autoStyle:t.IBorder.StrokeStyle.Thin,schemeLookup:e.schemeLookup(),quickBorder:i?.getLastBorder?.()??void 0,createBorder:t=>e.getNormal().createStyle({border:t}).getBorder(),onBorderSelect:e=>i?.setLastBorder?.(e)}}}),e.updateCommand(`formatFontFamily`,{callback:e=>{o({font:{family:e}})}}),e.updateCommand(`formatFontSize`,{callback:e=>{o({font:{size:e}})}}),e.updateCommand(`formatFontSizeIncrease`,{callback:()=>{o(e=>({font:{size:t.FontUtils.findNextFontSize(e.getFont().getSize(),!0)}}))}}),e.updateCommand(`formatFontSizeDecrease`,{callback:()=>{o(e=>({font:{size:t.FontUtils.findNextFontSize(e.getFont().getSize(),!1)}}))}}),e.updateCommand(`formatNumberFormat`,{callback:e=>{o({numberFormat:e})}}),e.updateCommand(`formatNumberFormatGeneralStyle`,{callback:()=>{o({numberFormat:t.NumberFormat.Type.General})}}),e.updateCommand(`formatNumberFormatNumberStyle`,{callback:()=>{o({numberFormat:`#,##0.00`})}}),e.updateCommand(`formatNumberFormatTimeStyle`,{callback:()=>{o({numberFormat:`h:mm AM/PM`})}}),e.updateCommand(`formatNumberFormatDateStyle`,{callback:()=>{o({numberFormat:`d-mmm-yy`})}}),e.updateCommand(`formatNumberFormatAccountingStyle`,{callback:e=>{o(e?{numberFormat:e}:{named:t.IStyle.BuiltInName.Currency})}}),e.updateCommand(`formatNumberFormatPercentStyle`,{callback:()=>{o({named:t.IStyle.BuiltInName.Percent})}}),e.updateCommand(`formatNumberFormatScientificStyle`,{callback:()=>{o({numberFormat:`0.00E+00`})}}),e.updateCommand(`formatNumberFormatCommaStyle`,{callback:()=>{o({named:t.IStyle.BuiltInName.Comma})}}),e.updateCommand(`formatNumberFormatIncreaseDecimal`,{callback:()=>{o(e=>({numberFormat:t.NumberFormat.Parser.adjustDecimalPlaces(e.getNumberFormat(),1)}))}}),e.updateCommand(`formatNumberFormatDecreaseDecimal`,{callback:()=>{o(e=>({numberFormat:t.NumberFormat.Parser.adjustDecimalPlaces(e.getNumberFormat(),-1)}))}});let h={style:t.IBorder.StrokeStyle.Thin,color:null};e.updateCommand(`formatBorderAddOutline`,{callback:()=>{o({border:{left:h,top:h,right:h,bottom:h}})}}),e.updateCommand(`formatBorderClearOutline`,{callback:()=>{o({border:null})}}),e.updateCommand(`formatIndentDecrease`,{callback:()=>{o(e=>{let t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}})}}),e.updateCommand(`formatIndentIncrease`,{callback:()=>{o(e=>{let n={alignment:{indent:e.getAlignment().getIndent()+1}};return e.getAlignment().getHorizontal()===t.ITextFrame.HorizontalAlignment.General&&(n.alignment.horizontal=t.ITextFrame.HorizontalAlignment.Left),n})}}),e.updateCommand(`formatCellStyle`,{callback:e=>{n.getSelectedRanges().getStyle().setNamed(e,{autoSelect:!0,autoFit:!0})},context:()=>({styles:()=>n.getStyles(),named:()=>n.getSelectedCell().getStyle().getNamed(),createCell:e=>n.createCell(e)})});let g=e=>{o({alignment:{rotation:e}})};e.updateCommand(`formatTextRotate0`,{callback:()=>g(0)}),e.updateCommand(`formatTextRotate45`,{callback:()=>g(45)}),e.updateCommand(`formatTextRotate90`,{callback:()=>g(90)}),e.updateCommand(`formatTextRotate270`,{callback:()=>g(270)}),e.updateCommand(`formatTextRotate315`,{callback:()=>g(315)}),e.updateCommand(`formatTextRotateCustom`,{callback:e=>g(e??0)}),e.updateCommand(`formatNumberDialog`,{tags:[`noTransaction`],callback:()=>{let e={initialValue:n.getSelectedCell().getStyle().getNumberFormat(),context:()=>n.getSelectedCell(),onInput:e=>{n.doBatch(()=>{n.getSelectedRanges().getStyle().update({numberFormat:e},{autoSelect:!0,autoFit:!0})},{description:(0,a.messageKey)(`op.numberFormat`)})}};r?.showWindow?.(`numberFormat`,e)}}),e.updateCommand(`formatSheetTabColor`,{callback:e=>{n.setTabColor(e)},state:n.getTabColor()??mo,context:()=>({...ho(n),autoColor:mo,onColorSelect:()=>{}})});let _=()=>{let r=s(),i=r.getUnderline(),a=r.getVerticalAlignment();e.updateCommand(`formatBoldToggle`,{state:l()}),e.updateCommand(`formatItalicToggle`,{state:r.getStyle()===t.IFont.Style.Italic}),e.updateCommand(`formatStrikeThroughToggle`,{state:r.getStrike()}),e.updateCommand(`formatUnderlinedToggle`,{state:i===t.IFont.UnderlineStyle.Single}),e.updateCommand(`formatUnderlinedDoubleToggle`,{state:i===t.IFont.UnderlineStyle.Double}),e.updateCommand(`formatUnderlinedAccountingToggle`,{state:i===t.IFont.UnderlineStyle.SingleAccounting}),e.updateCommand(`formatUnderlinedAccountingDoubleToggle`,{state:i===t.IFont.UnderlineStyle.DoubleAccounting}),e.updateCommand(`formatSuperscriptToggle`,{state:a===t.IFont.VerticalAlignment.Super}),e.updateCommand(`formatSubscriptToggle`,{state:a===t.IFont.VerticalAlignment.Sub}),e.updateCommand(`formatFontFamily`,{state:r.getFamily()}),e.updateCommand(`formatFontSize`,{state:r.getSize()});let o=n.getSelectedCell().getStyle().getNumberFormat();e.updateCommand(`formatNumberFormat`,{state:o,context:()=>n.getSelectedCell()}),e.updateCommand(`formatNumberDialog`,{state:o,context:()=>n.getSelectedCell()});let u=n.getSelectedCell().getStyle().getFill(),d=null;u?.getType()===t.IFill.Type.Solid?d=u.getColor():u?.getType()===t.IFill.Type.Gradient?d=u.getStops()?.[0]?.getColor()??null:u?.getType()===t.IFill.Type.Pattern&&(d=u.getBackground()),e.updateCommand(`formatFillColor`,{state:d}),e.updateCommand(`formatFontColor`,{state:r.toJSON()?.color?r.getColor():null});let f=c(),p=f.getOverflow();e.updateCommand(`formatTextOverflowVisibleToggle`,{state:p===t.ITextFrame.Overflow.Visible}),e.updateCommand(`formatTextOverflowWrapToggle`,{state:p===t.ITextFrame.Overflow.Wrap}),e.updateCommand(`formatTextOverflowClipToggle`,{state:p===t.ITextFrame.Overflow.Clip}),e.updateCommand(`formatTextOverflowShrinkToggle`,{state:p===t.ITextFrame.Overflow.Shrink}),e.updateCommand(`formatTextOverflowEllipsisToggle`,{state:p===t.ITextFrame.Overflow.Ellipsis});let m=f.getVertical();e.updateCommand(`formatAlignTopToggle`,{state:m===t.ITextFrame.VerticalAlignment.Top}),e.updateCommand(`formatAlignMiddleToggle`,{state:m===t.ITextFrame.VerticalAlignment.Center}),e.updateCommand(`formatAlignBottomToggle`,{state:m===t.ITextFrame.VerticalAlignment.Bottom}),e.updateCommand(`formatAlignJustifyVerticalToggle`,{state:m===t.ITextFrame.VerticalAlignment.Justify}),e.updateCommand(`formatAlignDistributedVerticalToggle`,{state:m===t.ITextFrame.VerticalAlignment.Distributed});let h=f.getHorizontal();e.updateCommand(`formatAlignLeftToggle`,{state:h===t.ITextFrame.HorizontalAlignment.Left}),e.updateCommand(`formatAlignCenterToggle`,{state:h===t.ITextFrame.HorizontalAlignment.Center}),e.updateCommand(`formatAlignCenterContinuousToggle`,{state:h===t.ITextFrame.HorizontalAlignment.CenterContinuous}),e.updateCommand(`formatAlignFillToggle`,{state:h===t.ITextFrame.HorizontalAlignment.Fill}),e.updateCommand(`formatAlignDistributedHorizontalToggle`,{state:h===t.ITextFrame.HorizontalAlignment.Distributed}),e.updateCommand(`formatAlignRightToggle`,{state:h===t.ITextFrame.HorizontalAlignment.Right}),e.updateCommand(`formatAlignJustifyToggle`,{state:h===t.ITextFrame.HorizontalAlignment.Justify});let g=f.getRotation();e.updateCommand(`formatTextRotate0`,{state:g===0}),e.updateCommand(`formatTextRotate45`,{state:g===45}),e.updateCommand(`formatTextRotate90`,{state:g===90}),e.updateCommand(`formatTextRotate270`,{state:g===270}),e.updateCommand(`formatTextRotate315`,{state:g===315}),e.updateCommand(`formatTextRotateCustom`,{state:g??0})};_();let v=n.addListeners({onStyleChange:_}),y=n.getSelection().addListeners({onChange:_});return()=>{v(),y()}}(e,r,o,i?.pickerMemory),b=function(e,n){let r=e=>{n.getSelectedRanges().clear(e)};return e.updateCommand(`clearContents`,{callback:()=>{r(t.ICell.Content.Values)}}),e.updateCommand(`clearFormats`,{callback:()=>{r(t.ICell.Content.Formats)}}),e.updateCommand(`clearHyperlinks`,{callback:()=>{r(t.ICell.Content.Hyperlinks)}}),e.updateCommand(`clearComments`,{callback:()=>{r(t.ICell.Content.Comments)}}),e.updateCommand(`clearAll`,{callback:()=>{r()}}),e.updateCommand(`deleteHyperlink`,{callback:()=>{n.getSelectedRange().setHyperlink(null)}}),e.updateCommand(`deleteComments`,{callback:()=>{n.getSelectedRange().setComments(null)}}),()=>{}}(e,r),x=function(e,t){let n=(e,n)=>{t.getSelection().selectRegion({contentOnly:e,entireRegion:n})};return e.updateCommand(`selectAll`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{n(!1,e??!1)}}),e.updateCommand(`selectRegion`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{n(!0,!1)}}),e.updateCommand(`selectComments`,{tags:[`noTransaction`,`noRepeat`],disabledReasons:[(0,a.messageKey)(`reason.notImplemented`)],callback:()=>{}}),e.updateCommand(`clearHiddenSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{t.getSelection().clearHidden()}}),()=>{}}(e,r),S=function(e,t){let n=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null;e.updateCommand(`tableFilterToggle`,{callback:()=>{let e=n();if(e)return void e.setHiddenButtons(!e.isHiddenButtons());let r=t.getAutoTable();r?r.delete():t.addAutoTable()}});let r=()=>{let r=n()??t.getAutoTable(),i=t.getProtection(),o=!i.isAutoTableAllowed()||!i.isSortAllowed();e.updateCommand(`tableFilterToggle`,{state:!!r&&!r.isHiddenButtons(),disabledReasons:lo(o,(0,a.messageKey)(`reason.sheetProtected`))})};r();let i=t.getSelection().addListeners({onChange:r}),o=t.addListeners({onTablesChange:r,onProtectionChange:r});return()=>{i(),o()}}(e,r),C=function(e,n,r){let i=()=>n.getSelectedRanges();e.updateCommand(`hideRows`,{callback:()=>{i().getRowHeaders().setHidden(!0)}}),e.updateCommand(`hideColumns`,{callback:()=>{i().getColumnHeaders().setHidden(!0)}}),e.updateCommand(`unhideRows`,{callback:()=>{i().getRowHeaders().setHidden(!1)}}),e.updateCommand(`unhideColumns`,{callback:()=>{i().getColumnHeaders().setHidden(!1)}}),e.updateCommand(`autoFitRows`,{callback:()=>{i().autoFit({axes:t.IRange.AxisSelection.Row})}}),e.updateCommand(`autoFitColumns`,{callback:()=>{i().autoFit({axes:t.IRange.AxisSelection.Column})}});let o=(e,o)=>{let s=e===t.IRange.Axis.Row,c=s?(0,a.messageKey)(`op.resizeRows`):(0,a.messageKey)(`op.resizeColumns`),l={initialValue:{size:o,unit:`Px`},context:()=>({getAxis:()=>e,getUnitText:()=>`Pt`}),onInput:(e,r)=>{if(r===`Autofit`)return void n.doBatch(()=>i().autoFit({axes:s?t.IRange.AxisSelection.Row:t.IRange.AxisSelection.Column}),{description:(0,a.messageKey)(`op.autofit`),autoSelect:!0});if(!e)return;let o=s?i().getRowHeaders():i().getColumnHeaders();n.doBatch(()=>o.setSize(e.size+e.unit),{description:c,autoSelect:!0})}};r?.showWindow(`resizeHeader`,l)};return e.updateCommand(`resizeRows`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(t.IRange.Axis.Row,20)}),e.updateCommand(`resizeColumns`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(t.IRange.Axis.Column,100)}),()=>{}}(e,r,o),w=function(e,n){let r=(e,r)=>{let i=n.getSelectedRanges();i.doBatch(()=>{let r=e===t.IRange.Direction.Up||e===t.IRange.Direction.Down,o=i.getCoords().slice().sort(a.CoordUtils.createRangeComparator(r?t.IRange.Axis.Row:t.IRange.Axis.Column));for(let r of o){let i=r,a=n.getRange(i).getMerges(),o=0,s=0;a.length>0&&(o=a[0].rowEnd-a[0].rowStart,s=a[0].colEnd-a[0].colStart),e===t.IRange.Direction.Left?i={...r,colStart:r.colEnd+s}:e===t.IRange.Direction.Right?i={...r,colEnd:r.colStart+s}:e===t.IRange.Direction.Up?i={...r,rowStart:r.rowEnd+o}:e===t.IRange.Direction.Down&&(i={...r,rowEnd:r.rowStart+o}),n.getRange(i).autoFill(r,{filler:t.AutoFill.Types.Copy}),n.getRange(r).autoFit({axes:t.IRange.AxisSelection.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:r})};return e.updateCommand(`fillDown`,{callback:()=>r(t.IRange.Direction.Down,`Fill Down`)}),e.updateCommand(`fillRight`,{callback:()=>r(t.IRange.Direction.Right,`Fill Right`)}),e.updateCommand(`fillUp`,{callback:()=>r(t.IRange.Direction.Up,`Fill Up`)}),e.updateCommand(`fillLeft`,{callback:()=>r(t.IRange.Direction.Left,`Fill Left`)}),()=>{}}(e,r),T=function(e,n,r,i){let a=async(e,a=!1,o=!1)=>{let s=n.getSelectedRanges();a&&(e===t.IRange.Axis.Row?s=s.getEntireRows(o):e===t.IRange.Axis.Column&&(s=s.getEntireColumns(o)));let c=null,l=r?.getMode()?.key;if((l===`copy`||l===`cut`)&&i){let e=await i.getClipboard().readReference();e&&e.getItemType()===`range`&&(c=e.getItem?.()??null,c?.getCoords?.()||(c=null))}if(c){let n=await s.insertFrom(c,{...c.getMarkOptions(),axis:e,autoSelect:!0});!n||n.isEntireRows()||n.isEntireColumns()||n.autoFit({axes:t.IRange.AxisSelection.Row,minContent:!0}),r?.setMode(null)}else s.insert({axis:e,autoSelect:!0})},o=(e,r=!1)=>{let i=n.getSelectedRanges();r&&(e===t.IRange.Axis.Row?i=i.getEntireRows():e===t.IRange.Axis.Column&&(i=i.getEntireColumns())),i.delete(e)};return e.updateCommand(`insertCells`,{callback:()=>a()}),e.updateCommand(`insertCellsShiftRight`,{callback:()=>a(t.IRange.Axis.Column)}),e.updateCommand(`insertCellsShiftDown`,{callback:()=>a(t.IRange.Axis.Row)}),e.updateCommand(`insertRows`,{callback:()=>a(t.IRange.Axis.Row,!0)}),e.updateCommand(`insertColumns`,{callback:()=>a(t.IRange.Axis.Column,!0)}),e.updateCommand(`insertRowsAfter`,{callback:()=>a(t.IRange.Axis.Row,!0,!0)}),e.updateCommand(`insertColumnsAfter`,{callback:()=>a(t.IRange.Axis.Column,!0,!0)}),e.updateCommand(`deleteCells`,{callback:()=>o()}),e.updateCommand(`deleteCellsShiftUp`,{callback:()=>o(t.IRange.Axis.Row)}),e.updateCommand(`deleteCellsShiftLeft`,{callback:()=>o(t.IRange.Axis.Column)}),e.updateCommand(`deleteRows`,{callback:()=>o(t.IRange.Axis.Row,!0)}),e.updateCommand(`deleteColumns`,{callback:()=>o(t.IRange.Axis.Column,!0)}),()=>{}}(e,r,i?.editModeHandler,i?.globalClipboard),E=go(e,r,o),D=function(e,t,n){return e.updateCommand(`updateHyperlink`,{tags:[`noTransaction`],callback:()=>{n?.showWindow?.(`hyperlink`,{context:()=>t.getSelectedCell(),onInput:e=>{t.doBatch(()=>{t.getSelectedRange().setHyperlink(e)},{description:(0,a.messageKey)(`op.updateHyperlink`)})}})}}),e.updateCommand(`openHyperlink`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getSelectedCell().getHyperlink();if(e)try{await e.open()}catch(e){n?.showError?.(e)}}}),e.updateCommand(`updateComments`,{tags:[`noTransaction`],callback:()=>{n?.showWindow?.(`comments`,{context:()=>t.getSelectedCell(),onInput:e=>{t.doBatch(()=>{t.getSelectedRange().setComments(e)},{description:(0,a.messageKey)(`op.updateComment`)})}})}}),()=>{}}(e,r,o),O=function(e,t,n,r){let i=async(e,i,o=(0,a.messageKey)(`op.insertImage`))=>{let c=await Promise.resolve(n?.showBusy?.(o)??null);try{await t.getMovables().addPicture(e,{autoSelect:!0,...i}),c?.(),r?.setMode(null)}catch(e){c?.();let t=e;typeof t!=`string`&&(console.warn(e),t=(0,a.t)(`error.insertImage.unresolved`)),n?.showMessage?.(t,{type:s.NotifierType.Error})}};return e.updateCommand(`insertImageFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=null,n=null;if(typeof e==`string`?n=e:t=e?.file?e.file:e??null,!t&&(t=await a.DOMUtils.openFileDialog(n??`image/*`),!t))return;let r=await Promise.resolve(t);await i({source:{file:r}},e?.options)}}),e.updateCommand(`insertImageFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{if(!e){let t=await n?.showInput?.({title:(0,a.t)(`dialog.insertImage.title`),description:(0,a.t)(`dialog.insertImage.description`),inputLabel:(0,a.t)(`dialog.insertImage.inputLabel`),initialValue:`https://picsum.photos/360`,propsInput:{style:{minWidth:`440px`}},options:[{id:`Insert`,label:()=>(0,a.t)(`dialog.insert`)}]});if(!t||t.option!==`Insert`)return;e=t.input}e&&await i({source:{fetch:e}})}}),()=>{}}(e,r,o,i?.editModeHandler),k=_o(e,r,o,i?.activateTaskPane,i?.taskPaneArea);return()=>{g(),_(),v(),y(),b(),x(),S(),C(),w(),T(),E(),D(),O(),k()}}var{CommandScopeProvider:yo}=s.Command;Br();var bo={dynamic:(e,t)=>{let n=vo(e,t),r=t.editable&&t.sheet?Tt(e,{editable:t.editable,sheet:t.sheet,flavor:`startEdit`}):void 0;return()=>{n(),r?.()}}},xo=({sheet:e,editable:t,scopeRef:n,elementRef:r,children:a})=>s.Command.useCommandScope()?(0,i.jsx)(So,{sheet:e,editable:t,scopeRef:n,elementRef:r,children:a}):(0,i.jsx)(i.Fragment,{children:a}),So=({sheet:e,editable:n,scopeRef:a,elementRef:o,children:c})=>{let l=(0,s.useNotifier)(),u=Qn(),d=(0,s.useEditMode)(),f=(0,s.useGlobalClipboard)(),p=gr(),m=(0,r.useMemo)(()=>({serializer:{parse:t=>t?e?.getStyles().parseColor(t)??null:null,stringify:e=>e?e.toString():``}}),[e]),[h,g]=(0,s.usePersistenceState)(`sheet.lastFillColor`,e?.getStyles().parseColor(t.IColor.Scheme.Bg2),m),[_,v]=(0,s.usePersistenceState)(`sheet.lastFontColor`,e?.getStyles().parseColor(e?.getStyles().getNormal().getFont().getColor()),m),[y,b]=(0,s.usePersistenceState)(`sheet.lastBorder`,null),x=(0,r.useRef)(h);x.current=h;let S=(0,r.useRef)(_);S.current=_;let C=(0,r.useRef)(y);C.current=y;let w=(0,r.useMemo)(()=>({getLastFillColor:()=>x.current,setLastFillColor:g,getLastFontColor:()=>S.current,setLastFontColor:v,getLastBorder:()=>C.current,setLastBorder:b}),[g,v,b]),T=(0,r.useMemo)(()=>({scopeName:`sheet`,contributor:bo,data:{sheet:e,editable:n,notifier:l,manager:p??void 0,activateTaskPane:(e,t)=>u.activate(e,t),taskPaneArea:u,editModeHandler:d,globalClipboard:f,pickerMemory:w}}),[e,n,l,p,u,d,f,w]);return(0,i.jsx)(yo,{spec:T,scopeRef:a,elementRef:o,children:c})};So.displayName=`SheetCommandProviderInner`;var Co=`_sheetxl-sheet_3nny_5`,wo=`_viewport-overlay_3nny_6`,To=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{sheet:c,className:u,style:d=s.ReactUtils.EmptyCssProperties,ref:f,colorScheme:p,gridColorScheme:m,onSheetContextMenu:g,showColumnHeaders:_,propsColumnHeader:v,showRowHeaders:y,propsRowHeader:b,showScrollbars:x=!0,showCellErrors:S=!0,propsScrollPane:C,viewport:w,onViewportChange:T,layers:E,renderMovable:D,viewportComponent:O,onFirstRender:k,editable:A,onFocus:j,onBlur:M,onShowTooltip:N,onCloseTooltip:F,propsGrid:I,propsCellRender:L,...R}=e;if((0,r.useEffect)(()=>{t.LicenseManager._validate(!0)},[]),!c)throw Error(`ISheet must be provided.`);let[z,B]=(0,r.useReducer)(e=>e+1,0),[,V]=(0,r.useReducer)(e=>e+1,0),H=(0,r.useRef)(null),U=(0,s.useCallbackRef)(N,[N]),W=(0,s.useCallbackRef)(F,[F]),G=(0,r.useRef)(null),K=(0,r.useRef)(null);(0,r.useMemo)(()=>{K.current!==c&&(G.current=c?c.getId():null),K.current=c},[c]);let q=Ba(m)===`dark`,te=Va();ka();let J=(0,r.useId)(),Y=(0,r.useMemo)(()=>(0,s.createThemeScopeClass)(`sheet`,J),[J]),ne=(0,r.useMemo)(()=>(0,o.buildGridThemeCSS)({scope:`.${Y}`}),[Y]),X=(0,r.useMemo)(()=>Pa(`sxl-defaults`,`.${Y}`),[Y]),Z=c.getStyles(),ie=Z.getTheme(),ae=Z.getDefaultFontSize(),oe=(0,r.useMemo)(()=>Ra(ie,ae,`sxl-defaults`,`.${Y}`),[ie,ae,Y]),se=(0,s.useEditMode)(),ce=(0,r.useCallback)(e=>{},[]),[le,ue]=(0,r.useState)(null),Q=(0,r.useRef)(null),de=(0,r.useCallback)(e=>{e&&(ue(e),Q.current=e)},[]),[$,fe]=(0,r.useState)(()=>c?.getView()),pe=($?.getZoomScale()??100)/100,me=_??$?.isShowColumnHeaders(),he=y??$?.isShowRowHeaders(),[ge,_e]=(0,r.useState)({width:0,height:0}),ve=ge.width,ye=ge.height,be=(0,r.useMemo)(()=>{let e=jo,n=Ao,r=c?.getStyles().getNormal().getFont();if(ge.width>0&&ge.height>0){let i=r?.toCSS()?.fontFamily??`Calibri`,a=r?.getSize()??8.25,o=t.IFont.getSharedMeasurer()(``+ge.height,Math.ceil(a*t.IFont.getDeviceScale()),i);e=o.width??e,n=o.lineHeight}return{width:Math.round(e+5),height:Math.round(n+3)}},[ve,ye,c]),xe=he?pe*be.width:1,Se=me?pe*be.height:1,Ce=(c?.getColumnHeaders().getDefaultSize()??be.width)+xe+1,we=(c?.getRowHeaders().getDefaultSize()??be.height)+Se+1,Te=(0,r.useRef)(new Map),Ee=(0,r.useRef)(null),De=(0,r.useMemo)(()=>({getColOffset:e=>c.getColumnHeaders().getOffset(e),getColIndex:e=>c.getColumnHeaders().getIndex(e),getRowOffset:e=>c.getRowHeaders().getOffset(e),getRowIndex:e=>c.getRowHeaders().getIndex(e)}),[c]),[Oe,ke]=(0,r.useState)(!1),Ae=ee(),je=(0,r.useMemo)(()=>re(c,{referenceMode:Ae}),[c.getWorkbook()??c,Ae]),Me=A??je;(0,r.useEffect)(()=>{if(!Me)return;let e=Me.getSession();return Me.subscribe(()=>{let t=e;if(e=Me.getSession(),!t||e||!t.getActiveEditorId()?.startsWith(`inline:`))return;let n=Q.current;n?.contains(document.activeElement)&&n.focus()})},[Me]);let Ne=(0,s.useOptionalBoundSyncExternalStore)(Me,e=>e.getSession())?.getCoords()??null,[Pe,Fe]=(0,r.useState)(),Ie=(0,r.useRef)(null),Le=(0,s.useCallbackRef)(()=>{if(Ie.current?.(),Ie.current=null,!Pe||!c)return;let e=G.current;if(e&&e===c.getId()||c.isDeleted())return;let t=c.getRangeAtBounds({x:Pe.left,y:Pe.top,width:Pe.width,height:Pe.height});Ie.current=t.addListener(()=>{lt.current.clear()})},[c,Pe]),Re=(0,s.useCallbackRef)(e=>{if(Fe(e),Le(),!c||G.current)return;let t=(c.getView().getZoomScale()??100)/100;c.getView().setTopLeft(e?{left:e.left/t,top:e.top/t}:null),T?.(e)},[c,T]),[ze,Be]=(0,r.useState)(()=>c?.getView().getTopLeft()),Ve=(0,r.useMemo)(()=>{let e=c?.getView().getTopLeft();return new s.Viewport({topLeft:{left:(e?.left??0)*pe,top:(e?.top??0)*pe},zoom:pe})},[]),He=w??Ve;(0,r.useEffect)(()=>He.subscribe(()=>{He.isReady()&&He.isSettled()&&Re(He.getMetrics())}),[He]),(0,r.useLayoutEffect)(()=>{He.setZoom(pe)},[He,pe]),(0,r.useLayoutEffect)(()=>{ze?.left!=null&&He.setTarget(ze.left*pe,He.getTarget().top)},[He,ze?.left,pe]),(0,r.useLayoutEffect)(()=>{ze?.top!=null&&He.setTarget(He.getTarget().left,ze.top*pe)},[He,ze?.top,pe]);let Ue=(0,r.useRef)(c?.getId()??null);(0,r.useLayoutEffect)(()=>{let e=c?.getId();if(Ue.current===e)return;Ue.current=e;let t=c?.getView().getTopLeft(),n=(c?.getView().getZoomScale()??100)/100;He.setTarget((t?.left??0)*n,(t?.top??0)*n)},[He,c]);let We=(0,s.useCallbackRef)(e=>{let t=a.CoordUtils.cellToRange(e);if(G.current||c.isDeleted())return t;let n=c.getRange(t,{ignoreHidden:!0}).getMerges();return n.length===0?t:n[0]},[c]),Ge=e=>{let t=e?.coords?.colIndex??0,n=e?.coords?.rowIndex??0;if(!e||t===0&&n===0)return null;let r={};return t>0&&(r[a.AnchorLocation.Left]={index:t,offset:e.topLeft?.left??0}),n>0&&(r[a.AnchorLocation.Top]={index:n,offset:e.topLeft?.top??0}),r},[Ke,qe]=(0,r.useState)(()=>Ge(c.getView().getFreezePanes())),Je=Ot(c),Ye=(0,s.useCallbackRef)(e=>{let t=e?.cell??Me.getAnchor().getCoords();t&&(Me.startEdit(t,{mode:e?.editMode?`edit`:`enter`,dirty:e?.text??void 0,initialSelection:e?.initialSelection??null,autoFocus:!1!==e?.autoFocus})||Je())},[Me]),Xe=(0,s.useCallbackRef)(()=>Pe,[Pe]),[Ze,Qe]=(0,r.useState)($?.getMovableSelection().length>0),$e=Ne!==null||Ze,et=(0,r.useMemo)(()=>{let e=se.getMode();return e?.cursor?e.cursor:null},[null,se]);l(c?.getView(),{onFreezePaneChange:()=>{qe(Ge(c.getView().getFreezePanes()))},onTopLeftChange:()=>{Be(c.getView().getTopLeft())},onZoomScaleChange:()=>{V()},onMovableSelectionChange:()=>{Qe(c.getView().getMovableSelection().length>0)}}),l(c,{onViewChange(){fe(c.getView())},onLayoutChange:()=>{let e=c.getEntireRange();_e({height:e.getRowCount(),width:e.getColumnCount()}),nt()},onStyleChange:()=>{nt()},onMovablesChange:()=>{},onTablesChange:()=>{nt()},onInvalidated:()=>{nt()}}),l(c,{onRequestScrollIntoView:async(e,t)=>{if(!t)return!1;let n={colIndex:t?.coords?.colStart,rowIndex:t?.coords?.rowStart};return await Q.current?.scrollCellCoordsIntoView(n,t?.scroll),!0},onRequestFocus:()=>a.DOMUtils.whenFocus(tt.current),onRequestViewport:async()=>{let e=Xe();return e?{x:e.left,y:e.top,width:e.width,height:e.height}:null}},Oo);let tt=(0,s.useImperativeElement)(n,()=>{let e=e=>{c?.getView()&&c.getView().selectMovables([]),Ee.current=null,Q.current?.focus(e)},t=async(e=null)=>{if(e||=c?.getView().getMovableSelection()[0],!e)return!1;let t=e.getRange().getCoords();if(!t)return!1;let n=Q.current?.getPaneFromCell({colIndex:t.colStart,rowIndex:t.rowStart});if(!n)return!1;let r=n.getAnchor();c?.getView().getMovableSelection().indexOf(e)===-1&&c?.getView().selectMovables([e]);let i=Te.current?.get(r);return i?.current?(await i.current.focusMovable(e),!0):(Ee.current={movable:e,anchor:r},!0)};return{getGridSurface:()=>Q.current,getRowHeaderElement:()=>ft.current,getColumnHeaderElement:()=>mt.current,rowHeaderHeight:()=>Se,colHeaderWidth:()=>xe,startEdit:Ye,submitEdit:()=>{Me.commit()},cancelEdit:()=>{Me.cancel()},isEditing:Ne!==null,focus:n=>{let r=Me.getSession(),i=r?.getCoords().scope;(!r||i&&i!==c.getName())&&(c?.getView().getMovableSelection().length>0?t():e(n))},focusSheet:e,focusMovable:t,contains:e=>Q.current?.contains?.(e)??!1,invalidate:nt,isSheetElement:()=>!0,getSheet:()=>c,onWheelScroll:ot}},[c,Me,Ne]),nt=(0,r.useCallback)(()=>{G.current||(lt.current.clear(),Q.current?.invalidate(),B?.())},[]),rt=(0,r.useMemo)(()=>O?(0,i.jsx)(`div`,{className:P(`viewport-overlay`,wo),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`},children:O}):(0,i.jsx)(i.Fragment,{}),[O]),it=null;me&&he&&(it=(0,i.jsx)(Ga,{width:xe,height:Se,sheet:c,colorScheme:p,onMouseDown:e=>{e.nativeEvent.which===s.MouseButtonCodes.Right?g?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):Q.current?.focus()}}));let at=(0,r.useRef)(null),ot=(0,s.useCallbackRef)(e=>{if(e.shiftKey||!e.ctrlKey&&!e.metaKey)return;let{deltaY:t}=e,n=t>0?`sheetZoomOut`:t<0?`sheetZoomIn`:null;if(n){let e=at.current;e?.resolve(n,e)?.execute()}return t===0},[]);(0,r.useEffect)(()=>{fe(c.getView()),qe(Ge(c.getView().getFreezePanes())),lt.current.clear(),B()},[le,c?.getView()]);let st=(0,r.useCallback)((e,t)=>c.getRowHeaders().hiddenHeadersAt(e,t),[c]),ct=(0,r.useCallback)((e,t)=>c.getColumnHeaders().hiddenHeadersAt(e,t),[c]),lt=(0,r.useRef)(new Map),ut=(0,s.useCallbackRef)((e,n)=>{if(G.current)return[];let r=lt.current,i=n??e.getVisibleRange();if(!i)return[];let a=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,o=r.get(a);if(o)return o;let s=[];if(c.getRange(i).forEach((e,n)=>{let r=n.getCoords(),i=n.getCell();if(!(e=>{if(e.isEmpty())return!1;let n=e.getSpans();if(n.width>1||n.height>1||e.getStyle().hasVisibleStyling()||$.isShowFormulas()&&e.getFormula()!==null)return!0;let r=e.getValue();return r!==null&&!(!$.isShowZeros()&&r===0&&e.getType()===t.ScalarType.Number)})(i))return;let a;$.isShowFormulas()||(a=i.getExtrusions()??void 0),s.push({cell:r,value:i,range:a})},ko),r.set(a,s),r.size>12){let e=r.keys().next().value;e!==void 0&&r.delete(e)}return s},[c,$.isShowZeros(),$.isShowFormulas()]),dt=(0,r.useMemo)(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px var(--sxl-color-base-100)`},propsPath:{stroke:`var(--sxl-color-base-content)`}}),[]),ft=(0,r.useRef)(null),pt=(0,r.useMemo)(()=>(0,i.jsx)(Wa,{ref:ft,tabIndex:-1,freezeStart:Ke?.[a.AnchorLocation.Top],oppositeSize:xe,sheetHeader:c.getRowHeaders(),colorScheme:p,propsCellRender:L,verticalPadding:Math.max(0,Math.floor(c.getStyles().getNormal().getFont().getSize()/10)),viewport:He,onSheetContextMenu:g,onFocus:()=>{Q.current?.focus()},style:{position:`relative`,flex:`0`,gridColumn:`1 / 2`,gridRow:`2 / 3`,zIndex:1}}),[xe,Se,c,L,He,Ke?.[a.AnchorLocation.Top],g,b,le]),mt=(0,r.useRef)(null),ht=(0,r.useMemo)(()=>(0,i.jsx)(Wa,{ref:mt,tabIndex:-1,freezeStart:Ke?.[a.AnchorLocation.Left],oppositeSize:Se,sheetHeader:c.getColumnHeaders(),colorScheme:p,propsCellRender:L,viewport:He,onSheetContextMenu:g,onFocus:()=>{Q.current?.focus()},style:{position:`relative`,display:`flex`,gridColumn:`2 / 3`,gridRow:`1 / 2`,zIndex:1}}),[Se,c,L,He,Ke?.[a.AnchorLocation.Left],g,v,le]),gt=(0,r.useMemo)(()=>{let e=c.getId();return[(0,i.jsx)(la,{sheet:c,onSheetContextMenu:g},`context-menu-[${e}]`),(0,i.jsx)(Fn,{sheet:c},`background-[${e}]`),(0,i.jsx)(Mn,{sheet:c,sheetView:$},`gridlines-[${e}]`),(0,i.jsx)(nn,{getVisibleCells:ut,sheet:c},`fills-[${e}]`),(0,i.jsx)(Ni,{sheet:c},`conditional-bars-[${e}]`),(0,i.jsx)(kn,{sheet:c,sheetView:$,propsCellRender:L,editable:Me},`cells-[${e}]`),(0,i.jsx)(On,{getVisibleCells:ut,sheet:c},`cell-borders-[${e}]`),(0,i.jsx)(o.Layer,{className:`grid-border`,children:(0,i.jsx)(o.VirtualDiv,{fill:!0,className:`grid-border`,...(0,s.themeSurfaceProps)(`app`,te),style:No})},`grid-border-[${e}]`),(0,i.jsx)(Ri,{sheet:c},`conditional-icons-[${e}]`),(0,i.jsx)(oi,{sheet:c},`spill-[${e}]`),(0,i.jsx)(Pt,{sheet:c,onShowTooltip:U,onCloseTooltip:W},`selection-[${e}]`),(0,i.jsx)(pr,{sheet:c},`table-[${e}]`),(0,i.jsx)(ai,{sheet:c},`table-commands-[${e}]`),(0,i.jsx)(Ut,{sheet:c,sheetView:$,className:`references`},`ref-picker-[${e}]`),(0,i.jsx)(Ca,{sheet:c},`clipboard-[${e}]`),(0,i.jsx)(An,{sheet:c,onColumnButtonMouseDown:L?.onColumnButtonMouseDown,propsColumnButton:L?.propsColumnButton,renderColumnButton:L?.renderColumnButton},`column-buttons-[${e}]`),(0,i.jsx)(Ui,{sheet:c},`validation-[${e}]`),(0,i.jsx)(Jn,{sheet:c,renderMovable:D},`movable-[${e}]`),(0,i.jsx)(jt,{sheet:c,editable:Me,darkMode:q,onEditRejected:Je},`editor-[${e}]`),S?(0,i.jsx)(an,{className:`errors`,sheet:c},`cell-errors-[${e}]`):null,(0,i.jsx)(aa,{sheet:c},`resize-indicator-[${e}]`),E]},[c,Z,D,g,E,Me,S,$,q,te,ut,L,Je]),_t=(0,r.useCallback)((e,t)=>(0,i.jsx)(Fr,{pane:e,children:t}),[]),[vt,yt]=(0,r.useState)(!1),bt=(0,r.useMemo)(()=>{let e=c.getStyles().getNormal(),t=e.getFont(),n=e.getFill();return(0,i.jsx)(o.GridSurface,{className:`sheetxl-sheet-primary`,wrapPane:_t,style:{...Do,cursor:et??null??`cell`,...n.toCSS(`adaptive`),...t.toCSS(`adaptive`,pe),minWidth:Ce,minHeight:we},ref:de,...I,onFirstRender:e=>{yt(!0),I?.onFirstRender?.(e)},freezeLeft:Ke?.[a.AnchorLocation.Left],propsFreezeLeft:dt,freezeTop:Ke?.[a.AnchorLocation.Top],propsFreezeTop:dt,columnCount:ge.width,rowCount:ge.height,metrics:De,getRangeFromCell:We,hiddenRowsAt:st,hiddenColumnsAt:ct,viewport:He,children:gt},`grid-main`)},[ve,ye,et,null,Ce,we,z,gt]);(0,r.useEffect)(()=>{G.current||(lt.current.clear(),B())},[Ke,pe,ze?.left,ze?.top,I,Ce,we,et,gt,null]);let xt=Eo;x||(xt={...xt,...d});let St=q?`dark`:`light`,Ct=(0,s.useCallbackRef)(e=>{let{style:t,...n}=e;return(0,i.jsx)(Ua,{...n,style:{...t,paddingLeft:`4px`,paddingRight:`4px`},sheet:c})},[c]),wt=(0,i.jsxs)(`div`,{...(0,s.themeSurfaceProps)(`grid`,St),style:{gridColumn:`2 / 3`,gridRow:`2 / 3`,overflow:`hidden`,position:`relative`},ref:H,children:[bt,rt,(0,i.jsx)(fa,{style:{position:`absolute`,right:24,bottom:4},colorLicensee:`var(--sxl-color-primary)`,colorCredits:`var(--sxl-color-base-content)`})]}),Tt=(0,i.jsxs)(`div`,{className:Y,style:xt,onTouchStart:()=>{kt()},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||(ke(!0),j?.(e))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(ke(!1),M?.(e))},ref:cn([tt,ce]),...R,children:[(0,i.jsx)(`style`,{children:ne}),(0,i.jsx)(`style`,{children:X}),(0,i.jsx)(`style`,{children:oe}),(0,i.jsx)(`div`,{className:P(u,`sheetxl-sheet`,Co),ref:f,...(0,s.themeSurfaceProps)(`grid`,St),style:{position:`absolute`,width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`auto 1fr`,gridTemplateRows:`auto 1fr`,flex:`1 1 100%`},children:(0,i.jsxs)(o.SurfaceStateProvider,{children:[it,ht,pt,wt]})})]});x&&(Tt=(0,i.jsx)(s.ScrollPane,{style:{flex:`1 1 100%`,width:`100%`,height:`100%`,overflow:`hidden`,background:`var(--sxl-color-base-100)`,minHeight:2*be.height,minWidth:2*be.width,...d},viewport:He,disableTouch:$e,onWheelScroll:ot,renderScrollbarHorizontal:Ct,renderScrollbarVertical:Ct,...C,children:Tt})),(0,r.useEffect)(()=>{G.current=null,lt.current.clear(),Le(),B?.(),Oe&&tt.current?.focus()},[c]);let[Et,Dt]=(0,r.useState)(!1),kt=(0,s.useCallbackRef)(()=>{Et||Dt(!0)},[Et]);return(0,r.useEffect)(()=>{if(vt)return typeof k==`function`&&k(),s.ReactUtils.detectIt().primaryInput===`touch`&&kt(),()=>{}},[k,vt,Et]),(0,i.jsx)(xo,{sheet:c,editable:A,scopeRef:at,elementRef:tt,children:(0,i.jsx)(s.FloatProvider,{themeScopeClass:Y,themeSurface:`app`,themeMode:p,children:(0,i.jsx)(h,{sheet:c,children:Tt})})})}));To.displayName=`SheetElement`;var Eo=Object.freeze({flex:`1 1 100%`,width:`100%`,height:`100%`,minWidth:0,minHeight:0,display:`flex`,alignContent:`stretch`,position:`relative`}),Do={position:`absolute`,top:0,left:0,bottom:0,right:0},Oo={ignoreModelChange:!0},ko={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Ao=20,jo=40,Mo=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,No={pointerEvents:`none`,borderTop:Mo,borderLeft:Mo,borderRight:Mo,borderBottom:`none`},Po=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,disabled:a,style:c,shape:l,isDragging:u,onHide:d,onShow:f,...p}=e,m=(0,r.useMemo)(()=>l?.toJSON()??null,[l]),h=m?.type===`grpSp`,g=h||m?.type===`cxnSp`?void 0:l.getName(),_=(0,o.useGridPane)(),v=(0,s.useImperativeElement)(t,()=>({isShapeEditor:()=>!0}),[]),[y,{height:b,width:x}]=vn();if(!l.isDeleted()&&!h)return(0,i.jsx)(`div`,{className:`shape-editor`,...p,ref:cn([v,y]),style:{width:`100%`,height:`100%`,border:`var(--sxl-color-neutral, grey) solid 1px`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:_.getZoom(),display:`flex`,position:`relative`,filter:a?`blur(1px)`:void 0,boxShadow:u?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0,overflow:`hidden`,wordBreak:`break-word`,...c},children:g})}));Po.displayName=`ShapeEditor`;var Fo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),Io=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1387 h -469 v -640 h 469 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 1131 h -469 v -811 h 469 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z`})]}),Lo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1515 h -469 v -1195 h 469 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 875 h -469 v -555 h 469 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z`})]}),Ro=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z`})]}),zo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),Bo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1877 299 h -1770 v -43 h 1770 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),Vo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z`})]}),Ho=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z`})]}),Uo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z`})]}),Wo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z`})]}),Go=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z`})]}),Ko=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 1813 277 v 299 h -1706 v -299 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1088 v 299 h -810 v -299 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 896 1109 h -795 v -42 h 838 v 322 h -43 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z`})]}),qo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 704 832 v -469 h 640 v 469 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1600 v -469 h 811 v 469 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z`})]}),Jo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 533 832 v -469 h 1195 v 469 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 1173 1600 v -469 h 555 v 469 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z`})]}),Yo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z`})]}),Xo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),Zo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1941 1941 h -1834 v -1834 h 1834 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z`})]}),Qo=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`})]}),$o=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z`})]}),es=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z`})]}),ts=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z`})]}),ns=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z`}),(0,i.jsx)(`path`,{className:`styled info`,d:`M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),rs=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),is=e=>(0,i.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,i.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,i.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,i.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,i.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,i.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,i.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,i.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),as={themed:`_themed_f2asj_9`,small:`_small_f2asj_36`,medium:`_medium_f2asj_37`,large:`_large_f2asj_38`},os=(0,r.memo)(e=>{let{size:t=`medium`,className:n,children:r,...a}=e;return(0,i.jsx)(`span`,{className:P(`icon`,as.themed,as[t],n),...a,children:r})});os.displayName=`ThemedChartIcon`;var ss={types:{0:{type:`column`}}},cs={types:{0:{type:`column`,grouping:`stacked`}}},ls={types:{0:{type:`column`,grouping:`percentStacked`}}},us={types:{0:{type:`line`}}},ds={types:{0:{type:`line`,grouping:`stacked`}}},fs={types:{0:{type:`line`,grouping:`percentStacked`}}},ps={types:{0:{type:`line`,scatterStyle:`lineMarker`}}},ms={types:{0:{type:`line`,scatterStyle:`lineMarker`,grouping:`stacked`}}},hs={types:{0:{type:`line`,scatterStyle:`lineMarker`,grouping:`percentStacked`}}},gs={types:{0:{type:`pie`}}},_s={types:{0:{type:`pie`,holeSize:50}}},vs={types:{0:{type:`bar`}}},ys={types:{0:{type:`bar`,grouping:`stacked`}}},bs={types:{0:{type:`bar`,grouping:`percentStacked`}}},xs={types:{0:{type:`area`}}},Ss={types:{0:{type:`area`,grouping:`stacked`}}},Cs={types:{0:{type:`area`,grouping:`percentStacked`}}},ws={types:{0:{type:`scatter`,scatterStyle:`marker`}}},Ts={types:{0:{type:`scatter`,scatterStyle:`smoothMarker`}}},Es={types:{0:{type:`scatter`,scatterStyle:`smooth`}}},Ds={types:{0:{type:`scatter`,scatterStyle:`lineMarker`}}},Os={types:{0:{type:`scatter`,scatterStyle:`line`}}},ks={Column:`column`,ColumnStacked:`columnStacked`,ColumnStackedPercent:`columnStackedPercent`,Line:`line`,LineStacked:`lineStacked`,LineStackedPercent:`lineStackedPercent`,LineMarkers:`lineMarkers`,LineStackedMarkers:`lineStackedMarkers`,LineStackedPercentMarkers:`lineStackedPercentMarkers`,Pie:`pie`,PieDoughnut:`pieDoughnut`,Bar:`bar`,BarStacked:`barStacked`,BarStackedPercent:`barStackedPercent`,Area:`area`,AreaStacked:`areaStacked`,AreaStackedPercent:`areaStackedPercent`,ScatterMarkers:`scatterMarkers`,ScatterLinesMarkersSmooth:`scatterLinesMarkersSmooth`,ScatterLinesMarkers:`scatterLinesMarkers`,ScatterLinesSmooth:`scatterLinesSmooth`,ScatterLines:`scatterLines`,Bubble:`bubble`,Bubble3D:`bubble3D`},As=new Map;As.set(ks.Column,{Icon:Fo,description:(0,a.messageKey)(`chart.type.column`),template:ss}),As.set(ks.ColumnStacked,{Icon:Io,description:(0,a.messageKey)(`chart.type.columnStacked`),template:cs}),As.set(ks.ColumnStackedPercent,{Icon:Lo,description:(0,a.messageKey)(`chart.type.columnStackedPercent`),template:ls}),As.set(ks.Line,{Icon:Ro,description:(0,a.messageKey)(`chart.type.line`),template:us}),As.set(ks.LineStacked,{Icon:zo,description:(0,a.messageKey)(`chart.type.lineStacked`),template:ds}),As.set(ks.LineStackedPercent,{Icon:Bo,description:(0,a.messageKey)(`chart.type.lineStackedPercent`),template:fs}),As.set(ks.LineMarkers,{Icon:Vo,description:(0,a.messageKey)(`chart.type.lineMarkers`),template:ps}),As.set(ks.LineStackedMarkers,{Icon:Ho,description:(0,a.messageKey)(`chart.type.lineStackedMarkers`),template:ms}),As.set(ks.LineStackedPercentMarkers,{Icon:Uo,description:(0,a.messageKey)(`chart.type.lineStackedPercentMarkers`),template:hs}),As.set(ks.Pie,{Icon:Wo,description:(0,a.messageKey)(`chart.type.pie`),template:gs}),As.set(ks.PieDoughnut,{Icon:Go,description:(0,a.messageKey)(`chart.type.pieDoughnut`),template:_s}),As.set(ks.Bar,{Icon:Ko,description:(0,a.messageKey)(`chart.type.bar`),template:vs}),As.set(ks.BarStacked,{Icon:qo,description:(0,a.messageKey)(`chart.type.barStacked`),template:ys}),As.set(ks.BarStackedPercent,{Icon:Jo,description:(0,a.messageKey)(`chart.type.barStackedPercent`),template:bs}),As.set(ks.Area,{Icon:Yo,description:(0,a.messageKey)(`chart.type.area`),template:xs}),As.set(ks.AreaStacked,{Icon:Xo,description:(0,a.messageKey)(`chart.type.areaStacked`),template:Ss}),As.set(ks.AreaStackedPercent,{Icon:Zo,description:(0,a.messageKey)(`chart.type.areaStackedPercent`),template:Cs}),As.set(ks.ScatterMarkers,{Icon:Qo,description:(0,a.messageKey)(`chart.type.scatterMarkers`),template:ws}),As.set(ks.ScatterLinesMarkersSmooth,{Icon:$o,description:(0,a.messageKey)(`chart.type.scatterLinesMarkersSmooth`),template:Ts}),As.set(ks.ScatterLinesMarkers,{Icon:ts,description:(0,a.messageKey)(`chart.type.scatterLinesMarkers`),template:Ds}),As.set(ks.ScatterLinesSmooth,{Icon:es,description:(0,a.messageKey)(`chart.type.scatterLinesSmooth`),template:Es}),As.set(ks.ScatterLines,{Icon:ns,description:(0,a.messageKey)(`chart.type.scatterLines`),template:Os}),As.set(ks.Bubble,{Icon:rs,description:(0,a.messageKey)(`chart.type.bubble`),template:null}),As.set(ks.Bubble3D,{Icon:is,description:(0,a.messageKey)(`chart.type.bubble3D`),template:null});var js=e=>As.get(e),Ms=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,disabled:c,chart:l,isDragging:u,onHide:d,onShow:f,...p}=e;(0,r.useEffect)(()=>{},[l]);let m=(0,o.useGridPane)(),h=(0,s.useImperativeElement)(t,()=>({isChartEditor:()=>!0}),[]),[g,{height:_,width:v}]=vn();if(l.isDeleted())return;let y=js(l.getChartType());y||=js(ks.Column);let b=y.Icon;return(0,i.jsx)(`div`,{...p,ref:cn([h,g]),children:(0,i.jsxs)(`div`,{className:`chart-editor`,style:{width:`100%`,height:`100%`,paddingTop:`20px`,paddingBottom:`20px`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:m.getZoom(),display:`flex`,flexDirection:`column`,rowGap:`8px`,position:`relative`,border:`var(--sxl-color-neutral, grey) solid 1px`,filter:c?`blur(1px)`:void 0,boxShadow:u?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0},children:[l.getChartTitle(),(0,i.jsx)(b,{style:{maxWidth:`260px`,fill:`grey`,opacity:.4}}),(0,i.jsx)(`div`,{style:{textAlign:`center`},children:a.CommonUtils.camelToPrettyCase(l.getChartType())})]})})}));Ms.displayName=`ChartEditor`;var Ns=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,disabled:a,slicer:c,isDragging:l,onHide:u,onShow:d,...f}=e;(0,r.useEffect)(()=>{},[c]);let p=(0,o.useGridPane)(),m=(0,s.useImperativeElement)(t,()=>({isSlicerEditor:()=>!0}),[]),[h,{height:g,width:_}]=vn();if(!c.isDeleted())return(0,i.jsx)(`div`,{...f,ref:cn([m,h]),children:(0,i.jsx)(`div`,{className:`slicer-editor`,style:{width:`100%`,height:`100%`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:p.getZoom(),display:`flex`,position:`relative`,border:`var(--sxl-color-neutral, grey) solid 1px`,filter:a?`blur(1px)`:void 0,boxShadow:l?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0},children:(0,i.jsx)(`div`,{style:{textAlign:`center`},children:c.getDescription()})})})}));Ns.displayName=`SlicerEditor`;var Ps={placement:`bottom-start`,followAnchor:!0},Fs={x:0,y:0,top:0,left:0,bottom:0,right:0,width:0,height:0,toJSON:()=>({})},Is=e=>{let{api:n,grammar:a,disabled:l}=e,u=a===`formula`,d=y(),f=e.workbook===void 0?d:e.workbook,p=te().getMode(),m=!!p?.activeInput&&!n.engaged,[h,g]=(0,r.useState)(-1),[_,v]=(0,r.useState)(null),[b,x]=(0,r.useState)(null),S=(0,r.useMemo)(()=>ft(u?n.tokens:null),[u,n.tokens]),[C,T]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=n.tokens,t=u&&n.engaged&&e&&h>=0?pt(e,S.matchOf,h,n.tokenBase):null;T(e=>mt(e,t)?e:t)},[u,n.engaged,n.tokens,n.tokenBase,h,S]);let E=(0,r.useMemo)(()=>ht(u?_:null,C,S),[u,_,C,S]),O=h>=0?Math.min(h,n.text.length):n.text.length,k=u&&n.engaged&&n.text.length>0&&w(n.text,O),A=k&&O>=n.text.length,j=k&&!A?O:-1,M=(0,r.useMemo)(()=>{if(u){let e=n.tokens;if(!e)return null;let t=n.tokenBase,r=e.map(e=>{let n=t;return t+=(e.text??``).length,n}),a=e.map((e,t)=>{let n=S.unmatched.has(t),a=E.has(t),o=S.depthOf.get(t),s=n||o===void 0||e.isReference?void 0:st(o),c=n?ut:s??D(e),l;(c||a||n)&&(l={},c&&(l.color=c),n&&(l.fontWeight=`bold`),a&&(l.color=`transparent`));let u=e.text??``,d=j>=r[t]&&j<r[t]+u.length;return(0,i.jsxs)(`span`,{"data-si":t,style:l,children:[a&&(0,i.jsx)(`span`,{"aria-hidden":!0,style:ct,children:(0,i.jsx)(`span`,{style:lt(c??`inherit`),children:e.text})}),d?(0,i.jsxs)(i.Fragment,{children:[u.slice(0,j-r[t]),(0,i.jsx)(et,{}),u.slice(j-r[t])]}):u]},`t-${t}`)}),o=n.tokenBase>0?(0,i.jsx)(`span`,{children:n.text.slice(0,n.tokenBase)},`eq`):null,s=A?(0,i.jsx)(et,{},`expected`):null;if(!_)return[o,...a,s].filter(Boolean);let{lo:c,hi:l,outline:u}=_,d=u?it:rt;return[o,...a.slice(0,c),(0,i.jsx)(`span`,{className:`formula-eval-run`,style:d,children:a.slice(c,l+1)},`eval-run`),...a.slice(l+1),s].filter(Boolean)}if(n.segments.length===0)return null;let e=[];return n.segments.forEach((t,n)=>{n>0&&e.push((0,i.jsx)(`span`,{children:`,`},`sep-${n}`));let r=_&&_.lo===n;e.push((0,i.jsx)(`span`,{"data-si":n,style:{...t.valid?{color:o.PICKER_COLORS[n%o.PICKER_COLORS.length]}:null,...r?_.outline?it:rt:null},children:t.text},`seg-${n}`))}),e},[u,n.tokens,n.tokenBase,n.text,n.segments,S,E,_,A,j]),N=!l&&!m&&!!M,P=(0,r.useRef)(null),F=(0,r.useRef)(null),I=(0,r.useRef)(null),[L,R]=(0,r.useState)(null);(0,r.useLayoutEffect)(()=>{if(!N)return void R(null);let e=F.current,t=P.current;if(!e||!t)return;let n=()=>{let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.getComputedStyle(e);R({position:`absolute`,left:n.left-r.left,top:n.top-r.top,width:n.width,height:n.height,boxSizing:`border-box`,paddingLeft:i.paddingLeft,paddingRight:i.paddingRight,paddingTop:i.paddingTop,paddingBottom:i.paddingBottom,font:i.font,letterSpacing:i.letterSpacing,display:`flex`,alignItems:`center`,whiteSpace:`pre`,overflow:`hidden`,pointerEvents:`none`,textAlign:`left`});let a=I.current;a&&(a.scrollLeft=e.scrollLeft)};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[N,n.text]);let z=Ze({text:n.text,getTokens:()=>u?n.tokens:null,active:u&&n.engaged,getCaret:()=>F.current?.selectionStart??n.text.length,getCalculation:()=>{try{return f?.getSelectedSheet().getCalculation()??null}catch{return null}},getNames:()=>{try{return f?.getSelectedSheet().getNames()??null}catch{return null}},getLocale:()=>f?.getLocale()??null,applyText:(e,t)=>{n.replaceText(e,t)},hoveredTokenIndex:b});(0,r.useEffect)(()=>{z.update()},[z.update,n.text,h,n.engaged]);let B=(0,s.useFloatStack)({label:`formula-field-hint`,anchor:(0,r.useMemo)(()=>({getBoundingClientRect:()=>F.current?.getBoundingClientRect()??Fs}),[]),autoFocus:!1,disableClickAway:r.default.useCallback(e=>!!P.current?.contains(e),[]),propsPopper:Ps,createPopupPanel:z.renderPanel}),V=z.active&&!p?.dragging,H=B.reference;(0,r.useEffect)(()=>{V?H.open(0):H.close(0)},[V,H]);let[U,W]=(0,r.useState)(null),G=(0,r.useRef)(null),K=(0,r.useRef)(!1),q=()=>{G.current=null,K.current=!1,W(null),v(null),x(null)},ee=()=>{K.current||q()},J=ie(()=>q(),()=>ne()),Y=t=>{if(!f)return!1;try{return f.getSelectedSheet().getCalculation().createFormula(`=`+t,e.home).isValid()}catch{return!1}},ne=()=>{let t=F.current,r=I.current,i=()=>{K.current&&q()};if(!t||!r||!N)return void i();if(J.isDragging())return;let a=t.selectionStart??0,o=t.selectionEnd??0;if(a===o)return void i();let s=null;if(u){let t=f?se(n.tokens,n.tokenBase,n.text,a,o,Y):null;t&&(s={lo:t.lo,hi:t.hi,key:`sel:f:${t.lo}:${t.hi}:${t.fragment??t.evalIndex}`,evaluate:async()=>{let r=f.getSelectedSheet().getCalculation();return fe(t.fragment===null?await r.createFormula(n.text,e.home).evaluate({evalIndex:t.evalIndex}):await r.createFormula(`=`+t.fragment,e.home).evaluate())}})}else{let e=0,t=-1;for(let r=0;r<n.segments.length;r++){r>0&&(e+=1);let i=e;if(e+=n.segments[r].text.length,i<o&&e>a){if(t>=0){t=-1;break}t=r}}if(t>=0&&n.segments[t].valid){let e=t;s={lo:e,hi:e,key:`sel:s:${e}:${n.segments[e].text}`,evaluate:()=>n.evaluateSegment(e)}}}if(!s)return void i();if(s.key===G.current)return;G.current=s.key,K.current=!0,W(null),x(null),v({lo:s.lo,hi:s.hi,outline:!0});let c=r.querySelector(`[data-si="${s.lo}"]`)?.getBoundingClientRect(),l=r.querySelector(`[data-si="${s.hi}"]`)?.getBoundingClientRect();if(!c)return void q();let d=l&&Math.abs(l.top-c.top)<1?{left:(c.left+l.right)/2,top:c.top-6}:{left:(c.left+c.right)/2,top:c.top-6},p=s.key;s.evaluate().then(e=>{G.current===p&&e!=null&&W({...d,text:e})}).catch(()=>{})};(0,r.useEffect)(()=>{n.engaged||q()},[n.engaged]);let X=r=>{if(r.which!==s.KeyCodes.F9||r.shiftKey||r.ctrlKey||r.altKey||r.metaKey)return!1;let i=F.current;if(!u||!i||!f||l||!n.tokens?.length)return!1;let a=i.selectionStart??0,o=i.selectionEnd??0,c;if(a!==o)c=se(n.tokens,n.tokenBase,n.text,a,o,Y);else{let e=ce(n.tokens);c=e?{...e,...le(n.tokens,n.tokenBase,e.lo,e.hi),fragment:null}:null}if(!c)return!1;r.preventDefault(),r.stopPropagation();let d=n.text,p=f.getSelectedSheet().getCalculation(),m=ue((0,t.getLocaleProfile)(f.getLocale()??`en`).decimal),h=(0,t.getLanguagePack)(),g={t:h?.booleans?.true??`TRUE`,f:h?.booleans?.false??`FALSE`};return(async()=>{let t=null,n=``;try{if(t=de(c.fragment===null?await p.createFormula(d,e.home).evaluate({evalIndex:c.evalIndex}):await p.createFormula(`=`+c.fragment,e.home).evaluate(),m,g),t===null||(n=d.slice(0,c.start)+t+d.slice(c.end),!p.createFormula(n,e.home).isValid()))return}catch{return}let r=F.current;if(!r||r.value!==d)return;s.ReactUtils.replaceRangeText(r,c.start,c.end,t);let i=c.start,a=c.start+t.length;requestAnimationFrame(()=>{F.current?.value===n&&F.current.setSelectionRange(i,a)})})(),!0};return(0,r.useEffect)(()=>{q()},[n.text]),{containerRef:P,inputElRef:F,overlayActive:N,inputHandlers:{onScroll:e=>{let t=I.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft),q(),ne()},onMouseMove:t=>{let r=I.current;if(!r)return;if(J.blocksHover(t)||ae(F.current))return void ee();let i=t.clientX,a=t.clientY,o=r.querySelectorAll(`[data-si]`),s=-1,c=null;for(let e=0;e<o.length;e++){let t=o[e].getBoundingClientRect();if(i>=t.left&&i<=t.right&&a>=t.top&&a<=t.bottom){s=Number(o[e].getAttribute(`data-si`)),c=t;break}}if(s<0||!c)return void q();if(u){let t=n.tokens;if(!t||!f)return void q();let i=oe(t,s);if(!i)return void q();let a=`f:${i.evalIndex}:${i.lo}:${i.hi}`;if(a===G.current)return;G.current=a,W(null),v({lo:i.lo,hi:i.hi}),x(s);let o=r.querySelector(`[data-si="${i.lo}"]`)?.getBoundingClientRect(),l=r.querySelector(`[data-si="${i.hi}"]`)?.getBoundingClientRect(),u=o&&l&&Math.abs(l.top-o.top)<1?{left:(o.left+l.right)/2,top:o.top-6}:{left:(c.left+c.right)/2,top:c.top-6};try{let t=f.getSelectedSheet().getCalculation().createFormula(n.text,e.home);Promise.resolve(t.evaluate({evalIndex:i.evalIndex})).then(e=>{if(G.current!==a)return;let t=fe(e);t!=null&&W({...u,text:t})}).catch(()=>{})}catch{}return}if(!n.segments[s]?.valid)return void q();let l=`s:${s}:${n.segments[s].text}`;if(l===G.current)return;G.current=l,W(null),v({lo:s,hi:s});let d={left:(c.left+c.right)/2,top:c.top-6};n.evaluateSegment(s).then(e=>{G.current===l&&e!=null&&W({...d,text:e})})},onMouseLeave:ee,onSelect:e=>{g(F.current?.selectionStart??-1),ne()},onPointerDown:e=>{J.begin(e),V&&!B.isOpen&&H.open(0)}},inputExpected:k,handleKeyDown:e=>!!z.handleKeyDown(e)||(e.which===s.KeyCodes.Escape&&B.isOpen?(e.preventDefault(),e.stopPropagation(),H.close(0),!0):!!X(e)),overlayElement:N&&L?(0,i.jsx)(`div`,{ref:I,"aria-hidden":!0,style:L,children:(0,i.jsx)(`span`,{style:{whiteSpace:`pre`},children:M})}):null,tipElement:U?(0,c.createPortal)((0,i.jsx)(`div`,{className:`sxl-formula-eval-tip`,style:{...Z,left:U.left,top:U.top},children:U.text}),document.body):null,hintElement:B.component}},Ls=e=>{e.button===0&&e.preventDefault()},Rs=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{grammar:n=`formula`,value:a,onChangeInput:o,onChangeText:c,onDone:l,changeOn:u,workbook:d,apiRef:f,hideAdornment:p,hideError:m,home:h,equals:g,pickAs:_,allowMulti:v,allowCrossSheet:y,disabled:b,className:x,style:S,onKeyDown:C,onFocus:w,onBlur:T,placeholder:E,...D}=e,O=(0,s.useTranslator)(),k=we({value:a,onChange:o,onChangeText:c,onDone:l,changeOn:u,workbook:d,home:h,equals:g,pickAs:_,allowMulti:v,allowCrossSheet:y,disabled:b},n);(0,r.useImperativeHandle)(f,()=>k,[k]);let A=Is({api:k,grammar:n,disabled:b,workbook:d,home:h}),j=!!k.error&&!A.inputExpected,M=!!l,N={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`none`,background:`none`,padding:`0 2px`,margin:0,cursor:`pointer`,color:`inherit`,opacity:.8},F=p?null:(0,i.jsx)(`span`,{className:`sxl-input-adornment`,onMouseDown:Ls,style:{display:`inline-flex`,alignItems:`center`,flex:`0 0 auto`},children:k.engaged&&M?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`button`,{type:`button`,"aria-label":`commit-reference`,title:O(`referenceInput.commit`),style:N,disabled:!!k.error,tabIndex:-1,onMouseDown:Ls,onClick:()=>{k.commit()},children:(0,i.jsx)(s.DynamicIcon,{iconKey:`CheckSuccess`})}),(0,i.jsx)(`button`,{type:`button`,"aria-label":`cancel-reference`,title:O(`referenceInput.cancel`),style:N,tabIndex:-1,onMouseDown:Ls,onClick:()=>{k.cancel()},children:(0,i.jsx)(s.DynamicIcon,{iconKey:`CloseError`})})]}):(0,i.jsx)(`button`,{type:`button`,"aria-label":`select-current-range`,title:O(`referenceInput.selectCurrent`),style:b||!k.canSelectCurrent?{...N,opacity:.3,cursor:`default`}:N,disabled:b||!k.canSelectCurrent,tabIndex:-1,onMouseDown:Ls,onClick:()=>{k.engaged||k.togglePoint(),k.selectCurrent()},children:(0,i.jsx)(s.DynamicIcon,{iconKey:`SelectRangeMode`})})});return(0,i.jsxs)(`div`,{ref:e=>{A.containerRef.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:P(`sxl-formula-input`,x),"data-grammar":n,"data-error":j?``:void 0,"data-engaged":k.engaged?``:void 0,style:{position:`relative`,display:`inline-flex`,flexDirection:`column`,minWidth:0,fontFamily:`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif)`,...S},children:[(0,i.jsxs)(`span`,{style:{display:`inline-flex`,flexDirection:`row`,alignItems:`center`,border:`1px solid `+(j?`var(--sxl-color-error, #d93025)`:`var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))`),borderRadius:`var(--sxl-input-radius, 4px)`,background:`var(--sxl-input-bg, transparent)`},children:[(0,i.jsx)(`input`,{...D,type:`text`,spellCheck:!1,autoComplete:`off`,placeholder:E,disabled:b,readOnly:b||k.inputProps.readOnly,"aria-invalid":!!j||void 0,value:k.inputProps.value,ref:e=>{A.inputElRef.current=e,k.inputProps.ref(e)},onChange:k.inputProps.onChange,onKeyDown:e=>{A.handleKeyDown(e)||(k.inputProps.onKeyDown(e),e.defaultPrevented||C?.(e))},onPointerDown:A.inputHandlers.onPointerDown,onMouseDown:k.inputProps.onMouseDown,onSelect:e=>{k.inputProps.onSelect(e),A.inputHandlers.onSelect(e)},onFocus:e=>{k.inputProps.onFocus(e),w?.(e)},onBlur:e=>{k.inputProps.onBlur(e),T?.(e)},onScroll:A.inputHandlers.onScroll,onMouseMove:A.inputHandlers.onMouseMove,onMouseLeave:A.inputHandlers.onMouseLeave,onContextMenu:e=>{e.stopPropagation()},style:{flex:`1 1 auto`,minWidth:0,font:`inherit`,color:`inherit`,background:`none`,border:`none`,outline:`none`,padding:`var(--sxl-input-padding, 4px 6px)`,...A.overlayActive?{color:`transparent`,caretColor:`var(--sxl-color-text, light-dark(#000, #fff))`}:null}}),F]}),!m&&(0,i.jsx)(`span`,{className:`sxl-formula-input-error`,style:{display:`block`,visibility:j?`visible`:`hidden`,color:`var(--sxl-color-error, #d93025)`,fontSize:`0.75em`,paddingTop:`2px`},children:j?O(k.error):`\xA0`}),A.overlayElement,A.tipElement,A.hintElement]})}));Rs.displayName=`FormulaInput`;var zs=`_editable-input_1u3oj_6`,Bs=e=>(0,i.jsx)(`input`,{...e}),Vs=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{style:n={},className:a,value:o=``,onSubmit:c,onChange:l,onCancel:u,renderInput:d=Bs,styleHover:f={},dragging:p,maxLength:m,disabled:h=!1,readOnly:g=!1,..._}=e,[v,y]=(0,r.useState)(!1),[b,x]=(0,r.useState)(!1),[S,C]=(0,r.useState)(o);(0,r.useEffect)(()=>{C(o)},[o]);let w=(0,r.useRef)(null),[T,E]=(0,r.useState)(null),D=(0,s.useNotifier)(),O=(0,r.useCallback)(function(e){let t=e.message;T!==t&&(D?.showMessage?.(t,{type:s.NotifierType.Error}),E(t))},[D,T]),k=(0,r.useCallback)(e=>{let t=!1;try{t=c?.(e)??!0}catch(e){O(e)}return t?(w.current=null,x(!1),C(e),t):(setTimeout(()=>{w.current?.focus()},0),t)},[c]),A=(0,s.useCallbackRef)(()=>{C(o),w.current=null,x(!1),u?.()},[u,o]),j=(0,r.useMemo)(()=>{if(!b)return null;let e={className:P(zs),autoFocus:!0,spellCheck:!1,name:`editable-label`,autoComplete:`off`,maxLength:m,type:`text`,value:S,onFocus:e=>{w.current||(w.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{w.current&&k(S)},onChange:e=>{b&&C(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>e.code===`Escape`?(e.preventDefault(),void A()):e.code===`Enter`?(e.preventDefault(),void k(e.target.value)):void(e.code===`Tab`?k(e.target.value):e.stopPropagation())};return(0,i.jsx)(i.Fragment,{children:d(e)})},[b,S,k,A,d,h]),[M,N]=(0,r.useState)();(0,r.useLayoutEffect)(()=>{let e=Object.assign({},n);(p||v)&&(e=Object.assign(e,f)),N(e)},[p,v,f,n]),(0,r.useEffect)(()=>{j&&l?.(S)},[j,l,S]);let F=(0,s.useImperativeElement)(t,()=>({startEdit(){h||g||x(!0)},cancel(){A()}}),[]);return(0,i.jsxs)(`div`,{..._,ref:F,style:{flexDirection:`column`,display:`flex`,...M},className:P(a),children:[(0,i.jsxs)(`div`,{style:{position:`relative`,boxSizing:`content-box`,whiteSpace:`pre`,userSelect:`none`,display:`flex`,justifyContent:`center`},onDoubleClick:()=>{h||g||x(!0)},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[(0,i.jsx)(`div`,{className:`editable-label-container`,style:{textAlign:`center`,display:`flex`,minHeight:`1em`,opacity:+!b},children:S}),j]}),(0,i.jsx)(`div`,{style:{whiteSpace:`pre`,position:`relative`,maxHeight:`0px`,height:`0px`,visibility:`hidden`,marginLeft:`1px`,marginRight:`1px`,overflow:`hidden`,...f},children:S})]})})),Hs=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Us(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ws(e){return`nodeType`in e}function Gs(e){var t;return e?Us(e)?e:Ws(e)&&(t=e.ownerDocument?.defaultView)!=null?t:window:window}function Ks(e){let{Document:t}=Gs(e);return e instanceof t}function qs(e){return!Us(e)&&e instanceof Gs(e).HTMLElement}function Js(e){return e instanceof Gs(e).SVGElement}function Ys(e){return e?Us(e)?e.document:Ws(e)?Ks(e)?e:qs(e)||Js(e)?e.ownerDocument:document:document:document}var Xs=Hs?n.useLayoutEffect:n.useEffect;function Zs(e){let t=(0,n.useRef)(e);return Xs(()=>{t.current=e}),(0,n.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current==null?void 0:t.current(...n)},[])}function Qs(e,t){t===void 0&&(t=[e]);let r=(0,n.useRef)(e);return Xs(()=>{r.current!==e&&(r.current=e)},t),r}function $s(e,t){let r=(0,n.useRef)();return(0,n.useMemo)(()=>{let t=e(r.current);return r.current=t,t},[...t])}function ec(e){let t=Zs(e),r=(0,n.useRef)(null);return[r,(0,n.useCallback)(e=>{e!==r.current&&t?.(e,r.current),r.current=e},[])]}function tc(e){let t=(0,n.useRef)();return(0,n.useEffect)(()=>{t.current=e},[e]),t.current}var nc={};function rc(e,t){return(0,n.useMemo)(()=>{if(t)return t;let n=nc[e]==null?0:nc[e]+1;return nc[e]=n,e+`-`+n},[e,t])}function ic(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var ac=ic(1),oc=ic(-1);function sc(e){if(!e)return!1;let{KeyboardEvent:t}=Gs(e.target);return t&&e instanceof t}function cc(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=Gs(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return`clientX`in e&&`clientY`in e}(e)?{x:e.clientX,y:e.clientY}:null}var lc=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[lc.Translate.toString(e),lc.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),uc=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function dc(e){return e.matches(uc)?e:e.querySelector(uc)}var fc={display:`none`};function pc(e){let{id:t,value:r}=e;return n.default.createElement(`div`,{id:t,style:fc},r)}function mc(e){let{id:t,announcement:r,ariaLiveType:i=`assertive`}=e;return n.default.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":i,"aria-atomic":!0},r)}var hc=(0,n.createContext)(null),gc,_c={draggable:`
24
27
  To pick up a draggable item, press the space bar.
25
28
  While dragging, use the arrow keys to move the item.
26
29
  Press space again to drop the item in its new position, or press escape to cancel.
27
- `},mi={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function fi(e){let{announcements:t=mi,container:n,hiddenTextDescribedById:i,screenReaderInstructions:a=hi}=e;const{announce:l,announcement:f}=(function(){const[y,p]=o.useState("");return{announce:o.useCallback(T=>{T!=null&&p(T)},[]),announcement:y}})(),h=hn("DndLiveRegion"),[c,C]=o.useState(!1);if(o.useEffect(()=>{C(!0)},[]),(function(y){const p=o.useContext(Fr);o.useEffect(()=>{if(!p)throw new Error("useDndMonitor must be used within a children of <DndContext>");return p(y)},[y,p])})(o.useMemo(()=>({onDragStart(y){let{active:p}=y;l(t.onDragStart({active:p}))},onDragMove(y){let{active:p,over:T}=y;t.onDragMove&&l(t.onDragMove({active:p,over:T}))},onDragOver(y){let{active:p,over:T}=y;l(t.onDragOver({active:p,over:T}))},onDragEnd(y){let{active:p,over:T}=y;l(t.onDragEnd({active:p,over:T}))},onDragCancel(y){let{active:p,over:T}=y;l(t.onDragCancel({active:p,over:T}))}}),[l,t])),!c)return null;const M=o.createElement(o.Fragment,null,o.createElement(ui,{id:i,value:a.draggable}),o.createElement(gi,{id:h,announcement:f}));return n?Kt.createPortal(M,n):M}var ht;function zn(){}function io(e,t){return o.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ht||(ht={}));const kt=Object.freeze({x:0,y:0});function Ar(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pi(e,t){const n=Dn(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Dr(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return n-i}function vi(e,t){let{data:{value:n}}=e,{data:{value:i}}=t;return i-n}function $o(e){let{left:t,top:n,height:i,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+i},{x:t+a,y:n+i}]}function zr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Wo(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Ci=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=Wo(t,t.left,t.top),l=[];for(const f of i){const{id:h}=f,c=n.get(h);if(c){const C=Ar(Wo(c),a);l.push({id:h,data:{droppableContainer:f,value:C}})}}return l.sort(Dr)};function yi(e,t){const n=Math.max(t.top,e.top),i=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),f=a-i,h=l-n;if(i<a&&n<l){const c=t.width*t.height,C=e.width*e.height,M=f*h;return Number((M/(c+C-M)).toFixed(4))}return 0}const wi=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:i}=e;const a=[];for(const l of i){const{id:f}=l,h=n.get(f);if(h){const c=yi(h,t);c>0&&a.push({id:f,data:{droppableContainer:l,value:c}})}}return a.sort(vi)};function Go(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:kt}function bi(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,f)=>({...l,top:l.top+e*f.y,bottom:l.bottom+e*f.y,left:l.left+e*f.x,right:l.right+e*f.x}),{...t})}}const xi=bi(1);function Lr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const qi={ignoreTransform:!1};function Xt(e,t){t===void 0&&(t=qi);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:C,transformOrigin:M}=Ct(e).getComputedStyle(e);C&&(n=(function(y,p,T){const I=Lr(p);if(!I)return y;const{scaleX:z,scaleY:D,x:_,y:$}=I,w=y.left-_-(1-z)*parseFloat(T),N=y.top-$-(1-D)*parseFloat(T.slice(T.indexOf(" ")+1)),v=z?y.width/z:y.width,E=D?y.height/D:y.height;return{width:v,height:E,top:N,right:w+v,bottom:N+E,left:w}})(n,C,M))}const{top:i,left:a,width:l,height:f,bottom:h,right:c}=n;return{top:i,left:a,width:l,height:f,bottom:h,right:c}}function _o(e){return Xt(e,{ignoreTransform:!0})}function Hn(e,t){const n=[];return e?(function i(a){if(t!=null&&n.length>=t||!a)return n;if(qo(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!gn(a)||Ir(a)||n.includes(a))return n;const l=Ct(e).getComputedStyle(a);return a!==e&&(function(f,h){h===void 0&&(h=Ct(f).getComputedStyle(f));const c=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(C=>{const M=h[C];return typeof M=="string"&&c.test(M)})})(a,l)&&n.push(a),(function(f,h){return h===void 0&&(h=Ct(f).getComputedStyle(f)),h.position==="fixed"})(a,l)?n:i(a.parentNode)})(e):n}function Nr(e){const[t]=Hn(e,1);return t??null}function ao(e){return jn&&e?Zt(e)?e:xo(e)?qo(e)||e===_t(e).scrollingElement?window:gn(e)?e:null:null:null}function Pr(e){return Zt(e)?e.scrollX:e.scrollLeft}function jr(e){return Zt(e)?e.scrollY:e.scrollTop}function go(e){return{x:Pr(e),y:jr(e)}}var mt;function Br(e){return!(!jn||!e)&&e===document.scrollingElement}function Or(e){const t={x:0,y:0},n=Br(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=i.y,isRight:e.scrollLeft>=i.x,maxScroll:i,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(mt||(mt={}));const Si={x:.2,y:.2};function Ri(e,t,n,i,a){let{top:l,left:f,right:h,bottom:c}=n;i===void 0&&(i=10),a===void 0&&(a=Si);const{isTop:C,isBottom:M,isLeft:y,isRight:p}=Or(e),T={x:0,y:0},I={x:0,y:0},z=t.height*a.y,D=t.width*a.x;return!C&&l<=t.top+z?(T.y=mt.Backward,I.y=i*Math.abs((t.top+z-l)/z)):!M&&c>=t.bottom-z&&(T.y=mt.Forward,I.y=i*Math.abs((t.bottom-z-c)/z)),!p&&h>=t.right-D?(T.x=mt.Forward,I.x=i*Math.abs((t.right-D-h)/D)):!y&&f<=t.left+D&&(T.x=mt.Backward,I.x=i*Math.abs((t.left+D-f)/D)),{direction:T,speed:I}}function ki(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:f}=window;return{top:0,left:0,right:l,bottom:f,width:l,height:f}}const{top:t,left:n,right:i,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:i,bottom:a,width:e.clientWidth,height:e.clientHeight}}function Hr(e){return e.reduce((t,n)=>$t(t,go(n)),kt)}function Vr(e,t){if(t===void 0&&(t=Xt),!e)return;const{top:n,left:i,bottom:a,right:l}=t(e);Nr(e)&&(a<=0||l<=0||n>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mi=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+Pr(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+jr(n),0)}]];class ho{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Hn(n),a=Hr(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,f,h]of Mi)for(const c of f)Object.defineProperty(this,c,{get:()=>{const C=h(i),M=a[l]-C;return this.rect[c]+M},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ln{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=t}add(t,n,i){var a;(a=this.target)==null||a.addEventListener(t,n,i),this.listeners.push([t,n,i])}}function so(e,t){const n=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+i**2)>t:"x"in t&&"y"in t?n>t.x&&i>t.y:"x"in t?n>t.x:"y"in t&&i>t.y}var qt,Ye;function Zo(e){e.preventDefault()}function Ti(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(qt||(qt={})),(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ye||(Ye={}));const Ur={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},Ii=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ye.Right:return{...n,x:n.x+25};case Ye.Left:return{...n,x:n.x-25};case Ye.Down:return{...n,y:n.y+25};case Ye.Up:return{...n,y:n.y-25}}};class So{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ln(_t(n)),this.windowListeners=new ln(Ct(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,i=t.node.current;i&&Vr(i),n(kt)}handleKeyDown(t){if(On(t)){const{active:n,context:i,options:a}=this.props,{keyboardCodes:l=Ur,coordinateGetter:f=Ii,scrollBehavior:h="smooth"}=a,{code:c}=t;if(l.end.includes(c))return void this.handleEnd(t);if(l.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:C}=i.current,M=C?{x:C.left,y:C.top}:kt;this.referenceCoordinates||(this.referenceCoordinates=M);const y=f(t,{active:n,context:i.current,currentCoordinates:M});if(y){const p=dn(y,M),T={x:0,y:0},{scrollableAncestors:I}=i.current;for(const z of I){const D=t.code,{isTop:_,isRight:$,isLeft:w,isBottom:N,maxScroll:v,minScroll:E}=Or(z),q=ki(z),Z={x:Math.min(D===Ye.Right?q.right-q.width/2:q.right,Math.max(D===Ye.Right?q.left:q.left+q.width/2,y.x)),y:Math.min(D===Ye.Down?q.bottom-q.height/2:q.bottom,Math.max(D===Ye.Down?q.top:q.top+q.height/2,y.y))},F=D===Ye.Right&&!$||D===Ye.Left&&!w,P=D===Ye.Down&&!N||D===Ye.Up&&!_;if(F&&Z.x!==y.x){const W=z.scrollLeft+p.x,pe=D===Ye.Right&&W<=v.x||D===Ye.Left&&W>=E.x;if(pe&&!p.y)return void z.scrollTo({left:W,behavior:h});T.x=pe?z.scrollLeft-W:D===Ye.Right?z.scrollLeft-v.x:z.scrollLeft-E.x,T.x&&z.scrollBy({left:-T.x,behavior:h});break}if(P&&Z.y!==y.y){const W=z.scrollTop+p.y,pe=D===Ye.Down&&W<=v.y||D===Ye.Up&&W>=E.y;if(pe&&!p.x)return void z.scrollTo({top:W,behavior:h});T.y=pe?z.scrollTop-W:D===Ye.Down?z.scrollTop-v.y:z.scrollTop-E.y,T.y&&z.scrollBy({top:-T.y,behavior:h});break}}this.handleMove(t,$t(dn(y,this.referenceCoordinates),T))}}}handleMove(t,n){const{onMove:i}=this.props;t.preventDefault(),i(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Xo(e){return!!(e&&"distance"in e)}function Yo(e){return!!(e&&"delay"in e)}So.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:i=Ur,onActivation:a}=t,{active:l}=n;const{code:f}=e.nativeEvent;if(i.start.includes(f)){const h=l.activatorNode.current;return(!h||e.target===h)&&(e.preventDefault(),a?.({event:e.nativeEvent}),!0)}return!1}}];class Ro{constructor(t,n,i){var a;i===void 0&&(i=(function(h){const{EventTarget:c}=Ct(h);return h instanceof c?h:_t(h)})(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:f}=l;this.props=t,this.events=n,this.document=_t(f),this.documentListeners=new ln(this.document),this.listeners=new ln(i),this.windowListeners=new ln(Ct(f)),this.initialCoordinates=(a=Dn(l))!=null?a:kt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(qt.Resize,this.handleCancel),this.windowListeners.add(qt.DragStart,Zo),this.windowListeners.add(qt.VisibilityChange,this.handleCancel),this.windowListeners.add(qt.ContextMenu,Zo),this.documentListeners.add(qt.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yo(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Xo(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:i,onPending:a}=this.props;a(i,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(qt.Click,Ti,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:i,initialCoordinates:a,props:l}=this,{onMove:f,options:{activationConstraint:h}}=l;if(!a)return;const c=(n=Dn(t))!=null?n:kt,C=dn(a,c);if(!i&&h){if(Xo(h)){if(h.tolerance!=null&&so(C,h.tolerance))return this.handleCancel();if(so(C,h.distance))return this.handleStart()}return Yo(h)&&so(C,h.tolerance)?this.handleCancel():void this.handlePending(h,C)}t.cancelable&&t.preventDefault(),f(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ei={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Kr extends Ro{constructor(t){const{event:n}=t,i=_t(n.target);super(t,Ei,i)}}Kr.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return!(!n.isPrimary||n.button!==0)&&(i?.({event:n}),!0)}}];const Fi={move:{name:"mousemove"},end:{name:"mouseup"}};var mo;(function(e){e[e.RightClick=2]="RightClick"})(mo||(mo={}));class $r extends Ro{constructor(t){super(t,Fi,_t(t.event.target))}}$r.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;return n.button!==mo.RightClick&&(i?.({event:n}),!0)}}];const co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Wr extends Ro{constructor(t){super(t,co)}static setup(){return window.addEventListener(co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(co.move.name,t)};function t(){}}}var an,Ln;function Ai(e){let{acceleration:t,activator:n=an.Pointer,canScroll:i,draggingRect:a,enabled:l,interval:f=5,order:h=Ln.TreeOrder,pointerCoordinates:c,scrollableAncestors:C,scrollableAncestorRects:M,delta:y,threshold:p}=e;const T=(function(E){let{delta:q,disabled:Z}=E;const F=An(q);return rn(P=>{if(Z||!F||!P)return Di;const W={x:Math.sign(q.x-F.x),y:Math.sign(q.y-F.y)};return{x:{[mt.Backward]:P.x[mt.Backward]||W.x===-1,[mt.Forward]:P.x[mt.Forward]||W.x===1},y:{[mt.Backward]:P.y[mt.Backward]||W.y===-1,[mt.Forward]:P.y[mt.Forward]||W.y===1}}},[Z,q,F])})({delta:y,disabled:!l}),[I,z]=(function(){const E=o.useRef(null);return[o.useCallback((q,Z)=>{E.current=setInterval(q,Z)},[]),o.useCallback(()=>{E.current!==null&&(clearInterval(E.current),E.current=null)},[])]})(),D=o.useRef({x:0,y:0}),_=o.useRef({x:0,y:0}),$=o.useMemo(()=>{switch(n){case an.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case an.DraggableRect:return a}},[n,a,c]),w=o.useRef(null),N=o.useCallback(()=>{const E=w.current;if(!E)return;const q=D.current.x*_.current.x,Z=D.current.y*_.current.y;E.scrollBy(q,Z)},[]),v=o.useMemo(()=>h===Ln.TreeOrder?[...C].reverse():C,[h,C]);o.useEffect(()=>{if(l&&C.length&&$){for(const E of v){if(i?.(E)===!1)continue;const q=C.indexOf(E),Z=M[q];if(!Z)continue;const{direction:F,speed:P}=Ri(E,Z,$,t,p);for(const W of["x","y"])T[W][F[W]]||(P[W]=0,F[W]=0);if(P.x>0||P.y>0)return z(),w.current=E,I(N,f),D.current=P,void(_.current=F)}D.current={x:0,y:0},_.current={x:0,y:0},z()}else z()},[t,N,i,z,l,f,JSON.stringify($),JSON.stringify(T),I,C,v,M,JSON.stringify(p)])}Wr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:i}=t;const{touches:a}=n;return!(a.length>1)&&(i?.({event:n}),!0)}}],(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(an||(an={})),(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ln||(Ln={}));const Di={x:{[mt.Backward]:!1,[mt.Forward]:!1},y:{[mt.Backward]:!1,[mt.Forward]:!1}};var un,fo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(un||(un={})),(function(e){e.Optimized="optimized"})(fo||(fo={}));const Jo=new Map;function po(e,t){return rn(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Nn(e){let{callback:t,disabled:n}=e;const i=Bn(t),a=o.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:l}=window;return new l(i)},[n]);return o.useEffect(()=>()=>a?.disconnect(),[a]),a}function zi(e){return new ho(Xt(e),e)}function Qo(e,t,n){t===void 0&&(t=zi);const[i,a]=o.useState(null);function l(){a(c=>{if(!e)return null;var C;if(e.isConnected===!1)return(C=c??n)!=null?C:null;const M=t(e);return JSON.stringify(c)===JSON.stringify(M)?c:M})}const f=(function(c){let{callback:C,disabled:M}=c;const y=Bn(C),p=o.useMemo(()=>{if(M||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:T}=window;return new T(y)},[y,M]);return o.useEffect(()=>()=>p?.disconnect(),[p]),p})({callback(c){if(e)for(const C of c){const{type:M,target:y}=C;if(M==="childList"&&y instanceof HTMLElement&&y.contains(e)){l();break}}}}),h=Nn({callback:l});return Rt(()=>{l(),e?(h?.observe(e),f?.observe(document.body,{childList:!0,subtree:!0})):(h?.disconnect(),f?.disconnect())},[e]),i}const er=[];function tr(e,t){t===void 0&&(t=[]);const n=o.useRef(null);return o.useEffect(()=>{n.current=null},t),o.useEffect(()=>{const i=e!==kt;i&&!n.current&&(n.current=e),!i&&n.current&&(n.current=null)},[e]),n.current?dn(e,n.current):kt}function nr(e){return o.useMemo(()=>e?(function(t){const n=t.innerWidth,i=t.innerHeight;return{top:0,left:0,right:n,bottom:i,width:n,height:i}})(e):null,[e])}const or=[];function Gr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return gn(t)?t:e}const Li=[{sensor:Kr,options:{}},{sensor:So,options:{}}],Ni={current:{}},Mn={draggable:{measure:_o},droppable:{measure:_o,strategy:un.WhileDragging,frequency:fo.Optimized},dragOverlay:{measure:Xt}};class sn extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,i;return(n=(i=this.get(t))==null?void 0:i.node.current)!=null?n:void 0}}const Pi={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Mn,measureDroppableContainers:zn,windowRect:null,measuringScheduled:!1},_r={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zn,draggableNodes:new Map,over:null,measureDroppableContainers:zn},mn=o.createContext(_r),Zr=o.createContext(Pi);function ji(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sn}}}function Bi(e,t){switch(t.type){case ht.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ht.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ht.DragEnd:case ht.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ht.RegisterDroppable:{const{element:n}=t,{id:i}=n,a=new sn(e.droppable.containers);return a.set(i,n),{...e,droppable:{...e.droppable,containers:a}}}case ht.SetDroppableDisabled:{const{id:n,key:i,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||i!==l.key)return e;const f=new sn(e.droppable.containers);return f.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:f}}}case ht.UnregisterDroppable:{const{id:n,key:i}=t,a=e.droppable.containers.get(n);if(!a||i!==a.key)return e;const l=new sn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Oi(e){let{disabled:t}=e;const{active:n,activatorEvent:i,draggableNodes:a}=o.useContext(mn),l=An(i),f=An(n?.id);return o.useEffect(()=>{if(!t&&!i&&l&&f!=null){if(!On(l)||document.activeElement===l.target)return;const h=a.get(f);if(!h)return;const{activatorNode:c,node:C}=h;if(!c.current&&!C.current)return;requestAnimationFrame(()=>{for(const M of[c.current,C.current]){if(!M)continue;const y=ci(M);if(y){y.focus();break}}})}},[i,t,a,f,l]),null}function Xr(e,t){let{transform:n,...i}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...i}),n):n}const Vn=o.createContext({...kt,scaleX:1,scaleY:1});var Ft;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ft||(Ft={}));const Hi=o.memo(function(e){var t,n,i,a;let{id:l,accessibility:f,autoScroll:h=!0,children:c,sensors:C=Li,collisionDetection:M=wi,measuring:y,modifiers:p,...T}=e;const I=o.useReducer(Bi,void 0,ji),[z,D]=I,[_,$]=(function(){const[V]=o.useState(()=>new Set),X=o.useCallback(oe=>(V.add(oe),()=>V.delete(oe)),[V]);return[o.useCallback(oe=>{let{type:Fe,event:Ue}=oe;V.forEach(Oe=>{var Se;return(Se=Oe[Fe])==null?void 0:Se.call(Oe,Ue)})},[V]),X]})(),[w,N]=o.useState(Ft.Uninitialized),v=w===Ft.Initialized,{draggable:{active:E,nodes:q,translate:Z},droppable:{containers:F}}=z,P=E!=null?q.get(E):null,W=o.useRef({initial:null,translated:null}),pe=o.useMemo(()=>{var V;return E!=null?{id:E,data:(V=P?.data)!=null?V:Ni,rect:W}:null},[E,P]),de=o.useRef(null),[le,R]=o.useState(null),[te,k]=o.useState(null),b=cn(T,Object.values(T)),ee=hn("DndDescribedBy",l),ne=o.useMemo(()=>F.getEnabled(),[F]),Re=(Ce=y,o.useMemo(()=>({draggable:{...Mn.draggable,...Ce?.draggable},droppable:{...Mn.droppable,...Ce?.droppable},dragOverlay:{...Mn.dragOverlay,...Ce?.dragOverlay}}),[Ce?.draggable,Ce?.droppable,Ce?.dragOverlay]));var Ce;const{droppableRects:ye,measureDroppableContainers:Pe,measuringScheduled:ze}=(function(V,X){let{dragging:oe,dependencies:Fe,config:Ue}=X;const[Oe,Se]=o.useState(null),{frequency:He,measure:ve,strategy:De}=Ue,be=o.useRef(V),ke=(function(){switch(De){case un.Always:return!1;case un.BeforeDragging:return oe;default:return!oe}})(),Ne=cn(ke),Ze=o.useCallback(function(at){at===void 0&&(at=[]),Ne.current||Se(ot=>ot===null?at:ot.concat(at.filter($e=>!ot.includes($e))))},[Ne]),_e=o.useRef(null),Xe=rn(at=>{if(ke&&!oe)return Jo;if(!at||at===Jo||be.current!==V||Oe!=null){const ot=new Map;for(let $e of V){if(!$e)continue;if(Oe&&Oe.length>0&&!Oe.includes($e.id)&&$e.rect.current){ot.set($e.id,$e.rect.current);continue}const lt=$e.node.current,it=lt?new ho(ve(lt),lt):null;$e.rect.current=it,it&&ot.set($e.id,it)}return ot}return at},[V,Oe,oe,ke,ve]);return o.useEffect(()=>{be.current=V},[V]),o.useEffect(()=>{ke||Ze()},[oe,ke]),o.useEffect(()=>{Oe&&Oe.length>0&&Se(null)},[JSON.stringify(Oe)]),o.useEffect(()=>{ke||typeof He!="number"||_e.current!==null||(_e.current=setTimeout(()=>{Ze(),_e.current=null},He))},[He,ke,Ze,...Fe]),{droppableRects:Xe,measureDroppableContainers:Ze,measuringScheduled:Oe!=null}})(ne,{dragging:v,dependencies:[Z.x,Z.y],config:Re.droppable}),Ae=(function(V,X){const oe=X!=null?V.get(X):void 0,Fe=oe?oe.node.current:null;return rn(Ue=>{var Oe;return X==null?null:(Oe=Fe??Ue)!=null?Oe:null},[Fe,X])})(q,E),Ie=o.useMemo(()=>te?Dn(te):null,[te]),ue=(function(){const V=le?.autoScrollEnabled===!1,X=typeof h=="object"?h.enabled===!1:h===!1,oe=v&&!V&&!X;return typeof h=="object"?{...h,enabled:oe}:{enabled:oe}})(),O=(function(V,X){return po(V,X)})(Ae,Re.draggable.measure);(function(V){let{activeNode:X,measure:oe,initialRect:Fe,config:Ue=!0}=V;const Oe=o.useRef(!1),{x:Se,y:He}=typeof Ue=="boolean"?{x:Ue,y:Ue}:Ue;Rt(()=>{if(!Se&&!He||!X)return void(Oe.current=!1);if(Oe.current||!Fe)return;const ve=X?.node.current;if(!ve||ve.isConnected===!1)return;const De=Go(oe(ve),Fe);if(Se||(De.x=0),He||(De.y=0),Oe.current=!0,Math.abs(De.x)>0||Math.abs(De.y)>0){const be=Nr(ve);be&&be.scrollBy({top:De.y,left:De.x})}},[X,Se,He,Fe,oe])})({activeNode:E!=null?q.get(E):null,config:ue.layoutShiftCompensation,initialRect:O,measure:Re.draggable.measure});const xe=Qo(Ae,Re.draggable.measure,O),Le=Qo(Ae?Ae.parentElement:null),H=o.useRef({activatorEvent:null,active:null,activeNode:Ae,collisionRect:null,collisions:null,droppableRects:ye,draggableNodes:q,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),U=F.getNodeFor((t=H.current.over)==null?void 0:t.id),he=(function(V){let{measure:X}=V;const[oe,Fe]=o.useState(null),Ue=Nn({callback:o.useCallback(ve=>{for(const{target:De}of ve)if(gn(De)){Fe(be=>{const ke=X(De);return be?{...be,width:ke.width,height:ke.height}:ke});break}},[X])}),Oe=o.useCallback(ve=>{const De=Gr(ve);Ue?.disconnect(),De&&Ue?.observe(De),Fe(De?X(De):null)},[X,Ue]),[Se,He]=Fn(Oe);return o.useMemo(()=>({nodeRef:Se,rect:oe,setRef:He}),[oe,Se,He])})({measure:Re.dragOverlay.measure}),ce=(n=he.nodeRef.current)!=null?n:Ae,me=v?(i=he.rect)!=null?i:xe:null,Te=!!(he.nodeRef.current&&he.rect),ie=Go(qe=Te?null:xe,po(qe));var qe;const g=nr(ce?Ct(ce):null),je=(function(V){const X=o.useRef(V),oe=rn(Fe=>V?Fe&&Fe!==er&&V&&X.current&&V.parentNode===X.current.parentNode?Fe:Hn(V):er,[V]);return o.useEffect(()=>{X.current=V},[V]),oe})(v?U??Ae:null),Be=(function(V,X){X===void 0&&(X=Xt);const[oe]=V,Fe=nr(oe?Ct(oe):null),[Ue,Oe]=o.useState(or);function Se(){Oe(()=>V.length?V.map(ve=>Br(ve)?Fe:new ho(X(ve),ve)):or)}const He=Nn({callback:Se});return Rt(()=>{He?.disconnect(),Se(),V.forEach(ve=>He?.observe(ve))},[V]),Ue})(je),Ee=Xr(p,{transform:{x:Z.x-ie.x,y:Z.y-ie.y,scaleX:1,scaleY:1},activatorEvent:te,active:pe,activeNodeRect:xe,containerNodeRect:Le,draggingNodeRect:me,over:H.current.over,overlayNodeRect:he.rect,scrollableAncestors:je,scrollableAncestorRects:Be,windowRect:g}),u=Ie?$t(Ie,Z):null,L=(function(V){const[X,oe]=o.useState(null),Fe=o.useRef(V),Ue=o.useCallback(Oe=>{const Se=ao(Oe.target);Se&&oe(He=>He?(He.set(Se,go(Se)),new Map(He)):null)},[]);return o.useEffect(()=>{const Oe=Fe.current;if(V!==Oe){Se(Oe);const He=V.map(ve=>{const De=ao(ve);return De?(De.addEventListener("scroll",Ue,{passive:!0}),[De,go(De)]):null}).filter(ve=>ve!=null);oe(He.length?new Map(He):null),Fe.current=V}return()=>{Se(V),Se(Oe)};function Se(He){He.forEach(ve=>{const De=ao(ve);De?.removeEventListener("scroll",Ue)})}},[Ue,V]),o.useMemo(()=>V.length?X?Array.from(X.values()).reduce((Oe,Se)=>$t(Oe,Se),kt):Hr(V):kt,[V,X])})(je),K=tr(L),m=tr(L,[xe]),A=$t(Ee,K),G=me?xi(me,Ee):null,J=pe&&G?M({active:pe,collisionRect:G,droppableRects:ye,droppableContainers:ne,pointerCoordinates:u}):null,re=zr(J,"id"),[x,B]=o.useState(null),S=(function(V,X,oe){return{...V,scaleX:X&&oe?X.width/oe.width:1,scaleY:X&&oe?X.height/oe.height:1}})(Te?Ee:$t(Ee,m),(a=x?.rect)!=null?a:null,xe),j=o.useRef(null),se=o.useCallback((V,X)=>{let{sensor:oe,options:Fe}=X;if(de.current==null)return;const Ue=q.get(de.current);if(!Ue)return;const Oe=V.nativeEvent,Se=new oe({active:de.current,activeNode:Ue,event:Oe,options:Fe,context:H,onAbort(ve){if(!q.get(ve))return;const{onDragAbort:De}=b.current,be={id:ve};De?.(be),_({type:"onDragAbort",event:be})},onPending(ve,De,be,ke){if(!q.get(ve))return;const{onDragPending:Ne}=b.current,Ze={id:ve,constraint:De,initialCoordinates:be,offset:ke};Ne?.(Ze),_({type:"onDragPending",event:Ze})},onStart(ve){const De=de.current;if(De==null)return;const be=q.get(De);if(!be)return;const{onDragStart:ke}=b.current,Ne={activatorEvent:Oe,active:{id:De,data:be.data,rect:W}};Kt.unstable_batchedUpdates(()=>{ke?.(Ne),N(Ft.Initializing),D({type:ht.DragStart,initialCoordinates:ve,active:De}),_({type:"onDragStart",event:Ne}),R(j.current),k(Oe)})},onMove(ve){D({type:ht.DragMove,coordinates:ve})},onEnd:He(ht.DragEnd),onCancel:He(ht.DragCancel)});function He(ve){return async function(){const{active:De,collisions:be,over:ke,scrollAdjustedTranslate:Ne}=H.current;let Ze=null;if(De&&Ne){const{cancelDrop:_e}=b.current;Ze={activatorEvent:Oe,active:De,collisions:be,delta:Ne,over:ke},ve===ht.DragEnd&&typeof _e=="function"&&await Promise.resolve(_e(Ze))&&(ve=ht.DragCancel)}de.current=null,Kt.unstable_batchedUpdates(()=>{D({type:ve}),N(Ft.Uninitialized),B(null),R(null),k(null),j.current=null;const _e=ve===ht.DragEnd?"onDragEnd":"onDragCancel";if(Ze){const Xe=b.current[_e];Xe?.(Ze),_({type:_e,event:Ze})}})}}j.current=Se},[q]),ae=o.useCallback((V,X)=>(oe,Fe)=>{const Ue=oe.nativeEvent,Oe=q.get(Fe);if(de.current!==null||!Oe||Ue.dndKit||Ue.defaultPrevented)return;const Se={active:Oe};V(oe,X.options,Se)===!0&&(Ue.dndKit={capturedBy:X.sensor},de.current=Fe,se(oe,X))},[q,se]),we=(function(V,X){return o.useMemo(()=>V.reduce((oe,Fe)=>{const{sensor:Ue}=Fe;return[...oe,...Ue.activators.map(Oe=>({eventName:Oe.eventName,handler:X(Oe.handler,Fe)}))]},[]),[V,X])})(C,ae);(function(V){o.useEffect(()=>{if(!jn)return;const X=V.map(oe=>{let{sensor:Fe}=oe;return Fe.setup==null?void 0:Fe.setup()});return()=>{for(const oe of X)oe?.()}},V.map(X=>{let{sensor:oe}=X;return oe}))})(C),Rt(()=>{xe&&w===Ft.Initializing&&N(Ft.Initialized)},[xe,w]),o.useEffect(()=>{const{onDragMove:V}=b.current,{active:X,activatorEvent:oe,collisions:Fe,over:Ue}=H.current;if(!X||!oe)return;const Oe={active:X,activatorEvent:oe,collisions:Fe,delta:{x:A.x,y:A.y},over:Ue};Kt.unstable_batchedUpdates(()=>{V?.(Oe),_({type:"onDragMove",event:Oe})})},[A.x,A.y]),o.useEffect(()=>{const{active:V,activatorEvent:X,collisions:oe,droppableContainers:Fe,scrollAdjustedTranslate:Ue}=H.current;if(!V||de.current==null||!X||!Ue)return;const{onDragOver:Oe}=b.current,Se=Fe.get(re),He=Se&&Se.rect.current?{id:Se.id,rect:Se.rect.current,data:Se.data,disabled:Se.disabled}:null,ve={active:V,activatorEvent:X,collisions:oe,delta:{x:Ue.x,y:Ue.y},over:He};Kt.unstable_batchedUpdates(()=>{B(He),Oe?.(ve),_({type:"onDragOver",event:ve})})},[re]),Rt(()=>{H.current={activatorEvent:te,active:pe,activeNode:Ae,collisionRect:G,collisions:J,droppableRects:ye,draggableNodes:q,draggingNode:ce,draggingNodeRect:me,droppableContainers:F,over:x,scrollableAncestors:je,scrollAdjustedTranslate:A},W.current={initial:me,translated:G}},[pe,Ae,J,G,q,ce,me,ye,F,x,je,A]),Ai({...ue,delta:Z,draggingRect:G,pointerCoordinates:u,scrollableAncestors:je,scrollableAncestorRects:Be});const Y=o.useMemo(()=>({active:pe,activeNode:Ae,activeNodeRect:xe,activatorEvent:te,collisions:J,containerNodeRect:Le,dragOverlay:he,draggableNodes:q,droppableContainers:F,droppableRects:ye,over:x,measureDroppableContainers:Pe,scrollableAncestors:je,scrollableAncestorRects:Be,measuringConfiguration:Re,measuringScheduled:ze,windowRect:g}),[pe,Ae,xe,te,J,Le,he,q,F,ye,x,Pe,je,Be,Re,ze,g]),fe=o.useMemo(()=>({activatorEvent:te,activators:we,active:pe,activeNodeRect:xe,ariaDescribedById:{draggable:ee},dispatch:D,draggableNodes:q,over:x,measureDroppableContainers:Pe}),[te,we,pe,xe,D,ee,q,x,Pe]);return o.createElement(Fr.Provider,{value:$},o.createElement(mn.Provider,{value:fe},o.createElement(Zr.Provider,{value:Y},o.createElement(Vn.Provider,{value:S},c)),o.createElement(Oi,{disabled:f?.restoreFocus===!1})),o.createElement(fi,{...f,hiddenTextDescribedById:ee}))}),Vi=o.createContext(null),rr="button";function Ui(e){let{id:t,data:n,disabled:i=!1,attributes:a}=e;const l=hn("Draggable"),{activators:f,activatorEvent:h,active:c,activeNodeRect:C,ariaDescribedById:M,draggableNodes:y,over:p}=o.useContext(mn),{role:T=rr,roleDescription:I="draggable",tabIndex:z=0}=a??{},D=c?.id===t,_=o.useContext(D?Vn:Vi),[$,w]=Fn(),[N,v]=Fn(),E=(function(Z,F){return o.useMemo(()=>Z.reduce((P,W)=>{let{eventName:pe,handler:de}=W;return P[pe]=le=>{de(le,F)},P},{}),[Z,F])})(f,t),q=cn(n);return Rt(()=>(y.set(t,{id:t,key:l,node:$,activatorNode:N,data:q}),()=>{const Z=y.get(t);Z&&Z.key===l&&y.delete(t)}),[y,t]),{active:c,activatorEvent:h,activeNodeRect:C,attributes:o.useMemo(()=>({role:T,tabIndex:z,"aria-disabled":i,"aria-pressed":!(!D||T!==rr)||void 0,"aria-roledescription":I,"aria-describedby":M.draggable}),[i,T,z,D,I,M.draggable]),isDragging:D,listeners:i?void 0:E,node:$,over:p,setNodeRef:w,setActivatorNodeRef:v,transform:_}}function Yr(){return o.useContext(Zr)}const Ki={timeout:25};function $i(e){let{animation:t,children:n}=e;const[i,a]=o.useState(null),[l,f]=o.useState(null),h=An(n);return n||i||!h||a(h),Rt(()=>{if(!l)return;const c=i?.key,C=i?.props.id;c!=null&&C!=null?Promise.resolve(t(C,l)).then(()=>{a(null)}):a(null)},[t,i,l]),o.createElement(o.Fragment,null,n,i?o.cloneElement(i,{ref:f}):null)}const Wi={x:0,y:0,scaleX:1,scaleY:1};function Gi(e){let{children:t}=e;return o.createElement(mn.Provider,{value:_r},o.createElement(Vn.Provider,{value:Wi},t))}const _i={position:"fixed",touchAction:"none"},Zi=e=>On(e)?"transform 250ms ease":void 0,Xi=o.forwardRef((e,t)=>{let{as:n,activatorEvent:i,adjustScale:a,children:l,className:f,rect:h,style:c,transform:C,transition:M=Zi}=e;if(!h)return null;const y=a?C:{...C,scaleX:1,scaleY:1},p={..._i,width:h.width,height:h.height,top:h.top,left:h.left,transform:Lt.Transform.toString(y),transformOrigin:a&&i?pi(i,h):void 0,transition:typeof M=="function"?M(i):M,...c};return o.createElement(n,{className:f,style:p,ref:t},l)}),Yi=e=>t=>{let{active:n,dragOverlay:i}=t;const a={},{styles:l,className:f}=e;if(l!=null&&l.active)for(const[h,c]of Object.entries(l.active))c!==void 0&&(a[h]=n.node.style.getPropertyValue(h),n.node.style.setProperty(h,c));if(l!=null&&l.dragOverlay)for(const[h,c]of Object.entries(l.dragOverlay))c!==void 0&&i.node.style.setProperty(h,c);return f!=null&&f.active&&n.node.classList.add(f.active),f!=null&&f.dragOverlay&&i.node.classList.add(f.dragOverlay),function(){for(const[h,c]of Object.entries(a))n.node.style.setProperty(h,c);f!=null&&f.active&&n.node.classList.remove(f.active)}},Jr={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Lt.Transform.toString(t)},{transform:Lt.Transform.toString(n)}]},sideEffects:Yi({styles:{active:{opacity:"0"}}})};function Ji(e){let{config:t,draggableNodes:n,droppableContainers:i,measuringConfiguration:a}=e;return Bn((l,f)=>{if(t===null)return;const h=n.get(l);if(!h)return;const c=h.node.current;if(!c)return;const C=Gr(f);if(!C)return;const{transform:M}=Ct(f).getComputedStyle(f),y=Lr(M);if(!y)return;const p=typeof t=="function"?t:(function(T){const{duration:I,easing:z,sideEffects:D,keyframes:_}={...Jr,...T};return $=>{let{active:w,dragOverlay:N,transform:v,...E}=$;if(!I)return;const q={x:N.rect.left-w.rect.left,y:N.rect.top-w.rect.top},Z={scaleX:v.scaleX!==1?w.rect.width*v.scaleX/N.rect.width:1,scaleY:v.scaleY!==1?w.rect.height*v.scaleY/N.rect.height:1},F={x:v.x-q.x,y:v.y-q.y,...Z},P=_({...E,active:w,dragOverlay:N,transform:{initial:v,final:F}}),[W]=P,pe=P[P.length-1];if(JSON.stringify(W)===JSON.stringify(pe))return;const de=D?.({active:w,dragOverlay:N,...E}),le=N.node.animate(P,{duration:I,easing:z,fill:"forwards"});return new Promise(R=>{le.onfinish=()=>{de?.(),R()}})}})(t);return Vr(c,a.draggable.measure),p({active:{id:l,data:h.data,node:c,rect:a.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:f,rect:a.dragOverlay.measure(C)},droppableContainers:i,measuringConfiguration:a,transform:y})})}let lr=0;function Qi(e){return o.useMemo(()=>{if(e!=null)return lr++,lr},[e])}const ea=o.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:i,style:a,transition:l,modifiers:f,wrapperElement:h="div",className:c,zIndex:C=999}=e;const{activatorEvent:M,active:y,activeNodeRect:p,containerNodeRect:T,draggableNodes:I,droppableContainers:z,dragOverlay:D,over:_,measuringConfiguration:$,scrollableAncestors:w,scrollableAncestorRects:N,windowRect:v}=Yr(),E=o.useContext(Vn),q=Qi(y?.id),Z=Xr(f,{activatorEvent:M,active:y,activeNodeRect:p,containerNodeRect:T,draggingNodeRect:D.rect,over:_,overlayNodeRect:D.rect,scrollableAncestors:w,scrollableAncestorRects:N,transform:E,windowRect:v}),F=po(p),P=Ji({config:i,draggableNodes:I,droppableContainers:z,measuringConfiguration:$}),W=F?D.setRef:void 0;return o.createElement(Gi,null,o.createElement($i,{animation:P},y&&q?o.createElement(Xi,{key:q,id:y.id,ref:W,as:h,activatorEvent:M,adjustScale:t,className:c,transition:l,rect:F,style:{zIndex:C,...a},transform:Z},n):null))});function ko(e,t,n){const i=e.slice();return i.splice(n<0?i.length+n:n,0,i.splice(t,1)[0]),i}function ta(e,t){return e.reduce((n,i,a)=>{const l=t.get(i);return l&&(n[a]=l),n},Array(e.length))}function Rn(e){return e!==null&&e>=0}const kn={scaleX:1,scaleY:1},na=e=>{var t;let{rects:n,activeNodeRect:i,activeIndex:a,overIndex:l,index:f}=e;const h=(t=n[a])!=null?t:i;if(!h)return null;const c=(function(C,M,y){const p=C[M],T=C[M-1],I=C[M+1];return!p||!T&&!I?0:y<M?T?p.left-(T.left+T.width):I.left-(p.left+p.width):I?I.left-(p.left+p.width):p.left-(T.left+T.width)})(n,f,a);if(f===a){const C=n[l];return C?{x:a<l?C.left+C.width-(h.left+h.width):C.left-h.left,y:0,...kn}:null}return f>a&&f<=l?{x:-h.width-c,y:0,...kn}:f<a&&f>=l?{x:h.width+c,y:0,...kn}:{x:0,y:0,...kn}},Mo=e=>{let{rects:t,activeIndex:n,overIndex:i,index:a}=e;const l=ko(t,i,n),f=t[a],h=l[a];return h&&f?{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}:null},Qr="Sortable",el=o.createContext({activeIndex:-1,containerId:Qr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mo,disabled:{draggable:!1,droppable:!1}});function oa(e){let{children:t,id:n,items:i,strategy:a=Mo,disabled:l=!1}=e;const{active:f,dragOverlay:h,droppableRects:c,over:C,measureDroppableContainers:M}=Yr(),y=hn(Qr,n),p=h.rect!==null,T=o.useMemo(()=>i.map(E=>typeof E=="object"&&"id"in E?E.id:E),[i]),I=f!=null,z=f?T.indexOf(f.id):-1,D=C?T.indexOf(C.id):-1,_=o.useRef(T),$=!(function(E,q){if(E===q)return!0;if(E.length!==q.length)return!1;for(let Z=0;Z<E.length;Z++)if(E[Z]!==q[Z])return!1;return!0})(T,_.current),w=D!==-1&&z===-1||$,N=(function(E){return typeof E=="boolean"?{draggable:E,droppable:E}:E})(l);Rt(()=>{$&&I&&M(T)},[$,T,I,M]),o.useEffect(()=>{_.current=T},[T]);const v=o.useMemo(()=>({activeIndex:z,containerId:y,disabled:N,disableTransforms:w,items:T,overIndex:D,useDragOverlay:p,sortedRects:ta(T,c),strategy:a}),[z,y,N.draggable,N.droppable,w,T,D,c,p,a]);return o.createElement(el.Provider,{value:v},t)}const ra=e=>{let{id:t,items:n,activeIndex:i,overIndex:a}=e;return ko(n,i,a).indexOf(t)},la=e=>{let{containerId:t,isSorting:n,wasDragging:i,index:a,items:l,newIndex:f,previousItems:h,previousContainerId:c,transition:C}=e;return!(!C||!i)&&(h===l||a!==f)&&(!!n||f!==a&&t===c)},ia={duration:200,easing:"ease"},tl="transform",aa=Lt.Transition.toString({property:tl,duration:0,easing:"linear"}),sa={roleDescription:"sortable"};function ca(e){let{animateLayoutChanges:t=la,attributes:n,disabled:i,data:a,getNewIndex:l=ra,id:f,strategy:h,resizeObserverConfig:c,transition:C=ia}=e;const{items:M,containerId:y,activeIndex:p,disabled:T,disableTransforms:I,sortedRects:z,overIndex:D,useDragOverlay:_,strategy:$}=o.useContext(el),w=(function(U,he){var ce,me;return typeof U=="boolean"?{draggable:U,droppable:!1}:{draggable:(ce=U?.draggable)!=null?ce:he.draggable,droppable:(me=U?.droppable)!=null?me:he.droppable}})(i,T),N=M.indexOf(f),v=o.useMemo(()=>({sortable:{containerId:y,index:N,items:M},...a}),[y,a,N,M]),E=o.useMemo(()=>M.slice(M.indexOf(f)),[M,f]),{rect:q,node:Z,isOver:F,setNodeRef:P}=(function(U){let{data:he,disabled:ce=!1,id:me,resizeObserverConfig:Te}=U;const ie=hn("Droppable"),{active:qe,dispatch:g,over:je,measureDroppableContainers:Be}=o.useContext(mn),Ee=o.useRef({disabled:ce}),u=o.useRef(!1),L=o.useRef(null),K=o.useRef(null),{disabled:m,updateMeasurementsFor:A,timeout:G}={...Ki,...Te},J=cn(A??me),re=Nn({callback:o.useCallback(()=>{u.current?(K.current!=null&&clearTimeout(K.current),K.current=setTimeout(()=>{Be(Array.isArray(J.current)?J.current:[J.current]),K.current=null},G)):u.current=!0},[G]),disabled:m||!qe}),x=o.useCallback((se,ae)=>{re&&(ae&&(re.unobserve(ae),u.current=!1),se&&re.observe(se))},[re]),[B,S]=Fn(x),j=cn(he);return o.useEffect(()=>{re&&B.current&&(re.disconnect(),u.current=!1,re.observe(B.current))},[B,re]),o.useEffect(()=>(g({type:ht.RegisterDroppable,element:{id:me,key:ie,disabled:ce,node:B,rect:L,data:j}}),()=>g({type:ht.UnregisterDroppable,key:ie,id:me})),[me]),o.useEffect(()=>{ce!==Ee.current.disabled&&(g({type:ht.SetDroppableDisabled,id:me,key:ie,disabled:ce}),Ee.current.disabled=ce)},[me,ie,ce,g]),{active:qe,rect:L,isOver:je?.id===me,node:B,over:je,setNodeRef:S}})({id:f,data:v,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:W,activatorEvent:pe,activeNodeRect:de,attributes:le,setNodeRef:R,listeners:te,isDragging:k,over:b,setActivatorNodeRef:ee,transform:ne}=Ui({id:f,data:v,attributes:{...sa,...n},disabled:w.draggable}),Re=(function(){for(var U=arguments.length,he=new Array(U),ce=0;ce<U;ce++)he[ce]=arguments[ce];return o.useMemo(()=>me=>{he.forEach(Te=>Te(me))},he)})(P,R),Ce=!!W,ye=Ce&&!I&&Rn(p)&&Rn(D),Pe=!_&&k,ze=Pe&&ye?ne:null,Ae=ye?ze??(h??$)({rects:z,activeNodeRect:de,activeIndex:p,overIndex:D,index:N}):null,Ie=Rn(p)&&Rn(D)?l({id:f,items:M,activeIndex:p,overIndex:D}):N,ue=W?.id,O=o.useRef({activeId:ue,items:M,newIndex:Ie,containerId:y}),xe=M!==O.current.items,Le=t({active:W,containerId:y,isDragging:k,isSorting:Ce,id:f,index:N,items:M,newIndex:O.current.newIndex,previousItems:O.current.items,previousContainerId:O.current.containerId,transition:C,wasDragging:O.current.activeId!=null}),H=(function(U){let{disabled:he,index:ce,node:me,rect:Te}=U;const[ie,qe]=o.useState(null),g=o.useRef(ce);return Rt(()=>{if(!he&&ce!==g.current&&me.current){const je=Te.current;if(je){const Be=Xt(me.current,{ignoreTransform:!0}),Ee={x:je.left-Be.left,y:je.top-Be.top,scaleX:je.width/Be.width,scaleY:je.height/Be.height};(Ee.x||Ee.y)&&qe(Ee)}}ce!==g.current&&(g.current=ce)},[he,ce,me,Te]),o.useEffect(()=>{ie&&qe(null)},[ie]),ie})({disabled:!Le,index:N,node:Z,rect:q});return o.useEffect(()=>{Ce&&O.current.newIndex!==Ie&&(O.current.newIndex=Ie),y!==O.current.containerId&&(O.current.containerId=y),M!==O.current.items&&(O.current.items=M)},[Ce,Ie,y,M]),o.useEffect(()=>{if(ue===O.current.activeId)return;if(ue!=null&&O.current.activeId==null)return void(O.current.activeId=ue);const U=setTimeout(()=>{O.current.activeId=ue},50);return()=>clearTimeout(U)},[ue]),{active:W,activeIndex:p,attributes:le,data:v,rect:q,index:N,newIndex:Ie,items:M,isOver:F,isSorting:Ce,isDragging:k,listeners:te,node:Z,overIndex:D,over:b,setNodeRef:Re,setActivatorNodeRef:ee,setDroppableNodeRef:P,setDraggableNodeRef:R,transform:H??Ae,transition:(function(){if(H||xe&&O.current.newIndex===N)return aa;if(!(Pe&&!On(pe)||!C)&&(Ce||Le))return Lt.Transition.toString({...C,property:tl})})()}}function Pn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const da=[Ye.Down,Ye.Right,Ye.Up,Ye.Left],ua=(e,t)=>{let{context:{active:n,collisionRect:i,droppableRects:a,droppableContainers:l,over:f,scrollableAncestors:h}}=t;if(da.includes(e.code)){if(e.preventDefault(),!n||!i)return;const c=[];l.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const p=a.get(y.id);if(p)switch(e.code){case Ye.Down:i.top<p.top&&c.push(y);break;case Ye.Up:i.top>p.top&&c.push(y);break;case Ye.Left:i.left>p.left&&c.push(y);break;case Ye.Right:i.left<p.left&&c.push(y)}});const C=(y=>{let{collisionRect:p,droppableRects:T,droppableContainers:I}=y;const z=$o(p),D=[];for(const _ of I){const{id:$}=_,w=T.get($);if(w){const N=$o(w),v=z.reduce((q,Z,F)=>q+Ar(N[F],Z),0),E=Number((v/4).toFixed(4));D.push({id:$,data:{droppableContainer:_,value:E}})}}return D.sort(Dr)})({collisionRect:i,droppableRects:a,droppableContainers:c});let M=zr(C,"id");if(M===f?.id&&C.length>1&&(M=C[1].id),M!=null){const y=l.get(n.id),p=l.get(M),T=p?a.get(p.id):null,I=p?.node.current;if(I&&T&&y&&p){const z=Hn(I).some((N,v)=>h[v]!==N),D=ir(y,p),_=(function(N,v){return!Pn(N)||!Pn(v)||!ir(N,v)?!1:N.data.current.sortable.index<v.data.current.sortable.index})(y,p),$=z||!D?{x:0,y:0}:{x:_?i.width-T.width:0,y:_?i.height-T.height:0},w={x:T.left,y:T.top};return $.x&&$.y?w:dn(w,$)}}}};function ir(e,t){return!(!Pn(e)||!Pn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const ga=e=>{let{transform:t}=e;return{...t,y:0}},nl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,index:l,editing:f,editable:h,selectedIndex:c,background:C,activeColor:M,borderColor:y,borderWidth:p,dragging:T,...I}=e;return s.jsxs("div",{ref:t,className:ct(a),style:{...i,display:"flex",flexDirection:"column",background:c===l?"white":C,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===l?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...I,children:[s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[s.jsx("div",{style:{marginLeft:c===l?"0px":"-1px",marginTop:c===l?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===l?s.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):s.jsx(s.Fragment,{})]}),s.jsx("div",{style:{flex:"1 1 100%",background:c===l&&M?M?.toCSS():"none",minHeight:"2px"}})]})})),St={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},ol=o.memo(o.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:i,fadeIn:a,handle:l,height:f,index:h,listeners:c,onRemove:C,renderItem:M,sorting:y,style:p,transition:T,transform:I,value:z,wrapperStyle:D,..._},$)=>{o.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=M?M({dragOverlay:!!t,dragging:!!n,sorting:!!y,index:h,fadeIn:!!a,listeners:c,ref:$,style:p,transform:I,transition:T,value:z}):s.jsx(s.Fragment,{children:z});return s.jsx("div",{className:ct("tab-item",St.Wrapper,a&&St.fadeIn,y&&St.sorting,t&&St.dragOverlay),style:{...D,transition:[T,D?.transition].filter(Boolean).join(", "),"--translate-x":I?`${Math.round(I.x)}px`:void 0,"--translate-y":I?`${Math.round(I.y)}px`:void 0,"--scale-x":I?.scaleX?`${I.scaleX}`:void 0,"--scale-y":I?.scaleY?`${I.scaleY}`:void 0,"--index":h},ref:$,children:s.jsx("div",{className:ct(St.Item,n&&St.dragging,l&&St.withHandle,t&&St.dragOverlay,i&&St.disabled,e&&St.color,"dragging"),style:p,"data-cypress":"draggable-item",...l?void 0:c,..._,tabIndex:l?void 0:-1,children:w})})})),ar={Row:"_Row_1kr10_1"},ha=o.memo(o.forwardRef(({children:e,horizontal:t,style:n},i)=>s.jsx("div",{ref:i,style:{...n},className:ct(ar.Row,t&&ar.horizontal),children:e}))),ma={...Jr},fa=o.memo(o.forwardRef((e,t)=>{const{className:n,activationConstraint:i,animateLayoutChanges:a,adjustScale:l=!1,collisionDetection:f=Ci,coordinateGetter:h=ua,dropAnimation:c=ma,getItemStyles:C=()=>({}),getNewIndex:M,handle:y=!1,items:p,onMove:T,isDisabled:I=()=>!1,measuring:z,modifiers:D,renderItem:_,renderDivider:$,reorderItems:w=ko,strategy:N=Mo,style:v,useDragOverlay:E=!0,onDragStart:q,wrapperStyle:Z=()=>({})}=e,[F,P]=o.useState(()=>p);o.useEffect(()=>{P(p)},[p]);const[W,pe]=o.useState(null),de=(function(){for(var b=arguments.length,ee=new Array(b),ne=0;ne<b;ne++)ee[ne]=arguments[ne];return o.useMemo(()=>[...ee].filter(Re=>Re!=null),[...ee])})(io($r,{activationConstraint:i}),io(Wr,{activationConstraint:i}),io(So,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:h})),le=F.indexOf.bind(F),R=W?le(W):-1,te=[];F.map((b,ee)=>{te.push(s.jsx(pa,{id:b,handle:y,index:ee,style:C,wrapperStyle:Z,disabled:I(b),renderItem:_,animateLayoutChanges:a,useDragOverlay:E,getNewIndex:M},b+"-"+ee));const ne=$?.({key:"divider-"+ee});ne&&te.push(ne)});const{getPortalContainer:k}=r.useFullscreenPortal();return s.jsxs(Hi,{sensors:de,collisionDetection:f,onDragStart:b=>{const{active:ee}=b;ee&&(q?.(b),pe(ee.id))},autoScroll:{canScroll:b=>!0},onDragEnd:b=>{if(pe(null),b.over){const ee=le(b.over.id);R!==ee&&(P(ne=>w(ne,R,ee)),T?.(R,ee))}},onDragCancel:()=>{pe(null)},measuring:z,modifiers:D,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...v},className:ct(n,St.Wrapper),children:s.jsx(oa,{items:F,strategy:N,children:s.jsx(ha,{ref:t,children:te})})}),E?Kt.createPortal(s.jsx(ea,{adjustScale:l,dropAnimation:c,children:W?s.jsx(ol,{value:F[R],handle:y,renderItem:_,wrapperStyle:Z({index:R,isDragging:!0,id:F[R]}),index:R,dragging:!0,style:C({id:F[R],index:R,isSorting:W!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),k()):null]})}));function pa({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:i,id:a,index:l,onRemove:f,style:h,renderItem:c,useDragOverlay:C,wrapperStyle:M}){const{attributes:y,isDragging:p,isSorting:T,listeners:I,overIndex:z,setNodeRef:D,transform:_,transition:$}=ca({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return s.jsx(ol,{ref:D,value:a,disabled:e,dragging:p,sorting:T,handle:i,renderItem:c,index:l,style:h({index:l,id:a,isDragging:p,isSorting:T,overIndex:z}),onRemove:f?()=>f(a):void 0,transform:_,transition:$,wrapperStyle:M({index:l,isDragging:p,id:a}),listeners:I,"data-index":l,"data-id":a,dragOverlay:!C&&p,...y})}const va="_TabStrip_3x0dp_1",Ca=new d.Color("rgb(33, 115, 70)"),ya="#eee",wa=e=>s.jsx(nl,{...e}),rl=o.memo(o.forwardRef((e,t)=>{const{children:n,style:i,className:a,selectedTabIndex:l=0,tabNames:f=[],onSelectedTabIndexChange:h,onTabNameChange:c,onTabMove:C,renderScrollButtonStart:M=r.defaultCreateScrollStartButton,renderScrollButtonEnd:y=r.defaultCreateScrollEndButton,renderScrollButtonEdge:p=r.defaultCreateScrollEdgeButton,renderTabButton:T=wa,renderTabDivider:I,propsEditLabel:z,disabled:D=!1,disableDrag:_=!1,background:$="white",activeColor:w=Ca,borderColor:N=ya,borderWidth:v=1}=e,[E,q]=o.useState(l),[Z,F]=o.useState(f),P=o.useCallback(ie=>{const qe=k.current?.[ie]?.closest(".tab-item")??k.current?.[ie];qe&&Pe.current?.scrollTo({top:qe.offsetTop,left:qe.offsetLeft,behavior:"smooth"})},[]);o.useEffect(()=>{P(l)},[l]);const W=o.useCallback((ie,qe)=>{qe!==E&&(q(qe),h?.(qe)),P(qe)},[h,E]),pe=o.useCallback((ie,qe)=>{C?.(ie,qe)},[C]),de=o.useRef(null),[le,R]=o.useState(-1),te=o.useCallback((ie,qe)=>{c?.(ie,qe)},[c]);o.useLayoutEffect(()=>{q(l)},[l]),o.useLayoutEffect(()=>{F(f)},[f]);const k=o.useRef([]),b=o.useRef(null);o.useImperativeHandle(t,()=>Object.assign({startEdit(ie){k.current?.[ie]?.startEdit()},cancel(ie){k.current?.[ie]?.cancel()}},b.current),[E,le]);const ee=o.useCallback(({value:ie,index:qe,dragging:g})=>{const{style:je,maxLength:Be,...Ee}=z||{},u=s.jsx(Tr,{ref:L=>{k.current[qe]=L},value:ie,disabled:D,maxLength:Be,style:{color:E===qe&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...je},styleHover:{},onSubmit:L=>(de.current=!1,R(-1),te(qe,L)),onCancel:()=>{de.current=!1,R(-1)},onChange:L=>{de.current=!0,R(qe)},...Ee});return T({onClick:L=>W(L,qe),value:ie,index:qe,editing:le===qe&&de.current,editable:!0,disabled:D,selectedIndex:E,background:$,activeColor:w,borderColor:N,borderWidth:v,dragging:g,children:u})},[E,te,W,z,D,le,T]),[ne,{width:Re}]=Wt(),[Ce,{width:ye}]=Wt(),Pe=o.useRef(null),[ze,Ae]=o.useState({left:0,top:0,width:0,height:0}),[Ie,ue]=o.useState(null);o.useEffect(()=>{Ie!==null&&Pe.current&&Pe.current.scrollTo({left:Ie,behavior:"smooth"})},[Ie]);const O=o.useCallback((ie,qe=!1)=>{if(!Pe.current)return 0;let g=Pe.current.firstChild.getBoundingClientRect(),je=Pe.current.firstChild.firstChild.children,Be=0;return Be=qe?0:r.ScrollUtils.getScrollTo(ie,g.left,je,!0,Math.max(0,ie-200)),ue(Be),Math.max(0,Be)},[]),xe=o.useCallback((ie,qe=!1)=>{if(!Pe.current)return 0;let g=Pe.current.firstChild.getBoundingClientRect(),je=Pe.current.firstChild.firstChild.children,Be=0;const Ee=Math.ceil(ye-Re);return Be=qe?Ee:r.ScrollUtils.getScrollTo(ie,g.left,je,!1,Math.max(0,ie+200)),ue(Be),Math.min(Ee,Be)},[ye,Re]),Le=o.useRef(null),H=o.useRef(null),U=o.useCallback(()=>{H.current&&(clearTimeout(H.current),H.current=null,Le.current=null)},[]),he=o.useCallback((ie,qe,g=260)=>{Le.current=ie,H.current=setTimeout(()=>{const je=qe?O(Le.current||ie):xe(Le.current||ie);je!==Le.current?he(je,qe,120):U()},g)},[O,xe,U]);o.useEffect(()=>()=>U(),[U]);const ce=o.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(ze.left)<=0||Math.floor(ye-Re)===0,orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>he(Pe.current.scrollLeft,!0),onClick:ie=>O(Math.min(Pe.current.scrollLeft,Ie??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[ze,Ie,ye,Re]),me=o.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(ye-Re)<=Math.ceil(ze.left),orientation:r.ScrollbarOrientation.Horizontal,onMouseUp:U,onMouseLeave:U,onMouseDown:()=>he(Pe.current.scrollLeft,!1),onClick:ie=>xe(Math.max(Pe.current.scrollLeft,Ie??0),ie.ctrlKey)}),[ze,Ie,ye,Re]),Te=o.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,p?.(ce)]}),[ce,me,M,y,n,p]);return s.jsxs("div",{style:{...i,display:"flex",alignItems:"stretch"},className:ct(va,a),ref:b,children:[s.jsx("div",{style:{borderTop:`solid ${N} ${v}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Te}),s.jsx("div",{className:"Tabs",ref:ne,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:s.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:Pe,onScroll:ie=>{Ae({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:s.jsx(fa,{isDisabled:ie=>D||_,items:Z,strategy:na,modifiers:[ga],ref:Ce,renderItem:ee,renderDivider:I,onMove:pe,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:p(me)})]})}));rl.displayName="TabStrip";const Tn=o.createContext(null);Tn.displayName="DocThemesContext";const ba="_script-editor_iy654_5",xa={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},qa=o.lazy(()=>Promise.resolve().then(()=>require("./Da611GSWMp5ncOGO.cjs")));let nn,on,Et=["define","require"],sr=!1,In="@0.7.27";In!=="@local"&&In!=="@0.0.0"||(In="");const Sa=`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${In}/types/scripting.d.ts`,cr=async(e,t,n)=>{const i=e.getModel();if(!i)return;const a=await t.languages.typescript.getTypeScriptWorker(),l=await a(i.uri),f=await l.getNavigationTree(i.uri.toString()),h=e.getPosition();let c={...h};c.lineNumber=1,c.column=1;let C=!1;for(let z=h.lineNumber;z>=1;z--)if(i.getLineContent(z).trim()===""){const D=To(f,i.getOffsetAt({lineNumber:z,column:1}),"function");if(!D||ka(D)){C=!0,c.lineNumber=z+1;break}{const _=D.spans[0].start;z=i.getPositionAt(_).lineNumber,c.lineNumber=z}}let M=n,y=!1;!C&&!M.startsWith(`
28
- `)&&c.lineNumber>1&&(M=`
29
- `+M,y=!0);let p=!1;i.getLineCount()>1&&(M.endsWith(`
30
-
31
- `)||(M+=`
32
-
33
- `,p=!0));const T=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${M}`}];let I=null;i.pushEditOperations([],T,z=>(I=z[0].range,y&&I.startLineNumber++,p&&I.endLineNumber--,[new t.Selection(I.startLineNumber,I.startColumn,I.endLineNumber,I.endColumn)])),e.setSelection({startLineNumber:I.endLineNumber,startColumn:I.endColumn,endLineNumber:I.startLineNumber,endColumn:I.startColumn})};function Ra(e,t){let n=null;const i=e.length;for(let a=0;!n&&a<i;a++){const l=e[a];l.getName()===t.text&&(n=l)}return n?n.getContext():"formula"}function vo(e,t,n,i,a=[]){if(i.kind==="function"&&i.kindModifiers==="export"){const l=i.spans[0].start,f=e.getPositionAt(l);a.push({name:i.text,type:Ra(n,i),lineNumber:f.lineNumber})}if(i.childItems)for(const l of i.childItems)vo(e,t,n,l,a);return a}function To(e,t,n="function",i){const a=e.spans,l=a.length;for(let f=0;f<l;f++){const h=a[f];if(h.start<=t&&t<h.start+h.length){if(e.kind===n&&(!i||e.kindModifiers===i))return e;for(const c of e.childItems||[]){const C=To(c,t,n,i);if(C)return C}}return null}}function ka(e){return e.kind==="comment"}const Ma=o.memo(o.forwardRef((e,t)=>{const{className:n,style:i,commands:a,readOnly:l=!1,darkMode:f,loadingPanel:h,autoFocus:c=!0,frame:C,onStatusChange:M,...y}=e,p=o.useRef(null),T=o.useRef(!1),I=o.useMemo(()=>({contains(ue){if(!p.current)return;const O=p.current.editor;return O&&O.getDomNode()?.contains(ue)},focus(){if(!p.current)return;const ue=p.current.editor;return ue&&ue.getDomNode()?.focus()}}),[]),z=o.useMemo(()=>[new r.Command("help",I,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),D=o.useMemo(()=>{let ue=null;const O=()=>I;return ue=a?a.createChildGroup(O,"scriptEditor",!1):new r.CommandGroup(O,"scriptEditor"),ue.addCommands(z,!0),ue},[a,z]),_=a.getGroup("workbook"),$=r.useCommands(_,["executeSelectedScript","saveScripts"]),w=$[0],N=$[1],v=w?.getContext(),[E,q]=o.useState({message:"Loading",cursor:"",dirty:!1}),[Z,F]=o.useState({loading:!1,compiling:!1,errors:[],warnings:[]}),P=r.useCallbackRef(ue=>{q(O=>{const xe={...O,...ue};return ge.CommonUtils.deepEqual(xe,O)?O:(N.update({disabled:!xe.dirty}).updateCallback(async()=>{await W()}),xe)})},[M,N]);o.useEffect(()=>{M?.(E)},[M,E]);const W=r.useCallbackRef(async()=>{if(!p.current)return;const ue=p.current.editor;let O;if(E.dirty){const xe=ue.getValue();await v?.saveSource(xe),O=v?.getScripts().getModules().getByName("scripts");const Le=O?.getSource(),H=ue.getValue(),U=(Le?.length??0)!==xe.length||Le!==H;P({dirty:U})}else O=v?.getScripts().getModules().getByName("scripts");return O},[E]);o.useEffect(()=>{const ue=C?.addListener({onBeforeHide:async()=>(await W(),!0)});return()=>{ue?.()}},[C]),o.useEffect(()=>{const ue=v?.getScripts();if(ue)return ue.addListeners({onBeforeSearch:()=>W()})},[v]);const pe=r.useCallbackRef(ue=>{w?.execute(ue)},[w]),de=o.useRef(""),[le,R]=o.useState(!1),te=r.useCallbackRef(async()=>{if(!p.current)return null;const ue=p.current,O=ue.editor;if(!O)return null;const xe=ue.monaco,Le=await(async(H,U,he="export")=>{const ce=H.getModel();if(!ce)return null;const me=await U.languages.typescript.getTypeScriptWorker(),Te=await me(ce.uri),ie=await Te.getNavigationTree(ce.uri.toString());let qe=null,g=H.getSelection();if(!g)return null;const je=g.startLineNumber===g.endLineNumber&&g.startColumn===g.endColumn?ce.getLineCount():Math.min(g.endLineNumber,ce.getLineCount());for(let Be=g.startLineNumber;!qe&&Be<=je;Be++){const Ee=To(ie,ce.getOffsetAt({lineNumber:Be,column:1}),"function",he);Ee&&(qe=Ee.text)}return qe})(O,xe);return P({message:(Le??"").toUpperCase()}),Le?{source:O.getValue(),name:Le}:null},[]);r.useCallbackRef(ge.CommonUtils.debounce(W,200),[]);const k=r.useCallbackRef(async(ue,O,xe)=>{F(H=>({...H,compiling:!0}));const Le=await v?.getScripts().createModule({source:xe?.getValue(),declarationsOnly:!0});Le&&((async function(H,U){const he=[];for(let ce=1;ce<H.getLineCount()+1;ce++){const me={startLineNumber:ce,startColumn:1,endLineNumber:ce,endColumn:H.getLineLength(ce)+1},Te=H.getValueInRange(me).indexOf("modelt");Te!==-1&&he.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:me.startLineNumber,startColumn:Te+1,endLineNumber:me.startLineNumber,endColumn:Te+5})}U.editor.setModelMarkers(H,"owner",he)})(ue,O),(async function(H,U,he,ce){const me=await U.languages.typescript.getTypeScriptWorker(),Te=await me(H.uri),ie=await Te.getNavigationTree(H.uri.toString()),qe=vo(H,U,ce,ie).map(g=>{let je=null,Be=null;return g.type==="formula"?(je="formula.margin-icon",Be="Formula"):g.type==="macro"?(je="macro.margin-icon",Be="Macro"):g.type==="autoRun"&&(je="autorun.margin-icon",Be="Auto Run"),{range:new U.Range(g.lineNumber,1,g.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:je,glyphMarginHoverMessage:{value:Be},stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});ye.current&&ye.current.clear(),ye.current=he.createDecorationsCollection(qe)})(ue,O,xe,Le?Le.getFunctions().getItems():ge.CommonUtils.EmptyArray),F(H=>({...H,compiling:!1})))},[v]),b=r.useCallbackRef(ge.CommonUtils.debounce(k,580),[]),ee=r.useCallbackRef(async(ue=void 0)=>{if(!p.current||!v)return;const O=p.current.editor.getPosition(),xe={cursor:O?O.toString():""};ue!==void 0&&(xe.message=ue),P(xe);const Le=te();v.setSelectedFunction(Le)},[v]);o.useEffect(()=>{},[Z]);const ne=o.useRef(null),Re=r.useCallbackRef(async()=>{await W(),C?.close()},[C]);o.useEffect(()=>{if(!v)return;const ue={insertSnippet:xe=>{p.current?.editor&&cr(p.current.editor,p.current.monaco,xe)},close:()=>Re()};v.setEditor(ue),v.setSelectedFunction(te());const O=v.addContainerListener({onBeforeSave:async()=>{W()},onReadonlyChange(){},onScriptChange:async()=>{if(!p.current?.editor||!v)return;const xe=p.current.editor,Le=v.getScripts().getModules().getItems()[0]?.getSource()??"";xe.setValue(Le)}});return()=>{v.setEditor(null),O()}},[v]),o.useEffect(()=>()=>{const ue=ne.current;if(ue){ue.dispose();const O=ue.debounceTimer;O!==void 0&&clearTimeout(O),ne.current=null}},[le]);const Ce=r.useCallbackRef(ue=>{const O=p.current?.editor;return!!O&&(O.focus(ue),!0)},[E]),ye=o.useRef(null),Pe=r.useCallbackRef((ue,O)=>{p.current={monaco:O,editor:ue},R(!0),ee("Loading Types");const xe=v?.getScripts().getModules().getItems()[0]?.getSource()??"";ue.setValue(xe),Promise.resolve().then(()=>require("./DNki9dGbSn_gUfd3.cjs")).then(H=>H.customEditor).then(async H=>{ee(""),H.AutoTypings.create(ue,{shareCache:!0,dontAdaptEditorOptions:!0,monaco:O,onUpdate:(U,he)=>{if(U.type==="LookedUpPackage"&&U.success!==void 0){const ce=O.languages.typescript.typescriptDefaults.getDiagnosticsOptions();O.languages.typescript.typescriptDefaults.setDiagnosticsOptions({...ce,diagnosticCodesToIgnore:[]})}},onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(U=>{ne.current=U;const he=ue.getModel();b(he,O,ue),(()=>{if(sr)return;const ce=(Te,ie)=>{try{if(ie===void 0)try{delete globalThis[Te]}catch{try{globalThis[Te]=void 0}catch{}}else globalThis[Te]=ie}catch{}},me=Et.length;for(let Te=0;Te<me;Te++){const ie=Et[Te];ce(ie,nn[ie])}nn=void 0,sr=!0})()})}),ue.addCommand("executeScript",function(H,...U){U?.[0]&&pe({functionName:U?.[0]})},""),ue.addAction({id:"executeScript",label:"Execute",keybindings:[O.KeyCode.F8],run:async H=>{const U=te();v?.setSelectedFunction(U);const he=await U;pe(he)}}),ue.addAction({id:"saveScript",label:"Save Script",keybindings:[O.KeyMod.CtrlCmd|O.KeyCode.KeyS],run:H=>{W()}}),ue.onMouseDown(async H=>{if(H.target.type===O.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=H.target.position.lineNumber,he=await O.languages.typescript.getTypeScriptWorker(),ce=await he(Le.uri),me=await ce.getNavigationTree(Le.uri.toString()),Te=(await W()).getFunctions().getItems(),ie=vo(Le,O,Te,me).find(qe=>qe.lineNumber===U);if(ie){const qe=H.event.browserEvent.button;qe===0?ie.type==="macro"||ie.type==="autoRun"?pe({functionName:ie.name}):ie.type==="formula"&&v?.quickInsertFunction?.(ie.name):qe===2&&(console.log("Context menu for function:",ie.name),H.event.browserEvent.preventDefault())}}}),ue.onDidChangeModelContent(()=>{P({dirty:!0}),b(Le,O,ue)}),O.editor.onDidChangeMarkers(H=>{H.some(U=>U.toString()===Le.uri.toString())});const Le=ue.getModel();(function(H,U){U.languages.registerInlayHintsProvider("typescript",{provideInlayHints(he,ce,me){const Te=[];for(let ie=1;ie<he.getLineCount()+1;ie++){const qe={startLineNumber:ie,startColumn:1,endLineNumber:ie,endColumn:he.getLineLength(ie)+1},g="hint",je=he.getValueInRange(qe).indexOf("hint");je!==-1&&Te.push({kind:U.languages.InlayHintKind.Type,position:{lineNumber:qe.startLineNumber,column:je+g.length+1},label:"[hint]"})}return{hints:Te,dispose:()=>{}}}})})(0,O),Le.onDidChangeContent(H=>{const U=v?.getScripts().getModules().getByName("scripts"),he=U?.getSource(),ce=ue.getValue(),me=(he?.length??0)!==ce.length||he!==ce;P({dirty:me})}),ue.onDidChangeCursorPosition(H=>{ee()})},[v]),ze=o.useMemo(()=>le?null:h||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[le,h]),Ae=o.useMemo(()=>{if(!le){if(!nn){nn={};const O=Et.length;for(let xe=0;xe<O;xe++){const Le=Et[xe];nn[Le]=globalThis[Le]}}if(on){const O=Et.length;for(let xe=0;xe<O;xe++){const Le=Et[xe];globalThis[Le]=on[Le]}}}const ue=v?.getScripts().getModules()?.getByName("scripts")?.getSource()??"";return s.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[s.jsx(o.Suspense,{children:s.jsx(qa,{theme:f?"extended-dark":"extended",options:{...xa,fixedOverflowWidgets:!0,readOnly:l},language:"typescript",value:ue,onValidate:O=>{let xe=!1;const Le=O?O.length:0;for(let H=0;!xe&&H<Le;H++)O[H].severity===8&&(xe=!0)},beforeMount:O=>{O.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[2307]}),O.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),O.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),O.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let xe=!1,Le=!1;try{const H=await(async()=>await(await fetch(Sa)).text())(),U=O.Uri.parse('inmemory://model/"sheetxl-models".d.ts');let he=O.editor.getModel(U);he?Le=!0:he=O.editor.createModel(H,"typescript",U),O.editor.setModelMarkers(he,"default",[]),xe=!0}catch(H){console.warn("cant load types",H)}if(O.languages.registerLinkProvider("*",{provideLinks:(H,U)=>{const he=[],ce={links:he},me=H.getLinesContent(),Te=me.length;for(let ie=1;ie<=Te;ie++){const qe=me[ie-1],g=O.editor.tokenize(qe,"typescript"),je=g[0].length;for(let Be=0;Be<je;Be++){const Ee=g[0]?.[Be];if(Ee&&Ee.type.startsWith("string")){let u=Ee.offset,L=g[0]?.[Be+1]?.offset??qe.length,K=new O.Range(ie,u+1,ie,L+1),m=H.getValueInRange(K);const A=m[0];A!=="`"&&A!=="'"&&A!=='"'||(u++,m=m.substring(1));const G=m[m.length-1];G!=="`"&&G!=="'"&&G!=='"'||(u++,m=m.substring(0,m.length-1));try{v.getRanges(m)&&he.push({range:{endColumn:L,endLineNumber:ie,startColumn:u,startLineNumber:ie},tooltip:`Goto range '${m}'`,url:`/range/${m}`})}catch(J){console.warn(J)}}}}return ce}}),O.editor.registerLinkOpener({open(H){if(H?.path?.startsWith("/range/")){try{v.getRanges(H.path.substring(7))?.select()}catch(U){console.warn("invalid range",U)}return!0}return!1}}),!Le){const H=O.languages.typescript.typescriptDefaults.getCompilerOptions();O.languages.typescript.typescriptDefaults.setCompilerOptions({...H,target:O.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:O.languages.typescript.ModuleResolutionKind.NodeJs,allowSyntheticDefaultImports:!0,baseUrl:"inmemory://model/",allowNonTsExtensions:!0})}if(de.current&&(await cr(p.current.editor,p.current.monaco,de.current),de.current=null),T.current&&requestAnimationFrame(async()=>{T.current&&O.editor.focus()}),!on){on={};const H=Et.length;for(let U=0;U<H;U++){const he=Et[U];on[he]=globalThis[he]}}})()},onMount:Pe})}),ze]})},[v,D,l,ze,f]),Ie=r.useImperativeElement(t,()=>({isScriptEditorElement:()=>!0,focus:ue=>{Ce(ue)},close:()=>Re(),getEditor:()=>v?.getEditor()}),[v]);return o.useEffect(()=>(c&&requestAnimationFrame(()=>{Ie.current?.focus()}),()=>{p.current?.editor&&requestAnimationFrame(()=>{Ie.current?.contains(document.activeElement)&&Ie.current?.focus()})}),[]),s.jsx("div",{className:ct("script-editor",ba,n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...i},ref:Ie,...y,children:Ae})})),Ta=Object.freeze(Object.defineProperty({__proto__:null,FindScopeOptions:{Workbook:"workbook",Sheet:"sheet"}},Symbol.toStringTag,{value:"Module"}));Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:()=>d.LicenseManager}),exports.ChartAreaIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z"}),s.jsx("path",{className:"styled background",d:"M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z"}),s.jsx("path",{className:"styled info_light",d:"M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z"}),s.jsx("path",{className:"styled info_dark",d:"M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z"})]}),exports.ChartAreaStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z"}),s.jsx("path",{className:"styled background",d:"M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z"}),s.jsx("path",{className:"styled info_light",d:"M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartAreaStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z"}),s.jsx("path",{className:"styled background",d:"M 1941 1941 h -1834 v -1834 h 1834 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z"}),s.jsx("path",{className:"styled info_light",d:"M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z"})]}),exports.ChartBarIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z"}),s.jsx("path",{className:"styled background",d:"M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z"}),s.jsx("path",{className:"styled info_light",d:"M 1813 277 v 299 h -1706 v -299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1088 v 299 h -810 v -299 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 896 1109 h -795 v -42 h 838 v 322 h -43 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z"})]}),exports.ChartBarStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z"}),s.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 704 832 v -469 h 640 v 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 917 1600 v -469 h 811 v 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z"})]}),exports.ChartBarStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z"}),s.jsx("path",{className:"styled background",d:"M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 533 832 v -469 h 1195 v 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1173 1600 v -469 h 555 v 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z"})]}),exports.ChartBubble3DIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),s.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartBubbleIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),s.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z"}),s.jsx("path",{className:"styled background",d:"M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z"}),s.jsx("path",{className:"styled info_light",d:"M 619 1941 h -299 v -1322 h 299 z"}),s.jsx("path",{className:"styled info_dark",d:"M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1429 1941 h -298 v -1066 h 298 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z"})]}),exports.ChartColumnStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z"}),s.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 832 1387 h -469 v -640 h 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 1131 h -469 v -811 h 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z"})]}),exports.ChartColumnStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z"}),s.jsx("path",{className:"styled background",d:"M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z"}),s.jsx("path",{className:"styled info_light",d:"M 832 1515 h -469 v -1195 h 469 z"}),s.jsx("path",{className:"styled info_dark",d:"M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z"}),s.jsx("path",{className:"styled secondary_light",d:"M 1600 875 h -469 v -555 h 469 z"}),s.jsx("path",{className:"styled secondary_dark",d:"M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z"})]}),exports.ChartEditor=ii,exports.ChartLineIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z"}),s.jsx("path",{className:"styled info",d:"M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z"})]}),exports.ChartLineMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z"}),s.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z"}),s.jsx("path",{className:"styled info",d:"M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z"})]}),exports.ChartLineStackedIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),s.jsx("path",{className:"styled info",d:"M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled info",d:"M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z"})]}),exports.ChartLineStackedPercentIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"}),s.jsx("path",{className:"styled info",d:"M 1877 299 h -1770 v -43 h 1770 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z"})]}),exports.ChartLineStackedPercentMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z"}),s.jsx("path",{className:"styled info",d:"M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z"})]}),exports.ChartPieDoughnutIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z"}),s.jsx("path",{className:"styled background",d:"M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z"}),s.jsx("path",{className:"styled current_color",d:"M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z"}),s.jsx("path",{className:"styled info_light",d:"M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z"})]}),exports.ChartPieIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z"}),s.jsx("path",{className:"styled background",d:"M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z"}),s.jsx("path",{className:"styled current_color",d:"M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z"}),s.jsx("path",{className:"styled info_light",d:"M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z"}),s.jsx("path",{className:"styled info_dark",d:"M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z"})]}),exports.ChartScatterLinesIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z"}),s.jsx("path",{className:"styled info",d:"M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z"}),s.jsx("path",{className:"styled current_color",d:"M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z"})]}),exports.ChartScatterLinesMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z"}),s.jsx("path",{className:"styled background",d:"M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z"}),s.jsx("path",{className:"styled info",d:"M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z"}),s.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z"})]}),exports.ChartScatterLinesMarkersSmoothIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z"}),s.jsx("path",{className:"styled background",d:"M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z"}),s.jsx("path",{className:"styled info",d:"M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z"}),s.jsx("path",{className:"styled current_color",d:"M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z"})]}),exports.ChartScatterLinesSmoothIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z"}),s.jsx("path",{className:"styled info",d:"M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z"})]}),exports.ChartScatterMarkersIcon=e=>s.jsxs("svg",{viewBox:"0,0,2048,2048",...e,children:[s.jsx("path",{className:"styled high_contrast",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"}),s.jsx("path",{className:"styled background",d:"M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z"}),s.jsx("path",{className:"styled info",d:"M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z"}),s.jsx("path",{className:"styled current_color",d:"M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z"})]}),exports.CommandContext=Ta,exports.CornerTriangle=uo,exports.DefaultTaskPaneRegistry=En,exports.DocThemesContext=Tn,exports.DocThemesProvider=e=>{const{themes:t,children:n}=e;return s.jsx(Tn.Provider,{value:t,children:n})},exports.EditableLabel=Tr,exports.EmptyFrame=Yl,exports.FilterButton=dr,exports.LogoNoPaddingIcon=e=>s.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[s.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),s.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),s.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),s.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.LogoTextNoPaddingIcon=vr,exports.MovableArea=xr,exports.PictureEditor=Mr,exports.ScriptEditor=Ma,exports.SheetCellEditor=gr,exports.SheetCellRenderer=ur,exports.SheetElement=kr,exports.SheetScrollbar=bo,exports.StaticBorderRenderer=xl,exports.StyledStrokePath=mr,exports.Tab=nl,exports.TabStrip=rl,exports.TaskPaneArea=El,exports.TaskPaneProvider=({children:e,renderArea:t,onUpdateArea:n,registry:i=En})=>{const a=o.useRef(null),l=o.useRef(null),[f,h]=o.useState(null),[c,C]=o.useState(null),M=r.useCallbackRef(p=>{const T=t({registry:i,onClose:()=>{C(null),n?.(null)},ref:I=>{I&&C(I)}});return n?.(T),T},[t,i,f]),y=o.useMemo(()=>({activateTaskPane(p,T){l.current!==p&&(a.current?a.current.activateTaskPane(p,T):(h(p),M(p)))}}),[]);return o.useEffect(()=>{c&&f&&(c.activateTaskPane(f,{autoFocus:!0}),h(null))},[f,c]),o.createElement(Cr.Provider,{value:c??y},e)},exports.TaskPaneStrip=wo,exports.TaskPaneTitle=yo,exports.createCellEditStateFromCell=hr,exports.useBordersOverlay=Co,exports.useDocThemes=()=>{const e=o.useContext(Tn),[t]=o.useState(()=>new d.ThemeCollection);return o.useMemo(()=>e||t,[e])},exports.useModelListener=Qe,exports.useMovableCommands=qr,exports.useRangeListener=(e,t,n,i)=>{const a=o.useRef(n);a.current=n;const l=i?.fireOnAddressChange??!0;o.useEffect(()=>{if(!e||!t||!a.current){const c={getSource:()=>null,getFrom:()=>null,getTo:()=>null,trigger:"delete",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()};return void a.current?.(c)}const f=c=>{a.current?.(c)},h=e.getRange(t).addListener(f,i);if(l){const c=e.getRange(t);f({getSource:()=>c,getFrom:()=>null,getTo:()=>null,trigger:"modelChange",isDataChange:!1,isTransactional:!1,isUndo:!1,timeStamp:Date.now()})}return()=>{h?.()}},[e,t])},exports.useSheetCommands=wr,exports.useSheetCopyPaste=br,exports.useTaskPaneArea=yr;
30
+ `},vc={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function yc(e){let{announcements:t=vc,container:r,hiddenTextDescribedById:i,screenReaderInstructions:a=_c}=e,{announce:o,announcement:s}=function(){let[e,t]=(0,n.useState)(``);return{announce:(0,n.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}(),l=rc(`DndLiveRegion`),[u,d]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{d(!0)},[]),function(e){let t=(0,n.useContext)(hc);(0,n.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}((0,n.useMemo)(()=>({onDragStart(e){let{active:n}=e;o(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&o(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;o(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;o(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;o(t.onDragCancel({active:n,over:r}))}}),[o,t])),!u)return null;let f=n.default.createElement(n.default.Fragment,null,n.default.createElement(pc,{id:i,value:a.draggable}),n.default.createElement(mc,{id:l,announcement:s}));return r?(0,c.createPortal)(f,r):f}function bc(){}function xc(e,t){return(0,n.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(gc||={});var Sc=Object.freeze({x:0,y:0});function Cc(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function wc(e,t){let n=cc(e);return n?(n.x-t.left)/t.width*100+`% `+(n.y-t.top)/t.height*100+`%`:`0 0`}function Tc(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ec(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Dc(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Oc(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function kc(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}var Ac=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=kc(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Cc(kc(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Tc)};function jc(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s;return Number((i/(n+r-i)).toFixed(4))}return 0}var Mc=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=jc(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Ec)};function Nc(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Sc}function Pc(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var Fc=Pc(1);function Ic(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var Lc,Rc={ignoreTransform:!1};function zc(e,t){t===void 0&&(t=Rc);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=Gs(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=Ic(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Bc(e){return zc(e,{ignoreTransform:!0})}function Vc(e,t){let n=[];return e?function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ks(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!qs(i)||Js(i)||n.includes(i))return n;let a=Gs(e).getComputedStyle(i);return i!==e&&function(e,t){t===void 0&&(t=Gs(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}(i,a)&&n.push(i),function(e,t){return t===void 0&&(t=Gs(e).getComputedStyle(e)),t.position===`fixed`}(i,a)?n:r(i.parentNode)}(e):n}function Hc(e){let[t]=Vc(e,1);return t??null}function Uc(e){return Hs&&e?Us(e)?e:Ws(e)?Ks(e)||e===Ys(e).scrollingElement?window:qs(e)?e:null:null:null}function Wc(e){return Us(e)?e.scrollX:e.scrollLeft}function Gc(e){return Us(e)?e.scrollY:e.scrollTop}function Kc(e){return{x:Wc(e),y:Gc(e)}}function qc(e){return!(!Hs||!e)&&e===document.scrollingElement}function Jc(e){let t={x:0,y:0},n=qc(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Lc||={});var Yc={x:.2,y:.2};function Xc(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Yc);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Jc(e),p={x:0,y:0},m={x:0,y:0},h=t.height*i.y,g=t.width*i.x;return!l&&a<=t.top+h?(p.y=Lc.Backward,m.y=r*Math.abs((t.top+h-a)/h)):!u&&c>=t.bottom-h&&(p.y=Lc.Forward,m.y=r*Math.abs((t.bottom-h-c)/h)),!f&&s>=t.right-g?(p.x=Lc.Forward,m.x=r*Math.abs((t.right-g-s)/g)):!d&&o<=t.left+g&&(p.x=Lc.Backward,m.x=r*Math.abs((t.left+g-o)/g)),{direction:p,speed:m}}function Zc(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Qc(e){return e.reduce((e,t)=>ac(e,Kc(t)),Sc)}function $c(e,t){if(t===void 0&&(t=zc),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);Hc(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var el,tl,nl=[[`x`,[`left`,`right`],function(e){return e.reduce((e,t)=>e+Wc(t),0)}],[`y`,[`top`,`bottom`],function(e){return e.reduce((e,t)=>e+Gc(t),0)}]],rl=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Vc(t),r=Qc(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of nl)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},il=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function al(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}function ol(e){e.preventDefault()}function sl(e){e.stopPropagation()}(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(el||={}),function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`}(tl||={});var cl={start:[tl.Space,tl.Enter],cancel:[tl.Esc],end:[tl.Space,tl.Enter,tl.Tab]},ll=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case tl.Right:return{...n,x:n.x+25};case tl.Left:return{...n,x:n.x-25};case tl.Down:return{...n,y:n.y+25};case tl.Up:return{...n,y:n.y-25}}},ul=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new il(Ys(t)),this.windowListeners=new il(Gs(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(el.Resize,this.handleCancel),this.windowListeners.add(el.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(el.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&$c(n),t(Sc)}handleKeyDown(e){if(sc(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=cl,coordinateGetter:a=ll,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Sc;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=oc(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Jc(n),p=Zc(n),m={x:Math.min(i===tl.Right?p.right-p.width/2:p.right,Math.max(i===tl.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===tl.Down?p.bottom-p.height/2:p.bottom,Math.max(i===tl.Down?p.top:p.top+p.height/2,u.y))},h=i===tl.Right&&!s||i===tl.Left&&!c,g=i===tl.Down&&!l||i===tl.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===tl.Right&&e<=d.x||i===tl.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:o});r.x=a?n.scrollLeft-e:i===tl.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===tl.Down&&e<=d.y||i===tl.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:o});r.y=a?n.scrollTop-e:i===tl.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,ac(oc(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};function dl(e){return!!(e&&`distance`in e)}function fl(e){return!!(e&&`delay`in e)}ul.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=cl,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];var pl=class{constructor(e,t,n){n===void 0&&(n=function(e){let{EventTarget:t}=Gs(e);return e instanceof t?e:Ys(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=Ys(i),this.documentListeners=new il(this.document),this.listeners=new il(n),this.windowListeners=new il(Gs(i)),this.initialCoordinates=cc(r)??Sc,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(el.Resize,this.handleCancel),this.windowListeners.add(el.DragStart,ol),this.windowListeners.add(el.VisibilityChange,this.handleCancel),this.windowListeners.add(el.ContextMenu,ol),this.documentListeners.add(el.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fl(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(dl(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(el.Click,sl,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(el.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=cc(e)??Sc,s=oc(n,o);if(!t&&a){if(dl(a)){if(a.tolerance!=null&&al(s,a.tolerance))return this.handleCancel();if(al(s,a.distance))return this.handleStart()}return fl(a)&&al(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===tl.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},ml={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},hl=class extends pl{constructor(e){let{event:t}=e,n=Ys(t.target);super(e,ml,n)}};hl.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||n.button!==0)&&(r?.({event:n}),!0)}}];var gl,_l={move:{name:`mousemove`},end:{name:`mouseup`}};(function(e){e[e.RightClick=2]=`RightClick`})(gl||={});var vl=class extends pl{constructor(e){super(e,_l,Ys(e.event.target))}};vl.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==gl.RightClick&&(r?.({event:n}),!0)}}];var yl,bl,xl={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Sl=class extends pl{constructor(e){super(e,xl)}static setup(){return window.addEventListener(xl.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(xl.move.name,e)};function e(){}}};function Cl(e){let{acceleration:t,activator:r=yl.Pointer,canScroll:i,draggingRect:a,enabled:o,interval:s=5,order:c=bl.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e,m=function(e){let{delta:t,disabled:n}=e,r=tc(t);return $s(e=>{if(n||!r||!e)return El;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Lc.Backward]:e.x[Lc.Backward]||i.x===-1,[Lc.Forward]:e.x[Lc.Forward]||i.x===1},y:{[Lc.Backward]:e.y[Lc.Backward]||i.y===-1,[Lc.Forward]:e.y[Lc.Forward]||i.y===1}}},[n,t,r])}({delta:f,disabled:!o}),[h,g]=function(){let e=(0,n.useRef)(null);return[(0,n.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,n.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}(),_=(0,n.useRef)({x:0,y:0}),v=(0,n.useRef)({x:0,y:0}),y=(0,n.useMemo)(()=>{switch(r){case yl.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case yl.DraggableRect:return a}},[r,a,l]),b=(0,n.useRef)(null),x=(0,n.useCallback)(()=>{let e=b.current;if(!e)return;let t=_.current.x*v.current.x,n=_.current.y*v.current.y;e.scrollBy(t,n)},[]),S=(0,n.useMemo)(()=>c===bl.TreeOrder?[...u].reverse():u,[c,u]);(0,n.useEffect)(()=>{if(o&&u.length&&y){for(let e of S){if(!1===i?.(e))continue;let n=u.indexOf(e),r=d[n];if(!r)continue;let{direction:a,speed:o}=Xc(e,r,y,t,p);for(let e of[`x`,`y`])m[e][a[e]]||(o[e]=0,a[e]=0);if(o.x>0||o.y>0)return g(),b.current=e,h(x,s),_.current=o,void(v.current=a)}_.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,x,i,g,o,s,JSON.stringify(y),JSON.stringify(m),h,u,S,d,JSON.stringify(p)])}Sl.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return!(i.length>1)&&(r?.({event:n}),!0)}}],function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`}(yl||={}),function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`}(bl||={});var wl,Tl,El={x:{[Lc.Backward]:!1,[Lc.Forward]:!1},y:{[Lc.Backward]:!1,[Lc.Forward]:!1}};(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(wl||={}),function(e){e.Optimized=`optimized`}(Tl||={});var Dl=new Map;function Ol(e,t){return $s(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function kl(e){let{callback:t,disabled:r}=e,i=Zs(t),a=(0,n.useMemo)(()=>{if(r||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(i)},[r]);return(0,n.useEffect)(()=>()=>a?.disconnect(),[a]),a}function Al(e){return new rl(zc(e),e)}function jl(e,t,r){t===void 0&&(t=Al);let[i,a]=(0,n.useState)(null);function o(){a(n=>{if(!e)return null;if(!1===e.isConnected)return n??r??null;let i=t(e);return JSON.stringify(n)===JSON.stringify(i)?n:i})}let s=function(e){let{callback:t,disabled:r}=e,i=Zs(t),a=(0,n.useMemo)(()=>{if(r||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(i)},[i,r]);return(0,n.useEffect)(()=>()=>a?.disconnect(),[a]),a}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),c=kl({callback:o});return Xs(()=>{o(),e?(c?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),s?.disconnect())},[e]),i}var Ml=[];function Nl(e,t){t===void 0&&(t=[]);let r=(0,n.useRef)(null);return(0,n.useEffect)(()=>{r.current=null},t),(0,n.useEffect)(()=>{let t=e!==Sc;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?oc(e,r.current):Sc}function Pl(e){return(0,n.useMemo)(()=>e?function(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}var Fl=[];function Il(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return qs(t)?t:e}var Ll=[{sensor:hl,options:{}},{sensor:ul,options:{}}],Rl={current:{}},zl={draggable:{measure:Bc},droppable:{measure:Bc,strategy:wl.WhileDragging,frequency:Tl.Optimized},dragOverlay:{measure:zc}},Bl=class extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Vl={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Bl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:bc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:zl,measureDroppableContainers:bc,windowRect:null,measuringScheduled:!1},Hl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:bc,draggableNodes:new Map,over:null,measureDroppableContainers:bc},Ul=(0,n.createContext)(Hl),Wl=(0,n.createContext)(Vl);function Gl(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Bl}}}function Kl(e,t){switch(t.type){case gc.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case gc.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case gc.DragEnd:case gc.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case gc.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Bl(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case gc.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Bl(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case gc.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Bl(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function ql(e){let{disabled:t}=e,{active:r,activatorEvent:i,draggableNodes:a}=(0,n.useContext)(Ul),o=tc(i),s=tc(r?.id);return(0,n.useEffect)(()=>{if(!t&&!i&&o&&s!=null){if(!sc(o)||document.activeElement===o.target)return;let e=a.get(s);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=dc(e);if(t){t.focus();break}}})}},[i,t,a,s,o]),null}function Jl(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}var Yl,Xl=(0,n.createContext)({...Sc,scaleX:1,scaleY:1});(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Yl||={});var Zl=(0,n.memo)(function(e){let{id:t,accessibility:r,autoScroll:i=!0,children:a,sensors:o=Ll,collisionDetection:s=Mc,measuring:l,modifiers:u,...d}=e,[f,p]=(0,n.useReducer)(Kl,void 0,Gl),[m,h]=function(){let[e]=(0,n.useState)(()=>new Set),t=(0,n.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,n.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}(),[g,_]=(0,n.useState)(Yl.Uninitialized),v=g===Yl.Initialized,{draggable:{active:y,nodes:b,translate:x},droppable:{containers:S}}=f,C=y==null?null:b.get(y),w=(0,n.useRef)({initial:null,translated:null}),T=(0,n.useMemo)(()=>y==null?null:{id:y,data:C?.data??Rl,rect:w},[y,C]),E=(0,n.useRef)(null),[D,O]=(0,n.useState)(null),[k,A]=(0,n.useState)(null),j=Qs(d,Object.values(d)),M=rc(`DndDescribedBy`,t),N=(0,n.useMemo)(()=>S.getEnabled(),[S]),P=(F=l,(0,n.useMemo)(()=>({draggable:{...zl.draggable,...F?.draggable},droppable:{...zl.droppable,...F?.droppable},dragOverlay:{...zl.dragOverlay,...F?.dragOverlay}}),[F?.draggable,F?.droppable,F?.dragOverlay]));var F;let{droppableRects:I,measureDroppableContainers:L,measuringScheduled:R}=function(e,t){let{dragging:r,dependencies:i,config:a}=t,[o,s]=(0,n.useState)(null),{frequency:c,measure:l,strategy:u}=a,d=(0,n.useRef)(e),f=function(){switch(u){case wl.Always:return!1;case wl.BeforeDragging:return r;default:return!r}}(),p=Qs(f),m=(0,n.useCallback)(function(e){e===void 0&&(e=[]),p.current||s(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),h=(0,n.useRef)(null),g=$s(t=>{if(f&&!r)return Dl;if(!t||t===Dl||d.current!==e||o!=null){let t=new Map;for(let n of e){if(!n)continue;if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new rl(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,o,r,f,l]);return(0,n.useEffect)(()=>{d.current=e},[e]),(0,n.useEffect)(()=>{f||m()},[r,f]),(0,n.useEffect)(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),(0,n.useEffect)(()=>{f||typeof c!=`number`||h.current!==null||(h.current=setTimeout(()=>{m(),h.current=null},c))},[c,f,m,...i]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:o!=null}}(N,{dragging:v,dependencies:[x.x,x.y],config:P.droppable}),z=function(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return $s(e=>t==null?null:r??e??null,[r,t])}(b,y),B=(0,n.useMemo)(()=>k?cc(k):null,[k]),V=function(){let e=!1===D?.autoScrollEnabled,t=typeof i==`object`?!1===i.enabled:!1===i,n=v&&!e&&!t;return typeof i==`object`?{...i,enabled:n}:{enabled:n}}(),H=function(e,t){return Ol(e,t)}(z,P.draggable.measure);(function(e){let{activeNode:t,measure:r,initialRect:i,config:a=!0}=e,o=(0,n.useRef)(!1),{x:s,y:c}=typeof a==`boolean`?{x:a,y:a}:a;Xs(()=>{if(!s&&!c||!t)return void(o.current=!1);if(o.current||!i)return;let e=t?.node.current;if(!e||!1===e.isConnected)return;let n=Nc(r(e),i);if(s||(n.x=0),c||(n.y=0),o.current=!0,Math.abs(n.x)>0||Math.abs(n.y)>0){let t=Hc(e);t&&t.scrollBy({top:n.y,left:n.x})}},[t,s,c,i,r])})({activeNode:y==null?null:b.get(y),config:V.layoutShiftCompensation,initialRect:H,measure:P.draggable.measure});let U=jl(z,P.draggable.measure,H),W=jl(z?z.parentElement:null),G=(0,n.useRef)({activatorEvent:null,active:null,activeNode:z,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=S.getNodeFor(G.current.over?.id),q=function(e){let{measure:t}=e,[r,i]=(0,n.useState)(null),a=kl({callback:(0,n.useCallback)(e=>{for(let{target:n}of e)if(qs(n)){i(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[o,s]=ec((0,n.useCallback)(e=>{let n=Il(e);a?.disconnect(),n&&a?.observe(n),i(n?t(n):null)},[t,a]));return(0,n.useMemo)(()=>({nodeRef:o,rect:r,setRef:s}),[r,o,s])}({measure:P.dragOverlay.measure}),ee=q.nodeRef.current??z,te=v?q.rect??U:null,J=!!(q.nodeRef.current&&q.rect),Y=Nc(ne=J?null:U,Ol(ne));var ne;let X=Pl(ee?Gs(ee):null),re=function(e){let t=(0,n.useRef)(e),r=$s(n=>e?n&&n!==Ml&&e&&t.current&&e.parentNode===t.current.parentNode?n:Vc(e):Ml,[e]);return(0,n.useEffect)(()=>{t.current=e},[e]),r}(v?K??z:null),Z=function(e,t){t===void 0&&(t=zc);let[r]=e,i=Pl(r?Gs(r):null),[a,o]=(0,n.useState)(Fl);function s(){o(()=>e.length?e.map(e=>qc(e)?i:new rl(t(e),e)):Fl)}let c=kl({callback:s});return Xs(()=>{c?.disconnect(),s(),e.forEach(e=>c?.observe(e))},[e]),a}(re),ie=Jl(u,{transform:{x:x.x-Y.x,y:x.y-Y.y,scaleX:1,scaleY:1},activatorEvent:k,active:T,activeNodeRect:U,containerNodeRect:W,draggingNodeRect:te,over:G.current.over,overlayNodeRect:q.rect,scrollableAncestors:re,scrollableAncestorRects:Z,windowRect:X}),ae=B?ac(B,x):null,oe=function(e){let[t,r]=(0,n.useState)(null),i=(0,n.useRef)(e),a=(0,n.useCallback)(e=>{let t=Uc(e.target);t&&r(e=>e?(e.set(t,Kc(t)),new Map(e)):null)},[]);return(0,n.useEffect)(()=>{let t=i.current;if(e!==t){n(t);let o=e.map(e=>{let t=Uc(e);return t?(t.addEventListener(`scroll`,a,{passive:!0}),[t,Kc(t)]):null}).filter(e=>e!=null);r(o.length?new Map(o):null),i.current=e}return()=>{n(e),n(t)};function n(e){e.forEach(e=>{Uc(e)?.removeEventListener(`scroll`,a)})}},[a,e]),(0,n.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ac(e,t),Sc):Qc(e):Sc,[e,t])}(re),se=Nl(oe),ce=Nl(oe,[U]),le=ac(ie,se),ue=te?Fc(te,ie):null,Q=T&&ue?s({active:T,collisionRect:ue,droppableRects:I,droppableContainers:N,pointerCoordinates:ae}):null,de=Oc(Q,`id`),[$,fe]=(0,n.useState)(null),pe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(J?ie:ac(ie,ce),$?.rect??null,U),me=(0,n.useRef)(null),he=(0,n.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(E.current==null)return;let i=b.get(E.current);if(!i)return;let a=e.nativeEvent,o=new n({active:E.current,activeNode:i,event:a,options:r,context:G,onAbort(e){if(!b.get(e))return;let{onDragAbort:t}=j.current,n={id:e};t?.(n),m({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!b.get(e))return;let{onDragPending:i}=j.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),m({type:`onDragPending`,event:a})},onStart(e){let t=E.current;if(t==null)return;let n=b.get(t);if(!n)return;let{onDragStart:r}=j.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:w}};(0,c.unstable_batchedUpdates)(()=>{r?.(i),_(Yl.Initializing),p({type:gc.DragStart,initialCoordinates:e,active:t}),m({type:`onDragStart`,event:i}),O(me.current),A(a)})},onMove(e){p({type:gc.DragMove,coordinates:e})},onEnd:s(gc.DragEnd),onCancel:s(gc.DragCancel)});function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=G.current,o=null;if(t&&i){let{cancelDrop:s}=j.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===gc.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=gc.DragCancel)}E.current=null,(0,c.unstable_batchedUpdates)(()=>{p({type:e}),_(Yl.Uninitialized),fe(null),O(null),A(null),me.current=null;let t=e===gc.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=j.current[t];e?.(o),m({type:t,event:o})}})}}me.current=o},[b]),ge=function(e,t){return(0,n.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(o,(0,n.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=b.get(r);if(E.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};!0===e(n,t.options,o)&&(i.dndKit={capturedBy:t.sensor},E.current=r,he(n,t))},[b,he]));(function(e){(0,n.useEffect)(()=>{if(!Hs)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))})(o),Xs(()=>{U&&g===Yl.Initializing&&_(Yl.Initialized)},[U,g]),(0,n.useEffect)(()=>{let{onDragMove:e}=j.current,{active:t,activatorEvent:n,collisions:r,over:i}=G.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:le.x,y:le.y},over:i};(0,c.unstable_batchedUpdates)(()=>{e?.(a),m({type:`onDragMove`,event:a})})},[le.x,le.y]),(0,n.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=G.current;if(!e||E.current==null||!t||!i)return;let{onDragOver:a}=j.current,o=r.get(de),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,c.unstable_batchedUpdates)(()=>{fe(s),a?.(l),m({type:`onDragOver`,event:l})})},[de]),Xs(()=>{G.current={activatorEvent:k,active:T,activeNode:z,collisionRect:ue,collisions:Q,droppableRects:I,draggableNodes:b,draggingNode:ee,draggingNodeRect:te,droppableContainers:S,over:$,scrollableAncestors:re,scrollAdjustedTranslate:le},w.current={initial:te,translated:ue}},[T,z,Q,ue,b,ee,te,I,S,$,re,le]),Cl({...V,delta:x,draggingRect:ue,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:Z});let _e=(0,n.useMemo)(()=>({active:T,activeNode:z,activeNodeRect:U,activatorEvent:k,collisions:Q,containerNodeRect:W,dragOverlay:q,draggableNodes:b,droppableContainers:S,droppableRects:I,over:$,measureDroppableContainers:L,scrollableAncestors:re,scrollableAncestorRects:Z,measuringConfiguration:P,measuringScheduled:R,windowRect:X}),[T,z,U,k,Q,W,q,b,S,I,$,L,re,Z,P,R,X]),ve=(0,n.useMemo)(()=>({activatorEvent:k,activators:ge,active:T,activeNodeRect:U,ariaDescribedById:{draggable:M},dispatch:p,draggableNodes:b,over:$,measureDroppableContainers:L}),[k,ge,T,U,p,M,b,$,L]);return n.default.createElement(hc.Provider,{value:h},n.default.createElement(Ul.Provider,{value:ve},n.default.createElement(Wl.Provider,{value:_e},n.default.createElement(Xl.Provider,{value:pe},a)),n.default.createElement(ql,{disabled:!1===r?.restoreFocus})),n.default.createElement(yc,{...r,hiddenTextDescribedById:M}))}),Ql=(0,n.createContext)(null),$l=`button`;function eu(e){let{id:t,data:r,disabled:i=!1,attributes:a}=e,o=rc(`Draggable`),{activators:s,activatorEvent:c,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=(0,n.useContext)(Ul),{role:m=$l,roleDescription:h=`draggable`,tabIndex:g=0}=a??{},_=l?.id===t,v=(0,n.useContext)(_?Xl:Ql),[y,b]=ec(),[x,S]=ec(),C=function(e,t){return(0,n.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}(s,t),w=Qs(r);return Xs(()=>(f.set(t,{id:t,key:o,node:y,activatorNode:x,data:w}),()=>{let e=f.get(t);e&&e.key===o&&f.delete(t)}),[f,t]),{active:l,activatorEvent:c,activeNodeRect:u,attributes:(0,n.useMemo)(()=>({role:m,tabIndex:g,"aria-disabled":i,"aria-pressed":!(!_||m!==$l)||void 0,"aria-roledescription":h,"aria-describedby":d.draggable}),[i,m,g,_,h,d.draggable]),isDragging:_,listeners:i?void 0:C,node:y,over:p,setNodeRef:b,setActivatorNodeRef:S,transform:v}}function tu(){return(0,n.useContext)(Wl)}var nu={timeout:25};function ru(e){let{animation:t,children:r}=e,[i,a]=(0,n.useState)(null),[o,s]=(0,n.useState)(null),c=tc(r);return r||i||!c||a(c),Xs(()=>{if(!o)return;let e=i?.key,n=i?.props.id;e!=null&&n!=null?Promise.resolve(t(n,o)).then(()=>{a(null)}):a(null)},[t,i,o]),n.default.createElement(n.default.Fragment,null,r,i?(0,n.cloneElement)(i,{ref:s}):null)}var iu={x:0,y:0,scaleX:1,scaleY:1};function au(e){let{children:t}=e;return n.default.createElement(Ul.Provider,{value:Hl},n.default.createElement(Xl.Provider,{value:iu},t))}var ou={position:`fixed`,touchAction:`none`},su=e=>sc(e)?`transform 250ms ease`:void 0,cu=(0,n.forwardRef)((e,t)=>{let{as:r,activatorEvent:i,adjustScale:a,children:o,className:s,rect:c,style:l,transform:u,transition:d=su}=e;if(!c)return null;let f=a?u:{...u,scaleX:1,scaleY:1},p={...ou,width:c.width,height:c.height,top:c.top,left:c.left,transform:lc.Transform.toString(f),transformOrigin:a&&i?wc(i,c):void 0,transition:typeof d==`function`?d(i):d,...l};return n.default.createElement(r,{className:s,style:p,ref:t},o)}),lu=e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}},uu={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:lc.Transform.toString(t)},{transform:lc.Transform.toString(n)}]},sideEffects:lu({styles:{active:{opacity:`0`}}})};function du(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Zs((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=Il(a);if(!c)return;let{transform:l}=Gs(a).getComputedStyle(a),u=Ic(l);if(!u)return;let d=typeof t==`function`?t:function(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...uu,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}(t);return $c(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}var fu=0;function pu(e){return(0,n.useMemo)(()=>{if(e!=null)return++fu},[e])}var mu=n.default.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:i,style:a,transition:o,modifiers:s,wrapperElement:c=`div`,className:l,zIndex:u=999}=e,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggableNodes:h,droppableContainers:g,dragOverlay:_,over:v,measuringConfiguration:y,scrollableAncestors:b,scrollableAncestorRects:x,windowRect:S}=tu(),C=(0,n.useContext)(Xl),w=pu(f?.id),T=Jl(s,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:_.rect,over:v,overlayNodeRect:_.rect,scrollableAncestors:b,scrollableAncestorRects:x,transform:C,windowRect:S}),E=Ol(p),D=du({config:i,draggableNodes:h,droppableContainers:g,measuringConfiguration:y}),O=E?_.setRef:void 0;return n.default.createElement(au,null,n.default.createElement(ru,{animation:D},f&&w?n.default.createElement(cu,{key:w,id:f.id,ref:O,as:c,activatorEvent:d,adjustScale:t,className:l,transition:o,rect:E,style:{zIndex:u,...a},transform:T},r):null))});function hu(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function gu(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function _u(e){return e!==null&&e>=0}var vu={scaleX:1,scaleY:1},yu=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=function(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r&&(i||a)?n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width):0}(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...vu}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...vu}:a<r&&a>=i?{x:o.width+s,y:0,...vu}:{x:0,y:0,...vu}},bu=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=hu(t,r,n),o=t[i],s=a[i];return s&&o?{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}:null},xu=`Sortable`,Su=n.default.createContext({activeIndex:-1,containerId:xu,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:bu,disabled:{draggable:!1,droppable:!1}});function Cu(e){let{children:t,id:r,items:i,strategy:a=bu,disabled:o=!1}=e,{active:s,dragOverlay:c,droppableRects:l,over:u,measureDroppableContainers:d}=tu(),f=rc(xu,r),p=c.rect!==null,m=(0,n.useMemo)(()=>i.map(e=>typeof e==`object`&&`id`in e?e.id:e),[i]),h=s!=null,g=s?m.indexOf(s.id):-1,_=u?m.indexOf(u.id):-1,v=(0,n.useRef)(m),y=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,v.current),b=_!==-1&&g===-1||y,x=function(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}(o);Xs(()=>{y&&h&&d(m)},[y,m,h,d]),(0,n.useEffect)(()=>{v.current=m},[m]);let S=(0,n.useMemo)(()=>({activeIndex:g,containerId:f,disabled:x,disableTransforms:b,items:m,overIndex:_,useDragOverlay:p,sortedRects:gu(m,l),strategy:a}),[g,f,x.draggable,x.droppable,b,m,_,l,p,a]);return n.default.createElement(Su.Provider,{value:S},t)}var wu=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return hu(n,r,i).indexOf(t)},Tu=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!(!l||!r)&&(s===a||i!==o)&&(!!n||o!==i&&t===c)},Eu={duration:200,easing:`ease`},Du=`transform`,Ou=lc.Transition.toString({property:Du,duration:0,easing:`linear`}),ku={roleDescription:`sortable`};function Au(e){let{animateLayoutChanges:t=Tu,attributes:r,disabled:i,data:a,getNewIndex:o=wu,id:s,strategy:c,resizeObserverConfig:l,transition:u=Eu}=e,{items:d,containerId:f,activeIndex:p,disabled:m,disableTransforms:h,sortedRects:g,overIndex:_,useDragOverlay:v,strategy:y}=(0,n.useContext)(Su),b=function(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}(i,m),x=d.indexOf(s),S=(0,n.useMemo)(()=>({sortable:{containerId:f,index:x,items:d},...a}),[f,a,x,d]),C=(0,n.useMemo)(()=>d.slice(d.indexOf(s)),[d,s]),{rect:w,node:T,isOver:E,setNodeRef:D}=function(e){let{data:t,disabled:r=!1,id:i,resizeObserverConfig:a}=e,o=rc(`Droppable`),{active:s,dispatch:c,over:l,measureDroppableContainers:u}=(0,n.useContext)(Ul),d=(0,n.useRef)({disabled:r}),f=(0,n.useRef)(!1),p=(0,n.useRef)(null),m=(0,n.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:_}={...nu,...a},v=Qs(g??i),y=kl({callback:(0,n.useCallback)(()=>{f.current?(m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(v.current)?v.current:[v.current]),m.current=null},_)):f.current=!0},[_]),disabled:h||!s}),[b,x]=ec((0,n.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))},[y])),S=Qs(t);return(0,n.useEffect)(()=>{y&&b.current&&(y.disconnect(),f.current=!1,y.observe(b.current))},[b,y]),(0,n.useEffect)(()=>(c({type:gc.RegisterDroppable,element:{id:i,key:o,disabled:r,node:b,rect:p,data:S}}),()=>c({type:gc.UnregisterDroppable,key:o,id:i})),[i]),(0,n.useEffect)(()=>{r!==d.current.disabled&&(c({type:gc.SetDroppableDisabled,id:i,key:o,disabled:r}),d.current.disabled=r)},[i,o,r,c]),{active:s,rect:p,isOver:l?.id===i,node:b,over:l,setNodeRef:x}}({id:s,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:N,isDragging:P,over:F,setActivatorNodeRef:I,transform:L}=eu({id:s,data:S,attributes:{...ku,...r},disabled:b.draggable}),R=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(D,M),z=!!O,B=z&&!h&&_u(p)&&_u(_),V=!v&&P,H=B?(V&&B?L:null)??(c??y)({rects:g,activeNodeRect:A,activeIndex:p,overIndex:_,index:x}):null,U=_u(p)&&_u(_)?o({id:s,items:d,activeIndex:p,overIndex:_}):x,W=O?.id,G=(0,n.useRef)({activeId:W,items:d,newIndex:U,containerId:f}),K=d!==G.current.items,q=t({active:O,containerId:f,isDragging:P,isSorting:z,id:s,index:x,items:d,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:u,wasDragging:G.current.activeId!=null}),ee=function(e){let{disabled:t,index:r,node:i,rect:a}=e,[o,s]=(0,n.useState)(null),c=(0,n.useRef)(r);return Xs(()=>{if(!t&&r!==c.current&&i.current){let e=a.current;if(e){let t=zc(i.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}r!==c.current&&(c.current=r)},[t,r,i,a]),(0,n.useEffect)(()=>{o&&s(null)},[o]),o}({disabled:!q,index:x,node:T,rect:w});return(0,n.useEffect)(()=>{z&&G.current.newIndex!==U&&(G.current.newIndex=U),f!==G.current.containerId&&(G.current.containerId=f),d!==G.current.items&&(G.current.items=d)},[z,U,f,d]),(0,n.useEffect)(()=>{if(W===G.current.activeId)return;if(W!=null&&G.current.activeId==null)return void(G.current.activeId=W);let e=setTimeout(()=>{G.current.activeId=W},50);return()=>clearTimeout(e)},[W]),{active:O,activeIndex:p,attributes:j,data:S,rect:w,index:x,newIndex:U,items:d,isOver:E,isSorting:z,isDragging:P,listeners:N,node:T,overIndex:_,over:F,setNodeRef:R,setActivatorNodeRef:I,setDroppableNodeRef:D,setDraggableNodeRef:M,transform:ee??H,transition:function(){if(ee||K&&G.current.newIndex===x)return Ou;if(!(V&&!sc(k)||!u)&&(z||q))return lc.Transition.toString({...u,property:Du})}()}}function ju(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var Mu=[tl.Down,tl.Right,tl.Up,tl.Left],Nu=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(Mu.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case tl.Down:r.top<a.top&&t.push(n);break;case tl.Up:r.top>a.top&&t.push(n);break;case tl.Left:r.left>a.left&&t.push(n);break;case tl.Right:r.left<a.left&&t.push(n)}});let u=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Dc(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Dc(r),o=i.reduce((e,t,r)=>e+Cc(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Tc)})({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),d=Oc(u,`id`);if(d===o?.id&&u.length>1&&(d=u[1].id),d!=null){let e=a.get(n.id),t=a.get(d),o=t?i.get(t.id):null,u=t?.node.current;if(u&&o&&e&&t){let n=Vc(u).some((e,t)=>s[t]!==e),i=Pu(e,t),a=(l=t,!(!ju(c=e)||!ju(l))&&!!Pu(c,l)&&c.data.current.sortable.index<l.data.current.sortable.index),d=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},f={x:o.left,y:o.top};return d.x&&d.y?f:oc(f,d)}}}var c,l};function Pu(e,t){return!(!ju(e)||!ju(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var Fu=e=>{let{transform:t}=e;return{...t,y:0}},Iu=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},Lu=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,style:r,className:a,index:o,editing:s,editable:c,selectedIndex:l,background:u,activeColor:d,borderColor:f,borderWidth:p,dragging:m,...h}=e;return(0,i.jsxs)(`div`,{ref:t,className:P(a),style:{...r,display:`flex`,flexDirection:`column`,background:l===o?`white`:u,minHeight:`0px`,fontFamily:`inherit`,fontSize:`16px`,fontWeight:l===o?`700`:`400`,lineHeight:`1`,letterSpacing:`0px`,textTransform:`none`,minWidth:`unset`},...h,children:[(0,i.jsxs)(`div`,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},children:[(0,i.jsx)(`div`,{style:{marginLeft:l===o?`0px`:`-1px`,marginTop:l===o?`0px`:`4px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}),n,l===o?(0,i.jsx)(`div`,{style:{marginLeft:`0px`,marginTop:`0px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}):(0,i.jsx)(i.Fragment,{})]}),(0,i.jsx)(`div`,{style:{flex:`1 1 100%`,background:l===o&&d?d:`none`,minHeight:`2px`}})]})})),Ru={Wrapper:`_Wrapper_10yib_21`,fadeIn:`_fadeIn_10yib_29`,dragOverlay:`_dragOverlay_10yib_33`,Item:`_Item_10yib_43`,pop:`_pop_10yib_1`,withHandle:`_withHandle_10yib_57`,dragging:`_dragging_10yib_62`,disabled:`_disabled_10yib_72`},zu=(0,r.memo)((0,r.forwardRef)(({color:e,dragOverlay:t,dragging:n,disabled:a,fadeIn:o,handle:s,height:c,index:l,listeners:u,onRemove:d,renderItem:f,sorting:p,style:m,transition:h,transform:g,value:_,wrapperStyle:v,...y},b)=>{(0,r.useEffect)(()=>{if(t)return document.body.style.cursor=`grabbing`,()=>{document.body.style.cursor=``}},[t]);let x=f?f({dragOverlay:!!t,dragging:!!n,sorting:!!p,index:l,fadeIn:!!o,listeners:u,ref:b,style:m,transform:g,transition:h,value:_}):(0,i.jsx)(i.Fragment,{children:_});return(0,i.jsx)(`div`,{className:P(`tab-item`,Ru.Wrapper,o&&Ru.fadeIn,p&&Ru.sorting,t&&Ru.dragOverlay),style:{...v,transition:[h,v?.transition].filter(Boolean).join(`, `),"--translate-x":g?`${Math.round(g.x)}px`:void 0,"--translate-y":g?`${Math.round(g.y)}px`:void 0,"--scale-x":g?.scaleX?`${g.scaleX}`:void 0,"--scale-y":g?.scaleY?`${g.scaleY}`:void 0,"--index":l},ref:b,children:(0,i.jsx)(`div`,{className:P(Ru.Item,n&&Ru.dragging,s&&Ru.withHandle,t&&Ru.dragOverlay,a&&Ru.disabled,e&&Ru.color,`dragging`),style:m,"data-cypress":`draggable-item`,...s?void 0:u,...y,tabIndex:s?void 0:-1,children:x})})})),Bu={Row:`_Row_1kr10_1`},Vu=(0,r.memo)((0,r.forwardRef)(({children:e,horizontal:t,style:n},r)=>(0,i.jsx)(`div`,{ref:r,style:{...n},className:P(Bu.Row,t&&Bu.horizontal),children:e}))),Hu={...uu,sideEffects:lu({styles:{active:{opacity:`0`}}})},Uu=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{className:a,activationConstraint:o,animateLayoutChanges:l,adjustScale:u=!1,collisionDetection:d=Ac,coordinateGetter:f=Nu,dropAnimation:p=Hu,getItemStyles:m=()=>({}),getNewIndex:h,handle:g=!1,items:_,onMove:v,isDisabled:y=()=>!1,measuring:b,modifiers:x,renderItem:S,renderDivider:C,reorderItems:w=hu,strategy:T=bu,style:E,useDragOverlay:D=!0,onDragStart:O,wrapperStyle:k=()=>({})}=e,[A,j]=(0,r.useState)(()=>_);(0,r.useEffect)(()=>{j(_)},[_]);let[M,N]=(0,r.useState)(null),F=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.useMemo)(()=>[...t].filter(e=>e!=null),[...t])}(xc(vl,{activationConstraint:o}),xc(Sl,{activationConstraint:o}),xc(ul,{scrollBehavior:`Cypress`in window?`auto`:void 0,coordinateGetter:f})),I=A.indexOf.bind(A),L=M?I(String(M)):-1,R=[];A.map((e,t)=>{R.push((0,i.jsx)(Wu,{id:e,handle:g,index:t,style:m,wrapperStyle:k,disabled:y(e),renderItem:S,animateLayoutChanges:l,useDragOverlay:D,getNewIndex:h},e));let n=C?.({key:`divider-`+e});n&&R.push(n)});let{getPortalContainer:z}=(0,s.useFullscreenPortal)(),B=(0,s.useFloatSurface)()?.themeScope,V={};B?.mode&&(V[s.THEME_MODE_ATTR]=B.mode),B?.surface&&(V[s.THEME_SURFACE_ATTR]=B.surface);let H=B?.classes?.join(` `),U=(0,r.useRef)(null),W=(0,r.useRef)(null),G=()=>{let e=W.current;W.current=null,e&&setTimeout(()=>{let{el:t,start:n,end:r}=e;if(document.activeElement!==t)return;let i=r??t.value.length;try{t.setSelectionRange(n??i,i)}catch{}},80)};return(0,i.jsxs)(Zl,{sensors:F,collisionDetection:d,onDragStart:e=>{let{active:t}=e;t&&(O?.(e),N(t.id))},autoScroll:{canScroll:e=>{if(e===document.scrollingElement||e===document.documentElement||e===document.body)return!1;let t=U.current;return!!t&&e.contains(t)}},onDragEnd:e=>{if(N(null),G(),e.over){let t=I(String(e.over.id));L!==t&&(j(e=>w(e,L,t)),v?.(L,t))}},onDragCancel:()=>{N(null),G()},measuring:b,modifiers:x,children:[(0,i.jsx)(`div`,{ref:U,style:{display:`flex`,justifyContent:`flex-start`,boxSizing:`border-box`,...E},className:P(a,Ru.Wrapper),onMouseDown:e=>{(()=>{let e=document.activeElement;W.current=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?{el:e,start:e.selectionStart,end:e.selectionEnd}:null})();let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable||e.preventDefault()},children:(0,i.jsx)(Cu,{items:A,strategy:T,children:(0,i.jsx)(Vu,{ref:t,children:R})})}),D?(0,c.createPortal)((0,i.jsx)(mu,{adjustScale:u,dropAnimation:p,children:M?(0,i.jsx)(`div`,{className:H,...V,style:{display:`flex`},children:(0,i.jsx)(zu,{value:A[L],handle:g,renderItem:S,wrapperStyle:k({index:L,isDragging:!0,id:A[L]}),index:L,dragging:!0,style:m({id:A[L],index:L,isSorting:M!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0})}):null}),z()):null]})}));function Wu({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:r,id:a,index:o,onRemove:s,style:c,renderItem:l,useDragOverlay:u,wrapperStyle:d}){let{attributes:f,isDragging:p,isSorting:m,listeners:h,overIndex:g,setNodeRef:_,transform:v,transition:y}=Au({id:a,animateLayoutChanges:t,disabled:e,getNewIndex:n});return(0,i.jsx)(zu,{ref:_,value:a,disabled:e,dragging:p,sorting:m,handle:r,renderItem:l,index:o,style:c({index:o,id:a,isDragging:p,isSorting:m,overIndex:g}),onRemove:s?()=>s(a):void 0,transform:v,transition:y,wrapperStyle:d({index:o,isDragging:p,id:a}),listeners:h,"data-index":o,"data-id":a,dragOverlay:!u&&p,...f})}var Gu=`_TabStrip_3x0dp_1`,Ku=`rgb(33, 115, 70)`,qu=`#eee`,Ju=e=>(0,i.jsx)(Lu,{...e}),Yu=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,style:a,className:o,selectedTabIndex:c=0,tabNames:l=[],onSelectedTabIndexChange:u,onTabNameChange:d,onTabMove:f,renderScrollButtonStart:p=s.defaultCreateScrollStartButton,renderScrollButtonEnd:m=s.defaultCreateScrollEndButton,renderScrollButtonEdge:h=s.defaultCreateScrollEdgeButton,renderTabButton:g=Ju,renderTabDivider:_,propsEditLabel:v,disabled:y=!1,disableDrag:b=!1,background:x=`white`,activeColor:S=Ku,borderColor:C=qu,borderWidth:w=1}=e,[T,E]=(0,r.useState)(c),[D,O]=(0,r.useState)(l),k=(0,r.useCallback)(e=>{let t=L.current?.[e]?.closest(`.tab-item`)??L.current?.[e];if(!t||!W.current)return;let n=W.current,r=t.getBoundingClientRect(),i=n.getBoundingClientRect();r.left>=i.left&&r.right<=i.right&&r.top>=i.top&&r.bottom<=i.bottom||n.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:`smooth`})},[]);(0,r.useEffect)(()=>{k(c)},[c]);let A=(0,r.useCallback)((e,t)=>{t!==T&&(E(t),u?.(t))},[u,T]),j=(0,r.useCallback)((e,t)=>{E(n=>n===e?t:e<n&&t>=n?n-1:e>n&&t<=n?n+1:n),f?.(e,t)},[f]),M=(0,r.useRef)(null),[N,F]=(0,r.useState)(-1),I=(0,r.useCallback)((e,t)=>{d?.(e,t)},[d]);(0,r.useLayoutEffect)(()=>{E(c)},[c]),(0,r.useLayoutEffect)(()=>{O(l)},[l]);let L=(0,r.useRef)([]),R=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,()=>Object.assign({startEdit(e){L.current?.[e]?.startEdit()},cancel(e){L.current?.[e]?.cancel()}},R.current),[T,N]);let z=(0,r.useCallback)(({value:e,index:t,dragging:n})=>{let{style:r,maxLength:a,...o}=v||{},s=(0,i.jsx)(Vs,{ref:e=>{L.current[t]=e},value:e,disabled:y,maxLength:a,style:{color:T===t&&S?S:`inherit`,flex:`1 1 100%`,paddingTop:`1px`,paddingBottom:`1px`,...r},styleHover:{},onSubmit:e=>(M.current=!1,F(-1),I(t,e)),onCancel:()=>{M.current=!1,F(-1)},onChange:e=>{M.current=!0,F(t)},...o});return g({onClick:e=>A(e,t),value:e,index:t,editing:N===t&&M.current,editable:!0,disabled:y,selectedIndex:T,background:x,activeColor:S,borderColor:C,borderWidth:w,dragging:n,children:s})},[T,I,A,v,y,N,g]),[B,{width:V}]=vn(),[H,{width:U}]=vn(),W=(0,r.useRef)(null),[G,K]=(0,r.useState)({left:0,top:0,width:0,height:0}),[q,ee]=(0,r.useState)(null);(0,r.useEffect)(()=>{q!==null&&W.current&&W.current.scrollTo({left:q,behavior:`smooth`})},[q]);let te=(0,r.useCallback)((e,t=!1)=>{if(!W.current)return 0;let n=W.current.firstChild.getBoundingClientRect(),r=W.current.firstChild.firstChild.children,i=0;return i=t?0:s.ScrollUtils.getScrollTo(e,n.left,r,!0,Math.max(0,e-200)),ee(i),Math.max(0,i)},[]),J=(0,r.useCallback)((e,t=!1)=>{if(!W.current)return 0;let n=W.current.firstChild.getBoundingClientRect(),r=W.current.firstChild.firstChild.children,i=0,a=Math.ceil(U-V);return i=t?a:s.ScrollUtils.getScrollTo(e,n.left,r,!1,Math.max(0,e+200)),ee(i),Math.min(a,i)},[U,V]),Y=(0,r.useRef)(null),ne=(0,r.useRef)(null),X=(0,r.useCallback)(()=>{ne.current&&(clearTimeout(ne.current),ne.current=null,Y.current=null)},[]),re=(0,r.useCallback)((e,t,n=260)=>{Y.current=e,ne.current=setTimeout(()=>{let n=t?te(Y.current||e):J(Y.current||e);n===Y.current?X():re(n,t,120)},n)},[te,J,X]);(0,r.useEffect)(()=>()=>X(),[X]);let Z=(0,r.useMemo)(()=>({style:{marginLeft:`4px`,marginRight:`6px`},disabled:Math.floor(G.left)<=0||Math.floor(U-V)===0,orientation:s.ScrollbarOrientation.Horizontal,isBefore:!0,onMouseUp:X,onMouseLeave:X,onMouseDown:e=>{e.preventDefault(),re(W.current.scrollLeft,!0)},onClick:e=>te(Math.min(W.current.scrollLeft,q??2**53-1),e.ctrlKey)}),[G,q,U,V]),ie=(0,r.useMemo)(()=>({style:{marginLeft:`6px`,marginRight:`4px`},disabled:Math.floor(U-V)<=Math.ceil(G.left),orientation:s.ScrollbarOrientation.Horizontal,isBefore:!1,onMouseUp:X,onMouseLeave:X,onMouseDown:e=>{e.preventDefault(),re(W.current.scrollLeft,!1)},onClick:e=>J(Math.max(W.current.scrollLeft,q??0),e.ctrlKey)}),[G,q,U,V]),ae=(0,r.useMemo)(()=>(0,i.jsxs)(i.Fragment,{children:[h?(0,i.jsx)(`div`,{style:{minWidth:`16px`}}):null,n,h?.(Z)]}),[Z,ie,p,m,n,h]);return(0,i.jsxs)(`div`,{style:{...a,display:`flex`,alignItems:`stretch`},className:P(o,Gu),ref:R,children:[(0,i.jsx)(`div`,{style:{borderTop:`solid ${C} ${w}px`,position:`absolute`,width:`100%`}}),(0,i.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:ae}),(0,i.jsx)(`div`,{className:`Tabs`,ref:B,style:{flex:`1 1 100%`,display:`flex`,position:`relative`,overflow:`hidden`},children:(0,i.jsx)(`div`,{style:{position:`relative`,overflowY:`hidden`,overflowX:`hidden`,marginBottom:`3px`},ref:W,onScroll:e=>{K({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:(0,i.jsx)(Uu,{isDisabled:e=>y||b,items:D,strategy:yu,modifiers:[Fu,Iu],ref:H,renderItem:z,renderDivider:_,onMove:j,activationConstraint:{distance:15}})})}),(0,i.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:h?.(ie)})]})}));Yu.displayName=`TabStrip`;var Xu={"sheet-tab":`_sheet-tab_1cbiv_2`,ghost:`_ghost_1cbiv_18`},Zu=e=>{let{disabled:t,editing:n,...r}=e;return(0,i.jsx)(`div`,{...r})},Qu=(e,t)=>`color-mix(in srgb, ${e} ${t}%, transparent)`,$u={top:3,right:4.5,bottom:1.5,left:4},ed=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,sheet:a,style:o,className:c,value:u,index:d,editing:f,editable:p,disabled:m,selectedIndex:h,dragging:g,borderColor:_,borderWidth:v,activeColor:y,background:b=`white`,tabRadius:x=4,slotSurface:S=Zu,inverted:C=!0,...w}=e,[T,E]=(0,r.useState)(()=>!!a&&a.getProtection().isLocked()),[D,O]=(0,r.useState)(()=>a?a.getTabColor():null);l(a,{onProtectionChange:()=>{E(a.getProtection().isLocked())},onTabColorChange:()=>{O(a.getTabColor())},onStyleChange:()=>{O(a.getTabColor())}});let k=h===d,A=Ba(),j=!k&&!g&&!D,M=g&&!D&&!k,N=null,F=null;if(D||g||j){let e=b,t=e,n=e;D?(F=D.toBlackOrWhite().toCSS(),e=D.toCSS(),t=Qu(e,75),n=Qu(e,10)):k||(e=`var(--sxl-color-base-100)`);let r=`linear-gradient(0deg, ${e} 0%, ${t} 60%, ${n} 90%, transparent 100%)`;N=(0,i.jsx)(`div`,{className:P(Xu.pill,j&&Xu.ghost),style:{position:`absolute`,boxSizing:`border-box`,top:`3px`,left:`4px`,right:`4.5px`,bottom:`1.5px`,opacity:k?.5:1,borderRadius:`4px`,border:j?void 0:M?`1px solid var(--sxl-tab-hover-border)`:k?`${b} solid 1px`:`var(--sxl-color-base-300) solid 1px`,background:j?void 0:M?`linear-gradient(var(--sxl-tab-hover-bg), var(--sxl-tab-hover-bg)), var(--sxl-color-base-100)`:k&&D?r:e}})}let I=_??null,L=k?(0,i.jsx)(`div`,{style:{width:`100%`,borderRadius:`4px`,minWidth:`4px`,height:`2px`,backgroundColor:`var(--sxl-color-primary)`}}):null,R=k?`var(--sxl-color-primary)`:F||`color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent)`;return(0,i.jsx)(`div`,{ref:t,className:P(c),"data-sxl-theme-surface":k?`grid`:void 0,"data-sxl-theme-mode":k?A:void 0,style:{...o,display:`flex`,flexDirection:`column`,minHeight:`0px`,fontFamily:`var(--sxl-font-family)`,fontWeight:k?700:400,fontSize:`0.85rem`,letterSpacing:`0`,lineHeight:`1`,textTransform:`none`,minWidth:`unset`,cursor:g?`grabbing`:void 0,"--sxl-tab-hover-bg":`var(--sxl-color-base-100)`,"--sxl-tab-hover-border":`var(--sxl-color-base-300)`},...w,children:(0,i.jsx)(s.RoundedTab,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},radius:x,variant:k&&C?`tab`:`rounded`,clipInset:k&&C?void 0:$u,strokeColor:k?I:`transparent`,children:(0,i.jsxs)(S,{className:Xu[`sheet-tab`],disabled:m,editing:f,style:{position:`relative`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,textTransform:`none`,borderRadius:`0px`,minHeight:`0px`,paddingLeft:`11px`,paddingRight:`12px`,paddingTop:`3px`,paddingBottom:`3px`,flex:`1 1 100%`,fontWeight:k?700:400,fontSize:`0.85rem`,letterSpacing:`0`,cursor:g?`grabbing`:m?`default`:`pointer`,color:R,backgroundColor:k?b:`transparent`,minWidth:`unset`,"--sxl-sheet-tab-input-color":`var(--sxl-color-base-content)`},children:[N,(0,i.jsxs)(`div`,{style:{zIndex:1,display:`flex`,flexDirection:`row`,alignItems:`center`},children:[(0,i.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,rowGap:`1px`,lineHeight:`1`,marginTop:k?void 0:`1px`},children:[n,L]}),T?(0,i.jsx)(s.DynamicIcon,{iconKey:`Lock`,style:{scale:`0.80`,marginLeft:`2px`,width:`22px`,height:`22px`}}):(0,i.jsx)(`div`,{style:{minHeight:`22px`}})]})]},u+`:`+d)})})}));ed.displayName=`SheetTab`;var td=e.t({FindScopeOptions:()=>nd}),nd={Workbook:`workbook`,Sheet:`sheet`};function rd(e,n){let r=n.workbook;if(!r)return()=>{};let i=n,o=i?.notifier,c=e=>e??r.getSelectedSheetIndex();e.updateCommand(`addSheet`,{callback:e=>{r.getSheets().add({index:e,autoSelect:!0})}}),e.updateCommand(`deleteSheet`,{callback:e=>{r.getSheetAt(c(e))?.delete()}}),e.updateCommand(`duplicateSheet`,{callback:async e=>{(await r.getSheetAt(c(e))?.duplicate())?.select()}}),e.updateCommand(`hideSheet`,{callback:e=>{r.getSheetAt(c(e)).setVisibility(t.ISheet.Visibility.Hidden)}}),e.updateCommand(`nextSheet`,{callback:e=>{r.getNextSheet(c(e)).select()}}),e.updateCommand(`previousSheet`,{callback:e=>{r.getPreviousSheet(c(e)).select()}}),e.updateCommand(`selectNextSheet`,{callback:e=>{r.getNextSheet(c(e)).select()}}),e.updateCommand(`selectPreviousSheet`,{callback:e=>{r.getPreviousSheet(c(e)).select()}}),i?.focusNameBox&&e.updateCommand(`activeNameBox`,{callback:()=>{i.focusNameBox()}}),e.updateCommand(`activeNameManager`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{i?.activateTaskPane?.(`managedNames`)}});let l=e=>{if(!e||!i.editable)return;let t=`=${e.getName()}(`;St(i.editable,`${t})`,{mode:`edit`,initialSelection:{start:t.length,end:t.length}}),i.editable.getSession()?.getActiveEditor()?.focus()},u=()=>({searchByCategory:e=>r.getScripts().searchFunctions({category:e,type:`formula`,includeBuiltIn:!0,includeDeprecated:!1}),searchByText:(e,t)=>e?.trim()?r.getScripts().searchFunctions({text:e,category:t?.category,limit:t?.limit,type:`formula`,includeBuiltIn:!0}):Promise.resolve(a.CommonUtils.EmptyArray),getCategories:()=>r.getScripts().getFunctionCategories({type:`formula`,includeBuiltIn:!0})}),d;e.updateCommand(`insertFunction`,{tags:[`noTransaction`],callback:e=>{l(e)},context:u}),e.updateCommand(`insertFunctionDialog`,{tags:[`noTransaction`],callback:o?.showWindow?()=>{let e=i.editable?.getAnchor().getCoords()??null;o.showWindow(`insertFunction`,{context:u,onInput:t=>{typeof t==`string`?((e,t)=>{let n=i.editable;n&&(xt(n,e)?n.getSession()?.getActiveEditor()?.focus():n.startEdit(t??n.getAnchor().getCoords(),{dirty:e,mode:`edit`,autoFocus:!1})&&n.commit())})(t,e):l(t)}})}:void 0,context:u});let f=()=>{let t=r.getSelectedSheet(),n=t&&!t.getProtection().isFormatCellsAllowed()?[(0,a.messageKey)(`reason.sheetProtected`)]:[];e.updateCommand(`insertFunction`,{disabledReasons:n}),e.updateCommand(`insertFunctionDialog`,{disabledReasons:n})},p=()=>{d?.(),d=r.getSelectedSheet()?.addListeners({onProtectionChange:f}),f()};p();let m=e=>{let t=r.getCalculation(),n=t.getStatus();t.calculate(e).then(t=>{globalThis.__sxlKeyDebug&&console.log(`[calc] ${e?`calculateFull`:`calculateAll`}: status ${n} -> ${t}`)})};e.updateCommand(`calculateAll`,{callback:()=>{m(!1)}}),e.updateCommand(`calculateFull`,{callback:()=>{m(!0)}}),e.updateCommand(`workbookStatistics`,{callback:()=>{o?.showWindow&&o.showWindow(`workbookStatistics`,{context:()=>({getWorkbook:()=>r})})}});let h=async(e,t)=>{let n=r.getSelectedRanges(),i=e?n?.getDependents(t):n?.getPrecedents(t);if(i)try{await i.select()}catch(e){o?.showError?.(e)}else o?.showMessage?.(e?(0,a.t)(`formulaTrace.noDependents`):(0,a.t)(`formulaTrace.noPrecedents`))};e.updateCommand(`selectDirectPrecedents`,{callback:()=>h(!1,!1)}),e.updateCommand(`selectPrecedents`,{callback:()=>h(!1,!0)}),e.updateCommand(`selectDirectDependents`,{callback:()=>h(!0,!1)}),e.updateCommand(`selectDependents`,{callback:()=>h(!0,!0)}),e.updateCommand(`selectTheme`,{callback:e=>{e&&r.setTheme(e)},...i?.themes?{context:()=>({theme:r.getTheme(),themes:i.themes})}:{}}),e.updateCommand(`deleteCellStyle`,{callback:e=>{e?.delete()}}),e.updateCommand(`modifyCellStyle`,{callback:e=>{let t=e?.named;t&&r.getStyles().setNamed({name:t.getName(),style:r.getSelectedSheet().getSelectedRange().getCell().getStyle()})}}),e.updateCommand(`newCellStyle`,{callback:()=>{o?.showInput&&o.showInput({initialValue:(()=>{let e=0;for(;;){e++;let t=`Style ${e}`;try{return r.getStyles().validateStyleName(t,!0),t}catch{}}})(),title:(0,a.t)(`dialog.newCellStyle.title`),description:(0,a.t)(`dialog.newCellStyle.description`),inputLabel:(0,a.t)(`dialog.newCellStyle.inputLabel`),propsInput:{style:{minWidth:`300px`}},options:[`Ok`,`Cancel`],defaultOption:`Ok`,onValidateInput:async e=>{let t=e??``,n=null;try{r.getStyles().validateStyleName(t,!1)}catch(e){n=e.message}let i=r.getStyles().getNamed(t);return{valid:n===null,message:n??(i?`Update style '${i.getName()}'.`:void 0)}}}).then(({input:e,option:t})=>{if(t!==`Ok`)return;let n=r.getSelectedSheet().getSelectedRange(),i=r.getStyles().setNamed({name:e,style:n.getCell().getStyle()});n.getStyle().update({named:i.getName()})})}});let g=i?.findMemory,_=()=>g?.getLastFind?.()??null,v=async e=>{let t=0,n=null,i=(0,a.messageKey)(`op.findReplace`);e?.replace&&!e?.replaceOptions?.maxCount&&(i=(0,a.messageKey)(`op.replaceAll`));let s=await Promise.resolve(o?.showBusy?.(i)??null);try{let i=r.getSelectedSheet(),c={from:i.getSelectedCell(),...e.findOptions},l=(e?.scope??`sheet`)===`sheet`?i.find(c):r.find(c);if(e.replace){let i=r.replace(l,e.replaceText,e.replaceOptions);t=i.count,e.replaceOptions?.maxCount&&(n=i.last)}else{let e=l.next();e.done||(t++,n=e.value)}n?.select({scrollIntoView:!0,autoFocus:!1}),s?.(),!e.replaceOptions?.maxCount&&t>1&&o?.showMessage?.((0,a.t)(`findReplace.replaced`,{count:t}))}catch(e){s?.(),o?.showError?.(e)}return t},y=async e=>{let t=await v(e),n=(e=>{let t=e.findOptions;return t?.text?{text:t.text,matchCase:t.matchCase,matchEntireCell:t.matchEntireCell,useRegex:t.useRegex,fields:t.fields,axis:t.axis,scope:e.scope}:null})(e);return n&&(g?.setLastFind?.(n),S()),t},b=(e=!1)=>{if(!o?.showWindow)return;let t=r.getSelectedCell(),n=t.getFormulaText(),i={initialValue:{findOptions:{text:(n?`=${n}`:t.getText({useFormattingCategory:!0}))||_()?.text||``},replace:e},context:()=>y,autoFocus:!0,disableAutoDestroy:!0};o.showWindow(`find`,i)};e.updateCommand(`find`,{callback:()=>b(!1)}),e.updateCommand(`findReplace`,{callback:()=>b(!0)});let x=e=>{let t=_();if(!t)return;let{scope:n,...r}=t;return v({findOptions:{...r,reverse:e},scope:n,replace:!1})};function S(){let t=_()?[]:[(0,a.messageKey)(`reason.noPreviousSearch`)];e.updateCommand(`findNext`,{disabledReasons:t}),e.updateCommand(`findPrevious`,{disabledReasons:t})}e.updateCommand(`findNext`,{callback:()=>{x(!1)}}),e.updateCommand(`findPrevious`,{callback:()=>{x(!0)}}),S(),e.updateCommand(`goto`,{callback:()=>{o?.showInput&&o.showInput({title:(0,a.t)(`dialog.goTo.title`),inputLabel:(0,a.t)(`dialog.goTo.inputLabel`),options:[{id:`Go To`,label:()=>(0,a.t)(`dialog.goTo`)}],onInput:async e=>{if(e)try{await r.getRanges(e).select()}catch(e){o.showMessage?.(e.message,{type:s.NotifierType.Error})}}})}});let C=e=>{if(!o?.showWindow)return;let t={selection:()=>r.getSelectedRanges().getFixed(!0),getNames:()=>r.getNames(),resolveRanges:e=>r.getRanges(e).getFixed(!0)},n={initialValue:e,context:()=>t,onInput:async e=>{if(e)try{await e.select()}catch(e){o.showMessage?.(e.message,{type:s.NotifierType.Error})}}};o.showWindow(`namedDetails`,n)};e.updateCommand(`selectNamed`,{callback:async e=>{if(e)try{await e.select()}catch(e){o?.showError?.(e)}}}),e.updateCommand(`addNamedReference`,{callback:()=>C(null)}),e.updateCommand(`editNamedReference`,{callback:e=>C(e??null)}),e.updateCommand(`deleteNamedReference`,{callback:e=>{e?.delete?.()}}),e.updateCommand(`activateTask`,{callback:()=>{o?.showInput&&o.showInput({title:(0,a.t)(`dialog.activateTask.title`),inputLabel:(0,a.t)(`dialog.activateTask.inputLabel`),options:[{id:`Activate`,label:()=>(0,a.t)(`dialog.activate`)}],onInput:async e=>{if(e)try{i?.activateTaskPane?.(e)}catch(e){o.showError?.(e.message)}}})}});let w=()=>{let t=r.getView();t&&(e.updateCommand(`workbookViewToggleShowFormulaBar`,{state:t.isShowFormulaBar(),callback:()=>{t.setShowFormulaBar(!t.isShowFormulaBar())}}),e.updateCommand(`workbookViewToggleShowTabs`,{state:t.isShowTabs(),callback:()=>{t.setShowTabs(!t.isShowTabs())}}),e.updateCommand(`workbookViewToggleShowStatusBar`,{state:t.isShowStatusBar(),callback:()=>{t.setShowStatusBar(!t.isShowStatusBar())}}),e.updateCommand(`workbookViewToggleShowHorizontalScrollBar`,{state:t.isShowHorizontalScrollbar(),callback:()=>{t.setShowHorizontalScrollbar(!t.isShowHorizontalScrollbar())}}),e.updateCommand(`workbookViewToggleShowVerticalScrollBar`,{state:t.isShowVerticalScrollbar(),callback:()=>{t.setShowVerticalScrollbar(!t.isShowVerticalScrollbar())}}))};w();let T=()=>{e.updateCommand(`locale`,{state:r.getPinnedLocale(),callback:e=>{r.setLocale(e??null)}})};T();let E=()=>{let t=r.getProtection().isStructureAllowed()?[]:[`The workbook structure is protected.`];for(let n of[`addSheet`,`duplicateSheet`,`selectTheme`,`addNamedReference`,`editNamedReference`,`deleteNamedReference`])e.updateCommand(n,{disabledReasons:t});let n=r.getSheets().getCount()<=1,i=[...t,...n?[`A workbook must have at least one visible sheet.`]:[]];e.updateCommand(`hideSheet`,{disabledReasons:i}),e.updateCommand(`deleteSheet`,{disabledReasons:i})};E();let D=r.addListeners({onSheetsChange:()=>{E()},onViewChange:()=>{w(),T()},onProtectionChange:()=>{E()},onSelectedSheetChange:()=>{p()}});return()=>{D(),d?.()}}var id={dynamic:(e,t)=>{let n=t.manager?mr(e,{manager:t.manager,notifier:t.notifier}):void 0,r=rd(e,t);return()=>{n?.(),r()}}},ad=class{constructor(){this._loadedIO=null,this._loadPromise=null,this._backingStore=null,this._listeners=new Set,this._lazyDefaultStore={write:async e=>(await this._loadIO()).getBackingStore().write?.(e)??null}}async _loadIO(){return this._loadedIO?this._loadedIO:(this._loadPromise||=(async()=>{try{let e=await import(`@sheetxl/io`);return await t.WorkbookIO.install(e.IOPlugin),this._loadedIO=t.WorkbookIO,this._loadedIO.addListeners({onRead:(e,t)=>{for(let e of this._listeners)e.onRead?.(this,t)},onWrite:(e,t)=>{for(let e of this._listeners)e.onWrite?.(this,t)}}),this._backingStore&&this._loadedIO.setBackingStore(this._backingStore),this._loadedIO}catch(e){throw this._loadPromise=null,e}})(),this._loadPromise)}async getReadFormats(e){return(await this._loadIO()).getReadFormats(e)}async getWriteFormats(e){return(await this._loadIO()).getWriteFormats(e)}async install(e){return(await this._loadIO()).install(e)}getOrigin(e){return new t.WorkbookOrigin(e)}async read(e){return(await this._loadIO()).read(e)}async writeArrayBuffer(e,t){return(await this._loadIO()).writeArrayBuffer(e,t)}async write(e,t,n){return(await this._loadIO()).write(e,t,n)}async writeAs(e,t,n){return(await this._loadIO()).writeAs(e,t,n)}getBackingStore(){return this._backingStore??(this._loadedIO?this._loadedIO.getBackingStore():this._lazyDefaultStore)}setBackingStore(e){this._backingStore=e??null,this._loadedIO?.setBackingStore(this._backingStore)}canWrite(){return typeof this.getBackingStore().write==`function`}canRead(){return typeof this.getBackingStore().read==`function`}addListeners(e,t){return this._listeners.add(e),()=>{this._listeners.delete(e)}}addCommitListener(e){return this.addListeners({onWrite:(t,n)=>{n.save&&e.onCommit?.({store:n.workbook.getTransactions(),commitId:n.commitId})}})}},od=new ad,sd=async(e,n={})=>{let{io:r=od,defaultTheme:i}=n;if(e instanceof t.Workbook)return e;if(!e||!a.CommonUtils.isPromiseLike(e)&&Object.keys(e).length===0)return new t.Workbook({theme:i});let o=await Promise.resolve(e);if(o instanceof t.Workbook)return o;if(o&&o.source){let e=await r.read(o);if(!e)throw Error(`Unable to read workbook from the provided source.`);return e}return o},cd=(e,n={})=>{let{io:i,defaultTheme:a,reloadKey:o}=n,s=(0,r.useRef)({io:i,defaultTheme:a});s.current={io:i,defaultTheme:a};let[c,l]=(0,r.useState)(()=>e instanceof t.Workbook?{status:`loaded`,workbook:e}:{status:`loading`});return(0,r.useEffect)(()=>{let t=!0;return l(e=>e.status===`loaded`?e:{status:`loading`}),(async()=>{try{let n=await sd(e,s.current);if(!t)return;l(e=>e.status===`loaded`&&e.workbook===n?e:{status:`loaded`,workbook:n})}catch(e){if(!t)return;l({status:`error`,error:e})}})(),()=>{t=!1}},[e,o]),c},ld=!1,ud=!1,dd=null,fd=async e=>{let n=await t.LicenseManager.getDetails();if(ud||n.isEval()){try{let e=top??window;e.SheetXL||=Object.freeze({getSelectedWorkbook:()=>dd?.getWorkbook(),getSelectedSheet:()=>dd?.getWorkbook().getSelectedSheet(),getSelectedRange:()=>dd?.getWorkbook().getSelectedRange(),getSelectedRanges:()=>dd?.getWorkbook().getSelectedRanges(),getRange:e=>dd?.getWorkbook().getRange(e),getSelectedWorkbookElement:()=>dd,getLicenseManager:()=>t.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, { autoSelect: true })":{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.getSelectedRange().getStyle().getFill().toCSS()":{Summary:`Get the fill style as css for the selected range.`},"SheetXL.getRange('a1:a3').autoFill('a1:a7')":{Summary:`Autofill down.`},"SheetXL.getRange('e7:i9').merge({ axis: '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().addPicture('https://www.sheetxl.com/logo-text.svg')":{Summary:`Add an image.`},"SheetXL.getSelectedSheet().getMovables().addPicture('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().addFormula('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(e){e instanceof DOMException||console.error(e),ld=!0}if(dd!==e&&(dd=e,!ld))try{ld=!0,(top??window).SheetXL&&(await t.LicenseManager._validate(!0),t.LicenseManager.wasPrinted()&&(()=>{a.CommonUtils.consoleWithNoSource(`%cTip: You can access the API directly in the console.
31
+ Try
32
+ %c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
33
+ >%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;`),ld=!0;let e=document.getElementById(`openEditorLink`);e&&e.addEventListener(`click`,e=>{e.preventDefault(),console.log(`openScriptEditor called from console`)})})())}catch(e){e instanceof DOMException||console.error(e)}}},pd=`_add-button_1b4ig_1`,md=e=>(0,i.jsx)(ed,{...e}),hd=`var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3)))`,gd=`1px`,_d=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{children:n,workbook:a,onBeforeUserChange:o,onUserChange:c,disabled:u=!1,readOnly:d=!1,className:f,style:p,condensed:m=!1,renderSheetTab:h=md,onTabContextMenu:g,renderScrollButtonStart:_,renderScrollButtonEnd:v,renderScrollButtonEdge:y,...b}=e,x=(0,s.useTranslator)(),S=m?null:_,C=m?null:v,w=m?null:y,T=(0,r.useRef)(null),E=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,()=>Object.assign({startEdit(e){E.current?.startEdit(e)},cancel(e){E.current?.cancel(e)}},T.current),[]);let[D,O]=(0,r.useState)(a?.getSelectedSheetIndex()),[k,A]=(0,r.useState)(a?.getSheets().getItems()),[j,M]=(0,r.useState)(a?.getProtection());l(a,{onViewChange(e){O(e?.getSelectedSheetIndex())},onSheetsChange:e=>{A(e.getSheets().getItems())},onProtectionChange:e=>{M(e?.getProtection())}});let N=d||!j.isStructureAllowed(),F=`color-mix(in srgb, var(--sxl-color-base-300) 25%, transparent)`,I=(0,r.useMemo)(()=>{let e=[];for(let t=0;t<k.length;t++)e.push(k[t].getName());return e},[k]),L=(0,r.useCallback)(e=>{!1!==o?.(e)&&(a.getSheetAt(e).select(),c?.(e))},[a,o,c]),R=(0,r.useCallback)((e,t)=>{a.getSheetAt(e).setName(t),c?.(e)},[a,c]),z=(0,r.useCallback)((e,t)=>{a.getSheetAt(e).setIndex(t),c?.(t)},[a,c]),B=(0,s.useCallbackRef)(()=>{if(!1===o?.(D))return;let e=D+1;a.getSheets().add({name:void 0,index:e,autoSelect:!0}),c?.(e)},[a,o,c,D]),V=(0,s.useCallbackRef)(e=>{let t;try{t=a.getSheetAt(e.index)}catch{}return t?h({sheet:t,inverted:!m,onContextMenu:g?t=>{L(e.index),g(t,e.index)}:void 0,...e}):(0,i.jsx)(i.Fragment,{})},[a,m,h,g,L]),H=(0,s.useCallbackRef)(e=>{let{key:t,style:n,...r}=e;return(0,i.jsx)(`div`,{...r,style:{alignSelf:`stretch`,width:`1px`,marginLeft:`-1px`,marginTop:`6px`,marginBottom:`6px`,background:F,...n}},t)},[F]),U=(0,r.useMemo)(()=>N?null:(0,i.jsx)(`button`,{type:`button`,className:P(`workbook-strip-add`,pd),disabled:u,"aria-label":`addTab`,title:x(`workbookStrip.newSheet`),onMouseDown:e=>{e.button===0&&e.preventDefault()},onClick:()=>B(),children:(0,i.jsx)(s.DynamicIcon,{iconKey:`AddCircle`,style:{width:`18px`,height:`18px`}})}),[u,N,B,x]);return(0,i.jsxs)(`div`,{ref:T,className:P(`workbook-strip`,f),style:{position:`relative`,display:`flex`,alignItems:`stretch`,flex:`1 1 100%`,maxWidth:`100%`,...p},...b,children:[(0,i.jsx)(Yu,{ref:E,selectedTabIndex:D,tabNames:I,onSelectedTabIndexChange:L,onTabNameChange:R,onTabMove:z,background:`var(--sxl-color-base-100)`,borderColor:hd,activeColor:null,disabled:u,disableDrag:N,renderTabButton:V,renderTabDivider:H,renderScrollButtonStart:S,renderScrollButtonEnd:C,renderScrollButtonEdge:w,propsEditLabel:{readOnly:N,maxLength:31,styleHover:{fontWeight:`700`},onKeyPress:e=>{a.isValidSheetNameCharacter(e.key)||e.preventDefault()},onCancel:()=>{c?.(D)}},children:n}),(0,i.jsx)(`div`,{style:{borderTop:`solid ${hd} ${gd}`,minWidth:`4px`}}),(0,i.jsx)(`div`,{style:{borderTop:`solid ${hd} ${gd}`,flex:`none`,display:`flex`,alignItems:`center`},children:U}),(0,i.jsx)(`div`,{style:{borderTop:`solid ${hd} ${gd}`,flex:1,minWidth:`24px`}})]})}));_d.displayName=`WorkbookStrip`;var vd=`_loading-panel_bjv3h_1`,yd=`_loading-spinner_bjv3h_10`,bd=e=>{let{key:t,...n}=e;return(0,i.jsx)(To,{...n},t)},xd=e=>(0,i.jsx)(_d,{...e}),Sd=e=>{let{transitionDelay:t,transparentBackground:n,onMount:r,onUnmount:a,className:o,style:s,...c}=e;return(0,i.jsx)(`div`,{className:P(vd,o),style:{background:n?`transparent`:`var(--sxl-color-base-100, #fff)`,...s},...c,children:(0,i.jsx)(`div`,{className:yd})})},Cd={"sheetxl-workbook":`_sheetxl-workbook_r60qk_11`,"sheetxl-reset":`_sheetxl-reset_r60qk_36`,viewport:`_viewport_r60qk_30`},wd={version:1};Br();var Td={ignoreModelChange:!0},Ed={flex:`1 1 100%`,display:`flex`,boxSizing:`border-box`},Dd=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,Od=(0,r.memo)((0,r.forwardRef)((e,n)=>{let{workbook:a,onWorkbookLoad:c,autoFocus:u=!1,style:d,className:f,onFocus:p,onBlur:m,onKeyDown:h,undoManager:g,focusNameBox:_,showTabs:y,propsTabs:b,renderTabs:x=xd,propsContextMenu:S,renderContextMenu:C,renderColumnMenu:w,renderMovableMenu:T,propsFloatPanel:E,renderFloatPanel:D,renderWorkbookLoading:O=Sd,propsWorkbookLoading:k,propsSheet:A,editable:j,renderSheet:M=bd,wrapperMain:N,showHorizontalScrollbar:F,showVerticalScrollbar:I,colorScheme:L,gridColorScheme:R,...z}=e;if(!a)throw Error(`IWorkbook must be provided.`);let B=(0,r.useRef)(null),V=(0,r.useRef)(null),H=(0,r.useMemo)(()=>(0,i.jsx)(`div`,{className:P(`sheetxl-viewport`,Cd.viewport),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`,pointerEvents:`none`},ref:V}),[]),[U,W]=(0,r.useState)(!1),[G,K]=(0,r.useState)(!1),q=(0,r.useCallback)(()=>{W(!0)},[]),ee=(0,r.useRef)(null),te=(0,s.useImperativeElement)(n,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>a,getSheetElement:()=>B.current,getViewportElement:()=>V.current,getCommandScope:()=>ee.current,focus(){B&&B.current&&B.current.focus()}}),[a]),[J,Y]=(0,r.useState)(null),ne=(0,r.useCallback)(e=>{e&&Y(e)},[]),X=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{!U||!J||(async()=>{X.current!==c&&(await c?.({source:J}),X.current=c??null),K(!0)})()},[U,J]);let re=(0,s.useCallbackRef)(e=>{b?.onUserChange?.(e);let t=document.activeElement;t&&t!==document.body&&!te.current?.contains(t)||requestAnimationFrame(()=>{B?.current?.focus()})},[b]),[Z,ie]=(0,r.useState)(a.getSelectedSheet()),[ae,oe]=(0,r.useState)(a.getProtection());l(a,{onSheetsChange:e=>{ie(e?.getSelectedSheet())},onViewChange(e){ie(e?.getSelectedSheet())},onProtectionChange:e=>{oe(e?.getProtection())}}),l(a,{onRequestSelect:async(e,t)=>new Promise(e=>{let n=B.current;n?n.getSheet()===t?e(!0):n.getGridSurface()?.onPaneChangeOnce(()=>{B.current?.getSheet()!==t&&e(!1),e(!0)}):e(!1)})},Td);let[se,ce]=(0,r.useReducer)(e=>e+1,0),le=a.getView();l(le,{onViewChange:e=>{ce()}});let[ue]=(0,s.usePersistenceState)(za.Mode,null),[Q]=(0,s.usePersistenceState)(za.DarkImages,!1),{themeMode:de}=(0,s.useResolvedThemeMode)({mode:L??ue??void 0}),$=Ba(R),fe=(0,r.useId)(),pe=(0,r.useMemo)(()=>(0,s.createThemeScopeClass)(`workbook`,fe),[fe]),me=(0,r.useMemo)(()=>(0,o.buildGridThemeCSS)({scope:`.${pe}`}),[pe]),he=(0,r.useMemo)(()=>Pa(`sxl-defaults`,`.${pe}`),[pe]),[ge,_e]=(0,r.useState)({});(0,r.useLayoutEffect)(()=>{if(!J)return;let e=getComputedStyle(J),t=t=>e.getPropertyValue(t).trim()||void 0,n=t(`--icon-color`);_e({base100:t(`--sxl-color-base-100`),primary:t(`--sxl-color-primary`),icon:n&&n!==`currentColor`?n:e.color||void 0})},[J,de]);let ve=(0,r.useMemo)(()=>({backgroundColor:ge.base100,borderColor:ge.primary,fillColor:ge.icon??`grey`}),[ge]),ye=(0,r.useMemo)(()=>new s.Viewport,[]),be=s.Command.useCommandScope(),xe=(0,s.useNotifier)(),Se=Qn(),Ce=Ta(),[we,Te]=(0,r.useState)(g??null);(0,r.useEffect)(()=>{if(!be)return void Te(null);if(g)return void Te(g);if(!a)return void Te(null);let e=new t.TransactionUndoManager(a.getTransactions());return Te(e),()=>e.close()},[be,a,g]);let[Ee,De]=(0,s.usePersistenceState)(`workbook.lastFind`,null,wd),Oe=(0,r.useRef)(Ee);Oe.current=Ee;let ke=(0,r.useMemo)(()=>({getLastFind:()=>Oe.current,setLastFind:De}),[De]),Ae=(0,r.useMemo)(()=>({scopeName:{key:a?`workbook:${a.getId()}`:`workbook`,name:`workbook`},contributor:id,data:{workbook:a,editable:j,notifier:xe,manager:we??void 0,activateTaskPane:(e,t)=>Se.activate(e,t),themes:Ce,focusNameBox:_,findMemory:ke}}),[a,j,xe,we,Se,Ce,_,ke]),[je,Me]=(0,r.useState)(!1),[Ne,Pe]=(0,r.useState)(null),[Fe,Ie]=(0,r.useState)(s.ToolTipPlacement.Top),[Le,Re]=(0,r.useState)(t.TypesUtils.EmptyBounds),ze=(0,r.useCallback)(()=>{Me(!1),Pe(null)},[]),Be=(0,r.useCallback)((e,t,n=s.ToolTipPlacement.Top)=>{Re(e),Ie(n),Pe(t),Me(!0)},[]),Ve=y??le?.isShowTabs(),He=F??le?.isShowHorizontalScrollbar(),Ue=I??le?.isShowVerticalScrollbar(),[We,{width:Ge}]=vn(),Ke=Ge===0||Ge>560,qe=(0,r.useMemo)(()=>{if(!Ve||!x)return null;let e=x({condensed:!Ke,workbook:a,...b,onUserChange:re});return e.type===r.Fragment?null:(Ke||(e=(0,i.jsx)(`div`,{style:{flex:`none`,display:`flex`},children:e})),e)},[x,b,a,Ke,Ve]),Je=(0,r.useCallback)(e=>{let{style:t,...n}=e,r=null,o=null,c=null;if(He&&(o=(0,i.jsx)(`div`,{className:`workbook-strip-scrollbar`,style:{display:`flex`,flex:`1 1 100%`,borderTop:Dd,flexDirection:`column`,justifyContent:`center`},children:(0,i.jsx)(Ua,{...n,style:{paddingLeft:`4px`,paddingRight:`4px`,...t},propsTouchThumb:ve,endGap:700,sheet:Z,onShowTooltip:e=>{Be({x:e.anchor.x,y:e.anchor.y,width:0,height:0},e.display??``,e.placement)},onCloseTooltip:()=>ze()})})),Ve&&Ke&&(c=qe),Ve&&Ke&&!He&&(c=(0,i.jsxs)(`div`,{style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`},children:[c,(0,i.jsx)(`div`,{style:{borderTop:Dd,flex:`1`}})]})),c&&He){let e=ge.icon??`grey`;r=(0,i.jsx)(s.SplitPane,{position:a.getView().getTabRatio()/10+`%`,onPositionChange:({percent:e})=>{a.getView().setTabRatio(Math.round(10*e))},minBefore:`200px`,minAfter:`180px`,propsResizer:{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='${e}' 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:Dd,borderBottom:`solid 3px transparent`}},elementBefore:c,elementAfter:o??void 0})}else if(He)r=o;else{if(!c)return(0,i.jsx)(`div`,{className:P(`workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`,height:`1px`,width:`100%`,borderTop:Dd}});r=c}return(0,i.jsx)(`div`,{className:P(`workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,width:`100%`,alignContent:`center`},children:r})},[Z,a,Ve,He,Ke,qe,ve,ge]),[Ye,Xe]=(0,r.useState)(null),Ze=Ar(),Qe=(0,r.useMemo)(()=>new s.Command.ManualActivation(null),[]),{reference:$e,component:et}=(0,s.useFloatStack)({label:`contextMenu`,propsPopper:(0,r.useMemo)(()=>({placement:`right-start`,...Ye?.propsPopper}),[Ye?.propsPopper]),anchor:Ye?.anchor??{getBoundingClientRect:()=>new DOMRect(Ye?.clientX||0,Ye?.clientY||0)},onClose:()=>Xe(null),createPopupPanel:Ye?.createPopupPanel,renderFloatPanel:D});(0,r.useEffect)(()=>{Ye?$e.open(0):$e.close(0)},[Ye]);let tt=(0,s.useCallbackRef)((e,t)=>!!e?.isDefaultPrevented()||!!w&&(e.preventDefault(),e.stopPropagation(),Ye&&Ye.anchor===e.currentTarget?(Xe(null),!0):(Qe.setAnchor(Ze?.getAnchor()??null),Xe({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},createPopupPanel:e=>{let{floatReference:n}=e;return w({column:t,floatReference:n,...S})}}),!0)),[w,S,a,Ye]),nt=(0,s.useCallbackRef)(e=>!!e.originalEvent?.isDefaultPrevented()||!!C&&(e.originalEvent?.preventDefault(),Qe.setAnchor(Ze?.getAnchor()??null),Xe({clientX:e.clientX,clientY:e.clientY,createPopupPanel:e=>{let{floatReference:t}=e;return C({workbook:a,floatReference:t,...S})}}),!0),[C,S,a]),rt=(0,s.useCallbackRef)((e,t)=>!!e?.isDefaultPrevented()||!!T&&(e.preventDefault(),Qe.setAnchor(Ze?.getAnchor()??null),Xe({clientX:e.clientX,clientY:e.clientY,createPopupPanel:e=>{let{floatReference:n}=e;return T({movable:t,floatReference:n,...S})}}),!0),[T,S,a]),it=(0,s.useCallbackRef)(()=>{J&&fd(J)},[J]),at=(0,r.useCallback)(e=>{let{style:t,...n}=e;return(0,i.jsx)(Ua,{...n,style:{...t,paddingTop:`4px`,paddingBottom:`4px`},propsTouchThumb:ve,sheet:Z,endGap:700,onShowTooltip:e=>{Be(e.anchor,e.display??``,s.ToolTipPlacement.Left)},onCloseTooltip:()=>ze()})},[Z,ve]);(0,r.useEffect)(()=>{u&&G&&B.current&&B.current.focus(typeof u==`object`?u:void 0)},[u,G]);let ot=(0,r.useRef)(null),st=(0,r.useMemo)(()=>G||!O?null:O?.({...k})??null,[G,O,k]),ct=(0,r.useMemo)(()=>st?(0,i.jsx)(`div`,{ref:ot,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,left:`0px`,top:`0px`,width:`100%`,height:`100%`,position:`absolute`,boxSizing:`border-box`,pointerEvents:d?.pointerEvents},children:st}):null,[st,d]),lt=(0,r.useCallback)(e=>{let{movable:t,...n}=e;if(!t)return(0,i.jsx)(i.Fragment,{});let r={movable:t,onContextMenuCapture:e=>{rt(e,t)},...n},a=t.getContent().getType(),o=null;return a===`picture`?(0,i.jsx)(Pn,{loadingPanel:(0,i.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`}}),picture:t.getContent(),description:t.getDescription()??t.getName()??void 0,...r}):a===`chart`?(0,i.jsx)(Ms,{...r,chart:t.getContent()}):a===`slicer`?(0,i.jsx)(Ns,{...r,slicer:t.getContent()}):a===`shape`?(0,i.jsx)(Po,{...r,shape:t.getContent()}):(o=`Unsupported type: '${a}'.`,typeof o==`string`&&(o=(0,i.jsx)(Un,{...r,style:{border:`red solid 2px`},description:o})),(0,i.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,clipPath:`inset(0px)`,display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,pointerEvents:`all`},children:o},t.getId()))},[]),ut=(0,r.useMemo)(()=>M({ref:B,style:Ed,colorScheme:de,gridColorScheme:$,sheet:Z,editable:j,onSheetContextMenu:nt,viewport:ye,showScrollbars:!1,viewportComponent:H,onFirstRender:q,onShowTooltip:e=>{Be({x:e.anchor.x,y:e.anchor.y,width:0,height:0},e.display??``,e.placement)},onCloseTooltip:()=>ze(),renderMovable:lt,...A,propsCellRender:{onColumnButtonMouseDown:(e,t)=>{A?.propsCellRender?.onColumnButtonMouseDown?.(e,t),tt(e,t)},...A?.propsCellRender}}),[A,Z,de,$,j]),dt=(0,r.useMemo)(()=>{let e=(0,i.jsx)(s.ScrollPane,{ref:We,style:Ed,viewport:ye,onWheelScroll:e=>B.current?.onWheelScroll?.(e),showHorizontalScrollbar:He||Ve,showVerticalScrollbar:Ue,renderScrollbarHorizontal:Je,renderScrollbarVertical:at,children:ut});return Ke||Ge===0||(e=(0,i.jsxs)(i.Fragment,{children:[e,qe]})),N?N(e):e},[He,Ve,Je,Ue,ye,Ke,ut,qe,N]),ft=(0,r.useMemo)(()=>(0,i.jsx)(s.FloatTooltip,{open:je,title:Ne,placement:Fe,anchorEl:{getBoundingClientRect:()=>new DOMRect(Le.x,Le.y,Le.width,Le.height)}}),[je,Ne,Fe,Le]),pt=(0,r.useMemo)(()=>({boxSizing:`border-box`,fontFamily:`var(--sxl-font-family)`,"--sxl-image-filter":$===`dark`&&Q?`hue-rotate(180deg) invert(1) brightness(95%)`:`none`,...d}),[$,Q,d]),mt=(0,r.useMemo)(()=>({flex:`1 1 100%`,width:`100%`,display:`flex`,flexDirection:`column`,opacity:!G&&st?0:void 0}),[G,st]);return(0,i.jsx)(s.FloatProvider,{renderFloatPanel:D,propsFloatPanel:E,themeScopeClass:pe,themeSurface:`app`,themeMode:de,children:(0,i.jsx)(v,{workbook:a,children:(0,i.jsx)(s.Command.CommandScopeProvider,{spec:Ae,scopeRef:ee,elementRef:te,children:(0,i.jsx)(hr.Provider,{value:we,children:(0,i.jsxs)(`div`,{className:P(`sheetxl-workbook`,Cd[`sheetxl-workbook`],Cd[`sheetxl-theme`],s.scrollbarThemedClassName,pe,f),style:pt,"data-sxl-theme-mode":de,...z,ref:cn([te,ne]),onFocus:e=>{it(),p?.(e)},onBlur:e=>{m?.(e)},onKeyDown:e=>{h?.(e)},children:[(0,i.jsx)(`style`,{children:me}),(0,i.jsx)(`style`,{children:he}),(0,i.jsxs)(`div`,{className:Cd[`sheetxl-reset`],style:mt,children:[dt,ft,(0,i.jsx)(s.Command.CommandAnchorProvider,{tracker:Qe,keyBindings:!1,children:et})]}),ct]})})})})})}));Od.displayName=`WorkbookElementBase`;var kd=(0,r.memo)((0,r.forwardRef)((e,t)=>{let{workbook:n,renderWorkbookError:r,renderWorkbookLoading:a=Sd,propsWorkbookLoading:o,...s}=e,c=cd(n),l;return l=c.status===`error`?r?r({error:c.error}):(0,i.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,textAlign:`center`,boxSizing:`border-box`},children:c.error instanceof Error?c.error.message:String(c.error)}):c.status===`loaded`?(0,i.jsx)(Od,{ref:t,...s,workbook:c.workbook,renderWorkbookLoading:a,propsWorkbookLoading:o}):(0,i.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:a?.({...o})}),(0,i.jsx)(i.Fragment,{children:l})}));kd.displayName=`WorkbookElement`;var Ad=(e,n)=>{let[i,a]=(0,r.useState)(null),[o,s]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!e)return a(null),void s(!1);let r=new t.TransactionSaveStateManager(e.getTransactions(),n);a(r),s(r.isDirty());let i=r.addListeners({onDirty:()=>s(!0),onClean:()=>s(!1)});return()=>{i(),r.close(),a(null)}},[e,n]),{isDirty:o,saveState:i}},jd=e=>{let[t,n]=(0,r.useState)(()=>e?.getName()??null);return(0,r.useEffect)(()=>{if(e)return n(e.getName()??null),e.addListeners({onNameChange:e=>n(e.getName()??null)});n(null)},[e]),t},Md=[`o`,`s`,`w`,`n`,`t`,`m`],Nd=class{constructor(e={}){this.name=null,this.dirty=!1,this.removeLangListener=null,this.base=null,this.originalTitle=null,this.windowInstalled=!1,this.handleBeforeUnload=e=>{this.dirty&&(e.preventDefault(),e.returnValue=``)},this.handleKey=e=>{!e.defaultPrevented&&this.guardKeys&&(e.altKey?e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.preventDefault():(e.ctrlKey||e.metaKey)&&this.guardKeys.includes(e.key)&&e.preventDefault())},this.documentTitle=e.documentTitle??!0,this.confirmOnClose=e.confirmOnClose??!0;let t=e.keyboardGuard??!0;this.guardKeys=!1===t?null:Array.isArray(t)?t:Md}update(e,t){this.name=e,this.dirty=t,this.installWindowListeners(),this.applyTitle()}dispose(){this.removeLangListener?.(),this.removeLangListener=null,this.windowInstalled&&typeof window<`u`&&(window.removeEventListener(`beforeunload`,this.handleBeforeUnload),document.removeEventListener(`keydown`,this.handleKey),document.removeEventListener(`keyup`,this.handleKey),this.windowInstalled=!1),this.documentTitle&&this.originalTitle!==null&&typeof document<`u`&&(document.title=this.originalTitle),this.base=null,this.originalTitle=null,this.name=null,this.dirty=!1}installWindowListeners(){this.windowInstalled||typeof window>`u`||(this.confirmOnClose&&window.addEventListener(`beforeunload`,this.handleBeforeUnload),this.guardKeys&&(document.addEventListener(`keydown`,this.handleKey),document.addEventListener(`keyup`,this.handleKey)),this.removeLangListener=a.DefaultLanguagePackService.addChangeListener(()=>this.applyTitle()),this.windowInstalled=!0)}applyTitle(){if(!this.documentTitle||typeof document>`u`)return;this.base===null&&(this.originalTitle=document.title,this.base=typeof this.documentTitle==`string`?this.documentTitle:document.title);let e=this.dirty?` ●`:``,t=this.name,n=`${t??(0,a.t)(`workbook.untitled`)}${e}`;document.title=t||e?`${n} - ${this.base}`:`${this.base}`}},Pd=(e,t,n={})=>{let{documentTitle:i,confirmOnClose:a,keyboardGuard:o}=n,s=(0,r.useRef)(null);s.current||=new Nd({documentTitle:i,confirmOnClose:a,keyboardGuard:o}),(0,r.useEffect)(()=>{s.current.update(e,t)},[e,t]),(0,r.useEffect)(()=>()=>s.current?.dispose(),[])};exports.COLOR_SCALE_PRESETS=eo,exports.ChartAreaIcon=Yo,exports.ChartAreaStackedIcon=Xo,exports.ChartAreaStackedPercentIcon=Zo,exports.ChartBarIcon=Ko,exports.ChartBarStackedIcon=qo,exports.ChartBarStackedPercentIcon=Jo,exports.ChartBubble3DIcon=is,exports.ChartBubbleIcon=rs,exports.ChartColumnIcon=Fo,exports.ChartColumnStackedIcon=Io,exports.ChartColumnStackedPercentIcon=Lo,exports.ChartEditor=Ms,exports.ChartLineIcon=Ro,exports.ChartLineMarkersIcon=Vo,exports.ChartLineStackedIcon=zo,exports.ChartLineStackedMarkersIcon=Ho,exports.ChartLineStackedPercentIcon=Bo,exports.ChartLineStackedPercentMarkersIcon=Uo,exports.ChartPieDoughnutIcon=Go,exports.ChartPieIcon=Wo,exports.ChartScatterLinesIcon=ns,exports.ChartScatterLinesMarkersIcon=ts,exports.ChartScatterLinesMarkersSmoothIcon=$o,exports.ChartScatterLinesSmoothIcon=es,exports.ChartScatterMarkersIcon=Qo,exports.ColumnButton=I,Object.defineProperty(exports,"CommandContext",{enumerable:!0,get:function(){return td}}),exports.CommandRootProvider=Yr,exports.CornerTriangle=b,exports.DATA_BAR_COLORS=to,exports.DATA_BAR_NEGATIVE_COLOR=`#FF0000`,exports.DATA_BAR_PRESETS=ro,exports.DefaultTaskPaneRegistry=Yn,exports.DocThemesContext=wa,exports.DocThemesProvider=e=>{let{themes:t,children:n}=e;return(0,i.jsx)(wa.Provider,{value:t,children:n})},exports.EVAL_TIP_GAP=6,exports.EVAL_TIP_STYLE=Z,exports.EditableLabel=Vs,exports.EmptyFrame=Un,exports.FormulaCellRenderer=j,exports.FormulaInput=Rs,exports.FunctionArgIcons=Ue,exports.FunctionPreviewContent=Ge,exports.FunctionPreviewHeader=Ke,exports.FunctionPreviewPanel=qe,exports.FunctionSignature=We,exports.ICON_SET_GROUPS=co,exports.INPUT_EXPECTED_CHAR=`/*^&<>=:,+-( `,exports.InputClipboardInjector=Or,Object.defineProperty(exports,"LicenseManager",{enumerable:!0,get:function(){return t.LicenseManager}}),exports.LogoNoPaddingIcon=e=>(0,i.jsxs)(`svg`,{...e,viewBox:`0 0 48 48`,children:[(0,i.jsx)(`path`,{d:`M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z`,fill:`#547DBE`}),(0,i.jsx)(`path`,{d:`m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z`,fill:`#FFFFFF`}),(0,i.jsx)(`path`,{d:`m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z`,fill:`#547DBE`,fillOpacity:`0.4`}),(0,i.jsx)(`path`,{d:`m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z`,strokeWidth:`2.5`,stroke:`#EB594D`,fill:`#f9CECB`})]}),exports.LogoTextNoPaddingIcon=da,exports.MainFocusContext=kr,exports.MovableLayer=Hn,exports.NamedHintPanel=Je,exports.NamedItemsPanel=De,exports.PaneScopeProvider=Fr,exports.PictureEditor=Pn,exports.PresetChartType=ks,exports.ReferenceModeContext=q,exports.ReferenceModeProvider=e=>{let{store:t,children:n}=e,i=(0,r.useMemo)(()=>t??U(),[t]);return(0,r.createElement)(q.Provider,{value:i},n)},exports.STYLE_PRESETS=Ka,exports.ShapeEditor=Po,exports.SheetCellEditorLayer=jt,exports.SheetCellRenderer=x,exports.SheetClipboardLayer=Ca,exports.SheetCommandContributor=bo,exports.SheetCommandProvider=xo,exports.SheetElement=To,exports.SheetHeaderRenderer=H,exports.SheetProvider=h,exports.SheetReferenceHeaderLayer=ua,exports.SheetReferenceLayer=Ut,exports.SheetScrollbar=Ua,exports.SheetSelection=Mt,exports.SheetSelectionLayer=Pt,exports.SheetTab=ed,exports.SlicerEditor=Ns,exports.StaticBorderRenderer=En,exports.StyledStrokePath=on,exports.Tab=Lu,exports.TabStrip=Yu,exports.TaskPaneArea=rr,exports.TaskPaneProvider=({children:e,renderArea:t,onUpdateArea:n,registry:i=Yn})=>{let o=(0,r.useRef)(null),c=(0,r.useRef)(null),[l,u]=(0,r.useState)(null),[d,f]=(0,r.useState)(null),p=(0,s.useCallbackRef)(e=>{let r=t({registry:i,onClose:()=>{f(null),n?.(null)},ref:e=>{e&&f(e)}});return n?.(r),r},[t,i,l]);(0,r.useEffect)(()=>{if(d&&!c.current){let e=d.getActive();e&&p(e)}},[t,i]);let m=(0,r.useMemo)(()=>({activate(e,t){c.current!==e&&(o.current?o.current.activate(e,t):(u({key:e,options:t}),p(e)))},getActive(){let e=o.current;return e?e.getActive():null},getOpen:()=>[],close:e=>a.CommonUtils.DonePromise,addListener:()=>()=>{}}),[]);return(0,r.useEffect)(()=>{d&&l&&(d.activate(l.key,{autoFocus:!0,...l.options}),u(null))},[l,d]),(0,r.createElement)(Xn.Provider,{value:d??m},e)},exports.TaskPaneStrip=nr,exports.TaskPaneTitle=er,exports.ThemeStateKey=za,exports.ThemedChartIcon=os,exports.UndoManagerContext=hr,exports.WindowChrome=Nd,exports.WorkbookCommandContributor=id,exports.WorkbookElement=kd,exports.WorkbookIO=od,exports.WorkbookProvider=v,exports.WorkbookStrip=_d,exports._WorkbookIO=ad,exports.argTypeKey=He,exports.assembleCall=(e,t,n,r)=>{let i=r?.equals??1?`=`:``,a=t.map((e,t)=>(n[t]??``).trim()),o=t.length;for(;o>0&&a[o-1]===``&&t[o-1].optional;)o--;return a.some(ke)||(o=0),`${i}${e}(${a.slice(0,o).join(r?.separator??`,`)})`},exports.buildDocThemeCSS=Ra,exports.buildOOXMLThemeCSS=Pa,exports.charSpanOfTokens=le,exports.contributeClipboardCommands=ba,exports.contributeEditorCommands=Dt,exports.contributeInsertCommands=Tt,exports.contributeSelectionCommands=Nt,exports.contributeSheetCommands=vo,exports.contributeUndoCommands=mr,exports.contributeWhileEditingCommands=Et,exports.contributeWorkbookCommands=rd,exports.createCSSSystemLookup=Ea,exports.createEditable=re,exports.createFunctionDescriptor=(e,t)=>({name:e,summary:t.getSummary(),params:t.getParameters()}),exports.createFunctionHint=(e,n)=>{let r=e.getName();return{name:r,nameLocal:(0,t.getLanguagePack)()?.functions?.[r]??r,argSeparator:(0,t.getLocaleProfile)(n?.locale??`en`).listSeparator,argIndex:n?.argIndex??-1,params:e.getDeclaration().getParameters()}},exports.createInputClipboardInjector=xr,exports.createReferenceModeStore=U,exports.createSheetCellInput=yt,exports.createSheetCreateEdit=X,exports.createSystemColorVars=e=>{let n={};for(let r in e)n[`${t.SYSTEM_COLOR_CSS_PREFIX}${r.toLowerCase()}`]=e[r];return n},exports.createTransactionalMiddleware=vr,exports.defaultColorScale=io,exports.defaultDataBar=ao,exports.defaultIconSet=so,exports.defaultIconStops=oo,exports.evalSegmentAt=oe,exports.evalTargetForSelection=se,exports.formatEvalLiteral=de,exports.formatEvalValue=fe,exports.formulaPrefixLen=E,exports.getConditionalIcon=Oi,exports.getConditionalIconSet=e=>Di[e]??ki,exports.getReferenceMode=G,exports.handleReferencePointNav=he,exports.hasTextSelection=ae,exports.iconSetSize=e=>{let t=parseInt(e,10);return Number.isFinite(t)&&t>0?t:3},exports.insertAtCaret=xt,exports.insertEditText=St,exports.installSystemColorDefaults=Oa,exports.installSystemColorLookup=()=>(Aa||(Aa=Ea(),t.Color.setDefaultSystemLookup(Aa)),Aa),exports.isEditable=yr,exports.isFormulaText=T,exports.isInputExpectedAt=w,exports.isReferencePointSeeding=me,exports.literalSeparatorsForDecimal=ue,exports.placeholderFromCell=e=>{if(!e||!e.isSpillOverflow())return null;let t=e.getSpill();if(!t)return null;let n=t.getCell(),r=n.getFormulaText();return!r||n.isEqual(e)?null:`=`+r},exports.presetChartTypeDescriptor=js,exports.referenceSpan=k,exports.renderWorkbookLoading=Sd,exports.renderWorkbookSheet=bd,exports.renderWorkbookStrip=xd,exports.resolveCellBackground=Y,exports.resolveWorkbookInput=sd,exports.restBase=Oe,exports.rootEvalSegment=ce,exports.scopeDrawnRanges=Ht,exports.setGlobalIWorkbookElement=fd,exports.setPrintExamplesOnLoad=e=>{ud=e},exports.setReferenceMode=K,exports.splitReferenceSegments=ve,exports.startEditWith=bt,exports.toArgRows=(e,t=[])=>{let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=i.getName(),o=i.getRepeatingTypes();if(!o&&!i.isRest()){n.push({key:`${r}`,label:a,param:i,descKey:a,optional:i.isOptional()});continue}let s=o??[i],c=s.length,{base:l,n:u}=Oe(a),d=n.length,f=Math.max(d,t.length-(e.length-r-1)),p=-1;for(let e=d;e<f;e++)ke(t[e])&&(p=e);let m=+!i.isOptional(),h=Math.max(m+1,Math.ceil((p-d+1)/c)+1);for(let e=0;e<h;e++)for(let t=0;t<c;t++){let o=s[t];n.push({key:`${r}r${e}s${t}`,label:`${c===1?l:o.getName()}${u+e}`,param:o,descKey:c===1?a:`${a}.${o.getName()}`,optional:e>0||o.isOptional()||i.isOptional(),repeat:e===h-1})}}return n},exports.toggleReferenceInFormula=A,exports.tokenColor=D,exports.tokenIndexAtCaret=O,exports.useAppColorScheme=Va,exports.useBorders=yn,exports.useDocThemes=Ta,exports.useEditCommit=ge,exports.useFormulaInput=we,exports.useFormulaInputParts=Is,exports.useFormulaViewAnchor=M,exports.useGridColorScheme=Ba,exports.useInputField=e=>{let{value:t,onChange:n,onChangeText:i,onDone:o,changeOn:c=`live`,onValidate:l,invalidKey:u=(0,a.messageKey)(`namedInput.invalid`),disabled:d=!1}=e,[f,p]=(0,r.useState)(!1),m=(0,r.useRef)(!1),h=(0,r.useRef)(null),g=(0,r.useRef)(e);g.current=e;let _=e=>{m.current=e,p(e)},v=ge({initialText:t??``,parse:e=>{let{onValidate:t,invalidKey:n=(0,a.messageKey)(`namedInput.invalid`)}=g.current;try{t?.(e)}catch(e){return{error:e?.message||n}}return{value:e,error:null}},changeOn:c,onChange:n?e=>n(e??``):void 0,onChangeText:i,onDone:o?(e,t)=>o(e??``,t):void 0,session:{isActive:()=>m.current,end:e=>b(e)}}),y=(0,s.useCallbackRef)(()=>{g.current.disabled||m.current||(v.beginSession(),_(!0))},[]),b=(0,s.useCallbackRef)(e=>{e.reason===`cancel`&&v.revertToBaseline(),_(!1),v.notifyDone(e)},[]);(0,r.useEffect)(()=>{let e=t??``;v.resetCommitted(e,e)},[t]);let x=(0,s.useCallbackRef)(e=>{m.current||y(),v.setText(e.target.value),v.liveChange(e.target.value)},[]),S=(0,s.useCallbackRef)(e=>{v.resetBlurGuard(),v.handleDoneKeys(e)||v.handleTextKeys(e)},[]),C=(0,s.useCallbackRef)(e=>{v.resetBlurGuard(),y()},[]),w=(0,s.useCallbackRef)(e=>{let t=v.consumeBlurGuard();_(!1),!t&&v.dirtyRef.current&&v.notifyDone({reason:`accept`})},[]);return{inputProps:{value:v.text,onChange:x,onKeyDown:S,onFocus:C,onBlur:w,ref:e=>{h.current=e}},text:v.text,error:v.error,dirty:v.dirty,engaged:f&&!d,revert:v.revertToCommitted,commit:v.commit,cancel:v.cancel}},exports.useMainFocus=Ar,exports.useModelListener=l,exports.useModelSync=u,exports.useProtectedEditNotice=Ot,exports.useRangeListener=f,exports.useReferenceMode=te,exports.useReferenceModeStore=ee,exports.useResolvedWorkbook=cd,exports.useSelectDrag=ie,exports.useSheet=g,exports.useSystemColors=ka,exports.useTaskPaneArea=Qn,exports.useUndoManager=gr,exports.useWindowChrome=Pd,exports.useWorkbook=y,exports.useWorkbookApp=(e={})=>{let{source:n,io:i=od,fromUrl:o=!0,defaultTheme:s,documentTitle:c,confirmOnClose:l,keyboardGuard:u}=e,d=gn(),f=(0,r.useMemo)(()=>{if(n instanceof t.Workbook||a.CommonUtils.isPromiseLike(n))return n;let e=null,r=null;if(n)e=typeof n==`string`?{source:n}:n;else if(o&&d.search){let t=new URLSearchParams(d.search),n=t.get(`source`);n&&(e={source:n},r=t.get(`title`))}return e?i.read(e).then(e=>{if(!e)throw Error(`Unable to read workbook from the provided source.`);let n=e.getOrigin();return r&&n instanceof t.WorkbookOrigin&&n.update({name:r}),e}):new t.Workbook({theme:s})},[n,o,d.search,i,s]),p=cd(f,{io:i,defaultTheme:s}),m=p.status===`loaded`?p.workbook:null,h=jd(m),{isDirty:g}=Ad(m,i);return Pd(h,g,{documentTitle:c,confirmOnClose:l,keyboardGuard:u}),f},exports.useWorkbookEncrypted=e=>{let[t,n]=(0,r.useState)(()=>e?.getOrigin?.()?.isEncrypted?.()??!1);return(0,r.useEffect)(()=>{if(!e)return void n(!1);let t=e.getOrigin?.(),r=()=>n(t?.isEncrypted?.()??!1);return r(),t?.addListeners({onChange:r})},[e]),t},exports.useWorkbookFormat=e=>{let[t,n]=(0,r.useState)(()=>e?.getOrigin?.()?.getFormat?.()??null);return(0,r.useEffect)(()=>{if(!e)return void n(null);let t=e.getOrigin?.(),r=()=>n(t?.getFormat?.()??null);return r(),t?.addListeners({onChange:r})},[e]),t},exports.useWorkbookName=jd,exports.useWorkbookSaveState=Ad;