@sheetxl/sdk 0.8.0-beta.11 → 0.8.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm/{BpgskG1Er_lGQ_yS.mjs → -Jx-jNHmtIQQfLvK.mjs} +1 -1
- package/browser/esm/{BLoUBId2xZpXAK_H.mjs → 2WuhYrIpYmOR5H73.mjs} +15 -15
- package/browser/esm/{Ctjb0SsxV4K4MMqG.mjs → 2mIwPy2D2JUX-9wx.mjs} +2 -2
- package/browser/esm/{CkxWugaJFjDGZNZ-.mjs → B3wf5vZCsWfWsDbj.mjs} +1 -1
- package/browser/esm/{BjkCiv5Jz6WYKZeu.mjs → BIHrHjRGWVlJglcp.mjs} +2 -2
- package/browser/esm/{BtvLTTfSBdAKplVG.mjs → BTFBedJMRWGvZyCE.mjs} +1 -1
- package/browser/esm/{C4MqfLn9Dm-l3OIk.mjs → BdCJNawfifyPupCP.mjs} +1 -1
- package/browser/esm/{CV5EGEjG5_-CPpP0.mjs → Bg5Di9GLNAkbqQ1P.mjs} +3 -3
- package/browser/esm/{C2VbEI_XVAoseAwa.mjs → BnC4-27Igwb8oDf2.mjs} +2 -2
- package/browser/esm/{CQYjO777cmAznUzK.mjs → Bt8_m94tBdks209L.mjs} +1 -1
- package/browser/esm/{C16ycKja6zG0crV_.mjs → BudSIfXBAsTxvu-K.mjs} +17836 -15712
- package/browser/esm/{DvAaxH6z_tGvrRzl.mjs → C9u8FUewte5ugUjH.mjs} +686 -686
- package/browser/esm/{DEiPS3Dr-s4fPbVZ.mjs → CBYMTDzMf1Vh7pkw.mjs} +1 -1
- package/browser/esm/{Dyq_ivuHvlXLwPCl.mjs → CNdjyofiRu6CYOrr.mjs} +1106 -1102
- package/browser/esm/{PcHFjNzQsE54POri.mjs → CRkYR-siY2C994KV.mjs} +1 -1
- package/browser/esm/{C5E6zSGAALWf61n4.mjs → CTe2qfmIUEad6FJv.mjs} +2 -2
- package/browser/esm/{BoV6zPBnfqCBCqZ7.mjs → CUzYuYTTGsChC_kZ.mjs} +3841 -3148
- package/browser/esm/CdEO8CEee6lEhabA.mjs +117 -0
- package/browser/esm/{S2dNNx1a5ydRnARM.mjs → CfRqiPDg6RBTg1EN.mjs} +2 -2
- package/browser/esm/{ClbvFbFzFzXLBKNN.mjs → CndRBvVfQUJIYRRj.mjs} +50 -50
- package/browser/esm/{BnG31I6Oj_HEtSPS.mjs → CwOPLXU3-9ZHGyOT.mjs} +1 -1
- package/browser/esm/{CHU6iu_WGlm7fLET.mjs → Cxjxk0ncRKx80I-w.mjs} +1 -1
- package/browser/esm/D2RZh0O9neOsyLAE.mjs +281 -0
- package/browser/esm/{BkBhLS0l6z8sxI6D.mjs → D64dM68B1pKYFzdP.mjs} +2 -2
- package/browser/esm/{BVDiOXGMc5_FMGfy.mjs → D9xNz46kAfXMZzp4.mjs} +2 -2
- package/browser/esm/{zlLuW405RSguy4Kn.mjs → DK899HhWX1HINMC1.mjs} +53 -53
- package/browser/esm/{B7aUIvgUjncMMD_i.mjs → DPhGQLNGmDZwODwJ.mjs} +5 -4
- package/browser/esm/{gssVX_FH1XFN-twD.mjs → DVroRnhi-5IDXNgM.mjs} +1 -1
- package/{node/esm/CZICGK_ss0HoGHCP.mjs → browser/esm/DZiivy0NmO1Vnyzk.mjs} +2 -2
- package/browser/esm/{ClPfI4lODvCece29.mjs → DgrAuRD2qr2DvFeJ.mjs} +61 -61
- package/browser/esm/{CU3DmJ-YnVVrC1_k.mjs → DobHLF6VjHr7Xi40.mjs} +1 -1
- package/browser/esm/{CaB7J-xgfKO2uAkG.mjs → DwZCT7DZiiXoTweg.mjs} +2 -2
- package/browser/esm/{BMyDRQ716j79h_bH.mjs → DwwR3O2sEZApPSTF.mjs} +6 -6
- package/browser/esm/{DLLE0FZNsKxbBzRn.mjs → Tah7cnFb_HNZdLtj.mjs} +45 -45
- package/browser/esm/{Dlmig06rIo7cInRk.mjs → fXWUMDhZ5yMSO629.mjs} +1 -1
- package/browser/esm/{DWNzqw7DUKwoxjri.mjs → hCQJcmIzPDxDEv2q.mjs} +2 -2
- package/browser/esm/index.mjs +679 -542
- package/browser/esm/{BFagR2JeWs74iAG3.mjs → qO-ujUrgq6H3TQix.mjs} +1 -1
- package/browser/esm/w6Jea0TiclPrYZ2M.mjs +1703 -0
- package/browser/esm/yuhcOYw6SHQ-RCm3.mjs +114 -0
- package/node/esm/-TA0MneBDKdGhsib.mjs +8668 -0
- package/node/esm/{B21JjOLghRoDOrkx.mjs → B-HUPAcqvK0eeeCz.mjs} +1 -1
- package/node/esm/{DNRhGK-8Tr9xcRyc.mjs → BL2iiEoqxDEV2Xrg.mjs} +3 -3
- package/node/esm/{D1TKBVmoKGAXf37B.mjs → BNXLOEddJ6O9gYws.mjs} +2 -2
- package/node/esm/{BrCKGFRsX_ezFJ4B.mjs → BSvOluusoDM4z_dx.mjs} +15 -15
- package/node/esm/{BIwObuhTJYf0jpUa.mjs → BskP3b8vUoIOGLY6.mjs} +2 -2
- package/node/esm/{2Kihw_-5lVTEnwMa.mjs → Btw4148Ot8ifhNc1.mjs} +1 -1
- package/node/esm/{BqiexuA89caYnAPz.mjs → C14-R6tifRh7pc0p.mjs} +1 -1
- package/node/esm/{DUTskXCXref-IJnI.mjs → C99zzq8DImQXi4BQ.mjs} +47 -47
- package/node/esm/{D8zEN-6ZdDqDvTxM.mjs → CBuEu5Jk-LfaDy-H.mjs} +61 -61
- package/node/esm/{yavzZOiZW_EjG9lE.mjs → CG-qBU5BAaVz7e-P.mjs} +1 -1
- package/node/esm/CPI58duc0j0a-HpJ.mjs +115 -0
- package/node/esm/{CCN5vD410obwdz38.mjs → CRt3vXe6YmXzqk3H.mjs} +15 -14
- package/node/esm/{CzXT00vrQa1_gvW9.mjs → C_aL7CGS1lrNn1Ng.mjs} +1 -1
- package/node/esm/{CZiqiay42tFTrLI4.mjs → C_xf5Bz30VqiJjXn.mjs} +1 -1
- package/node/esm/{BIRq1kT7lLRzns9t.mjs → CiIymQN6aJCul62g.mjs} +9 -9
- package/node/esm/{CNCNJNg890KdgkWh.mjs → Ci_zLYmCD7e-C79O.mjs} +1 -1
- package/{browser/esm/D5np__Jb1euAyaLw.mjs → node/esm/CkRYLed8Mmn3giNg.mjs} +2 -2
- package/node/esm/D3ptRKzASqBut1DE.mjs +117 -0
- package/node/esm/{cGwrLA1RCE-WhJ7w.mjs → D4ROK9UwDpS6jO3Z.mjs} +1 -1
- package/node/esm/{mFiBSM7XgBHV9AY7.mjs → D8hO07ToAibIuniw.mjs} +1535 -1531
- package/node/esm/{CDHdgJXH2vS71WMc.mjs → DUTmDHbFbhLDT4F3.mjs} +1 -1
- package/node/esm/{CGp6VZL-gZa9Uezx.mjs → DV5CU37aEbFbWFL0.mjs} +1 -1
- package/node/esm/{De2IONBxQhz-Qbyh.mjs → DdoiuKg9BKubtF1V.mjs} +1 -1
- package/node/esm/{Db0v7zXNnyjBIjjI.mjs → DggQ23jKMpwhENfa.mjs} +2 -2
- package/node/esm/{CwePQwTILHHjGDkZ.mjs → DhS6yWjrrSNIJMsn.mjs} +204 -204
- package/node/esm/{D_t5AUxSm7_icjzq.mjs → DhTya_mhmN53vskv.mjs} +1 -1
- package/node/esm/{DOU54VsOjG-m-NyQ.mjs → Dn1M7YWi25DeeYUb.mjs} +1 -1
- package/node/esm/{DkwIPzKc3UwdUIfM.mjs → DrCf6ITcBhVOFpRj.mjs} +6 -6
- package/node/esm/{D2KBymQJd1XhpeQD.mjs → DxazKtROyaI51dWl.mjs} +1 -1
- package/node/esm/{D6e2z7eZpxOJXHc7.mjs → Q_S1g46ZOTrdhTae.mjs} +1 -1
- package/node/esm/{OVfaSb506tNSIvbv.mjs → Vocy-I9dKzZMr0Ct.mjs} +19038 -16822
- package/node/esm/ZXPFcsT2zrALCZux.mjs +289 -0
- package/node/esm/{857CIBgQgGpnqrXk.mjs → eimUGjiIP-b8HiM6.mjs} +55 -55
- package/node/esm/{Bbf1Pm9Gk7YpLTvg.mjs → icn2nX5Z8e_3mNAv.mjs} +1 -1
- package/node/esm/index.mjs +740 -603
- package/node/esm/{Ct3h15sCus4Tgt6M.mjs → lGJ42sHqg5if2bba.mjs} +624 -616
- package/node/esm/{CdJHUJSBRHZoryPe.mjs → pYtP7wPyS96NQyXS.mjs} +59 -59
- package/package.json +6 -6
- package/resources/locales/de/model.msg.json +8 -2
- package/resources/locales/en/model.msg.json +9 -2
- package/types/scripting-api.json +10619 -10446
- package/types/scripting-enums.json +20 -1
- package/types/scripting.d.ts +1233 -296
- package/types/src/{sheet → anomalies}/_Anomalies.d.ts +3 -3
- package/types/src/anomalies/_FocusTable.d.ts +11 -0
- package/types/src/{sheet/_AnomalyFormulaChecks.d.ts → anomalies/_FormulaChecks.d.ts} +10 -2
- package/types/src/{sheet/_AnomalyLabelChecks.d.ts → anomalies/_LabelChecks.d.ts} +1 -1
- package/types/src/anomalies/_LiteralChecks.d.ts +35 -0
- package/types/src/anomalies/_SeriesChecks.d.ts +13 -0
- package/types/src/calculation/Calculation.d.ts +47 -9
- package/types/src/calculation/ExternalBookBindings.d.ts +2 -3
- package/types/src/calculation/ICalculation.d.ts +96 -9
- package/types/src/calculation/NamedFormulaCollection.d.ts +104 -8
- package/types/src/calculation/_CloneBoundary.d.ts +1 -1
- package/types/src/calculation/compiler/ASTTypes.d.ts +6 -2
- package/types/src/calculation/compiler/Types.d.ts +8 -0
- package/types/src/calculation/engine/CalcBackend.d.ts +104 -6
- package/types/src/calculation/executor/CalcExecutor.d.ts +73 -22
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +17 -1
- package/types/src/calculation/executor/_WhatIf.d.ts +50 -0
- package/types/src/calculation/formula/FormulaBlock.d.ts +4 -3
- package/types/src/calculation/formula/IFormulaBlock.d.ts +5 -0
- package/types/src/calculation/functions/_DataTableFunction.d.ts +14 -0
- package/types/src/calculation/grid/CalcGrid.d.ts +4 -6
- package/types/src/calculation/grid/CalcGridBackend.d.ts +5 -27
- package/types/src/calculation/grid/CalcGridProxy.d.ts +0 -2
- package/types/src/calculation/grid/CalcGridUtils.d.ts +4 -2
- package/types/src/calculation/grid/ICalcGrid.d.ts +16 -12
- package/types/src/calculation/grid/_CalcRequest.d.ts +17 -5
- package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +2 -0
- package/types/src/calculation/spatial/SpillEntry.d.ts +16 -2
- package/types/src/calculation/state/CalcNode.d.ts +0 -1
- package/types/src/calculation/state/CalcScope.d.ts +29 -0
- package/types/src/calculation/state/CalcState.d.ts +26 -4
- package/types/src/calculation/state/CalculationContext.d.ts +28 -1
- package/types/src/calculation/state/DeferredCalls.d.ts +260 -0
- package/types/src/calculation/state/IContextContainer.d.ts +20 -0
- package/types/src/calculation/state/_PendingOverlayGrid.d.ts +6 -0
- package/types/src/calculation/state/_WhatIfLayer.d.ts +91 -0
- package/types/src/cell/ICell.d.ts +53 -34
- package/types/src/cellControl/CellControl.d.ts +67 -0
- package/types/src/cellControl/CellControlCollection.d.ts +29 -0
- package/types/src/cellControl/CellControlRegistry.d.ts +47 -0
- package/types/src/cellControl/ICellControl.d.ts +99 -0
- package/types/src/cellControl/ICellControlCollection.d.ts +67 -0
- package/types/src/cellControl/index.d.ts +4 -0
- package/types/src/cellRange/ICellRange.d.ts +207 -59
- package/types/src/cellRange/ICellRanges.d.ts +4 -3
- package/types/src/chart/layout/ChartLayout.d.ts +5 -1
- package/types/src/chart/resolve/_Resolve.d.ts +10 -0
- package/types/src/chart/resolve/_ResolvedChart.d.ts +5 -2
- package/types/src/collections/ISparseGrid.d.ts +11 -2
- package/types/src/collections/MixedTypedArrayList.d.ts +8 -2
- package/types/src/collections/SparseGrid.d.ts +3 -8
- package/types/src/condition/AnchoredConditional.d.ts +2 -2
- package/types/src/externalBook/IExternalBook.d.ts +3 -4
- package/types/src/fetch/Fetcher.d.ts +15 -0
- package/types/src/fetch/IFetcher.d.ts +47 -0
- package/types/src/fetch/_WorkbookFetch.d.ts +43 -0
- package/types/src/fetch/index.d.ts +3 -0
- package/types/src/fill/PaintUtils.d.ts +3 -1
- package/types/src/hyperlink/IHyperlink.d.ts +10 -0
- package/types/src/hyperlink/_Hyperlink.d.ts +4 -1
- package/types/src/index.d.ts +2 -1
- package/types/src/named/INamedCollection.d.ts +36 -0
- package/types/src/named/NamedCollection.d.ts +18 -0
- package/types/src/primitives/AsyncValue.d.ts +58 -0
- package/types/src/resource/IResource.d.ts +9 -0
- package/types/src/resource/IResourceCollection.d.ts +4 -0
- package/types/src/resource/Resource.d.ts +2 -0
- package/types/src/resource/_AddResource.d.ts +13 -0
- package/types/src/richData/CellImage.d.ts +95 -0
- package/types/src/richData/Hyperlink.d.ts +49 -0
- package/types/src/richData/IRichDataCollection.d.ts +76 -0
- package/types/src/richData/IRichDataKind.d.ts +55 -11
- package/types/src/richData/RichArray.d.ts +42 -0
- package/types/src/richData/RichDataCollection.d.ts +23 -0
- package/types/src/richData/RichDataRegistry.d.ts +46 -14
- package/types/src/richData/RichDataValues.d.ts +20 -0
- package/types/src/richData/RichRecord.d.ts +68 -0
- package/types/src/richData/RichText.d.ts +5 -5
- package/types/src/richData/index.d.ts +6 -0
- package/types/src/scripting/FunctionArguments.d.ts +17 -1
- package/types/src/scripting/FunctionCollection.d.ts +8 -0
- package/types/src/scripting/Scripts.d.ts +10 -0
- package/types/src/scripting/TypedFunction.d.ts +2 -0
- package/types/src/sheet/ICellContainerOptions.d.ts +6 -0
- package/types/src/sheet/IWorksheet.d.ts +24 -17
- package/types/src/sheet/SheetCell.d.ts +17 -1
- package/types/src/sheet/SheetRange.d.ts +8 -2
- package/types/src/sheet/SheetRanges.d.ts +2 -2
- package/types/src/sheet/Worksheet.d.ts +110 -56
- package/types/src/sheet/_ListenerAnchor.d.ts +7 -1
- package/types/src/sheet/_ScalarListFactory.d.ts +54 -6
- package/types/src/sheet/_SheetMutations.d.ts +4 -1
- package/types/src/sheet/_SheetStateTypes.d.ts +23 -11
- package/types/src/workbook/IWorkbook.d.ts +40 -1
- package/types/src/workbook/Workbook.d.ts +25 -3
- package/types/src/workbook/WorkbookRanges.d.ts +1 -1
- package/browser/esm/BGOFfpxr2jPIdqmV.mjs +0 -40
- package/browser/esm/f1IoRb7tEb0QmCSt.mjs +0 -110
- package/browser/esm/nvU0ClAbf0g94YBK.mjs +0 -1695
- package/node/esm/B084DssTcdBheTp_.mjs +0 -7966
- package/node/esm/Df1bL6VFvrqIdSLB.mjs +0 -40
- package/node/esm/DrTZbfemSLq2mseG.mjs +0 -111
- package/types/src/dataTable/DataTable.d.ts +0 -67
- package/types/src/dataTable/DataTableCollection.d.ts +0 -19
- package/types/src/dataTable/IDataTable.d.ts +0 -99
- package/types/src/dataTable/IDataTableCollection.d.ts +0 -18
- package/types/src/dataTable/index.d.ts +0 -6
package/node/esm/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { a as e, l as t, o as s, t as r, u as i } from "./
|
|
8
|
-
import {
|
|
9
|
-
import { $t as
|
|
10
|
-
import { n as
|
|
11
|
-
import { t as
|
|
12
|
-
import { FormulaError as
|
|
13
|
-
import { BufferUtils as
|
|
7
|
+
import { a as e, l as t, o as s, t as r, u as i } from "./Btw4148Ot8ifhNc1.mjs";
|
|
8
|
+
import { $t as o, A as n, Ai as a, Ar as l, Br as h, Bt as c, C as u, Ci as d, Cr as g, Ct as m, D as _, Di as f, Dt as p, E as w, Ei as y, Et as S, F as b, Fi as k, Fr as C, Ft as v, Gr as I, Hr as N, Ht as O, I as R, Ii as x, Ir as E, It as L, Jr as A, Jt as V, Kr as T, Kt as P, L as F, Li as W, Lr as B, Mi as j, Mn as M, Mr as D, Ni as z, Nn as H, Nr as U, Nt as J, O as q, Oi as $, Ot as K, P as G, Pi as X, Pr as Q, Pt as Z, Qt as Y, Ri as ee, Rr as te, Rt as se, S as re, Si as ie, Sr as oe, T as ne, Ti as ae, Tn as le, Tt as he, Ur as ce, Ut as ue, Vr as de, Vt as ge, Wr as me, Wt as _e, Xt as fe, Yr as pe, Yt as we, Zt as ye, _a as Se, _i as be, a as ke, b as Ce, bi as ve, ca as Ie, cn as Ne, da as Oe, di as Re, dn as xe, en as Ee, fa as Le, fi as Ae, fn as Ve, ga as Te, ha as Pe, i as Fe, j as We, jn as Be, jr as je, k as Me, ki as De, kr as ze, kt as He, la as Ue, ma as Je, nn as qe, oa as $e, on as Ke, pa as Ge, pn as Xe, qr as Qe, qt as Ze, r as Ye, ri as et, si as tt, sn as st, ta as rt, ti as it, tn as ot, ua as nt, ui as at, un as lt, v as ht, va as ct, vi as ut, w as dt, wi as gt, wn as mt, wt as _t, x as ft, xi as pt, xr as wt, y as yt, ya as St, yi as bt, zi as kt, zr as Ct, zt as vt } from "./Vocy-I9dKzZMr0Ct.mjs";
|
|
9
|
+
import { $t as It, B as Nt, Ct as Ot, E as Rt, Gt as xt, H as Et, I as Lt, Jt as At, Kt as Vt, L as Tt, O as Pt, Qt as Ft, R as Wt, St as Bt, V as jt, W as Mt, at as Dt, ct as zt, dt as Ht, en as Ut, ft as Jt, lt as qt, ot as $t, qt as Kt, rt as Gt, st as Xt, ut as Qt, z as Zt } from "./BL2iiEoqxDEV2Xrg.mjs";
|
|
10
|
+
import { n as Yt, t as es } from "./DrCf6ITcBhVOFpRj.mjs";
|
|
11
|
+
import { t as ts } from "./Dn1M7YWi25DeeYUb.mjs";
|
|
12
|
+
import { FormulaError as ss, ScalarType as rs } from "@sheetxl/primitives";
|
|
13
|
+
import { BufferUtils as is, CommonUtils as os, CoordUtils as ns, DefaultLanguagePackService as as, ExpectedError as ls, InvalidPasswordError as hs, MimeType as cs, Notifier as us, NullNotAllowedError as ds, OutOfBoundsError as gs, PasswordRequiredError as ms, ProtectedError as _s, UndoManager as fs, messageKey as ps, t as ws } from "@sheetxl/utils";
|
|
14
14
|
export * from "@sheetxl/primitives";
|
|
15
15
|
export * from "@sheetxl/utils";
|
|
16
|
-
var
|
|
16
|
+
var ys, Ss = class extends fs {
|
|
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
|
}
|
|
@@ -100,14 +100,14 @@ var ls, hs = class extends os {
|
|
|
100
100
|
return 0 === e.length && null !== this._repeatOperation && e.push(this._repeatOperation.description), Object.freeze(e);
|
|
101
101
|
}
|
|
102
102
|
getUndoEntries() {
|
|
103
|
-
return this._undoCommits().map(
|
|
103
|
+
return this._undoCommits().map(ks);
|
|
104
104
|
}
|
|
105
105
|
getRedoEntries() {
|
|
106
|
-
const e = this._redoCommits().map(
|
|
106
|
+
const e = this._redoCommits().map(ks);
|
|
107
107
|
return 0 === e.length && null !== this._repeatOperation && e.push({
|
|
108
108
|
description: this._repeatOperation.description,
|
|
109
109
|
author: null,
|
|
110
|
-
meta:
|
|
110
|
+
meta: bs
|
|
111
111
|
}), Object.freeze(e);
|
|
112
112
|
}
|
|
113
113
|
addUndoOperation() {
|
|
@@ -119,11 +119,11 @@ var ls, hs = class extends os {
|
|
|
119
119
|
close() {
|
|
120
120
|
this._removeListener?.();
|
|
121
121
|
}
|
|
122
|
-
},
|
|
122
|
+
}, bs = Object.freeze({}), ks = (e) => ({
|
|
123
123
|
description: e.getDescription(),
|
|
124
124
|
author: e.getAuthor(),
|
|
125
|
-
meta: e.getMeta() ??
|
|
126
|
-
}),
|
|
125
|
+
meta: e.getMeta() ?? bs
|
|
126
|
+
}), Cs = class {
|
|
127
127
|
constructor(t, s) {
|
|
128
128
|
this._dirty = !1, this._store = t, this._savedCommitId = t.getCurrentCommit()?.getId() ?? null, this._emitter = new e(this);
|
|
129
129
|
const r = this;
|
|
@@ -161,8 +161,8 @@ var ls, hs = class extends os {
|
|
|
161
161
|
this._removeStoreListener?.(), this._removeCommitListener?.(), this._emitter.close();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
-
|
|
165
|
-
var
|
|
164
|
+
ys || (ys = {});
|
|
165
|
+
var vs, Is = class t {
|
|
166
166
|
constructor(s, r = {}) {
|
|
167
167
|
this._password = null, this._emitter = new e(this), this._path = s ?? 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 ?? t._defaultCanWrite(this._path), this._encryption = r.encryption ?? null;
|
|
168
168
|
}
|
|
@@ -175,7 +175,7 @@ var gs, ms = class t {
|
|
|
175
175
|
getName() {
|
|
176
176
|
if (null !== this._name && void 0 !== this._name) return this._name;
|
|
177
177
|
const e = this._cleanPath();
|
|
178
|
-
return e &&
|
|
178
|
+
return e && Pe(e) || null;
|
|
179
179
|
}
|
|
180
180
|
getPath() {
|
|
181
181
|
return this._path;
|
|
@@ -186,7 +186,7 @@ var gs, ms = class t {
|
|
|
186
186
|
getExtension() {
|
|
187
187
|
const e = this._cleanPath();
|
|
188
188
|
if (!e) return null;
|
|
189
|
-
const t =
|
|
189
|
+
const t = Te(e);
|
|
190
190
|
return t ? t.toLowerCase() : null;
|
|
191
191
|
}
|
|
192
192
|
getEncryption() {
|
|
@@ -236,26 +236,26 @@ var gs, ms = class t {
|
|
|
236
236
|
];
|
|
237
237
|
return `${t} ${(s / Math.pow(1024, r)).toFixed(2)}${i[Math.min(r, i.length - 1)]}`;
|
|
238
238
|
}
|
|
239
|
-
},
|
|
239
|
+
}, Ns = /* @__PURE__ */ new WeakMap(), Os = /* @__PURE__ */ new Set(), Rs = (e) => Ns.get(e) ?? null, xs = class t {
|
|
240
240
|
constructor(s) {
|
|
241
|
-
this._released = !1, t._assertFree(s), this._emitter = new e(this), this._origin = s,
|
|
241
|
+
this._released = !1, t._assertFree(s), this._emitter = new e(this), this._origin = s, Ns.set(s, this), Os.add(this);
|
|
242
242
|
}
|
|
243
243
|
getOrigin() {
|
|
244
244
|
return this._origin;
|
|
245
245
|
}
|
|
246
246
|
setOrigin(e) {
|
|
247
|
-
e !== this._origin && (t._assertFree(e), this._released || (
|
|
247
|
+
e !== this._origin && (t._assertFree(e), this._released || (Ns.delete(this._origin), Ns.set(e, this)), this._origin = e, this._emitter.notify("onOriginChange"));
|
|
248
248
|
}
|
|
249
249
|
release() {
|
|
250
|
-
this._released || (this._released = !0,
|
|
250
|
+
this._released || (this._released = !0, Ns.get(this._origin) === this && Ns.delete(this._origin), Os.delete(this));
|
|
251
251
|
}
|
|
252
252
|
addListeners(e, t) {
|
|
253
253
|
return this._emitter.addListeners(e, t);
|
|
254
254
|
}
|
|
255
255
|
static _assertFree(e) {
|
|
256
|
-
if (
|
|
256
|
+
if (Ns.has(e)) throw new Error("This origin already backs an open workbook; an origin backs one workbook at a time.");
|
|
257
257
|
}
|
|
258
|
-
},
|
|
258
|
+
}, Es = class {
|
|
259
259
|
constructor() {
|
|
260
260
|
this._defaultStringSourceType = "filepath";
|
|
261
261
|
}
|
|
@@ -275,10 +275,10 @@ var gs, ms = class t {
|
|
|
275
275
|
}
|
|
276
276
|
switch (n) {
|
|
277
277
|
case "file": {
|
|
278
|
-
const e = s, r = e?.name, n = r ? `${
|
|
278
|
+
const e = s, r = e?.name, n = r ? `${Pe(r)}` : "";
|
|
279
279
|
a = await e.arrayBuffer(), l = {
|
|
280
280
|
format: o,
|
|
281
|
-
ext:
|
|
281
|
+
ext: Te(r),
|
|
282
282
|
name: n,
|
|
283
283
|
absolutePath: r,
|
|
284
284
|
size: e.size,
|
|
@@ -302,7 +302,7 @@ var gs, ms = class t {
|
|
|
302
302
|
const [, t] = s.split(",");
|
|
303
303
|
e = t;
|
|
304
304
|
} else e = s;
|
|
305
|
-
a =
|
|
305
|
+
a = is.base64ToArrayBuffer(e), l = {
|
|
306
306
|
format: o,
|
|
307
307
|
size: e.length
|
|
308
308
|
};
|
|
@@ -318,7 +318,7 @@ var gs, ms = class t {
|
|
|
318
318
|
e = i.input, t = i.init, r = i.timeout;
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
-
const i = r || 3e4, n = new AbortController(), h = setTimeout(() => n.abort(), i), c = "string" == typeof e ? e : e.toString(), u =
|
|
321
|
+
const i = r || 3e4, n = new AbortController(), h = setTimeout(() => n.abort(), i), c = "string" == typeof e ? e : e.toString(), u = Te(c);
|
|
322
322
|
try {
|
|
323
323
|
const s = await fetch(e, {
|
|
324
324
|
...t,
|
|
@@ -330,7 +330,7 @@ var gs, ms = class t {
|
|
|
330
330
|
a = r, l = {
|
|
331
331
|
format: o,
|
|
332
332
|
ext: u,
|
|
333
|
-
name:
|
|
333
|
+
name: Pe(c, !0),
|
|
334
334
|
absolutePath: c
|
|
335
335
|
};
|
|
336
336
|
} catch (e) {
|
|
@@ -373,7 +373,7 @@ var gs, ms = class t {
|
|
|
373
373
|
return t.absolutePath ? this.findOpenPath(t.absolutePath) : null;
|
|
374
374
|
}
|
|
375
375
|
findOpenPath(e, t) {
|
|
376
|
-
return Array.from(
|
|
376
|
+
return Array.from(Os, (e) => e.getOrigin()).find((s) => {
|
|
377
377
|
if (s === t || !s.canWrite()) return !1;
|
|
378
378
|
const r = s.getPath();
|
|
379
379
|
return !!r && this.isSamePath(r, e);
|
|
@@ -404,10 +404,10 @@ var gs, ms = class t {
|
|
|
404
404
|
}
|
|
405
405
|
if ("undefined" != typeof File && e instanceof File) return "file";
|
|
406
406
|
if ("undefined" != typeof Blob && e instanceof Blob) return "blob";
|
|
407
|
-
const t = e instanceof ArrayBuffer || "[object ArrayBuffer]" === Object.prototype.toString.call(e), s = ArrayBuffer.isView(e), r =
|
|
407
|
+
const t = e instanceof ArrayBuffer || "[object ArrayBuffer]" === Object.prototype.toString.call(e), s = ArrayBuffer.isView(e), r = is.isNodeBuffer(e);
|
|
408
408
|
return t || s || r ? "buffer" : "undefined" != typeof ReadableStream && e instanceof ReadableStream || "[object ReadableStream]" === Object.prototype.toString.call(e) || e && "function" == typeof e.getReader && void 0 !== e.locked ? "stream" : null;
|
|
409
409
|
}
|
|
410
|
-
},
|
|
410
|
+
}, Ls = class extends Es {
|
|
411
411
|
constructor(e, t) {
|
|
412
412
|
super();
|
|
413
413
|
}
|
|
@@ -447,8 +447,8 @@ var gs, ms = class t {
|
|
|
447
447
|
), r = e.origin.getPath(), i = !(!r || !e.origin.canWrite()), o = i ? r : e.origin.getName() ? e.suggestedName : null;
|
|
448
448
|
if (!o) throw new Error("No file name provided to write to.");
|
|
449
449
|
const n = s.resolve(o.replace(/\\/g, "/")), a = this.findOpenPath(n, e.workbook?.getOrigin?.());
|
|
450
|
-
if (a) throw new
|
|
451
|
-
const l = i ? e.origin : new
|
|
450
|
+
if (a) throw new ls(ws("error.io.openElsewhere", { name: a.getName() ?? n }));
|
|
451
|
+
const l = i ? e.origin : new Is(n, {
|
|
452
452
|
format: e.format.key,
|
|
453
453
|
canWrite: !0
|
|
454
454
|
}), h = await e.encode(e.format.key, l);
|
|
@@ -464,7 +464,7 @@ var gs, ms = class t {
|
|
|
464
464
|
} catch (e) {
|
|
465
465
|
throw new Error(`Failed to write file '${n}': ${e.message}`);
|
|
466
466
|
}
|
|
467
|
-
if (l instanceof
|
|
467
|
+
if (l instanceof Is) {
|
|
468
468
|
const e = await t.stat(n).catch(() => null);
|
|
469
469
|
l.update({
|
|
470
470
|
size: c.byteLength,
|
|
@@ -474,13 +474,13 @@ var gs, ms = class t {
|
|
|
474
474
|
return l;
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
|
-
(
|
|
477
|
+
(vs || (vs = {})).SortOn = {
|
|
478
478
|
Value: "value",
|
|
479
479
|
FillColor: "fillColor",
|
|
480
480
|
FontColor: "fontColor",
|
|
481
481
|
Icon: "icon"
|
|
482
482
|
};
|
|
483
|
-
var
|
|
483
|
+
var As = {
|
|
484
484
|
TopLeft: "tl",
|
|
485
485
|
Top: "t",
|
|
486
486
|
TopRight: "tr",
|
|
@@ -490,53 +490,53 @@ var bs = {
|
|
|
490
490
|
BottomLeft: "bl",
|
|
491
491
|
Bottom: "b",
|
|
492
492
|
BottomRight: "br"
|
|
493
|
-
},
|
|
494
|
-
[
|
|
495
|
-
[
|
|
496
|
-
[
|
|
497
|
-
[
|
|
498
|
-
[
|
|
499
|
-
[
|
|
500
|
-
[
|
|
501
|
-
[
|
|
502
|
-
[
|
|
503
|
-
[
|
|
504
|
-
[
|
|
505
|
-
[
|
|
506
|
-
[
|
|
507
|
-
[
|
|
508
|
-
[
|
|
509
|
-
[
|
|
510
|
-
[
|
|
511
|
-
[
|
|
512
|
-
[
|
|
513
|
-
[
|
|
514
|
-
[
|
|
515
|
-
},
|
|
516
|
-
function
|
|
517
|
-
const t =
|
|
493
|
+
}, Vs = Dt.BuiltInName, Ts = {
|
|
494
|
+
[Vs.Normal]: ps("style.builtin.normal"),
|
|
495
|
+
[Vs.Comma]: ps("style.builtin.comma"),
|
|
496
|
+
[Vs.Currency]: ps("style.builtin.currency"),
|
|
497
|
+
[Vs.Percent]: ps("style.builtin.percent"),
|
|
498
|
+
[Vs.Comma0]: ps("style.builtin.comma0"),
|
|
499
|
+
[Vs.Currency0]: ps("style.builtin.currency0"),
|
|
500
|
+
[Vs.Hyperlink]: ps("style.builtin.hyperlink"),
|
|
501
|
+
[Vs.FollowedHyperlink]: ps("style.builtin.followedHyperlink"),
|
|
502
|
+
[Vs.Note]: ps("style.builtin.note"),
|
|
503
|
+
[Vs.WarningText]: ps("style.builtin.warningText"),
|
|
504
|
+
[Vs.Title]: ps("style.builtin.title"),
|
|
505
|
+
[Vs.Input]: ps("style.builtin.input"),
|
|
506
|
+
[Vs.Output]: ps("style.builtin.output"),
|
|
507
|
+
[Vs.Calculation]: ps("style.builtin.calculation"),
|
|
508
|
+
[Vs.CheckCell]: ps("style.builtin.checkCell"),
|
|
509
|
+
[Vs.LinkedCell]: ps("style.builtin.linkedCell"),
|
|
510
|
+
[Vs.Total]: ps("style.builtin.total"),
|
|
511
|
+
[Vs.Good]: ps("style.builtin.good"),
|
|
512
|
+
[Vs.Bad]: ps("style.builtin.bad"),
|
|
513
|
+
[Vs.Neutral]: ps("style.builtin.neutral"),
|
|
514
|
+
[Vs.ExplanatoryText]: ps("style.builtin.explanatoryText")
|
|
515
|
+
}, Ps = ps("style.builtin.heading"), Fs = ps("style.builtin.accent"), Ws = ps("style.builtin.accentTint"), Bs = /^Heading ([1-4])$/, js = /^Accent([1-6])$/, Ms = /^(20|40|60)% - Accent([1-6])$/;
|
|
516
|
+
function Ds(e) {
|
|
517
|
+
const t = Ts[e];
|
|
518
518
|
if (t) return { key: t };
|
|
519
|
-
let s =
|
|
519
|
+
let s = Bs.exec(e);
|
|
520
520
|
return s ? {
|
|
521
|
-
key:
|
|
521
|
+
key: Ps,
|
|
522
522
|
params: { n: +s[1] }
|
|
523
|
-
} : (s =
|
|
524
|
-
key:
|
|
523
|
+
} : (s = js.exec(e), s ? {
|
|
524
|
+
key: Fs,
|
|
525
525
|
params: { n: +s[1] }
|
|
526
|
-
} : (s =
|
|
527
|
-
key:
|
|
526
|
+
} : (s = Ms.exec(e), s ? {
|
|
527
|
+
key: Ws,
|
|
528
528
|
params: {
|
|
529
529
|
pct: +s[1],
|
|
530
530
|
n: +s[2]
|
|
531
531
|
}
|
|
532
532
|
} : null));
|
|
533
533
|
}
|
|
534
|
-
var
|
|
534
|
+
var zs, Hs, Us, Js, qs = (e, t, s, r, i) => {
|
|
535
535
|
const o = JSON.parse(JSON.stringify(e.definition));
|
|
536
536
|
o.adjs || (o.adjs = []);
|
|
537
537
|
let n = "", a = 0, l = 0;
|
|
538
|
-
t > 0 ? (l = t, a = 100 - t, n =
|
|
539
|
-
const h = new
|
|
538
|
+
t > 0 ? (l = t, a = 100 - t, n = ws("op.lighterPercent", { percent: t })) : t < 0 && (a = 100 + t, n = ws("op.darkerPercent", { percent: -t })), a && o.adjs.push({ [Ht.AdjustmentType.LumMod]: a }), l && o.adjs.push({ [Ht.AdjustmentType.LumOff]: l });
|
|
539
|
+
const h = new qt({
|
|
540
540
|
val: o.val,
|
|
541
541
|
adjs: o.adjs
|
|
542
542
|
}, s), c = h.toString();
|
|
@@ -547,15 +547,15 @@ var As, Ls, Vs, Ts, Ws = (e, t, s, r, i) => {
|
|
|
547
547
|
definition: o
|
|
548
548
|
};
|
|
549
549
|
};
|
|
550
|
-
function
|
|
550
|
+
function $s(e, t, s, r) {
|
|
551
551
|
let i = [];
|
|
552
552
|
for (let o = 0; o < e.length; o++) {
|
|
553
553
|
let n = [];
|
|
554
554
|
i.push(n);
|
|
555
555
|
const a = (i) => {
|
|
556
|
-
for (let a = 0; a < i.length; a++) n.push(
|
|
556
|
+
for (let a = 0; a < i.length; a++) n.push(qs(e[o], i[a], t, s, r));
|
|
557
557
|
};
|
|
558
|
-
let l = new
|
|
558
|
+
let l = new qt({
|
|
559
559
|
val: e[o].definition.val,
|
|
560
560
|
adjs: e[o].definition.adjs
|
|
561
561
|
}, t).toHSLA().lum;
|
|
@@ -593,45 +593,45 @@ function Bs(e, t, s, r) {
|
|
|
593
593
|
}
|
|
594
594
|
return i;
|
|
595
595
|
}
|
|
596
|
-
(
|
|
597
|
-
var
|
|
598
|
-
function
|
|
599
|
-
if (!
|
|
600
|
-
const e = import("./
|
|
596
|
+
(zs || (zs = {})).buildPalette = $s, Hs || (Hs = {}), Us || (Us = {}), Js || (Js = {});
|
|
597
|
+
var Ks, Gs = null;
|
|
598
|
+
function Xs() {
|
|
599
|
+
if (!Gs) {
|
|
600
|
+
const e = import("./C99zzq8DImQXi4BQ.mjs").then(({ initializeFunctions: e }) => {
|
|
601
601
|
const t = e(() => null);
|
|
602
602
|
return Object.freeze(Array.from(t.keys()));
|
|
603
603
|
});
|
|
604
604
|
e.catch(() => {
|
|
605
|
-
|
|
606
|
-
}),
|
|
605
|
+
Gs = null;
|
|
606
|
+
}), Gs = e;
|
|
607
607
|
}
|
|
608
|
-
return
|
|
608
|
+
return Gs;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
return
|
|
610
|
+
function Qs(e) {
|
|
611
|
+
return H.peek()?.readFormulaLiteral(e);
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
const s =
|
|
615
|
-
return s !== r ? s - r : e === t ? 0 : "number" == typeof e && "number" == typeof t ? e < t ? -1 : 1 : "string" == typeof e && "string" == typeof t ? e < t ? -1 : e > t ? 1 : 0 : "boolean" == typeof e ? e ? 1 : -1 :
|
|
613
|
+
function Zs(e, t) {
|
|
614
|
+
const s = Ys(e), r = Ys(t);
|
|
615
|
+
return s !== r ? s - r : e === t ? 0 : "number" == typeof e && "number" == typeof t ? e < t ? -1 : 1 : "string" == typeof e && "string" == typeof t ? e < t ? -1 : e > t ? 1 : 0 : "boolean" == typeof e ? e ? 1 : -1 : ss.isError(e) && ss.isError(t) ? e.getCode() - t.getCode() : 0;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function Ys(e) {
|
|
618
618
|
if (null === e) return 0;
|
|
619
619
|
switch (typeof e) {
|
|
620
620
|
case "number": return 1;
|
|
621
621
|
case "string": return 2;
|
|
622
622
|
case "boolean": return 3;
|
|
623
|
-
default: return
|
|
623
|
+
default: return ss.isError(e) ? 4 : 5;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
626
|
(function(e) {
|
|
627
627
|
function t(e) {
|
|
628
|
-
return
|
|
628
|
+
return H.peek()?.getFunctionDeclaration(e) ?? null;
|
|
629
629
|
}
|
|
630
630
|
e.get = t, e.has = function(e) {
|
|
631
631
|
return null !== t(e);
|
|
632
632
|
};
|
|
633
|
-
})(
|
|
634
|
-
var
|
|
633
|
+
})(Ks || (Ks = {}));
|
|
634
|
+
var er = class {
|
|
635
635
|
constructor(e) {
|
|
636
636
|
this._children = e;
|
|
637
637
|
}
|
|
@@ -679,19 +679,19 @@ var Hs = class {
|
|
|
679
679
|
const s = t[e].getSortedNumbers().getValues();
|
|
680
680
|
s.length > 0 && r.push(s);
|
|
681
681
|
}
|
|
682
|
-
e = new
|
|
682
|
+
e = new Ye(function(e) {
|
|
683
683
|
const t = e.length;
|
|
684
|
-
if (0 === t) return
|
|
684
|
+
if (0 === t) return tr;
|
|
685
685
|
if (1 === t) return e[0];
|
|
686
686
|
let s = e[0];
|
|
687
|
-
for (let r = 1; r < t; r++) s =
|
|
687
|
+
for (let r = 1; r < t; r++) s = sr(s, e[r]);
|
|
688
688
|
return Object.freeze(s);
|
|
689
689
|
}(r)), this._sortedNumbers = e;
|
|
690
690
|
}
|
|
691
691
|
return e;
|
|
692
692
|
}
|
|
693
693
|
getRanked(e) {
|
|
694
|
-
return
|
|
694
|
+
return Fe(this._children, e, Zs)[Symbol.iterator]();
|
|
695
695
|
}
|
|
696
696
|
getFrequencies(e) {
|
|
697
697
|
if (e) return this._mergeFrequencies(e);
|
|
@@ -699,7 +699,7 @@ var Hs = class {
|
|
|
699
699
|
return t || (t = this._mergeFrequencies(), this._frequencies = t), t;
|
|
700
700
|
}
|
|
701
701
|
_mergeFrequencies(e) {
|
|
702
|
-
const t = e?.keyFn ??
|
|
702
|
+
const t = e?.keyFn ?? g, s = e?.limit, r = /* @__PURE__ */ new Map(), i = this._children, o = i.length;
|
|
703
703
|
let n = 0, a = 0, l = !1;
|
|
704
704
|
for (let h = 0; h < o; h++) {
|
|
705
705
|
const o = i[h].getFrequencies(e);
|
|
@@ -714,22 +714,22 @@ var Hs = class {
|
|
|
714
714
|
}) : l = !0, u = c.next();
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
return
|
|
717
|
+
return oe.fromGroups(r, t, e, Zs, n, a, l);
|
|
718
718
|
}
|
|
719
719
|
getTypedCounts(e) {
|
|
720
720
|
let t = this._typedCounts;
|
|
721
721
|
if (!t) {
|
|
722
722
|
const e = {
|
|
723
|
-
[
|
|
724
|
-
[
|
|
725
|
-
[
|
|
726
|
-
[
|
|
727
|
-
[
|
|
728
|
-
[
|
|
723
|
+
[rs.Number]: 0,
|
|
724
|
+
[rs.String]: 0,
|
|
725
|
+
[rs.Boolean]: 0,
|
|
726
|
+
[rs.Error]: 0,
|
|
727
|
+
[rs.RichData]: 0,
|
|
728
|
+
[rs.Null]: 0
|
|
729
729
|
}, s = this._children, r = s.length;
|
|
730
730
|
for (let t = 0; t < r; t++) {
|
|
731
731
|
const r = s[t].getTypedCounts();
|
|
732
|
-
e[
|
|
732
|
+
e[rs.Number] += r[rs.Number] ?? 0, e[rs.String] += r[rs.String] ?? 0, e[rs.Boolean] += r[rs.Boolean] ?? 0, e[rs.Error] += r[rs.Error] ?? 0, e[rs.RichData] += r[rs.RichData] ?? 0, e[rs.Null] += r[rs.Null] ?? 0;
|
|
733
733
|
}
|
|
734
734
|
t = Object.freeze(e), this._typedCounts = t;
|
|
735
735
|
}
|
|
@@ -750,12 +750,12 @@ var Hs = class {
|
|
|
750
750
|
sum: 0,
|
|
751
751
|
sumSq: 0,
|
|
752
752
|
typed: {
|
|
753
|
-
[
|
|
754
|
-
[
|
|
755
|
-
[
|
|
756
|
-
[
|
|
757
|
-
[
|
|
758
|
-
[
|
|
753
|
+
[rs.Number]: 0,
|
|
754
|
+
[rs.String]: 0,
|
|
755
|
+
[rs.Boolean]: 0,
|
|
756
|
+
[rs.Error]: 0,
|
|
757
|
+
[rs.RichData]: 0,
|
|
758
|
+
[rs.Null]: 0
|
|
759
759
|
}
|
|
760
760
|
};
|
|
761
761
|
for (let i = 0; i < s; i++) {
|
|
@@ -764,10 +764,10 @@ var Hs = class {
|
|
|
764
764
|
const o = s.numericalCount;
|
|
765
765
|
o <= 0 || (r.numericalCount += o, r.sum += s.sum, r.sumSq += s.varP * o + s.sum * s.sum / o, (void 0 === r.min || s.min < r.min) && (r.min = s.min), (void 0 === r.max || s.max > r.max) && (r.max = s.max));
|
|
766
766
|
}
|
|
767
|
-
return
|
|
767
|
+
return ke(r);
|
|
768
768
|
}
|
|
769
|
-
},
|
|
770
|
-
function
|
|
769
|
+
}, tr = Object.freeze([]);
|
|
770
|
+
function sr(e, t) {
|
|
771
771
|
const s = e.length, r = t.length, i = new Array(s + r);
|
|
772
772
|
let o = 0, n = 0, a = 0;
|
|
773
773
|
for (; o < s && n < r;) i[a++] = e[o] <= t[n] ? e[o++] : t[n++];
|
|
@@ -775,14 +775,14 @@ function Js(e, t) {
|
|
|
775
775
|
for (; n < r;) i[a++] = t[n++];
|
|
776
776
|
return i;
|
|
777
777
|
}
|
|
778
|
-
var
|
|
778
|
+
var rr, ir = class {
|
|
779
779
|
constructor(e, t) {
|
|
780
780
|
this._source = null, this.cacheId = e, this.part = t;
|
|
781
781
|
}
|
|
782
782
|
_hold(e) {
|
|
783
783
|
const t = this.part?.xml;
|
|
784
784
|
if (!t || this._source) return;
|
|
785
|
-
const s =
|
|
785
|
+
const s = Y(t, "worksheetSource", "ref"), r = Y(t, "worksheetSource", "sheet");
|
|
786
786
|
if (!s || !r || s.includes("#REF!")) return;
|
|
787
787
|
const i = e(r);
|
|
788
788
|
if (!i) return;
|
|
@@ -791,7 +791,7 @@ var qs, $s = class {
|
|
|
791
791
|
wired: null,
|
|
792
792
|
last: null
|
|
793
793
|
};
|
|
794
|
-
this._source = o, i(`${
|
|
794
|
+
this._source = o, i(`${Re(r)}!${ye(s)}`, (e) => {
|
|
795
795
|
o.formula = e.formula;
|
|
796
796
|
const t = e.formula.getExpression();
|
|
797
797
|
o.wired ??= t, e.formula.hasRefError() || (o.last = t);
|
|
@@ -802,18 +802,18 @@ var qs, $s = class {
|
|
|
802
802
|
if (!e || !t?.formula) return e;
|
|
803
803
|
const s = t.formula.hasRefError() ? t.last : t.formula.getExpression();
|
|
804
804
|
if (null === s || s === t.wired) return e;
|
|
805
|
-
const r =
|
|
806
|
-
return r ?
|
|
805
|
+
const r = w(s);
|
|
806
|
+
return r ? Ee(Ee(e, "worksheetSource", "ref", o(r.reference)), "worksheetSource", "sheet", r.sheet) : Ee(e, "worksheetSource", "ref", o(s));
|
|
807
807
|
}
|
|
808
808
|
toJSON(e) {
|
|
809
|
-
const t = { cacheId: this.cacheId }, s =
|
|
809
|
+
const t = { cacheId: this.cacheId }, s = ot.toJSON(this.part, e);
|
|
810
810
|
if (s) {
|
|
811
811
|
const e = this.getXML();
|
|
812
812
|
null !== e && (s.xml = e), t.part = s;
|
|
813
813
|
}
|
|
814
814
|
return t;
|
|
815
815
|
}
|
|
816
|
-
},
|
|
816
|
+
}, or = class {
|
|
817
817
|
constructor(e, t) {
|
|
818
818
|
this._deleted = !1, this._json = { ...e }, this._deleteFromCollection = t ?? null;
|
|
819
819
|
}
|
|
@@ -847,7 +847,7 @@ var qs, $s = class {
|
|
|
847
847
|
get isIPerson() {
|
|
848
848
|
return !0;
|
|
849
849
|
}
|
|
850
|
-
},
|
|
850
|
+
}, nr = class extends St {
|
|
851
851
|
constructor(e) {
|
|
852
852
|
super(), this._byId = /* @__PURE__ */ new Map(), this._byDisplayName = /* @__PURE__ */ new Map(), this._items = null, this._current = null, e && this.fromJSON(e);
|
|
853
853
|
}
|
|
@@ -868,10 +868,10 @@ var qs, $s = class {
|
|
|
868
868
|
const e = this._byDisplayName.get(r);
|
|
869
869
|
if (e) return e;
|
|
870
870
|
}
|
|
871
|
-
const i = new
|
|
871
|
+
const i = new or({
|
|
872
872
|
...t,
|
|
873
873
|
displayName: r,
|
|
874
|
-
id: s ??
|
|
874
|
+
id: s ?? os.uuidV4().toUpperCase()
|
|
875
875
|
}, (e) => this._remove(e));
|
|
876
876
|
return this._byId.set(i.getId(), i), r && !this._byDisplayName.has(r) && this._byDisplayName.set(r, i), this._items = null, this._notifyCollectionChange(), i;
|
|
877
877
|
}
|
|
@@ -911,7 +911,7 @@ var qs, $s = class {
|
|
|
911
911
|
get isIPersonCollection() {
|
|
912
912
|
return !0;
|
|
913
913
|
}
|
|
914
|
-
},
|
|
914
|
+
}, ar = (e, t) => {
|
|
915
915
|
const s = [0];
|
|
916
916
|
for (let t = 0; t < e.length; t++) "\n" === e[t] && s.push(t + 1);
|
|
917
917
|
const r = t.map((e) => ` ${((e) => {
|
|
@@ -923,7 +923,7 @@ var qs, $s = class {
|
|
|
923
923
|
return `${t + 1}:${e - s[t] + 1}`;
|
|
924
924
|
})(e.start)} ${e.code}: ${e.message}`), i = t.length;
|
|
925
925
|
return `Script has ${i} compile error${1 === i ? "" : "s"}:\n${r.join("\n")}`;
|
|
926
|
-
},
|
|
926
|
+
}, lr = class {
|
|
927
927
|
constructor(t) {
|
|
928
928
|
this._options = t, this._emitter = new e(this), this._initState();
|
|
929
929
|
}
|
|
@@ -934,12 +934,12 @@ var qs, $s = class {
|
|
|
934
934
|
_builtInNames() {
|
|
935
935
|
try {
|
|
936
936
|
const e = this._options.getBuiltInFunctions?.();
|
|
937
|
-
if (!e) return
|
|
937
|
+
if (!e) return os.EmptyArray;
|
|
938
938
|
const t = [];
|
|
939
939
|
for (const s of e.getItems({ includeHidden: !0 })) s.isBuiltIn() && t.push(s.getName());
|
|
940
940
|
return t;
|
|
941
941
|
} catch {
|
|
942
|
-
return
|
|
942
|
+
return os.EmptyArray;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
async createModule(e) {
|
|
@@ -948,13 +948,13 @@ var qs, $s = class {
|
|
|
948
948
|
minify: !0,
|
|
949
949
|
...e
|
|
950
950
|
});
|
|
951
|
-
return t.module ? await
|
|
951
|
+
return t.module ? await Ne(xe.DEFAULT_MODULE, t.module, e?.declarationsOnly ?? !1, t.diagnostics) : null;
|
|
952
952
|
}
|
|
953
953
|
addModule(e, t, s) {
|
|
954
954
|
this._modules.add(e, t, s);
|
|
955
955
|
}
|
|
956
956
|
async addModuleFromJSON(e, t, s) {
|
|
957
|
-
const r = await
|
|
957
|
+
const r = await Ne(e, t);
|
|
958
958
|
return this.addModule(e, r, s), r;
|
|
959
959
|
}
|
|
960
960
|
executeMacro(e, t, s) {
|
|
@@ -970,7 +970,7 @@ var qs, $s = class {
|
|
|
970
970
|
}
|
|
971
971
|
async run(e, t) {
|
|
972
972
|
try {
|
|
973
|
-
const s = "string" == typeof e ? await this.createModule({ source: e }) : await
|
|
973
|
+
const s = "string" == typeof e ? await this.createModule({ source: e }) : await Ne(xe.DEFAULT_MODULE, e), r = "string" == typeof e ? e : e?.source ?? "";
|
|
974
974
|
return await this._runModule(s, r, t);
|
|
975
975
|
} catch (e) {
|
|
976
976
|
return {
|
|
@@ -987,7 +987,7 @@ var qs, $s = class {
|
|
|
987
987
|
};
|
|
988
988
|
const i = e.getDiagnostics(), o = i.filter((e) => "error" === e.severity);
|
|
989
989
|
if (o.length > 0) {
|
|
990
|
-
const e = new Error(
|
|
990
|
+
const e = new Error(ar(t, o));
|
|
991
991
|
return e.diagnostics = o, {
|
|
992
992
|
ok: !1,
|
|
993
993
|
error: e,
|
|
@@ -1015,12 +1015,12 @@ var qs, $s = class {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
_searchable(e) {
|
|
1017
1017
|
const t = this._modules;
|
|
1018
|
-
return t && 0 !== t.getCount() ? (e ? t.getItems({ name: e }) : t.getItems()).map((e) => e.getFunctions()) :
|
|
1018
|
+
return t && 0 !== t.getCount() ? (e ? t.getItems({ name: e }) : t.getItems()).map((e) => e.getFunctions()) : os.EmptyArray;
|
|
1019
1019
|
}
|
|
1020
1020
|
async searchFunctions(e) {
|
|
1021
1021
|
await this._emitter.notify("onBeforeSearch", { async: !0 });
|
|
1022
1022
|
const t = this._searchable(e?.moduleName);
|
|
1023
|
-
if (0 === t.length) return
|
|
1023
|
+
if (0 === t.length) return os.EmptyArray;
|
|
1024
1024
|
if (1 === t.length) return t[0].search(e);
|
|
1025
1025
|
const s = e?.limit, r = void 0 === s ? e : {
|
|
1026
1026
|
...e,
|
|
@@ -1038,19 +1038,40 @@ var qs, $s = class {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
|
-
if (!i || 0 === i.length) return
|
|
1041
|
+
if (!i || 0 === i.length) return os.EmptyArray;
|
|
1042
1042
|
const n = e?.text ? e.text.trim().toUpperCase() : null;
|
|
1043
|
-
return n ?
|
|
1043
|
+
return n ? lt(i, n) : i.sort((e, t) => {
|
|
1044
1044
|
const s = e.getName().toUpperCase(), r = t.getName().toUpperCase();
|
|
1045
1045
|
return s < r ? -1 : s > r ? 1 : 0;
|
|
1046
1046
|
}), void 0 !== s && i.length > s ? i.slice(0, s) : i;
|
|
1047
1047
|
}
|
|
1048
1048
|
async start() {
|
|
1049
|
-
|
|
1049
|
+
return this._startPromise || (this._startPromise = this._doStart(), this._startPromise.catch(() => {
|
|
1050
1050
|
this._startPromise = void 0;
|
|
1051
1051
|
})), this._startPromise;
|
|
1052
1052
|
}
|
|
1053
|
+
_load() {
|
|
1054
|
+
return this._loadPromise || (this._loadPromise = this._doLoad(), this._loadPromise.catch(() => {
|
|
1055
|
+
this._loadPromise = void 0;
|
|
1056
|
+
})), this._loadPromise;
|
|
1057
|
+
}
|
|
1053
1058
|
async _doStart() {
|
|
1059
|
+
await this._load();
|
|
1060
|
+
const e = this._options?.workbook, t = this._modules.getItems(), s = t.length;
|
|
1061
|
+
for (let r = 0; r < s; r++) {
|
|
1062
|
+
const s = t[r];
|
|
1063
|
+
try {
|
|
1064
|
+
const t = s.getFunctions().getItems({
|
|
1065
|
+
type: "autoRun",
|
|
1066
|
+
includeHidden: !0
|
|
1067
|
+
}), r = t.length;
|
|
1068
|
+
for (let s = 0; s < r; s++) await t[s].execute(e);
|
|
1069
|
+
} catch (e) {
|
|
1070
|
+
us.error("Error executing autoRun script:", e);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
async _doLoad() {
|
|
1054
1075
|
const e = this._options?.workbook, t = this._options?.json;
|
|
1055
1076
|
let s = {};
|
|
1056
1077
|
if (t) {
|
|
@@ -1058,13 +1079,13 @@ var qs, $s = class {
|
|
|
1058
1079
|
for (let i = 0; i < r.length; i++) {
|
|
1059
1080
|
const o = r[i], n = t[o];
|
|
1060
1081
|
try {
|
|
1061
|
-
s[o] = await
|
|
1082
|
+
s[o] = await Ne(o, n, !1, [], "workbook" === n?.scope ? e : null);
|
|
1062
1083
|
} catch (e) {
|
|
1063
|
-
|
|
1084
|
+
us.error(`Could not load script '${o}'; it will be unavailable.`, e);
|
|
1064
1085
|
}
|
|
1065
1086
|
}
|
|
1066
1087
|
}
|
|
1067
|
-
const r = this, i = new
|
|
1088
|
+
const r = this, i = new mt({
|
|
1068
1089
|
transactions: this._options?.transactions,
|
|
1069
1090
|
initial: s,
|
|
1070
1091
|
isReadOnly: () => r.isReadOnly(),
|
|
@@ -1076,21 +1097,6 @@ var qs, $s = class {
|
|
|
1076
1097
|
}
|
|
1077
1098
|
});
|
|
1078
1099
|
this._modules = i;
|
|
1079
|
-
const o = i.getItems();
|
|
1080
|
-
if (0 === o.length) return Promise.resolve(Kt.EmptyArray);
|
|
1081
|
-
const n = o.length;
|
|
1082
|
-
for (let t = 0; t < n; t++) {
|
|
1083
|
-
const s = o[t];
|
|
1084
|
-
try {
|
|
1085
|
-
const t = s.getFunctions().getItems({
|
|
1086
|
-
type: "autoRun",
|
|
1087
|
-
includeHidden: !0
|
|
1088
|
-
}), r = t.length;
|
|
1089
|
-
for (let s = 0; s < r; s++) await t[s].execute(e);
|
|
1090
|
-
} catch (e) {
|
|
1091
|
-
es.error("Error executing autoRun script:", e);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
1100
|
}
|
|
1095
1101
|
addListeners(e, t) {
|
|
1096
1102
|
return this._emitter.addListeners(e, t);
|
|
@@ -1107,9 +1113,110 @@ var qs, $s = class {
|
|
|
1107
1113
|
get isIScript() {
|
|
1108
1114
|
return !0;
|
|
1109
1115
|
}
|
|
1110
|
-
},
|
|
1116
|
+
}, hr = /^([a-z][a-z0-9+.-]*):/i, cr = (e) => {
|
|
1117
|
+
const t = e.toLowerCase();
|
|
1118
|
+
return t.endsWith(":") ? t : t + ":";
|
|
1119
|
+
}, ur = (e, t) => globalThis.fetch(e, t), dr = class {
|
|
1120
|
+
constructor() {
|
|
1121
|
+
this._handlers = /* @__PURE__ */ new Map([["http:", ur], ["https:", ur]]);
|
|
1122
|
+
}
|
|
1123
|
+
fetch(e, t) {
|
|
1124
|
+
const s = hr.exec(e)?.[1], r = this._handlers.get(s ? cr(s) : "https:");
|
|
1125
|
+
if (!r) return Promise.reject(/* @__PURE__ */ new TypeError(`No fetcher serves '${s}:'.`));
|
|
1126
|
+
try {
|
|
1127
|
+
return r(e, t);
|
|
1128
|
+
} catch (e) {
|
|
1129
|
+
return Promise.reject(e);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
register(e, t) {
|
|
1133
|
+
const s = cr(e), r = this._handlers.get(s);
|
|
1134
|
+
return this._handlers.set(s, t), () => {
|
|
1135
|
+
this._handlers.get(s) === t && (r ? this._handlers.set(s, r) : this._handlers.delete(s));
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
get isIFetcher() {
|
|
1139
|
+
return !0;
|
|
1140
|
+
}
|
|
1141
|
+
}, gr = /* @__PURE__ */ new Set([
|
|
1142
|
+
101,
|
|
1143
|
+
103,
|
|
1144
|
+
204,
|
|
1145
|
+
205,
|
|
1146
|
+
304
|
|
1147
|
+
]), mr = (e) => new Response(gr.has(e.status) ? null : e.body, {
|
|
1148
|
+
status: e.status,
|
|
1149
|
+
statusText: e.statusText,
|
|
1150
|
+
headers: e.headers
|
|
1151
|
+
}), _r = class {
|
|
1152
|
+
constructor(e, t) {
|
|
1153
|
+
this._kept = /* @__PURE__ */ new Map(), this._cached = /* @__PURE__ */ new Map(), this._inFlight = /* @__PURE__ */ new Map(), this._resources = e, this._fetcher = t;
|
|
1154
|
+
}
|
|
1155
|
+
getFetcher() {
|
|
1156
|
+
return this._fetcher;
|
|
1157
|
+
}
|
|
1158
|
+
async fetch(e, t) {
|
|
1159
|
+
if (((e) => !e || (!e.method || "GET" === e.method.toUpperCase()) && !e.body)(t) && "reload" !== t?.cache) {
|
|
1160
|
+
const s = this._kept.get(e) ?? this._findHeld(e);
|
|
1161
|
+
if (s && !s.isClosed()) return this._fromKept(s);
|
|
1162
|
+
const r = this._cached.get(e);
|
|
1163
|
+
if (r) return mr(r);
|
|
1164
|
+
let i = this._inFlight.get(e);
|
|
1165
|
+
return i || (i = this._request(e, {
|
|
1166
|
+
...t,
|
|
1167
|
+
signal: void 0
|
|
1168
|
+
}).finally(() => {
|
|
1169
|
+
this._inFlight.delete(e);
|
|
1170
|
+
}), this._inFlight.set(e, i)), mr(await ((e, t) => t ? t.aborted ? Promise.reject(t.reason) : new Promise((s, r) => {
|
|
1171
|
+
const i = () => r(t.reason);
|
|
1172
|
+
t.addEventListener("abort", i, { once: !0 }), e.then(s, r).finally(() => t.removeEventListener("abort", i));
|
|
1173
|
+
}) : e)(i, t?.signal));
|
|
1174
|
+
}
|
|
1175
|
+
return mr(await this._request(e, t));
|
|
1176
|
+
}
|
|
1177
|
+
adopt(e) {
|
|
1178
|
+
for (const t of e) {
|
|
1179
|
+
const e = t.getFetchedFrom();
|
|
1180
|
+
e && !t.isClosed() && this.keep(e, t);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
keep(e, t) {
|
|
1184
|
+
const s = this._kept.get(e);
|
|
1185
|
+
s !== t && (t.addReference(this), this._kept.set(e, t), s && !s.isClosed() && s.deleteReference(this));
|
|
1186
|
+
}
|
|
1187
|
+
_findHeld(e) {
|
|
1188
|
+
for (const t of this._resources.getItems()) if (t.getFetchedFrom() === e && !t.isClosed()) return this.keep(e, t), t;
|
|
1189
|
+
return null;
|
|
1190
|
+
}
|
|
1191
|
+
async _fromKept(e) {
|
|
1192
|
+
const [t, s] = await Promise.all([e.toBuffer(), e.getType()]);
|
|
1193
|
+
return mr({
|
|
1194
|
+
status: 200,
|
|
1195
|
+
statusText: "OK",
|
|
1196
|
+
headers: s ? [["content-type", s.mime]] : [],
|
|
1197
|
+
body: t
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
async _request(e, t) {
|
|
1201
|
+
const s = await this._fetcher.fetch(e, t), r = gr.has(s.status) ? null : await s.arrayBuffer(), i = [];
|
|
1202
|
+
s.headers.forEach((e, t) => {
|
|
1203
|
+
i.push([t, e]);
|
|
1204
|
+
});
|
|
1205
|
+
const o = {
|
|
1206
|
+
status: s.status,
|
|
1207
|
+
statusText: s.statusText,
|
|
1208
|
+
headers: i,
|
|
1209
|
+
body: r
|
|
1210
|
+
};
|
|
1211
|
+
if (s.ok && r && r.byteLength > 0) {
|
|
1212
|
+
const t = await new C({ source: { buffer: r } }).getType();
|
|
1213
|
+
t?.mime.startsWith("image/") ? (o.headers = i.filter(([e]) => "content-type" !== e.toLowerCase()), o.headers.push(["content-type", t.mime])) : this._cached.set(e, o);
|
|
1214
|
+
}
|
|
1215
|
+
return o;
|
|
1216
|
+
}
|
|
1217
|
+
}, fr = class {
|
|
1111
1218
|
constructor(e, t, s, r) {
|
|
1112
|
-
this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = s, this._topLeft = t ??
|
|
1219
|
+
this._mergedReading = [], this._colsReading = [], this._rowsReading = [], this._styles = s, this._topLeft = t ?? ns.EmptyCell, this._sheet = new dt({
|
|
1113
1220
|
runtime: e,
|
|
1114
1221
|
styles: this._styles,
|
|
1115
1222
|
calcOnLoad: "none",
|
|
@@ -1131,40 +1238,40 @@ var qs, $s = class {
|
|
|
1131
1238
|
e.includes(r) && delete i[r];
|
|
1132
1239
|
}
|
|
1133
1240
|
}
|
|
1134
|
-
const o =
|
|
1241
|
+
const o = jt(i.fontFamily);
|
|
1135
1242
|
r.font = {}, o && (r.font.family = o.family, r.font.fallbacks = o.fallbacks, r.font.size = o.size), r.font.size = i.fontSize, r.font.weight = i.fontWeight, r.font.style = i.fontStyle, r.font.color = i.color;
|
|
1136
|
-
const n =
|
|
1137
|
-
r.font.underline = n.underline, r.font.strike = n.strike ?
|
|
1243
|
+
const n = Wt(i.textDecoration);
|
|
1244
|
+
r.font.underline = n.underline, r.font.strike = n.strike ? At.StrikeStyle.Single : At.StrikeStyle.None, i.textUnderlineStyle && (r.font.underline = Zt(i.textUnderlineStyle)), r.alignment = {}, i?.textAlign && (r.alignment.horizontal = Tt(i.textAlign)), i?.textAlign && !r.alignment.horizontal && "general" !== i?.textAlign && ("center-across" === i.textAlign ? r.alignment.horizontal = Ut.HorizontalAlignment.CenterContinuous : "fill" === i.textAlign ? r.alignment.horizontal = Ut.HorizontalAlignment.Fill : "121" === i.textAlign || "010" === i.textAlign ? (r.alignment.horizontal = Ut.HorizontalAlignment.Distributed, r.alignment.justifyLastLine = "121" === i.textAlign) : console.warn("unknown text-align", i.textAlign)), i.verticalAlign && ("super" === i.verticalAlign.toLowerCase() ? r.font.baseline = Kt.Baseline.Superscript : "sub" === i.verticalAlign.toLowerCase() ? r.font.baseline = Kt.Baseline.Subscript : r.alignment.vertical = Nt(i.verticalAlign), r.alignment.vertical || ("121" === i.verticalAlign ? r.alignment.vertical = Ut.VerticalAlignment.Distributed : console.warn("unknown vertical-align", i.verticalAlign))), i.msoCharIndentCount && (r.alignment.indent = i.msoCharIndentCount), i.whiteSpace && (r.alignment.overflow = "no-wrap" === i.whiteSpace || "nowrap" === i.whiteSpace ? Ut.Overflow.Visible : Ut.Overflow.Wrap), "shrinktofit" === i.msoTextControl && (r.alignment.overflow = Ut.Overflow.Shrink);
|
|
1138
1245
|
let a = null;
|
|
1139
1246
|
if (i.background ? a = i.background : i.backgroundColor && (a = i.backgroundColor), a && (r.fill = { color: a }), i.msoPattern) {
|
|
1140
|
-
let e =
|
|
1141
|
-
e && (e.patternType ===
|
|
1247
|
+
let e = Mt(i.msoPattern);
|
|
1248
|
+
e && (e.patternType === zt.BuiltInSheetPattern.Solid ? r.fill = { color: e.foreground } : e.patternType !== zt.BuiltInSheetPattern.None && (a && (e.background = a), r.fill = e));
|
|
1142
1249
|
}
|
|
1143
|
-
"vertical" === i.layoutFlow || "vertical-ideographic" === i.layoutFlow ? r.alignment.stacked = !0 : void 0 !== i.msoRotate && (r.alignment.rotation =
|
|
1250
|
+
"vertical" === i.layoutFlow || "vertical-ideographic" === i.layoutFlow ? r.alignment.stacked = !0 : void 0 !== i.msoRotate && (r.alignment.rotation = Lt(i.msoRotate));
|
|
1144
1251
|
const l = (e, t) => {
|
|
1145
1252
|
e && (r.borders || (r.borders = {}), r.borders[e] = t);
|
|
1146
1253
|
};
|
|
1147
1254
|
i.border && "none" !== i.border && (l("top", i.border), l("left", i.border), l("right", i.border), l("bottom", i.border)), i.borderTop && l("top", i.borderTop), i.borderLeft && l("left", i.borderLeft), i.borderRight && l("right", i.borderRight), i.borderBottom && l("bottom", i.borderBottom), i.msoDiagonalUp && l("diagonalUp", i.msoDiagonalUp), i.msoDiagonalDown && l("diagonalDown", i.msoDiagonalDown);
|
|
1148
1255
|
let h = r.numberFormat;
|
|
1149
|
-
i.msoNumberFormat && (h =
|
|
1256
|
+
i.msoNumberFormat && (h = Gt(i.msoNumberFormat), h.includes("\\") ? h = null : "Fixed" === h ? h = Jt.Styles.lookupStyle(r.numberFormat).formatType === Jt.Type.Number ? null : Jt.Type.Number : "Percent" === h && (h = Jt.Styles.lookupStyle(r.numberFormat).formatType === Jt.Type.Percentage ? null : Jt.Type.Percentage)), h && (r.numberFormat = h), e.style = this._styles.normalize(r), s && 0 === Object.keys(e.style).length && delete e.style;
|
|
1150
1257
|
}
|
|
1151
1258
|
onCell(e, t, s, r, i) {
|
|
1152
1259
|
const o = r(i);
|
|
1153
1260
|
let n = { value: void 0 !== t ? t : s ?? "" };
|
|
1154
1261
|
if ("string" == typeof n.value && 0 === n.value.length && (n.value = void 0), o && this.applyCSSStyle(n, o), "string" == typeof n.value && /^#+$/.test(n.value)) {
|
|
1155
1262
|
const e = n.style?.numberFormat;
|
|
1156
|
-
e && (
|
|
1263
|
+
e && (Bt(e) || Ot(e)) && (n.value = ss.BuiltIn.Num);
|
|
1157
1264
|
}
|
|
1158
1265
|
if ("TD" === i?.tagName.toUpperCase()) {
|
|
1159
1266
|
let e = n.style, t = e?.font ?? {};
|
|
1160
|
-
(i.querySelectorAll("s").length > 0 || i.querySelectorAll("strike").length > 0) && (t.strike =
|
|
1267
|
+
(i.querySelectorAll("s").length > 0 || i.querySelectorAll("strike").length > 0) && (t.strike = At.StrikeStyle.Single), i.querySelectorAll("sub").length > 0 && (t.baseline = Kt.Baseline.Subscript), i.querySelectorAll("sup").length > 0 && (t.baseline = Kt.Baseline.Superscript), (i.querySelectorAll("b").length > 0 || i.querySelectorAll("strong").length > 0) && (t.weight = 700), i.querySelectorAll("i").length > 0 && (t.style = At.Style.Italic), i.querySelectorAll("u").length > 0 && (t.underline = At.UnderlineStyle.Single), Object.keys(t).length > 0 && (e || (e = {}, n.style = e), e.font || (e.font = t));
|
|
1161
1268
|
const s = i.querySelectorAll("a");
|
|
1162
1269
|
if (s.length > 0) {
|
|
1163
1270
|
const e = s[0].getAttribute("href");
|
|
1164
1271
|
e && (n.hyperlink = e);
|
|
1165
1272
|
}
|
|
1166
1273
|
}
|
|
1167
|
-
if (!
|
|
1274
|
+
if (!ns.isSingleCell(e)) {
|
|
1168
1275
|
const t = {
|
|
1169
1276
|
rowStart: this._topLeft.rowIndex + e.rowStart,
|
|
1170
1277
|
colStart: this._topLeft.colIndex + e.colStart,
|
|
@@ -1175,7 +1282,7 @@ var qs, $s = class {
|
|
|
1175
1282
|
}
|
|
1176
1283
|
if (void 0 === n.value && !n.style && Object.keys(n).length <= 1) return;
|
|
1177
1284
|
const a = this._builder, l = this._topLeft;
|
|
1178
|
-
if (a.pushAt(l.rowIndex + e.rowStart, l.colIndex + e.colStart, n), !
|
|
1285
|
+
if (a.pushAt(l.rowIndex + e.rowStart, l.colIndex + e.colStart, n), !ns.isSingleCell(e) && o.msoIgnore) {
|
|
1179
1286
|
if (o.msoIgnore.includes("colspan")) {
|
|
1180
1287
|
const t = {};
|
|
1181
1288
|
o && this.applyCSSStyle(t, o);
|
|
@@ -1205,9 +1312,9 @@ var qs, $s = class {
|
|
|
1205
1312
|
if ("userset" !== i.msoHeightSource) return;
|
|
1206
1313
|
if (!r) return;
|
|
1207
1314
|
let o = r.getAttribute("height") ?? i.height, n = null;
|
|
1208
|
-
if (o && (n =
|
|
1315
|
+
if (o && (n = Et(o, this._styles.getNormal().getFont().getSize(), "px")), null === n) for (let e = 0; e < r.cells.length; e++) {
|
|
1209
1316
|
const t = r.cells[e], i = t.getAttribute("height") ?? s(t).height;
|
|
1210
|
-
let o =
|
|
1317
|
+
let o = Et(i, this._styles.getNormal().getFont().getSize(), "px");
|
|
1211
1318
|
null !== o && (n = Math.max(o, n ?? 0));
|
|
1212
1319
|
}
|
|
1213
1320
|
null !== n && this._rowsReading.push({
|
|
@@ -1215,7 +1322,7 @@ var qs, $s = class {
|
|
|
1215
1322
|
min: this._topLeft.rowIndex + e,
|
|
1216
1323
|
max: this._topLeft.rowIndex + e + t - 1
|
|
1217
1324
|
},
|
|
1218
|
-
update: { size: n *
|
|
1325
|
+
update: { size: n * At.getDeviceScale() }
|
|
1219
1326
|
});
|
|
1220
1327
|
}
|
|
1221
1328
|
onColumn(e, t, s, r) {
|
|
@@ -1223,12 +1330,12 @@ var qs, $s = class {
|
|
|
1223
1330
|
if ("userset" !== i.msoWidthSource) return;
|
|
1224
1331
|
if (!r) return;
|
|
1225
1332
|
let o = r.getAttribute("width") ?? i.width, n = null;
|
|
1226
|
-
o && (n =
|
|
1333
|
+
o && (n = Et(o, this._styles.getNormal().getFont().getSize(), "px")), null !== n && this._colsReading.push({
|
|
1227
1334
|
address: {
|
|
1228
1335
|
min: this._topLeft.colIndex + e,
|
|
1229
1336
|
max: this._topLeft.colIndex + e + t - 1
|
|
1230
1337
|
},
|
|
1231
|
-
update: { size: n *
|
|
1338
|
+
update: { size: n * At.getDeviceScale() }
|
|
1232
1339
|
});
|
|
1233
1340
|
}
|
|
1234
1341
|
onDone() {
|
|
@@ -1239,9 +1346,9 @@ var qs, $s = class {
|
|
|
1239
1346
|
sheet() {
|
|
1240
1347
|
return this._sheet;
|
|
1241
1348
|
}
|
|
1242
|
-
},
|
|
1349
|
+
}, pr = class {
|
|
1243
1350
|
constructor(e) {
|
|
1244
|
-
if (!e) throw new
|
|
1351
|
+
if (!e) throw new ds("snapshot is required.");
|
|
1245
1352
|
this._snapshot = e;
|
|
1246
1353
|
}
|
|
1247
1354
|
getItemType() {
|
|
@@ -1271,10 +1378,10 @@ var qs, $s = class {
|
|
|
1271
1378
|
get isClipboardItem() {
|
|
1272
1379
|
return !0;
|
|
1273
1380
|
}
|
|
1274
|
-
},
|
|
1381
|
+
}, wr = class {
|
|
1275
1382
|
constructor(e, t, s, r, i) {
|
|
1276
|
-
if (this._parsed = void 0, this._runtime = e, !t) throw new
|
|
1277
|
-
this._topLeft = s ??
|
|
1383
|
+
if (this._parsed = void 0, this._runtime = e, !t) throw new ds("nativeItems are required.");
|
|
1384
|
+
this._topLeft = s ?? ns.EmptyCell, this._native = t, this._markOptions = Object.freeze(r ?? {}), this._styles = i;
|
|
1278
1385
|
}
|
|
1279
1386
|
getItemType() {
|
|
1280
1387
|
return "range";
|
|
@@ -1319,16 +1426,16 @@ var qs, $s = class {
|
|
|
1319
1426
|
async parse() {
|
|
1320
1427
|
let e, t = this._native?.text, s = this._native.html;
|
|
1321
1428
|
if (null === s && t && t.includes("<table")) try {
|
|
1322
|
-
const e = new DOMParser().parseFromString(t,
|
|
1323
|
-
if (r) throw new
|
|
1429
|
+
const e = new DOMParser().parseFromString(t, cs.Html), r = e.querySelector("parsererror");
|
|
1430
|
+
if (r) throw new ls("Unable to parse: " + r);
|
|
1324
1431
|
s = e, t = null;
|
|
1325
1432
|
} catch (e) {
|
|
1326
1433
|
console.warn("Discovered text as html table but could could not parse.");
|
|
1327
1434
|
}
|
|
1328
1435
|
try {
|
|
1329
|
-
const r = new
|
|
1436
|
+
const r = new fr(this._runtime, this._topLeft, this._styles, s ? "HTML" : "Text"), i = await Promise.resolve(t ? R(t) : [[]]);
|
|
1330
1437
|
let o;
|
|
1331
|
-
if (
|
|
1438
|
+
if (b(s, i, r) ? (e = r.sheet(), o = e.getUsedRange()) : s = null, o) {
|
|
1332
1439
|
const t = o.getSnapshot();
|
|
1333
1440
|
return this._parsed = {
|
|
1334
1441
|
prepare: (e, s) => t.prepare?.(e, s),
|
|
@@ -1351,7 +1458,7 @@ var qs, $s = class {
|
|
|
1351
1458
|
sheet: r,
|
|
1352
1459
|
options: await r.getMovables()._preparePicture({ source: { buffer: e } }, {
|
|
1353
1460
|
type: "picture",
|
|
1354
|
-
description:
|
|
1461
|
+
description: ps("op.copyImageFromClipboard"),
|
|
1355
1462
|
autoSelect: !0
|
|
1356
1463
|
})
|
|
1357
1464
|
};
|
|
@@ -1369,7 +1476,7 @@ var qs, $s = class {
|
|
|
1369
1476
|
get isClipboardItem() {
|
|
1370
1477
|
return !0;
|
|
1371
1478
|
}
|
|
1372
|
-
},
|
|
1479
|
+
}, yr = class {
|
|
1373
1480
|
constructor(t) {
|
|
1374
1481
|
this._closed = !1, this._kind = t.kind, this._id = t.id, this._part = t.part, this._styles = t.styles, this._tabColor = t.tabColor ? this._styles.parseColor(t.tabColor) : null, this._transactions = t.transactions, this._workbook = t.workbook ?? null, this._container = t.container, this._emitter = new e(this, this._transactions);
|
|
1375
1482
|
}
|
|
@@ -1386,11 +1493,11 @@ var qs, $s = class {
|
|
|
1386
1493
|
return this._assertOpen(), this._container.setName(e, t), this;
|
|
1387
1494
|
}
|
|
1388
1495
|
getVisibility() {
|
|
1389
|
-
return this._closed ?
|
|
1496
|
+
return this._closed ? be.Visibility.VeryHidden : this._container.getVisibility();
|
|
1390
1497
|
}
|
|
1391
1498
|
setVisibility(e = !0, t) {
|
|
1392
1499
|
let s;
|
|
1393
|
-
return this._assertOpen(), s = !0 === e ?
|
|
1500
|
+
return this._assertOpen(), s = !0 === e ? be.Visibility.Visible : !1 === e ? be.Visibility.Hidden : e, this._container.setVisibility(s, t), this;
|
|
1394
1501
|
}
|
|
1395
1502
|
getIndex() {
|
|
1396
1503
|
return this._container.getIndex();
|
|
@@ -1412,12 +1519,12 @@ var qs, $s = class {
|
|
|
1412
1519
|
}
|
|
1413
1520
|
delete() {
|
|
1414
1521
|
if (this._closed) return;
|
|
1415
|
-
const e = this._transactions.beginCommit({ description:
|
|
1522
|
+
const e = this._transactions.beginCommit({ description: ws("op.deleteSheet", { name: this.getName() }) });
|
|
1416
1523
|
try {
|
|
1417
1524
|
try {
|
|
1418
1525
|
this._notify("onBeforeDelete");
|
|
1419
1526
|
} catch (e) {
|
|
1420
|
-
throw e instanceof Error ? e : new
|
|
1527
|
+
throw e instanceof Error ? e : new ls(e?.message ?? ws("error.sheet.modelDelete"));
|
|
1421
1528
|
}
|
|
1422
1529
|
this._notify("onDelete"), e.commit();
|
|
1423
1530
|
} catch (t) {
|
|
@@ -1443,7 +1550,7 @@ var qs, $s = class {
|
|
|
1443
1550
|
this._emitter.notify(e);
|
|
1444
1551
|
}
|
|
1445
1552
|
_assertOpen() {
|
|
1446
|
-
if (this._closed) throw new Error(
|
|
1553
|
+
if (this._closed) throw new Error(ws("error.sheet.modelClosed"));
|
|
1447
1554
|
}
|
|
1448
1555
|
get [Symbol.toStringTag]() {
|
|
1449
1556
|
return "[OpaqueSheet]";
|
|
@@ -1458,12 +1565,12 @@ var qs, $s = class {
|
|
|
1458
1565
|
return !0;
|
|
1459
1566
|
}
|
|
1460
1567
|
};
|
|
1461
|
-
(
|
|
1568
|
+
(rr || (rr = {})).Visibility = {
|
|
1462
1569
|
Visible: "visible",
|
|
1463
1570
|
Hidden: "hidden",
|
|
1464
1571
|
VeryHidden: "veryHidden"
|
|
1465
1572
|
};
|
|
1466
|
-
var
|
|
1573
|
+
var Sr, br = {
|
|
1467
1574
|
showFormulaBar: !0,
|
|
1468
1575
|
showTabs: !0,
|
|
1469
1576
|
tabRatio: 600,
|
|
@@ -1474,11 +1581,11 @@ var sr, rr = {
|
|
|
1474
1581
|
firstTab: 0,
|
|
1475
1582
|
windowBounds: null,
|
|
1476
1583
|
minimized: !1,
|
|
1477
|
-
visibility:
|
|
1584
|
+
visibility: rr.Visibility.Visible,
|
|
1478
1585
|
autoFilterDateGrouping: !0
|
|
1479
|
-
},
|
|
1586
|
+
}, kr = class {
|
|
1480
1587
|
constructor(t) {
|
|
1481
|
-
this._id =
|
|
1588
|
+
this._id = os.uuidV4(), this._emitter = new e(this), this._state = { ...br }, t?.json && this._fromJSON(t?.json);
|
|
1482
1589
|
}
|
|
1483
1590
|
getId() {
|
|
1484
1591
|
return this._id;
|
|
@@ -1567,7 +1674,7 @@ var sr, rr = {
|
|
|
1567
1674
|
const t = Object.keys(this._state), s = t.length;
|
|
1568
1675
|
for (let r = 0; r < s; r++) {
|
|
1569
1676
|
const s = t[r], i = this._state[s];
|
|
1570
|
-
null != i && i !==
|
|
1677
|
+
null != i && i !== br[s] && (e[s] = i);
|
|
1571
1678
|
}
|
|
1572
1679
|
return 0 === Object.keys(e).length && (e = null), e;
|
|
1573
1680
|
}
|
|
@@ -1577,7 +1684,7 @@ var sr, rr = {
|
|
|
1577
1684
|
}
|
|
1578
1685
|
update(e, t = !0) {
|
|
1579
1686
|
this._state = {
|
|
1580
|
-
...
|
|
1687
|
+
...br,
|
|
1581
1688
|
...this._state,
|
|
1582
1689
|
...e
|
|
1583
1690
|
}, t && this._emitter.notify("onViewChange");
|
|
@@ -1592,13 +1699,13 @@ var sr, rr = {
|
|
|
1592
1699
|
get isIWorkbookView() {
|
|
1593
1700
|
return !0;
|
|
1594
1701
|
}
|
|
1595
|
-
},
|
|
1702
|
+
}, Cr = Object.freeze({
|
|
1596
1703
|
structure: !1,
|
|
1597
1704
|
windows: !1,
|
|
1598
1705
|
revision: !0,
|
|
1599
1706
|
password: null,
|
|
1600
1707
|
revisionsPassword: null
|
|
1601
|
-
}),
|
|
1708
|
+
}), vr = class extends te {
|
|
1602
1709
|
isWindowsAllowed() {
|
|
1603
1710
|
return this._isPropertyAllowed("windows");
|
|
1604
1711
|
}
|
|
@@ -1620,7 +1727,7 @@ var sr, rr = {
|
|
|
1620
1727
|
const s = Object.keys(t), r = s.length;
|
|
1621
1728
|
for (let i = 0; i < r; i++) {
|
|
1622
1729
|
const r = s[i], o = t[r];
|
|
1623
|
-
null != o && o !==
|
|
1730
|
+
null != o && o !== Cr[r] && (e[r] = o);
|
|
1624
1731
|
}
|
|
1625
1732
|
}
|
|
1626
1733
|
return super._toJSON(e);
|
|
@@ -1632,38 +1739,38 @@ var sr, rr = {
|
|
|
1632
1739
|
return !0;
|
|
1633
1740
|
}
|
|
1634
1741
|
};
|
|
1635
|
-
(
|
|
1742
|
+
(Sr || (Sr = {})).Type = {
|
|
1636
1743
|
Number: "number",
|
|
1637
1744
|
Boolean: "boolean",
|
|
1638
1745
|
Date: "date",
|
|
1639
1746
|
String: "string",
|
|
1640
1747
|
Float: "float"
|
|
1641
1748
|
};
|
|
1642
|
-
var
|
|
1749
|
+
var Ir = (e) => {
|
|
1643
1750
|
if ("string" == typeof e) return {
|
|
1644
|
-
type:
|
|
1751
|
+
type: Sr.Type.String,
|
|
1645
1752
|
value: e
|
|
1646
1753
|
};
|
|
1647
1754
|
if ("boolean" == typeof e) return {
|
|
1648
|
-
type:
|
|
1755
|
+
type: Sr.Type.Boolean,
|
|
1649
1756
|
value: e
|
|
1650
1757
|
};
|
|
1651
1758
|
if ("number" == typeof e) {
|
|
1652
1759
|
if (!Number.isFinite(e)) throw new Error("A custom property value must be a finite number.");
|
|
1653
1760
|
return {
|
|
1654
|
-
type: Number.isInteger(e) && e >= -2147483648 && e <= 2147483647 ?
|
|
1761
|
+
type: Number.isInteger(e) && e >= -2147483648 && e <= 2147483647 ? Sr.Type.Number : Sr.Type.Float,
|
|
1655
1762
|
value: e
|
|
1656
1763
|
};
|
|
1657
1764
|
}
|
|
1658
1765
|
if (e instanceof Date) {
|
|
1659
1766
|
if (isNaN(e.getTime())) throw new Error("A custom property value must be a valid date.");
|
|
1660
1767
|
return {
|
|
1661
|
-
type:
|
|
1768
|
+
type: Sr.Type.Date,
|
|
1662
1769
|
value: e.toISOString()
|
|
1663
1770
|
};
|
|
1664
1771
|
}
|
|
1665
1772
|
throw new Error("A custom property value must be a string, number, boolean or Date.");
|
|
1666
|
-
},
|
|
1773
|
+
}, Nr = class {
|
|
1667
1774
|
constructor(e, t) {
|
|
1668
1775
|
this._json = e, this._owner = t;
|
|
1669
1776
|
}
|
|
@@ -1678,12 +1785,12 @@ var ar = (e) => {
|
|
|
1678
1785
|
}
|
|
1679
1786
|
getValue() {
|
|
1680
1787
|
const { type: e, value: t } = this._json;
|
|
1681
|
-
return e ===
|
|
1788
|
+
return e === Sr.Type.Date ? new Date(t) : t;
|
|
1682
1789
|
}
|
|
1683
1790
|
setValue(e) {
|
|
1684
1791
|
this._owner._assertCustomEditable(this), this._json = {
|
|
1685
1792
|
...this._json,
|
|
1686
|
-
...
|
|
1793
|
+
...Ir(e)
|
|
1687
1794
|
};
|
|
1688
1795
|
}
|
|
1689
1796
|
delete() {
|
|
@@ -1692,7 +1799,7 @@ var ar = (e) => {
|
|
|
1692
1799
|
toJSON() {
|
|
1693
1800
|
return { ...this._json };
|
|
1694
1801
|
}
|
|
1695
|
-
},
|
|
1802
|
+
}, Or = class {
|
|
1696
1803
|
constructor(e) {
|
|
1697
1804
|
this._json = {}, this._custom = [], this._assertOpen = e;
|
|
1698
1805
|
}
|
|
@@ -1782,9 +1889,9 @@ var ar = (e) => {
|
|
|
1782
1889
|
if (this._assertOpen(), "string" != typeof e || "" === e) throw new Error("A custom property needs a name.");
|
|
1783
1890
|
const s = this.getCustomProperty(e);
|
|
1784
1891
|
if (s) return s.setValue(t), s;
|
|
1785
|
-
const r = new
|
|
1892
|
+
const r = new Nr({
|
|
1786
1893
|
key: e,
|
|
1787
|
-
...
|
|
1894
|
+
...Ir(t)
|
|
1788
1895
|
}, this);
|
|
1789
1896
|
return this._custom.push(r), r;
|
|
1790
1897
|
}
|
|
@@ -1799,26 +1906,26 @@ var ar = (e) => {
|
|
|
1799
1906
|
}
|
|
1800
1907
|
fromJSON(e) {
|
|
1801
1908
|
const { custom: t, ...s } = e ?? {};
|
|
1802
|
-
this._json = s, this._custom = (t ?? []).map((e) => new
|
|
1909
|
+
this._json = s, this._custom = (t ?? []).map((e) => new Nr({ ...e }, this));
|
|
1803
1910
|
}
|
|
1804
1911
|
toJSON() {
|
|
1805
1912
|
const e = { ...this._json };
|
|
1806
1913
|
return this._custom.length > 0 && (e.custom = this._custom.map((e) => e.toJSON())), e;
|
|
1807
1914
|
}
|
|
1808
1915
|
};
|
|
1809
|
-
function
|
|
1810
|
-
return
|
|
1916
|
+
function Rr(e) {
|
|
1917
|
+
return ws("error.workbook.invalidSheetKey", { key: e });
|
|
1811
1918
|
}
|
|
1812
|
-
function
|
|
1813
|
-
return
|
|
1919
|
+
function xr(e) {
|
|
1920
|
+
return ws("error.workbook.sheetNameNotFound", { sheetName: e });
|
|
1814
1921
|
}
|
|
1815
|
-
function
|
|
1816
|
-
return
|
|
1922
|
+
function Er(e, t) {
|
|
1923
|
+
return ws("chart" === t ? "error.workbook.sheetIsChart" : "macro" === t ? "error.workbook.sheetIsMacro" : "error.workbook.sheetIsDialog", { sheetName: e });
|
|
1817
1924
|
}
|
|
1818
|
-
function
|
|
1819
|
-
return "chart" === t ?
|
|
1925
|
+
function Lr(e, t) {
|
|
1926
|
+
return "chart" === t ? ws("error.workbook.selectedIsChart", { sheetName: e }) : "macro" === t ? ws("error.workbook.selectedIsMacro", { sheetName: e }) : "dialog" === t ? ws("error.workbook.selectedIsDialog", { sheetName: e }) : ws("error.workbook.noWorksheet");
|
|
1820
1927
|
}
|
|
1821
|
-
var
|
|
1928
|
+
var Ar = class extends St {
|
|
1822
1929
|
constructor(e, t, s, r) {
|
|
1823
1930
|
super(), this._add = e, this._get = t, this._addListeners = s, this._getSelected = r;
|
|
1824
1931
|
}
|
|
@@ -1849,39 +1956,39 @@ var mr = class extends ee {
|
|
|
1849
1956
|
get isIWorksheetCollection() {
|
|
1850
1957
|
return !0;
|
|
1851
1958
|
}
|
|
1852
|
-
},
|
|
1853
|
-
function
|
|
1854
|
-
const t =
|
|
1959
|
+
}, Vr = /* @__PURE__ */ new RegExp(/[\\/\\*?:[\]]+/), Tr = /* @__PURE__ */ new RegExp(/\(((\d+)(?!.*\d))\)$/, "g");
|
|
1960
|
+
function Pr(e) {
|
|
1961
|
+
const t = ws(ps("workbook.defaultSheetName"), { n: e + 1 });
|
|
1855
1962
|
return "workbook.defaultSheetName" === t ? `Sheet${e + 1}` : t;
|
|
1856
1963
|
}
|
|
1857
|
-
function
|
|
1964
|
+
function Fr(e, t) {
|
|
1858
1965
|
return {
|
|
1859
|
-
...
|
|
1966
|
+
...ft,
|
|
1860
1967
|
getWorksheet: () => null,
|
|
1861
|
-
toString: () =>
|
|
1968
|
+
toString: () => et(e, t)
|
|
1862
1969
|
};
|
|
1863
1970
|
}
|
|
1864
|
-
function
|
|
1865
|
-
if (!e) throw new Error(
|
|
1866
|
-
if (
|
|
1971
|
+
function Wr(e, t = !1) {
|
|
1972
|
+
if (!e) throw new Error(ws("error.workbook.sheetNameBlank"));
|
|
1973
|
+
if (Vr.test(e)) {
|
|
1867
1974
|
if (!t) throw new Error(function(e) {
|
|
1868
|
-
return e ?
|
|
1975
|
+
return e ? ws("error.workbook.sheetNameInvalidCharsNamed", { sheetName: e }) : ws("error.workbook.sheetNameInvalidChars");
|
|
1869
1976
|
}(e));
|
|
1870
|
-
e = e.replace(
|
|
1977
|
+
e = e.replace(Vr, "");
|
|
1871
1978
|
}
|
|
1872
|
-
if (0 === e.length) throw new Error(
|
|
1979
|
+
if (0 === e.length) throw new Error(ws("error.workbook.sheetNameBlank"));
|
|
1873
1980
|
const s = e.length;
|
|
1874
1981
|
if (s > 31) {
|
|
1875
|
-
if (!t) throw new Error(
|
|
1982
|
+
if (!t) throw new Error(ws("error.workbook.sheetNameTooLong"));
|
|
1876
1983
|
e = e.substring(0, 31);
|
|
1877
1984
|
}
|
|
1878
1985
|
if ("'" === e.charAt(0) || "'" === e.charAt(s - 1)) {
|
|
1879
|
-
if (!t) throw new Error(
|
|
1986
|
+
if (!t) throw new Error(ws("error.workbook.sheetNameQuotes"));
|
|
1880
1987
|
e = e.replace(/^'|'$/g, "");
|
|
1881
1988
|
}
|
|
1882
1989
|
return e;
|
|
1883
1990
|
}
|
|
1884
|
-
var
|
|
1991
|
+
var Br, jr = "workbook.activeSheet", Mr = class e extends u {
|
|
1885
1992
|
constructor(e, t, s, r) {
|
|
1886
1993
|
super(e, t, r), this._workbook = s;
|
|
1887
1994
|
}
|
|
@@ -1892,24 +1999,24 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
1892
1999
|
let r = this._options;
|
|
1893
2000
|
return s && (r = {
|
|
1894
2001
|
...this._options,
|
|
1895
|
-
getOptions:
|
|
2002
|
+
getOptions: Ce(this._options?.getOptions, s)
|
|
1896
2003
|
}), new e(t, this._internal, this._workbook, r);
|
|
1897
2004
|
}
|
|
1898
2005
|
_createRange(e, t) {
|
|
1899
|
-
const s = e ? { ...e } : null, r = this._workbook, i = s ? r._getSheetRef(s.scope,
|
|
1900
|
-
if (i && !i.sheet.isIWorksheet) throw new
|
|
2006
|
+
const s = e ? { ...e } : null, r = this._workbook, i = s ? r._getSheetRef(s.scope, be.Visibility.VeryHidden) : null;
|
|
2007
|
+
if (i && !i.sheet.isIWorksheet) throw new ls(Er(i.name, i.sheet.getKind()));
|
|
1901
2008
|
if (!i) {
|
|
1902
2009
|
const e = r._anchorWorksheet();
|
|
1903
|
-
return delete s?.scope,
|
|
1904
|
-
scope:
|
|
2010
|
+
return delete s?.scope, Fr(s, s ? {
|
|
2011
|
+
scope: pe,
|
|
1905
2012
|
...e.getEntireRange().getCoords()
|
|
1906
2013
|
} : null);
|
|
1907
2014
|
}
|
|
1908
2015
|
let o = this._options;
|
|
1909
2016
|
return t && (o = {
|
|
1910
2017
|
...this._options,
|
|
1911
|
-
getOptions:
|
|
1912
|
-
}), new
|
|
2018
|
+
getOptions: Ce(this._options.getOptions, t)
|
|
2019
|
+
}), new Dr(e, yt(i.sheet), this._workbook, o);
|
|
1913
2020
|
}
|
|
1914
2021
|
async select(e) {
|
|
1915
2022
|
const t = [];
|
|
@@ -1935,15 +2042,15 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
1935
2042
|
}
|
|
1936
2043
|
getAddress(e) {
|
|
1937
2044
|
const t = this._internal.getSheet(), s = t.getEntireRange().getCoords();
|
|
1938
|
-
return
|
|
2045
|
+
return it(this.getCoords(), {
|
|
1939
2046
|
...s,
|
|
1940
2047
|
scope: t.getName()
|
|
1941
|
-
},
|
|
2048
|
+
}, et, at, e);
|
|
1942
2049
|
}
|
|
1943
2050
|
toString() {
|
|
1944
2051
|
return this.getAddress();
|
|
1945
2052
|
}
|
|
1946
|
-
},
|
|
2053
|
+
}, Dr = class e extends Z {
|
|
1947
2054
|
constructor(e, t, s, r) {
|
|
1948
2055
|
super(e, t, r), this._workbook = s;
|
|
1949
2056
|
}
|
|
@@ -1951,17 +2058,17 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
1951
2058
|
let s = this._options;
|
|
1952
2059
|
return t && (s = {
|
|
1953
2060
|
...this._options,
|
|
1954
|
-
getOptions:
|
|
1955
|
-
}), new
|
|
2061
|
+
getOptions: Ce(this._options?.getOptions, t)
|
|
2062
|
+
}), new Mr(e, this._internal, this._workbook, s);
|
|
1956
2063
|
}
|
|
1957
2064
|
_createRange(t, s) {
|
|
1958
2065
|
const r = this._internal;
|
|
1959
|
-
if (!t) return
|
|
1960
|
-
if (r.validateCoords(t), r.getSheet().isClosed()) return
|
|
2066
|
+
if (!t) return ht(r.getSheet(), r.getSheet().getEntireCoords());
|
|
2067
|
+
if (r.validateCoords(t), r.getSheet().isClosed()) return ht(null, r.getSheet().getEntireCoords(), t);
|
|
1961
2068
|
let i = this._options;
|
|
1962
2069
|
return s && (i = {
|
|
1963
2070
|
...this._options,
|
|
1964
|
-
getOptions:
|
|
2071
|
+
getOptions: Ce(this._options?.getOptions, s)
|
|
1965
2072
|
}), new e(t, this._internal, this._workbook, i);
|
|
1966
2073
|
}
|
|
1967
2074
|
addListener(e, t) {
|
|
@@ -1974,7 +2081,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
1974
2081
|
}
|
|
1975
2082
|
getAddress(e) {
|
|
1976
2083
|
const t = this._internal.getSheet(), s = t?.getEntireRange().getCoords() ?? null;
|
|
1977
|
-
return
|
|
2084
|
+
return et(this.getCoords(), {
|
|
1978
2085
|
...s,
|
|
1979
2086
|
scope: t.getName()
|
|
1980
2087
|
});
|
|
@@ -1982,13 +2089,13 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
1982
2089
|
toString() {
|
|
1983
2090
|
return this.getAddress();
|
|
1984
2091
|
}
|
|
1985
|
-
},
|
|
2092
|
+
}, zr = (e) => !!e && "object" == typeof e && "function" == typeof e.getOrigin, Hr = class {
|
|
1986
2093
|
constructor(t) {
|
|
1987
|
-
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
|
|
2094
|
+
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 fe(() => {
|
|
1988
2095
|
const e = [];
|
|
1989
2096
|
for (const t of this.getWorksheets()) e.push(...t.getPivotTables());
|
|
1990
2097
|
return e;
|
|
1991
|
-
}), this._people = new
|
|
2098
|
+
}), this._people = new nr(), this._commentCollection = new vt(null, (e, t, s) => {
|
|
1992
2099
|
const r = [];
|
|
1993
2100
|
for (const i of this.getWorksheets()) r.push(...i.getComments().getItems(e ? {
|
|
1994
2101
|
address: e,
|
|
@@ -2001,25 +2108,25 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2001
2108
|
return r;
|
|
2002
2109
|
}, (e, t) => this.addListeners({ onSheetsChange: e.onCollectionChange ? () => {
|
|
2003
2110
|
e.onCollectionChange(this._commentCollection);
|
|
2004
|
-
} : void 0 }, t)), this._isDate1904 = !1, this._codeName = null, this._updateLinks = null, this._documentProperties = new
|
|
2005
|
-
if (this._closed) throw new Error(
|
|
2006
|
-
}), this._locale = null, this._localeOverrides = null;
|
|
2111
|
+
} : void 0 }, t)), this._isDate1904 = !1, this._codeName = null, this._updateLinks = null, this._documentProperties = new Or(() => {
|
|
2112
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2113
|
+
}), this._locale = null, this._localeOverrides = null, this._startModules = /* @__PURE__ */ new WeakSet();
|
|
2007
2114
|
const s = "string" == typeof t ? { origin: t } : { ...t }, r = s.origin;
|
|
2008
|
-
this._ownOriginProvider = !
|
|
2115
|
+
this._ownOriginProvider = !zr(r), this._originProvider = zr(r) ? r : new xs("string" == typeof r ? new Is(null, { name: r }) : r ?? new Is(null)), delete s.origin, this._bindOrigin(this._originProvider.getOrigin()), this._listenerOriginProvider = this._originProvider.addListeners({ onOriginChange: () => this._onOriginChange() });
|
|
2009
2116
|
const o = s.json;
|
|
2010
|
-
delete s.json, this._transactions = s.transactions ?? new i(), this._id = this._transactions.create(), this._ownTransactions = !s.transactions, this._emitter = new e(this, this._transactions), this._runtime = s.runtime ?? new
|
|
2117
|
+
delete s.json, this._transactions = s.transactions ?? new i(), this._id = this._transactions.create(), this._ownTransactions = !s.transactions, this._emitter = new e(this, this._transactions), this._runtime = s.runtime ?? new Ie("Workbook Runtime", {
|
|
2011
2118
|
isDate1904: () => this._isDate1904,
|
|
2012
2119
|
getNow: () => this._transactions.getCurrentCommit().getTimestamp(),
|
|
2013
|
-
getLocale: () => this._locale ??
|
|
2120
|
+
getLocale: () => this._locale ?? nt() ?? Ue(),
|
|
2014
2121
|
getLocaleOverrides: () => this._localeOverrides
|
|
2015
|
-
}), this._listenerLanguage =
|
|
2122
|
+
}), this._listenerLanguage = as.addChangeListener(() => {
|
|
2016
2123
|
this._closed || this._notifyAllChange();
|
|
2017
2124
|
});
|
|
2018
|
-
const n = this,
|
|
2125
|
+
const n = this, a = this._beginCommit({ description: ps(o ? "op.openWorkbook" : "op.newWorkbook") });
|
|
2019
2126
|
try {
|
|
2020
|
-
this._strings = s.strings ?? new
|
|
2127
|
+
this._strings = s.strings ?? new U(), this._ownStrings = !s.strings, this._richValues = s.richData ?? new P(), this._resources = s.resources ?? new Q(), this._ownResources = !s.resources, this._fetch = new _r(this._resources, s.fetcher ?? new dr()), this._createSheetName = s.createSheetNameCallback ?? Pr;
|
|
2021
2128
|
let e = s.createWorksheetCallback;
|
|
2022
|
-
e || (e = (e) => new
|
|
2129
|
+
e || (e = (e) => new dt(e)), this._sheetOnNameChange = /* @__PURE__ */ new Map(), this._sheetOnVisibilityChange = /* @__PURE__ */ new Map(), this._sheetOnIndexChange = /* @__PURE__ */ new Map(), this._createSheet = (t, s, r, i, o, a, l) => {
|
|
2023
2130
|
let h = null;
|
|
2024
2131
|
const c = {
|
|
2025
2132
|
runtime: n._runtime,
|
|
@@ -2029,6 +2136,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2029
2136
|
transactions: n._transactions,
|
|
2030
2137
|
styles: n._styles,
|
|
2031
2138
|
strings: n._strings,
|
|
2139
|
+
richData: n._richValues,
|
|
2032
2140
|
resources: n._resources,
|
|
2033
2141
|
names: n._names,
|
|
2034
2142
|
workbook: n,
|
|
@@ -2039,7 +2147,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2039
2147
|
h = e, n._addSheetRef({
|
|
2040
2148
|
name: s,
|
|
2041
2149
|
id: t,
|
|
2042
|
-
visibility: r ??
|
|
2150
|
+
visibility: r ?? be.Visibility.Visible,
|
|
2043
2151
|
sheetId: o,
|
|
2044
2152
|
sheet: e
|
|
2045
2153
|
}, i);
|
|
@@ -2056,7 +2164,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2056
2164
|
},
|
|
2057
2165
|
getVisibility: () => {
|
|
2058
2166
|
const e = n._getSheetRef(h);
|
|
2059
|
-
return e ? e.visibility :
|
|
2167
|
+
return e ? e.visibility : be.Visibility.Visible;
|
|
2060
2168
|
},
|
|
2061
2169
|
setVisibility: (e, t) => {
|
|
2062
2170
|
n._setSheetVisibility(h, e, t);
|
|
@@ -2067,10 +2175,10 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2067
2175
|
duplicate: () => n._duplicateSheet(h),
|
|
2068
2176
|
getIndex: () => {
|
|
2069
2177
|
const e = n._getSheetRef(h);
|
|
2070
|
-
return e ? n._getOffsetForId(e.id, n._getSheetRefs(
|
|
2178
|
+
return e ? n._getOffsetForId(e.id, n._getSheetRefs(be.Visibility.VeryHidden)) : i;
|
|
2071
2179
|
},
|
|
2072
2180
|
setIndex: (e, t) => {
|
|
2073
|
-
const s = n._getSheetRef(h,
|
|
2181
|
+
const s = n._getSheetRef(h, be.Visibility.VeryHidden);
|
|
2074
2182
|
return !!s && (n._moveSheet(s, e, t), !0);
|
|
2075
2183
|
},
|
|
2076
2184
|
setIndexCallback: (e) => {
|
|
@@ -2080,16 +2188,16 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2080
2188
|
}
|
|
2081
2189
|
};
|
|
2082
2190
|
return a && (c.json = a), void 0 !== l && (c.uid = () => l), h = e(c, s, i, r), h;
|
|
2083
|
-
}, this._namedTableSource = new
|
|
2084
|
-
getSheets: () => n._sheets ? n.getWorksheets().getItems() :
|
|
2191
|
+
}, this._namedTableSource = new je({
|
|
2192
|
+
getSheets: () => n._sheets ? n.getWorksheets().getItems() : os.EmptyArray,
|
|
2085
2193
|
addSheetsListener: (e, t) => n.addListeners({ onSheetsChange: e }, t)
|
|
2086
|
-
}), this._names = s.names ?? new
|
|
2194
|
+
}), this._names = s.names ?? new qe({
|
|
2087
2195
|
addressToRanges: (e) => n.getRanges(e),
|
|
2088
2196
|
getCurrentScope: () => n.getSelectedWorksheet()?.getName() ?? null,
|
|
2089
2197
|
isReadOnly: () => (n._options.readonly ?? !1) || n._isStructureProtected(),
|
|
2090
2198
|
transactions: n._transactions,
|
|
2091
|
-
getSources: () => n._calculation ? [n._calculation.getNamedFormulas(), n._namedTableSource] :
|
|
2092
|
-
}), this._ownNames = !s.names, this._calculation = s.calculation ?? new
|
|
2199
|
+
getSources: () => n._calculation ? [n._calculation.getNamedFormulas(), n._namedTableSource] : os.EmptyArray
|
|
2200
|
+
}), this._ownNames = !s.names, this._calculation = s.calculation ?? new _({
|
|
2093
2201
|
runtime: n._runtime,
|
|
2094
2202
|
functions: s.functions,
|
|
2095
2203
|
json: o?.calc,
|
|
@@ -2108,19 +2216,19 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2108
2216
|
getSheetIndex: (e) => {
|
|
2109
2217
|
if (void 0 === e) {
|
|
2110
2218
|
const e = n.getSelectedSheet();
|
|
2111
|
-
return e ? this._getSheetRefs(
|
|
2219
|
+
return e ? this._getSheetRefs(be.Visibility.VeryHidden).findIndex((t) => t.sheet === e) : -1;
|
|
2112
2220
|
}
|
|
2113
|
-
const t = this._getSheetRefs(
|
|
2221
|
+
const t = this._getSheetRefs(be.Visibility.VeryHidden);
|
|
2114
2222
|
e = e.toLowerCase();
|
|
2115
2223
|
const s = t.length;
|
|
2116
2224
|
for (let r = 0; r < s; r++) if (t[r].name.toLowerCase() === e) return r;
|
|
2117
2225
|
try {
|
|
2118
|
-
|
|
2119
|
-
const t = this._names.getItems(
|
|
2226
|
+
Ur.address = e;
|
|
2227
|
+
const t = this._names.getItems(Ur);
|
|
2120
2228
|
if (!t || 0 === t.length) return -1;
|
|
2121
2229
|
let s = (t[0].getRanges?.()?.getCoords()?.[0])?.scope;
|
|
2122
2230
|
if (!s) return -1;
|
|
2123
|
-
const r = this._getSheetRefs(
|
|
2231
|
+
const r = this._getSheetRefs(be.Visibility.VeryHidden);
|
|
2124
2232
|
s = s.toLowerCase();
|
|
2125
2233
|
const i = r.length;
|
|
2126
2234
|
for (let e = 0; e < i; e++) if (r[e].name.toLowerCase() === s) return e;
|
|
@@ -2129,37 +2237,42 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2129
2237
|
}
|
|
2130
2238
|
return -1;
|
|
2131
2239
|
},
|
|
2132
|
-
getSheetCount: () => n._getSheetRefs(
|
|
2240
|
+
getSheetCount: () => n._getSheetRefs(be.Visibility.VeryHidden).length,
|
|
2133
2241
|
externalBooks: o?.externalBooks,
|
|
2134
2242
|
externalBookResolver: s.externalBookResolver,
|
|
2135
2243
|
namedCollection: n._names,
|
|
2136
2244
|
strings: n._strings,
|
|
2245
|
+
get resources() {
|
|
2246
|
+
return n._resources;
|
|
2247
|
+
},
|
|
2248
|
+
fetch: (e, t) => n._fetch.fetch(e, t),
|
|
2249
|
+
startFunctions: () => n._startFunctions(),
|
|
2137
2250
|
transactions: n._transactions,
|
|
2138
2251
|
names: o?.names
|
|
2139
2252
|
}), this._ownCalculation = !s.calculation, this._scripts = this._createScripts(o?.modules), this._ownNames = !s.names, this._options = Object.freeze({ ...s });
|
|
2140
|
-
const t = o?.sheets?.length ? o.sheets.map((e) => e.name) : [this._createSheetName(0)], r = t.map((e) => e + "-" +
|
|
2253
|
+
const t = o?.sheets?.length ? o.sheets.map((e) => e.name) : [this._createSheetName(0)], r = t.map((e) => e + "-" + os.uuidV4()), i = (e) => {
|
|
2141
2254
|
const t = o?.sheets?.[e]?.kind;
|
|
2142
|
-
return !!t && t !==
|
|
2255
|
+
return !!t && t !== be.Kind.Worksheet;
|
|
2143
2256
|
};
|
|
2144
2257
|
this._calculation._setSheets(t.map((e, t) => i(t) ? [
|
|
2145
2258
|
r[t],
|
|
2146
2259
|
e,
|
|
2147
2260
|
!0
|
|
2148
2261
|
] : [r[t], e]));
|
|
2149
|
-
const
|
|
2262
|
+
const l = s.calcOnLoad ?? "auto";
|
|
2150
2263
|
let h = !1;
|
|
2151
2264
|
const c = (async () => {
|
|
2152
2265
|
try {
|
|
2153
|
-
if (this._ownCalculation && "none" !==
|
|
2266
|
+
if (this._ownCalculation && "none" !== l && ("full" === l || "auto" === l && !0 === o?.calc?.fullCalcOnLoad ? await this._calculation.calculate({ full: !0 }) : await this._calculation.start(), this._closed)) return;
|
|
2154
2267
|
await this._scripts.start();
|
|
2155
2268
|
} finally {
|
|
2156
2269
|
h = !0, this._starting = null;
|
|
2157
2270
|
}
|
|
2158
2271
|
})();
|
|
2159
|
-
h || (this._starting = c), this._starting?.catch(() => {}), o ? this._fromJSON(o, r) : (this._initState(), this._addSheet(!1, t[0], null, r[0])), this._sheets = new
|
|
2272
|
+
h || (this._starting = c), this._starting?.catch(() => {}), o ? this._fromJSON(o, r) : (this._initState(), this._addSheet(!1, t[0], null, r[0])), this._sheets = new Ar((e) => n._addSheetOptions(e), (e, t) => {
|
|
2160
2273
|
if (e) {
|
|
2161
2274
|
const s = this._getSheetRef(e, t);
|
|
2162
|
-
return s &&
|
|
2275
|
+
return s && Jr(s) ? [s.sheet] : os.EmptyArray;
|
|
2163
2276
|
}
|
|
2164
2277
|
return this._getWorksheets(t);
|
|
2165
2278
|
}, (e, t) => {
|
|
@@ -2172,9 +2285,9 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2172
2285
|
r(n._sheets);
|
|
2173
2286
|
} : void 0
|
|
2174
2287
|
}, t);
|
|
2175
|
-
}, () => n.getSelectedWorksheet()), this._ownCalculation && "none" !== (s.calcOnLoad ?? "auto") && this._calculation.hydrateNames(), this._emitter.notify("onLoad"), this._ownTransactions ?
|
|
2288
|
+
}, () => n.getSelectedWorksheet()), this._ownCalculation && "none" !== (s.calcOnLoad ?? "auto") && this._calculation.hydrateNames(), this._emitter.notify("onLoad"), this._ownTransactions ? a.amend() : a.commit();
|
|
2176
2289
|
} catch (e) {
|
|
2177
|
-
throw
|
|
2290
|
+
throw a.rollback(), e;
|
|
2178
2291
|
}
|
|
2179
2292
|
this._initializing = !1;
|
|
2180
2293
|
}
|
|
@@ -2182,13 +2295,13 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2182
2295
|
let e = this._getSheetRefs();
|
|
2183
2296
|
for (let t = (e ? e.length : 0) - 1; t >= 0; t--);
|
|
2184
2297
|
const t = this._options;
|
|
2185
|
-
this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new
|
|
2298
|
+
this._isDate1904 = t.runtime?.isDate1904() ?? !1, this._locale = null, this._localeOverrides = null, this._theme = t.theme ?? new Qe().getDefaultTheme(), this._styles = t?.styles ?? new Ct(this._theme), this._ownStyles = !t.styles, this._styles.getTheme() || this._styles.setTheme(this.getTheme()), this._activeSheetOffset = 0, this.setView(new kr()), this._listenerProtection?.(), this._protection = new vr(void 0, this._options.readonly ?? !1), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
|
|
2186
2299
|
s._emitter.notify("onProtectionChange");
|
|
2187
2300
|
} });
|
|
2188
2301
|
const s = this;
|
|
2189
2302
|
this._transactionsRemoveListener = this._transactions.addStateListener(this._id, {
|
|
2190
2303
|
async onAfterStateChange(e, t, r, i, o) {
|
|
2191
|
-
const n = s._view, a = o?.[
|
|
2304
|
+
const n = s._view, a = o?.[jr], l = r ? a?.before : a?.after, h = a?.viewId === n.getId() && null != l, c = h ? l : n.getActiveSheetId(), u = h && t.getId() === s._lastTransactionUUID ? s._getSheetRef({ id: c }) : null;
|
|
2192
2305
|
u ? await u.sheet.select() : s._resyncActiveSheet(c, e), s._lastTransactionUUID = t.getId(), (r || i) && s._emitter.notify("onSheetsChange"), s._emitter.notify("onSelectedSheetChange"), s._emitter.notify("onViewChange");
|
|
2193
2306
|
},
|
|
2194
2307
|
onRestoreOrRevert() {
|
|
@@ -2243,8 +2356,8 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2243
2356
|
return this._view;
|
|
2244
2357
|
}
|
|
2245
2358
|
setView(e) {
|
|
2246
|
-
if (this._closed) throw new Error(
|
|
2247
|
-
if (!e) throw new
|
|
2359
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2360
|
+
if (!e) throw new ls(ws("error.sheet.emptyView"));
|
|
2248
2361
|
this._listenerWorkbookView?.();
|
|
2249
2362
|
const t = this;
|
|
2250
2363
|
let s = -1;
|
|
@@ -2257,7 +2370,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2257
2370
|
return this._runtime;
|
|
2258
2371
|
}
|
|
2259
2372
|
setDate1904(e) {
|
|
2260
|
-
if (this._closed) throw new Error(
|
|
2373
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2261
2374
|
return this._isDate1904 === e || (this._isDate1904 = e, this._emitter.notify("onRegionalChange")), this;
|
|
2262
2375
|
}
|
|
2263
2376
|
getLocale() {
|
|
@@ -2267,11 +2380,11 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2267
2380
|
return this._locale;
|
|
2268
2381
|
}
|
|
2269
2382
|
setLocale(e) {
|
|
2270
|
-
if (this._closed) throw new Error(
|
|
2383
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2271
2384
|
if (e) try {
|
|
2272
2385
|
new Intl.Locale(e);
|
|
2273
2386
|
} catch {
|
|
2274
|
-
throw new Error(
|
|
2387
|
+
throw new Error(ws("error.workbook.invalidLocale", { locale: e }));
|
|
2275
2388
|
}
|
|
2276
2389
|
return this._locale === e || (this._locale = e, this._emitter.notify("onRegionalChange")), this;
|
|
2277
2390
|
}
|
|
@@ -2279,7 +2392,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2279
2392
|
return this._localeOverrides;
|
|
2280
2393
|
}
|
|
2281
2394
|
setLocaleOverrides(e) {
|
|
2282
|
-
if (this._closed) throw new Error(
|
|
2395
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2283
2396
|
const t = e && Object.keys(e).length > 0 ? e : null;
|
|
2284
2397
|
return this._localeOverrides = t, this._emitter.notify("onRegionalChange"), this;
|
|
2285
2398
|
}
|
|
@@ -2289,14 +2402,20 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2289
2402
|
getResources() {
|
|
2290
2403
|
return this._resources;
|
|
2291
2404
|
}
|
|
2405
|
+
getFetcher() {
|
|
2406
|
+
return this._fetch.getFetcher();
|
|
2407
|
+
}
|
|
2408
|
+
fetch(e, t) {
|
|
2409
|
+
return this._fetch.fetch(e, t);
|
|
2410
|
+
}
|
|
2292
2411
|
getTransactions() {
|
|
2293
2412
|
return this._transactions;
|
|
2294
2413
|
}
|
|
2295
2414
|
getChanges(e) {
|
|
2296
|
-
const t = this._transactions, [s, r] = t.getLog(e ?? t.getCurrentCommit(!1).getId(), 2), i = [], o = this.getWorksheets().getItems({ visibility:
|
|
2415
|
+
const t = this._transactions, [s, r] = t.getLog(e ?? t.getCurrentCommit(!1).getId(), 2), i = [], o = this.getWorksheets().getItems({ visibility: be.Visibility.VeryHidden });
|
|
2297
2416
|
for (let e = 0; e < o.length; e++) {
|
|
2298
2417
|
const t = o[e];
|
|
2299
|
-
t instanceof
|
|
2418
|
+
t instanceof dt && i.push(...t._changeEventsOf(s, r ?? null));
|
|
2300
2419
|
}
|
|
2301
2420
|
return i;
|
|
2302
2421
|
}
|
|
@@ -2310,7 +2429,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2310
2429
|
return this._updateLinks;
|
|
2311
2430
|
}
|
|
2312
2431
|
setUpdateLinks(e) {
|
|
2313
|
-
if (this._closed) throw new Error(
|
|
2432
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2314
2433
|
return this._updateLinks = e, this;
|
|
2315
2434
|
}
|
|
2316
2435
|
getPivotTables() {
|
|
@@ -2326,8 +2445,8 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2326
2445
|
return this._theme;
|
|
2327
2446
|
}
|
|
2328
2447
|
setTheme(e) {
|
|
2329
|
-
if (this._closed) throw new Error(
|
|
2330
|
-
if (!e) throw new
|
|
2448
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2449
|
+
if (!e) throw new ls(ws("error.workbook.notSetValue"));
|
|
2331
2450
|
const t = this._theme;
|
|
2332
2451
|
return this._theme = e, this.getStyles().setTheme(e), this._emitter.notify("onThemeChange"), t;
|
|
2333
2452
|
}
|
|
@@ -2340,7 +2459,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2340
2459
|
}
|
|
2341
2460
|
getSelectedWorksheet() {
|
|
2342
2461
|
const e = this._getSheetRef(this.getSelectedSheetIndex());
|
|
2343
|
-
return e &&
|
|
2462
|
+
return e && Jr(e) ? e.sheet : null;
|
|
2344
2463
|
}
|
|
2345
2464
|
getActiveSheet() {
|
|
2346
2465
|
return this.getSelectedWorksheet();
|
|
@@ -2349,30 +2468,30 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2349
2468
|
return this.getSelectedWorksheet();
|
|
2350
2469
|
}
|
|
2351
2470
|
getSheets(e) {
|
|
2352
|
-
const t = this._getSheetRefs(e?.visibility ??
|
|
2471
|
+
const t = this._getSheetRefs(e?.visibility ?? be.Visibility.Visible), s = new Array(t.length);
|
|
2353
2472
|
for (let e = 0; e < t.length; e++) s[e] = t[e].sheet;
|
|
2354
2473
|
return s;
|
|
2355
2474
|
}
|
|
2356
2475
|
getSheet(e) {
|
|
2357
2476
|
if (void 0 === e) return this.getSelectedSheet();
|
|
2358
|
-
if (!e) throw new Error(
|
|
2477
|
+
if (!e) throw new Error(ws("error.workbook.sheetNameNotProvided"));
|
|
2359
2478
|
const t = this._getSheetRef(e);
|
|
2360
|
-
if (!t) throw new
|
|
2479
|
+
if (!t) throw new gs(xr(e));
|
|
2361
2480
|
return t.sheet;
|
|
2362
2481
|
}
|
|
2363
|
-
getWorksheet(e, t =
|
|
2482
|
+
getWorksheet(e, t = be.Visibility.Visible) {
|
|
2364
2483
|
if ("number" == typeof e) return this.getWorksheetAt(e, t);
|
|
2365
2484
|
if (void 0 === e) return this._requireSelectedWorksheet();
|
|
2366
|
-
if (!e) throw new Error(
|
|
2485
|
+
if (!e) throw new Error(ws("error.workbook.sheetNameNotProvided"));
|
|
2367
2486
|
const s = this._getSheetRef(e, t);
|
|
2368
|
-
if (!s) throw new
|
|
2369
|
-
if (!
|
|
2487
|
+
if (!s) throw new gs(xr(e));
|
|
2488
|
+
if (!Jr(s)) throw new gs(Er(s.name, s.sheet.getKind()));
|
|
2370
2489
|
return s.sheet;
|
|
2371
2490
|
}
|
|
2372
|
-
getWorksheetAt(e, t =
|
|
2491
|
+
getWorksheetAt(e, t = be.Visibility.Visible) {
|
|
2373
2492
|
const s = this._getWorksheets(t)[e];
|
|
2374
|
-
if (!s) throw new
|
|
2375
|
-
return
|
|
2493
|
+
if (!s) throw new gs(function(e) {
|
|
2494
|
+
return ws("error.workbook.sheetIndexNotFound", { index: e });
|
|
2376
2495
|
}(e));
|
|
2377
2496
|
return s;
|
|
2378
2497
|
}
|
|
@@ -2380,10 +2499,10 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2380
2499
|
const e = this.getSelectedWorksheet();
|
|
2381
2500
|
if (e) return e;
|
|
2382
2501
|
const t = this.getSelectedSheet();
|
|
2383
|
-
throw new
|
|
2502
|
+
throw new ls(Lr(t?.getName() ?? "", t?.getKind() ?? be.Kind.Worksheet));
|
|
2384
2503
|
}
|
|
2385
2504
|
_anchorWorksheet() {
|
|
2386
|
-
return this.getSelectedWorksheet() || (this._getWorksheets(
|
|
2505
|
+
return this.getSelectedWorksheet() || (this._getWorksheets(be.Visibility.VeryHidden)[0] ?? null);
|
|
2387
2506
|
}
|
|
2388
2507
|
getWorksheets() {
|
|
2389
2508
|
return this._sheets;
|
|
@@ -2391,35 +2510,35 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2391
2510
|
addWorksheet(e) {
|
|
2392
2511
|
return this.getWorksheets().add(e);
|
|
2393
2512
|
}
|
|
2394
|
-
_getWorksheets(e =
|
|
2513
|
+
_getWorksheets(e = be.Visibility.Visible) {
|
|
2395
2514
|
const t = this._getSheetRefs(e), s = [], r = t.length;
|
|
2396
2515
|
for (let e = 0; e < r; e++) {
|
|
2397
2516
|
const r = t[e];
|
|
2398
|
-
|
|
2517
|
+
Jr(r) && s.push(r.sheet);
|
|
2399
2518
|
}
|
|
2400
2519
|
return s;
|
|
2401
2520
|
}
|
|
2402
|
-
_getSheetRefs(e =
|
|
2521
|
+
_getSheetRefs(e = be.Visibility.Visible) {
|
|
2403
2522
|
const t = this._getState();
|
|
2404
|
-
return t ? e ===
|
|
2523
|
+
return t ? e === be.Visibility.Visible ? t.sheetRefsVisible : e === be.Visibility.Hidden ? t.sheetRefsVisibleAndHidden : e === be.Visibility.VeryHidden ? t.sheetRefsAll : os.EmptyArray : [];
|
|
2405
2524
|
}
|
|
2406
|
-
_getSheetRef(e, t =
|
|
2525
|
+
_getSheetRef(e, t = be.Visibility.Visible) {
|
|
2407
2526
|
let s = null;
|
|
2408
2527
|
return "number" == typeof e ? this._getSheetRefs(t)[e] : ("string" == typeof e ? s = this._getState().refsByLowerCaseName.get(e.toLowerCase()) : !0 === e?.isISheet ? s = this._getState().refsByInstance.get(e) : void 0 !== e?.id && (s = this._getState().refsById.get(e.id)), s);
|
|
2409
2528
|
}
|
|
2410
2529
|
_validateNewSheetName(e, t = !0) {
|
|
2411
2530
|
if (null == e) return e;
|
|
2412
|
-
if (
|
|
2531
|
+
if (Wr(e), t && this._getState().sheetsByLowerCaseName.has(e.toLowerCase())) throw new ls(ws("error.workbook.nameTaken"));
|
|
2413
2532
|
return e.substring(0, 31);
|
|
2414
2533
|
}
|
|
2415
2534
|
findValidSheetName(e) {
|
|
2416
|
-
e && (e =
|
|
2535
|
+
e && (e = Wr(e, !0));
|
|
2417
2536
|
try {
|
|
2418
2537
|
return function(e, t) {
|
|
2419
2538
|
try {
|
|
2420
2539
|
if (t(e)) return e;
|
|
2421
2540
|
} catch (e) {}
|
|
2422
|
-
let s, r, i =
|
|
2541
|
+
let s, r, i = Tr.exec(e);
|
|
2423
2542
|
for (null !== i ? (s = e.substring(0, i.index), r = parseFloat(i[1])) : (s = e + " ", r = 1); r < 256;) {
|
|
2424
2543
|
r++;
|
|
2425
2544
|
const e = "(" + r + ")", i = s.substring(0, 31 - e.length) + e;
|
|
@@ -2434,25 +2553,25 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2434
2553
|
}
|
|
2435
2554
|
}
|
|
2436
2555
|
isValidSheetNameCharacter(e) {
|
|
2437
|
-
return !
|
|
2556
|
+
return !Vr.test(e);
|
|
2438
2557
|
}
|
|
2439
2558
|
_isStructureProtected() {
|
|
2440
2559
|
return !this._initializing && !this.getProtection().isStructureAllowed();
|
|
2441
2560
|
}
|
|
2442
2561
|
_addSheetOptions(e) {
|
|
2443
|
-
if (this._closed) throw new Error(
|
|
2444
|
-
if (!this.getProtection().isStructureAllowed()) throw new
|
|
2562
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2563
|
+
if (!this.getProtection().isStructureAllowed()) throw new _s(ws("error.workbook.protection"));
|
|
2445
2564
|
let t, s = null;
|
|
2446
2565
|
t = "string" == typeof e ? { name: e } : "number" == typeof e ? { index: e } : e, t = {
|
|
2447
2566
|
...t,
|
|
2448
|
-
description: t?.description ??
|
|
2567
|
+
description: t?.description ?? ps("op.addSheet")
|
|
2449
2568
|
};
|
|
2450
2569
|
const r = this.beginCommit(t);
|
|
2451
2570
|
try {
|
|
2452
2571
|
const e = t?.autoSelect ?? !1;
|
|
2453
2572
|
s = this._addSheet(!0, t.name, t.index ?? null);
|
|
2454
2573
|
const i = this.getView().getActiveSheetId();
|
|
2455
|
-
if (e && this._recordActiveSheet(r, i, this._getSheetRef(s).id), r.commit({ description:
|
|
2574
|
+
if (e && this._recordActiveSheet(r, i, this._getSheetRef(s).id), r.commit({ description: ws("op.addSheetNamed", { name: s.getName() }) }), !1 !== e) {
|
|
2456
2575
|
const t = "boolean" == typeof e ? void 0 : e;
|
|
2457
2576
|
s.select(t);
|
|
2458
2577
|
}
|
|
@@ -2464,8 +2583,8 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2464
2583
|
_nextSheetName(e = null) {
|
|
2465
2584
|
let t = e ? e.toLowerCase() : null;
|
|
2466
2585
|
const s = this._getState(), r = s.sheetsByLowerCaseName;
|
|
2467
|
-
if (e && r.has(t)) throw new
|
|
2468
|
-
return
|
|
2586
|
+
if (e && r.has(t)) throw new ls(function(e) {
|
|
2587
|
+
return ws("error.workbook.nameDuplicate", { sheetName: e });
|
|
2469
2588
|
}(e));
|
|
2470
2589
|
t = (e = this._validateNewSheetName(e)) ? e.toLowerCase() : null;
|
|
2471
2590
|
let i = s.lastId + 1;
|
|
@@ -2477,16 +2596,16 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2477
2596
|
}
|
|
2478
2597
|
_addSheet(e, t = null, s = null, r) {
|
|
2479
2598
|
t = this._nextSheetName(t);
|
|
2480
|
-
const i = this._getState(), o = this._createSheet(i.lastId, t,
|
|
2481
|
-
if (!o) throw new
|
|
2599
|
+
const i = this._getState(), o = this._createSheet(i.lastId, t, be.Visibility.Visible, s, void 0, null, r);
|
|
2600
|
+
if (!o) throw new ls(ws("error.workbook.sheetNameBlank"));
|
|
2482
2601
|
return e && (this._tellSheets(), this._emitter.notify("onSheetsChange")), o;
|
|
2483
2602
|
}
|
|
2484
2603
|
_createOpaqueSheet(e, t, s, r, i, o, n, a, l) {
|
|
2485
2604
|
const h = this;
|
|
2486
2605
|
let c = null;
|
|
2487
|
-
return c = new
|
|
2606
|
+
return c = new yr({
|
|
2488
2607
|
kind: o,
|
|
2489
|
-
id: l ?? t + "-" +
|
|
2608
|
+
id: l ?? t + "-" + os.uuidV4(),
|
|
2490
2609
|
part: n,
|
|
2491
2610
|
tabColor: a,
|
|
2492
2611
|
styles: this._styles,
|
|
@@ -2497,25 +2616,25 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2497
2616
|
setName: (e, t) => {
|
|
2498
2617
|
h._setSheetName(c, e, t);
|
|
2499
2618
|
},
|
|
2500
|
-
getVisibility: () => h._getSheetRef(c,
|
|
2619
|
+
getVisibility: () => h._getSheetRef(c, be.Visibility.VeryHidden)?.visibility ?? be.Visibility.Visible,
|
|
2501
2620
|
setVisibility: (e, t) => {
|
|
2502
2621
|
h._setSheetVisibility(c, e, t);
|
|
2503
2622
|
},
|
|
2504
2623
|
getIndex: () => {
|
|
2505
|
-
const e = h._getSheetRef(c,
|
|
2506
|
-
return e ? h._getOffsetForId(e.id, h._getSheetRefs(
|
|
2624
|
+
const e = h._getSheetRef(c, be.Visibility.VeryHidden);
|
|
2625
|
+
return e ? h._getOffsetForId(e.id, h._getSheetRefs(be.Visibility.VeryHidden)) : -1;
|
|
2507
2626
|
},
|
|
2508
2627
|
setIndex: (e, t) => {
|
|
2509
|
-
const s = h._getSheetRef(c,
|
|
2628
|
+
const s = h._getSheetRef(c, be.Visibility.VeryHidden);
|
|
2510
2629
|
s && h._moveSheet(s, e, t);
|
|
2511
2630
|
},
|
|
2512
2631
|
requestSelect: () => h._requestSelect(c),
|
|
2513
|
-
isAttached: () => !!h._getSheetRef(c,
|
|
2632
|
+
isAttached: () => !!h._getSheetRef(c, be.Visibility.VeryHidden)
|
|
2514
2633
|
}
|
|
2515
2634
|
}), this._sheetOnNameChange.set(e, () => c._notify("onNameChange")), this._sheetOnVisibilityChange.set(e, () => c._notify("onVisibilityChange")), this._sheetOnIndexChange.set(e, () => c._notify("onIndexChange")), this._addSheetRef({
|
|
2516
2635
|
name: t,
|
|
2517
2636
|
id: e,
|
|
2518
|
-
visibility: s ??
|
|
2637
|
+
visibility: s ?? be.Visibility.Visible,
|
|
2519
2638
|
sheetId: i,
|
|
2520
2639
|
sheet: c
|
|
2521
2640
|
}, r), c;
|
|
@@ -2528,10 +2647,10 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2528
2647
|
}), this.getSelectedSheet() === e;
|
|
2529
2648
|
}
|
|
2530
2649
|
_updateSheetRefStates(e) {
|
|
2531
|
-
if (this._closed) throw new Error(
|
|
2532
|
-
if (!this._initializing && !this.getProtection().isStructureAllowed()) throw new
|
|
2650
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2651
|
+
if (!this._initializing && !this.getProtection().isStructureAllowed()) throw new _s(ws("error.workbook.protection"));
|
|
2533
2652
|
const t = e, s = [], r = [], i = t.length;
|
|
2534
|
-
for (let e = 0; e < i; e++) t[e].visibility ===
|
|
2653
|
+
for (let e = 0; e < i; e++) t[e].visibility === be.Visibility.Visible ? (s.push(t[e]), r.push(t[e])) : t[e].visibility === be.Visibility.Hidden && r.push(t[e]);
|
|
2535
2654
|
this._updateState({
|
|
2536
2655
|
sheetRefsAll: t,
|
|
2537
2656
|
sheetRefsVisible: s,
|
|
@@ -2541,7 +2660,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2541
2660
|
_tellSheets() {
|
|
2542
2661
|
if (this._isLoadingSheets) return;
|
|
2543
2662
|
const e = this._getState().sheetRefsAll;
|
|
2544
|
-
this._calculation._setSheets(e.map((e) =>
|
|
2663
|
+
this._calculation._setSheets(e.map((e) => Jr(e) ? [e.sheet.getId(), e.name] : [
|
|
2545
2664
|
e.sheet.getId(),
|
|
2546
2665
|
e.name,
|
|
2547
2666
|
!0
|
|
@@ -2573,9 +2692,9 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2573
2692
|
g._validateDeleteSheet(e);
|
|
2574
2693
|
},
|
|
2575
2694
|
onDelete(e) {
|
|
2576
|
-
let t = g._getSheetRef(e,
|
|
2695
|
+
let t = g._getSheetRef(e, be.Visibility.VeryHidden);
|
|
2577
2696
|
if (!t) return;
|
|
2578
|
-
const s = g._beginCommit({ description:
|
|
2697
|
+
const s = g._beginCommit({ description: ws("op.deleteSheet", { name: t.name }) });
|
|
2579
2698
|
try {
|
|
2580
2699
|
const r = g._getState(), i = r.sheetRefsAll, o = g._getOffsetForId(t.id, i);
|
|
2581
2700
|
let a = [...i];
|
|
@@ -2606,7 +2725,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2606
2725
|
throw s.rollback(), e;
|
|
2607
2726
|
}
|
|
2608
2727
|
}
|
|
2609
|
-
}, { transactional: !0 }), r =
|
|
2728
|
+
}, { transactional: !0 }), r = Jr(e) ? e.sheet.addListeners({ onSelectionChange: (e) => {
|
|
2610
2729
|
g.getView().getActiveSheetId() === g._getSheetRef(e)?.id && g._emitter.notify("onSelectionChange", {
|
|
2611
2730
|
source: g,
|
|
2612
2731
|
params: e
|
|
@@ -2630,7 +2749,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2630
2749
|
}
|
|
2631
2750
|
_recordActiveSheet(e, t, s) {
|
|
2632
2751
|
const r = this.getView().getId();
|
|
2633
|
-
e.setIntent(
|
|
2752
|
+
e.setIntent(jr, (e) => ({
|
|
2634
2753
|
viewId: r,
|
|
2635
2754
|
before: e?.before ?? t,
|
|
2636
2755
|
after: s
|
|
@@ -2662,27 +2781,27 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2662
2781
|
let s = this._view.getActiveSheetId();
|
|
2663
2782
|
null == s && (this._view.setActiveSheetId(t), s = t);
|
|
2664
2783
|
let r = e.refsById.get(s);
|
|
2665
|
-
r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), s = t), r.visibility ===
|
|
2784
|
+
r || (this._view.setActiveSheetId(t), r = e.refsById.get(t), s = t), r.visibility === be.Visibility.Visible && (this._activeSheetOffset = this._getOffsetForId(s, e.sheetRefsVisible));
|
|
2666
2785
|
}
|
|
2667
2786
|
_validateDeleteSheet(e) {
|
|
2668
|
-
if (this._closed) throw new Error(
|
|
2669
|
-
if (!this.getProtection().isStructureAllowed()) throw new
|
|
2787
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2788
|
+
if (!this.getProtection().isStructureAllowed()) throw new _s(ws("error.workbook.protection"));
|
|
2670
2789
|
let t = this._getSheetRef(e);
|
|
2671
|
-
if (!t) throw new
|
|
2672
|
-
return
|
|
2790
|
+
if (!t) throw new ls(function(e) {
|
|
2791
|
+
return ws("error.workbook.deleteKey", { key: e });
|
|
2673
2792
|
}(e));
|
|
2674
2793
|
const s = this._getState().sheetRefsVisible;
|
|
2675
|
-
if (1 === s.length && s[0].id === t.id) throw new
|
|
2794
|
+
if (1 === s.length && s[0].id === t.id) throw new ls(ws("error.workbook.sheetOne"));
|
|
2676
2795
|
}
|
|
2677
2796
|
_getOffsetForId(e, t) {
|
|
2678
2797
|
const s = t.length;
|
|
2679
2798
|
for (let r = 0; r < s; r++) if (t[r].id === e) return r;
|
|
2680
|
-
throw new
|
|
2799
|
+
throw new ls(ws("error.workbook.noVisibleRefs"));
|
|
2681
2800
|
}
|
|
2682
2801
|
find(e) {
|
|
2683
|
-
if (this._closed) throw new Error(
|
|
2802
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2684
2803
|
const t = this._getWorksheets();
|
|
2685
|
-
if (0 === t.length) return { next: () =>
|
|
2804
|
+
if (0 === t.length) return { next: () => $e };
|
|
2686
2805
|
if (1 === t.length) return t[0].find(e);
|
|
2687
2806
|
"string" == typeof e && (e = { text: e });
|
|
2688
2807
|
const s = !e?.reverse;
|
|
@@ -2701,7 +2820,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2701
2820
|
rowIndex: t[0].rowStart
|
|
2702
2821
|
};
|
|
2703
2822
|
}
|
|
2704
|
-
const d =
|
|
2823
|
+
const d = ns.createCellComparator(e?.axis, e?.reverse);
|
|
2705
2824
|
delete (e = { ...e }).from;
|
|
2706
2825
|
const g = () => {
|
|
2707
2826
|
if (!u && c.done && (a && o === i ? u = !0 : s ? (o++, o > t.length - 1 && (o = 0, a = !0)) : (o--, o < 0 && (o = t.length - 1, a = !0)), r && a && (u = !0), u || l || !a || o !== i || (u = !0), !u)) {
|
|
@@ -2711,7 +2830,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2711
2830
|
}
|
|
2712
2831
|
if (!u && a && o === i && (c.done || !l || !c.done && d(c.value.getCoords(), l) >= 0) && (u = !0), u) {
|
|
2713
2832
|
const e = c;
|
|
2714
|
-
return c =
|
|
2833
|
+
return c = $e, e;
|
|
2715
2834
|
}
|
|
2716
2835
|
const g = c;
|
|
2717
2836
|
return c = h.next(), g;
|
|
@@ -2726,8 +2845,8 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2726
2845
|
let r = 0, i = null;
|
|
2727
2846
|
const o = "function" == typeof t, n = s?.maxCount ?? Number.MAX_SAFE_INTEGER, a = !s?.maxCount;
|
|
2728
2847
|
let l = "";
|
|
2729
|
-
const h = "string" == typeof t ?
|
|
2730
|
-
let c = s?.description ??
|
|
2848
|
+
const h = "string" == typeof t ? Je(t) : null;
|
|
2849
|
+
let c = s?.description ?? ps("op.replace");
|
|
2731
2850
|
const u = this._transactions.beginCommit({ description: c });
|
|
2732
2851
|
try {
|
|
2733
2852
|
let c = null, d = null, g = e.next();
|
|
@@ -2740,10 +2859,10 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2740
2859
|
const l = o ? t(n) : t;
|
|
2741
2860
|
void 0 !== l && l !== n && (d.push(n, l), r++, i = n), g = e.next();
|
|
2742
2861
|
}
|
|
2743
|
-
d?.apply(), 1 === r && 1 === n && i && (l = i.getAddress()), 0 === r ? u.rollback() : u.commit({ description: s?.description ?? (a ? null !== h ?
|
|
2862
|
+
d?.apply(), 1 === r && 1 === n && i && (l = i.getAddress()), 0 === r ? u.rollback() : u.commit({ description: s?.description ?? (a ? null !== h ? ws("op.replaceAllWith", { value: h }) : ps("op.replaceAll") : l ? null !== h ? ws("op.replaceAtWith", {
|
|
2744
2863
|
address: l,
|
|
2745
2864
|
value: h
|
|
2746
|
-
}) :
|
|
2865
|
+
}) : ws("op.replaceAt", { address: l }) : null !== h ? ws("op.replaceWith", { value: h }) : ps("op.replace")) });
|
|
2747
2866
|
} catch (e) {
|
|
2748
2867
|
throw u.rollback(), e;
|
|
2749
2868
|
}
|
|
@@ -2764,117 +2883,117 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2764
2883
|
const s = this._getSheetRefs(), r = s.length;
|
|
2765
2884
|
for (let i = 0; i < r; i++) {
|
|
2766
2885
|
const o = s[(e + i) % r];
|
|
2767
|
-
if (!
|
|
2886
|
+
if (!Jr(o)) continue;
|
|
2768
2887
|
const n = t.indexOf(o.sheet);
|
|
2769
2888
|
if (-1 !== n) return n;
|
|
2770
2889
|
}
|
|
2771
2890
|
return 0;
|
|
2772
2891
|
}
|
|
2773
2892
|
getNextSheet(e) {
|
|
2774
|
-
if (this._closed) throw new Error(
|
|
2893
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2775
2894
|
const t = this._getSheetRefs();
|
|
2776
2895
|
return t[this._nextSheetIndex(e, t)]?.sheet ?? null;
|
|
2777
2896
|
}
|
|
2778
2897
|
getPreviousSheet(e) {
|
|
2779
|
-
if (this._closed) throw new Error(
|
|
2898
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2780
2899
|
const t = this._getSheetRefs();
|
|
2781
2900
|
return t[this._prevSheetIndex(e, t)]?.sheet ?? null;
|
|
2782
2901
|
}
|
|
2783
2902
|
async _duplicateSheet(e) {
|
|
2784
|
-
if (this._closed) throw new Error(
|
|
2785
|
-
if (!this.getProtection().isStructureAllowed()) throw new
|
|
2903
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2904
|
+
if (!this.getProtection().isStructureAllowed()) throw new _s(ws("error.workbook.protection"));
|
|
2786
2905
|
const t = this._getSheetRefs(), s = this.getSelectedSheetIndex();
|
|
2787
2906
|
let r = null;
|
|
2788
2907
|
if (e) {
|
|
2789
|
-
if (r = this._getSheetRef(e), !r) throw new
|
|
2908
|
+
if (r = this._getSheetRef(e), !r) throw new ls(Rr(r));
|
|
2790
2909
|
} else r = t[s];
|
|
2791
2910
|
if (!r) return null;
|
|
2792
|
-
if (!
|
|
2911
|
+
if (!Jr(r)) throw new ls((i = r.name, ws("error.workbook.sheetNotDuplicable", { sheetName: i })));
|
|
2793
2912
|
var i;
|
|
2794
|
-
const o = r.sheet, n = this._strings.beginPersist(), a = this.getResources().beginPersist(), l = this.getStyles().beginPersist();
|
|
2795
|
-
let
|
|
2796
|
-
const
|
|
2913
|
+
const o = r.sheet, n = this._strings.beginPersist(), a = this.getResources().beginPersist(), l = this.getStyles().beginPersist(), h = this._richValues.beginPersist();
|
|
2914
|
+
let c = null;
|
|
2915
|
+
const u = this.beginCommit(ws("op.duplicateNamed", { name: o.getName() }));
|
|
2797
2916
|
try {
|
|
2798
2917
|
const e = this._getState().refsByInstance.get(o), r = await o.toJSON(), i = t.length + 1, n = this.findValidSheetName(e.name), a = this._createSheet(i, n, e.visibility, s, void 0, r);
|
|
2799
|
-
this._tellSheets(), this._emitter.notify("onSheetsChange"),
|
|
2918
|
+
this._tellSheets(), this._emitter.notify("onSheetsChange"), c = a, u.commit();
|
|
2800
2919
|
} catch (e) {
|
|
2801
|
-
throw
|
|
2920
|
+
throw u.rollback(), e;
|
|
2802
2921
|
} finally {
|
|
2803
|
-
l.endPersist(), a.endPersist(), n.endPersist();
|
|
2922
|
+
h.endPersist(), l.endPersist(), a.endPersist(), n.endPersist();
|
|
2804
2923
|
}
|
|
2805
|
-
return
|
|
2924
|
+
return c;
|
|
2806
2925
|
}
|
|
2807
2926
|
_createRange(e, t) {
|
|
2808
|
-
const s = e ? { ...e } : null, r = s ? this._getSheetRef(s.scope,
|
|
2809
|
-
if (r && !
|
|
2927
|
+
const s = e ? { ...e } : null, r = s ? this._getSheetRef(s.scope, be.Visibility.VeryHidden) : null;
|
|
2928
|
+
if (r && !Jr(r)) throw new ls(Er(r.name, r.sheet.getKind()));
|
|
2810
2929
|
if (!r) {
|
|
2811
2930
|
const e = this._anchorWorksheet();
|
|
2812
|
-
return e ? (delete s?.scope,
|
|
2813
|
-
scope:
|
|
2931
|
+
return e ? (delete s?.scope, Fr(s, s ? {
|
|
2932
|
+
scope: pe,
|
|
2814
2933
|
...e.getEntireRange().getCoords()
|
|
2815
|
-
} : null)) : void console.warn(
|
|
2934
|
+
} : null)) : void console.warn(ws("error.workbook.noVisibleRefs"));
|
|
2816
2935
|
}
|
|
2817
2936
|
const i = r.sheet;
|
|
2818
2937
|
let o = null;
|
|
2819
|
-
return t && (o = { getOptions: t }), new
|
|
2938
|
+
return t && (o = { getOptions: t }), new Dr(e, yt(i), this, o);
|
|
2820
2939
|
}
|
|
2821
2940
|
_createRanges(e, t) {
|
|
2822
2941
|
const s = this._anchorWorksheet();
|
|
2823
|
-
if (!s) throw new
|
|
2942
|
+
if (!s) throw new ls(Lr("", be.Kind.Worksheet));
|
|
2824
2943
|
let r = null;
|
|
2825
|
-
return t && (r = { getOptions: t }), new
|
|
2944
|
+
return t && (r = { getOptions: t }), new Mr(e, yt(s), this, r);
|
|
2826
2945
|
}
|
|
2827
2946
|
getRange(e, t) {
|
|
2828
2947
|
if (void 0 === e) return this.getSelectedRange(t);
|
|
2829
2948
|
try {
|
|
2830
2949
|
const s = this._rangesAddressToCoords(e);
|
|
2831
|
-
if (1 !== s.length) throw new
|
|
2950
|
+
if (1 !== s.length) throw new ls(ws("error.address.singleRangeOnlyAlt"));
|
|
2832
2951
|
return this._createRange(s[0], t);
|
|
2833
2952
|
} catch (t) {
|
|
2834
|
-
if (t instanceof
|
|
2835
|
-
throw new
|
|
2953
|
+
if (t instanceof gs) throw new gs(t.message);
|
|
2954
|
+
throw new ls(t.message ?? B(e));
|
|
2836
2955
|
}
|
|
2837
2956
|
}
|
|
2838
2957
|
getCell(e) {
|
|
2839
2958
|
if (void 0 === e) return this.getSelectedCell();
|
|
2840
2959
|
const t = this.getRange(e);
|
|
2841
|
-
if (t.size > 1) throw new
|
|
2960
|
+
if (t.size > 1) throw new ls(ws("error.address.singleCellOnly"));
|
|
2842
2961
|
return t.getCell();
|
|
2843
2962
|
}
|
|
2844
2963
|
getRanges(e, t) {
|
|
2845
2964
|
const s = this._rangesAddressToCoords(e);
|
|
2846
|
-
if (0 === s.length) throw new
|
|
2965
|
+
if (0 === s.length) throw new ls(B(e));
|
|
2847
2966
|
return this._createRanges(s, t);
|
|
2848
2967
|
}
|
|
2849
2968
|
_createGraphRanges(e, t) {
|
|
2850
2969
|
const s = [], r = this.getCalculation()?.getNamedFormulas() ?? null;
|
|
2851
2970
|
for (let e = 0; e < t.length; e++) {
|
|
2852
|
-
const i = t[e], o = i.sheetName ? this._getSheetRef(i.sheetName,
|
|
2853
|
-
n && s.push(new
|
|
2971
|
+
const i = t[e], o = i.sheetName ? this._getSheetRef(i.sheetName, be.Visibility.VeryHidden) : null, n = o && Jr(o) ? o.sheet : this._anchorWorksheet();
|
|
2972
|
+
n && s.push(new J(i, r, yt(n), null));
|
|
2854
2973
|
}
|
|
2855
2974
|
for (let t = 0; t < e.length; t++) s.push(e[t]);
|
|
2856
2975
|
const i = this._anchorWorksheet();
|
|
2857
|
-
return 0 !== s.length && i ? new
|
|
2976
|
+
return 0 !== s.length && i ? new Mr(s, yt(i), this, null) : null;
|
|
2858
2977
|
}
|
|
2859
2978
|
getAnomalies(e) {
|
|
2860
|
-
if (this._closed) throw new Error(
|
|
2861
|
-
const t =
|
|
2862
|
-
const t =
|
|
2979
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2980
|
+
const t = L(e), s = this._getWorksheets(be.Visibility.VeryHidden).map((e) => {
|
|
2981
|
+
const t = yt(e);
|
|
2863
2982
|
return {
|
|
2864
2983
|
bounds: t.getSheet().getEntireCoords(),
|
|
2865
2984
|
internal: t,
|
|
2866
2985
|
qualified: !0
|
|
2867
2986
|
};
|
|
2868
2987
|
});
|
|
2869
|
-
return new
|
|
2988
|
+
return new v(s, () => (this.getSelectedWorksheet() ?? this._getWorksheets(be.Visibility.VeryHidden)[0]).getEntireRange(), t);
|
|
2870
2989
|
}
|
|
2871
2990
|
getStats(e) {
|
|
2872
|
-
if (this._closed) throw new Error(
|
|
2873
|
-
const t = this._getWorksheets(
|
|
2991
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
2992
|
+
const t = this._getWorksheets(be.Visibility.VeryHidden), s = t.length;
|
|
2874
2993
|
if (1 === s) return t[0].getStats(e);
|
|
2875
2994
|
const r = new Array(s);
|
|
2876
2995
|
for (let i = 0; i < s; i++) r[i] = t[i].getStats(e);
|
|
2877
|
-
return new
|
|
2996
|
+
return new er(r);
|
|
2878
2997
|
}
|
|
2879
2998
|
_activeRangeCoords() {
|
|
2880
2999
|
const e = this._requireSelectedWorksheet(), t = e.getSelection().getRanges().getCoords(), s = e.getName(), r = t.length, i = new Array(r);
|
|
@@ -2899,21 +3018,21 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2899
3018
|
getSelectedCell() {
|
|
2900
3019
|
return this._requireSelectedWorksheet().getSelectedCell();
|
|
2901
3020
|
}
|
|
2902
|
-
_rangesAddressToCoords(e, t = !0, s =
|
|
2903
|
-
if (!e) throw new
|
|
2904
|
-
const r = this.getSelectedWorksheet(), i = { ...(r ?? this._anchorWorksheet())?.getEntireRange().getCoords() },
|
|
2905
|
-
if (
|
|
3021
|
+
_rangesAddressToCoords(e, t = !0, s = be.Visibility.Hidden) {
|
|
3022
|
+
if (!e) throw new ls(ws("error.address.noAddress"));
|
|
3023
|
+
const r = this.getSelectedWorksheet(), i = { ...(r ?? this._anchorWorksheet())?.getEntireRange().getCoords() }, o = r?.getName();
|
|
3024
|
+
if (o && (i.scope = o), "string" == typeof e) {
|
|
2906
3025
|
const t = e.trim().toLowerCase();
|
|
2907
3026
|
if ("r" === t || "c" === t) {
|
|
2908
3027
|
const s = this.getSelectedCell().getCoords(), r = {};
|
|
2909
3028
|
"r" === t ? r.rowStart = r.rowEnd = s.rowIndex : r.colStart = r.colEnd = s.colIndex, e = r;
|
|
2910
3029
|
}
|
|
2911
3030
|
}
|
|
2912
|
-
const a = this, l =
|
|
3031
|
+
const a = this, l = tt(e, i, Ae, (e) => {
|
|
2913
3032
|
if (!t) return null;
|
|
2914
3033
|
if ("string" == typeof e) {
|
|
2915
|
-
const t =
|
|
2916
|
-
getTable: (e) =>
|
|
3034
|
+
const t = We(e, {
|
|
3035
|
+
getTable: (e) => n(a.getNames().getByName(e)),
|
|
2917
3036
|
getAnchor: () => r ? {
|
|
2918
3037
|
sheet: r,
|
|
2919
3038
|
coords: r.getSelectedCell().getCoords()
|
|
@@ -2923,16 +3042,16 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2923
3042
|
const s = a.getNames().getByName(e)?.getRanges?.();
|
|
2924
3043
|
if (s) return s.getCoords();
|
|
2925
3044
|
}
|
|
2926
|
-
throw new
|
|
3045
|
+
throw new ls(`Invalid sheet reference '${e}'.`);
|
|
2927
3046
|
}), h = l.length;
|
|
2928
3047
|
for (let e = 0; e < h; e++) this._validateCoords(l[e], s);
|
|
2929
3048
|
return l;
|
|
2930
3049
|
}
|
|
2931
|
-
_validateCoords(e, t =
|
|
3050
|
+
_validateCoords(e, t = be.Visibility.Visible, s = ws("error.sheet.oobRange")) {
|
|
2932
3051
|
if (null === e) return;
|
|
2933
3052
|
const r = this.getWorksheet(e.scope ?? void 0, t).getEntireRange().getCoords();
|
|
2934
|
-
if (!
|
|
2935
|
-
if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new
|
|
3053
|
+
if (!ns.isRangeWithinRange(e, r)) throw new gs(s);
|
|
3054
|
+
if (e.rowEnd < e.rowStart || e.colEnd < e.colStart) throw new ls(ws("error.address.invalidRangeInverted"));
|
|
2936
3055
|
}
|
|
2937
3056
|
_updateSheetRef(e, t) {
|
|
2938
3057
|
const s = this._getState();
|
|
@@ -2954,18 +3073,18 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2954
3073
|
}), this._tellSheets(), t;
|
|
2955
3074
|
}
|
|
2956
3075
|
_setSheetName(e, t, s) {
|
|
2957
|
-
if (this._closed) throw new Error(
|
|
2958
|
-
if (!this.getProtection().isStructureAllowed()) throw new
|
|
3076
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
3077
|
+
if (!this.getProtection().isStructureAllowed()) throw new _s(ws("error.workbook.protection"));
|
|
2959
3078
|
const r = this._getSheetRef(e);
|
|
2960
|
-
if (!r) throw new
|
|
3079
|
+
if (!r) throw new ls(Rr(e));
|
|
2961
3080
|
if (t === r.name) return r.sheet;
|
|
2962
|
-
if (null == (t = this._validateNewSheetName(t))) throw new
|
|
3081
|
+
if (null == (t = this._validateNewSheetName(t))) throw new ls(ws("error.workbook.sheetNameNotProvided"));
|
|
2963
3082
|
const i = Object.freeze({
|
|
2964
3083
|
...r,
|
|
2965
3084
|
name: t
|
|
2966
3085
|
});
|
|
2967
3086
|
let o = null;
|
|
2968
|
-
const n = this.beginCommit(
|
|
3087
|
+
const n = this.beginCommit(ps("op.renameSheet"));
|
|
2969
3088
|
try {
|
|
2970
3089
|
const e = this._updateSheetRef(r, i);
|
|
2971
3090
|
this._adjustSheetNamesIfRequired(), this._sheetOnNameChange.forEach((e, t) => {
|
|
@@ -2976,24 +3095,24 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
2976
3095
|
}
|
|
2977
3096
|
return o;
|
|
2978
3097
|
}
|
|
2979
|
-
_setSheetVisibility(e, t =
|
|
2980
|
-
if (this._closed) throw new Error(
|
|
2981
|
-
if (!this.getProtection().isStructureAllowed()) throw new
|
|
2982
|
-
const r = this._getSheetRef(e,
|
|
3098
|
+
_setSheetVisibility(e, t = be.Visibility.Visible, s) {
|
|
3099
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
3100
|
+
if (!this.getProtection().isStructureAllowed()) throw new _s(ws("error.workbook.protection"));
|
|
3101
|
+
const r = this._getSheetRef(e, be.Visibility.VeryHidden);
|
|
2983
3102
|
if (!r) return null;
|
|
2984
3103
|
if (t === r.visibility) return;
|
|
2985
3104
|
let i = null, o = "";
|
|
2986
|
-
t ===
|
|
3105
|
+
t === be.Visibility.Visible ? o = ps("op.unhideSheet") : t === be.Visibility.Hidden ? o = ps("op.hideSheet") : t === be.Visibility.VeryHidden && (o = ps("op.veryHideSheet"));
|
|
2987
3106
|
const n = this.beginCommit(o);
|
|
2988
3107
|
try {
|
|
2989
3108
|
const e = this._getState().sheetRefsVisible;
|
|
2990
|
-
if (t !==
|
|
3109
|
+
if (t !== be.Visibility.Visible && 1 === e.length && e[0].id === r.id) throw new ls(ws("error.workbook.sheetOne"));
|
|
2991
3110
|
const o = {
|
|
2992
3111
|
...r,
|
|
2993
3112
|
visibility: t
|
|
2994
3113
|
};
|
|
2995
3114
|
let a = -1;
|
|
2996
|
-
t !==
|
|
3115
|
+
t !== be.Visibility.Visible && (a = this._getOffsetForId(r.id, e)), i = this._updateSheetRef(r, o).sheet, t !== be.Visibility.Visible && this._adjustRemoveSelectionIfRequired(a, r.id), this._adjustSheetNamesIfRequired(), n.commit(s);
|
|
2997
3116
|
} catch (e) {
|
|
2998
3117
|
throw n.rollback(), e;
|
|
2999
3118
|
}
|
|
@@ -3002,13 +3121,13 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3002
3121
|
}), this._emitter.notify("onSheetsChange"), i;
|
|
3003
3122
|
}
|
|
3004
3123
|
_moveSheet(e, t, s) {
|
|
3005
|
-
if (this._closed) throw new Error(
|
|
3006
|
-
if (!this.getProtection().isStructureAllowed()) throw new
|
|
3124
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
3125
|
+
if (!this.getProtection().isStructureAllowed()) throw new _s(ws("error.workbook.protection"));
|
|
3007
3126
|
let r = null;
|
|
3008
|
-
const i = this.beginCommit(
|
|
3127
|
+
const i = this.beginCommit(ws("op.moveSheetNamed", { name: e.name }));
|
|
3009
3128
|
try {
|
|
3010
3129
|
const o = this._getState(), n = o.sheetRefsVisible;
|
|
3011
|
-
if (t < 0 || t > n.length - 1) throw new
|
|
3130
|
+
if (t < 0 || t > n.length - 1) throw new ls(`Invalid to index: ${t}`);
|
|
3012
3131
|
const a = this.getView().getActiveSheetId(), l = o.sheetRefsAll, h = this._getOffsetForId(e.id, l), c = this._getOffsetForId(n[t].id, l);
|
|
3013
3132
|
if (h === c) return;
|
|
3014
3133
|
const u = l[h];
|
|
@@ -3022,11 +3141,11 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3022
3141
|
return r;
|
|
3023
3142
|
}
|
|
3024
3143
|
_setSelectedSheet(e) {
|
|
3025
|
-
if (this._closed) throw new Error(
|
|
3144
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
3026
3145
|
const t = this._getSheetRef(e);
|
|
3027
|
-
if (!t) throw new
|
|
3146
|
+
if (!t) throw new ls(Rr(e));
|
|
3028
3147
|
let s = null;
|
|
3029
|
-
return t.visibility !==
|
|
3148
|
+
return t.visibility !== be.Visibility.Visible && this._setSheetVisibility(t, be.Visibility.Visible), this._view.setActiveSheetId(t.id), s = t.sheet, s;
|
|
3030
3149
|
}
|
|
3031
3150
|
getProtection() {
|
|
3032
3151
|
return this._protection;
|
|
@@ -3044,7 +3163,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3044
3163
|
return this._calculation;
|
|
3045
3164
|
}
|
|
3046
3165
|
getFonts() {
|
|
3047
|
-
return
|
|
3166
|
+
return j.getShared();
|
|
3048
3167
|
}
|
|
3049
3168
|
createFormula(e, t, s) {
|
|
3050
3169
|
return this.getCalculation().createFormula(e, t, s);
|
|
@@ -3075,39 +3194,35 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3075
3194
|
return this._emitter.addListeners(e, t);
|
|
3076
3195
|
}
|
|
3077
3196
|
_sheetToWBEvent(e) {
|
|
3078
|
-
const t = this
|
|
3079
|
-
|
|
3080
|
-
const
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
const s = e.getCoords(), r = e.getWorksheet().getName();
|
|
3096
|
-
return t.getRange({
|
|
3097
|
-
...s,
|
|
3098
|
-
scope: r
|
|
3099
|
-
});
|
|
3100
|
-
}
|
|
3101
|
-
};
|
|
3197
|
+
const t = this, s = (e) => {
|
|
3198
|
+
if (e.isInvalid()) return e;
|
|
3199
|
+
const s = e.getWorksheet().getName();
|
|
3200
|
+
if (e.isICellRanges) {
|
|
3201
|
+
const r = e.getCoords().map((e) => e.scope ? e : {
|
|
3202
|
+
...e,
|
|
3203
|
+
scope: s
|
|
3204
|
+
});
|
|
3205
|
+
return t.getRanges(r);
|
|
3206
|
+
}
|
|
3207
|
+
const r = e.getCoords();
|
|
3208
|
+
return t.getRange(r.scope ? r : {
|
|
3209
|
+
...r,
|
|
3210
|
+
scope: s
|
|
3211
|
+
});
|
|
3212
|
+
};
|
|
3213
|
+
return (t) => {
|
|
3102
3214
|
e({
|
|
3103
|
-
getSource:
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3215
|
+
getSource: () => s(t.getSource()),
|
|
3216
|
+
getRanges: () => {
|
|
3217
|
+
const e = t.getRanges();
|
|
3218
|
+
return e ? s(e) : null;
|
|
3219
|
+
},
|
|
3220
|
+
getPreviousAddress: () => t.getPreviousAddress(),
|
|
3221
|
+
getTrigger: () => t.getTrigger(),
|
|
3222
|
+
isUndo: () => t.isUndo(),
|
|
3223
|
+
getCommit: () => t.getCommit(),
|
|
3224
|
+
toString: () => `WorkbookRangeEvent: ('${t.getTrigger()}', ${s(t.getSource()).toString()})`,
|
|
3225
|
+
getTimeStamp: () => t.getTimeStamp()
|
|
3111
3226
|
});
|
|
3112
3227
|
};
|
|
3113
3228
|
}
|
|
@@ -3115,74 +3230,90 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3115
3230
|
const e = this._pivotCaches;
|
|
3116
3231
|
if (0 === e.length) return;
|
|
3117
3232
|
const t = (e) => {
|
|
3118
|
-
const t = this._getSheetRef(e), s = t &&
|
|
3233
|
+
const t = this._getSheetRef(e), s = t && Jr(t) ? t.sheet : null;
|
|
3119
3234
|
return s ? s._contentAddWatch(() => null) : null;
|
|
3120
3235
|
};
|
|
3121
3236
|
for (let s = 0; s < e.length; s++) e[s]._hold(t);
|
|
3122
3237
|
}
|
|
3123
3238
|
_fromJSON(e, t) {
|
|
3124
|
-
if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || 0 === e.sheets.length) throw new
|
|
3125
|
-
e.theme && (this._theme = new
|
|
3126
|
-
const s = this._strings.beginPersist(), r = this._resources.beginPersist(), i = this._styles.beginPersist();
|
|
3239
|
+
if (this._emitter.notify("onBeforeLoad", { params: e }), this._initState(), !e.sheets || 0 === e.sheets.length) throw new ls(ws("error.workbook.sheetOne"));
|
|
3240
|
+
e.theme && (this._theme = new T(e.theme), this._styles.setTheme(this._theme));
|
|
3241
|
+
const s = this._strings.beginPersist(), r = this._resources.beginPersist(), i = this._styles.beginPersist(), o = this._richValues.beginPersist();
|
|
3127
3242
|
try {
|
|
3128
|
-
s.fromJSON(e.strings), r.fromJSON(e.resources),
|
|
3129
|
-
|
|
3130
|
-
|
|
3243
|
+
s.fromJSON(e.strings), r.fromJSON(e.resources), this._fetch.adopt(this._resources.getItems()), i.fromJSON(e.styles), o.fromJSON(e.richData, {
|
|
3244
|
+
resources: this._resources,
|
|
3245
|
+
strings: this._strings,
|
|
3246
|
+
fromResourceId: (e) => r.fromResourceId(e) ?? null
|
|
3247
|
+
}, 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 || (e.view = {});
|
|
3248
|
+
const n = [], a = e.pivotCaches;
|
|
3249
|
+
if (a) {
|
|
3131
3250
|
const e = r.fromResourceId.bind(r);
|
|
3132
|
-
for (let t = 0; t <
|
|
3133
|
-
const s =
|
|
3134
|
-
s && "number" == typeof s.cacheId &&
|
|
3251
|
+
for (let t = 0; t < a.length; t++) {
|
|
3252
|
+
const s = a[t];
|
|
3253
|
+
s && "number" == typeof s.cacheId && n.push(new ir(s.cacheId, ot.fromJSON(s.part, e)));
|
|
3135
3254
|
}
|
|
3136
3255
|
}
|
|
3137
|
-
this._pivotCaches =
|
|
3138
|
-
const
|
|
3139
|
-
let
|
|
3140
|
-
null !==
|
|
3141
|
-
let
|
|
3256
|
+
this._pivotCaches = n, this._people.fromJSON(e.people);
|
|
3257
|
+
const l = e.sheets, h = l.length;
|
|
3258
|
+
let c = e.view.activeSheetId ?? null;
|
|
3259
|
+
null !== c && (c = Math.min(Math.max(0, c), h - 1));
|
|
3260
|
+
let u = null, d = null;
|
|
3142
3261
|
this._isLoadingSheets = !0;
|
|
3143
|
-
for (let e = 0; e <
|
|
3144
|
-
const s =
|
|
3145
|
-
|
|
3262
|
+
for (let e = 0; e < h; e++) {
|
|
3263
|
+
const s = l[e], i = s.visibility || be.Visibility.Visible, o = e;
|
|
3264
|
+
d = o, i === be.Visibility.Visible ? null === u && (u = o) : null !== c && c === o && (c = null);
|
|
3146
3265
|
try {
|
|
3147
|
-
const n = s.kind ??
|
|
3148
|
-
if (n !==
|
|
3149
|
-
const a = s.sheet, l =
|
|
3150
|
-
if (!l) throw new
|
|
3266
|
+
const n = s.kind ?? be.Kind.Worksheet;
|
|
3267
|
+
if (n !== be.Kind.Worksheet) {
|
|
3268
|
+
const a = s.sheet, l = ot.fromJSON(a?.part, r.fromResourceId.bind(r));
|
|
3269
|
+
if (!l) throw new ls(ws("error.workbook.sheetPartMissing", { sheetName: s.name }));
|
|
3151
3270
|
this._createOpaqueSheet(o, s.name, i, e, s.sheetId, n, l, a?.tabColor ?? null, t?.[e]);
|
|
3152
3271
|
} else this._createSheet(o, s.name, i, e, s.sheetId, s.sheet, t?.[e]);
|
|
3153
3272
|
} catch (e) {
|
|
3154
3273
|
throw this._isLoadingSheets = !1, e;
|
|
3155
3274
|
}
|
|
3156
3275
|
}
|
|
3157
|
-
this._isLoadingSheets = !1, this._tellSheets(), this._holdPivotCaches(), this._updateState({ lastId:
|
|
3158
|
-
const
|
|
3159
|
-
this._protection = new
|
|
3160
|
-
|
|
3276
|
+
this._isLoadingSheets = !1, this._tellSheets(), this._holdPivotCaches(), this._updateState({ lastId: d }), e.view.activeSheetId = c ?? u, this.setView(new kr({ json: e.view })), this._adjustSheetNamesIfRequired(), this._listenerProtection?.();
|
|
3277
|
+
const g = this;
|
|
3278
|
+
this._protection = new vr(e?.protection, this._options?.readonly), this._listenerProtection = this._protection.addListeners({ onChange: (e) => {
|
|
3279
|
+
g._emitter.notify("onProtectionChange", { source: e });
|
|
3161
3280
|
} }), this._emitter.notify("onLoad");
|
|
3162
3281
|
} finally {
|
|
3163
|
-
i.endPersist(), r.endPersist(), s.endPersist();
|
|
3282
|
+
o.endPersist(), i.endPersist(), r.endPersist(), s.endPersist();
|
|
3164
3283
|
}
|
|
3165
3284
|
}
|
|
3285
|
+
async _startFunctions() {
|
|
3286
|
+
const e = this._scripts;
|
|
3287
|
+
if (!e) return os.EmptyArray;
|
|
3288
|
+
await e._load();
|
|
3289
|
+
const t = [];
|
|
3290
|
+
for (const s of e.getModules().getItems()) this._startModules.add(s), t.push(...s.getFunctions().getItems({
|
|
3291
|
+
type: "formula",
|
|
3292
|
+
includeHidden: !0
|
|
3293
|
+
}));
|
|
3294
|
+
return t;
|
|
3295
|
+
}
|
|
3166
3296
|
_createScripts(e) {
|
|
3167
3297
|
const t = this;
|
|
3168
|
-
return new
|
|
3298
|
+
return new lr({
|
|
3169
3299
|
transactions: this._transactions,
|
|
3170
3300
|
json: e,
|
|
3171
3301
|
workbook: t,
|
|
3172
3302
|
getBuiltInFunctions: () => t._calculation?.getFunctions(),
|
|
3173
3303
|
onAdd: (e, s) => {
|
|
3174
3304
|
const r = t._calculation;
|
|
3175
|
-
r.getStatus() !==
|
|
3305
|
+
r.getStatus() !== wt.Status.Off && r.start().then(async () => {
|
|
3306
|
+
if (t._startModules.has(s)) return;
|
|
3176
3307
|
const e = s.getFunctions().getItems({
|
|
3177
3308
|
type: "formula",
|
|
3178
3309
|
includeHidden: !0
|
|
3179
|
-
}),
|
|
3180
|
-
for (let
|
|
3181
|
-
const
|
|
3310
|
+
}), r = e.length;
|
|
3311
|
+
for (let t = 0; t < r; t++) {
|
|
3312
|
+
const s = e[t];
|
|
3182
3313
|
try {
|
|
3183
|
-
await this._calculation.getFunctions().add(
|
|
3314
|
+
await this._calculation.getFunctions().add(s);
|
|
3184
3315
|
} catch (e) {
|
|
3185
|
-
|
|
3316
|
+
us.error(e?.message ?? String(e), e);
|
|
3186
3317
|
}
|
|
3187
3318
|
}
|
|
3188
3319
|
}).catch(() => {});
|
|
@@ -3191,10 +3322,10 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3191
3322
|
});
|
|
3192
3323
|
}
|
|
3193
3324
|
async toJSON(e) {
|
|
3194
|
-
if (this._closed) throw new Error(
|
|
3325
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
3195
3326
|
await Promise.resolve(this._starting);
|
|
3196
3327
|
const t = this.getCalculation();
|
|
3197
|
-
t.getStatus() !==
|
|
3328
|
+
t.getStatus() !== wt.Status.Off && (await t.ready(), await t._whenRequestsSettled?.()), await this._emitter.notify("onBeforeSave", { async: !0 });
|
|
3198
3329
|
const s = { sheets: [] }, r = e?.ignoreStyles ?? !1;
|
|
3199
3330
|
if (!r) {
|
|
3200
3331
|
const e = this._theme.toJSON();
|
|
@@ -3207,60 +3338,66 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3207
3338
|
this._isDate1904 && (s.date1904 = !0), this._codeName && (s.codeName = this._codeName), this._updateLinks && (s.updateLinks = this._updateLinks);
|
|
3208
3339
|
const i = this._documentProperties.toJSON();
|
|
3209
3340
|
Object.keys(i).length > 0 && (s.properties = i), this._locale && (s.locale = this._locale), this._localeOverrides && (s.localeOverrides = this._localeOverrides);
|
|
3210
|
-
const o = e?.resources ?? "embed", n = "ignore" === o, a = this._strings.beginPersist(), l = n ? null : this._resources.beginPersist(), h = this._styles.beginPersist();
|
|
3341
|
+
const o = e?.resources ?? "embed", n = "ignore" === o, a = this._strings.beginPersist(), l = n ? null : this._resources.beginPersist(), h = this._styles.beginPersist(), c = this._richValues.beginPersist();
|
|
3211
3342
|
try {
|
|
3212
3343
|
const t = this._getSheetRef(this.getSelectedSheetIndex()).id;
|
|
3213
|
-
let i = t,
|
|
3214
|
-
const
|
|
3215
|
-
for (let r = 0; r <
|
|
3216
|
-
const o =
|
|
3344
|
+
let i = t, u = null;
|
|
3345
|
+
const d = this._getState(), g = d.sheetRefsAll, m = d.sheetsById, _ = g.length;
|
|
3346
|
+
for (let r = 0; r < _; r++) {
|
|
3347
|
+
const o = g[r], n = r + 1;
|
|
3217
3348
|
let a;
|
|
3218
|
-
const h =
|
|
3219
|
-
if (
|
|
3349
|
+
const h = m.get(o.id);
|
|
3350
|
+
if (Jr(o)) a = {
|
|
3220
3351
|
name: o.name,
|
|
3221
3352
|
sheet: await o.sheet.toJSON(e)
|
|
3222
3353
|
};
|
|
3223
3354
|
else {
|
|
3224
|
-
const e = h, t = l ? l.toResourceId.bind(l) : () => null, s = { part:
|
|
3355
|
+
const e = h, t = l ? l.toResourceId.bind(l) : () => null, s = { part: ot.toJSON(e._getPart(), t) }, r = e.getTabColor();
|
|
3225
3356
|
r && (s.tabColor = r.toString()), a = {
|
|
3226
3357
|
name: o.name,
|
|
3227
3358
|
kind: e.getKind(),
|
|
3228
3359
|
sheet: s
|
|
3229
3360
|
};
|
|
3230
3361
|
}
|
|
3231
|
-
void 0 !== o.sheetId && (a.sheetId = o.sheetId), o.visibility ===
|
|
3362
|
+
void 0 !== o.sheetId && (a.sheetId = o.sheetId), o.visibility === be.Visibility.Visible ? null === u && (u = n) : a.visibility = o.visibility, o.id === t && (i = n), s.sheets.push(a);
|
|
3232
3363
|
}
|
|
3233
3364
|
if (!r) {
|
|
3234
3365
|
const e = h.toJSON();
|
|
3235
3366
|
e && Object.keys(e).length > 0 && (s.styles = e);
|
|
3236
3367
|
}
|
|
3237
|
-
const
|
|
3238
|
-
|
|
3239
|
-
const
|
|
3240
|
-
Object.keys(
|
|
3241
|
-
const
|
|
3242
|
-
|
|
3243
|
-
const
|
|
3244
|
-
w && (s.externalBooks = w);
|
|
3245
|
-
const y = this._pivotCaches;
|
|
3368
|
+
const f = this.getProtection().toJSON();
|
|
3369
|
+
f && (s.protection = f);
|
|
3370
|
+
const p = this._calculation.toJSON();
|
|
3371
|
+
Object.keys(p).length > 0 && (s.calc = p);
|
|
3372
|
+
const w = await a.toJSONAsync();
|
|
3373
|
+
w && w.length > 0 && (s.strings = w);
|
|
3374
|
+
const y = await c.toJSONAsync(l ? l.toResourceId.bind(l) : void 0);
|
|
3246
3375
|
if (y.length > 0) {
|
|
3376
|
+
s.richData = y;
|
|
3377
|
+
const e = c.toKindsJSON();
|
|
3378
|
+
e.length > 0 && (s.richTypes = e);
|
|
3379
|
+
}
|
|
3380
|
+
const S = this._calculation.getExternalBooks().toJSON();
|
|
3381
|
+
S && (s.externalBooks = S);
|
|
3382
|
+
const b = this._pivotCaches;
|
|
3383
|
+
if (b.length > 0) {
|
|
3247
3384
|
const e = l ? l.toResourceId.bind(l) : () => null, t = /* @__PURE__ */ new Set();
|
|
3248
3385
|
for (const e of this.getPivotTables()) t.add(e.getCacheId());
|
|
3249
3386
|
const r = [];
|
|
3250
|
-
for (let s = 0; s <
|
|
3387
|
+
for (let s = 0; s < b.length; s++) t.has(b[s].cacheId) && r.push(b[s].toJSON(e));
|
|
3251
3388
|
r.length > 0 && (s.pivotCaches = r);
|
|
3252
3389
|
}
|
|
3253
|
-
const
|
|
3254
|
-
if (
|
|
3390
|
+
const k = this._people.toJSON();
|
|
3391
|
+
if (k && (s.people = k), !n) {
|
|
3255
3392
|
const e = await l.toJSONAsync("function" == typeof o ? o : void 0);
|
|
3256
3393
|
e && e.length > 0 && (s.resources = e);
|
|
3257
3394
|
}
|
|
3258
|
-
const
|
|
3259
|
-
|
|
3260
|
-
const
|
|
3261
|
-
|
|
3395
|
+
const C = this._calculation.getNamedFormulas().toJSON();
|
|
3396
|
+
C && C.length > 0 && (s.names = C);
|
|
3397
|
+
const v = this._view.toJSON();
|
|
3398
|
+
v && (i !== u ? v.activeSheetId = i : delete v.activeSheetId, Object.keys(v).length > 0 && (s.view = v));
|
|
3262
3399
|
} finally {
|
|
3263
|
-
h.endPersist(), n || l.endPersist(), a.endPersist();
|
|
3400
|
+
c.endPersist(), h.endPersist(), n || l.endPersist(), a.endPersist();
|
|
3264
3401
|
}
|
|
3265
3402
|
return this._emitter.notify("onSave", { params: s }), s;
|
|
3266
3403
|
}
|
|
@@ -3280,16 +3417,16 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3280
3417
|
} catch (e) {
|
|
3281
3418
|
console.warn("error on close", e);
|
|
3282
3419
|
}
|
|
3283
|
-
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
|
|
3420
|
+
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 xs && this._originProvider.release(), this._closed = !0;
|
|
3284
3421
|
}
|
|
3285
3422
|
beginCommit(e) {
|
|
3286
|
-
if (this._closed) throw new Error(
|
|
3423
|
+
if (this._closed) throw new Error(ws("error.workbook.modelClosed"));
|
|
3287
3424
|
return this._beginCommit("string" == typeof e ? { description: e } : e);
|
|
3288
3425
|
}
|
|
3289
3426
|
doBatch(e, t) {
|
|
3290
3427
|
const r = this;
|
|
3291
3428
|
t = "string" == typeof t ? { description: t } : {
|
|
3292
|
-
description:
|
|
3429
|
+
description: ps("op.updateWorkbook"),
|
|
3293
3430
|
...t
|
|
3294
3431
|
};
|
|
3295
3432
|
const i = s.bind(this._transactions, this, e);
|
|
@@ -3309,7 +3446,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3309
3446
|
_getState() {
|
|
3310
3447
|
return this._transactions.getState(this._id);
|
|
3311
3448
|
}
|
|
3312
|
-
_updateState(e, t =
|
|
3449
|
+
_updateState(e, t = ps("op.updateWorkbook"), s) {
|
|
3313
3450
|
if (!e) return;
|
|
3314
3451
|
const r = this._beginCommit(t);
|
|
3315
3452
|
try {
|
|
@@ -3330,7 +3467,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3330
3467
|
get isIWorkbook() {
|
|
3331
3468
|
return !0;
|
|
3332
3469
|
}
|
|
3333
|
-
},
|
|
3470
|
+
}, Ur = { address: null }, Jr = (e) => e.sheet.getKind() === be.Kind.Worksheet, qr = class {
|
|
3334
3471
|
constructor() {
|
|
3335
3472
|
this._readFormats = [], this._writeFormats = [], this._encryptions = [];
|
|
3336
3473
|
}
|
|
@@ -3407,9 +3544,9 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3407
3544
|
return !0;
|
|
3408
3545
|
});
|
|
3409
3546
|
}
|
|
3410
|
-
},
|
|
3547
|
+
}, $r = /* @__PURE__ */ new WeakMap(), Kr = (e) => !!e && "object" == typeof e && "function" == typeof e.getPath && "function" == typeof e.canWrite, Gr = class {
|
|
3411
3548
|
constructor() {
|
|
3412
|
-
this._setInstalled = /* @__PURE__ */ new WeakSet(), this._backingStore = null, this._emitter = new e(this), this._registry = new
|
|
3549
|
+
this._setInstalled = /* @__PURE__ */ new WeakSet(), this._backingStore = null, this._emitter = new e(this), this._registry = new qr(), this._defaultStore = new Ls(() => this.getWriteFormats(), () => this.getReadFormats());
|
|
3413
3550
|
}
|
|
3414
3551
|
getBackingStore() {
|
|
3415
3552
|
return this._backingStore ?? this._defaultStore;
|
|
@@ -3444,15 +3581,15 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3444
3581
|
return this._registry.getWriteFormats(e);
|
|
3445
3582
|
}
|
|
3446
3583
|
getOrigin(e) {
|
|
3447
|
-
return new
|
|
3584
|
+
return new Is(e);
|
|
3448
3585
|
}
|
|
3449
3586
|
async read(e) {
|
|
3450
3587
|
let t = null;
|
|
3451
3588
|
if ("string" == typeof e) e = { source: e };
|
|
3452
|
-
else if (
|
|
3589
|
+
else if (Kr(e)) {
|
|
3453
3590
|
const s = e.getPath();
|
|
3454
3591
|
if (!s) throw new Error("Cannot read from an unbound origin (no path).");
|
|
3455
|
-
|
|
3592
|
+
Rs(e) ? e = {
|
|
3456
3593
|
source: s,
|
|
3457
3594
|
asCopy: !0
|
|
3458
3595
|
} : (t = e, e = { source: s });
|
|
@@ -3471,21 +3608,21 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3471
3608
|
search: i,
|
|
3472
3609
|
ext: o
|
|
3473
3610
|
}))[0];
|
|
3474
|
-
if (!n) throw new
|
|
3611
|
+
if (!n) throw new ls(ws("error.io.readFormatUnavailable", { format: i ?? o }));
|
|
3475
3612
|
const a = s?.typedCreateWorkbookOptions, l = a ? Object.keys(a).find((e) => e.toLowerCase() === n.key.toLowerCase()) : void 0;
|
|
3476
3613
|
let h = {
|
|
3477
3614
|
...s,
|
|
3478
3615
|
...void 0 !== l ? a[l] : void 0
|
|
3479
3616
|
};
|
|
3480
3617
|
delete h.typedCreateWorkbookOptions, delete h.source, delete h.asCopy;
|
|
3481
|
-
const c = r ?? new
|
|
3618
|
+
const c = r ?? new Is(t.absolutePath ?? null, {
|
|
3482
3619
|
name: t.name ?? null,
|
|
3483
3620
|
format: n.key,
|
|
3484
3621
|
size: t.size ?? null,
|
|
3485
3622
|
lastModified: t.lastModified ?? null,
|
|
3486
3623
|
canWrite: t.canWrite ?? !1
|
|
3487
3624
|
});
|
|
3488
|
-
r instanceof
|
|
3625
|
+
r instanceof Is && r.update({
|
|
3489
3626
|
format: n.key,
|
|
3490
3627
|
size: t.size ?? null,
|
|
3491
3628
|
lastModified: t.lastModified ?? null
|
|
@@ -3519,7 +3656,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3519
3656
|
}
|
|
3520
3657
|
async _decrypt(e, t, s) {
|
|
3521
3658
|
const r = await this._registry.detectEncryption(e);
|
|
3522
|
-
if (t instanceof
|
|
3659
|
+
if (t instanceof Is && t.update({ encryption: r ? r.key : null }), !r) return {
|
|
3523
3660
|
bytes: e,
|
|
3524
3661
|
password: null
|
|
3525
3662
|
};
|
|
@@ -3528,7 +3665,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3528
3665
|
try {
|
|
3529
3666
|
return i = await r.decode(e, t), !0;
|
|
3530
3667
|
} catch (e) {
|
|
3531
|
-
if (!(e instanceof
|
|
3668
|
+
if (!(e instanceof hs)) throw e;
|
|
3532
3669
|
return !1;
|
|
3533
3670
|
}
|
|
3534
3671
|
};
|
|
@@ -3538,7 +3675,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3538
3675
|
};
|
|
3539
3676
|
if (!s?.onPassword) {
|
|
3540
3677
|
const e = t.getName();
|
|
3541
|
-
throw new
|
|
3678
|
+
throw new ms(e ? ws("error.io.passwordRequired", { name: e }) : ws("error.io.passwordRequiredUnnamed"));
|
|
3542
3679
|
}
|
|
3543
3680
|
const n = await Promise.resolve(s.onPassword({
|
|
3544
3681
|
origin: t,
|
|
@@ -3554,16 +3691,16 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3554
3691
|
bytes: i,
|
|
3555
3692
|
password: n
|
|
3556
3693
|
};
|
|
3557
|
-
throw new
|
|
3694
|
+
throw new hs(ws("error.io.passwordIncorrect"));
|
|
3558
3695
|
}
|
|
3559
3696
|
async writeArrayBuffer(e, t) {
|
|
3560
3697
|
if (!t?.format) throw new Error("A format must be specified to write to an ArrayBuffer (e.g. { format: 'xlsx' }).");
|
|
3561
3698
|
const s = (await this._registry.getWriteFormats({ search: t.format }))[0];
|
|
3562
|
-
if (!s) throw new
|
|
3699
|
+
if (!s) throw new ls(ws("error.io.writeFormatUnavailable", { format: t.format }));
|
|
3563
3700
|
return this._writeArrayBuffer(e, s, t);
|
|
3564
3701
|
}
|
|
3565
3702
|
async write(e, t, s) {
|
|
3566
|
-
return "string" == typeof t ||
|
|
3703
|
+
return "string" == typeof t || Kr(t) ? this._write(e, t, !1, s) : this._write(e, e?.getOrigin?.(), !0, t ?? s);
|
|
3567
3704
|
}
|
|
3568
3705
|
async writeAs(e, t, s) {
|
|
3569
3706
|
if (!t) throw new Error("A target must be provided for writeAs (use write(workbook) for a plain save).");
|
|
@@ -3575,13 +3712,13 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3575
3712
|
let i = "string" == typeof t ? this.getOrigin(t) : t;
|
|
3576
3713
|
const o = i.getFormat();
|
|
3577
3714
|
let n;
|
|
3578
|
-
if ((r?.format || o) && (n = (await this._registry.getWriteFormats({ search: r?.format ?? o ?? void 0 }))[0]), n || i.getPath() && i.canWrite() && i.getExtension() || (n = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !n) throw new
|
|
3715
|
+
if ((r?.format || o) && (n = (await this._registry.getWriteFormats({ search: r?.format ?? o ?? void 0 }))[0]), n || i.getPath() && i.canWrite() && i.getExtension() || (n = (await this._registry.getWriteFormats({ ext: "sxl" }))[0] ?? (await this._registry.getWriteFormats())[0]), !n) throw new ls(ws("error.io.writeFormatUnresolved"));
|
|
3579
3716
|
const a = i.getExtension();
|
|
3580
3717
|
if (r?.format && a && i.getPath() && i.canWrite() && !n.exts.includes(a)) {
|
|
3581
3718
|
const e = (await this._registry.getWriteFormats({ ext: a }))[0];
|
|
3582
3719
|
if (e && e.key !== n.key) {
|
|
3583
3720
|
const e = i.getPath().split(/[/\\]/).pop();
|
|
3584
|
-
throw new
|
|
3721
|
+
throw new ls(ws("error.io.writeFormatMismatch", {
|
|
3585
3722
|
format: r.format,
|
|
3586
3723
|
file: e
|
|
3587
3724
|
}));
|
|
@@ -3589,17 +3726,17 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3589
3726
|
}
|
|
3590
3727
|
if ("string" == typeof t) {
|
|
3591
3728
|
const e = i.getPath();
|
|
3592
|
-
i = new
|
|
3729
|
+
i = new Is(Te(e) ? e : `${e}.${n.exts[0]}`, { format: n.key });
|
|
3593
3730
|
}
|
|
3594
|
-
const l = i.getEncryption(), h = e.getOrigin?.(), c = (i instanceof
|
|
3731
|
+
const l = i.getEncryption(), h = e.getOrigin?.(), c = (i instanceof Is ? i.getPassword() : null) ?? (h instanceof Is ? h.getPassword() : null), u = i.isEncrypted() || (h?.isEncrypted() ?? !1), d = void 0 !== r?.password ? r.password : c ?? (u ? void 0 : null);
|
|
3595
3732
|
let g = null;
|
|
3596
3733
|
if (void 0 === d) {
|
|
3597
3734
|
if (u) {
|
|
3598
3735
|
const e = i.getName();
|
|
3599
|
-
throw new
|
|
3736
|
+
throw new ms(e ? ws("error.io.passwordRequiredSave", { name: e }) : ws("error.io.passwordRequiredSaveUnnamed"));
|
|
3600
3737
|
}
|
|
3601
|
-
} else if (null !== d && (g = await this._registry.getEncryption(l), !g)) throw new
|
|
3602
|
-
const m = `${i.getName() ??
|
|
3738
|
+
} else if (null !== d && (g = await this._registry.getEncryption(l), !g)) throw new ls(ws("error.io.encryptionUnavailable"));
|
|
3739
|
+
const m = `${i.getName() ?? ws("workbook.defaultName")}.${n.exts[0]}`, _ = r?.progress, f = !i.getPath() || !i.canWrite() || !!r?.prompt;
|
|
3603
3740
|
let p = !1;
|
|
3604
3741
|
const w = this;
|
|
3605
3742
|
let y = null, S = [];
|
|
@@ -3628,7 +3765,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3628
3765
|
}))(_, h), u = await w._writeArrayBuffer(e, l, {
|
|
3629
3766
|
...r,
|
|
3630
3767
|
progress: c
|
|
3631
|
-
}), m =
|
|
3768
|
+
}), m = $r.get(a);
|
|
3632
3769
|
if (h.some((e) => !m?.has(e.message)) && r?.onWarnings) {
|
|
3633
3770
|
const t = await Promise.resolve(r.onWarnings({
|
|
3634
3771
|
workbook: e,
|
|
@@ -3642,38 +3779,38 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3642
3779
|
return S = h, g ? g.encode(u, d) : u;
|
|
3643
3780
|
}
|
|
3644
3781
|
};
|
|
3645
|
-
let
|
|
3782
|
+
let k = null;
|
|
3646
3783
|
try {
|
|
3647
3784
|
const t = this.getBackingStore();
|
|
3648
3785
|
if (!t.write) throw new Error("The active backing store is read-only (no write implementation).");
|
|
3649
|
-
if (
|
|
3650
|
-
if (void 0 !== d &&
|
|
3651
|
-
const e =
|
|
3786
|
+
if (k = await t.write(b), k) {
|
|
3787
|
+
if (void 0 !== d && k instanceof Is && (k.setPassword(d), k.update({ encryption: g ? g.key : null })), S.length) {
|
|
3788
|
+
const e = $r.get(k) ?? /* @__PURE__ */ new Set();
|
|
3652
3789
|
for (const t of S) e.add(t.message);
|
|
3653
|
-
|
|
3790
|
+
$r.set(k, e);
|
|
3654
3791
|
}
|
|
3655
|
-
s &&
|
|
3792
|
+
s && k !== e.getOrigin() && Rs(e.getOrigin())?.setOrigin(k);
|
|
3656
3793
|
const t = y ?? e.getTransactions?.()?.getCurrentCommit() ?? null;
|
|
3657
3794
|
this._emitter.notify("onWrite", {
|
|
3658
3795
|
params: {
|
|
3659
3796
|
workbook: e,
|
|
3660
|
-
origin:
|
|
3797
|
+
origin: k,
|
|
3661
3798
|
commitId: t?.getId() ?? null,
|
|
3662
3799
|
save: s
|
|
3663
3800
|
},
|
|
3664
3801
|
transactional: !1
|
|
3665
3802
|
});
|
|
3666
3803
|
}
|
|
3667
|
-
_?.onComplete && await Promise.resolve(_.onComplete(
|
|
3804
|
+
_?.onComplete && await Promise.resolve(_.onComplete(k));
|
|
3668
3805
|
} catch (e) {
|
|
3669
3806
|
const t = e instanceof Error ? e : new Error(String(e));
|
|
3670
|
-
if (_?.onError && await Promise.resolve(_.onError(t)), _?.onComplete && await Promise.resolve(_.onComplete(null)), t instanceof
|
|
3671
|
-
throw new Error(
|
|
3807
|
+
if (_?.onError && await Promise.resolve(_.onError(t)), _?.onComplete && await Promise.resolve(_.onComplete(null)), t instanceof ls) throw t;
|
|
3808
|
+
throw new Error(ws("error.io.writeFailed", { reason: t.message }), { cause: e });
|
|
3672
3809
|
}
|
|
3673
|
-
return
|
|
3810
|
+
return k;
|
|
3674
3811
|
}
|
|
3675
3812
|
_stripExtension(e) {
|
|
3676
|
-
const t =
|
|
3813
|
+
const t = Te(e);
|
|
3677
3814
|
return t ? e.slice(0, e.length - t.length - 1) : e;
|
|
3678
3815
|
}
|
|
3679
3816
|
_baseName(e) {
|
|
@@ -3693,25 +3830,25 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3693
3830
|
async _readArrayBuffer(e, t, s) {
|
|
3694
3831
|
if (!e) throw new Error("ArrayBuffer must be specified.");
|
|
3695
3832
|
if (!t) throw new Error("format must be specified.");
|
|
3696
|
-
if (0 === e.byteLength) return new
|
|
3833
|
+
if (0 === e.byteLength) return new Hr(s?.createWorkbookOptions);
|
|
3697
3834
|
const r = t.handler;
|
|
3698
3835
|
if (!r) throw new Error(`Unable to resolve a read handler for '${t.key}'.`);
|
|
3699
3836
|
let i;
|
|
3700
3837
|
try {
|
|
3701
3838
|
i = await r(e, s);
|
|
3702
3839
|
} catch (e) {
|
|
3703
|
-
if (e instanceof
|
|
3704
|
-
throw new
|
|
3840
|
+
if (e instanceof ls) throw e;
|
|
3841
|
+
throw new ls(ws("error.io.readFailed", {
|
|
3705
3842
|
format: t.description ?? t.key,
|
|
3706
3843
|
reason: e?.message ?? String(e)
|
|
3707
3844
|
}), { cause: e });
|
|
3708
3845
|
}
|
|
3709
|
-
return await
|
|
3846
|
+
return await Ke(), i;
|
|
3710
3847
|
}
|
|
3711
3848
|
get isIWorkbookIO() {
|
|
3712
3849
|
return !0;
|
|
3713
3850
|
}
|
|
3714
|
-
},
|
|
3851
|
+
}, Xr = new Gr(), Qr = class {
|
|
3715
3852
|
constructor() {
|
|
3716
3853
|
this._buffer = null, this._formatKey = null;
|
|
3717
3854
|
}
|
|
@@ -3725,7 +3862,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3725
3862
|
async read(e) {
|
|
3726
3863
|
return this._buffer ? e.decode(this._buffer, { format: this._formatKey ?? void 0 }) : null;
|
|
3727
3864
|
}
|
|
3728
|
-
},
|
|
3865
|
+
}, Zr = "locales", Yr = "fonts", ei = {
|
|
3729
3866
|
suffix: ".msg.json",
|
|
3730
3867
|
async extract(e) {
|
|
3731
3868
|
const t = e.relPath.split("/");
|
|
@@ -3735,7 +3872,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3735
3872
|
} : null;
|
|
3736
3873
|
},
|
|
3737
3874
|
place: (e, t) => t ? `${t}/${e}` : null
|
|
3738
|
-
},
|
|
3875
|
+
}, ti = [
|
|
3739
3876
|
".woff2",
|
|
3740
3877
|
".woff",
|
|
3741
3878
|
".ttf",
|
|
@@ -3745,7 +3882,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3745
3882
|
].map((e) => ({
|
|
3746
3883
|
suffix: e,
|
|
3747
3884
|
place: (e, t) => t ? `${t}/${e}` : e
|
|
3748
|
-
})),
|
|
3885
|
+
})), si = {
|
|
3749
3886
|
suffix: ".metrics.json",
|
|
3750
3887
|
async extract(e) {
|
|
3751
3888
|
const t = await e.readJson();
|
|
@@ -3756,13 +3893,13 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3756
3893
|
} : null;
|
|
3757
3894
|
},
|
|
3758
3895
|
place: (e, t) => t ? `${t}/${e}` : e
|
|
3759
|
-
},
|
|
3760
|
-
kind:
|
|
3761
|
-
files: [
|
|
3896
|
+
}, ri = [{
|
|
3897
|
+
kind: Zr,
|
|
3898
|
+
files: [ei]
|
|
3762
3899
|
}, {
|
|
3763
|
-
kind:
|
|
3900
|
+
kind: Yr,
|
|
3764
3901
|
files: [
|
|
3765
|
-
|
|
3902
|
+
si,
|
|
3766
3903
|
{
|
|
3767
3904
|
suffix: ".hinted.json",
|
|
3768
3905
|
async extract(e) {
|
|
@@ -3774,7 +3911,7 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3774
3911
|
hinted: !0
|
|
3775
3912
|
} : null;
|
|
3776
3913
|
},
|
|
3777
|
-
place:
|
|
3914
|
+
place: si.place
|
|
3778
3915
|
},
|
|
3779
3916
|
{
|
|
3780
3917
|
suffix: ".rows.json",
|
|
@@ -3787,40 +3924,40 @@ var Sr, br = "workbook.activeSheet", kr = class e extends h {
|
|
|
3787
3924
|
rows: !0
|
|
3788
3925
|
} : null;
|
|
3789
3926
|
},
|
|
3790
|
-
place:
|
|
3927
|
+
place: si.place
|
|
3791
3928
|
},
|
|
3792
|
-
...
|
|
3929
|
+
...ti
|
|
3793
3930
|
]
|
|
3794
3931
|
}];
|
|
3795
|
-
async function
|
|
3796
|
-
const { Chart: s } = await import("./
|
|
3932
|
+
async function ii(e, t) {
|
|
3933
|
+
const { Chart: s } = await import("./D8hO07ToAibIuniw.mjs");
|
|
3797
3934
|
return new s({
|
|
3798
3935
|
json: e,
|
|
3799
3936
|
getStyles: t?.getStyles
|
|
3800
3937
|
});
|
|
3801
3938
|
}
|
|
3802
|
-
|
|
3803
|
-
var
|
|
3804
|
-
function
|
|
3805
|
-
if (!
|
|
3806
|
-
const e = import("./
|
|
3939
|
+
Br || (Br = {});
|
|
3940
|
+
var oi = null;
|
|
3941
|
+
function ni() {
|
|
3942
|
+
if (!oi) {
|
|
3943
|
+
const e = import("./C_aL7CGS1lrNn1Ng.mjs").then((e) => e.loadScriptingDeclarations());
|
|
3807
3944
|
e.catch(() => {
|
|
3808
|
-
|
|
3809
|
-
}),
|
|
3945
|
+
oi = null;
|
|
3946
|
+
}), oi = e;
|
|
3810
3947
|
}
|
|
3811
|
-
return
|
|
3948
|
+
return oi;
|
|
3812
3949
|
}
|
|
3813
|
-
var
|
|
3814
|
-
function
|
|
3815
|
-
if (!
|
|
3816
|
-
const e = import("./
|
|
3950
|
+
var ai, li, hi, ci = null;
|
|
3951
|
+
function ui() {
|
|
3952
|
+
if (!ci) {
|
|
3953
|
+
const e = import("./C_aL7CGS1lrNn1Ng.mjs").then((e) => e.loadScriptingApi()).then((e) => JSON.parse(e));
|
|
3817
3954
|
e.catch(() => {
|
|
3818
|
-
|
|
3819
|
-
}),
|
|
3955
|
+
ci = null;
|
|
3956
|
+
}), ci = e;
|
|
3820
3957
|
}
|
|
3821
|
-
return
|
|
3958
|
+
return ci;
|
|
3822
3959
|
}
|
|
3823
|
-
|
|
3960
|
+
ai || (ai = {}), (li || (li = {})).Type = {
|
|
3824
3961
|
Button: "button",
|
|
3825
3962
|
CheckBox: "checkBox",
|
|
3826
3963
|
OptionButton: "optionButton",
|
|
@@ -3833,12 +3970,12 @@ Hr || (Hr = {}), (Ur || (Ur = {})).Type = {
|
|
|
3833
3970
|
EditBox: "editBox",
|
|
3834
3971
|
Dialog: "dialog",
|
|
3835
3972
|
Unknown: "formControl"
|
|
3836
|
-
}, (
|
|
3973
|
+
}, (hi || (hi = {})).DropStyle = {
|
|
3837
3974
|
Combo: "combo",
|
|
3838
3975
|
ComboEdit: "comboEdit",
|
|
3839
3976
|
Simple: "simple"
|
|
3840
3977
|
};
|
|
3841
|
-
var
|
|
3978
|
+
var di = class extends le {
|
|
3842
3979
|
constructor(e) {
|
|
3843
3980
|
super(e);
|
|
3844
3981
|
}
|
|
@@ -3851,8 +3988,8 @@ var Kr = class extends Se {
|
|
|
3851
3988
|
colEnd: (e?.size?.width ?? 5) - 1,
|
|
3852
3989
|
rowEnd: (e?.size?.height ?? 5) - 1
|
|
3853
3990
|
},
|
|
3854
|
-
getRanges: (e) => new
|
|
3991
|
+
getRanges: (e) => new re(null)
|
|
3855
3992
|
}, super._initializeOptions(e);
|
|
3856
3993
|
}
|
|
3857
|
-
},
|
|
3858
|
-
export {
|
|
3994
|
+
}, gi = "0.8.0-beta.12", mi = "2026-10-29T20:27:37.494Z";
|
|
3995
|
+
export { St as AbstractCollection, r as AbstractMovableContent, _e as AddressUtils, Qr as ArrayBackingStore, G as AutoFill, mi as BUILD_DATE, c as CellControlRegistry, gt as CellImage, ae as CellImageKind, Me as ChartElementSelection, es as ChartKinds, ge as CheckboxKind, qt as Color, Be as Condition, ut as DateUtils, Gr as DefaultWorkbookIO, m as EXTERNAL_LINK_PATH_REL_TYPE, wr as ExternalRangeClipboardItem, Yr as FONTS_KIND, dr as Fetcher, Vt as FontUtils, M as FormulaText, Ks as FunctionDeclarations, F as GeomUtils, y as Hyperlink, f as HyperlinkKind, D as IAnchored, xt as IBorders, wt as ICalculation, we as ICell, Js as ICellHeaderRange, l as ICellRange, Us as ICellRanges, Dt as ICellStyle, Ht as IColor, ze as ICondition, ue as IConditionalFormat, Sr as ICustomProperty, O as IDataValidation, hi as IDropDown, $t as IEffect, zt as IFill, At as IFont, j as IFontCollection, Kt as IFontStyle, li as IFormControl, ts as IGeometry, ai as IMovable, q as IPageLayout, Br as IPicture, Hs as IResource, a as IRichDataKind, xe as IScript, Pt as IShape, be as ISheet, h as ISlicerStyle, vs as ISort, Xt as IStroke, I as ITable, me as ITableStyle, Se as IText, Ut as ITextFrame, zs as ITheme, A as IThemeCollection, ys as IWorkbookIO, rr as IWorkbookView, se as IWorksheetView, Zr as LOCALES_KIND, E as LicenseManager, st as MovableContentRegistry, ce as NamedStyleCollection, Jt as NumberFormat, Yt as PaintUtils, nr as PersonCollection, pr as RangeClipboardItem, As as RectAlignment, ct as Registry, C as Resource, Q as ResourceCollection, ie as RichArray, d as RichArrayKind, P as RichDataCollection, ve as RichDataRegistry, pt as RichRecord, $ as RichText, De as RichTextKind, ri as SHEETXL_RESOURCE_KINDS, Qt as SYSTEM_COLOR_CSS_PREFIX, Rt as ShapeStyleUtils, z as SimpleFontFace, de as SlicerStyleCollection, bt as Sort, U as StringCollection, Ct as StyleCollection, di as Table, N as TableStyleCollection, Le as TextRotation, Oe as TextStacked, Ge as TextUtils, T as Theme, Qe as ThemeCollection, t as TransactionConflictError, Cs as TransactionSaveStateManager, i as TransactionStore, Ss as TransactionUndoManager, rt as Tuple, gi as VERSION, Hr as Workbook, Xr as WorkbookIO, Is as WorkbookOrigin, kr as WorkbookView, dt as Worksheet, Ds as builtInStyleNameDisplay, ne as createCellRangeCounts, ii as createChart, _t as externalBookClosedName, he as externalBookFileName, S as externalBookLocation, p as externalBookOpenName, Ze as findLabel, Xs as getBuiltInFunctionNames, k as getLanguagePack, Ft as getLocaleProfile, Ve as getScriptRuntime, ui as getScriptingApi, ni as getScriptingDeclarations, x as localizeBoolean, W as localizeErrorLabel, It as makeLocaleProfile, V as normalizeLabel, ee as parseBooleanLocal, kt as parseErrorLocal, K as parseExternalScope, Qs as parseFormulaLiteral, X as registerSdkLocales, He as sourceEntryFromPath, Xe as withScriptRuntime };
|