@sheetxl/sdk 0.8.0-beta.14 → 0.8.0-beta.16

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 (195) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/4MbBwfmW2hDXk9_w.mjs +165 -0
  3. package/browser/esm/{ChYgQL-8qIDFmX31.mjs → 9YWdxmSjzLN4j_ts.mjs} +22 -22
  4. package/browser/esm/B6BdiHigbUdbZp3J.mjs +686 -0
  5. package/browser/esm/{CImFKFaYToUH-bSE.mjs → BF_QwkZ_hs2rFoTT.mjs} +3 -3
  6. package/browser/esm/{DBvu0tdSf-5vol4e.mjs → BMo2_9Ul36IwRm3S.mjs} +3 -3
  7. package/browser/esm/{B1aH_qa-czVyEVHd.mjs → BWY1qiidTUBVPJoD.mjs} +506 -502
  8. package/browser/esm/{BSXQAXwZdJKYTO4P.mjs → Bf80epSsm_RyAOb9.mjs} +29 -29
  9. package/browser/esm/{D_XMi4_5iO2rkET5.mjs → BfoE6Dn_GQCIkQD3.mjs} +2 -2
  10. package/browser/esm/{Dhw5XEJYFrkYjdU2.mjs → BlMYYQZP-QM-iBHz.mjs} +23 -22
  11. package/browser/esm/{MuNBN02MyZ558c_K.mjs → BqT-ASHP0NVSUUnY.mjs} +1528 -1433
  12. package/browser/esm/{DnR0xY7_iE3TmMcg.mjs → BtNuoQIrrHw_jnbJ.mjs} +4 -4
  13. package/browser/esm/BxFzcCYhvo9NXFjC.mjs +527 -0
  14. package/browser/esm/{DonQz2Tc3k9lNT8E.mjs → BxYuRTSF9ykc-Tpz.mjs} +3 -3
  15. package/browser/esm/{aRXqxIzjuSLwawMh.mjs → C2PvZwqK-uvsugVS.mjs} +2 -2
  16. package/browser/esm/C3JOjQwdG9kAig7i.mjs +2017 -0
  17. package/browser/esm/{SwLp-iElwDjfcJtv.mjs → C5x0EzqElYGTiTQc.mjs} +2 -2
  18. package/browser/esm/{AXlD9K1gCwPU4gCO.mjs → CMChv-fCFh68VQQt.mjs} +588 -587
  19. package/browser/esm/{BpwULQPKbb4R9Jew.mjs → CRbQATfI0yZxe1kX.mjs} +3 -3
  20. package/browser/esm/{CM_X1zZYzEUPaNJL.mjs → CUu3zeHqcwMRYiov.mjs} +2 -2
  21. package/{node/esm/b3XnssSr9lmvAC2N.mjs → browser/esm/C_jLGkFemj55_BP3.mjs} +3 -3
  22. package/browser/esm/{CtC__ALh4I8PKIln.mjs → CkZoDPUCK5jMUaeJ.mjs} +26955 -22064
  23. package/browser/esm/{DvvqmUQ9Z0NFm1-4.mjs → D-iHJ3q4nwOLcn1D.mjs} +2 -2
  24. package/browser/esm/{qCqzZW74-fhaIG2V.mjs → D807piM0VSokWz-L.mjs} +2 -2
  25. package/browser/esm/{BLYl-afJe_3std8i.mjs → DW3oQ39IF0bsc_lm.mjs} +2 -2
  26. package/browser/esm/{Ln4gsmhqH1LyoANj.mjs → DcB52JPBPmkc3l1m.mjs} +4 -4
  27. package/browser/esm/{DIfAk63CvaOZ3QKi.mjs → DlVnybrgwZWxWN3_.mjs} +10 -10
  28. package/browser/esm/{Dh84MDs-OhdCPCIg.mjs → DvVhatd0J1ch3OCO.mjs} +22 -22
  29. package/browser/esm/{BWoz4kQdA5KKJfl6.mjs → Dx9Fya60meMpuHqm.mjs} +2 -2
  30. package/browser/esm/{r_EZapMBdyS4gUd-.mjs → HV0FkJ6k3Ils318J.mjs} +78 -78
  31. package/browser/esm/{C7hpfT-sX2lyLS-D.mjs → JV9Szh5qTssjxJoE.mjs} +2 -2
  32. package/browser/esm/{CPIWV3Enlh_BF2TY.mjs → KpuD1kEcWB7cT0VM.mjs} +3 -3
  33. package/browser/esm/{3t4S9eda2I6jFad0.mjs → U4FL-QeC0bRUhTEo.mjs} +2 -2
  34. package/browser/esm/{D39XcmtPXVtMN4yF.mjs → WLlpmgLN5OVLoLrC.mjs} +3 -3
  35. package/browser/esm/{Cy8uYCggktF83278.mjs → WR146UAqrsUsL39e.mjs} +2 -2
  36. package/browser/esm/{BPPMKyMn65i1a1mE.mjs → WcHfawW2lkTHtWUd.mjs} +51 -49
  37. package/browser/esm/{Bdcd3QOzsc0aVMjN.mjs → Zp5-cTJ0Llb6EfGi.mjs} +4 -4
  38. package/browser/esm/{oSCy1X5CJ1iYtGDp.mjs → ad9PX897hYE4Srkc.mjs} +3 -3
  39. package/browser/esm/{UMQTbO0zNmBpzW1V.mjs → d_t-7d5BD1AdHg3u.mjs} +404 -404
  40. package/browser/esm/{BVqIknGhQCLUB_7Q.mjs → dwGdnbV-CykjNrlm.mjs} +2 -2
  41. package/browser/esm/{DiXeQjc0WJGLSVEo.mjs → e69NcYnKMLnAmqyA.mjs} +2 -2
  42. package/browser/esm/index.mjs +886 -578
  43. package/browser/esm/{yuF8SbWfjBfrxcq5.mjs → r-o0UCm7KtluNmyK.mjs} +3 -3
  44. package/licenses/dependencies.txt +69 -69
  45. package/node/esm/{BEBt5fo__rvT2q_u.mjs → 446KYBjJQa8g-8Gg.mjs} +52 -50
  46. package/node/esm/{BELc5aQ_pFPgbiso.mjs → 5OfKfTRX2_y2NwpU.mjs} +2 -2
  47. package/node/esm/{C-5JLSNof0FhkuFd.mjs → A3PEHO1HJvkHfb5n.mjs} +2 -2
  48. package/node/esm/{YpOpRyciqQLIY1-G.mjs → B4WUGzJBkQu7BXRm.mjs} +2 -2
  49. package/node/esm/{I-FZojIFWluC6X-j.mjs → BH8J6vKSO5zI_TWo.mjs} +2 -2
  50. package/node/esm/BLmdKnkLwkb3wWe6.mjs +2040 -0
  51. package/node/esm/{BuyAYLI4s33-vmgG.mjs → BZSxu_ZqX8-Uczzn.mjs} +2 -2
  52. package/node/esm/{DiCMnYA2bttmrX3q.mjs → BfPBiAgVmWhuFgFP.mjs} +3 -3
  53. package/node/esm/{BSVttk12GXNfKZ9k.mjs → Bknw7zWZhl2-w1pi.mjs} +3 -3
  54. package/node/esm/{uLrulyR7IXq0SF4j.mjs → BvIPsPiHhMclZ1kH.mjs} +22 -22
  55. package/node/esm/{clgEkmEwfB28nkz2.mjs → By2TFKOjA1HekZap.mjs} +4 -4
  56. package/node/esm/{BXg-D8Rc_iyB8p7X.mjs → BywIhvYkWk2o7MSW.mjs} +2 -2
  57. package/node/esm/{pF2vCOTmrxPAB41Q.mjs → C3zyhnMwQ2hRQBz7.mjs} +31 -30
  58. package/node/esm/{BCjHRVU8tC5lYypg.mjs → C884edhUf9yMqpPp.mjs} +2 -2
  59. package/node/esm/{B6jhx5pHPs2W5GE7.mjs → CDHY-0OyQ9348Brb.mjs} +189 -189
  60. package/node/esm/{xRGObcoaGDnAZFnj.mjs → CERNLhFrAwtu_p-q.mjs} +2 -2
  61. package/node/esm/{DbPUG2DcQ3T_QhcJ.mjs → CFkX_Cn6avQqQiVC.mjs} +78 -78
  62. package/node/esm/CJDV8P3hI8lu--3Z.mjs +530 -0
  63. package/node/esm/{Cyeq1rDslIqF1LKz.mjs → CKwiipdPJGzAiPjg.mjs} +2 -2
  64. package/node/esm/{BLPrFp_jKGYgWPX1.mjs → CLtUMJfKsy4SevWE.mjs} +3 -3
  65. package/node/esm/{DLdXl0O0TXuyqLU4.mjs → CVPieTgKCwkL21nD.mjs} +28573 -23108
  66. package/node/esm/{Dlk2ZYExFgQ0xE2H.mjs → C_fYuynP2a_70WdL.mjs} +2 -2
  67. package/{browser/esm/BEDfJP2tcuRy2Y2E.mjs → node/esm/CgdNA3B_GFG_yJiN.mjs} +3 -3
  68. package/node/esm/Cs3ibv6YHCDwLRlk.mjs +115 -0
  69. package/node/esm/{DeFE8QfuCeGw-mvd.mjs → Cxak8i2NidZ4Uv6v.mjs} +487 -483
  70. package/node/esm/{NA-8urR7T1NCwrgD.mjs → D88A3UpCyGRjcX3U.mjs} +3 -3
  71. package/node/esm/{99miMotf3dOuG5Jk.mjs → DBIUe2BC9xU7qMHR.mjs} +3 -3
  72. package/node/esm/{BEdxa3I4VOiCsvy7.mjs → DELfV5HQZo1mInBd.mjs} +4 -4
  73. package/node/esm/{BfEdeOg4iYXaYTlh.mjs → DOt3t-13tsnM7Fj6.mjs} +2 -2
  74. package/node/esm/{B3hBxzqJ2_hUylNr.mjs → DfWc3nW_Z_qqc_Wf.mjs} +1762 -1674
  75. package/node/esm/DgnwKbUEyQN5_gWT.mjs +169 -0
  76. package/node/esm/{Ccocd9DTvOnlOE9D.mjs → Dhv9JymnXqcF54oo.mjs} +2 -2
  77. package/node/esm/{Lj98EH6coGdKUzuS.mjs → DvtyKKzOnoOM80NB.mjs} +22 -22
  78. package/node/esm/{Crn6dnSQQRCQAnQ-.mjs → KDGrIa9R5XzWfjM2.mjs} +2 -2
  79. package/node/esm/{D30rC6AWaGGf3CaC.mjs → RTwm9ge1KoPdlBNt.mjs} +2 -2
  80. package/node/esm/{CdSTmD2ZvG9NesNR.mjs → _RIAmJI98l6bIFfZ.mjs} +2 -2
  81. package/node/esm/{CI8UIWR01z9QDlzH.mjs → bIGdvfpnijWeCac6.mjs} +1005 -1004
  82. package/node/esm/index.mjs +913 -598
  83. package/node/esm/kaiXmn0AA5WDsLPo.mjs +199 -0
  84. package/node/esm/{B5VmOC0jO9Zbh9Mq.mjs → mTIhoz1gEcaEm7s1.mjs} +3 -3
  85. package/package.json +7 -7
  86. package/resources/locales/de/model.msg.json +82 -1
  87. package/resources/locales/en/model.msg.json +80 -1
  88. package/types/scripting-api.json +9967 -9497
  89. package/types/scripting-enums.json +27 -0
  90. package/types/scripting.d.ts +2282 -166
  91. package/types/src/.generated/wasm/sdk.d.ts +332 -0
  92. package/types/src/calculation/Calculation.d.ts +8 -0
  93. package/types/src/calculation/ICalculation.d.ts +51 -0
  94. package/types/src/calculation/compiler/Types.d.ts +5 -0
  95. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +1 -1
  96. package/types/src/calculation/formula/FormulaBlock.d.ts +2 -0
  97. package/types/src/calculation/formula/IFormulaBlock.d.ts +18 -0
  98. package/types/src/calculation/grid/CalcGrid.d.ts +5 -1
  99. package/types/src/calculation/grid/CalcGridBackend.d.ts +36 -1
  100. package/types/src/calculation/grid/CalcGridProxy.d.ts +2 -0
  101. package/types/src/calculation/grid/CalcGridUtils.d.ts +4 -2
  102. package/types/src/calculation/grid/FormulaHost.d.ts +3 -1
  103. package/types/src/calculation/grid/ICalcGrid.d.ts +88 -0
  104. package/types/src/calculation/grid/_CalcRequest.d.ts +9 -0
  105. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +2 -0
  106. package/types/src/calculation/spatial/SpillEntry.d.ts +55 -4
  107. package/types/src/calculation/state/CalcNode.d.ts +6 -3
  108. package/types/src/calculation/state/CalculationContext.d.ts +4 -2
  109. package/types/src/calculation/state/_PivotView.d.ts +22 -0
  110. package/types/src/cell/ICell.d.ts +1 -21
  111. package/types/src/cellRange/ICellRange.d.ts +18 -2
  112. package/types/src/collections/MixedTypedArrayList.d.ts +16 -2
  113. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +10 -0
  114. package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +3 -0
  115. package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +3 -0
  116. package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +3 -0
  117. package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +3 -0
  118. package/types/src/condition/BuiltInOperators/MatchesOperator.d.ts +10 -0
  119. package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
  120. package/types/src/condition/BuiltInOperators/index.d.ts +2 -0
  121. package/types/src/condition/Condition.d.ts +1 -0
  122. package/types/src/condition/ICondition.d.ts +15 -0
  123. package/types/src/condition/_ConditionUtils.d.ts +14 -0
  124. package/types/src/conditionalFormat/ConditionalFormat.d.ts +2 -1
  125. package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -3
  126. package/types/src/license/LicenseDetails.d.ts +27 -0
  127. package/types/src/license/LicenseManager.d.ts +24 -7
  128. package/types/src/license/_Utils.d.ts +34 -3
  129. package/types/src/license/index.d.ts +1 -0
  130. package/types/src/license/runtime.browser.d.ts +32 -4
  131. package/types/src/license/runtime.node.d.ts +8 -5
  132. package/types/src/license/summary.d.ts +18 -0
  133. package/types/src/pivot/IPivotTable.d.ts +1549 -13
  134. package/types/src/pivot/IPivotTableCollection.d.ts +70 -4
  135. package/types/src/pivot/PivotCache.d.ts +95 -11
  136. package/types/src/pivot/PivotDataField.d.ts +73 -0
  137. package/types/src/pivot/PivotField.d.ts +142 -0
  138. package/types/src/pivot/PivotTable.d.ts +548 -14
  139. package/types/src/pivot/PivotTableCollection.d.ts +18 -3
  140. package/types/src/pivot/_PivotAreas.d.ts +48 -0
  141. package/types/src/pivot/_PivotControls.d.ts +140 -0
  142. package/types/src/pivot/_PivotEngine.d.ts +9 -0
  143. package/types/src/pivot/_PivotGroups.d.ts +25 -0
  144. package/types/src/pivot/_PivotItems.d.ts +167 -0
  145. package/types/src/pivot/_PivotStructure.d.ts +237 -0
  146. package/types/src/pivot/_PivotStylePreview.d.ts +21 -0
  147. package/types/src/pivot/_PivotUtils.d.ts +37 -0
  148. package/types/src/pivot/engine/PivotAdd.d.ts +37 -0
  149. package/types/src/pivot/engine/PivotData.d.ts +65 -0
  150. package/types/src/pivot/engine/PivotEdit.d.ts +45 -0
  151. package/types/src/pivot/engine/PivotFilters.d.ts +50 -0
  152. package/types/src/pivot/engine/PivotFormulas.d.ts +72 -0
  153. package/types/src/pivot/engine/PivotLayout.d.ts +133 -0
  154. package/types/src/pivot/engine/PivotMove.d.ts +24 -0
  155. package/types/src/pivot/engine/PivotRefresh.d.ts +87 -0
  156. package/types/src/pivot/engine/PivotSort.d.ts +26 -0
  157. package/types/src/pivot/engine/PivotViewBuilder.d.ts +22 -0
  158. package/types/src/pivot/engine/index.d.ts +15 -0
  159. package/types/src/pivot/index.d.ts +4 -0
  160. package/types/src/pivot/kernel/KernelPivot.d.ts +63 -0
  161. package/types/src/pivot/kernel/_KernelLeaves.d.ts +100 -0
  162. package/types/src/pivot/kernel/_PivotAxisTree.d.ts +71 -0
  163. package/types/src/primitives/Range.d.ts +12 -1
  164. package/types/src/sheet/IWorksheet.d.ts +35 -0
  165. package/types/src/sheet/SheetCell.d.ts +21 -14
  166. package/types/src/sheet/SheetRange.d.ts +3 -0
  167. package/types/src/sheet/Worksheet.d.ts +175 -7
  168. package/types/src/sheet/_PivotFootprint.d.ts +42 -0
  169. package/types/src/sheet/_SheetAutoFitUtils.d.ts +12 -1
  170. package/types/src/sheet/_SheetMutations.d.ts +47 -0
  171. package/types/src/sheet/_SheetStateTypes.d.ts +11 -0
  172. package/types/src/sheet/style/SheetCellStyle.d.ts +6 -0
  173. package/types/src/sheet/style/SheetPivotStyle.d.ts +83 -0
  174. package/types/src/sheet/style/_IndentUnit.d.ts +14 -0
  175. package/types/src/sheetHeader/SheetCellHeader.d.ts +1 -1
  176. package/types/src/slicer/ISlicer.d.ts +114 -34
  177. package/types/src/slicer/ITimeline.d.ts +61 -0
  178. package/types/src/slicer/Slicer.d.ts +76 -3
  179. package/types/src/slicer/_PivotSlicer.d.ts +51 -0
  180. package/types/src/slicer/index.d.ts +1 -0
  181. package/types/src/table/AnchoredTable.d.ts +11 -1
  182. package/types/src/table/ITable.d.ts +5 -6
  183. package/types/src/table/ITableStyle.d.ts +50 -34
  184. package/types/src/table/_BuiltInPivotStyles.d.ts +8 -0
  185. package/types/src/table/_BuiltInTableStyles.d.ts +0 -1
  186. package/types/src/type/ITypes.d.ts +5 -1
  187. package/types/src/workbook/IWorkbook.d.ts +8 -2
  188. package/types/src/workbook/Workbook.d.ts +72 -6
  189. package/browser/esm/D2NFcBM4xsv0JJ1q.mjs +0 -184
  190. package/browser/esm/DnqwX3-2NfGBaXXl.mjs +0 -357
  191. package/node/esm/C3S4hF1vn0NyJPPd.mjs +0 -199
  192. package/node/esm/CPsGyt3vnOdLTShj.mjs +0 -360
  193. package/node/esm/D4Y1WJgjiFEgbWrW.mjs +0 -115
  194. package/types/src/pivot/_PivotXml.d.ts +0 -24
  195. package/types/src/primitives/Grouping.d.ts +0 -65
@@ -1,19 +1,19 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.14
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.16
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: SheetXL EULA — https://www.sheetxl.com/eula
6
6
  */
7
- import { r as e } from "./BWoz4kQdA5KKJfl6.mjs";
8
- import { a as t, l as n, o as r, t as i, u as a } from "./qCqzZW74-fhaIG2V.mjs";
9
- import { $t as o, A as s, Ai as c, Ar as l, At as u, Bi as d, Br as f, Bt as p, C as m, Ci as h, Cr as g, D as _, Di as v, Dt as y, E as b, Ei as x, En as S, Et as C, F as w, Fi as ee, Fr as te, Ft as ne, Gr as re, Gt as ie, Hr as ae, Ht as oe, I as se, Ii as ce, Ir as le, It as ue, Jr as de, Jt as fe, Kr as pe, L as me, Li as he, Lr as ge, Lt as _e, M as ve, Mn as ye, Mr as be, Ni as xe, Nn as Se, Nr as Ce, O as we, Oi as Te, Ot as Ee, Pi as De, Pn as Oe, Pr as ke, Pt as Ae, Qt as je, R as Me, Ri as Ne, Rr as Pe, S as Fe, Si as Ie, Sr as Le, T, Ti as Re, Tn as ze, Tt as Be, Ur as Ve, Ut as He, Vr as Ue, Vt as We, Wr as Ge, Wt as Ke, Xt as qe, Yr as Je, Yt as Ye, Zt as Xe, _a as E, a as Ze, ai as Qe, b as D, ba as $e, bi as et, ci as tt, cn as nt, da as rt, di as it, dn as at, en as ot, fa as st, fi as ct, fn as lt, ga as ut, ha as dt, i as ft, j as pt, ji as mt, jr as ht, k as gt, ki as _t, kr as vt, kt as yt, la as bt, ln as O, ma as xt, mn as St, na as Ct, nn as k, pa as wt, pi as Tt, pn as Et, qr as Dt, qt as Ot, r as kt, ri as At, rn as jt, sa as Mt, sn as Nt, ti as Pt, tn as Ft, ua as It, v as Lt, va as Rt, vi as A, w as zt, wi as Bt, wr as Vt, wt as Ht, x as j, xi as Ut, y as Wt, ya as Gt, yi as Kt, zi as qt, zr as Jt, zt as Yt } from "./CtC__ALh4I8PKIln.mjs";
10
- import { A as Xt, B as Zt, H as Qt, Jt as $t, K as en, O as tn, R as nn, Tt as rn, U as an, V as on, W as sn, Yt as M, Zt as N, at as cn, ct as ln, dt as un, ft as dn, in as P, k as fn, lt as pn, mt as F, nn as mn, pt as hn, qt as gn, rn as _n, st as vn, ut as yn, wt as bn, z as xn } from "./AXlD9K1gCwPU4gCO.mjs";
11
- import { n as Sn, t as Cn } from "./Bdcd3QOzsc0aVMjN.mjs";
12
- import { FormulaError as I, ScalarType as L } from "@sheetxl/primitives";
13
- import { BufferUtils as wn, CommonUtils as R, CoordUtils as z, DOMUtils as Tn, DefaultLanguagePackService as En, ExpectedError as B, ImageUtils as Dn, InvalidPasswordError as On, MimeType as kn, Notifier as An, NullNotAllowedError as jn, OutOfBoundsError as V, PasswordRequiredError as Mn, ProtectedError as H, UndoManager as Nn, messageKey as U, t as W } from "@sheetxl/utils";
7
+ import { r as e } from "./Dx9Fya60meMpuHqm.mjs";
8
+ import { a as t, l as n, o as r, t as i, u as a } from "./D807piM0VSokWz-L.mjs";
9
+ import { $i as o, $n as s, $t as c, A as l, Aa as u, Ai as d, At as f, Bi as p, Bt as m, C as h, Ca as g, Ci as _, D as v, Da as y, Di as b, Dt as x, E as S, Ei as C, Er as w, Et as ee, F as te, Fi as ne, Ft as re, Gn as ie, Gt as ae, Hn as oe, Ht as se, I as ce, Ii as le, It as ue, Jt as de, L as fe, Li as pe, Lt as me, M as he, Ma as ge, Mi as _e, Na as ve, Ni as ye, O as be, Oa as xe, Oi as Se, Ot as Ce, Pi as we, Pt as Te, Qt as Ee, R as De, Ri as Oe, S as ke, Sa as Ae, Si as je, T, Ta as Me, Ti as Ne, Tr as Pe, Tt as Fe, Ut as Ie, Vi as Le, Vn as Re, Vt as ze, Wn as Be, Wt as Ve, Xn as He, Xt as Ue, Ya as We, Yi as Ge, Yn as Ke, Yt as qe, Zi as Je, Zn as E, Zt as Ye, _a as Xe, _r as Ze, a as Qe, aa as $e, ao as D, b as O, ba as et, co as tt, da as nt, do as rt, ea as it, en as at, eo as ot, er as st, fa as ct, fo as k, ga as lt, gi as ut, ha as dt, hi as ft, ho as pt, i as mt, ia as ht, io as gt, j as _t, ja as vt, ji as yt, k as bt, ka as xt, ki as St, kt as Ct, lo as wt, ma as Tt, mi as Et, mo as Dt, mr as Ot, no as kt, nr as At, on as A, oo as jt, pa as Mt, po as Nt, pr as Pt, qi as Ft, qt as It, r as Lt, ra as Rt, ro as zt, sn as Bt, so as Vt, tn as Ht, tr as Ut, ua as j, uo as Wt, v as Gt, va as Kt, w as qt, wi as Jt, wt as Yt, x as M, xa as Xt, xi as Zt, xr as Qt, y as $t, ya as en, zi as tn, zt as nn } from "./CkZoDPUCK5jMUaeJ.mjs";
10
+ import { A as rn, B as an, Dt as on, Et as sn, H as cn, K as ln, O as un, Qt as N, R as dn, U as fn, V as pn, W as mn, Xt as hn, Zt as gn, an as _n, at as vn, ct as yn, dt as bn, en as P, ft as xn, k as Sn, lt as Cn, mt as F, on as wn, pt as Tn, sn as I, st as En, ut as Dn, z as On } from "./CMChv-fCFh68VQQt.mjs";
11
+ import { n as kn, t as An } from "./Zp5-cTJ0Llb6EfGi.mjs";
12
+ import { FormulaError as L, ScalarType as R } from "@sheetxl/primitives";
13
+ import { BufferUtils as jn, CommonUtils as z, CoordUtils as B, DOMUtils as Mn, DefaultLanguagePackService as Nn, ExpectedError as V, ImageUtils as Pn, InvalidPasswordError as Fn, MimeType as In, Notifier as Ln, NullNotAllowedError as Rn, OutOfBoundsError as H, PasswordRequiredError as zn, ProtectedError as U, UndoManager as Bn, messageKey as W, t as G } from "@sheetxl/utils";
14
14
  export * from "@sheetxl/primitives";
15
15
  export * from "@sheetxl/utils";
16
- var Pn, Fn = class extends Nn {
16
+ var Vn, Hn = class extends Bn {
17
17
  constructor(e, t = 50) {
18
18
  super(t), this._transactions = e, this._floorId = e ? e.getCurrentCommit(!1).getId() : null, this._removeListener = e?.addListener({ onCommitChange: () => this._notifyOnStackChange() });
19
19
  }
@@ -98,14 +98,14 @@ var Pn, Fn = class extends Nn {
98
98
  return e.length === 0 && this._repeatOperation !== null && e.push(this._repeatOperation.description), Object.freeze(e);
99
99
  }
100
100
  getUndoEntries() {
101
- return this._undoCommits().map(Ln);
101
+ return this._undoCommits().map(Wn);
102
102
  }
103
103
  getRedoEntries() {
104
- let e = this._redoCommits().map(Ln);
104
+ let e = this._redoCommits().map(Wn);
105
105
  return e.length === 0 && this._repeatOperation !== null && e.push({
106
106
  description: this._repeatOperation.description,
107
107
  author: null,
108
- meta: In
108
+ meta: Un
109
109
  }), Object.freeze(e);
110
110
  }
111
111
  addUndoOperation() {
@@ -117,11 +117,11 @@ var Pn, Fn = class extends Nn {
117
117
  close() {
118
118
  this._removeListener?.();
119
119
  }
120
- }, In = Object.freeze({}), Ln = (e) => ({
120
+ }, Un = Object.freeze({}), Wn = (e) => ({
121
121
  description: e.getDescription(),
122
122
  author: e.getAuthor(),
123
- meta: e.getMeta() ?? In
124
- }), Rn = class {
123
+ meta: e.getMeta() ?? Un
124
+ }), Gn = class {
125
125
  constructor(e, n) {
126
126
  this._dirty = !1, this._store = e, this._savedCommitId = e.getCurrentCommit()?.getId() ?? null, this._emitter = new t(this);
127
127
  let r = this;
@@ -159,8 +159,8 @@ var Pn, Fn = class extends Nn {
159
159
  this._removeStoreListener?.(), this._removeCommitListener?.(), this._emitter.close();
160
160
  }
161
161
  };
162
- Pn ||= {};
163
- var zn, G = class e {
162
+ Vn ||= {};
163
+ var Kn, K = class e {
164
164
  constructor(n, r = {}) {
165
165
  this._password = null, this._emitter = new t(this), this._path = n ?? null, this._name = r.name ?? null, this._format = r.format ?? null, this._size = r.size ?? null, this._lastModified = r.lastModified ?? null, this._canWrite = r.canWrite ?? e._defaultCanWrite(this._path), this._encryption = r.encryption ?? null;
166
166
  }
@@ -173,7 +173,7 @@ var zn, G = class e {
173
173
  getName() {
174
174
  if (this._name !== null && this._name !== void 0) return this._name;
175
175
  let e = this._cleanPath();
176
- return e && ut(e) || null;
176
+ return e && rt(e) || null;
177
177
  }
178
178
  getPath() {
179
179
  return this._path;
@@ -184,7 +184,7 @@ var zn, G = class e {
184
184
  getExtension() {
185
185
  let e = this._cleanPath();
186
186
  if (!e) return null;
187
- let t = E(e);
187
+ let t = k(e);
188
188
  return t ? t.toLowerCase() : null;
189
189
  }
190
190
  getEncryption() {
@@ -234,26 +234,26 @@ var zn, G = class e {
234
234
  ];
235
235
  return `${t} ${(n / 1024 ** r).toFixed(2)}${i[Math.min(r, i.length - 1)]}`;
236
236
  }
237
- }, K = /* @__PURE__ */ new WeakMap(), Bn = /* @__PURE__ */ new Set(), Vn = (e) => K.get(e) ?? null, Hn = () => Array.from(Bn, (e) => e.getOrigin()), Un = class e {
237
+ }, q = /* @__PURE__ */ new WeakMap(), qn = /* @__PURE__ */ new Set(), Jn = (e) => q.get(e) ?? null, Yn = () => Array.from(qn, (e) => e.getOrigin()), Xn = class e {
238
238
  constructor(n) {
239
- this._released = !1, e._assertFree(n), this._emitter = new t(this), this._origin = n, K.set(n, this), Bn.add(this);
239
+ this._released = !1, e._assertFree(n), this._emitter = new t(this), this._origin = n, q.set(n, this), qn.add(this);
240
240
  }
241
241
  getOrigin() {
242
242
  return this._origin;
243
243
  }
244
244
  setOrigin(t) {
245
- t !== this._origin && (e._assertFree(t), this._released || (K.delete(this._origin), K.set(t, this)), this._origin = t, this._emitter.notify("onOriginChange"));
245
+ t !== this._origin && (e._assertFree(t), this._released || (q.delete(this._origin), q.set(t, this)), this._origin = t, this._emitter.notify("onOriginChange"));
246
246
  }
247
247
  release() {
248
- this._released || (this._released = !0, K.get(this._origin) === this && K.delete(this._origin), Bn.delete(this));
248
+ this._released || (this._released = !0, q.get(this._origin) === this && q.delete(this._origin), qn.delete(this));
249
249
  }
250
250
  addListeners(e, t) {
251
251
  return this._emitter.addListeners(e, t);
252
252
  }
253
253
  static _assertFree(e) {
254
- if (K.has(e)) throw Error("This origin already backs an open workbook; an origin backs one workbook at a time.");
254
+ if (q.has(e)) throw Error("This origin already backs an open workbook; an origin backs one workbook at a time.");
255
255
  }
256
- }, Wn = class {
256
+ }, Zn = class {
257
257
  constructor() {
258
258
  this._defaultStringSourceType = "filepath";
259
259
  }
@@ -271,10 +271,10 @@ var zn, G = class e {
271
271
  }
272
272
  switch (o) {
273
273
  case "file": {
274
- let e = n, r = e?.name, o = r ? `${ut(r)}` : "";
274
+ let e = n, r = e?.name, o = r ? `${rt(r)}` : "";
275
275
  s = await e.arrayBuffer(), c = {
276
276
  format: a,
277
- ext: E(r),
277
+ ext: k(r),
278
278
  name: o,
279
279
  absolutePath: r,
280
280
  size: e.size,
@@ -298,7 +298,7 @@ var zn, G = class e {
298
298
  let [, t] = n.split(",");
299
299
  e = t;
300
300
  } else e = n;
301
- s = wn.base64ToArrayBuffer(e), c = {
301
+ s = jn.base64ToArrayBuffer(e), c = {
302
302
  format: a,
303
303
  size: e.length
304
304
  };
@@ -314,7 +314,7 @@ var zn, G = class e {
314
314
  e = i.input, t = i.init, r = i.timeout;
315
315
  }
316
316
  }
317
- let i = r || 3e4, o = new AbortController(), l = setTimeout(() => o.abort(), i), u = typeof e == "string" ? e : e.toString(), d = E(u);
317
+ let i = r || 3e4, o = new AbortController(), l = setTimeout(() => o.abort(), i), u = typeof e == "string" ? e : e.toString(), d = k(u);
318
318
  try {
319
319
  let n = await fetch(e, {
320
320
  ...t,
@@ -326,7 +326,7 @@ var zn, G = class e {
326
326
  s = r, c = {
327
327
  format: a,
328
328
  ext: d,
329
- name: ut(u, !0),
329
+ name: rt(u, !0),
330
330
  absolutePath: u
331
331
  };
332
332
  } catch (e) {
@@ -366,7 +366,7 @@ var zn, G = class e {
366
366
  return t.absolutePath ? this.findOpenPath(t.absolutePath) : null;
367
367
  }
368
368
  findOpenPath(e, t) {
369
- return Hn().find((n) => {
369
+ return Yn().find((n) => {
370
370
  if (n === t || !n.canWrite()) return !1;
371
371
  let r = n.getPath();
372
372
  return !!r && this.isSamePath(r, e);
@@ -397,21 +397,21 @@ var zn, G = class e {
397
397
  }
398
398
  if (typeof File < "u" && e instanceof File) return "file";
399
399
  if (typeof Blob < "u" && e instanceof Blob) return "blob";
400
- let t = e instanceof ArrayBuffer || Object.prototype.toString.call(e) === "[object ArrayBuffer]", n = ArrayBuffer.isView(e), r = wn.isNodeBuffer(e);
400
+ let t = e instanceof ArrayBuffer || Object.prototype.toString.call(e) === "[object ArrayBuffer]", n = ArrayBuffer.isView(e), r = jn.isNodeBuffer(e);
401
401
  return t || n || r ? "buffer" : typeof ReadableStream < "u" && e instanceof ReadableStream || Object.prototype.toString.call(e) === "[object ReadableStream]" || e && typeof e.getReader == "function" && e.locked !== void 0 ? "stream" : null;
402
402
  }
403
- }, Gn = class extends Wn {
403
+ }, Qn = class extends Zn {
404
404
  constructor(e, t) {
405
405
  super(), this._getWriteFormats = e, this._getReadFormats = t, this._defaultStringSourceType = "fetch", this._handleCache = /* @__PURE__ */ new WeakMap();
406
406
  }
407
407
  async fileFromHandle(e) {
408
- return qn(e) ? e.getFile() : null;
408
+ return er(e) ? e.getFile() : null;
409
409
  }
410
410
  async resolveSource() {
411
411
  let e = await this._getReadFormats?.() ?? [];
412
412
  if (typeof globalThis.showOpenFilePicker == "function") try {
413
413
  let t = function(e) {
414
- let t = Kn(e);
414
+ let t = $n(e);
415
415
  if (t.length <= 1) return t;
416
416
  let n = /* @__PURE__ */ new Set(), r = {};
417
417
  for (let e of t) for (let [t, i] of Object.entries(e.accept)) for (let e of i) n.has(e) || (n.add(e), (r[t] ??= []).push(e));
@@ -426,13 +426,13 @@ var zn, G = class e {
426
426
  throw e;
427
427
  }
428
428
  let t = e.flatMap((e) => e.exts.map((e) => "." + e)).join(", ");
429
- return Tn.openFileDialog(t);
429
+ return Mn.openFileDialog(t);
430
430
  }
431
431
  async findOpenOrigin(e) {
432
- return qn(e) ? this._findOpenHandle(e) : null;
432
+ return er(e) ? this._findOpenHandle(e) : null;
433
433
  }
434
434
  async _findOpenHandle(e, t) {
435
- for (let n of Hn()) {
435
+ for (let n of Yn()) {
436
436
  if (n === t || !n.canWrite()) continue;
437
437
  let r = this._handleCache.get(n);
438
438
  if (r && typeof r.isSameEntry == "function" && await r.isSameEntry(e)) return n;
@@ -440,7 +440,7 @@ var zn, G = class e {
440
440
  return null;
441
441
  }
442
442
  async onWorkbookRead(e, t) {
443
- if (!qn(t)) return;
443
+ if (!er(t)) return;
444
444
  let n = e.getOrigin?.();
445
445
  n?.canWrite() && this._handleCache.set(n, t);
446
446
  }
@@ -467,18 +467,18 @@ var zn, G = class e {
467
467
  if (!a) {
468
468
  c = await globalThis.showSaveFilePicker({
469
469
  suggestedName: n,
470
- types: Kn(o)
470
+ types: $n(o)
471
471
  });
472
472
  let t = await this._findOpenHandle(c, e.workbook?.getOrigin?.());
473
- if (t) throw new B(W("error.io.openElsewhere", { name: t.getName() ?? c.name ?? "" }));
473
+ if (t) throw new V(G("error.io.openElsewhere", { name: t.getName() ?? c.name ?? "" }));
474
474
  }
475
- let s = Yn(c.name ?? n), l = o.find((e) => e.exts.some((e) => e.toLowerCase() === s)) ?? r, u = a ? t : new G(c.name ?? n, {
475
+ let s = nr(c.name ?? n), l = o.find((e) => e.exts.some((e) => e.toLowerCase() === s)) ?? r, u = a ? t : new K(c.name ?? n, {
476
476
  format: l.key,
477
477
  canWrite: !0
478
478
  }), d = await i(l.key, u);
479
479
  if (!d) return null;
480
- let f = new Blob([Jn(d)], { type: l.mimeType || "application/octet-stream" }), p = await c.createWritable();
481
- if (await p.write(f), await p.close(), this._handleCache.set(u, c), u instanceof G) {
480
+ let f = new Blob([tr(d)], { type: l.mimeType || "application/octet-stream" }), p = await c.createWritable();
481
+ if (await p.write(f), await p.close(), this._handleCache.set(u, c), u instanceof K) {
482
482
  let e = await Promise.resolve(c.getFile?.()).then((e) => e?.lastModified ?? null, () => null);
483
483
  u.update({
484
484
  size: f.size,
@@ -488,21 +488,21 @@ var zn, G = class e {
488
488
  return u;
489
489
  } catch (e) {
490
490
  if (e?.name === "AbortError") return null;
491
- if (e instanceof B) throw e;
491
+ if (e instanceof V) throw e;
492
492
  }
493
- let l = t.getPath(), u = l ? l.split(/[/\\]/).pop() : null, d = u && r.exts.some((e) => e.toLowerCase() === Yn(u)) ? u : n, f = l !== d || t.canWrite() ? new G(d, {
493
+ let l = t.getPath(), u = l ? l.split(/[/\\]/).pop() : null, d = u && r.exts.some((e) => e.toLowerCase() === nr(u)) ? u : n, f = l !== d || t.canWrite() ? new K(d, {
494
494
  format: r.key,
495
495
  canWrite: !1
496
496
  }) : t, p = await i(r.key, f);
497
497
  if (!p) return null;
498
- let m = new Blob([Jn(p)], { type: r.mimeType || "application/octet-stream" });
498
+ let m = new Blob([tr(p)], { type: r.mimeType || "application/octet-stream" });
499
499
  return function(e, t) {
500
500
  let n = URL.createObjectURL(e), r = document.createElement("a");
501
501
  r.style.display = "none", r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
502
- }(m, d), f instanceof G && f.update({ size: m.size }), f;
502
+ }(m, d), f instanceof K && f.update({ size: m.size }), f;
503
503
  }
504
504
  };
505
- function Kn(e) {
505
+ function $n(e) {
506
506
  return e.map((e) => {
507
507
  let t = e.mimeType && e.mimeType.includes("/") ? e.mimeType : "application/octet-stream";
508
508
  return {
@@ -511,27 +511,27 @@ function Kn(e) {
511
511
  };
512
512
  });
513
513
  }
514
- function qn(e) {
514
+ function er(e) {
515
515
  return !!e && e.kind === "file" && typeof e.getFile == "function";
516
516
  }
517
- function Jn(e) {
517
+ function tr(e) {
518
518
  if (typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) {
519
519
  let t = new ArrayBuffer(e.byteLength);
520
520
  return new Uint8Array(t).set(new Uint8Array(e)), t;
521
521
  }
522
522
  return e;
523
523
  }
524
- function Yn(e) {
524
+ function nr(e) {
525
525
  let t = e.lastIndexOf(".");
526
526
  return t >= 0 ? e.slice(t + 1).toLowerCase() : "";
527
527
  }
528
- (zn ||= {}).SortOn = {
528
+ (Kn ||= {}).SortOn = {
529
529
  Value: "value",
530
530
  FillColor: "fillColor",
531
531
  FontColor: "fontColor",
532
532
  Icon: "icon"
533
533
  };
534
- var Xn = {
534
+ var rr = {
535
535
  TopLeft: "tl",
536
536
  Top: "t",
537
537
  TopRight: "tr",
@@ -541,53 +541,53 @@ var Xn = {
541
541
  BottomLeft: "bl",
542
542
  Bottom: "b",
543
543
  BottomRight: "br"
544
- }, q = vn.BuiltInName, Zn = {
545
- [q.Normal]: U("style.builtin.normal"),
546
- [q.Comma]: U("style.builtin.comma"),
547
- [q.Currency]: U("style.builtin.currency"),
548
- [q.Percent]: U("style.builtin.percent"),
549
- [q.Comma0]: U("style.builtin.comma0"),
550
- [q.Currency0]: U("style.builtin.currency0"),
551
- [q.Hyperlink]: U("style.builtin.hyperlink"),
552
- [q.FollowedHyperlink]: U("style.builtin.followedHyperlink"),
553
- [q.Note]: U("style.builtin.note"),
554
- [q.WarningText]: U("style.builtin.warningText"),
555
- [q.Title]: U("style.builtin.title"),
556
- [q.Input]: U("style.builtin.input"),
557
- [q.Output]: U("style.builtin.output"),
558
- [q.Calculation]: U("style.builtin.calculation"),
559
- [q.CheckCell]: U("style.builtin.checkCell"),
560
- [q.LinkedCell]: U("style.builtin.linkedCell"),
561
- [q.Total]: U("style.builtin.total"),
562
- [q.Good]: U("style.builtin.good"),
563
- [q.Bad]: U("style.builtin.bad"),
564
- [q.Neutral]: U("style.builtin.neutral"),
565
- [q.ExplanatoryText]: U("style.builtin.explanatoryText")
566
- }, Qn = U("style.builtin.heading"), $n = U("style.builtin.accent"), er = U("style.builtin.accentTint"), tr = /^Heading ([1-4])$/, nr = /^Accent([1-6])$/, rr = /^(20|40|60)% - Accent([1-6])$/;
567
- function ir(e) {
568
- let t = Zn[e];
544
+ }, J = En.BuiltInName, ir = {
545
+ [J.Normal]: W("style.builtin.normal"),
546
+ [J.Comma]: W("style.builtin.comma"),
547
+ [J.Currency]: W("style.builtin.currency"),
548
+ [J.Percent]: W("style.builtin.percent"),
549
+ [J.Comma0]: W("style.builtin.comma0"),
550
+ [J.Currency0]: W("style.builtin.currency0"),
551
+ [J.Hyperlink]: W("style.builtin.hyperlink"),
552
+ [J.FollowedHyperlink]: W("style.builtin.followedHyperlink"),
553
+ [J.Note]: W("style.builtin.note"),
554
+ [J.WarningText]: W("style.builtin.warningText"),
555
+ [J.Title]: W("style.builtin.title"),
556
+ [J.Input]: W("style.builtin.input"),
557
+ [J.Output]: W("style.builtin.output"),
558
+ [J.Calculation]: W("style.builtin.calculation"),
559
+ [J.CheckCell]: W("style.builtin.checkCell"),
560
+ [J.LinkedCell]: W("style.builtin.linkedCell"),
561
+ [J.Total]: W("style.builtin.total"),
562
+ [J.Good]: W("style.builtin.good"),
563
+ [J.Bad]: W("style.builtin.bad"),
564
+ [J.Neutral]: W("style.builtin.neutral"),
565
+ [J.ExplanatoryText]: W("style.builtin.explanatoryText")
566
+ }, ar = W("style.builtin.heading"), or = W("style.builtin.accent"), sr = W("style.builtin.accentTint"), cr = /^Heading ([1-4])$/, lr = /^Accent([1-6])$/, ur = /^(20|40|60)% - Accent([1-6])$/;
567
+ function dr(e) {
568
+ let t = ir[e];
569
569
  if (t) return { key: t };
570
- let n = tr.exec(e);
570
+ let n = cr.exec(e);
571
571
  return n ? {
572
- key: Qn,
572
+ key: ar,
573
573
  params: { n: +n[1] }
574
- } : (n = nr.exec(e), n ? {
575
- key: $n,
574
+ } : (n = lr.exec(e), n ? {
575
+ key: or,
576
576
  params: { n: +n[1] }
577
- } : (n = rr.exec(e), n ? {
578
- key: er,
577
+ } : (n = ur.exec(e), n ? {
578
+ key: sr,
579
579
  params: {
580
580
  pct: +n[1],
581
581
  n: +n[2]
582
582
  }
583
583
  } : null));
584
584
  }
585
- var ar, or, sr, cr, lr = (e, t, n, r, i) => {
585
+ var fr, pr, mr, hr, gr = (e, t, n, r, i) => {
586
586
  let a = JSON.parse(JSON.stringify(e.definition));
587
587
  a.adjs ||= [];
588
588
  let o = "", s = 0, c = 0;
589
- t > 0 ? (c = t, s = 100 - t, o = W("op.lighterPercent", { percent: t })) : t < 0 && (s = 100 + t, o = W("op.darkerPercent", { percent: -t })), s && a.adjs.push({ [hn.AdjustmentType.LumMod]: s }), c && a.adjs.push({ [hn.AdjustmentType.LumOff]: c });
590
- let l = new un({
589
+ t > 0 ? (c = t, s = 100 - t, o = G("op.lighterPercent", { percent: t })) : t < 0 && (s = 100 + t, o = G("op.darkerPercent", { percent: -t })), s && a.adjs.push({ [Tn.AdjustmentType.LumMod]: s }), c && a.adjs.push({ [Tn.AdjustmentType.LumOff]: c });
590
+ let l = new bn({
591
591
  val: a.val,
592
592
  adjs: a.adjs
593
593
  }, n), u = l.toString();
@@ -598,14 +598,14 @@ var ar, or, sr, cr, lr = (e, t, n, r, i) => {
598
598
  definition: a
599
599
  };
600
600
  };
601
- function ur(e, t, n, r) {
601
+ function _r(e, t, n, r) {
602
602
  let i = [];
603
603
  for (let a = 0; a < e.length; a++) {
604
604
  let o = [];
605
605
  i.push(o);
606
606
  let s = (i) => {
607
- for (let s = 0; s < i.length; s++) o.push(lr(e[a], i[s], t, n, r));
608
- }, c = new un({
607
+ for (let s = 0; s < i.length; s++) o.push(gr(e[a], i[s], t, n, r));
608
+ }, c = new bn({
609
609
  val: e[a].definition.val,
610
610
  adjs: e[a].definition.adjs
611
611
  }, t).toHSLA().lum;
@@ -643,45 +643,45 @@ function ur(e, t, n, r) {
643
643
  }
644
644
  return i;
645
645
  }
646
- (ar ||= {}).buildPalette = ur, or ||= {}, sr ||= {}, cr ||= {};
647
- var dr, J = null;
648
- function fr() {
649
- if (!J) {
650
- let e = import("./DIfAk63CvaOZ3QKi.mjs").then(({ initializeFunctions: e }) => {
646
+ (fr ||= {}).buildPalette = _r, pr ||= {}, mr ||= {}, hr ||= {};
647
+ var vr, Y = null;
648
+ function yr() {
649
+ if (!Y) {
650
+ let e = import("./DlVnybrgwZWxWN3_.mjs").then(({ initializeFunctions: e }) => {
651
651
  let t = e(() => null);
652
652
  return Object.freeze(Array.from(t.keys()));
653
653
  });
654
654
  e.catch(() => {
655
- J = null;
656
- }), J = e;
655
+ Y = null;
656
+ }), Y = e;
657
657
  }
658
- return J;
658
+ return Y;
659
659
  }
660
- function pr(e) {
661
- return Oe.peek()?.readFormulaLiteral(e);
660
+ function br(e) {
661
+ return w.peek()?.readFormulaLiteral(e);
662
662
  }
663
- function mr(e, t) {
664
- let n = hr(e), r = hr(t);
665
- return n === r ? e === t ? 0 : typeof e == "number" && typeof t == "number" ? e < t ? -1 : 1 : typeof e == "string" && typeof t == "string" ? e < t ? -1 : +(e > t) : typeof e == "boolean" ? e ? 1 : -1 : I.isError(e) && I.isError(t) ? e.getCode() - t.getCode() : 0 : n - r;
663
+ function xr(e, t) {
664
+ let n = Sr(e), r = Sr(t);
665
+ return n === r ? e === t ? 0 : typeof e == "number" && typeof t == "number" ? e < t ? -1 : 1 : typeof e == "string" && typeof t == "string" ? e < t ? -1 : +(e > t) : typeof e == "boolean" ? e ? 1 : -1 : L.isError(e) && L.isError(t) ? e.getCode() - t.getCode() : 0 : n - r;
666
666
  }
667
- function hr(e) {
667
+ function Sr(e) {
668
668
  if (e === null) return 0;
669
669
  switch (typeof e) {
670
670
  case "number": return 1;
671
671
  case "string": return 2;
672
672
  case "boolean": return 3;
673
- default: return I.isError(e) ? 4 : 5;
673
+ default: return L.isError(e) ? 4 : 5;
674
674
  }
675
675
  }
676
676
  (function(e) {
677
677
  function t(e) {
678
- return Oe.peek()?.getFunctionDeclaration(e) ?? null;
678
+ return w.peek()?.getFunctionDeclaration(e) ?? null;
679
679
  }
680
680
  e.get = t, e.has = function(e) {
681
681
  return t(e) !== null;
682
682
  };
683
- })(dr ||= {});
684
- var gr = class {
683
+ })(vr ||= {});
684
+ var Cr = class {
685
685
  constructor(e) {
686
686
  this._children = e;
687
687
  }
@@ -726,19 +726,19 @@ var gr = class {
726
726
  let n = t[e].getSortedNumbers().getValues();
727
727
  n.length > 0 && r.push(n);
728
728
  }
729
- e = new kt(function(e) {
729
+ e = new Lt(function(e) {
730
730
  let t = e.length;
731
- if (t === 0) return _r;
731
+ if (t === 0) return wr;
732
732
  if (t === 1) return e[0];
733
733
  let n = e[0];
734
- for (let r = 1; r < t; r++) n = vr(n, e[r]);
734
+ for (let r = 1; r < t; r++) n = Tr(n, e[r]);
735
735
  return Object.freeze(n);
736
736
  }(r)), this._sortedNumbers = e;
737
737
  }
738
738
  return e;
739
739
  }
740
740
  getRanked(e) {
741
- return ft(this._children, e, mr)[Symbol.iterator]();
741
+ return mt(this._children, e, xr)[Symbol.iterator]();
742
742
  }
743
743
  getFrequencies(e) {
744
744
  if (e) return this._mergeFrequencies(e);
@@ -746,7 +746,7 @@ var gr = class {
746
746
  return t || (t = this._mergeFrequencies(), this._frequencies = t), t;
747
747
  }
748
748
  _mergeFrequencies(e) {
749
- let t = e?.keyFn ?? Vt, n = e?.limit, r = /* @__PURE__ */ new Map(), i = this._children, a = i.length, o = 0, s = 0, c = !1;
749
+ let t = e?.keyFn ?? ut, n = e?.limit, r = /* @__PURE__ */ new Map(), i = this._children, a = i.length, o = 0, s = 0, c = !1;
750
750
  for (let l = 0; l < a; l++) {
751
751
  let a = i[l].getFrequencies(e);
752
752
  o += a.getVisitedCount(), s += a.getTotalCount(), c ||= a.isTruncated();
@@ -759,22 +759,22 @@ var gr = class {
759
759
  }) : c = !0, d = u.next();
760
760
  }
761
761
  }
762
- return g.fromGroups(r, t, e, mr, o, s, c);
762
+ return ft.fromGroups(r, t, e, xr, o, s, c);
763
763
  }
764
764
  getTypedCounts(e) {
765
765
  let t = this._typedCounts;
766
766
  if (!t) {
767
767
  let e = {
768
- [L.Number]: 0,
769
- [L.String]: 0,
770
- [L.Boolean]: 0,
771
- [L.Error]: 0,
772
- [L.RichData]: 0,
773
- [L.Null]: 0
768
+ [R.Number]: 0,
769
+ [R.String]: 0,
770
+ [R.Boolean]: 0,
771
+ [R.Error]: 0,
772
+ [R.RichData]: 0,
773
+ [R.Null]: 0
774
774
  }, n = this._children, r = n.length;
775
775
  for (let t = 0; t < r; t++) {
776
776
  let r = n[t].getTypedCounts();
777
- e[L.Number] += r[L.Number] ?? 0, e[L.String] += r[L.String] ?? 0, e[L.Boolean] += r[L.Boolean] ?? 0, e[L.Error] += r[L.Error] ?? 0, e[L.RichData] += r[L.RichData] ?? 0, e[L.Null] += r[L.Null] ?? 0;
777
+ e[R.Number] += r[R.Number] ?? 0, e[R.String] += r[R.String] ?? 0, e[R.Boolean] += r[R.Boolean] ?? 0, e[R.Error] += r[R.Error] ?? 0, e[R.RichData] += r[R.RichData] ?? 0, e[R.Null] += r[R.Null] ?? 0;
778
778
  }
779
779
  t = Object.freeze(e), this._typedCounts = t;
780
780
  }
@@ -795,12 +795,12 @@ var gr = class {
795
795
  sum: 0,
796
796
  sumSq: 0,
797
797
  typed: {
798
- [L.Number]: 0,
799
- [L.String]: 0,
800
- [L.Boolean]: 0,
801
- [L.Error]: 0,
802
- [L.RichData]: 0,
803
- [L.Null]: 0
798
+ [R.Number]: 0,
799
+ [R.String]: 0,
800
+ [R.Boolean]: 0,
801
+ [R.Error]: 0,
802
+ [R.RichData]: 0,
803
+ [R.Null]: 0
804
804
  }
805
805
  };
806
806
  for (let i = 0; i < n; i++) {
@@ -809,55 +809,156 @@ var gr = class {
809
809
  let a = n.numericalCount;
810
810
  a <= 0 || (r.numericalCount += a, r.sum += n.sum, r.sumSq += n.varP * a + n.sum * n.sum / a, (r.min === void 0 || n.min < r.min) && (r.min = n.min), (r.max === void 0 || n.max > r.max) && (r.max = n.max));
811
811
  }
812
- return Ze(r);
812
+ return Qe(r);
813
813
  }
814
- }, _r = Object.freeze([]);
815
- function vr(e, t) {
814
+ }, wr = Object.freeze([]);
815
+ function Tr(e, t) {
816
816
  let n = e.length, r = t.length, i = Array(n + r), a = 0, o = 0, s = 0;
817
817
  for (; a < n && o < r;) i[s++] = e[a] <= t[o] ? e[a++] : t[o++];
818
818
  for (; a < n;) i[s++] = e[a++];
819
819
  for (; o < r;) i[s++] = t[o++];
820
820
  return i;
821
821
  }
822
- var yr, br = class {
822
+ var Er, Dr = class e {
823
823
  constructor(e, t) {
824
- this._source = null, this.cacheId = e, this.part = t;
825
- }
826
- _hold(e) {
827
- let t = this.part?.xml;
828
- if (!t || this._source) return;
829
- let n = o(t, "worksheetSource", "ref"), r = o(t, "worksheetSource", "sheet");
830
- if (!n || !r || n.includes("#REF!")) return;
831
- let i = e(r);
832
- if (!i) return;
833
- let a = {
824
+ this._source = null, this._fresh = /* @__PURE__ */ new WeakSet(), this._unwatch = null, this.cacheId = e, this._store = t, this._fresh.add(t.get());
825
+ }
826
+ static dataOf(t, n) {
827
+ let r = e.modelOf(t);
828
+ return {
829
+ part: A.fromJSON(t.part, n),
830
+ model: r,
831
+ partFormats: !r && t.partFormats ? t.partFormats : null,
832
+ source: !r && t.source ? t.source : null
833
+ };
834
+ }
835
+ static modelOf(e) {
836
+ if (!e.fields) return null;
837
+ let { cacheId: t, part: n, partFormats: r, ...i } = e;
838
+ return i;
839
+ }
840
+ get part() {
841
+ return this._store.get().part;
842
+ }
843
+ get _model() {
844
+ return this._store.get().model;
845
+ }
846
+ _getData() {
847
+ return this._store.get();
848
+ }
849
+ _replace(e) {
850
+ let t = {
851
+ part: null,
852
+ model: e,
853
+ partFormats: null,
854
+ source: null
855
+ };
856
+ this._store.set(t), this._fresh.add(t);
857
+ }
858
+ _restate(e) {
859
+ let t = this._fresh.has(this._store.get()), n = {
860
+ part: null,
861
+ model: e,
862
+ partFormats: null,
863
+ source: null
864
+ };
865
+ this._store.set(n), t && this._fresh.add(n);
866
+ }
867
+ _hold(e, t) {
868
+ if (this._source) return;
869
+ let { ref: n, sheet: r, name: i } = this._sourceAsRead() ?? {}, a = null, o = null;
870
+ if (n && r && !n.includes("#REF!") ? (a = e(r), o = `${ht(r)}!${oe(n)}`) : !i || n || r ? i && r && !n && (a = e(r), o = `${ht(r)}!${i}`) : (a = t(i), o = `${i}[#All]`), !a || !o) return;
871
+ let s = {
834
872
  formula: null,
835
873
  wired: null,
836
874
  last: null
837
875
  };
838
- this._source = a, i(`${ct(r)}!${je(n)}`, (e) => {
839
- a.formula = e.formula;
876
+ this._source = s, a(o, (e) => {
877
+ s.formula = e.formula;
840
878
  let t = e.formula.getExpression();
841
- a.wired ??= t, e.formula.hasRefError() || (a.last = t);
879
+ s.wired ??= t, e.formula.hasRefError() || (s.last = t);
842
880
  });
843
881
  }
844
- getXML() {
845
- let e = this.part?.xml ?? null, t = this._source;
846
- if (!e || !t?.formula) return e;
847
- let n = t.formula.hasRefError() ? t.last : t.formula.getExpression();
848
- if (n === null || n === t.wired) return e;
849
- let r = _(n);
850
- return r ? Ft(Ft(e, "worksheetSource", "ref", ot(r.reference)), "worksheetSource", "sheet", r.sheet) : Ft(e, "worksheetSource", "ref", ot(n));
882
+ _sourceAsRead() {
883
+ let e = this._model?.source ?? this._store.get().source;
884
+ return e ? {
885
+ ref: e.ref ?? null,
886
+ sheet: e.sheet ?? null,
887
+ name: e.name ?? null
888
+ } : null;
889
+ }
890
+ _watchSource(e, t, n) {
891
+ if (this._unwatch) return;
892
+ let { ref: r, sheet: i, name: a } = this._sourceAsRead() ?? {}, o = null, s = null;
893
+ if (r && i && !r.includes("#REF!") ? s = e(i, r) : a && !r && (o = i ? null : t(a), s = o?.getRange() ?? n(a, i ?? null)), !s || s.isInvalid()) return;
894
+ let c = (e) => `${e.getRowCount()}x${e.getColumnCount()}`, l = c(s), u = [], d = () => {
895
+ this._fresh = /* @__PURE__ */ new WeakSet();
896
+ }, f = (e) => {
897
+ let t = l;
898
+ return l = c(e), l !== t;
899
+ };
900
+ u.push(s.addListener((e) => {
901
+ if (e.getTrigger() === "data") return void (e.getCommit() !== null && d());
902
+ let t = e.getSource();
903
+ (t.isInvalid() || f(t)) && d();
904
+ }, { transactional: !1 })), o && u.push(s.getWorksheet().addListeners({ onTablesChange: () => {
905
+ !o.isDeleted() && f(o.getRange()) && d();
906
+ } })), this._unwatch = () => {
907
+ this._unwatch = null;
908
+ for (let e of u) e();
909
+ };
910
+ }
911
+ _isStale() {
912
+ return !this._fresh.has(this._store.get());
913
+ }
914
+ _moved() {
915
+ let e = this._source;
916
+ if (!e?.formula) return null;
917
+ let t = e.formula.hasRefError() ? e.last : e.formula.getExpression();
918
+ if (t === null || t === e.wired) return null;
919
+ let n = this._sourceAsRead();
920
+ if (n?.name && n.sheet) {
921
+ let e = v(t)?.sheet;
922
+ return e ? { sheet: e } : null;
923
+ }
924
+ let r = /^(.+)\[#All\]$/.exec(t)?.[1];
925
+ if (r) return { name: r };
926
+ let i = v(t);
927
+ return i ? {
928
+ name: null,
929
+ ref: Be(i.reference),
930
+ sheet: i.sheet
931
+ } : { ref: Be(t) };
932
+ }
933
+ _getSource() {
934
+ let e = this._sourceAsRead();
935
+ if (!e) return null;
936
+ let t = {};
937
+ e.ref && (t.ref = e.ref), e.sheet && (t.sheet = e.sheet), e.name && (t.name = e.name);
938
+ let n = this._moved();
939
+ if (n) for (let e of [
940
+ "ref",
941
+ "sheet",
942
+ "name"
943
+ ]) {
944
+ let r = n[e];
945
+ r === null ? delete t[e] : r !== void 0 && (t[e] = r);
946
+ }
947
+ return t;
851
948
  }
852
949
  toJSON(e) {
853
- let t = { cacheId: this.cacheId }, n = k.toJSON(this.part, e);
950
+ let t = { cacheId: this.cacheId }, n = A.toJSON(this.part, e);
854
951
  if (n) {
855
- let e = this.getXML();
856
- e !== null && (n.xml = e), t.part = n;
952
+ t.part = n;
953
+ let e = this._store.get().partFormats;
954
+ e && (t.partFormats = e);
857
955
  }
858
- return t;
956
+ let r = this._model;
957
+ r && Object.assign(t, r);
958
+ let i = this._getSource();
959
+ return i && (t.source = i), t;
859
960
  }
860
- }, xr = class {
961
+ }, Or = class {
861
962
  constructor(e, t) {
862
963
  this._deleted = !1, this._json = { ...e }, this._deleteFromCollection = t ?? null;
863
964
  }
@@ -891,7 +992,7 @@ var yr, br = class {
891
992
  get isIPerson() {
892
993
  return !0;
893
994
  }
894
- }, Sr = class extends $e {
995
+ }, kr = class extends pt {
895
996
  constructor(e) {
896
997
  super(), this._byId = /* @__PURE__ */ new Map(), this._byDisplayName = /* @__PURE__ */ new Map(), this._items = null, this._current = null, e && this.fromJSON(e);
897
998
  }
@@ -912,10 +1013,10 @@ var yr, br = class {
912
1013
  let e = this._byDisplayName.get(r);
913
1014
  if (e) return e;
914
1015
  }
915
- let i = new xr({
1016
+ let i = new Or({
916
1017
  ...t,
917
1018
  displayName: r,
918
- id: n ?? R.uuidV4().toUpperCase()
1019
+ id: n ?? z.uuidV4().toUpperCase()
919
1020
  }, (e) => this._remove(e));
920
1021
  return this._byId.set(i.getId(), i), r && !this._byDisplayName.has(r) && this._byDisplayName.set(r, i), this._items = null, this._notifyCollectionChange(), i;
921
1022
  }
@@ -955,7 +1056,7 @@ var yr, br = class {
955
1056
  get isIPersonCollection() {
956
1057
  return !0;
957
1058
  }
958
- }, Cr = (e, t) => {
1059
+ }, Ar = (e, t) => {
959
1060
  let n = [0];
960
1061
  for (let t = 0; t < e.length; t++) e[t] === "\n" && n.push(t + 1);
961
1062
  let r = t.map((e) => ` ${((e) => {
@@ -967,7 +1068,7 @@ var yr, br = class {
967
1068
  return `${t + 1}:${e - n[t] + 1}`;
968
1069
  })(e.start)} ${e.code}: ${e.message}`), i = t.length;
969
1070
  return `Script has ${i} compile error${i === 1 ? "" : "s"}:\n${r.join("\n")}`;
970
- }, wr = class {
1071
+ }, jr = class {
971
1072
  constructor(e) {
972
1073
  this._options = e, this._emitter = new t(this), this._initState();
973
1074
  }
@@ -978,12 +1079,12 @@ var yr, br = class {
978
1079
  _builtInNames() {
979
1080
  try {
980
1081
  let e = this._options.getBuiltInFunctions?.();
981
- if (!e) return R.EmptyArray;
1082
+ if (!e) return z.EmptyArray;
982
1083
  let t = [];
983
1084
  for (let n of e.getItems({ includeHidden: !0 })) n.isBuiltIn() && t.push(n.getName());
984
1085
  return t;
985
1086
  } catch {
986
- return R.EmptyArray;
1087
+ return z.EmptyArray;
987
1088
  }
988
1089
  }
989
1090
  async createModule(e) {
@@ -992,16 +1093,17 @@ var yr, br = class {
992
1093
  minify: !0,
993
1094
  ...e
994
1095
  });
995
- return t.module ? await O(lt.DEFAULT_MODULE, t.module, e?.declarationsOnly ?? !1, t.diagnostics) : null;
1096
+ return t.module ? await E(st.DEFAULT_MODULE, t.module, e?.declarationsOnly ?? !1, t.diagnostics) : null;
996
1097
  }
997
1098
  addModule(e, t, n) {
998
1099
  this._modules.add(e, t, n);
999
1100
  }
1000
1101
  async addModuleFromJSON(e, t, n) {
1001
- let r = await O(e, t);
1102
+ let r = await E(e, t);
1002
1103
  return this.addModule(e, r, n), r;
1003
1104
  }
1004
- executeMacro(e, t, n) {
1105
+ async executeMacro(e, t, n) {
1106
+ await D.assertUsable("scripts");
1005
1107
  let r = this._modules.getItems({ name: t }), i = r.length;
1006
1108
  for (let t = 0; t < i; t++) {
1007
1109
  let i = r[t].getFunctions().getByName(e);
@@ -1014,7 +1116,8 @@ var yr, br = class {
1014
1116
  }
1015
1117
  async run(e, t) {
1016
1118
  try {
1017
- let n = typeof e == "string" ? await this.createModule({ source: e }) : await O(lt.DEFAULT_MODULE, e), r = typeof e == "string" ? e : e?.source ?? "";
1119
+ await D.assertUsable("scripts");
1120
+ let n = typeof e == "string" ? await this.createModule({ source: e }) : await E(st.DEFAULT_MODULE, e), r = typeof e == "string" ? e : e?.source ?? "";
1018
1121
  return await this._runModule(n, r, t);
1019
1122
  } catch (e) {
1020
1123
  return {
@@ -1031,7 +1134,7 @@ var yr, br = class {
1031
1134
  };
1032
1135
  let i = e.getDiagnostics(), a = i.filter((e) => e.severity === "error");
1033
1136
  if (a.length > 0) {
1034
- let e = Error(Cr(t, a));
1137
+ let e = Error(Ar(t, a));
1035
1138
  return e.diagnostics = a, {
1036
1139
  ok: !1,
1037
1140
  error: e,
@@ -1059,12 +1162,12 @@ var yr, br = class {
1059
1162
  }
1060
1163
  _searchable(e) {
1061
1164
  let t = this._modules;
1062
- return t && t.getCount() !== 0 ? (e ? t.getItems({ name: e }) : t.getItems()).map((e) => e.getFunctions()) : R.EmptyArray;
1165
+ return t && t.getCount() !== 0 ? (e ? t.getItems({ name: e }) : t.getItems()).map((e) => e.getFunctions()) : z.EmptyArray;
1063
1166
  }
1064
1167
  async searchFunctions(e) {
1065
1168
  await this._emitter.notify("onBeforeSearch", { async: !0 });
1066
1169
  let t = this._searchable(e?.moduleName);
1067
- if (t.length === 0) return R.EmptyArray;
1170
+ if (t.length === 0) return z.EmptyArray;
1068
1171
  if (t.length === 1) return t[0].search(e);
1069
1172
  let n = e?.limit, r = n === void 0 ? e : {
1070
1173
  ...e,
@@ -1080,9 +1183,9 @@ var yr, br = class {
1080
1183
  }
1081
1184
  }
1082
1185
  }
1083
- if (!i || i.length === 0) return R.EmptyArray;
1186
+ if (!i || i.length === 0) return z.EmptyArray;
1084
1187
  let o = e?.text ? e.text.trim().toUpperCase() : null;
1085
- return o ? at(i, o) : i.sort((e, t) => {
1188
+ return o ? s(i, o) : i.sort((e, t) => {
1086
1189
  let n = e.getName().toUpperCase(), r = t.getName().toUpperCase();
1087
1190
  return n < r ? -1 : +(n > r);
1088
1191
  }), n !== void 0 && i.length > n ? i.slice(0, n) : i;
@@ -1109,7 +1212,7 @@ var yr, br = class {
1109
1212
  }), r = t.length;
1110
1213
  for (let n = 0; n < r; n++) await t[n].execute(e);
1111
1214
  } catch (e) {
1112
- An.error("Error executing autoRun script:", e);
1215
+ Ln.error("Error executing autoRun script:", e);
1113
1216
  }
1114
1217
  }
1115
1218
  }
@@ -1120,13 +1223,13 @@ var yr, br = class {
1120
1223
  for (let i = 0; i < r.length; i++) {
1121
1224
  let a = r[i], o = t[a];
1122
1225
  try {
1123
- n[a] = await O(a, o, !1, [], o?.scope === "workbook" ? e : null);
1226
+ n[a] = await E(a, o, !1, [], o?.scope === "workbook" ? e : null);
1124
1227
  } catch (e) {
1125
- An.error(`Could not load script '${a}'; it will be unavailable.`, e);
1228
+ Ln.error(`Could not load script '${a}'; it will be unavailable.`, e);
1126
1229
  }
1127
1230
  }
1128
1231
  }
1129
- let r = this, i = new ze({
1232
+ let r = this, i = new Pt({
1130
1233
  transactions: this._options?.transactions,
1131
1234
  initial: n,
1132
1235
  isReadOnly: () => r.isReadOnly(),
@@ -1154,10 +1257,10 @@ var yr, br = class {
1154
1257
  get isIScript() {
1155
1258
  return !0;
1156
1259
  }
1157
- }, Tr = /^([a-z][a-z0-9+.-]*):/i, Er = (e) => {
1260
+ }, Mr = /^([a-z][a-z0-9+.-]*):/i, Nr = (e) => {
1158
1261
  let t = e.toLowerCase();
1159
1262
  return t.endsWith(":") ? t : t + ":";
1160
- }, Dr = async (e, t) => {
1263
+ }, Pr = async (e, t) => {
1161
1264
  try {
1162
1265
  return await globalThis.fetch(e, t);
1163
1266
  } catch (n) {
@@ -1176,14 +1279,14 @@ var yr, br = class {
1176
1279
  } finally {
1177
1280
  clearTimeout(i), r.abort();
1178
1281
  }
1179
- })(e, t) ? new I.Blocked("This site is restricted: it doesn't allow web apps to read its data, so the browser blocked the request for security.", { cause: n }) : n;
1282
+ })(e, t) ? new L.Blocked("This site is restricted: it doesn't allow web apps to read its data, so the browser blocked the request for security.", { cause: n }) : n;
1180
1283
  }
1181
- }, Or = class {
1284
+ }, Fr = class {
1182
1285
  constructor() {
1183
- this._handlers = /* @__PURE__ */ new Map([["http:", Dr], ["https:", Dr]]);
1286
+ this._handlers = /* @__PURE__ */ new Map([["http:", Pr], ["https:", Pr]]);
1184
1287
  }
1185
1288
  fetch(e, t) {
1186
- let n = Tr.exec(e)?.[1], r = this._handlers.get(n ? Er(n) : "https:");
1289
+ let n = Mr.exec(e)?.[1], r = this._handlers.get(n ? Nr(n) : "https:");
1187
1290
  if (!r) return Promise.reject(/* @__PURE__ */ TypeError(`No fetcher serves '${n}:'.`));
1188
1291
  try {
1189
1292
  return r(e, t);
@@ -1192,7 +1295,7 @@ var yr, br = class {
1192
1295
  }
1193
1296
  }
1194
1297
  register(e, t) {
1195
- let n = Er(e), r = this._handlers.get(n);
1298
+ let n = Nr(e), r = this._handlers.get(n);
1196
1299
  return this._handlers.set(n, t), () => {
1197
1300
  this._handlers.get(n) === t && (r ? this._handlers.set(n, r) : this._handlers.delete(n));
1198
1301
  };
@@ -1200,17 +1303,17 @@ var yr, br = class {
1200
1303
  get isIFetcher() {
1201
1304
  return !0;
1202
1305
  }
1203
- }, kr = /* @__PURE__ */ new Set([
1306
+ }, Ir = /* @__PURE__ */ new Set([
1204
1307
  101,
1205
1308
  103,
1206
1309
  204,
1207
1310
  205,
1208
1311
  304
1209
- ]), Y = (e) => new Response(kr.has(e.status) ? null : e.body, {
1312
+ ]), X = (e) => new Response(Ir.has(e.status) ? null : e.body, {
1210
1313
  status: e.status,
1211
1314
  statusText: e.statusText,
1212
1315
  headers: e.headers
1213
- }), Ar = class {
1316
+ }), Lr = class {
1214
1317
  constructor(e, t) {
1215
1318
  this._kept = /* @__PURE__ */ new Map(), this._cached = /* @__PURE__ */ new Map(), this._inFlight = /* @__PURE__ */ new Map(), this._resources = e, this._fetcher = t;
1216
1319
  }
@@ -1222,19 +1325,19 @@ var yr, br = class {
1222
1325
  let n = this._kept.get(e) ?? this._findHeld(e);
1223
1326
  if (n && !n.isClosed()) return this._fromKept(n);
1224
1327
  let r = this._cached.get(e);
1225
- if (r) return Y(r);
1328
+ if (r) return X(r);
1226
1329
  let i = this._inFlight.get(e);
1227
1330
  return i || (i = this._request(e, {
1228
1331
  ...t,
1229
1332
  signal: void 0
1230
1333
  }).finally(() => {
1231
1334
  this._inFlight.delete(e);
1232
- }), this._inFlight.set(e, i)), Y(await ((e, t) => t ? t.aborted ? Promise.reject(t.reason) : new Promise((n, r) => {
1335
+ }), this._inFlight.set(e, i)), X(await ((e, t) => t ? t.aborted ? Promise.reject(t.reason) : new Promise((n, r) => {
1233
1336
  let i = () => r(t.reason);
1234
1337
  t.addEventListener("abort", i, { once: !0 }), e.then(n, r).finally(() => t.removeEventListener("abort", i));
1235
1338
  }) : e)(i, t?.signal));
1236
1339
  }
1237
- return Y(await this._request(e, t));
1340
+ return X(await this._request(e, t));
1238
1341
  }
1239
1342
  adopt(e) {
1240
1343
  for (let t of e) {
@@ -1252,7 +1355,7 @@ var yr, br = class {
1252
1355
  }
1253
1356
  async _fromKept(e) {
1254
1357
  let [t, n] = await Promise.all([e.toBuffer(), e.getType()]);
1255
- return Y({
1358
+ return X({
1256
1359
  status: 200,
1257
1360
  statusText: "OK",
1258
1361
  headers: n ? [["content-type", n.mime]] : [],
@@ -1260,7 +1363,7 @@ var yr, br = class {
1260
1363
  });
1261
1364
  }
1262
1365
  async _request(e, t) {
1263
- let n = await this._fetcher.fetch(e, t), r = kr.has(n.status) ? null : await n.arrayBuffer(), i = [];
1366
+ let n = await this._fetcher.fetch(e, t), r = Ir.has(n.status) ? null : await n.arrayBuffer(), i = [];
1264
1367
  n.headers.forEach((e, t) => {
1265
1368
  i.push([t, e]);
1266
1369
  });
@@ -1271,14 +1374,14 @@ var yr, br = class {
1271
1374
  body: r
1272
1375
  };
1273
1376
  if (n.ok && r && r.byteLength > 0) {
1274
- let t = await new te({ source: { buffer: r } }).getType();
1377
+ let t = await new b({ source: { buffer: r } }).getType();
1275
1378
  t?.mime.startsWith("image/") ? (a.headers = i.filter(([e]) => e.toLowerCase() !== "content-type"), a.headers.push(["content-type", t.mime])) : this._cached.set(e, a);
1276
1379
  }
1277
1380
  return a;
1278
1381
  }
1279
- }, jr = class {
1382
+ }, Rr = class {
1280
1383
  constructor(e, t, n, r) {
1281
- this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = n, this._topLeft = t ?? z.EmptyCell, this._sheet = new T({
1384
+ this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = n, this._topLeft = t ?? B.EmptyCell, this._sheet = new T({
1282
1385
  runtime: e,
1283
1386
  styles: this._styles,
1284
1387
  calcOnLoad: "none",
@@ -1299,39 +1402,39 @@ var yr, br = class {
1299
1402
  e.includes(r) && delete i[r];
1300
1403
  }
1301
1404
  }
1302
- let a = an(i.fontFamily);
1405
+ let a = fn(i.fontFamily);
1303
1406
  r.font = {}, a && (r.font.family = a.family, r.font.fallbacks = a.fallbacks, r.font.size = a.size), r.font.size = i.fontSize, r.font.weight = i.fontWeight, r.font.style = i.fontStyle, r.font.color = i.color;
1304
- let o = Zt(i.textDecoration);
1305
- r.font.underline = o.underline, r.font.strike = o.strike ? N.StrikeStyle.Single : N.StrikeStyle.None, i.textUnderlineStyle && (r.font.underline = on(i.textUnderlineStyle)), r.alignment = {}, i?.textAlign && (r.alignment.horizontal = xn(i.textAlign)), i?.textAlign && !r.alignment.horizontal && i?.textAlign !== "general" && (i.textAlign === "center-across" ? r.alignment.horizontal = P.HorizontalAlignment.CenterContinuous : i.textAlign === "fill" ? r.alignment.horizontal = P.HorizontalAlignment.Fill : i.textAlign === "121" || i.textAlign === "010" ? (r.alignment.horizontal = P.HorizontalAlignment.Distributed, r.alignment.justifyLastLine = i.textAlign === "121") : console.warn("unknown text-align", i.textAlign)), i.verticalAlign && (i.verticalAlign.toLowerCase() === "super" ? r.font.baseline = M.Baseline.Superscript : i.verticalAlign.toLowerCase() === "sub" ? r.font.baseline = M.Baseline.Subscript : r.alignment.vertical = Qt(i.verticalAlign), r.alignment.vertical || (i.verticalAlign === "121" ? r.alignment.vertical = P.VerticalAlignment.Distributed : console.warn("unknown vertical-align", i.verticalAlign))), i.msoCharIndentCount && (r.alignment.indent = i.msoCharIndentCount), i.whiteSpace && (r.alignment.overflow = i.whiteSpace === "no-wrap" || i.whiteSpace === "nowrap" ? P.Overflow.Visible : P.Overflow.Wrap), i.msoTextControl === "shrinktofit" && (r.alignment.overflow = P.Overflow.Shrink);
1407
+ let o = an(i.textDecoration);
1408
+ r.font.underline = o.underline, r.font.strike = o.strike ? P.StrikeStyle.Single : P.StrikeStyle.None, i.textUnderlineStyle && (r.font.underline = pn(i.textUnderlineStyle)), r.alignment = {}, i?.textAlign && (r.alignment.horizontal = On(i.textAlign)), i?.textAlign && !r.alignment.horizontal && i?.textAlign !== "general" && (i.textAlign === "center-across" ? r.alignment.horizontal = I.HorizontalAlignment.CenterContinuous : i.textAlign === "fill" ? r.alignment.horizontal = I.HorizontalAlignment.Fill : i.textAlign === "121" || i.textAlign === "010" ? (r.alignment.horizontal = I.HorizontalAlignment.Distributed, r.alignment.justifyLastLine = i.textAlign === "121") : console.warn("unknown text-align", i.textAlign)), i.verticalAlign && (i.verticalAlign.toLowerCase() === "super" ? r.font.baseline = N.Baseline.Superscript : i.verticalAlign.toLowerCase() === "sub" ? r.font.baseline = N.Baseline.Subscript : r.alignment.vertical = cn(i.verticalAlign), r.alignment.vertical || (i.verticalAlign === "121" ? r.alignment.vertical = I.VerticalAlignment.Distributed : console.warn("unknown vertical-align", i.verticalAlign))), i.msoCharIndentCount && (r.alignment.indent = i.msoCharIndentCount), i.whiteSpace && (r.alignment.overflow = i.whiteSpace === "no-wrap" || i.whiteSpace === "nowrap" ? I.Overflow.Visible : I.Overflow.Wrap), i.msoTextControl === "shrinktofit" && (r.alignment.overflow = I.Overflow.Shrink);
1306
1409
  let s = null;
1307
1410
  if (i.background ? s = i.background : i.backgroundColor && (s = i.backgroundColor), s && (r.fill = { color: s }), i.msoPattern) {
1308
- let e = en(i.msoPattern);
1309
- e && (e.patternType === yn.BuiltInSheetPattern.Solid ? r.fill = { color: e.foreground } : e.patternType !== yn.BuiltInSheetPattern.None && (s && (e.background = s), r.fill = e));
1411
+ let e = ln(i.msoPattern);
1412
+ e && (e.patternType === Dn.BuiltInSheetPattern.Solid ? r.fill = { color: e.foreground } : e.patternType !== Dn.BuiltInSheetPattern.None && (s && (e.background = s), r.fill = e));
1310
1413
  }
1311
- i.layoutFlow === "vertical" || i.layoutFlow === "vertical-ideographic" ? r.alignment.stacked = !0 : i.msoRotate !== void 0 && (r.alignment.rotation = nn(i.msoRotate));
1414
+ i.layoutFlow === "vertical" || i.layoutFlow === "vertical-ideographic" ? r.alignment.stacked = !0 : i.msoRotate !== void 0 && (r.alignment.rotation = dn(i.msoRotate));
1312
1415
  let c = (e, t) => {
1313
1416
  e && (r.borders ||= {}, r.borders[e] = t);
1314
1417
  };
1315
1418
  i.border && i.border !== "none" && (c("top", i.border), c("left", i.border), c("right", i.border), c("bottom", i.border)), i.borderTop && c("top", i.borderTop), i.borderLeft && c("left", i.borderLeft), i.borderRight && c("right", i.borderRight), i.borderBottom && c("bottom", i.borderBottom), i.msoDiagonalUp && c("diagonalUp", i.msoDiagonalUp), i.msoDiagonalDown && c("diagonalDown", i.msoDiagonalDown);
1316
1419
  let l = r.numberFormat;
1317
- i.msoNumberFormat && (l = cn(i.msoNumberFormat), l.includes("\\") ? l = null : l === "Fixed" ? l = F.Styles.lookupStyle(r.numberFormat).formatType === F.Type.Number ? null : F.Type.Number : l === "Percent" && (l = F.Styles.lookupStyle(r.numberFormat).formatType === F.Type.Percentage ? null : F.Type.Percentage)), l && (r.numberFormat = l), e.style = this._styles.normalize(r), n && Object.keys(e.style).length === 0 && delete e.style;
1420
+ i.msoNumberFormat && (l = vn(i.msoNumberFormat), l.includes("\\") ? l = null : l === "Fixed" ? l = F.Styles.lookupStyle(r.numberFormat).formatType === F.Type.Number ? null : F.Type.Number : l === "Percent" && (l = F.Styles.lookupStyle(r.numberFormat).formatType === F.Type.Percentage ? null : F.Type.Percentage)), l && (r.numberFormat = l), e.style = this._styles.normalize(r), n && Object.keys(e.style).length === 0 && delete e.style;
1318
1421
  }
1319
1422
  onCell(e, t, n, r, i) {
1320
1423
  let a = r(i), o = { value: t === void 0 ? n ?? "" : t };
1321
1424
  if (typeof o.value == "string" && o.value.length === 0 && (o.value = void 0), a && this.applyCSSStyle(o, a), typeof o.value == "string" && /^#+$/.test(o.value)) {
1322
1425
  let e = o.style?.numberFormat;
1323
- e && (bn(e) || rn(e)) && (o.value = I.BuiltIn.Num);
1426
+ e && (sn(e) || on(e)) && (o.value = L.BuiltIn.Num);
1324
1427
  }
1325
1428
  if (i?.tagName.toUpperCase() === "TD") {
1326
1429
  let e = o.style, t = e?.font ?? {};
1327
- (i.querySelectorAll("s").length > 0 || i.querySelectorAll("strike").length > 0) && (t.strike = N.StrikeStyle.Single), i.querySelectorAll("sub").length > 0 && (t.baseline = M.Baseline.Subscript), i.querySelectorAll("sup").length > 0 && (t.baseline = M.Baseline.Superscript), (i.querySelectorAll("b").length > 0 || i.querySelectorAll("strong").length > 0) && (t.weight = 700), i.querySelectorAll("i").length > 0 && (t.style = N.Style.Italic), i.querySelectorAll("u").length > 0 && (t.underline = N.UnderlineStyle.Single), Object.keys(t).length > 0 && (e || (e = {}, o.style = e), e.font || (e.font = t));
1430
+ (i.querySelectorAll("s").length > 0 || i.querySelectorAll("strike").length > 0) && (t.strike = P.StrikeStyle.Single), i.querySelectorAll("sub").length > 0 && (t.baseline = N.Baseline.Subscript), i.querySelectorAll("sup").length > 0 && (t.baseline = N.Baseline.Superscript), (i.querySelectorAll("b").length > 0 || i.querySelectorAll("strong").length > 0) && (t.weight = 700), i.querySelectorAll("i").length > 0 && (t.style = P.Style.Italic), i.querySelectorAll("u").length > 0 && (t.underline = P.UnderlineStyle.Single), Object.keys(t).length > 0 && (e || (e = {}, o.style = e), e.font || (e.font = t));
1328
1431
  let n = i.querySelectorAll("a");
1329
1432
  if (n.length > 0) {
1330
1433
  let e = n[0].getAttribute("href");
1331
1434
  e && (o.hyperlink = e);
1332
1435
  }
1333
1436
  }
1334
- if (!z.isSingleCell(e)) {
1437
+ if (!B.isSingleCell(e)) {
1335
1438
  let t = {
1336
1439
  rowStart: this._topLeft.rowIndex + e.rowStart,
1337
1440
  colStart: this._topLeft.colIndex + e.colStart,
@@ -1342,7 +1445,7 @@ var yr, br = class {
1342
1445
  }
1343
1446
  if (o.value === void 0 && !o.style && Object.keys(o).length <= 1) return;
1344
1447
  let s = this._builder, c = this._topLeft;
1345
- if (s.pushAt(c.rowIndex + e.rowStart, c.colIndex + e.colStart, o), !z.isSingleCell(e) && a.msoIgnore) {
1448
+ if (s.pushAt(c.rowIndex + e.rowStart, c.colIndex + e.colStart, o), !B.isSingleCell(e) && a.msoIgnore) {
1346
1449
  if (a.msoIgnore.includes("colspan")) {
1347
1450
  let t = {};
1348
1451
  a && this.applyCSSStyle(t, a);
@@ -1371,8 +1474,8 @@ var yr, br = class {
1371
1474
  let i = n(r);
1372
1475
  if (i.msoHeightSource !== "userset" || !r) return;
1373
1476
  let a = r.getAttribute("height") ?? i.height, o = null;
1374
- if (a && (o = sn(a, this._styles.getNormal().getFont().getSize(), "px")), o === null) for (let e = 0; e < r.cells.length; e++) {
1375
- let t = r.cells[e], i = t.getAttribute("height") ?? n(t).height, a = sn(i, this._styles.getNormal().getFont().getSize(), "px");
1477
+ if (a && (o = mn(a, this._styles.getNormal().getFont().getSize(), "px")), o === null) for (let e = 0; e < r.cells.length; e++) {
1478
+ let t = r.cells[e], i = t.getAttribute("height") ?? n(t).height, a = mn(i, this._styles.getNormal().getFont().getSize(), "px");
1376
1479
  a !== null && (o = Math.max(a, o ?? 0));
1377
1480
  }
1378
1481
  o !== null && this._rowsReading.push({
@@ -1380,19 +1483,19 @@ var yr, br = class {
1380
1483
  min: this._topLeft.rowIndex + e,
1381
1484
  max: this._topLeft.rowIndex + e + t - 1
1382
1485
  },
1383
- update: { size: o * N.getDeviceScale() }
1486
+ update: { size: o * P.getDeviceScale() }
1384
1487
  });
1385
1488
  }
1386
1489
  onColumn(e, t, n, r) {
1387
1490
  let i = n(r);
1388
1491
  if (i.msoWidthSource !== "userset" || !r) return;
1389
1492
  let a = r.getAttribute("width") ?? i.width, o = null;
1390
- a && (o = sn(a, this._styles.getNormal().getFont().getSize(), "px")), o !== null && this._colsReading.push({
1493
+ a && (o = mn(a, this._styles.getNormal().getFont().getSize(), "px")), o !== null && this._colsReading.push({
1391
1494
  address: {
1392
1495
  min: this._topLeft.colIndex + e,
1393
1496
  max: this._topLeft.colIndex + e + t - 1
1394
1497
  },
1395
- update: { size: o * N.getDeviceScale() }
1498
+ update: { size: o * P.getDeviceScale() }
1396
1499
  });
1397
1500
  }
1398
1501
  onDone() {
@@ -1403,9 +1506,9 @@ var yr, br = class {
1403
1506
  sheet() {
1404
1507
  return this._sheet;
1405
1508
  }
1406
- }, Mr = class {
1509
+ }, zr = class {
1407
1510
  constructor(e) {
1408
- if (!e) throw new jn("snapshot is required.");
1511
+ if (!e) throw new Rn("snapshot is required.");
1409
1512
  this._snapshot = e;
1410
1513
  }
1411
1514
  getItemType() {
@@ -1435,10 +1538,10 @@ var yr, br = class {
1435
1538
  get isClipboardItem() {
1436
1539
  return !0;
1437
1540
  }
1438
- }, Nr = class {
1541
+ }, Br = class {
1439
1542
  constructor(e, t, n, r, i) {
1440
- if (this._parsed = void 0, this._runtime = e, !t) throw new jn("nativeItems are required.");
1441
- this._topLeft = n ?? z.EmptyCell, this._native = t, this._markOptions = Object.freeze(r ?? {}), this._styles = i;
1543
+ if (this._parsed = void 0, this._runtime = e, !t) throw new Rn("nativeItems are required.");
1544
+ this._topLeft = n ?? B.EmptyCell, this._native = t, this._markOptions = Object.freeze(r ?? {}), this._styles = i;
1442
1545
  }
1443
1546
  getItemType() {
1444
1547
  return "range";
@@ -1483,15 +1586,15 @@ var yr, br = class {
1483
1586
  async parse() {
1484
1587
  let e, t = this._native?.text, n = this._native.html;
1485
1588
  if (n === null && t && t.includes("<table")) try {
1486
- let e = new DOMParser().parseFromString(t, kn.Html), r = e.querySelector("parsererror");
1487
- if (r) throw new B("Unable to parse: " + r);
1589
+ let e = new DOMParser().parseFromString(t, In.Html), r = e.querySelector("parsererror");
1590
+ if (r) throw new V("Unable to parse: " + r);
1488
1591
  n = e, t = null;
1489
1592
  } catch {
1490
1593
  console.warn("Discovered text as html table but could could not parse.");
1491
1594
  }
1492
1595
  try {
1493
- let r = new jr(this._runtime, this._topLeft, this._styles, n ? "HTML" : "Text"), i = await Promise.resolve(t ? me(t) : [[]]), a;
1494
- if (se(n, i, r) ? (e = r.sheet(), a = e.getUsedRange()) : n = null, a) {
1596
+ let r = new Rr(this._runtime, this._topLeft, this._styles, n ? "HTML" : "Text"), i = await Promise.resolve(t ? fe(t) : [[]]), a;
1597
+ if (ce(n, i, r) ? (e = r.sheet(), a = e.getUsedRange()) : n = null, a) {
1495
1598
  let t = a.getSnapshot();
1496
1599
  return this._parsed = {
1497
1600
  prepare: (e, n) => t.prepare?.(e, n),
@@ -1505,7 +1608,7 @@ var yr, br = class {
1505
1608
  throw e;
1506
1609
  }
1507
1610
  if (!t && !n && this._native.image) {
1508
- let e = await this._native.image.arrayBuffer(), t = Dn.getPngStatedSize(e), n = null;
1611
+ let e = await this._native.image.arrayBuffer(), t = Pn.getPngStatedSize(e), n = null;
1509
1612
  return this._parsed = {
1510
1613
  async prepare(r) {
1511
1614
  let i = r.getWorksheet();
@@ -1513,7 +1616,7 @@ var yr, br = class {
1513
1616
  sheet: i,
1514
1617
  options: await i.getMovables()._preparePicture({ source: { buffer: e } }, {
1515
1618
  type: "picture",
1516
- description: U("op.copyImageFromClipboard"),
1619
+ description: W("op.copyImageFromClipboard"),
1517
1620
  autoSelect: !0,
1518
1621
  ...t && { bounds: t }
1519
1622
  })
@@ -1532,7 +1635,7 @@ var yr, br = class {
1532
1635
  get isClipboardItem() {
1533
1636
  return !0;
1534
1637
  }
1535
- }, Pr = class {
1638
+ }, Vr = class {
1536
1639
  constructor(e) {
1537
1640
  this._closed = !1, this._kind = e.kind, this._id = e.id, this._part = e.part, this._styles = e.styles, this._tabColor = e.tabColor ? this._styles.parseColor(e.tabColor) : null, this._transactions = e.transactions, this._workbook = e.workbook ?? null, this._container = e.container, this._emitter = new t(this, this._transactions);
1538
1641
  }
@@ -1549,11 +1652,11 @@ var yr, br = class {
1549
1652
  return this._assertOpen(), this._container.setName(e, t), this;
1550
1653
  }
1551
1654
  getVisibility() {
1552
- return this._closed ? A.Visibility.VeryHidden : this._container.getVisibility();
1655
+ return this._closed ? j.Visibility.VeryHidden : this._container.getVisibility();
1553
1656
  }
1554
1657
  setVisibility(e = !0, t) {
1555
1658
  let n;
1556
- return this._assertOpen(), n = !0 === e ? A.Visibility.Visible : !1 === e ? A.Visibility.Hidden : e, this._container.setVisibility(n, t), this;
1659
+ return this._assertOpen(), n = !0 === e ? j.Visibility.Visible : !1 === e ? j.Visibility.Hidden : e, this._container.setVisibility(n, t), this;
1557
1660
  }
1558
1661
  getIndex() {
1559
1662
  return this._container.getIndex();
@@ -1575,12 +1678,12 @@ var yr, br = class {
1575
1678
  }
1576
1679
  delete() {
1577
1680
  if (this._closed) return;
1578
- let e = this._transactions.beginCommit({ description: W("op.deleteSheet", { name: this.getName() }) });
1681
+ let e = this._transactions.beginCommit({ description: G("op.deleteSheet", { name: this.getName() }) });
1579
1682
  try {
1580
1683
  try {
1581
1684
  this._notify("onBeforeDelete");
1582
1685
  } catch (e) {
1583
- throw e instanceof Error ? e : new B(e?.message ?? W("error.sheet.modelDelete"));
1686
+ throw e instanceof Error ? e : new V(e?.message ?? G("error.sheet.modelDelete"));
1584
1687
  }
1585
1688
  this._notify("onDelete"), e.commit();
1586
1689
  } catch (t) {
@@ -1606,7 +1709,7 @@ var yr, br = class {
1606
1709
  this._emitter.notify(e);
1607
1710
  }
1608
1711
  _assertOpen() {
1609
- if (this._closed) throw Error(W("error.sheet.modelClosed"));
1712
+ if (this._closed) throw Error(G("error.sheet.modelClosed"));
1610
1713
  }
1611
1714
  get [Symbol.toStringTag]() {
1612
1715
  return "[OpaqueSheet]";
@@ -1621,12 +1724,12 @@ var yr, br = class {
1621
1724
  return !0;
1622
1725
  }
1623
1726
  };
1624
- (yr ||= {}).Visibility = {
1727
+ (Er ||= {}).Visibility = {
1625
1728
  Visible: "visible",
1626
1729
  Hidden: "hidden",
1627
1730
  VeryHidden: "veryHidden"
1628
1731
  };
1629
- var X, Fr = {
1732
+ var Z, Hr = {
1630
1733
  showFormulaBar: !0,
1631
1734
  showTabs: !0,
1632
1735
  tabRatio: 600,
@@ -1637,11 +1740,11 @@ var X, Fr = {
1637
1740
  firstTab: 0,
1638
1741
  windowBounds: null,
1639
1742
  minimized: !1,
1640
- visibility: yr.Visibility.Visible,
1743
+ visibility: Er.Visibility.Visible,
1641
1744
  autoFilterDateGrouping: !0
1642
- }, Ir = class {
1745
+ }, Ur = class {
1643
1746
  constructor(e) {
1644
- this._id = R.uuidV4(), this._emitter = new t(this), this._state = { ...Fr }, e?.json && this._fromJSON(e?.json);
1747
+ this._id = z.uuidV4(), this._emitter = new t(this), this._state = { ...Hr }, e?.json && this._fromJSON(e?.json);
1645
1748
  }
1646
1749
  getId() {
1647
1750
  return this._id;
@@ -1729,7 +1832,7 @@ var X, Fr = {
1729
1832
  let e = {}, t = Object.keys(this._state), n = t.length;
1730
1833
  for (let r = 0; r < n; r++) {
1731
1834
  let n = t[r], i = this._state[n];
1732
- i != null && i !== Fr[n] && (e[n] = i);
1835
+ i != null && i !== Hr[n] && (e[n] = i);
1733
1836
  }
1734
1837
  return Object.keys(e).length === 0 && (e = null), e;
1735
1838
  }
@@ -1739,7 +1842,7 @@ var X, Fr = {
1739
1842
  }
1740
1843
  update(e, t = !0) {
1741
1844
  this._state = {
1742
- ...Fr,
1845
+ ...Hr,
1743
1846
  ...this._state,
1744
1847
  ...e
1745
1848
  }, t && this._emitter.notify("onViewChange");
@@ -1754,13 +1857,13 @@ var X, Fr = {
1754
1857
  get isIWorkbookView() {
1755
1858
  return !0;
1756
1859
  }
1757
- }, Lr = Object.freeze({
1860
+ }, Wr = Object.freeze({
1758
1861
  structure: !1,
1759
1862
  windows: !1,
1760
1863
  revision: !0,
1761
1864
  password: null,
1762
1865
  revisionsPassword: null
1763
- }), Rr = class extends Pe {
1866
+ }), Gr = class extends St {
1764
1867
  isWindowsAllowed() {
1765
1868
  return this._isPropertyAllowed("windows");
1766
1869
  }
@@ -1782,7 +1885,7 @@ var X, Fr = {
1782
1885
  let n = Object.keys(t), r = n.length;
1783
1886
  for (let i = 0; i < r; i++) {
1784
1887
  let r = n[i], a = t[r];
1785
- a != null && a !== Lr[r] && (e[r] = a);
1888
+ a != null && a !== Wr[r] && (e[r] = a);
1786
1889
  }
1787
1890
  }
1788
1891
  return super._toJSON(e);
@@ -1794,38 +1897,38 @@ var X, Fr = {
1794
1897
  return !0;
1795
1898
  }
1796
1899
  };
1797
- (X ||= {}).Type = {
1900
+ (Z ||= {}).Type = {
1798
1901
  Number: "number",
1799
1902
  Boolean: "boolean",
1800
1903
  Date: "date",
1801
1904
  String: "string",
1802
1905
  Float: "float"
1803
1906
  };
1804
- var zr = (e) => {
1907
+ var Kr = (e) => {
1805
1908
  if (typeof e == "string") return {
1806
- type: X.Type.String,
1909
+ type: Z.Type.String,
1807
1910
  value: e
1808
1911
  };
1809
1912
  if (typeof e == "boolean") return {
1810
- type: X.Type.Boolean,
1913
+ type: Z.Type.Boolean,
1811
1914
  value: e
1812
1915
  };
1813
1916
  if (typeof e == "number") {
1814
1917
  if (!Number.isFinite(e)) throw Error("A custom property value must be a finite number.");
1815
1918
  return {
1816
- type: Number.isInteger(e) && e >= -2147483648 && e <= 2147483647 ? X.Type.Number : X.Type.Float,
1919
+ type: Number.isInteger(e) && e >= -2147483648 && e <= 2147483647 ? Z.Type.Number : Z.Type.Float,
1817
1920
  value: e
1818
1921
  };
1819
1922
  }
1820
1923
  if (e instanceof Date) {
1821
1924
  if (isNaN(e.getTime())) throw Error("A custom property value must be a valid date.");
1822
1925
  return {
1823
- type: X.Type.Date,
1926
+ type: Z.Type.Date,
1824
1927
  value: e.toISOString()
1825
1928
  };
1826
1929
  }
1827
1930
  throw Error("A custom property value must be a string, number, boolean or Date.");
1828
- }, Br = class {
1931
+ }, qr = class {
1829
1932
  constructor(e, t) {
1830
1933
  this._json = e, this._owner = t;
1831
1934
  }
@@ -1840,12 +1943,12 @@ var zr = (e) => {
1840
1943
  }
1841
1944
  getValue() {
1842
1945
  let { type: e, value: t } = this._json;
1843
- return e === X.Type.Date ? new Date(t) : t;
1946
+ return e === Z.Type.Date ? new Date(t) : t;
1844
1947
  }
1845
1948
  setValue(e) {
1846
1949
  this._owner._assertCustomEditable(this), this._json = {
1847
1950
  ...this._json,
1848
- ...zr(e)
1951
+ ...Kr(e)
1849
1952
  };
1850
1953
  }
1851
1954
  delete() {
@@ -1854,7 +1957,7 @@ var zr = (e) => {
1854
1957
  toJSON() {
1855
1958
  return { ...this._json };
1856
1959
  }
1857
- }, Vr = class {
1960
+ }, Jr = class {
1858
1961
  constructor(e) {
1859
1962
  this._json = {}, this._custom = [], this._assertOpen = e;
1860
1963
  }
@@ -1944,9 +2047,9 @@ var zr = (e) => {
1944
2047
  if (this._assertOpen(), typeof e != "string" || e === "") throw Error("A custom property needs a name.");
1945
2048
  let n = this.getCustomProperty(e);
1946
2049
  if (n) return n.setValue(t), n;
1947
- let r = new Br({
2050
+ let r = new qr({
1948
2051
  key: e,
1949
- ...zr(t)
2052
+ ...Kr(t)
1950
2053
  }, this);
1951
2054
  return this._custom.push(r), r;
1952
2055
  }
@@ -1961,26 +2064,26 @@ var zr = (e) => {
1961
2064
  }
1962
2065
  fromJSON(e) {
1963
2066
  let { custom: t, ...n } = e ?? {};
1964
- this._json = n, this._custom = (t ?? []).map((e) => new Br({ ...e }, this));
2067
+ this._json = n, this._custom = (t ?? []).map((e) => new qr({ ...e }, this));
1965
2068
  }
1966
2069
  toJSON() {
1967
2070
  let e = { ...this._json };
1968
2071
  return this._custom.length > 0 && (e.custom = this._custom.map((e) => e.toJSON())), e;
1969
2072
  }
1970
2073
  };
1971
- function Hr(e) {
1972
- return W("error.workbook.invalidSheetKey", { key: e });
2074
+ function Yr(e) {
2075
+ return G("error.workbook.invalidSheetKey", { key: e });
1973
2076
  }
1974
- function Ur(e) {
1975
- return W("error.workbook.sheetNameNotFound", { sheetName: e });
2077
+ function Xr(e) {
2078
+ return G("error.workbook.sheetNameNotFound", { sheetName: e });
1976
2079
  }
1977
- function Wr(e, t) {
1978
- return W(t === "chart" ? "error.workbook.sheetIsChart" : t === "macro" ? "error.workbook.sheetIsMacro" : "error.workbook.sheetIsDialog", { sheetName: e });
2080
+ function Zr(e, t) {
2081
+ return G(t === "chart" ? "error.workbook.sheetIsChart" : t === "macro" ? "error.workbook.sheetIsMacro" : "error.workbook.sheetIsDialog", { sheetName: e });
1979
2082
  }
1980
- function Gr(e, t) {
1981
- return t === "chart" ? W("error.workbook.selectedIsChart", { sheetName: e }) : t === "macro" ? W("error.workbook.selectedIsMacro", { sheetName: e }) : t === "dialog" ? W("error.workbook.selectedIsDialog", { sheetName: e }) : W("error.workbook.noWorksheet");
2083
+ function Qr(e, t) {
2084
+ return t === "chart" ? G("error.workbook.selectedIsChart", { sheetName: e }) : t === "macro" ? G("error.workbook.selectedIsMacro", { sheetName: e }) : t === "dialog" ? G("error.workbook.selectedIsDialog", { sheetName: e }) : G("error.workbook.noWorksheet");
1982
2085
  }
1983
- var Kr = class extends $e {
2086
+ var $r = class extends pt {
1984
2087
  constructor(e, t, n, r) {
1985
2088
  super(), this._add = e, this._get = t, this._addListeners = n, this._getSelected = r;
1986
2089
  }
@@ -2011,39 +2114,39 @@ var Kr = class extends $e {
2011
2114
  get isIWorksheetCollection() {
2012
2115
  return !0;
2013
2116
  }
2014
- }, qr = /* @__PURE__ */ new RegExp(/[\\/\\*?:[\]]+/), Jr = /* @__PURE__ */ new RegExp(/\(((\d+)(?!.*\d))\)$/, "g");
2015
- function Yr(e) {
2016
- let t = W(U("workbook.defaultSheetName"), { n: e + 1 });
2117
+ }, ei = /* @__PURE__ */ new RegExp(/[\\/\\*?:[\]]+/), ti = /* @__PURE__ */ new RegExp(/\(((\d+)(?!.*\d))\)$/, "g");
2118
+ function ni(e) {
2119
+ let t = G(W("workbook.defaultSheetName"), { n: e + 1 });
2017
2120
  return t === "workbook.defaultSheetName" ? `Sheet${e + 1}` : t;
2018
2121
  }
2019
- function Xr(e, t) {
2122
+ function ri(e, t) {
2020
2123
  return {
2021
- ...Fe,
2124
+ ...ke,
2022
2125
  getWorksheet: () => null,
2023
- toString: () => At(e, t)
2126
+ toString: () => Ge(e, t)
2024
2127
  };
2025
2128
  }
2026
- function Zr(e, t = !1) {
2027
- if (!e) throw Error(W("error.workbook.sheetNameBlank"));
2028
- if (qr.test(e)) {
2129
+ function ii(e, t = !1) {
2130
+ if (!e) throw Error(G("error.workbook.sheetNameBlank"));
2131
+ if (ei.test(e)) {
2029
2132
  if (!t) throw Error(function(e) {
2030
- return e ? W("error.workbook.sheetNameInvalidCharsNamed", { sheetName: e }) : W("error.workbook.sheetNameInvalidChars");
2133
+ return e ? G("error.workbook.sheetNameInvalidCharsNamed", { sheetName: e }) : G("error.workbook.sheetNameInvalidChars");
2031
2134
  }(e));
2032
- e = e.replace(qr, "");
2135
+ e = e.replace(ei, "");
2033
2136
  }
2034
- if (e.length === 0) throw Error(W("error.workbook.sheetNameBlank"));
2137
+ if (e.length === 0) throw Error(G("error.workbook.sheetNameBlank"));
2035
2138
  let n = e.length;
2036
2139
  if (n > 31) {
2037
- if (!t) throw Error(W("error.workbook.sheetNameTooLong"));
2140
+ if (!t) throw Error(G("error.workbook.sheetNameTooLong"));
2038
2141
  e = e.substring(0, 31);
2039
2142
  }
2040
2143
  if (e.charAt(0) === "'" || e.charAt(n - 1) === "'") {
2041
- if (!t) throw Error(W("error.workbook.sheetNameQuotes"));
2144
+ if (!t) throw Error(G("error.workbook.sheetNameQuotes"));
2042
2145
  e = e.replace(/^'|'$/g, "");
2043
2146
  }
2044
2147
  return e;
2045
2148
  }
2046
- var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2149
+ var ai = "workbook.activeSheet", oi = class e extends qt {
2047
2150
  constructor(e, t, n, r) {
2048
2151
  super(e, t, r), this._workbook = n;
2049
2152
  }
@@ -2054,24 +2157,24 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2054
2157
  let r = this._options;
2055
2158
  return n && (r = {
2056
2159
  ...this._options,
2057
- getOptions: j(this._options?.getOptions, n)
2160
+ getOptions: M(this._options?.getOptions, n)
2058
2161
  }), new e(t, this._internal, this._workbook, r);
2059
2162
  }
2060
2163
  _createRange(e, t) {
2061
- let n = e ? { ...e } : null, r = this._workbook, i = n ? r._getSheetRef(n.scope, A.Visibility.VeryHidden) : null;
2062
- if (i && !i.sheet.isIWorksheet) throw new B(Wr(i.name, i.sheet.getKind()));
2164
+ let n = e ? { ...e } : null, r = this._workbook, i = n ? r._getSheetRef(n.scope, j.Visibility.VeryHidden) : null;
2165
+ if (i && !i.sheet.isIWorksheet) throw new V(Zr(i.name, i.sheet.getKind()));
2063
2166
  if (!i) {
2064
2167
  let e = r._anchorWorksheet();
2065
- return delete n?.scope, Xr(n, n ? {
2066
- scope: Je,
2168
+ return delete n?.scope, ri(n, n ? {
2169
+ scope: Le,
2067
2170
  ...e.getEntireRange().getCoords()
2068
2171
  } : null);
2069
2172
  }
2070
2173
  let a = this._options;
2071
2174
  return t && (a = {
2072
2175
  ...this._options,
2073
- getOptions: j(this._options.getOptions, t)
2074
- }), new ti(e, D(i.sheet), this._workbook, a);
2176
+ getOptions: M(this._options.getOptions, t)
2177
+ }), new si(e, O(i.sheet), this._workbook, a);
2075
2178
  }
2076
2179
  async select(e) {
2077
2180
  let t = [], n = null, r = this.getCoords();
@@ -2095,15 +2198,15 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2095
2198
  }
2096
2199
  getAddress(e) {
2097
2200
  let t = this._internal.getSheet(), n = t.getEntireRange().getCoords();
2098
- return Pt(this.getCoords(), {
2201
+ return Ft(this.getCoords(), {
2099
2202
  ...n,
2100
2203
  scope: t.getName()
2101
- }, At, it, e);
2204
+ }, Ge, Rt, e);
2102
2205
  }
2103
2206
  toString() {
2104
2207
  return this.getAddress();
2105
2208
  }
2106
- }, ti = class e extends ne {
2209
+ }, si = class e extends re {
2107
2210
  constructor(e, t, n, r) {
2108
2211
  super(e, t, r), this._workbook = n;
2109
2212
  }
@@ -2111,17 +2214,17 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2111
2214
  let n = this._options;
2112
2215
  return t && (n = {
2113
2216
  ...this._options,
2114
- getOptions: j(this._options?.getOptions, t)
2115
- }), new ei(e, this._internal, this._workbook, n);
2217
+ getOptions: M(this._options?.getOptions, t)
2218
+ }), new oi(e, this._internal, this._workbook, n);
2116
2219
  }
2117
2220
  _createRange(t, n) {
2118
2221
  let r = this._internal;
2119
- if (!t) return Wt(r.getSheet(), r.getSheet().getEntireCoords());
2120
- if (r.validateCoords(t), r.getSheet().isClosed()) return Wt(null, r.getSheet().getEntireCoords(), t);
2222
+ if (!t) return $t(r.getSheet(), r.getSheet().getEntireCoords());
2223
+ if (r.validateCoords(t), r.getSheet().isClosed()) return $t(null, r.getSheet().getEntireCoords(), t);
2121
2224
  let i = this._options;
2122
2225
  return n && (i = {
2123
2226
  ...this._options,
2124
- getOptions: j(this._options?.getOptions, n)
2227
+ getOptions: M(this._options?.getOptions, n)
2125
2228
  }), new e(t, this._internal, this._workbook, i);
2126
2229
  }
2127
2230
  addListener(e, t) {
@@ -2134,7 +2237,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2134
2237
  }
2135
2238
  getAddress(e) {
2136
2239
  let t = this._internal.getSheet(), n = t?.getEntireRange().getCoords() ?? null;
2137
- return At(this.getCoords(), {
2240
+ return Ge(this.getCoords(), {
2138
2241
  ...n,
2139
2242
  scope: t.getName()
2140
2243
  });
@@ -2142,15 +2245,15 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2142
2245
  toString() {
2143
2246
  return this.getAddress();
2144
2247
  }
2145
- }, ni = (e) => !!e && typeof e == "object" && typeof e.getOrigin == "function", ri = class {
2248
+ }, ci = (e) => !!e && typeof e == "object" && typeof e.getOrigin == "function", li = class {
2146
2249
  constructor(n) {
2147
- this._isLoadingSheets = !1, this._lastTransactionUUID = null, this._starting = null, this._closed = !1, this._listenerOriginProvider = null, this._listenerOrigin = null, this._lastOriginName = null, this._initializing = !0, this._pivotCaches = [], this._pivotTableCollection = new Xe(() => {
2250
+ this._isLoadingSheets = !1, this._lastTransactionUUID = null, this._starting = null, this._closed = !1, this._listenerOriginProvider = null, this._listenerOrigin = null, this._lastOriginName = null, this._initializing = !0, this._pivotCaches = [], this._pivotTableCollection = new Ye(() => {
2148
2251
  let e = [];
2149
- for (let t of this.getWorksheets()) e.push(...t.getPivotTables());
2252
+ for (let t of this.getWorksheets().getItems({ visibility: j.Visibility.VeryHidden })) e.push(...t.getPivotTables());
2150
2253
  return e;
2151
- }), this._people = new Sr(), this._commentCollection = new p(null, (e, t, n) => {
2254
+ }, (e, t) => this.doBatch(e, t)), this._people = new kr(), this._commentCollection = new m(null, (e, t, n) => {
2152
2255
  let r = [];
2153
- for (let i of this.getWorksheets()) r.push(...i.getComments().getItems(e ? {
2256
+ for (let i of this.getWorksheets().getItems({ visibility: j.Visibility.VeryHidden })) r.push(...i.getComments().getItems(e ? {
2154
2257
  address: e,
2155
2258
  ignoreHidden: t,
2156
2259
  fullyContained: n
@@ -2161,23 +2264,23 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2161
2264
  return r;
2162
2265
  }, (e, t) => this.addListeners({ onSheetsChange: e.onCollectionChange ? () => {
2163
2266
  e.onCollectionChange(this._commentCollection);
2164
- } : void 0 }, t)), this._isDate1904 = !1, this._codeName = null, this._updateLinks = null, this._documentProperties = new Vr(() => {
2165
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2267
+ } : void 0 }, t)), this._isDate1904 = !1, this._codeName = null, this._updateLinks = null, this._hiddenPivotFieldList = !1, this._documentProperties = new Jr(() => {
2268
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2166
2269
  }), this._locale = null, this._localeOverrides = null, this._startModules = /* @__PURE__ */ new WeakSet();
2167
2270
  let r = typeof n == "string" ? { origin: n } : { ...n }, i = r.origin;
2168
- this._ownOriginProvider = !ni(i), this._originProvider = ni(i) ? i : new Un(typeof i == "string" ? new G(null, { name: i }) : i ?? new G(null)), delete r.origin, this._bindOrigin(this._originProvider.getOrigin()), this._listenerOriginProvider = this._originProvider.addListeners({ onOriginChange: () => this._onOriginChange() });
2271
+ this._ownOriginProvider = !ci(i), this._originProvider = ci(i) ? i : new Xn(typeof i == "string" ? new K(null, { name: i }) : i ?? new K(null)), delete r.origin, this._bindOrigin(this._originProvider.getOrigin()), this._listenerOriginProvider = this._originProvider.addListeners({ onOriginChange: () => this._onOriginChange() });
2169
2272
  let o = r.json;
2170
- delete r.json, this._transactions = r.transactions ?? new a(), this._id = this._transactions.create(), this._ownTransactions = !r.transactions, this._emitter = new t(this, this._transactions), this._runtime = r.runtime ?? new bt("Workbook Runtime", {
2273
+ delete r.json, this._transactions = r.transactions ?? new a(), this._id = this._transactions.create(), this._ownTransactions = !r.transactions, this._emitter = new t(this, this._transactions), this._runtime = r.runtime ?? new kt("Workbook Runtime", {
2171
2274
  isDate1904: () => this._isDate1904,
2172
2275
  getNow: () => this._transactions.getCurrentCommit().getTimestamp(),
2173
- getLocale: () => this._locale ?? rt() ?? It(),
2276
+ getLocale: () => this._locale ?? gt() ?? zt(),
2174
2277
  getLocaleOverrides: () => this._localeOverrides
2175
- }), this._listenerLanguage = En.addChangeListener(() => {
2278
+ }), this._listenerLanguage = Nn.addChangeListener(() => {
2176
2279
  this._closed || this._notifyAllChange();
2177
2280
  });
2178
- let s = this, c = this._beginCommit({ description: U(o ? "op.openWorkbook" : "op.newWorkbook") });
2281
+ let s = this, c = this._beginCommit({ description: W(o ? "op.openWorkbook" : "op.newWorkbook") });
2179
2282
  try {
2180
- this._strings = r.strings ?? new Ce(), this._ownStrings = !r.strings, this._richValues = r.richData ?? new Ot(), this._resources = r.resources ?? new ke(), this._ownResources = !r.resources, this._fetch = new Ar(this._resources, r.fetcher ?? new Or()), this._createSheetName = r.createSheetNameCallback ?? Yr;
2283
+ this._strings = r.strings ?? new Ne(), this._ownStrings = !r.strings, this._richValues = r.richData ?? new It(), this._resources = r.resources ?? new C(), this._ownResources = !r.resources, this._fetch = new Lr(this._resources, r.fetcher ?? new Fr()), this._createSheetName = r.createSheetNameCallback ?? ni;
2181
2284
  let t = r.createWorksheetCallback;
2182
2285
  t ||= (e) => new T(e), this._sheetOnNameChange = /* @__PURE__ */ new Map(), this._sheetOnVisibilityChange = /* @__PURE__ */ new Map(), this._sheetOnIndexChange = /* @__PURE__ */ new Map(), this._createSheet = (e, n, r, i, a, o, c) => {
2183
2286
  let l = null, u = {
@@ -2199,7 +2302,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2199
2302
  l = t, s._addSheetRef({
2200
2303
  name: n,
2201
2304
  id: e,
2202
- visibility: r ?? A.Visibility.Visible,
2305
+ visibility: r ?? j.Visibility.Visible,
2203
2306
  sheetId: a,
2204
2307
  sheet: t
2205
2308
  }, i);
@@ -2216,7 +2319,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2216
2319
  },
2217
2320
  getVisibility: () => {
2218
2321
  let e = s._getSheetRef(l);
2219
- return e ? e.visibility : A.Visibility.Visible;
2322
+ return e ? e.visibility : j.Visibility.Visible;
2220
2323
  },
2221
2324
  setVisibility: (e, t) => {
2222
2325
  s._setSheetVisibility(l, e, t);
@@ -2227,10 +2330,10 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2227
2330
  duplicate: () => s._duplicateSheet(l),
2228
2331
  getIndex: () => {
2229
2332
  let e = s._getSheetRef(l);
2230
- return e ? s._getOffsetForId(e.id, s._getSheetRefs(A.Visibility.VeryHidden)) : i;
2333
+ return e ? s._getOffsetForId(e.id, s._getSheetRefs(j.Visibility.VeryHidden)) : i;
2231
2334
  },
2232
2335
  setIndex: (e, t) => {
2233
- let n = s._getSheetRef(l, A.Visibility.VeryHidden);
2336
+ let n = s._getSheetRef(l, j.Visibility.VeryHidden);
2234
2337
  return !!n && (s._moveSheet(n, e, t), !0);
2235
2338
  },
2236
2339
  setIndexCallback: (t) => {
@@ -2240,16 +2343,16 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2240
2343
  }
2241
2344
  };
2242
2345
  return o && (u.json = o), c !== void 0 && (u.uid = () => c), l = t(u, n, i, r), l;
2243
- }, this._namedTableSource = new ht({
2244
- getSheets: () => s._sheets ? s.getWorksheets().getItems() : R.EmptyArray,
2346
+ }, this._namedTableSource = new _({
2347
+ getSheets: () => s._sheets ? s.getWorksheets().getItems({ visibility: j.Visibility.VeryHidden }) : z.EmptyArray,
2245
2348
  addSheetsListener: (e, t) => s.addListeners({ onSheetsChange: e }, t)
2246
- }), this._names = r.names ?? new jt({
2349
+ }), this._names = r.names ?? new ie({
2247
2350
  addressToRanges: (e) => s.getRanges(e),
2248
2351
  getCurrentScope: () => s.getSelectedWorksheet()?.getName() ?? null,
2249
2352
  isReadOnly: () => (s._options.readonly ?? !1) || s._isStructureProtected(),
2250
2353
  transactions: s._transactions,
2251
- getSources: () => s._calculation ? [s._calculation.getNamedFormulas(), s._namedTableSource] : R.EmptyArray
2252
- }), this._ownNames = !r.names, this._calculation = r.calculation ?? new we({
2354
+ getSources: () => s._calculation ? [s._calculation.getNamedFormulas(), s._namedTableSource] : z.EmptyArray
2355
+ }), this._ownNames = !r.names, this._calculation = r.calculation ?? new be({
2253
2356
  runtime: s._runtime,
2254
2357
  functions: r.functions,
2255
2358
  json: o?.calc,
@@ -2268,19 +2371,19 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2268
2371
  getSheetIndex: (e) => {
2269
2372
  if (e === void 0) {
2270
2373
  let e = s.getSelectedSheet();
2271
- return e ? this._getSheetRefs(A.Visibility.VeryHidden).findIndex((t) => t.sheet === e) : -1;
2374
+ return e ? this._getSheetRefs(j.Visibility.VeryHidden).findIndex((t) => t.sheet === e) : -1;
2272
2375
  }
2273
- let t = this._getSheetRefs(A.Visibility.VeryHidden);
2376
+ let t = this._getSheetRefs(j.Visibility.VeryHidden);
2274
2377
  e = e.toLowerCase();
2275
2378
  let n = t.length;
2276
2379
  for (let r = 0; r < n; r++) if (t[r].name.toLowerCase() === e) return r;
2277
2380
  try {
2278
- ii.address = e;
2279
- let t = this._names.getItems(ii);
2381
+ ui.address = e;
2382
+ let t = this._names.getItems(ui);
2280
2383
  if (!t || t.length === 0) return -1;
2281
2384
  let n = t[0].getRanges?.()?.getCoords()?.[0]?.scope;
2282
2385
  if (!n) return -1;
2283
- let r = this._getSheetRefs(A.Visibility.VeryHidden);
2386
+ let r = this._getSheetRefs(j.Visibility.VeryHidden);
2284
2387
  n = n.toLowerCase();
2285
2388
  let i = r.length;
2286
2389
  for (let e = 0; e < i; e++) if (r[e].name.toLowerCase() === n) return e;
@@ -2289,7 +2392,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2289
2392
  }
2290
2393
  return -1;
2291
2394
  },
2292
- getSheetCount: () => s._getSheetRefs(A.Visibility.VeryHidden).length,
2395
+ getSheetCount: () => s._getSheetRefs(j.Visibility.VeryHidden).length,
2293
2396
  externalBooks: o?.externalBooks,
2294
2397
  externalBookResolver: r.externalBookResolver,
2295
2398
  namedCollection: s._names,
@@ -2299,7 +2402,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2299
2402
  },
2300
2403
  fetch: (e, t) => s._fetch.fetch(e, t),
2301
2404
  parseText: (t, n) => (async (t, n, r) => {
2302
- let i = await import("./BpwULQPKbb4R9Jew.mjs").then((t) => e(t.default, 1)), a = (i.default ?? i).parse(n, {
2405
+ let i = await import("./CRbQATfI0yZxe1kX.mjs").then((t) => e(t.default, 1)), a = (i.default ?? i).parse(n, {
2303
2406
  delimiter: r?.delimiter ?? ",",
2304
2407
  skipEmptyLines: !1
2305
2408
  }).data, o = a.length, s = a[o - 1];
@@ -2311,7 +2414,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2311
2414
  let n = a[e], r = Array(c);
2312
2415
  for (let e = 0; e < c; e++) {
2313
2416
  let i = n[e];
2314
- r[e] = i === void 0 || i === "" ? null : Lt(t, i).value;
2417
+ r[e] = i === void 0 || i === "" ? null : Gt(t, i).value;
2315
2418
  }
2316
2419
  l[e] = r;
2317
2420
  }
@@ -2321,9 +2424,9 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2321
2424
  transactions: s._transactions,
2322
2425
  names: o?.names
2323
2426
  }), this._ownCalculation = !r.calculation, this._scripts = this._createScripts(o?.modules), this._ownNames = !r.names, this._options = Object.freeze({ ...r });
2324
- let n = o?.sheets?.length ? o.sheets.map((e) => e.name) : [this._createSheetName(0)], i = n.map((e) => e + "-" + R.uuidV4()), a = (e) => {
2427
+ let n = o?.sheets?.length ? o.sheets.map((e) => e.name) : [this._createSheetName(0)], i = n.map((e) => e + "-" + z.uuidV4()), a = (e) => {
2325
2428
  let t = o?.sheets?.[e]?.kind;
2326
- return !!t && t !== A.Kind.Worksheet;
2429
+ return !!t && t !== j.Kind.Worksheet;
2327
2430
  };
2328
2431
  this._calculation._setSheets(n.map((e, t) => a(t) ? [
2329
2432
  i[t],
@@ -2332,16 +2435,16 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2332
2435
  ] : [i[t], e]));
2333
2436
  let l = r.calcOnLoad ?? "auto", u = !1, d = (async () => {
2334
2437
  try {
2335
- if (this._ownCalculation && l !== "none" && (l === "full" || l === "auto" && !0 === o?.calc?.fullCalcOnLoad ? await this._calculation._calculateForLoad() : await this._calculation.start(), this._closed)) return;
2438
+ if (this._ownCalculation && l !== "none" && (l === "full" || l === "auto" && !0 === o?.calc?.fullCalcOnLoad ? await this._calculation._calculateForLoad() : await this._calculation.start(), this._closed || (await this._refreshPivotCachesOnLoad(), this._closed))) return;
2336
2439
  await this._scripts.start();
2337
2440
  } finally {
2338
2441
  u = !0, this._starting = null;
2339
2442
  }
2340
2443
  })();
2341
- u || (this._starting = d), this._starting?.catch(() => {}), o ? this._fromJSON(o, i) : (this._initState(), this._addSheet(!1, n[0], null, i[0])), this._sheets = new Kr((e) => s._addSheetOptions(e), (e, t) => {
2444
+ u || (this._starting = d), this._starting?.catch(() => {}), o ? this._fromJSON(o, i) : (this._initState(), this._addSheet(!1, n[0], null, i[0])), this._sheets = new $r((e) => s._addSheetOptions(e), (e, t) => {
2342
2445
  if (e) {
2343
2446
  let n = this._getSheetRef(e, t);
2344
- return n && Z(n) ? [n.sheet] : R.EmptyArray;
2447
+ return n && Q(n) ? [n.sheet] : z.EmptyArray;
2345
2448
  }
2346
2449
  return this._getWorksheets(t);
2347
2450
  }, (e, t) => {
@@ -2354,7 +2457,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2354
2457
  r(s._sheets);
2355
2458
  } : void 0
2356
2459
  }, t);
2357
- }, () => s.getSelectedWorksheet()), this._ownCalculation && (r.calcOnLoad ?? "auto") !== "none" && this._calculation.hydrateNames(), this._emitter.notify("onLoad"), this._ownTransactions ? c.amend() : c.commit();
2460
+ }, () => s.getSelectedWorksheet()), this._ownCalculation && (r.calcOnLoad ?? "auto") !== "none" && (this._calculation.hydrateNames(), this._holdPivotCaches()), this._emitter.notify("onLoad"), this._ownTransactions ? c.amend() : c.commit();
2358
2461
  } catch (e) {
2359
2462
  throw c.rollback(), e;
2360
2463
  }
@@ -2364,13 +2467,13 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2364
2467
  let e = this._getSheetRefs();
2365
2468
  for (let t = (e ? e.length : 0) - 1; t >= 0; t--);
2366
2469
  let t = this._options;
2367
- this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new Dt().getDefaultTheme(), this._styles = t?.styles ?? new Jt(this._theme), this._ownStyles = !t.styles, this._styles.getTheme() || this._styles.setTheme(this.getTheme()), this._activeSheetOffset = 0, this.setView(new Ir()), this._listenerProtection?.(), this._protection = new Rr(void 0, this._options.readonly ?? !1), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
2470
+ this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new tn().getDefaultTheme(), this._styles = t?.styles ?? new yt(this._theme), this._ownStyles = !t.styles, this._styles.getTheme() || this._styles.setTheme(this.getTheme()), this._activeSheetOffset = 0, this.setView(new Ur()), this._listenerProtection?.(), this._protection = new Gr(void 0, this._options.readonly ?? !1), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
2368
2471
  n._emitter.notify("onProtectionChange");
2369
2472
  } });
2370
2473
  let n = this;
2371
2474
  this._transactionsRemoveListener = this._transactions.addStateListener(this._id, {
2372
2475
  async onAfterStateChange(e, t, r, i, a) {
2373
- let o = n._view, s = a?.[$r], c = r ? s?.before : s?.after, l = s?.viewId === o.getId() && c != null, u = l ? c : o.getActiveSheetId(), d = l && t.getId() === n._lastTransactionUUID ? n._getSheetRef({ id: u }) : null;
2476
+ let o = n._view, s = a?.[ai], c = r ? s?.before : s?.after, l = s?.viewId === o.getId() && c != null, u = l ? c : o.getActiveSheetId(), d = l && t.getId() === n._lastTransactionUUID ? n._getSheetRef({ id: u }) : null;
2374
2477
  d ? await d.sheet.select() : n._resyncActiveSheet(u, e), n._lastTransactionUUID = t.getId(), (r || i) && n._emitter.notify("onSheetsChange"), n._emitter.notify("onSelectedSheetChange"), n._emitter.notify("onViewChange");
2375
2478
  },
2376
2479
  onRestoreOrRevert() {
@@ -2391,7 +2494,8 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2391
2494
  refsByInstance: /* @__PURE__ */ new Map(),
2392
2495
  lastId: -1,
2393
2496
  sheetsCreated: /* @__PURE__ */ new Set(),
2394
- listenersSheets: /* @__PURE__ */ new Map()
2497
+ listenersSheets: /* @__PURE__ */ new Map(),
2498
+ pivotCacheData: /* @__PURE__ */ new Map()
2395
2499
  });
2396
2500
  }
2397
2501
  getId() {
@@ -2425,8 +2529,8 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2425
2529
  return this._view;
2426
2530
  }
2427
2531
  setView(e) {
2428
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2429
- if (!e) throw new B(W("error.sheet.emptyView"));
2532
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2533
+ if (!e) throw new V(G("error.sheet.emptyView"));
2430
2534
  this._listenerWorkbookView?.();
2431
2535
  let t = this, n = -1;
2432
2536
  return this._listenerWorkbookView = e.addListeners({ onViewChange: (e) => {
@@ -2438,7 +2542,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2438
2542
  return this._runtime;
2439
2543
  }
2440
2544
  setDate1904(e) {
2441
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2545
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2442
2546
  return this._isDate1904 === e || (this._isDate1904 = e, this._emitter.notify("onRegionalChange")), this;
2443
2547
  }
2444
2548
  getLocale() {
@@ -2448,11 +2552,11 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2448
2552
  return this._locale;
2449
2553
  }
2450
2554
  setLocale(e) {
2451
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2555
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2452
2556
  if (e) try {
2453
2557
  new Intl.Locale(e);
2454
2558
  } catch {
2455
- throw Error(W("error.workbook.invalidLocale", { locale: e }));
2559
+ throw Error(G("error.workbook.invalidLocale", { locale: e }));
2456
2560
  }
2457
2561
  return this._locale === e || (this._locale = e, this._emitter.notify("onRegionalChange")), this;
2458
2562
  }
@@ -2460,7 +2564,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2460
2564
  return this._localeOverrides;
2461
2565
  }
2462
2566
  setLocaleOverrides(e) {
2463
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2567
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2464
2568
  let t = e && Object.keys(e).length > 0 ? e : null;
2465
2569
  return this._localeOverrides = t, this._emitter.notify("onRegionalChange"), this;
2466
2570
  }
@@ -2480,7 +2584,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2480
2584
  return this._transactions;
2481
2585
  }
2482
2586
  getChanges(e) {
2483
- let t = this._transactions, [n, r] = t.getLog(e ?? t.getCurrentCommit(!1).getId(), 2), i = [], a = this.getWorksheets().getItems({ visibility: A.Visibility.VeryHidden });
2587
+ let t = this._transactions, [n, r] = t.getLog(e ?? t.getCurrentCommit(!1).getId(), 2), i = [], a = this.getWorksheets().getItems({ visibility: j.Visibility.VeryHidden });
2484
2588
  for (let e = 0; e < a.length; e++) {
2485
2589
  let t = a[e];
2486
2590
  t instanceof T && i.push(...t._changeEventsOf(n, r ?? null));
@@ -2497,7 +2601,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2497
2601
  return this._updateLinks;
2498
2602
  }
2499
2603
  setUpdateLinks(e) {
2500
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2604
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2501
2605
  return this._updateLinks = e, this;
2502
2606
  }
2503
2607
  getPivotTables() {
@@ -2513,8 +2617,8 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2513
2617
  return this._theme;
2514
2618
  }
2515
2619
  setTheme(e) {
2516
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2517
- if (!e) throw new B(W("error.workbook.notSetValue"));
2620
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2621
+ if (!e) throw new V(G("error.workbook.notSetValue"));
2518
2622
  let t = this._theme;
2519
2623
  return this._theme = e, this.getStyles().setTheme(e), this._emitter.notify("onThemeChange"), t;
2520
2624
  }
@@ -2527,7 +2631,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2527
2631
  }
2528
2632
  getSelectedWorksheet() {
2529
2633
  let e = this._getSheetRef(this.getSelectedSheetIndex());
2530
- return e && Z(e) ? e.sheet : null;
2634
+ return e && Q(e) ? e.sheet : null;
2531
2635
  }
2532
2636
  getActiveSheet() {
2533
2637
  return this.getSelectedWorksheet();
@@ -2536,30 +2640,30 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2536
2640
  return this.getSelectedWorksheet();
2537
2641
  }
2538
2642
  getSheets(e) {
2539
- let t = this._getSheetRefs(e?.visibility ?? A.Visibility.Visible), n = Array(t.length);
2643
+ let t = this._getSheetRefs(e?.visibility ?? j.Visibility.Visible), n = Array(t.length);
2540
2644
  for (let e = 0; e < t.length; e++) n[e] = t[e].sheet;
2541
2645
  return n;
2542
2646
  }
2543
2647
  getSheet(e) {
2544
2648
  if (e === void 0) return this.getSelectedSheet();
2545
- if (!e) throw Error(W("error.workbook.sheetNameNotProvided"));
2649
+ if (!e) throw Error(G("error.workbook.sheetNameNotProvided"));
2546
2650
  let t = this._getSheetRef(e);
2547
- if (!t) throw new V(Ur(e));
2651
+ if (!t) throw new H(Xr(e));
2548
2652
  return t.sheet;
2549
2653
  }
2550
- getWorksheet(e, t = A.Visibility.Visible) {
2654
+ getWorksheet(e, t = j.Visibility.Visible) {
2551
2655
  if (typeof e == "number") return this.getWorksheetAt(e, t);
2552
2656
  if (e === void 0) return this._requireSelectedWorksheet();
2553
- if (!e) throw Error(W("error.workbook.sheetNameNotProvided"));
2657
+ if (!e) throw Error(G("error.workbook.sheetNameNotProvided"));
2554
2658
  let n = this._getSheetRef(e, t);
2555
- if (!n) throw new V(Ur(e));
2556
- if (!Z(n)) throw new V(Wr(n.name, n.sheet.getKind()));
2659
+ if (!n) throw new H(Xr(e));
2660
+ if (!Q(n)) throw new H(Zr(n.name, n.sheet.getKind()));
2557
2661
  return n.sheet;
2558
2662
  }
2559
- getWorksheetAt(e, t = A.Visibility.Visible) {
2663
+ getWorksheetAt(e, t = j.Visibility.Visible) {
2560
2664
  let n = this._getWorksheets(t)[e];
2561
- if (!n) throw new V(function(e) {
2562
- return W("error.workbook.sheetIndexNotFound", { index: e });
2665
+ if (!n) throw new H(function(e) {
2666
+ return G("error.workbook.sheetIndexNotFound", { index: e });
2563
2667
  }(e));
2564
2668
  return n;
2565
2669
  }
@@ -2567,10 +2671,10 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2567
2671
  let e = this.getSelectedWorksheet();
2568
2672
  if (e) return e;
2569
2673
  let t = this.getSelectedSheet();
2570
- throw new B(Gr(t?.getName() ?? "", t?.getKind() ?? A.Kind.Worksheet));
2674
+ throw new V(Qr(t?.getName() ?? "", t?.getKind() ?? j.Kind.Worksheet));
2571
2675
  }
2572
2676
  _anchorWorksheet() {
2573
- return this.getSelectedWorksheet() || (this._getWorksheets(A.Visibility.VeryHidden)[0] ?? null);
2677
+ return this.getSelectedWorksheet() || (this._getWorksheets(j.Visibility.VeryHidden)[0] ?? null);
2574
2678
  }
2575
2679
  getWorksheets() {
2576
2680
  return this._sheets;
@@ -2578,35 +2682,35 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2578
2682
  addWorksheet(e) {
2579
2683
  return this.getWorksheets().add(e);
2580
2684
  }
2581
- _getWorksheets(e = A.Visibility.Visible) {
2685
+ _getWorksheets(e = j.Visibility.Visible) {
2582
2686
  let t = this._getSheetRefs(e), n = [], r = t.length;
2583
2687
  for (let e = 0; e < r; e++) {
2584
2688
  let r = t[e];
2585
- Z(r) && n.push(r.sheet);
2689
+ Q(r) && n.push(r.sheet);
2586
2690
  }
2587
2691
  return n;
2588
2692
  }
2589
- _getSheetRefs(e = A.Visibility.Visible) {
2693
+ _getSheetRefs(e = j.Visibility.Visible) {
2590
2694
  let t = this._getState();
2591
- return t ? e === A.Visibility.Visible ? t.sheetRefsVisible : e === A.Visibility.Hidden ? t.sheetRefsVisibleAndHidden : e === A.Visibility.VeryHidden ? t.sheetRefsAll : R.EmptyArray : [];
2695
+ return t ? e === j.Visibility.Visible ? t.sheetRefsVisible : e === j.Visibility.Hidden ? t.sheetRefsVisibleAndHidden : e === j.Visibility.VeryHidden ? t.sheetRefsAll : z.EmptyArray : [];
2592
2696
  }
2593
- _getSheetRef(e, t = A.Visibility.Visible) {
2697
+ _getSheetRef(e, t = j.Visibility.Visible) {
2594
2698
  let n = null;
2595
2699
  return typeof e == "number" ? this._getSheetRefs(t)[e] : (typeof e == "string" ? n = this._getState().refsByLowerCaseName.get(e.toLowerCase()) : !0 === e?.isISheet ? n = this._getState().refsByInstance.get(e) : e?.id !== void 0 && (n = this._getState().refsById.get(e.id)), n);
2596
2700
  }
2597
2701
  _validateNewSheetName(e, t = !0) {
2598
2702
  if (e == null) return e;
2599
- if (Zr(e), t && this._getState().sheetsByLowerCaseName.has(e.toLowerCase())) throw new B(W("error.workbook.nameTaken"));
2703
+ if (ii(e), t && this._getState().sheetsByLowerCaseName.has(e.toLowerCase())) throw new V(G("error.workbook.nameTaken"));
2600
2704
  return e.substring(0, 31);
2601
2705
  }
2602
2706
  findValidSheetName(e) {
2603
- e &&= Zr(e, !0);
2707
+ e &&= ii(e, !0);
2604
2708
  try {
2605
2709
  return function(e, t) {
2606
2710
  try {
2607
2711
  if (t(e)) return e;
2608
2712
  } catch {}
2609
- let n, r, i = Jr.exec(e);
2713
+ let n, r, i = ti.exec(e);
2610
2714
  for (i === null ? (n = e + " ", r = 1) : (n = e.substring(0, i.index), r = parseFloat(i[1])); r < 256;) {
2611
2715
  r++;
2612
2716
  let e = "(" + r + ")", i = n.substring(0, 31 - e.length) + e;
@@ -2621,25 +2725,25 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2621
2725
  }
2622
2726
  }
2623
2727
  isValidSheetNameCharacter(e) {
2624
- return !qr.test(e);
2728
+ return !ei.test(e);
2625
2729
  }
2626
2730
  _isStructureProtected() {
2627
2731
  return !this._initializing && !this.getProtection().isStructureAllowed();
2628
2732
  }
2629
2733
  _addSheetOptions(e) {
2630
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2631
- if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2734
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2735
+ if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2632
2736
  let t, n = null;
2633
2737
  t = typeof e == "string" ? { name: e } : typeof e == "number" ? { index: e } : e, t = {
2634
2738
  ...t,
2635
- description: t?.description ?? U("op.addSheet")
2739
+ description: t?.description ?? W("op.addSheet")
2636
2740
  };
2637
2741
  let r = this.beginCommit(t);
2638
2742
  try {
2639
2743
  let e = t?.autoSelect ?? !1;
2640
2744
  n = this._addSheet(!0, t.name, t.index ?? null);
2641
2745
  let i = this.getView().getActiveSheetId();
2642
- if (e && this._recordActiveSheet(r, i, this._getSheetRef(n).id), r.commit({ description: W("op.addSheetNamed", { name: n.getName() }) }), !1 !== e) {
2746
+ if (e && this._recordActiveSheet(r, i, this._getSheetRef(n).id), r.commit({ description: G("op.addSheetNamed", { name: n.getName() }) }), !1 !== e) {
2643
2747
  let t = typeof e == "boolean" ? void 0 : e;
2644
2748
  n.select(t);
2645
2749
  }
@@ -2650,8 +2754,8 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2650
2754
  }
2651
2755
  _nextSheetName(e = null) {
2652
2756
  let t = e ? e.toLowerCase() : null, n = this._getState(), r = n.sheetsByLowerCaseName;
2653
- if (e && r.has(t)) throw new B(function(e) {
2654
- return W("error.workbook.nameDuplicate", { sheetName: e });
2757
+ if (e && r.has(t)) throw new V(function(e) {
2758
+ return G("error.workbook.nameDuplicate", { sheetName: e });
2655
2759
  }(e));
2656
2760
  t = (e = this._validateNewSheetName(e)) ? e.toLowerCase() : null;
2657
2761
  let i = n.lastId + 1;
@@ -2663,15 +2767,15 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2663
2767
  }
2664
2768
  _addSheet(e, t = null, n = null, r) {
2665
2769
  t = this._nextSheetName(t);
2666
- let i = this._getState(), a = this._createSheet(i.lastId, t, A.Visibility.Visible, n, void 0, null, r);
2667
- if (!a) throw new B(W("error.workbook.sheetNameBlank"));
2770
+ let i = this._getState(), a = this._createSheet(i.lastId, t, j.Visibility.Visible, n, void 0, null, r);
2771
+ if (!a) throw new V(G("error.workbook.sheetNameBlank"));
2668
2772
  return e && (this._tellSheets(), this._emitter.notify("onSheetsChange")), a;
2669
2773
  }
2670
2774
  _createOpaqueSheet(e, t, n, r, i, a, o, s, c) {
2671
2775
  let l = this, u = null;
2672
- return u = new Pr({
2776
+ return u = new Vr({
2673
2777
  kind: a,
2674
- id: c ?? t + "-" + R.uuidV4(),
2778
+ id: c ?? t + "-" + z.uuidV4(),
2675
2779
  part: o,
2676
2780
  tabColor: s,
2677
2781
  styles: this._styles,
@@ -2682,25 +2786,25 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2682
2786
  setName: (e, t) => {
2683
2787
  l._setSheetName(u, e, t);
2684
2788
  },
2685
- getVisibility: () => l._getSheetRef(u, A.Visibility.VeryHidden)?.visibility ?? A.Visibility.Visible,
2789
+ getVisibility: () => l._getSheetRef(u, j.Visibility.VeryHidden)?.visibility ?? j.Visibility.Visible,
2686
2790
  setVisibility: (e, t) => {
2687
2791
  l._setSheetVisibility(u, e, t);
2688
2792
  },
2689
2793
  getIndex: () => {
2690
- let e = l._getSheetRef(u, A.Visibility.VeryHidden);
2691
- return e ? l._getOffsetForId(e.id, l._getSheetRefs(A.Visibility.VeryHidden)) : -1;
2794
+ let e = l._getSheetRef(u, j.Visibility.VeryHidden);
2795
+ return e ? l._getOffsetForId(e.id, l._getSheetRefs(j.Visibility.VeryHidden)) : -1;
2692
2796
  },
2693
2797
  setIndex: (e, t) => {
2694
- let n = l._getSheetRef(u, A.Visibility.VeryHidden);
2798
+ let n = l._getSheetRef(u, j.Visibility.VeryHidden);
2695
2799
  n && l._moveSheet(n, e, t);
2696
2800
  },
2697
2801
  requestSelect: () => l._requestSelect(u),
2698
- isAttached: () => !!l._getSheetRef(u, A.Visibility.VeryHidden)
2802
+ isAttached: () => !!l._getSheetRef(u, j.Visibility.VeryHidden)
2699
2803
  }
2700
2804
  }), this._sheetOnNameChange.set(e, () => u._notify("onNameChange")), this._sheetOnVisibilityChange.set(e, () => u._notify("onVisibilityChange")), this._sheetOnIndexChange.set(e, () => u._notify("onIndexChange")), this._addSheetRef({
2701
2805
  name: t,
2702
2806
  id: e,
2703
- visibility: n ?? A.Visibility.Visible,
2807
+ visibility: n ?? j.Visibility.Visible,
2704
2808
  sheetId: i,
2705
2809
  sheet: u
2706
2810
  }, r), u;
@@ -2713,10 +2817,10 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2713
2817
  }), this.getSelectedSheet() === e;
2714
2818
  }
2715
2819
  _updateSheetRefStates(e) {
2716
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2717
- if (!this._initializing && !this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2820
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2821
+ if (!this._initializing && !this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2718
2822
  let t = e, n = [], r = [], i = t.length;
2719
- for (let e = 0; e < i; e++) t[e].visibility === A.Visibility.Visible ? (n.push(t[e]), r.push(t[e])) : t[e].visibility === A.Visibility.Hidden && r.push(t[e]);
2823
+ for (let e = 0; e < i; e++) t[e].visibility === j.Visibility.Visible ? (n.push(t[e]), r.push(t[e])) : t[e].visibility === j.Visibility.Hidden && r.push(t[e]);
2720
2824
  this._updateState({
2721
2825
  sheetRefsAll: t,
2722
2826
  sheetRefsVisible: n,
@@ -2726,7 +2830,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2726
2830
  _tellSheets() {
2727
2831
  if (this._isLoadingSheets) return;
2728
2832
  let e = this._getState().sheetRefsAll;
2729
- this._calculation._setSheets(e.map((e) => Z(e) ? [e.sheet.getId(), e.name] : [
2833
+ this._calculation._setSheets(e.map((e) => Q(e) ? [e.sheet.getId(), e.name] : [
2730
2834
  e.sheet.getId(),
2731
2835
  e.name,
2732
2836
  !0
@@ -2756,9 +2860,9 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2756
2860
  p._validateDeleteSheet(e);
2757
2861
  },
2758
2862
  onDelete(e) {
2759
- let t = p._getSheetRef(e, A.Visibility.VeryHidden);
2863
+ let t = p._getSheetRef(e, j.Visibility.VeryHidden);
2760
2864
  if (!t) return;
2761
- let n = p._beginCommit({ description: W("op.deleteSheet", { name: t.name }) });
2865
+ let n = p._beginCommit({ description: G("op.deleteSheet", { name: t.name }) });
2762
2866
  try {
2763
2867
  let r = p._getState(), i = r.sheetRefsAll, a = p._getOffsetForId(t.id, i), s = [...i];
2764
2868
  s.splice(a, 1), p._updateSheetRefStates(s);
@@ -2788,7 +2892,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2788
2892
  throw n.rollback(), e;
2789
2893
  }
2790
2894
  }
2791
- }, { transactional: !0 }), r = Z(e) ? e.sheet.addListeners({ onSelectionChange: (e) => {
2895
+ }, { transactional: !0 }), r = Q(e) ? e.sheet.addListeners({ onSelectionChange: (e) => {
2792
2896
  p.getView().getActiveSheetId() === p._getSheetRef(e)?.id && p._emitter.notify("onSelectionChange", {
2793
2897
  source: p,
2794
2898
  params: e
@@ -2812,7 +2916,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2812
2916
  }
2813
2917
  _recordActiveSheet(e, t, n) {
2814
2918
  let r = this.getView().getId();
2815
- e.setIntent($r, (e) => ({
2919
+ e.setIntent(ai, (e) => ({
2816
2920
  viewId: r,
2817
2921
  before: e?.before ?? t,
2818
2922
  after: n
@@ -2842,27 +2946,27 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2842
2946
  let n = this._view.getActiveSheetId();
2843
2947
  n ??= (this._view.setActiveSheetId(t), t);
2844
2948
  let r = e.refsById.get(n);
2845
- r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), n = t), r.visibility === A.Visibility.Visible && (this._activeSheetOffset = this._getOffsetForId(n, e.sheetRefsVisible));
2949
+ r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), n = t), r.visibility === j.Visibility.Visible && (this._activeSheetOffset = this._getOffsetForId(n, e.sheetRefsVisible));
2846
2950
  }
2847
2951
  _validateDeleteSheet(e) {
2848
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2849
- if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
2952
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2953
+ if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2850
2954
  let t = this._getSheetRef(e);
2851
- if (!t) throw new B(function(e) {
2852
- return W("error.workbook.deleteKey", { key: e });
2955
+ if (!t) throw new V(function(e) {
2956
+ return G("error.workbook.deleteKey", { key: e });
2853
2957
  }(e));
2854
2958
  let n = this._getState().sheetRefsVisible;
2855
- if (n.length === 1 && n[0].id === t.id) throw new B(W("error.workbook.sheetOne"));
2959
+ if (n.length === 1 && n[0].id === t.id) throw new V(G("error.workbook.sheetOne"));
2856
2960
  }
2857
2961
  _getOffsetForId(e, t) {
2858
2962
  let n = t.length;
2859
2963
  for (let r = 0; r < n; r++) if (t[r].id === e) return r;
2860
- throw new B(W("error.workbook.noVisibleRefs"));
2964
+ throw new V(G("error.workbook.noVisibleRefs"));
2861
2965
  }
2862
2966
  find(e) {
2863
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2967
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2864
2968
  let t = this._getWorksheets();
2865
- if (t.length === 0) return { next: () => Mt };
2969
+ if (t.length === 0) return { next: () => ot };
2866
2970
  if (t.length === 1) return t[0].find(e);
2867
2971
  typeof e == "string" && (e = { text: e });
2868
2972
  let n = !e?.reverse, r = e?.disableWrap ?? !1, i = this._worksheetOffsetFrom(this.getSelectedSheetIndex(), t), a = i, o = t[a], s = !1;
@@ -2878,7 +2982,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2878
2982
  rowIndex: t[0].rowStart
2879
2983
  };
2880
2984
  }
2881
- let f = z.createCellComparator(e?.axis, e?.reverse);
2985
+ let f = B.createCellComparator(e?.axis, e?.reverse);
2882
2986
  delete (e = { ...e }).from;
2883
2987
  let p = () => {
2884
2988
  if (!d && u.done && (s && a === i ? d = !0 : n ? (a++, a > t.length - 1 && (a = 0, s = !0)) : (a--, a < 0 && (a = t.length - 1, s = !0)), r && s && (d = !0), d || c || !s || a !== i || (d = !0), !d)) {
@@ -2888,7 +2992,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2888
2992
  }
2889
2993
  if (!d && s && a === i && (u.done || !c || !u.done && f(u.value.getCoords(), c) >= 0) && (d = !0), d) {
2890
2994
  let e = u;
2891
- return u = Mt, e;
2995
+ return u = ot, e;
2892
2996
  }
2893
2997
  let p = u;
2894
2998
  return u = l.next(), p;
@@ -2900,7 +3004,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2900
3004
  } };
2901
3005
  }
2902
3006
  replace(e, t, n) {
2903
- let r = 0, i = null, a = typeof t == "function", o = n?.maxCount ?? 2 ** 53 - 1, s = !n?.maxCount, c = "", l = typeof t == "string" ? dt(t) : null, u = n?.description ?? U("op.replace"), d = this._transactions.beginCommit({ description: u });
3007
+ let r = 0, i = null, a = typeof t == "function", o = n?.maxCount ?? 2 ** 53 - 1, s = !n?.maxCount, c = "", l = typeof t == "string" ? Wt(t) : null, u = n?.description ?? W("op.replace"), d = this._transactions.beginCommit({ description: u });
2904
3008
  try {
2905
3009
  let u = null, f = null, p = e.next();
2906
3010
  for (; !p.done && r < o;) {
@@ -2912,10 +3016,10 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2912
3016
  let c = a ? t(o) : t;
2913
3017
  c !== void 0 && c !== o && (f.push(o, c), r++, i = o), p = e.next();
2914
3018
  }
2915
- f?.apply(), r === 1 && o === 1 && i && (c = i.getAddress()), r === 0 ? d.rollback() : d.commit({ description: n?.description ?? (s ? l === null ? U("op.replaceAll") : W("op.replaceAllWith", { value: l }) : c ? l === null ? W("op.replaceAt", { address: c }) : W("op.replaceAtWith", {
3019
+ f?.apply(), r === 1 && o === 1 && i && (c = i.getAddress()), r === 0 ? d.rollback() : d.commit({ description: n?.description ?? (s ? l === null ? W("op.replaceAll") : G("op.replaceAllWith", { value: l }) : c ? l === null ? G("op.replaceAt", { address: c }) : G("op.replaceAtWith", {
2916
3020
  address: c,
2917
3021
  value: l
2918
- }) : l === null ? U("op.replace") : W("op.replaceWith", { value: l })) });
3022
+ }) : l === null ? W("op.replace") : G("op.replaceWith", { value: l })) });
2919
3023
  } catch (e) {
2920
3024
  throw d.rollback(), e;
2921
3025
  }
@@ -2936,113 +3040,113 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
2936
3040
  let n = this._getSheetRefs(), r = n.length;
2937
3041
  for (let i = 0; i < r; i++) {
2938
3042
  let a = n[(e + i) % r];
2939
- if (!Z(a)) continue;
3043
+ if (!Q(a)) continue;
2940
3044
  let o = t.indexOf(a.sheet);
2941
3045
  if (o !== -1) return o;
2942
3046
  }
2943
3047
  return 0;
2944
3048
  }
2945
3049
  getNextSheet(e) {
2946
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3050
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2947
3051
  let t = this._getSheetRefs();
2948
3052
  return t[this._nextSheetIndex(e, t)]?.sheet ?? null;
2949
3053
  }
2950
3054
  getPreviousSheet(e) {
2951
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3055
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
2952
3056
  let t = this._getSheetRefs();
2953
3057
  return t[this._prevSheetIndex(e, t)]?.sheet ?? null;
2954
3058
  }
2955
3059
  async _duplicateSheet(e) {
2956
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
2957
- if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
3060
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3061
+ if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
2958
3062
  let t = this._getSheetRefs(), n = this.getSelectedSheetIndex(), r = null;
2959
3063
  if (e) {
2960
- if (r = this._getSheetRef(e), !r) throw new B(Hr(r));
3064
+ if (r = this._getSheetRef(e), !r) throw new V(Yr(r));
2961
3065
  } else r = t[n];
2962
3066
  if (!r) return null;
2963
- if (!Z(r)) throw new B((i = r.name, W("error.workbook.sheetNotDuplicable", { sheetName: i })));
3067
+ if (!Q(r)) throw new V((i = r.name, G("error.workbook.sheetNotDuplicable", { sheetName: i })));
2964
3068
  var i;
2965
- let a = r.sheet, o = this._strings.beginPersist(), s = this.getResources().beginPersist(), c = this.getStyles().beginPersist(), l = this._richValues.beginPersist(), u = null, d = this.beginCommit(W("op.duplicateNamed", { name: a.getName() }));
3069
+ let a = r.sheet, o = t.indexOf(r), s = this._strings.beginPersist(), c = this.getResources().beginPersist(), l = this.getStyles().beginPersist(), u = this._richValues.beginPersist(), d = null, f = this.beginCommit(G("op.duplicateNamed", { name: a.getName() }));
2966
3070
  try {
2967
- let e = this._getState().refsByInstance.get(a), r = await a.toJSON(), i = t.length + 1, o = this.findValidSheetName(e.name), s = this._createSheet(i, o, e.visibility, n, void 0, r);
2968
- this._tellSheets(), this._emitter.notify("onSheetsChange"), u = s, d.commit();
3071
+ let e = this._getState().refsByInstance.get(a), n = await a.toJSON(), r = t.length + 1, i = this.findValidSheetName(e.name), s = this._createSheet(r, i, e.visibility, o, void 0, n);
3072
+ this._tellSheets(), this._emitter.notify("onSheetsChange"), d = s, f.commit();
2969
3073
  } catch (e) {
2970
- throw d.rollback(), e;
3074
+ throw f.rollback(), e;
2971
3075
  } finally {
2972
- l.endPersist(), c.endPersist(), s.endPersist(), o.endPersist();
3076
+ u.endPersist(), l.endPersist(), c.endPersist(), s.endPersist();
2973
3077
  }
2974
- return u;
3078
+ return d;
2975
3079
  }
2976
3080
  _createRange(e, t) {
2977
- let n = e ? { ...e } : null, r = n ? this._getSheetRef(n.scope, A.Visibility.VeryHidden) : null;
2978
- if (r && !Z(r)) throw new B(Wr(r.name, r.sheet.getKind()));
3081
+ let n = e ? { ...e } : null, r = n ? this._getSheetRef(n.scope, j.Visibility.VeryHidden) : null;
3082
+ if (r && !Q(r)) throw new V(Zr(r.name, r.sheet.getKind()));
2979
3083
  if (!r) {
2980
3084
  let e = this._anchorWorksheet();
2981
- return e ? (delete n?.scope, Xr(n, n ? {
2982
- scope: Je,
3085
+ return e ? (delete n?.scope, ri(n, n ? {
3086
+ scope: Le,
2983
3087
  ...e.getEntireRange().getCoords()
2984
- } : null)) : void console.warn(W("error.workbook.noVisibleRefs"));
3088
+ } : null)) : void console.warn(G("error.workbook.noVisibleRefs"));
2985
3089
  }
2986
3090
  let i = r.sheet, a = null;
2987
- return t && (a = { getOptions: t }), new ti(e, D(i), this, a);
3091
+ return t && (a = { getOptions: t }), new si(e, O(i), this, a);
2988
3092
  }
2989
3093
  _createRanges(e, t) {
2990
3094
  let n = this._anchorWorksheet();
2991
- if (!n) throw new B(Gr("", A.Kind.Worksheet));
3095
+ if (!n) throw new V(Qr("", j.Kind.Worksheet));
2992
3096
  let r = null;
2993
- return t && (r = { getOptions: t }), new ei(e, D(n), this, r);
3097
+ return t && (r = { getOptions: t }), new oi(e, O(n), this, r);
2994
3098
  }
2995
3099
  getRange(e, t) {
2996
3100
  if (e === void 0) return this.getSelectedRange(t);
2997
- typeof e == "number" && (e = Qe(arguments), t = void 0);
3101
+ typeof e == "number" && (e = Je(arguments), t = void 0);
2998
3102
  try {
2999
3103
  let n = this._rangesAddressToCoords(e);
3000
- if (n.length !== 1) throw new B(W("error.address.singleRangeOnlyAlt"));
3104
+ if (n.length !== 1) throw new V(G("error.address.singleRangeOnlyAlt"));
3001
3105
  return this._createRange(n[0], t);
3002
3106
  } catch (t) {
3003
- throw t instanceof V ? new V(t.message) : new B(t.message ?? ge(e));
3107
+ throw t instanceof H ? new H(t.message) : new V(t.message ?? Se(e));
3004
3108
  }
3005
3109
  }
3006
3110
  getCell(e) {
3007
3111
  if (e === void 0) return this.getSelectedCell();
3008
3112
  let t = this.getRange(e);
3009
- if (t.size > 1) throw new B(W("error.address.singleCellOnly"));
3113
+ if (t.size > 1) throw new V(G("error.address.singleCellOnly"));
3010
3114
  return t.getCell();
3011
3115
  }
3012
3116
  getRanges(e, t) {
3013
3117
  let n = this._rangesAddressToCoords(e);
3014
- if (n.length === 0) throw new B(ge(e));
3118
+ if (n.length === 0) throw new V(Se(e));
3015
3119
  return this._createRanges(n, t);
3016
3120
  }
3017
3121
  _createGraphRanges(e, t) {
3018
3122
  let n = [], r = this.getCalculation()?.getNamedFormulas() ?? null;
3019
3123
  for (let e = 0; e < t.length; e++) {
3020
- let i = t[e], a = i.sheetName ? this._getSheetRef(i.sheetName, A.Visibility.VeryHidden) : null, o = a && Z(a) ? a.sheet : this._anchorWorksheet();
3021
- o && n.push(new Ae(i, r, D(o), null));
3124
+ let i = t[e], a = i.sheetName ? this._getSheetRef(i.sheetName, j.Visibility.VeryHidden) : null, o = a && Q(a) ? a.sheet : this._anchorWorksheet();
3125
+ o && n.push(new Te(i, r, O(o), null));
3022
3126
  }
3023
3127
  for (let t = 0; t < e.length; t++) n.push(e[t]);
3024
3128
  let i = this._anchorWorksheet();
3025
- return n.length !== 0 && i ? new ei(n, D(i), this, null) : null;
3129
+ return n.length !== 0 && i ? new oi(n, O(i), this, null) : null;
3026
3130
  }
3027
3131
  getAnomalies(e) {
3028
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3029
- let t = _e(e), n = this._getWorksheets(A.Visibility.VeryHidden).map((e) => {
3030
- let t = D(e);
3132
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3133
+ let t = me(e), n = this._getWorksheets(j.Visibility.VeryHidden).map((e) => {
3134
+ let t = O(e);
3031
3135
  return {
3032
3136
  bounds: t.getSheet().getEntireCoords(),
3033
3137
  internal: t,
3034
3138
  qualified: !0
3035
3139
  };
3036
3140
  });
3037
- return new ue(n, () => (this.getSelectedWorksheet() ?? this._getWorksheets(A.Visibility.VeryHidden)[0]).getEntireRange(), t);
3141
+ return new ue(n, () => (this.getSelectedWorksheet() ?? this._getWorksheets(j.Visibility.VeryHidden)[0]).getEntireRange(), t);
3038
3142
  }
3039
3143
  getStats(e) {
3040
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3041
- let t = this._getWorksheets(A.Visibility.VeryHidden), n = t.length;
3144
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3145
+ let t = this._getWorksheets(j.Visibility.VeryHidden), n = t.length;
3042
3146
  if (n === 1) return t[0].getStats(e);
3043
3147
  let r = Array(n);
3044
3148
  for (let i = 0; i < n; i++) r[i] = t[i].getStats(e);
3045
- return new gr(r);
3149
+ return new Cr(r);
3046
3150
  }
3047
3151
  _activeRangeCoords() {
3048
3152
  let e = this._requireSelectedWorksheet(), t = e.getSelection().getRanges().getCoords(), n = e.getName(), r = t.length, i = Array(r);
@@ -3067,8 +3171,8 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3067
3171
  getSelectedCell() {
3068
3172
  return this._requireSelectedWorksheet().getSelectedCell();
3069
3173
  }
3070
- _rangesAddressToCoords(e, t = !0, n = A.Visibility.Hidden) {
3071
- if (!e) throw new B(W("error.address.noAddress"));
3174
+ _rangesAddressToCoords(e, t = !0, n = j.Visibility.Hidden) {
3175
+ if (!e) throw new V(G("error.address.noAddress"));
3072
3176
  let r = this.getSelectedWorksheet(), i = { ...(r ?? this._anchorWorksheet())?.getEntireRange().getCoords() }, a = r?.getName();
3073
3177
  if (a && (i.scope = a), typeof e == "string") {
3074
3178
  let t = e.trim().toLowerCase();
@@ -3077,11 +3181,11 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3077
3181
  t === "r" ? r.rowStart = r.rowEnd = n.rowIndex : r.colStart = r.colEnd = n.colIndex, e = r;
3078
3182
  }
3079
3183
  }
3080
- let o = this, s = tt(e, i, Tt, (e) => {
3184
+ let o = this, s = it(e, i, $e, (e) => {
3081
3185
  if (!t) return null;
3082
3186
  if (typeof e == "string") {
3083
- let t = ve(e, {
3084
- getTable: (e) => pt(o.getNames().getByName(e)),
3187
+ let t = he(e, {
3188
+ getTable: (e) => _t(o.getNames().getByName(e)),
3085
3189
  getAnchor: () => r ? {
3086
3190
  sheet: r,
3087
3191
  coords: r.getSelectedCell().getCoords()
@@ -3091,16 +3195,16 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3091
3195
  let n = o.getNames().getByName(e)?.getRanges?.();
3092
3196
  if (n) return n.getCoords();
3093
3197
  }
3094
- throw new B(`Invalid sheet reference '${e}'.`);
3198
+ throw new V(`Invalid sheet reference '${e}'.`);
3095
3199
  }), c = s.length;
3096
3200
  for (let e = 0; e < c; e++) this._validateCoords(s[e], n);
3097
3201
  return s;
3098
3202
  }
3099
- _validateCoords(e, t = A.Visibility.Visible, n = W("error.sheet.oobRange")) {
3203
+ _validateCoords(e, t = j.Visibility.Visible, n = G("error.sheet.oobRange")) {
3100
3204
  if (e === null) return;
3101
3205
  let r = this.getWorksheet(e.scope ?? void 0, t).getEntireRange().getCoords();
3102
- if (!z.isRangeWithinRange(e, r)) throw new V(n);
3103
- if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new B(W("error.address.invalidRangeInverted"));
3206
+ if (!B.isRangeWithinRange(e, r)) throw new H(n);
3207
+ if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new V(G("error.address.invalidRangeInverted"));
3104
3208
  }
3105
3209
  _updateSheetRef(e, t) {
3106
3210
  let n = this._getState(), r = [...n.sheetRefsAll];
@@ -3120,16 +3224,16 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3120
3224
  }), this._tellSheets(), t;
3121
3225
  }
3122
3226
  _setSheetName(e, t, n) {
3123
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3124
- if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
3227
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3228
+ if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
3125
3229
  let r = this._getSheetRef(e);
3126
- if (!r) throw new B(Hr(e));
3230
+ if (!r) throw new V(Yr(e));
3127
3231
  if (t === r.name) return r.sheet;
3128
- if ((t = this._validateNewSheetName(t)) == null) throw new B(W("error.workbook.sheetNameNotProvided"));
3232
+ if ((t = this._validateNewSheetName(t)) == null) throw new V(G("error.workbook.sheetNameNotProvided"));
3129
3233
  let i = Object.freeze({
3130
3234
  ...r,
3131
3235
  name: t
3132
- }), a = null, o = this.beginCommit(U("op.renameSheet"));
3236
+ }), a = null, o = this.beginCommit(W("op.renameSheet"));
3133
3237
  try {
3134
3238
  let e = this._updateSheetRef(r, i);
3135
3239
  this._adjustSheetNamesIfRequired(), this._sheetOnNameChange.forEach((e, t) => {
@@ -3140,23 +3244,23 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3140
3244
  }
3141
3245
  return a;
3142
3246
  }
3143
- _setSheetVisibility(e, t = A.Visibility.Visible, n) {
3144
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3145
- if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
3146
- let r = this._getSheetRef(e, A.Visibility.VeryHidden);
3247
+ _setSheetVisibility(e, t = j.Visibility.Visible, n) {
3248
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3249
+ if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
3250
+ let r = this._getSheetRef(e, j.Visibility.VeryHidden);
3147
3251
  if (!r) return null;
3148
3252
  if (t === r.visibility) return;
3149
3253
  let i = null, a = "";
3150
- t === A.Visibility.Visible ? a = U("op.unhideSheet") : t === A.Visibility.Hidden ? a = U("op.hideSheet") : t === A.Visibility.VeryHidden && (a = U("op.veryHideSheet"));
3254
+ t === j.Visibility.Visible ? a = W("op.unhideSheet") : t === j.Visibility.Hidden ? a = W("op.hideSheet") : t === j.Visibility.VeryHidden && (a = W("op.veryHideSheet"));
3151
3255
  let o = this.beginCommit(a);
3152
3256
  try {
3153
3257
  let e = this._getState().sheetRefsVisible;
3154
- if (t !== A.Visibility.Visible && e.length === 1 && e[0].id === r.id) throw new B(W("error.workbook.sheetOne"));
3258
+ if (t !== j.Visibility.Visible && e.length === 1 && e[0].id === r.id) throw new V(G("error.workbook.sheetOne"));
3155
3259
  let a = {
3156
3260
  ...r,
3157
3261
  visibility: t
3158
3262
  }, s = -1;
3159
- t !== A.Visibility.Visible && (s = this._getOffsetForId(r.id, e)), i = this._updateSheetRef(r, a).sheet, t !== A.Visibility.Visible && this._adjustRemoveSelectionIfRequired(s, r.id), this._adjustSheetNamesIfRequired(), o.commit(n);
3263
+ t !== j.Visibility.Visible && (s = this._getOffsetForId(r.id, e)), i = this._updateSheetRef(r, a).sheet, t !== j.Visibility.Visible && this._adjustRemoveSelectionIfRequired(s, r.id), this._adjustSheetNamesIfRequired(), o.commit(n);
3160
3264
  } catch (e) {
3161
3265
  throw o.rollback(), e;
3162
3266
  }
@@ -3165,12 +3269,12 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3165
3269
  }), this._emitter.notify("onSheetsChange"), i;
3166
3270
  }
3167
3271
  _moveSheet(e, t, n) {
3168
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3169
- if (!this.getProtection().isStructureAllowed()) throw new H(W("error.workbook.protection"));
3170
- let r = null, i = this.beginCommit(W("op.moveSheetNamed", { name: e.name }));
3272
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3273
+ if (!this.getProtection().isStructureAllowed()) throw new U(G("error.workbook.protection"));
3274
+ let r = null, i = this.beginCommit(G("op.moveSheetNamed", { name: e.name }));
3171
3275
  try {
3172
3276
  let a = this._getState(), o = a.sheetRefsVisible;
3173
- if (t < 0 || t > o.length - 1) throw new B(`Invalid to index: ${t}`);
3277
+ if (t < 0 || t > o.length - 1) throw new V(`Invalid to index: ${t}`);
3174
3278
  let s = this.getView().getActiveSheetId(), c = a.sheetRefsAll, l = this._getOffsetForId(e.id, c), u = this._getOffsetForId(o[t].id, c);
3175
3279
  if (l === u) return;
3176
3280
  let d = c[l], f = [...c];
@@ -3183,11 +3287,11 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3183
3287
  return r;
3184
3288
  }
3185
3289
  _setSelectedSheet(e) {
3186
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3290
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3187
3291
  let t = this._getSheetRef(e);
3188
- if (!t) throw new B(Hr(e));
3292
+ if (!t) throw new V(Yr(e));
3189
3293
  let n = null;
3190
- return t.visibility !== A.Visibility.Visible && this._setSheetVisibility(t, A.Visibility.Visible), this._view.setActiveSheetId(t.id), n = t.sheet, n;
3294
+ return t.visibility !== j.Visibility.Visible && this._setSheetVisibility(t, j.Visibility.Visible), this._view.setActiveSheetId(t.id), n = t.sheet, n;
3191
3295
  }
3192
3296
  getProtection() {
3193
3297
  return this._protection;
@@ -3205,7 +3309,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3205
3309
  return this._calculation;
3206
3310
  }
3207
3311
  getFonts() {
3208
- return xe.getShared();
3312
+ return Me.getShared();
3209
3313
  }
3210
3314
  createFormula(e, t, n) {
3211
3315
  return this.getCalculation().createFormula(e, t, n);
@@ -3272,52 +3376,215 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3272
3376
  let e = this._pivotCaches;
3273
3377
  if (e.length === 0) return;
3274
3378
  let t = (e) => {
3275
- let t = this._getSheetRef(e), n = t && Z(t) ? t.sheet : null;
3379
+ let t = this._getSheetRef(e), n = t && Q(t) ? t.sheet : null;
3276
3380
  return n ? n._contentAddWatch(() => null) : null;
3381
+ }, n = (e) => {
3382
+ for (let t of this._getSheetRefs(j.Visibility.VeryHidden)) {
3383
+ if (!Q(t)) continue;
3384
+ let n = t.sheet;
3385
+ if (n.getTables().getByName(e)) return n._contentAddWatch(() => null);
3386
+ }
3387
+ return null;
3388
+ }, r = (e, t) => {
3389
+ let n = this._getSheetRef(e);
3390
+ return n && Q(n) ? n.sheet.getRange(t) : null;
3391
+ }, i = (e) => {
3392
+ for (let t of this._getSheetRefs(j.Visibility.VeryHidden)) {
3393
+ if (!Q(t)) continue;
3394
+ let n = t.sheet.getTables().getByName(e);
3395
+ if (n) return n;
3396
+ }
3397
+ return null;
3398
+ }, a = (e, t) => {
3399
+ let n = this._pivotSourceNamed(e, t)?.getValue(), i = typeof n == "string" ? v(n) : null;
3400
+ return i && /^\$?[A-Za-z]+\$?\d+(?::\$?[A-Za-z]+\$?\d+)?$/.test(i.reference) ? r(i.sheet, i.reference.replaceAll("$", "")) : null;
3401
+ };
3402
+ for (let o = 0; o < e.length; o++) this._getState().pivotCacheData.has(e[o].cacheId) && (e[o]._hold(t, n), e[o]._watchSource(r, i, a));
3403
+ }
3404
+ _pivotCacheStore(e) {
3405
+ return {
3406
+ get: () => this._getState().pivotCacheData.get(e),
3407
+ set: (t) => {
3408
+ this._updateState((n) => ({
3409
+ ...n,
3410
+ pivotCacheData: new Map(n.pivotCacheData).set(e, t)
3411
+ }), W("op.refreshPivotTable"));
3412
+ }
3277
3413
  };
3278
- for (let n = 0; n < e.length; n++) e[n]._hold(t);
3414
+ }
3415
+ _getPivotCache(e) {
3416
+ return this._getState().pivotCacheData.has(e) ? this._pivotCaches.find((t) => t.cacheId === e) ?? null : null;
3417
+ }
3418
+ _pivotSourceOf(e, t) {
3419
+ if (e.isITable) return { name: e.getName() };
3420
+ let n = null;
3421
+ if (typeof e == "string") {
3422
+ for (let t of this._getSheetRefs(j.Visibility.VeryHidden)) if (Q(t) && t.sheet.getTables().getByName(e)) return { name: e };
3423
+ if (this.getNames().getByName(e)) return { name: e };
3424
+ if (t.getNames().getByName(e)?.getScope()) return {
3425
+ name: e,
3426
+ sheet: t.getName()
3427
+ };
3428
+ let r = v(e), i = r ? this._getSheetRef(r.sheet) : null;
3429
+ if (r && (!i || !Q(i))) return null;
3430
+ try {
3431
+ n = r ? i.sheet.getRange(r.reference) : t.getRange(e);
3432
+ } catch (e) {
3433
+ if (!(e instanceof V)) throw e;
3434
+ return null;
3435
+ }
3436
+ } else n = e.isICellRange ? e : t.getRange(e);
3437
+ if (!n || n.isInvalid()) return null;
3438
+ let { rowStart: r, colStart: i, rowEnd: a, colEnd: s } = n.getCoords();
3439
+ return {
3440
+ ref: o({
3441
+ rowStart: r,
3442
+ colStart: i,
3443
+ rowEnd: a,
3444
+ colEnd: s
3445
+ }),
3446
+ sheet: n.getWorksheet().getName()
3447
+ };
3448
+ }
3449
+ _findPivotCache(e) {
3450
+ let t = (e, t) => (e ?? "").toLocaleLowerCase() === (t ?? "").toLocaleLowerCase();
3451
+ return this._pivotCaches.find((n) => {
3452
+ if (!this._getPivotCache(n.cacheId) || !n._getData().model || n._isStale()) return !1;
3453
+ let r = n._getSource();
3454
+ return !!r && t(r.ref, e.ref) && t(r.sheet, e.sheet) && t(r.name, e.name);
3455
+ }) ?? null;
3456
+ }
3457
+ _addPivotCache(e) {
3458
+ let t = this._pivotCaches.reduce((e, t) => Math.max(e, t.cacheId), -1) + 1, n = this._pivotCacheStore(t);
3459
+ n.set({
3460
+ part: null,
3461
+ model: e,
3462
+ partFormats: null,
3463
+ source: null
3464
+ });
3465
+ let r = new Dr(t, n);
3466
+ return this._pivotCaches.push(r), this._holdPivotCaches(), r;
3467
+ }
3468
+ async _refreshPivotCaches(e, t) {
3469
+ let n = [];
3470
+ for (let t of this._getSheetRefs(j.Visibility.VeryHidden)) if (Q(t)) for (let r of t.sheet.getPivotTables().getItems()) e.has(r.getCacheId()) && n.push(r);
3471
+ for (let e of n) e._assertRefreshAllowed();
3472
+ for (let r of e) {
3473
+ let e = this._getPivotCache(r), i = e ? await this._pivotSourceRangeOf(e._getSource()) : null;
3474
+ if (!e || !i) throw new V(G("error.pivotTable.refreshSourceUnsupported"));
3475
+ if (i.getRowCount() < 2) throw new V(G("error.pivotTable.refreshSourceTooSmall"));
3476
+ i.getWorksheet()._cellBuffer?.release();
3477
+ let a = e.toJSON();
3478
+ if (!a.fields) throw new V(G("error.pivotTable.refreshSourceUnsupported"));
3479
+ let { model: o, remap: s } = t.refreshPivotCache(a, t.readPivotSource(i), e._getSource() ?? void 0, this._isDate1904);
3480
+ e._replace(o);
3481
+ for (let e of n) e.getCacheId() === r && e._remapCache(s, t);
3482
+ }
3483
+ for (let e of n) await e._prepareRelayout(t);
3484
+ for (let e of n) e._refresh(t);
3485
+ }
3486
+ async _refreshPivotCachesOnLoad() {
3487
+ let e = this._pivotCaches.filter((e) => !!e._getData().model?.refreshOnLoad);
3488
+ if (e.length === 0) return;
3489
+ let t = await Ht.load();
3490
+ for (let n of e) {
3491
+ if (this._closed) return;
3492
+ try {
3493
+ await this._transactions.doBatch(() => this._refreshPivotCaches(/* @__PURE__ */ new Set([n.cacheId]), t));
3494
+ } catch (e) {
3495
+ if (!(e instanceof V || e instanceof U)) throw e;
3496
+ }
3497
+ }
3498
+ }
3499
+ async _pivotSourceRangeOf(e) {
3500
+ if (!e) return null;
3501
+ if (e.ref) {
3502
+ if (!e.sheet || e.ref.includes("#REF!")) return null;
3503
+ let t = this._getSheetRef(e.sheet);
3504
+ return t && Q(t) ? t.sheet.getRange(e.ref) : null;
3505
+ }
3506
+ if (!e.name) return null;
3507
+ if (!e.sheet) for (let t of this._getSheetRefs(j.Visibility.VeryHidden)) {
3508
+ if (!Q(t)) continue;
3509
+ let n = t.sheet.getTables().getByName(e.name);
3510
+ if (!n || n.isDeleted()) continue;
3511
+ let { rowEnd: r } = n.getDataRange().getCoords();
3512
+ return t.sheet.getRange({
3513
+ ...n.getRange().getCoords(),
3514
+ rowEnd: r
3515
+ });
3516
+ }
3517
+ let t = await this._pivotSourceNamed(e.name, e.sheet ?? null)?.evaluate(), n = t?.isIReferenceRange ? t.getCoords() : null;
3518
+ if (!n?.scope) return null;
3519
+ let r = this._getSheetRef(n.scope);
3520
+ return r && Q(r) ? r.sheet.getRange(n) : null;
3521
+ }
3522
+ _pivotSourceNamed(e, t) {
3523
+ if (!t) return this.getNames().getByName(e);
3524
+ let n = this._getSheetRef(t);
3525
+ if (!n || !Q(n)) return null;
3526
+ let r = n.sheet.getNames().getByName(e);
3527
+ return r?.getScope() ? r : null;
3528
+ }
3529
+ _holdPivotSlicers() {
3530
+ let e = (e, t) => {
3531
+ let n = this._getSheetRef(e);
3532
+ return (n && Q(n) ? n.sheet : null)?.getPivotTables().getByName(t) ?? null;
3533
+ };
3534
+ for (let t of this._getSheetRefs(j.Visibility.VeryHidden)) {
3535
+ if (!Q(t)) continue;
3536
+ let n = t.sheet.getMovables().getItems();
3537
+ for (let t = 0; t < n.length; t++) {
3538
+ let r = n[t].getContent();
3539
+ r.isISlicer && r._holdPivotTables(e);
3540
+ }
3541
+ }
3279
3542
  }
3280
3543
  _fromJSON(e, t) {
3281
- if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || e.sheets.length === 0) throw new B(W("error.workbook.sheetOne"));
3282
- e.theme && (this._theme = new pe(e.theme), this._styles.setTheme(this._theme));
3544
+ if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || e.sheets.length === 0) throw new V(G("error.workbook.sheetOne"));
3545
+ e.theme && (this._theme = new Oe(e.theme), this._styles.setTheme(this._theme));
3283
3546
  let n = this._strings.beginPersist(), r = this._resources.beginPersist(), i = this._styles.beginPersist(), a = this._richValues.beginPersist();
3284
3547
  try {
3285
3548
  n.fromJSON(e.strings), r.fromJSON(e.resources), this._fetch.adopt(this._resources.getItems()), i.fromJSON(e.styles), a.fromJSON(e.richData, {
3286
3549
  resources: this._resources,
3287
3550
  strings: this._strings,
3288
3551
  fromResourceId: (e) => r.fromResourceId(e) ?? null
3289
- }, e.richTypes), e.date1904 && (this._isDate1904 = !0), this._codeName = e.codeName ?? null, this._updateLinks = e.updateLinks ?? null, this._documentProperties.fromJSON(e.properties), e.locale && (this._locale = e.locale), e.localeOverrides && (this._localeOverrides = e.localeOverrides), e.view ||= {};
3290
- let o = [], s = e.pivotCaches;
3291
- if (s) {
3552
+ }, e.richTypes), e.date1904 && (this._isDate1904 = !0), this._codeName = e.codeName ?? null, this._updateLinks = e.updateLinks ?? null, this._hiddenPivotFieldList = !0 === e.hiddenPivotFieldList, this._documentProperties.fromJSON(e.properties), e.locale && (this._locale = e.locale), e.localeOverrides && (this._localeOverrides = e.localeOverrides), e.view ||= {};
3553
+ let o = [], s = /* @__PURE__ */ new Map(), c = e.pivotCaches;
3554
+ if (c) {
3292
3555
  let e = r.fromResourceId.bind(r);
3293
- for (let t = 0; t < s.length; t++) {
3294
- let n = s[t];
3295
- n && typeof n.cacheId == "number" && o.push(new br(n.cacheId, k.fromJSON(n.part, e)));
3556
+ for (let t = 0; t < c.length; t++) {
3557
+ let n = c[t];
3558
+ n && typeof n.cacheId == "number" && !s.has(n.cacheId) && s.set(n.cacheId, Dr.dataOf(n, e));
3296
3559
  }
3297
3560
  }
3561
+ this._updateState({ pivotCacheData: s });
3562
+ for (let e of s.keys()) o.push(new Dr(e, this._pivotCacheStore(e)));
3298
3563
  this._pivotCaches = o, this._people.fromJSON(e.people);
3299
- let c = e.sheets, l = c.length, u = e.view.activeSheetId ?? null;
3300
- u !== null && (u = Math.min(Math.max(0, u), l - 1));
3301
- let d = null, f = null;
3564
+ let l = e.sheets, u = l.length, d = e.view.activeSheetId ?? null;
3565
+ d !== null && (d = Math.min(Math.max(0, d), u - 1));
3566
+ let f = null, p = null;
3302
3567
  this._isLoadingSheets = !0;
3303
- for (let e = 0; e < l; e++) {
3304
- let n = c[e], i = n.visibility || A.Visibility.Visible, a = e;
3305
- f = a, i === A.Visibility.Visible ? d === null && (d = a) : u !== null && u === a && (u = null);
3568
+ for (let e = 0; e < u; e++) {
3569
+ let n = l[e], i = n.visibility || j.Visibility.Visible, a = e;
3570
+ p = a, i === j.Visibility.Visible ? f === null && (f = a) : d !== null && d === a && (d = null);
3306
3571
  try {
3307
- let o = n.kind ?? A.Kind.Worksheet;
3308
- if (o !== A.Kind.Worksheet) {
3309
- let s = n.sheet, c = k.fromJSON(s?.part, r.fromResourceId.bind(r));
3310
- if (!c) throw new B(W("error.workbook.sheetPartMissing", { sheetName: n.name }));
3572
+ let o = n.kind ?? j.Kind.Worksheet;
3573
+ if (o !== j.Kind.Worksheet) {
3574
+ let s = n.sheet, c = A.fromJSON(s?.part, r.fromResourceId.bind(r));
3575
+ if (!c) throw new V(G("error.workbook.sheetPartMissing", { sheetName: n.name }));
3311
3576
  this._createOpaqueSheet(a, n.name, i, e, n.sheetId, o, c, s?.tabColor ?? null, t?.[e]);
3312
3577
  } else this._createSheet(a, n.name, i, e, n.sheetId, n.sheet, t?.[e]);
3313
3578
  } catch (e) {
3314
3579
  throw this._isLoadingSheets = !1, e;
3315
3580
  }
3316
3581
  }
3317
- this._isLoadingSheets = !1, this._tellSheets(), this._holdPivotCaches(), this._updateState({ lastId: f }), e.view.activeSheetId = u ?? d, this.setView(new Ir({ json: e.view })), this._adjustSheetNamesIfRequired(), this._listenerProtection?.();
3318
- let p = this;
3319
- this._protection = new Rr(e?.protection, this._options?.readonly), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
3320
- p._emitter.notify("onProtectionChange", { source: e });
3582
+ this._isLoadingSheets = !1, this._tellSheets(), this._holdPivotCaches(), this._holdPivotSlicers();
3583
+ for (let e of this._getSheetRefs(j.Visibility.VeryHidden)) Q(e) && e.sheet._tellPivots();
3584
+ this._updateState({ lastId: p }), e.view.activeSheetId = d ?? f, this.setView(new Ur({ json: e.view })), this._adjustSheetNamesIfRequired(), this._listenerProtection?.();
3585
+ let m = this;
3586
+ this._protection = new Gr(e?.protection, this._options?.readonly), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
3587
+ m._emitter.notify("onProtectionChange", { source: e });
3321
3588
  } }), this._emitter.notify("onLoad");
3322
3589
  } finally {
3323
3590
  a.endPersist(), i.endPersist(), r.endPersist(), n.endPersist();
@@ -3325,7 +3592,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3325
3592
  }
3326
3593
  async _startFunctions() {
3327
3594
  let e = this._scripts;
3328
- if (!e) return R.EmptyArray;
3595
+ if (!e) return z.EmptyArray;
3329
3596
  await e._load();
3330
3597
  let t = [];
3331
3598
  for (let n of e.getModules().getItems()) this._startModules.add(n), t.push(...n.getFunctions().getItems({
@@ -3336,14 +3603,14 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3336
3603
  }
3337
3604
  _createScripts(e) {
3338
3605
  let t = this;
3339
- return new wr({
3606
+ return new jr({
3340
3607
  transactions: this._transactions,
3341
3608
  json: e,
3342
3609
  workbook: t,
3343
3610
  getBuiltInFunctions: () => t._calculation?.getFunctions(),
3344
3611
  onAdd: (e, n) => {
3345
3612
  let r = t._calculation;
3346
- r.getStatus() !== Le.Status.Off && r.start().then(async () => {
3613
+ r.getStatus() !== Et.Status.Off && r.start().then(async () => {
3347
3614
  if (t._startModules.has(n)) return;
3348
3615
  let e = n.getFunctions().getItems({
3349
3616
  type: "formula",
@@ -3354,7 +3621,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3354
3621
  try {
3355
3622
  await this._calculation.getFunctions().add(n);
3356
3623
  } catch (e) {
3357
- An.error(e?.message ?? String(e), e);
3624
+ Ln.error(e?.message ?? String(e), e);
3358
3625
  }
3359
3626
  }
3360
3627
  }).catch(() => {});
@@ -3363,10 +3630,10 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3363
3630
  });
3364
3631
  }
3365
3632
  async toJSON(e) {
3366
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3633
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3367
3634
  await Promise.resolve(this._starting);
3368
3635
  let t = this.getCalculation();
3369
- t.getStatus() !== Le.Status.Off && (await t.ready(), await t._whenRequestsSettled?.()), await this._emitter.notify("onBeforeSave", { async: !0 });
3636
+ t.getStatus() !== Et.Status.Off && (await t.ready(), await t._whenRequestsSettled?.()), await this._emitter.notify("onBeforeSave", { async: !0 });
3370
3637
  let n = { sheets: [] }, r = e?.ignoreStyles ?? !1;
3371
3638
  if (!r) {
3372
3639
  let e = this._theme.toJSON();
@@ -3376,7 +3643,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3376
3643
  let e = this._scripts.toJSON();
3377
3644
  e && Object.keys(e).length > 0 && (n.modules = e);
3378
3645
  }
3379
- this._isDate1904 && (n.date1904 = !0), this._codeName && (n.codeName = this._codeName), this._updateLinks && (n.updateLinks = this._updateLinks);
3646
+ this._isDate1904 && (n.date1904 = !0), this._codeName && (n.codeName = this._codeName), this._updateLinks && (n.updateLinks = this._updateLinks), this._hiddenPivotFieldList && (n.hiddenPivotFieldList = !0);
3380
3647
  let i = this._documentProperties.toJSON();
3381
3648
  Object.keys(i).length > 0 && (n.properties = i), this._locale && (n.locale = this._locale), this._localeOverrides && (n.localeOverrides = this._localeOverrides);
3382
3649
  let a = e?.resources ?? "embed", o = a === "ignore", s = this._strings.beginPersist(), c = o ? null : this._resources.beginPersist(), l = this._styles.beginPersist(), u = this._richValues.beginPersist();
@@ -3384,19 +3651,19 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3384
3651
  let t = this._getSheetRef(this.getSelectedSheetIndex()).id, i = t, d = null, f = this._getState(), p = f.sheetRefsAll, m = f.sheetsById, h = p.length;
3385
3652
  for (let r = 0; r < h; r++) {
3386
3653
  let a = p[r], o = r + 1, s, l = m.get(a.id);
3387
- if (Z(a)) s = {
3654
+ if (Q(a)) s = {
3388
3655
  name: a.name,
3389
3656
  sheet: await a.sheet.toJSON(e)
3390
3657
  };
3391
3658
  else {
3392
- let e = l, t = c ? c.toResourceId.bind(c) : () => null, n = { part: k.toJSON(e._getPart(), t) }, r = e.getTabColor();
3659
+ let e = l, t = c ? c.toResourceId.bind(c) : () => null, n = { part: A.toJSON(e._getPart(), t) }, r = e.getTabColor();
3393
3660
  r && (n.tabColor = r.toString()), s = {
3394
3661
  name: a.name,
3395
3662
  kind: e.getKind(),
3396
3663
  sheet: n
3397
3664
  };
3398
3665
  }
3399
- a.sheetId !== void 0 && (s.sheetId = a.sheetId), a.visibility === A.Visibility.Visible ? d === null && (d = o) : s.visibility = a.visibility, a.id === t && (i = o), n.sheets.push(s);
3666
+ a.sheetId !== void 0 && (s.sheetId = a.sheetId), a.visibility === j.Visibility.Visible ? d === null && (d = o) : s.visibility = a.visibility, a.id === t && (i = o), n.sheets.push(s);
3400
3667
  }
3401
3668
  if (!r) {
3402
3669
  let e = l.toJSON();
@@ -3420,9 +3687,14 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3420
3687
  if (x.length > 0) {
3421
3688
  let e = c ? c.toResourceId.bind(c) : () => null, t = /* @__PURE__ */ new Set();
3422
3689
  for (let e of this.getPivotTables()) t.add(e.getCacheId());
3423
- let r = [];
3424
- for (let n = 0; n < x.length; n++) t.has(x[n].cacheId) && r.push(x[n].toJSON(e));
3425
- r.length > 0 && (n.pivotCaches = r);
3690
+ let r = Ze(this);
3691
+ for (let e = 0; e < r.length; e++) {
3692
+ let n = r[e].toJSON()?.pivot?.cacheId;
3693
+ n !== void 0 && t.add(n);
3694
+ }
3695
+ let i = [];
3696
+ for (let n = 0; n < x.length; n++) t.has(x[n].cacheId) && i.push(x[n].toJSON(e));
3697
+ i.length > 0 && (n.pivotCaches = i);
3426
3698
  }
3427
3699
  let S = this._people.toJSON();
3428
3700
  if (S && (n.people = S), !o) {
@@ -3454,16 +3726,16 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3454
3726
  } catch (e) {
3455
3727
  console.warn("error on close", e);
3456
3728
  }
3457
- this._ownResources, this._ownNames && this._names.close(), this._ownCalculation && this._calculation.close(), this._ownStyles, this._transactionsRemoveListener?.(), this._listenerLanguage?.(), this._listenerOrigin?.(), this._listenerOriginProvider?.(), this._ownOriginProvider && this._originProvider instanceof Un && this._originProvider.release(), this._closed = !0;
3729
+ this._ownResources, this._ownNames && this._names.close(), this._ownCalculation && this._calculation.close(), this._ownStyles, this._transactionsRemoveListener?.(), this._listenerLanguage?.(), this._listenerOrigin?.(), this._listenerOriginProvider?.(), this._ownOriginProvider && this._originProvider instanceof Xn && this._originProvider.release(), this._closed = !0;
3458
3730
  }
3459
3731
  beginCommit(e) {
3460
- if (this._closed) throw Error(W("error.workbook.modelClosed"));
3732
+ if (this._closed) throw Error(G("error.workbook.modelClosed"));
3461
3733
  return this._beginCommit(typeof e == "string" ? { description: e } : e);
3462
3734
  }
3463
3735
  doBatch(e, t) {
3464
3736
  let n = this;
3465
3737
  t = typeof t == "string" ? { description: t } : {
3466
- description: U("op.updateWorkbook"),
3738
+ description: W("op.updateWorkbook"),
3467
3739
  ...t
3468
3740
  };
3469
3741
  let i = r.bind(this._transactions, this, e);
@@ -3483,7 +3755,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3483
3755
  _getState() {
3484
3756
  return this._transactions.getState(this._id);
3485
3757
  }
3486
- _updateState(e, t = U("op.updateWorkbook"), n) {
3758
+ _updateState(e, t = W("op.updateWorkbook"), n) {
3487
3759
  if (!e) return;
3488
3760
  let r = this._beginCommit(t);
3489
3761
  try {
@@ -3504,7 +3776,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3504
3776
  get isIWorkbook() {
3505
3777
  return !0;
3506
3778
  }
3507
- }, ii = { address: null }, Z = (e) => e.sheet.getKind() === A.Kind.Worksheet, ai = class {
3779
+ }, ui = { address: null }, Q = (e) => e.sheet.getKind() === j.Kind.Worksheet, di = class {
3508
3780
  constructor() {
3509
3781
  this._readFormats = [], this._writeFormats = [], this._encryptions = [];
3510
3782
  }
@@ -3578,9 +3850,9 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3578
3850
  return !0;
3579
3851
  });
3580
3852
  }
3581
- }, oi = /* @__PURE__ */ new WeakMap(), si = (e) => !!e && typeof e == "object" && typeof e.getPath == "function" && typeof e.canWrite == "function", ci = class {
3853
+ }, fi = /* @__PURE__ */ new WeakMap(), pi = (e) => !!e && typeof e == "object" && typeof e.getPath == "function" && typeof e.canWrite == "function", mi = class {
3582
3854
  constructor() {
3583
- this._setInstalled = /* @__PURE__ */ new WeakSet(), this._backingStore = null, this._emitter = new t(this), this._registry = new ai(), this._defaultStore = new Gn(() => this.getWriteFormats(), () => this.getReadFormats());
3855
+ this._setInstalled = /* @__PURE__ */ new WeakSet(), this._backingStore = null, this._emitter = new t(this), this._registry = new di(), this._defaultStore = new Qn(() => this.getWriteFormats(), () => this.getReadFormats());
3584
3856
  }
3585
3857
  getBackingStore() {
3586
3858
  return this._backingStore ?? this._defaultStore;
@@ -3615,15 +3887,15 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3615
3887
  return this._registry.getWriteFormats(e);
3616
3888
  }
3617
3889
  getOrigin(e) {
3618
- return new G(e);
3890
+ return new K(e);
3619
3891
  }
3620
3892
  async read(e) {
3621
3893
  let t = null;
3622
3894
  if (typeof e == "string") e = { source: e };
3623
- else if (si(e)) {
3895
+ else if (pi(e)) {
3624
3896
  let n = e.getPath();
3625
3897
  if (!n) throw Error("Cannot read from an unbound origin (no path).");
3626
- Vn(e) ? e = {
3898
+ Jn(e) ? e = {
3627
3899
  source: n,
3628
3900
  asCopy: !0
3629
3901
  } : (t = e, e = { source: n });
@@ -3638,24 +3910,21 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3638
3910
  async _decodeBuffer(e, t = {}, n, r = null) {
3639
3911
  let i = t.format, a = t.ext;
3640
3912
  if (!i && !a) throw Error("Either format or file extension must be provided to determine read type.");
3641
- let o = (await this._registry.getReadFormats({
3642
- search: i,
3643
- ext: a
3644
- }))[0];
3645
- if (!o) throw new B(W("error.io.readFormatUnavailable", { format: i ?? a }));
3913
+ let o = (await this._registry.getReadFormats(i ? { search: i } : { ext: a }))[0];
3914
+ if (!o) throw new V(G("error.io.readFormatUnavailable", { format: i ?? a }));
3646
3915
  let s = n?.typedCreateWorkbookOptions, c = s ? Object.keys(s).find((e) => e.toLowerCase() === o.key.toLowerCase()) : void 0, l = {
3647
3916
  ...n,
3648
3917
  ...c === void 0 ? void 0 : s[c]
3649
3918
  };
3650
3919
  delete l.typedCreateWorkbookOptions, delete l.source, delete l.asCopy;
3651
- let u = r ?? new G(t.absolutePath ?? null, {
3920
+ let u = r ?? new K(t.absolutePath ?? null, {
3652
3921
  name: t.name ?? null,
3653
3922
  format: o.key,
3654
3923
  size: t.size ?? null,
3655
3924
  lastModified: t.lastModified ?? null,
3656
3925
  canWrite: t.canWrite ?? !1
3657
3926
  });
3658
- r instanceof G && r.update({
3927
+ r instanceof K && r.update({
3659
3928
  format: o.key,
3660
3929
  size: t.size ?? null,
3661
3930
  lastModified: t.lastModified ?? null
@@ -3689,7 +3958,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3689
3958
  }
3690
3959
  async _decrypt(e, t, n) {
3691
3960
  let r = await this._registry.detectEncryption(e);
3692
- if (t instanceof G && t.update({ encryption: r ? r.key : null }), !r) return {
3961
+ if (t instanceof K && t.update({ encryption: r ? r.key : null }), !r) return {
3693
3962
  bytes: e,
3694
3963
  password: null
3695
3964
  };
@@ -3697,7 +3966,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3697
3966
  try {
3698
3967
  return i = await r.decode(e, t), !0;
3699
3968
  } catch (e) {
3700
- if (!(e instanceof On)) throw e;
3969
+ if (!(e instanceof Fn)) throw e;
3701
3970
  return !1;
3702
3971
  }
3703
3972
  };
@@ -3707,7 +3976,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3707
3976
  };
3708
3977
  if (!n?.onPassword) {
3709
3978
  let e = t.getName();
3710
- throw new Mn(e ? W("error.io.passwordRequired", { name: e }) : W("error.io.passwordRequiredUnnamed"));
3979
+ throw new zn(e ? G("error.io.passwordRequired", { name: e }) : G("error.io.passwordRequiredUnnamed"));
3711
3980
  }
3712
3981
  let o = await Promise.resolve(n.onPassword({
3713
3982
  origin: t,
@@ -3719,16 +3988,16 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3719
3988
  bytes: i,
3720
3989
  password: o
3721
3990
  };
3722
- throw new On(W("error.io.passwordIncorrect"));
3991
+ throw new Fn(G("error.io.passwordIncorrect"));
3723
3992
  }
3724
3993
  async writeArrayBuffer(e, t) {
3725
3994
  if (!t?.format) throw Error("A format must be specified to write to an ArrayBuffer (e.g. { format: 'xlsx' }).");
3726
3995
  let n = (await this._registry.getWriteFormats({ search: t.format }))[0];
3727
- if (!n) throw new B(W("error.io.writeFormatUnavailable", { format: t.format }));
3996
+ if (!n) throw new V(G("error.io.writeFormatUnavailable", { format: t.format }));
3728
3997
  return this._writeArrayBuffer(e, n, t);
3729
3998
  }
3730
3999
  async write(e, t, n) {
3731
- return typeof t == "string" || si(t) ? this._write(e, t, !1, n) : this._write(e, e?.getOrigin?.(), !0, t ?? n);
4000
+ return typeof t == "string" || pi(t) ? this._write(e, t, !1, n) : this._write(e, e?.getOrigin?.(), !0, t ?? n);
3732
4001
  }
3733
4002
  async writeAs(e, t, n) {
3734
4003
  if (!t) throw Error("A target must be provided for writeAs (use write(workbook) for a plain save).");
@@ -3738,13 +4007,13 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3738
4007
  if (!e) throw Error("Workbook must be provided.");
3739
4008
  if (!e.isIWorkbook) throw Error("Invalid workbook model provided. Must be an instance of IWorkbook.");
3740
4009
  let i = typeof t == "string" ? this.getOrigin(t) : t, a = i.getFormat(), o;
3741
- if ((r?.format || a) && (o = (await this._registry.getWriteFormats({ search: r?.format ?? a ?? void 0 }))[0]), o || i.getPath() && i.canWrite() && i.getExtension() || (o = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !o) throw new B(W("error.io.writeFormatUnresolved"));
4010
+ if ((r?.format || a) && (o = (await this._registry.getWriteFormats({ search: r?.format ?? a ?? void 0 }))[0]), o || i.getPath() && i.canWrite() && i.getExtension() || (o = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !o) throw new V(G("error.io.writeFormatUnresolved"));
3742
4011
  let s = i.getExtension();
3743
4012
  if (r?.format && s && i.getPath() && i.canWrite() && !o.exts.includes(s)) {
3744
4013
  let e = (await this._registry.getWriteFormats({ ext: s }))[0];
3745
4014
  if (e && e.key !== o.key) {
3746
4015
  let e = i.getPath().split(/[/\\]/).pop();
3747
- throw new B(W("error.io.writeFormatMismatch", {
4016
+ throw new V(G("error.io.writeFormatMismatch", {
3748
4017
  format: r.format,
3749
4018
  file: e
3750
4019
  }));
@@ -3752,16 +4021,16 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3752
4021
  }
3753
4022
  if (typeof t == "string") {
3754
4023
  let e = i.getPath();
3755
- i = new G(E(e) ? e : `${e}.${o.exts[0]}`, { format: o.key });
4024
+ i = new K(k(e) ? e : `${e}.${o.exts[0]}`, { format: o.key });
3756
4025
  }
3757
- let c = i.getEncryption(), l = e.getOrigin?.(), u = (i instanceof G ? i.getPassword() : null) ?? (l instanceof G ? l.getPassword() : null), d = i.isEncrypted() || (l?.isEncrypted() ?? !1), f = r?.password === void 0 ? u ?? (d ? void 0 : null) : r.password, p = null;
4026
+ let c = i.getEncryption(), l = e.getOrigin?.(), u = (i instanceof K ? i.getPassword() : null) ?? (l instanceof K ? l.getPassword() : null), d = i.isEncrypted() || (l?.isEncrypted() ?? !1), f = r?.password === void 0 ? u ?? (d ? void 0 : null) : r.password, p = null;
3758
4027
  if (f === void 0) {
3759
4028
  if (d) {
3760
4029
  let e = i.getName();
3761
- throw new Mn(e ? W("error.io.passwordRequiredSave", { name: e }) : W("error.io.passwordRequiredSaveUnnamed"));
4030
+ throw new zn(e ? G("error.io.passwordRequiredSave", { name: e }) : G("error.io.passwordRequiredSaveUnnamed"));
3762
4031
  }
3763
- } else if (f !== null && (p = await this._registry.getEncryption(c), !p)) throw new B(W("error.io.encryptionUnavailable"));
3764
- let m = `${i.getName() ?? W("workbook.defaultName")}.${o.exts[0]}`, h = r?.progress, g = !i.getPath() || !i.canWrite() || !!r?.prompt, _ = !1, v = this, y = null, b = [], x = {
4032
+ } else if (f !== null && (p = await this._registry.getEncryption(c), !p)) throw new V(G("error.io.encryptionUnavailable"));
4033
+ let m = `${i.getName() ?? G("workbook.defaultName")}.${o.exts[0]}`, h = r?.progress, g = !i.getPath() || !i.canWrite() || !!r?.prompt, _ = !1, v = this, y = null, b = [], x = {
3765
4034
  workbook: e,
3766
4035
  format: o,
3767
4036
  origin: i,
@@ -3786,7 +4055,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3786
4055
  }))(h, l), d = await v._writeArrayBuffer(e, c, {
3787
4056
  ...r,
3788
4057
  progress: u
3789
- }), m = oi.get(s);
4058
+ }), m = fi.get(s);
3790
4059
  if (l.some((e) => !m?.has(e.message)) && r?.onWarnings) {
3791
4060
  let t = await Promise.resolve(r.onWarnings({
3792
4061
  workbook: e,
@@ -3804,12 +4073,12 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3804
4073
  let t = this.getBackingStore();
3805
4074
  if (!t.write) throw Error("The active backing store is read-only (no write implementation).");
3806
4075
  if (S = await t.write(x), S) {
3807
- if (f !== void 0 && S instanceof G && (S.setPassword(f), S.update({ encryption: p ? p.key : null })), b.length) {
3808
- let e = oi.get(S) ?? /* @__PURE__ */ new Set();
4076
+ if (f !== void 0 && S instanceof K && (S.setPassword(f), S.update({ encryption: p ? p.key : null })), b.length) {
4077
+ let e = fi.get(S) ?? /* @__PURE__ */ new Set();
3809
4078
  for (let t of b) e.add(t.message);
3810
- oi.set(S, e);
4079
+ fi.set(S, e);
3811
4080
  }
3812
- n && S !== e.getOrigin() && Vn(e.getOrigin())?.setOrigin(S);
4081
+ n && S !== e.getOrigin() && Jn(e.getOrigin())?.setOrigin(S);
3813
4082
  let t = y ?? e.getTransactions?.()?.getCurrentCommit() ?? null;
3814
4083
  this._emitter.notify("onWrite", {
3815
4084
  params: {
@@ -3824,12 +4093,12 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3824
4093
  h?.onComplete && await Promise.resolve(h.onComplete(S));
3825
4094
  } catch (e) {
3826
4095
  let t = e instanceof Error ? e : Error(String(e));
3827
- throw h?.onError && await Promise.resolve(h.onError(t)), h?.onComplete && await Promise.resolve(h.onComplete(null)), t instanceof B ? t : Error(W("error.io.writeFailed", { reason: t.message }), { cause: e });
4096
+ throw h?.onError && await Promise.resolve(h.onError(t)), h?.onComplete && await Promise.resolve(h.onComplete(null)), t instanceof V ? t : Error(G("error.io.writeFailed", { reason: t.message }), { cause: e });
3828
4097
  }
3829
4098
  return S;
3830
4099
  }
3831
4100
  _stripExtension(e) {
3832
- let t = E(e);
4101
+ let t = k(e);
3833
4102
  return t ? e.slice(0, e.length - t.length - 1) : e;
3834
4103
  }
3835
4104
  _baseName(e) {
@@ -3841,7 +4110,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3841
4110
  if (!t) throw Error("A write format must be provided.");
3842
4111
  let r = t.handler;
3843
4112
  if (!r) throw Error(`Unable to resolve a write handler for '${t.key}'.`);
3844
- return r(e, {
4113
+ return jt(t.key) || await D.assertUsable("exports", 0), r(e, {
3845
4114
  ...n,
3846
4115
  format: t.key
3847
4116
  });
@@ -3849,24 +4118,24 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3849
4118
  async _readArrayBuffer(e, t, n) {
3850
4119
  if (!e) throw Error("ArrayBuffer must be specified.");
3851
4120
  if (!t) throw Error("format must be specified.");
3852
- if (e.byteLength === 0) return new ri(n?.createWorkbookOptions);
4121
+ if (e.byteLength === 0) return new li(n?.createWorkbookOptions);
3853
4122
  let r = t.handler;
3854
4123
  if (!r) throw Error(`Unable to resolve a read handler for '${t.key}'.`);
3855
4124
  let i;
3856
4125
  try {
3857
4126
  i = await r(e, n);
3858
4127
  } catch (e) {
3859
- throw e instanceof B ? e : new B(W("error.io.readFailed", {
4128
+ throw e instanceof V ? e : new V(G("error.io.readFailed", {
3860
4129
  format: t.description ?? t.key,
3861
4130
  reason: e?.message ?? String(e)
3862
4131
  }), { cause: e });
3863
4132
  }
3864
- return await Nt(), i;
4133
+ return await Ke(), i;
3865
4134
  }
3866
4135
  get isIWorkbookIO() {
3867
4136
  return !0;
3868
4137
  }
3869
- }, li = new ci(), ui = class {
4138
+ }, hi = new mi(), gi = class {
3870
4139
  constructor() {
3871
4140
  this._buffer = null, this._formatKey = null;
3872
4141
  }
@@ -3880,7 +4149,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3880
4149
  async read(e) {
3881
4150
  return this._buffer ? e.decode(this._buffer, { format: this._formatKey ?? void 0 }) : null;
3882
4151
  }
3883
- }, di = "locales", fi = "fonts", pi = {
4152
+ }, _i = "locales", vi = "fonts", yi = {
3884
4153
  suffix: ".msg.json",
3885
4154
  async extract(e) {
3886
4155
  let t = e.relPath.split("/");
@@ -3890,7 +4159,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3890
4159
  } : null;
3891
4160
  },
3892
4161
  place: (e, t) => t ? `${t}/${e}` : null
3893
- }, mi = [
4162
+ }, bi = [
3894
4163
  ".woff2",
3895
4164
  ".woff",
3896
4165
  ".ttf",
@@ -3900,7 +4169,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3900
4169
  ].map((e) => ({
3901
4170
  suffix: e,
3902
4171
  place: (e, t) => t ? `${t}/${e}` : e
3903
- })), hi = {
4172
+ })), xi = {
3904
4173
  suffix: ".metrics.json",
3905
4174
  async extract(e) {
3906
4175
  let t = await e.readJson();
@@ -3911,13 +4180,13 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3911
4180
  } : null;
3912
4181
  },
3913
4182
  place: (e, t) => t ? `${t}/${e}` : e
3914
- }, gi = [{
3915
- kind: di,
3916
- files: [pi]
4183
+ }, Si = [{
4184
+ kind: _i,
4185
+ files: [yi]
3917
4186
  }, {
3918
- kind: fi,
4187
+ kind: vi,
3919
4188
  files: [
3920
- hi,
4189
+ xi,
3921
4190
  {
3922
4191
  suffix: ".hinted.json",
3923
4192
  async extract(e) {
@@ -3929,7 +4198,7 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3929
4198
  hinted: !0
3930
4199
  } : null;
3931
4200
  },
3932
- place: hi.place
4201
+ place: xi.place
3933
4202
  },
3934
4203
  {
3935
4204
  suffix: ".rows.json",
@@ -3942,40 +4211,79 @@ var Qr, $r = "workbook.activeSheet", ei = class e extends zt {
3942
4211
  rows: !0
3943
4212
  } : null;
3944
4213
  },
3945
- place: hi.place
4214
+ place: xi.place
3946
4215
  },
3947
- ...mi
4216
+ ...bi
3948
4217
  ]
3949
4218
  }];
3950
- async function _i(e, t) {
3951
- let { Chart: n } = await import("./r_EZapMBdyS4gUd-.mjs");
4219
+ async function Ci(e, t) {
4220
+ let { Chart: n } = await import("./HV0FkJ6k3Ils318J.mjs");
3952
4221
  return new n({
3953
4222
  json: e,
3954
4223
  getStyles: t?.getStyles
3955
4224
  });
3956
4225
  }
3957
- Qr ||= {};
3958
- var Q = null;
3959
- function vi() {
3960
- if (!Q) {
3961
- let e = import("./oSCy1X5CJ1iYtGDp.mjs").then((e) => e.loadScriptingDeclarations());
3962
- e.catch(() => {
3963
- Q = null;
3964
- }), Q = e;
3965
- }
3966
- return Q;
3967
- }
3968
- var yi, bi, xi, $ = null;
3969
- function Si() {
4226
+ var wi, Ti = {
4227
+ showRowHeaders: !0,
4228
+ showColumnHeaders: !0,
4229
+ showRowStripes: !1,
4230
+ showColumnStripes: !1,
4231
+ showLastColumn: !0
4232
+ }, Ei = class extends Bt {
4233
+ constructor(e, t, n, r) {
4234
+ super(e, t?.getProperties() ?? { name: "" }, {
4235
+ rowStart: 0,
4236
+ colStart: 0,
4237
+ rowEnd: r - 1,
4238
+ colEnd: 4
4239
+ }), this._options = n, this._rows = r;
4240
+ }
4241
+ _isSubheading(e) {
4242
+ return e > 0 && e < this._rows - 1 && (e - 1) % 3 == 0;
4243
+ }
4244
+ _coveringAt(e, t) {
4245
+ if (e < 0 || e >= this._rows || t < 0 || t >= 5) return [];
4246
+ let { showRowHeaders: n, showColumnHeaders: r, showRowStripes: i, showColumnStripes: a, showLastColumn: o } = this._options, s = ["wholeTable"];
4247
+ return a && s.push(t % 2 == 0 ? "firstColumnStripe" : "secondColumnStripe"), i && s.push(e % 2 == 0 ? "firstRowStripe" : "secondRowStripe"), e === 0 ? (t === 0 && n && s.push("firstColumn"), r && s.push("headerRow"), t === 0 && n && r && s.push("firstHeaderCell")) : (t === 0 && n && s.push("firstColumn"), this._isSubheading(e) && n && s.push("firstRowSubheading")), t === 4 && o && s.push("lastColumn"), e === this._rows - 1 && s.push("totalRow"), s;
4248
+ }
4249
+ _bandOf(e, t, n) {
4250
+ return n === "firstRowSubheading" ? `${e}` : "";
4251
+ }
4252
+ }, Di = (e, t, n, r = 5) => {
4253
+ let i = Math.max(3, Math.floor(r)), a = new Ei(e, t, n ?? Ti, i);
4254
+ return {
4255
+ rows: i,
4256
+ columns: 5,
4257
+ getStyleAt: (t, n) => d(void 0, e, a, {
4258
+ rowStart: t,
4259
+ colStart: n,
4260
+ rowEnd: t,
4261
+ colEnd: n
4262
+ })
4263
+ };
4264
+ };
4265
+ wi ||= {};
4266
+ var $ = null;
4267
+ function Oi() {
3970
4268
  if (!$) {
3971
- let e = import("./oSCy1X5CJ1iYtGDp.mjs").then((e) => e.loadScriptingApi()).then((e) => JSON.parse(e));
4269
+ let e = import("./ad9PX897hYE4Srkc.mjs").then((e) => e.loadScriptingDeclarations());
3972
4270
  e.catch(() => {
3973
4271
  $ = null;
3974
4272
  }), $ = e;
3975
4273
  }
3976
4274
  return $;
3977
4275
  }
3978
- yi ||= {}, (bi ||= {}).Type = {
4276
+ var ki, Ai, ji, Mi = null;
4277
+ function Ni() {
4278
+ if (!Mi) {
4279
+ let e = import("./ad9PX897hYE4Srkc.mjs").then((e) => e.loadScriptingApi()).then((e) => JSON.parse(e));
4280
+ e.catch(() => {
4281
+ Mi = null;
4282
+ }), Mi = e;
4283
+ }
4284
+ return Mi;
4285
+ }
4286
+ ki ||= {}, (Ai ||= {}).Type = {
3979
4287
  Button: "button",
3980
4288
  CheckBox: "checkBox",
3981
4289
  OptionButton: "optionButton",
@@ -3988,12 +4296,12 @@ yi ||= {}, (bi ||= {}).Type = {
3988
4296
  EditBox: "editBox",
3989
4297
  Dialog: "dialog",
3990
4298
  Unknown: "formControl"
3991
- }, (xi ||= {}).DropStyle = {
4299
+ }, (ji ||= {}).DropStyle = {
3992
4300
  Combo: "combo",
3993
4301
  ComboEdit: "comboEdit",
3994
4302
  Simple: "simple"
3995
4303
  };
3996
- var Ci = class extends S {
4304
+ var Pi = class extends Ot {
3997
4305
  constructor(e) {
3998
4306
  super(e);
3999
4307
  }
@@ -4006,8 +4314,8 @@ var Ci = class extends S {
4006
4314
  colEnd: (e?.size?.width ?? 5) - 1,
4007
4315
  rowEnd: (e?.size?.height ?? 5) - 1
4008
4316
  },
4009
- getRanges: (e) => new m(null)
4317
+ getRanges: (e) => new h(null)
4010
4318
  }, super._initializeOptions(e);
4011
4319
  }
4012
- }, wi = "0.8.0-beta.14", Ti = "2026-11-04T17:50:50.158Z";
4013
- export { $e as AbstractCollection, i as AbstractMovableContent, ie as AddressUtils, ui as ArrayBackingStore, w as AutoFill, Ti as BUILD_DATE, We as CellControlRegistry, Re as CellImage, x as CellImageKind, s as ChartElementSelection, Cn as ChartKinds, oe as CheckboxKind, un as Color, ye as Condition, Kt as DateUtils, ci as DefaultWorkbookIO, Ht as EXTERNAL_LINK_PATH_REL_TYPE, Nr as ExternalRangeClipboardItem, fi as FONTS_KIND, Or as Fetcher, $t as FontUtils, Se as FormulaText, dr as FunctionDeclarations, Me as GeomUtils, v as Hyperlink, Te as HyperlinkKind, be as IAnchored, gn as IBorders, Le as ICalculation, qe as ICell, cr as ICellHeaderRange, l as ICellRange, sr as ICellRanges, vn as ICellStyle, hn as IColor, vt as ICondition, Ke as IConditionalFormat, X as ICustomProperty, He as IDataValidation, xi as IDropDown, ln as IEffect, yn as IFill, N as IFont, xe as IFontCollection, M as IFontStyle, bi as IFormControl, Xt as IGeometry, yi as IMovable, gt as IPageLayout, Qr as IPicture, or as IResource, mt as IRichDataKind, lt as IScript, fn as IShape, A as ISheet, f as ISlicerStyle, zn as ISort, pn as IStroke, re as ITable, Ge as ITableStyle, Rt as IText, P as ITextFrame, ar as ITheme, de as IThemeCollection, Pn as IWorkbookIO, yr as IWorkbookView, Yt as IWorksheetView, di as LOCALES_KIND, le as LicenseManager, nt as MovableContentRegistry, Ve as NamedStyleCollection, F as NumberFormat, Sn as PaintUtils, Sr as PersonCollection, Mr as RangeClipboardItem, Xn as RectAlignment, Gt as Registry, te as Resource, ke as ResourceCollection, h as RichArray, Bt as RichArrayKind, Ot as RichDataCollection, Ut as RichDataRegistry, Ie as RichRecord, _t as RichText, c as RichTextKind, gi as SHEETXL_RESOURCE_KINDS, dn as SYSTEM_COLOR_CSS_PREFIX, tn as ShapeStyleUtils, De as SimpleFontFace, Ue as SlicerStyleCollection, et as Sort, Ce as StringCollection, Jt as StyleCollection, Ci as Table, ae as TableStyleCollection, wt as TextRotation, st as TextStacked, xt as TextUtils, pe as Theme, Dt as ThemeCollection, n as TransactionConflictError, Rn as TransactionSaveStateManager, a as TransactionStore, Fn as TransactionUndoManager, Ct as Tuple, wi as VERSION, ri as Workbook, li as WorkbookIO, G as WorkbookOrigin, Ir as WorkbookView, T as Worksheet, ir as builtInStyleNameDisplay, b as createCellRangeCounts, _i as createChart, Be as externalBookClosedName, C as externalBookFileName, y as externalBookLocation, Ee as externalBookOpenName, fe as findLabel, fr as getBuiltInFunctionNames, ce as getLanguagePack, mn as getLocaleProfile, Et as getScriptRuntime, Si as getScriptingApi, vi as getScriptingDeclarations, he as localizeBoolean, Ne as localizeErrorLabel, _n as makeLocaleProfile, Ye as normalizeLabel, qt as parseBooleanLocal, d as parseErrorLocal, yt as parseExternalScope, pr as parseFormulaLiteral, ee as registerSdkLocales, u as sourceEntryFromPath, St as withScriptRuntime };
4320
+ }, Fi = "0.8.0-beta.16", Ii = "2026-11-05T02:02:31.271Z";
4321
+ export { pt as AbstractCollection, i as AbstractMovableContent, ae as AddressUtils, gi as ArrayBackingStore, te as AutoFill, Ii as BUILD_DATE, ze as CellControlRegistry, Xe as CellImage, Kt as CellImageKind, l as ChartElementSelection, An as ChartKinds, se as CheckboxKind, bn as Color, Qt as Condition, nt as DateUtils, mi as DefaultWorkbookIO, Yt as EXTERNAL_LINK_PATH_REL_TYPE, Br as ExternalRangeClipboardItem, vi as FONTS_KIND, Fr as Fetcher, gn as FontUtils, Pe as FormulaText, vr as FunctionDeclarations, De as GeomUtils, en as Hyperlink, et as HyperlinkKind, Jt as IAnchored, hn as IBorders, Et as ICalculation, Ue as ICell, hr as ICellHeaderRange, je as ICellRange, mr as ICellRanges, En as ICellStyle, Tn as IColor, Zt as ICondition, Ve as IConditionalFormat, Z as ICustomProperty, Ie as IDataValidation, ji as IDropDown, yn as IEffect, Dn as IFill, P as IFont, Me as IFontCollection, N as IFontStyle, Ai as IFormControl, rn as IGeometry, ki as IMovable, bt as IPageLayout, wi as IPicture, Re as IPivotTable, pr as IResource, g as IRichDataKind, st as IScript, Sn as IShape, j as ISheet, _e as ISlicerStyle, Kn as ISort, Cn as IStroke, pe as ITable, le as ITableStyle, Nt as IText, I as ITextFrame, fr as ITheme, p as IThemeCollection, Vn as IWorkbookIO, Er as IWorkbookView, nn as IWorksheetView, _i as LOCALES_KIND, D as LicenseManager, He as MovableContentRegistry, ne as NamedStyleCollection, F as NumberFormat, kn as PaintUtils, kr as PersonCollection, zr as RangeClipboardItem, rr as RectAlignment, Dt as Registry, b as Resource, C as ResourceCollection, dt as RichArray, lt as RichArrayKind, It as RichDataCollection, Mt as RichDataRegistry, Tt as RichRecord, Xt as RichText, Ae as RichTextKind, Si as SHEETXL_RESOURCE_KINDS, xn as SYSTEM_COLOR_CSS_PREFIX, un as ShapeStyleUtils, y as SimpleFontFace, ye as SlicerStyleCollection, ct as Sort, Ne as StringCollection, yt as StyleCollection, Pi as Table, we as TableStyleCollection, tt as TextRotation, Vt as TextStacked, wt as TextUtils, Oe as Theme, tn as ThemeCollection, n as TransactionConflictError, Gn as TransactionSaveStateManager, a as TransactionStore, Hn as TransactionUndoManager, We as Tuple, Fi as VERSION, li as Workbook, hi as WorkbookIO, K as WorkbookOrigin, Ur as WorkbookView, T as Worksheet, dr as builtInStyleNameDisplay, S as createCellRangeCounts, Ci as createChart, Fe as externalBookClosedName, ee as externalBookFileName, x as externalBookLocation, Ce as externalBookOpenName, de as findLabel, yr as getBuiltInFunctionNames, xt as getLanguagePack, _n as getLocaleProfile, Ut as getScriptRuntime, Ni as getScriptingApi, Oi as getScriptingDeclarations, u as localizeBoolean, vt as localizeErrorLabel, wn as makeLocaleProfile, qe as normalizeLabel, ge as parseBooleanLocal, ve as parseErrorLocal, Ct as parseExternalScope, br as parseFormulaLiteral, Ee as pivotBoxOf, c as pivotCellFormatsOf, at as pivotControlsIn, Di as pivotStylePreviewOf, xe as registerSdkLocales, f as sourceEntryFromPath, At as withScriptRuntime };