@sheetxl/sdk 0.8.0-beta.11 → 0.8.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +172 -0
- package/browser/esm/{BMyDRQ716j79h_bH.mjs → -GEhXGMfNcWmHPby.mjs} +6 -6
- package/browser/esm/{B7aUIvgUjncMMD_i.mjs → 9WXf_BTKjW1cQisZ.mjs} +95 -94
- package/browser/esm/{PcHFjNzQsE54POri.mjs → B2SgIPPBX0wjzuq8.mjs} +1 -1
- package/browser/esm/{DEiPS3Dr-s4fPbVZ.mjs → BC2RwlNwCdRywkoD.mjs} +1 -1
- package/browser/esm/{BpgskG1Er_lGQ_yS.mjs → BEqhm9xAUPiHUCFv.mjs} +1 -1
- package/browser/esm/BHgqi7KNrl7Vjr0W.mjs +348 -0
- package/browser/esm/{BkBhLS0l6z8sxI6D.mjs → BJKH0tDRx2FeSWvt.mjs} +2 -2
- package/browser/esm/{CU3DmJ-YnVVrC1_k.mjs → BTgWtqdQoh2cB6DL.mjs} +1 -1
- package/browser/esm/{Dyq_ivuHvlXLwPCl.mjs → BVshV1iY3bcUH9_E.mjs} +1135 -1129
- package/browser/esm/{BFagR2JeWs74iAG3.mjs → BYQ63XU7JzB4_itX.mjs} +1 -1
- package/browser/esm/{DvAaxH6z_tGvrRzl.mjs → Bax5aOzQkbHKXW_X.mjs} +239 -230
- package/browser/esm/{DLLE0FZNsKxbBzRn.mjs → BiDGKhtzV6yIy66o.mjs} +45 -45
- package/browser/esm/BmYrWK5OmHRtgyqM.mjs +367 -0
- package/browser/esm/{ClPfI4lODvCece29.mjs → BoAlHgjPQ6mxb_oO.mjs} +74 -74
- package/browser/esm/{BoV6zPBnfqCBCqZ7.mjs → C0mjTq8lhrX3HiPa.mjs} +4328 -3166
- package/browser/esm/{nvU0ClAbf0g94YBK.mjs → C5j0IdwtYkWlOftv.mjs} +604 -596
- package/browser/esm/{DWNzqw7DUKwoxjri.mjs → CL84-iL2QeKlLzo5.mjs} +2 -2
- package/browser/esm/{Ctjb0SsxV4K4MMqG.mjs → CLkBe-6n-pStQhnz.mjs} +2 -2
- package/{node/esm/CZICGK_ss0HoGHCP.mjs → browser/esm/CPzfhTPX2Y4dHX2p.mjs} +2 -2
- package/browser/esm/{Dlmig06rIo7cInRk.mjs → CSJuIjYUOE387FIP.mjs} +1 -1
- package/browser/esm/{BjkCiv5Jz6WYKZeu.mjs → Cdw0mGuoV3IU2LhR.mjs} +2 -2
- package/browser/esm/Ced5uyofOWHuL_Jy.mjs +114 -0
- package/browser/esm/{CkxWugaJFjDGZNZ-.mjs → Ci_LJ4S_GvYX0STI.mjs} +1 -1
- package/browser/esm/{zlLuW405RSguy4Kn.mjs → CwygVKP_RXmne5Ot.mjs} +47 -47
- package/browser/esm/{C4MqfLn9Dm-l3OIk.mjs → D-mfK0noQrM2jZLT.mjs} +1 -1
- package/browser/esm/{BnG31I6Oj_HEtSPS.mjs → D9SH_8v3FYCnxOFK.mjs} +1 -1
- package/browser/esm/{BVDiOXGMc5_FMGfy.mjs → DPD8fop6az9HZNiK.mjs} +2 -2
- package/browser/esm/DW-MmlgMH87l-_cw.mjs +302 -0
- package/browser/esm/{CaB7J-xgfKO2uAkG.mjs → DctIlUsO78-OU2ht.mjs} +2 -2
- package/browser/esm/DdcKkVb4jM6Y_epY.mjs +184 -0
- package/browser/esm/{CHU6iu_WGlm7fLET.mjs → DfKzE0IY0TjaEIxG.mjs} +1 -1
- package/browser/esm/{C2VbEI_XVAoseAwa.mjs → DkloMquaR1pbZCER.mjs} +44 -43
- package/browser/esm/{C16ycKja6zG0crV_.mjs → Dz86-De57bv2VYIi.mjs} +19447 -16481
- package/browser/esm/{BtvLTTfSBdAKplVG.mjs → HApSgmV2FXRRwQac.mjs} +1 -1
- package/browser/esm/{CQYjO777cmAznUzK.mjs → IbVAQU4YqtFqLwYk.mjs} +1 -1
- package/browser/esm/index.mjs +823 -644
- package/browser/esm/mHQ95RAfxHzcUN2r.mjs +18 -0
- package/browser/esm/pm00uZZu_H3gxHFx.mjs +117 -0
- package/browser/esm/{CV5EGEjG5_-CPpP0.mjs → quEvwgrEuOb0h3q-.mjs} +1926 -1298
- package/browser/esm/{ClbvFbFzFzXLBKNN.mjs → zZngLMg6mg6nnNGX.mjs} +66 -66
- package/licenses/dependencies.txt +71 -1
- package/node/esm/{BqiexuA89caYnAPz.mjs → -K4Cek-bTUItkB_8.mjs} +1 -1
- package/node/esm/-b8yNV4v9qiq8EMY.mjs +117 -0
- package/node/esm/{D8zEN-6ZdDqDvTxM.mjs → 1V-m67YHbxmg3xk2.mjs} +74 -74
- package/node/esm/{D_t5AUxSm7_icjzq.mjs → 4ROAfJC1mokmqubv.mjs} +1 -1
- package/node/esm/B89et7t3uRmtxk4v.mjs +115 -0
- package/node/esm/BKBkCBNGhMU0nQdY.mjs +372 -0
- package/node/esm/{OVfaSb506tNSIvbv.mjs → BQ2XqExomMceAjfe.mjs} +20822 -18373
- package/node/esm/{2Kihw_-5lVTEnwMa.mjs → Bfg7qjCXCwXbzW3K.mjs} +1 -1
- package/node/esm/{D1TKBVmoKGAXf37B.mjs → BtMeAB_dqJnOfzJM.mjs} +2 -2
- package/node/esm/{D6e2z7eZpxOJXHc7.mjs → Byc_bxU_MdjYtt0x.mjs} +1 -1
- package/node/esm/{CNCNJNg890KdgkWh.mjs → Bzrl292TNCK3Cpid.mjs} +1 -1
- package/node/esm/{De2IONBxQhz-Qbyh.mjs → C0P9zspoypRAj7yv.mjs} +1 -1
- package/node/esm/{CzXT00vrQa1_gvW9.mjs → C9gpMN3galHGZyoK.mjs} +1 -1
- package/node/esm/CKCG2peOkTq0gIIW.mjs +310 -0
- package/node/esm/{DUTskXCXref-IJnI.mjs → CWBS90g3Hz-kQDkY.mjs} +46 -46
- package/node/esm/{BIwObuhTJYf0jpUa.mjs → CoGSVnn-hNMtTEus.mjs} +2 -2
- package/node/esm/{CwePQwTILHHjGDkZ.mjs → CzrLqStvrcPE2-hb.mjs} +194 -185
- package/node/esm/{CCN5vD410obwdz38.mjs → D16EdlZG1hX5WUUK.mjs} +96 -95
- package/node/esm/{CDHdgJXH2vS71WMc.mjs → D1mDga2K5sjs8y07.mjs} +1 -1
- package/node/esm/{cGwrLA1RCE-WhJ7w.mjs → D2jtztjE6c23RKvZ.mjs} +1 -1
- package/node/esm/{Bbf1Pm9Gk7YpLTvg.mjs → D9nRcWsYk3M82iD8.mjs} +1 -1
- package/node/esm/{yavzZOiZW_EjG9lE.mjs → DALYzTxZ9Ur9C69Q.mjs} +1 -1
- package/node/esm/{DkwIPzKc3UwdUIfM.mjs → DF0nL7s01dp7n0Bx.mjs} +10 -10
- package/node/esm/{DNRhGK-8Tr9xcRyc.mjs → DO5ldLqhTvIfPXLW.mjs} +3348 -2610
- package/node/esm/DQz8J8ci7EJdqbuB.mjs +351 -0
- package/node/esm/{BIRq1kT7lLRzns9t.mjs → DR2OQTKqqyIkZnse.mjs} +2 -2
- package/node/esm/{857CIBgQgGpnqrXk.mjs → DSTLPBgpsGW6qP9e.mjs} +73 -73
- package/node/esm/{CGp6VZL-gZa9Uezx.mjs → DiXp7KSOZUSWXaZ5.mjs} +1 -1
- package/node/esm/{CZiqiay42tFTrLI4.mjs → DwvXHsycOQR219c7.mjs} +1 -1
- package/node/esm/{B21JjOLghRoDOrkx.mjs → Hc6B04OyVzHx2F5I.mjs} +38 -37
- package/node/esm/{Ct3h15sCus4Tgt6M.mjs → NkPNHsq2T3DXg76x.mjs} +561 -553
- package/node/esm/{B084DssTcdBheTp_.mjs → Nl_IIkO1jbk0s9i-.mjs} +4552 -3373
- package/node/esm/{D2KBymQJd1XhpeQD.mjs → OQT5lGqq8a4r5xNa.mjs} +1 -1
- package/node/esm/OTaaFGhF-k_iwobp.mjs +18 -0
- package/node/esm/{CdJHUJSBRHZoryPe.mjs → Z1elC_roIu7LhceZ.mjs} +53 -53
- package/{browser/esm/D5np__Jb1euAyaLw.mjs → node/esm/e3F3OVXCxLJrSukW.mjs} +2 -2
- package/node/esm/index.mjs +806 -625
- package/node/esm/{mFiBSM7XgBHV9AY7.mjs → suOBVUz-pca6ilJH.mjs} +1607 -1601
- package/package.json +8 -6
- package/resources/contents.json +108 -0
- package/resources/fonts/aptos-bold-italic.hinted.json +125 -0
- package/resources/fonts/aptos-bold-italic.metrics.json +221 -0
- package/resources/fonts/aptos-bold-italic.rows.json +8 -0
- package/resources/fonts/aptos-bold.hinted.json +125 -0
- package/resources/fonts/aptos-bold.metrics.json +221 -0
- package/resources/fonts/aptos-bold.rows.json +8 -0
- package/resources/fonts/aptos-display-bold-italic.hinted.json +125 -0
- package/resources/fonts/aptos-display-bold-italic.metrics.json +221 -0
- package/resources/fonts/aptos-display-bold-italic.rows.json +8 -0
- package/resources/fonts/aptos-display-bold.hinted.json +125 -0
- package/resources/fonts/aptos-display-bold.metrics.json +221 -0
- package/resources/fonts/aptos-display-bold.rows.json +8 -0
- package/resources/fonts/aptos-display-italic.hinted.json +124 -0
- package/resources/fonts/aptos-display-italic.metrics.json +221 -0
- package/resources/fonts/aptos-display-italic.rows.json +8 -0
- package/resources/fonts/aptos-display-regular.hinted.json +125 -0
- package/resources/fonts/aptos-display-regular.metrics.json +221 -0
- package/resources/fonts/aptos-display-regular.rows.json +8 -0
- package/resources/fonts/aptos-italic.hinted.json +125 -0
- package/resources/fonts/aptos-italic.metrics.json +221 -0
- package/resources/fonts/aptos-italic.rows.json +8 -0
- package/resources/fonts/aptos-narrow-bold-italic.hinted.json +125 -0
- package/resources/fonts/aptos-narrow-bold-italic.metrics.json +221 -0
- package/resources/fonts/aptos-narrow-bold-italic.rows.json +8 -0
- package/resources/fonts/aptos-narrow-bold.hinted.json +125 -0
- package/resources/fonts/aptos-narrow-bold.metrics.json +221 -0
- package/resources/fonts/aptos-narrow-bold.rows.json +8 -0
- package/resources/fonts/aptos-narrow-italic.hinted.json +125 -0
- package/resources/fonts/aptos-narrow-italic.metrics.json +221 -0
- package/resources/fonts/aptos-narrow-italic.rows.json +8 -0
- package/resources/fonts/aptos-narrow-regular.hinted.json +125 -0
- package/resources/fonts/aptos-narrow-regular.metrics.json +221 -0
- package/resources/fonts/aptos-narrow-regular.rows.json +8 -0
- package/resources/fonts/aptos-regular.hinted.json +125 -0
- package/resources/fonts/aptos-regular.metrics.json +221 -0
- package/resources/fonts/aptos-regular.rows.json +8 -0
- package/resources/fonts/arial-bold-italic.rows.json +0 -1
- package/resources/fonts/arial-bold.rows.json +0 -1
- package/resources/fonts/arial-italic.rows.json +0 -1
- package/resources/fonts/arial-regular.rows.json +0 -1
- package/resources/fonts/calibri-bold-italic.rows.json +0 -1
- package/resources/fonts/calibri-bold.rows.json +0 -1
- package/resources/fonts/calibri-italic.rows.json +0 -1
- package/resources/fonts/calibri-regular.rows.json +0 -1
- package/resources/fonts/cambria-bold-italic.rows.json +0 -1
- package/resources/fonts/cambria-bold.rows.json +0 -1
- package/resources/fonts/cambria-italic.rows.json +0 -1
- package/resources/fonts/cambria-regular.rows.json +0 -1
- package/resources/fonts/contents.json +240 -0
- package/resources/fonts/courier-new-bold-italic.rows.json +0 -1
- package/resources/fonts/courier-new-bold.rows.json +0 -1
- package/resources/fonts/courier-new-italic.rows.json +0 -1
- package/resources/fonts/courier-new-regular.rows.json +0 -1
- package/resources/fonts/times-new-roman-bold-italic.rows.json +0 -1
- package/resources/fonts/times-new-roman-bold.rows.json +0 -1
- package/resources/fonts/times-new-roman-italic.rows.json +0 -1
- package/resources/fonts/times-new-roman-regular.rows.json +0 -1
- package/resources/locales/de/model.msg.json +12 -2
- package/resources/locales/en/model.msg.json +13 -2
- package/types/scripting-api.json +10638 -10446
- package/types/scripting-enums.json +20 -1
- package/types/scripting.d.ts +1536 -477
- package/types/src/.generated/wasm/sdk.d.ts +5 -27
- package/types/src/address/AddressUtils.d.ts +8 -0
- package/types/src/address/_SheetNameQuoteChars.d.ts +3 -0
- package/types/src/{sheet → anomalies}/_Anomalies.d.ts +3 -3
- package/types/src/anomalies/_FocusTable.d.ts +5 -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 +61 -98
- package/types/src/calculation/ExternalBookBindings.d.ts +2 -29
- package/types/src/calculation/ICalculation.d.ts +96 -9
- package/types/src/calculation/NamedFormulaCollection.d.ts +110 -10
- package/types/src/calculation/TokenType.d.ts +0 -10
- package/types/src/calculation/_CloneBoundary.d.ts +0 -24
- package/types/src/calculation/_FormulaToolkit.d.ts +0 -5
- package/types/src/calculation/compiler/ASTTypes.d.ts +6 -15
- package/types/src/calculation/compiler/CompilerUtils.d.ts +0 -227
- package/types/src/calculation/compiler/FormulaLexer.d.ts +0 -8
- package/types/src/calculation/compiler/FormulaParser.d.ts +0 -61
- package/types/src/calculation/compiler/ParserUtils.d.ts +0 -24
- package/types/src/calculation/compiler/Types.d.ts +1 -45
- package/types/src/calculation/engine/CalcBackend.d.ts +83 -127
- package/types/src/calculation/engine/index.d.ts +0 -8
- package/types/src/calculation/executor/CalcExecutor.d.ts +50 -116
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +47 -12
- package/types/src/calculation/executor/CircularReference.d.ts +0 -17
- package/types/src/calculation/executor/_BlockOrder.d.ts +29 -0
- package/types/src/calculation/executor/_WhatIf.d.ts +31 -0
- package/types/src/calculation/formula/FormulaBlock.d.ts +4 -31
- package/types/src/calculation/formula/FormulaRecordView.d.ts +0 -15
- package/types/src/calculation/formula/IFormulaBlock.d.ts +5 -12
- package/types/src/calculation/formula/LambdaValue.d.ts +0 -15
- package/types/src/calculation/formula/TokenUtils.d.ts +1 -8
- package/types/src/calculation/functions/_DataTableFunction.d.ts +14 -0
- package/types/src/calculation/grid/CalcGrid.d.ts +8 -64
- package/types/src/calculation/grid/CalcGridBackend.d.ts +12 -35
- package/types/src/calculation/grid/CalcGridProxy.d.ts +0 -15
- package/types/src/calculation/grid/CalcGridUtils.d.ts +21 -23
- package/types/src/calculation/grid/ICalcGrid.d.ts +28 -109
- package/types/src/calculation/grid/_CalcRequest.d.ts +17 -33
- package/types/src/calculation/spatial/CircularEntry.d.ts +0 -10
- package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +54 -82
- package/types/src/calculation/spatial/SpillEntry.d.ts +20 -3
- package/types/src/calculation/state/CalcNode.d.ts +0 -1
- package/types/src/calculation/state/CalcScope.d.ts +29 -9
- package/types/src/calculation/state/CalcState.d.ts +19 -9
- package/types/src/calculation/state/CalculationContext.d.ts +32 -38
- package/types/src/calculation/state/DeferredCalls.d.ts +207 -0
- package/types/src/calculation/state/IContextContainer.d.ts +19 -55
- package/types/src/calculation/state/_KeepBlanks.d.ts +5 -0
- package/types/src/calculation/state/_PendingOverlayGrid.d.ts +52 -33
- package/types/src/calculation/state/_WhatIfLayer.d.ts +77 -0
- package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +0 -42
- package/types/src/calculation/symbol/ISymbolRegistry.d.ts +0 -6
- package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +0 -12
- package/types/src/calculation/symbol/SymbolRegistry.d.ts +0 -9
- package/types/src/calculation/toolkit/index.d.ts +0 -8
- package/types/src/cell/ICell.d.ts +59 -54
- 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 +226 -67
- package/types/src/cellRange/ICellRanges.d.ts +4 -3
- package/types/src/chart/Chart.d.ts +0 -16
- package/types/src/chart/_ChartParts.d.ts +0 -39
- package/types/src/chart/_ChartSource.d.ts +0 -14
- package/types/src/chart/createChart.d.ts +1 -1
- package/types/src/chart/kinds/ChartKind.d.ts +4 -4
- package/types/src/chart/kinds/_Placeholder.d.ts +0 -1
- package/types/src/chart/layout/ChartLayout.d.ts +5 -1
- package/types/src/chart/layout/TextMeasurer.d.ts +0 -20
- package/types/src/chart/layout/_LayoutUtils.d.ts +0 -16
- package/types/src/chart/math/BoxStats.d.ts +0 -8
- package/types/src/chart/math/DateUnitCalcs.d.ts +0 -10
- package/types/src/chart/math/Histogram.d.ts +0 -17
- package/types/src/chart/math/OrdUnitCalcs.d.ts +0 -53
- package/types/src/chart/math/Treemap.d.ts +0 -15
- package/types/src/chart/math/Trendlines.d.ts +0 -8
- package/types/src/chart/math/UnitCalcs.d.ts +0 -22
- package/types/src/chart/model/_Edits.d.ts +0 -33
- package/types/src/chart/model/_Grouping.d.ts +0 -25
- package/types/src/chart/model/_Inference.d.ts +0 -18
- package/types/src/chart/model/_NewChart.d.ts +0 -41
- package/types/src/chart/model/_OfPie.d.ts +0 -7
- package/types/src/chart/resolve/_LegacyStyles.d.ts +0 -20
- package/types/src/chart/resolve/_Resolve.d.ts +3 -12
- package/types/src/chart/resolve/_ResolvedChart.d.ts +5 -8
- 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/collections/_GridUtils.d.ts +0 -10
- package/types/src/comment/_NoteBox.d.ts +0 -15
- package/types/src/condition/AnchoredConditional.d.ts +3 -25
- package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +0 -49
- package/types/src/condition/BuiltinSelectors/DisplaySelector.d.ts +0 -10
- package/types/src/condition/ICondition.d.ts +2 -2
- package/types/src/condition/_ConditionUtils.d.ts +0 -38
- package/types/src/externalBook/ExternalBookCollection.d.ts +0 -15
- package/types/src/externalBook/ExternalBookName.d.ts +2 -3
- package/types/src/externalBook/IExternalBook.d.ts +16 -18
- package/types/src/fetch/Fetcher.d.ts +15 -0
- package/types/src/fetch/IFetcher.d.ts +48 -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/font/AdvanceTable.d.ts +16 -42
- package/types/src/font/IFont.d.ts +32 -9
- package/types/src/font/TableFileAdvanceBuilder.d.ts +6 -3
- package/types/src/font/_FontUtils.d.ts +0 -8
- package/types/src/font/_StandIns.d.ts +33 -0
- 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/io/IWorkbookIO.d.ts +3 -3
- package/types/src/io/WorkbookOrigin.d.ts +2 -2
- package/types/src/license/LicenseManager.d.ts +2 -1
- package/types/src/license/_Utils.d.ts +4 -3
- package/types/src/license/details.d.ts +3 -1
- package/types/src/license/keys.d.ts +6 -0
- package/types/src/license/license-key.d.ts +15 -33
- package/types/src/license/token.d.ts +55 -0
- package/types/src/named/INamedCollection.d.ts +36 -0
- package/types/src/named/NamedCollection.d.ts +18 -0
- package/types/src/picture/IPicture.d.ts +45 -0
- package/types/src/picture/Picture.d.ts +12 -0
- package/types/src/pivot/PivotTable.d.ts +0 -7
- package/types/src/primitives/AsyncValue.d.ts +46 -0
- package/types/src/primitives/PrimitiveUtils.d.ts +1 -110
- package/types/src/primitives/Range.d.ts +0 -60
- package/types/src/primitives/ScalarCollation.d.ts +0 -106
- package/types/src/primitives/stats/AggregateStats.d.ts +0 -19
- package/types/src/print/PageLayout.d.ts +0 -6
- package/types/src/reference/ReferenceUtils.d.ts +4 -2
- 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 +52 -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 -109
- package/types/src/sheet/ICellContainerOptions.d.ts +6 -0
- package/types/src/sheet/IWorksheet.d.ts +26 -22
- package/types/src/sheet/NamedCellRange.d.ts +0 -21
- package/types/src/sheet/SheetCell.d.ts +25 -3
- 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 +117 -104
- package/types/src/sheet/_DelimitedText.d.ts +13 -0
- package/types/src/sheet/_IgnoredErrors.d.ts +0 -12
- package/types/src/sheet/_ListenerAnchor.d.ts +7 -1
- package/types/src/sheet/_ScalarListFactory.d.ts +46 -17
- package/types/src/sheet/_SheetCoords.d.ts +0 -7
- package/types/src/sheet/_SheetFilterUtils.d.ts +0 -8
- package/types/src/sheet/_SheetMutations.d.ts +4 -1
- package/types/src/sheet/_SheetStateReader.d.ts +0 -10
- package/types/src/sheet/_SheetStateTypes.d.ts +23 -14
- package/types/src/sheet/_SheetUtils.d.ts +1 -1
- package/types/src/sheet/style/_RowLine.d.ts +32 -0
- package/types/src/sheet/style/_StyleUtils.d.ts +6 -14
- package/types/src/sheetView/_SheetViewUtils.d.ts +0 -1
- package/types/src/slicer/_BuiltInSlicerStyles.d.ts +0 -5
- package/types/src/style/ICellStyle.d.ts +4 -0
- package/types/src/table/AnchoredTable.d.ts +0 -147
- package/types/src/text/TextFrame.d.ts +4 -1
- package/types/src/text/TextStacked.d.ts +0 -24
- package/types/src/text/TextWrapper.d.ts +3 -5
- package/types/src/text/_LineBox.d.ts +24 -0
- package/types/src/text/_TextUtils.d.ts +5 -2
- package/types/src/text/_TextWrapperFallback.d.ts +2 -1
- package/types/src/wasm/sdkWasm.d.ts +1 -1
- package/types/src/workbook/IWorkbook.d.ts +40 -1
- package/types/src/workbook/Workbook.d.ts +25 -13
- package/types/src/workbook/WorkbookRanges.d.ts +1 -1
- package/browser/esm/BGOFfpxr2jPIdqmV.mjs +0 -40
- package/browser/esm/BLoUBId2xZpXAK_H.mjs +0 -698
- package/browser/esm/C5E6zSGAALWf61n4.mjs +0 -199
- package/browser/esm/S2dNNx1a5ydRnARM.mjs +0 -367
- package/browser/esm/f1IoRb7tEb0QmCSt.mjs +0 -110
- package/browser/esm/gssVX_FH1XFN-twD.mjs +0 -210
- package/node/esm/BrCKGFRsX_ezFJ4B.mjs +0 -811
- package/node/esm/DOU54VsOjG-m-NyQ.mjs +0 -210
- package/node/esm/Db0v7zXNnyjBIjjI.mjs +0 -372
- 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
|
@@ -1,16 +1,16 @@
|
|
|
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.13
|
|
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 {
|
|
8
|
-
import {
|
|
9
|
-
import { FormulaError as
|
|
7
|
+
import { Bn as e, Ct as t, In as n, Li as r, Rn as i, Sn as l, St as s, Zn as o, _ as a, _i as u, br as c, bt as f, cr as p, dr as d, dt as g, er as v, f as h, fi as m, gr as y, h as I, hr as b, jt as x, lr as R, n as E, oi as T, p as A, s as S, u as w, xr as C, yr as N, zn as F } from "./BQ2XqExomMceAjfe.mjs";
|
|
8
|
+
import { nn as P } from "./DO5ldLqhTvIfPXLW.mjs";
|
|
9
|
+
import { FormulaError as L, Scalar as k, ScalarType as $, ValueKind as O, isLazyValue as B } from "@sheetxl/primitives";
|
|
10
10
|
import { CommonUtils as V } from "@sheetxl/utils";
|
|
11
|
-
var z = (e, t) => e + t, D = (e, t) => e - t,
|
|
11
|
+
var z = (e, t) => e + t, D = (e, t) => e - t, M = (e, t) => g(e + t, e), W = (e, t) => g(e - t, e), U = (e, t) => h(e * t), _ = (e, t) => 0 === t ? L.BuiltIn.Div0 : h(e / t), j = (e, t) => {
|
|
12
12
|
if (0 === e) {
|
|
13
|
-
if (t < 0) return
|
|
13
|
+
if (t < 0) return L.BuiltIn.Div0;
|
|
14
14
|
if (0 === t) return NaN;
|
|
15
15
|
}
|
|
16
16
|
if (e < 0) {
|
|
@@ -22,112 +22,112 @@ var z = (e, t) => e + t, D = (e, t) => e - t, W = (e, t) => u(e + t, e), M = (e,
|
|
|
22
22
|
}, G = (e = "", t = "") => {
|
|
23
23
|
null === e && (e = ""), null === t && (t = "");
|
|
24
24
|
const n = typeof t;
|
|
25
|
-
"boolean" === typeof e && (e =
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
}, H = (e, t = null, n = null) => 0 === e.compare(t, n), X = (e, t = null, n = null) => 0 !== e.compare(t, n), Z = (e, t = null, n = null) => e.compare(t, n) > 0, K = (e, t = null, n = null) => e.compare(t, n) >= 0,
|
|
25
|
+
"boolean" === typeof e && (e = r(e)), "boolean" === n && (t = r(t));
|
|
26
|
+
const i = "" + e + t;
|
|
27
|
+
return i.length > k.MAX_TEXT_LENGTH ? i.slice(0, k.MAX_TEXT_LENGTH) : i;
|
|
28
|
+
}, H = (e, t = null, n = null) => 0 === e.compare(t, n), X = (e, t = null, n = null) => 0 !== e.compare(t, n), Z = (e, t = null, n = null) => e.compare(t, n) > 0, K = (e, t = null, n = null) => e.compare(t, n) >= 0, q = (e, t = null, n = null) => e.compare(t, n) < 0, J = (e, t = null, n = null) => e.compare(t, n) <= 0, Q = {
|
|
29
29
|
type: $.Number,
|
|
30
30
|
coerce: [$.Boolean, $.String],
|
|
31
31
|
onError: "value",
|
|
32
|
-
misalignValue:
|
|
32
|
+
misalignValue: L.BuiltIn.NA
|
|
33
33
|
}, Y = {
|
|
34
34
|
type: $.String,
|
|
35
35
|
coerce: [$.Boolean, $.Number],
|
|
36
36
|
onError: "value",
|
|
37
|
-
misalignValue:
|
|
37
|
+
misalignValue: L.BuiltIn.NA
|
|
38
38
|
}, ee = {
|
|
39
39
|
onError: "value",
|
|
40
|
-
misalignValue:
|
|
40
|
+
misalignValue: L.BuiltIn.NA
|
|
41
41
|
}, te = (e) => null !== e && "object" == typeof e && !0 === e.isIReferenceRange && 1 === e.size ? e.getValueAt(0, 0) ?? null : e, ne = (e, t, n, r) => {
|
|
42
|
-
if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) &&
|
|
43
|
-
if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) &&
|
|
42
|
+
if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) && L.isError(t)) return t;
|
|
43
|
+
if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && L.isError(n)) return n;
|
|
44
44
|
if (t = te(t), n = te(n), "number" == typeof t && "number" == typeof n) return r(t, n);
|
|
45
45
|
let i, l;
|
|
46
46
|
if (t?.isIRange ? i = t : n?.isIRange && (l = n), !i && !l) {
|
|
47
47
|
const i = e.getRuntime();
|
|
48
|
-
return t =
|
|
48
|
+
return t = S(i, t, a(t, !0), $.Number, !0), n = S(i, n, a(n, !0), $.Number, !0), t && L.isError(t) ? t : n && L.isError(n) ? n : r(t, n);
|
|
49
49
|
}
|
|
50
50
|
const s = !i, o = s ? t : n;
|
|
51
|
-
return (i ?? l).broadcast(o, (t, n) => t &&
|
|
51
|
+
return (i ?? l).broadcast(o, (t, n) => t && L.isError(t) ? t : n && L.isError(n) ? n : I(s ? r(n, t) : r(t, n), e), Q).fillEmpty(0);
|
|
52
52
|
}, re = (e, t, n, r) => {
|
|
53
|
-
if (
|
|
54
|
-
if (B(t) || B(n)) return
|
|
55
|
-
if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) &&
|
|
56
|
-
if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) &&
|
|
57
|
-
let i,
|
|
53
|
+
if (l(t) || l(n)) return L.BuiltIn.Value;
|
|
54
|
+
if (B(t) || B(n)) return L.BuiltIn.Value;
|
|
55
|
+
if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) && L.isError(t)) return t;
|
|
56
|
+
if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && L.isError(n)) return n;
|
|
57
|
+
let i, s;
|
|
58
58
|
t = te(t), n = te(n);
|
|
59
|
-
let
|
|
60
|
-
return t?.isIRange ? (i = t,
|
|
59
|
+
let o = !1;
|
|
60
|
+
return t?.isIRange ? (i = t, s = n) : n?.isIRange && (i = n, s = t, o = !0), i ? i.broadcast(s, (t, n) => t && L.isError(t) ? t : n && L.isError(n) ? n : (t = ie(t), n = ie(n), o ? r(e, n, t) : r(e, t, n)), ee) : L.isError(t) ? t : L.isError(n) ? n : r(e, ie(t), ie(n));
|
|
61
61
|
}, ie = (e) => {
|
|
62
62
|
if (!0 !== e?.isIRichData) return e;
|
|
63
63
|
const t = e.toPrimitive?.();
|
|
64
64
|
return null == t ? e : t;
|
|
65
65
|
}, le = (e, t, n) => {
|
|
66
|
-
if (null == n && (n = 0), null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) &&
|
|
66
|
+
if (null == n && (n = 0), null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && L.isError(n)) return n;
|
|
67
67
|
n = te(n);
|
|
68
68
|
let r, i = 1;
|
|
69
69
|
if ("+" === t) return n;
|
|
70
|
-
if ("-" !== t) throw new
|
|
70
|
+
if ("-" !== t) throw new L.Value(`Unrecognized prefix: ${t}`);
|
|
71
71
|
if (i = -i, n?.isIRange && (r = n), !r) {
|
|
72
72
|
const t = e.getRuntime();
|
|
73
|
-
return "number" != typeof (n =
|
|
73
|
+
return "number" != typeof (n = S(t, n, a(n, !0), $.Number, !0)) ? L.BuiltIn.Value : n * i;
|
|
74
74
|
}
|
|
75
|
-
return r.broadcast(i, (e, t) => e &&
|
|
76
|
-
}, se = (e) => e.getCode() <=
|
|
77
|
-
if (
|
|
78
|
-
if (n &&
|
|
79
|
-
if (!t) return
|
|
80
|
-
if (t.isIReferenceRange && n && !n.isIReferenceRange ? n = e.getReference(n) : n && n.isIReferenceRange && t && !t.isIReferenceRange && (t = e.getReference(t)), t.isIReferenceRange && (t = t.getCoords()), void 0 === t.colStart) return
|
|
81
|
-
if (n.isIReferenceRange && (n = n.getCoords()), void 0 === n.colStart) return
|
|
75
|
+
return r.broadcast(i, (e, t) => e && L.isError(e) ? e : t && L.isError(t) ? t : U(e, t), Q);
|
|
76
|
+
}, se = (e) => e.getCode() <= L.Code.NA ? e : L.BuiltIn.Value, oe = (e, t, n, r, i) => {
|
|
77
|
+
if (L.isError(t)) return se(t);
|
|
78
|
+
if (n && L.isError(n)) return se(n);
|
|
79
|
+
if (!t) return L.BuiltIn.Ref;
|
|
80
|
+
if (t.isIReferenceRange && n && !n.isIReferenceRange ? n = e.getReference(n) : n && n.isIReferenceRange && t && !t.isIReferenceRange && (t = e.getReference(t)), t.isIReferenceRange && (t = t.getCoords()), void 0 === t.colStart) return L.BuiltIn.Value;
|
|
81
|
+
if (n.isIReferenceRange && (n = n.getCoords()), void 0 === n.colStart) return L.BuiltIn.Value;
|
|
82
82
|
const l = t.scope ? "either" !== i || n.scope ? null : t : n;
|
|
83
83
|
if (l?.scope) {
|
|
84
84
|
const t = e.getReference(l);
|
|
85
|
-
if (
|
|
86
|
-
if (e.getSheetIndex() !== e.getSheetIndex(t)) return
|
|
85
|
+
if (L.isError(t)) return t;
|
|
86
|
+
if (e.getSheetIndex() !== e.getSheetIndex(t)) return L.BuiltIn.Value;
|
|
87
87
|
}
|
|
88
88
|
const s = r(t, n);
|
|
89
|
-
return
|
|
89
|
+
return L.isError(s) ? s : s ? e.getReference(s) : L.BuiltIn.Null;
|
|
90
90
|
}, ae = {
|
|
91
91
|
"+": (e, t, n) => ne(e, t, n, z),
|
|
92
92
|
"-": (e, t, n) => ne(e, t, n, D),
|
|
93
93
|
"*": (e, t, n) => ne(e, t, n, U),
|
|
94
94
|
"/": (e, t, n) => ne(e, t, n, _),
|
|
95
95
|
"^": (e, t, n) => ne(e, t, n, j),
|
|
96
|
-
" ": (e, t, n,
|
|
97
|
-
":": (e, t, n, r) => oe(e, t, n,
|
|
96
|
+
" ": (e, t, n, r) => oe(e, t, n, T, "either"),
|
|
97
|
+
":": (e, t, n, r) => oe(e, t, n, u, "start"),
|
|
98
98
|
".:.": (e, t, n, r) => {
|
|
99
|
-
const i = oe(e, t, n,
|
|
99
|
+
const i = oe(e, t, n, u, "start");
|
|
100
100
|
return e.getFunction("TRIMRANGE").execute(i, 3, 3);
|
|
101
101
|
},
|
|
102
102
|
".:": (e, t, n, r) => {
|
|
103
|
-
const i = oe(e, t, n,
|
|
103
|
+
const i = oe(e, t, n, u, "start");
|
|
104
104
|
return e.getFunction("TRIMRANGE").execute(i, 1, 1);
|
|
105
105
|
},
|
|
106
106
|
":.": (e, t, n, r) => {
|
|
107
|
-
const i = oe(e, t, n,
|
|
107
|
+
const i = oe(e, t, n, u, "start");
|
|
108
108
|
return e.getFunction("TRIMRANGE").execute(i, 2, 2);
|
|
109
109
|
},
|
|
110
110
|
"&": (e, t, n) => ((e, t, n, r) => {
|
|
111
|
-
if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) &&
|
|
112
|
-
if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) &&
|
|
111
|
+
if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) && L.isError(t)) return t;
|
|
112
|
+
if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && L.isError(n)) return n;
|
|
113
113
|
if (t = te(t), n = te(n), "string" == typeof t && "string" == typeof n) return r(t, n);
|
|
114
114
|
let i, l;
|
|
115
115
|
if (t?.isIRange ? i = t : n?.isIRange && (l = n), !i && !l) {
|
|
116
116
|
const i = e.getRuntime();
|
|
117
|
-
return t =
|
|
117
|
+
return t = S(i, t, a(t, !0), $.String, !1), n = S(i, n, a(n, !0), $.String, !1), L.isError(t) ? t : L.isError(n) ? n : r(t, n);
|
|
118
118
|
}
|
|
119
119
|
const s = !i, o = s ? t : n;
|
|
120
|
-
return (i ?? l).broadcast(o, (e, t) => e &&
|
|
120
|
+
return (i ?? l).broadcast(o, (e, t) => e && L.isError(e) ? e : t && L.isError(t) ? t : s ? r(t, e) : r(e, t), Y);
|
|
121
121
|
})(e, t, n, G),
|
|
122
122
|
"=": (e, t, n) => re(e, t, n, H),
|
|
123
123
|
"<>": (e, t, n) => re(e, t, n, X),
|
|
124
124
|
">": (e, t, n) => re(e, t, n, Z),
|
|
125
|
-
"<": (e, t, n) => re(e, t, n,
|
|
125
|
+
"<": (e, t, n) => re(e, t, n, q),
|
|
126
126
|
">=": (e, t, n) => re(e, t, n, K),
|
|
127
|
-
"<=": (e, t, n) => re(e, t, n,
|
|
127
|
+
"<=": (e, t, n) => re(e, t, n, J)
|
|
128
128
|
}, ue = {
|
|
129
|
-
"+": (e, t, n) => ne(e, t, n,
|
|
130
|
-
"-": (e, t, n) => ne(e, t, n,
|
|
129
|
+
"+": (e, t, n) => ne(e, t, n, M),
|
|
130
|
+
"-": (e, t, n) => ne(e, t, n, W)
|
|
131
131
|
}, ce = {
|
|
132
132
|
"-": (e, t) => le(e, "-", t),
|
|
133
133
|
"+": (e, t) => le(e, "+", t),
|
|
@@ -136,16 +136,16 @@ var z = (e, t) => e + t, D = (e, t) => e - t, W = (e, t) => u(e + t, e), M = (e,
|
|
|
136
136
|
const n = t;
|
|
137
137
|
if (!t.isIReferenceRange) return n.getValueAt(0, 0);
|
|
138
138
|
const r = t.getCoords(), i = n.getRowCount(), l = n.getColumnCount(), s = e.getRow() - r.rowStart, o = e.getColumn() - r.colStart, a = s >= 0 && s < i, u = o >= 0 && o < l;
|
|
139
|
-
return a && u ? n.getValueAt(s, o) : a && 1 === l ? n.getValueAt(s, 0) : u && 1 === i ? n.getValueAt(0, o) : 1 === i && 1 === l ? n.getValueAt(0, 0) :
|
|
139
|
+
return a && u ? n.getValueAt(s, o) : a && 1 === l ? n.getValueAt(s, 0) : u && 1 === i ? n.getValueAt(0, o) : 1 === i && 1 === l ? n.getValueAt(0, 0) : L.BuiltIn.Value;
|
|
140
140
|
}
|
|
141
141
|
}, fe = {
|
|
142
142
|
"%": (e, t) => ne(e, t, 100, _),
|
|
143
143
|
"#": (e, t) => {
|
|
144
|
-
if (
|
|
145
|
-
if (!t) return
|
|
146
|
-
if (t.isIReferenceRange && (t = t.getCoords()), void 0 === t.colStart) return
|
|
147
|
-
if (t.rowStart !== t.rowEnd || t.colStart !== t.colEnd) return
|
|
148
|
-
return e.getSpillAt(t.rowStart, t.colStart, t.scope) ||
|
|
144
|
+
if (L.isError(t)) return se(t);
|
|
145
|
+
if (!t) return L.BuiltIn.Ref;
|
|
146
|
+
if (t.isIReferenceRange && (t = t.getCoords()), void 0 === t.colStart) return L.BuiltIn.Value;
|
|
147
|
+
if (t.rowStart !== t.rowEnd || t.colStart !== t.colEnd) return L.BuiltIn.Ref;
|
|
148
|
+
return e.getSpillAt(t.rowStart, t.colStart, t.scope) || L.BuiltIn.Ref;
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
151
|
function pe(e, t) {
|
|
@@ -165,38 +165,38 @@ var de = class {
|
|
|
165
165
|
value: null,
|
|
166
166
|
inputs: null
|
|
167
167
|
};
|
|
168
|
-
if (this.references.set(e, t), n ===
|
|
168
|
+
if (this.references.set(e, t), n === C.Cell) {
|
|
169
169
|
const n = e.value;
|
|
170
170
|
n.$colIndex && (t.hasHorizontalAbs = !0), n.$rowIndex && (t.hasVerticalAbs = !0), t.value = this.cells.size, this.cells.set(e, this.cells.size), this.rootReferences.add(t), e.referenceIndex = this.referenceIndices.length, this.referenceIndices.push(t.index);
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
if (n ===
|
|
173
|
+
if (n === C.Infix || n === C.Prefix || n === C.Postfix || n === C.List) {
|
|
174
174
|
const n = e.inputs || [], r = n.length, i = e.value;
|
|
175
175
|
t.op = i;
|
|
176
|
-
const l =
|
|
176
|
+
const l = w(r);
|
|
177
177
|
t.inputs = l;
|
|
178
178
|
for (let e = 0; e < r; e++) {
|
|
179
179
|
const r = n[e], i = this.references.get(r);
|
|
180
180
|
i ? (i.hasHorizontalAbs && (t.hasHorizontalAbs = !0), i.hasVerticalAbs && (t.hasVerticalAbs = !0), l[e] = i.index) : l[e] = -1, i && this.rootReferences.delete(i);
|
|
181
181
|
}
|
|
182
|
-
if (this.rootReferences.add(t),
|
|
183
|
-
const r = n[0], i = !!r && r.type ===
|
|
182
|
+
if (this.rootReferences.add(t), Ze.includes(i)) {
|
|
183
|
+
const r = n[0], i = !!r && r.type === C.Cell, l = n[1], s = !!l && l.type === C.Cell;
|
|
184
184
|
i && s && void 0 !== l.referenceIndex && void 0 !== r.referenceIndex && (this.referenceIndices.splice(l.referenceIndex, 1), l.referenceIndex = r.referenceIndex, e.referenceIndex = r.referenceIndex, this.referenceIndices[r.referenceIndex] = t.index);
|
|
185
185
|
} else "#" === i && n[0] && (e.referenceIndex = n[0].referenceIndex);
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
-
if (n ===
|
|
189
|
-
const r = n ===
|
|
188
|
+
if (n === C.Error || n === C.Named) {
|
|
189
|
+
const r = n === C.Named ? e.value.nameId : p(e.value);
|
|
190
190
|
let i = this.names.get(r);
|
|
191
191
|
t.op = n, void 0 === i && (i = this.names.size, this.names.set(r, i)), t.value = i, this.rootReferences.add(t), e.referenceIndex = this.referenceIndices.length, this.referenceIndices.push(t.index);
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
|
-
if (n ===
|
|
194
|
+
if (n === C.TableReference) return t.op = n, this.rootReferences.add(t), e.referenceIndex = this.referenceIndices.length, void this.referenceIndices.push(t.index);
|
|
195
195
|
} else if (t && t.isReference) {
|
|
196
196
|
const t = {
|
|
197
197
|
node: e,
|
|
198
198
|
index: this.references.size,
|
|
199
|
-
op:
|
|
199
|
+
op: C.Function,
|
|
200
200
|
value: e.value,
|
|
201
201
|
inputs: null
|
|
202
202
|
};
|
|
@@ -204,21 +204,21 @@ var de = class {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
function ge(
|
|
208
|
-
const l = [],
|
|
209
|
-
const
|
|
210
|
-
type:
|
|
211
|
-
value:
|
|
207
|
+
function ge(e, t = !1, r = N) {
|
|
208
|
+
const l = [], s = /* @__PURE__ */ new Set(), o = (e, n, r) => {
|
|
209
|
+
const i = {
|
|
210
|
+
type: e.type,
|
|
211
|
+
value: e.type === C.Error ? R(e.value) : e.value
|
|
212
212
|
};
|
|
213
|
-
void 0 !==
|
|
214
|
-
const
|
|
215
|
-
return "string" == typeof
|
|
216
|
-
})(
|
|
217
|
-
const
|
|
218
|
-
return void 0 !==
|
|
219
|
-
},
|
|
213
|
+
void 0 !== e.image && (i.text = ((e) => {
|
|
214
|
+
const n = t ? e.value?.scopeImage : void 0;
|
|
215
|
+
return "string" == typeof n ? n : "";
|
|
216
|
+
})(e) + e.image);
|
|
217
|
+
const o = e.evalIndex ?? r;
|
|
218
|
+
return void 0 !== o && (i.evalIndex = o), n && (i.context = n), void 0 !== e.referenceIndex && (i.referenceIndex = e.referenceIndex), e.isReference && s.add(i), l.push(i), i;
|
|
219
|
+
}, a = (e, t, n, r, i) => {
|
|
220
220
|
if (null == t) return;
|
|
221
|
-
if (l.length > 1 && e ===
|
|
221
|
+
if (l.length > 1 && e === C.Whitespace && l[l.length - 1].type === C.Whitespace) return;
|
|
222
222
|
const s = {
|
|
223
223
|
type: e,
|
|
224
224
|
value: t,
|
|
@@ -226,185 +226,185 @@ function ge(t, r = !1, i = x) {
|
|
|
226
226
|
};
|
|
227
227
|
void 0 !== r && (s.evalIndex = r), n && (s.context = n), l.push(s);
|
|
228
228
|
};
|
|
229
|
-
(function e(
|
|
230
|
-
const p =
|
|
229
|
+
(function e(u, c, f) {
|
|
230
|
+
const p = u.evalIndex ?? f ?? 0, d = u.type, g = (t, n, i) => {
|
|
231
231
|
if (!t) return;
|
|
232
232
|
const l = t.length;
|
|
233
|
-
for (let s = 0; s < l; s++) e(t[s], n,
|
|
233
|
+
for (let s = 0; s < l; s++) e(t[s], n, i), s < l - 1 && a(C.Separator, ",", n, i, r.separatorFunction);
|
|
234
234
|
};
|
|
235
|
-
if (
|
|
236
|
-
if (
|
|
237
|
-
|
|
238
|
-
const
|
|
239
|
-
for (let
|
|
240
|
-
const l =
|
|
235
|
+
if (u.isLiteral) {
|
|
236
|
+
if (a(C.Whitespace, u.wsBefore, c, p), d === C.Array) {
|
|
237
|
+
a(C.Type, "{", c, p);
|
|
238
|
+
const t = u.value, n = t.length;
|
|
239
|
+
for (let i = 0; i < n; i++) {
|
|
240
|
+
const l = t[i], s = l.value, o = s.length;
|
|
241
241
|
for (let t = 0; t < o; t++) {
|
|
242
242
|
const n = s[t];
|
|
243
|
-
|
|
243
|
+
a(C.Whitespace, n.wsBefore, c, p), e(n, c, p), a(C.Whitespace, n.wsAfter, c, p), t < o - 1 && a(C.Separator, ",", c, p, r.separatorColumn);
|
|
244
244
|
}
|
|
245
|
-
|
|
245
|
+
i < n - 1 && (a(C.Whitespace, l.wsBefore, c, p), a(C.Separator, ";", c, p, r.separatorRow), a(C.Whitespace, l.wsAfter, c, p));
|
|
246
246
|
}
|
|
247
|
-
|
|
248
|
-
} else d ===
|
|
247
|
+
u.error || a(C.Type, "}", c, p);
|
|
248
|
+
} else d === C.String ? (u = {
|
|
249
249
|
type: d,
|
|
250
|
-
value: "\"" + `${
|
|
251
|
-
image:
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
} else if (d ===
|
|
255
|
-
else if (d ===
|
|
256
|
-
else if (d ===
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
"#" ===
|
|
250
|
+
value: "\"" + `${u.value}`.replace(/"/g, "\"\"") + "\"",
|
|
251
|
+
image: u.image
|
|
252
|
+
}, o(u, c, p)) : o(u, c, p);
|
|
253
|
+
a(C.Whitespace, u.wsAfter, c, p);
|
|
254
|
+
} else if (d === C.Infix) e(u.inputs[0], c, p), a(C.Whitespace, u.wsBefore, c, p), o(u, c, p), a(C.Whitespace, u.wsAfter, c, p), e(u.inputs[1], c, p);
|
|
255
|
+
else if (d === C.Prefix) a(C.Whitespace, u.wsBefore, c, p), o(u, c, p), a(C.Whitespace, u.wsAfter, c, p), u.inputs && e(u.inputs[0], c, p);
|
|
256
|
+
else if (d === C.Postfix) {
|
|
257
|
+
u.inputs?.[0] && e(u.inputs[0], c, p), a(C.Whitespace, u.wsBefore, c, p);
|
|
258
|
+
const t = o(u, c, p), n = l[l.length - 2];
|
|
259
|
+
"#" === u.value && void 0 !== t.text && !u.wsBefore && s.has(n) && (n.text = (n.text ?? "") + t.text, t.text = ""), a(C.Whitespace, u.wsAfter, c, p);
|
|
260
260
|
} else {
|
|
261
|
-
|
|
262
|
-
const f =
|
|
261
|
+
a(C.Whitespace, u.wsBefore, c, p);
|
|
262
|
+
const f = u.inputs;
|
|
263
263
|
switch (d) {
|
|
264
|
-
case
|
|
265
|
-
const
|
|
266
|
-
type:
|
|
267
|
-
value:
|
|
268
|
-
text:
|
|
269
|
-
evalIndex:
|
|
264
|
+
case C.Function: {
|
|
265
|
+
const t = String(u.value), n = {
|
|
266
|
+
type: C.Function,
|
|
267
|
+
value: t,
|
|
268
|
+
text: u.image ?? t,
|
|
269
|
+
evalIndex: u.evalIndex
|
|
270
270
|
};
|
|
271
|
-
c && (
|
|
272
|
-
const
|
|
273
|
-
name:
|
|
271
|
+
c && (n.context = c), l.push(n);
|
|
272
|
+
const i = {
|
|
273
|
+
name: t,
|
|
274
274
|
argIndex: -1,
|
|
275
|
-
type:
|
|
275
|
+
type: u.binder?.kind ?? "function"
|
|
276
276
|
};
|
|
277
|
-
if (c?.bound && (
|
|
278
|
-
const
|
|
279
|
-
let
|
|
280
|
-
for (let
|
|
281
|
-
const
|
|
282
|
-
if (
|
|
283
|
-
const e =
|
|
284
|
-
|
|
277
|
+
if (c?.bound && (i.bound = c.bound), a(C.Paren, "(", i, u.evalIndex), f) {
|
|
278
|
+
const t = f.length, n = u.binder?.kind, l = "lambda" === n ? 1 : "let" === n ? 2 : 0;
|
|
279
|
+
let s = i.bound;
|
|
280
|
+
for (let o = 0; o < t; o++) {
|
|
281
|
+
const u = l && o >= l ? f[o - l] : void 0;
|
|
282
|
+
if (u?.binding?.declaration) {
|
|
283
|
+
const e = u.value.nameId, t = "let" === n ? bt(f[o - 1]) : void 0;
|
|
284
|
+
s = It(s, t ? {
|
|
285
285
|
name: e,
|
|
286
|
-
params:
|
|
286
|
+
params: t
|
|
287
287
|
} : { name: e });
|
|
288
288
|
}
|
|
289
289
|
const c = {
|
|
290
|
-
...
|
|
291
|
-
argIndex:
|
|
290
|
+
...i,
|
|
291
|
+
argIndex: o
|
|
292
292
|
};
|
|
293
|
-
|
|
293
|
+
s && (c.bound = s), e(f[o], c, p), o < t - 1 && a(C.Separator, ",", c, p, r.separatorFunction);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
u.error || a(C.Paren, ")", i, u.evalIndex);
|
|
297
297
|
break;
|
|
298
298
|
}
|
|
299
|
-
case
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
const
|
|
303
|
-
|
|
299
|
+
case C.Call: {
|
|
300
|
+
const t = i(u), s = l.length;
|
|
301
|
+
if (t && e(t, c, p), t?.type === C.Named) for (let e = s; e < l.length; e++) {
|
|
302
|
+
const t = l[e];
|
|
303
|
+
t.type !== C.Whitespace && (t.evalIndex = u.evalIndex, t.type === C.Named && (t.type = C.Function, t.value = t.value.name));
|
|
304
304
|
}
|
|
305
|
-
const
|
|
306
|
-
name:
|
|
305
|
+
const o = {
|
|
306
|
+
name: t?.type === C.Named ? t.value.nameId : "",
|
|
307
307
|
argIndex: -1,
|
|
308
308
|
type: "function"
|
|
309
309
|
};
|
|
310
|
-
c?.bound && (
|
|
311
|
-
const f = n(
|
|
310
|
+
c?.bound && (o.bound = c.bound), a(C.Paren, "(", o, u.evalIndex);
|
|
311
|
+
const f = n(u), d = f.length;
|
|
312
312
|
for (let t = 0; t < d; t++) {
|
|
313
313
|
const n = {
|
|
314
|
-
...
|
|
314
|
+
...o,
|
|
315
315
|
argIndex: t
|
|
316
316
|
};
|
|
317
|
-
e(f[t], n, p), t < d - 1 &&
|
|
317
|
+
e(f[t], n, p), t < d - 1 && a(C.Separator, ",", n, p, r.separatorFunction);
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
u.error || a(C.Paren, ")", o, u.evalIndex);
|
|
320
320
|
break;
|
|
321
321
|
}
|
|
322
|
-
case
|
|
323
|
-
|
|
322
|
+
case C.Cell:
|
|
323
|
+
o(u, c, p);
|
|
324
324
|
break;
|
|
325
|
-
case
|
|
326
|
-
|
|
325
|
+
case C.Paren:
|
|
326
|
+
a(d, "(", c, p), g(f, c, p), u.error || a(d, ")", c, p);
|
|
327
327
|
break;
|
|
328
|
-
case
|
|
329
|
-
const n =
|
|
328
|
+
case C.TableReference: {
|
|
329
|
+
const n = u.value?.tableId ?? "", r = {
|
|
330
330
|
name: n,
|
|
331
331
|
argIndex: -1,
|
|
332
332
|
type: "table"
|
|
333
|
-
},
|
|
333
|
+
}, i = l.length, o = u.image;
|
|
334
334
|
let d, g = !1;
|
|
335
|
-
if (n &&
|
|
335
|
+
if (n && o) {
|
|
336
336
|
let e = 0;
|
|
337
|
-
if (91 ===
|
|
338
|
-
const t =
|
|
339
|
-
-1 !== t && 33 ===
|
|
337
|
+
if (91 === o.charCodeAt(0)) {
|
|
338
|
+
const t = o.indexOf("]");
|
|
339
|
+
-1 !== t && 33 === o.charCodeAt(t + 1) && (e = t + 2);
|
|
340
340
|
}
|
|
341
|
-
const
|
|
342
|
-
if (g = 0 ===
|
|
341
|
+
const n = o.indexOf("[", e);
|
|
342
|
+
if (g = 0 === n && null != f, n > 0) d = o.slice(0, n);
|
|
343
343
|
else if (!f) {
|
|
344
|
-
const e =
|
|
345
|
-
d =
|
|
344
|
+
const e = o.lastIndexOf("!");
|
|
345
|
+
d = t || -1 === e ? o : o.slice(e + 1);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
if (!n || g &&
|
|
348
|
+
if (!n || g && t || a(C.TableReference, n, c, p, d), f && a(C.Paren, "[", r, p), f) {
|
|
349
349
|
const t = f.length;
|
|
350
350
|
for (let n = 0; n < t; n++) {
|
|
351
|
-
const
|
|
352
|
-
...
|
|
351
|
+
const i = {
|
|
352
|
+
...r,
|
|
353
353
|
argIndex: n
|
|
354
354
|
};
|
|
355
|
-
e(f[n],
|
|
355
|
+
e(f[n], i, p), n < t - 1 && a(C.Separator, ",", i, p);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
f && !
|
|
359
|
-
const
|
|
360
|
-
for (let e =
|
|
358
|
+
f && !u.error && a(C.Paren, "]", r, p);
|
|
359
|
+
const v = u.referenceIndex;
|
|
360
|
+
for (let e = i; e < l.length; e++) void 0 !== v && (l[e].referenceIndex = v), s.add(l[e]);
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
363
|
-
case
|
|
364
|
-
case
|
|
365
|
-
const e =
|
|
366
|
-
|
|
367
|
-
const
|
|
363
|
+
case C.TableSpecifier:
|
|
364
|
+
case C.TableColumn: {
|
|
365
|
+
const e = u.image, t = null != e && e.startsWith("[") && e.endsWith("]");
|
|
366
|
+
t && a(C.Paren, "[", c, p);
|
|
367
|
+
const n = {
|
|
368
368
|
table: "table" === c?.type ? c.name : "",
|
|
369
|
-
name:
|
|
370
|
-
},
|
|
369
|
+
name: u.value
|
|
370
|
+
}, r = {
|
|
371
371
|
type: d,
|
|
372
|
-
value:
|
|
373
|
-
text:
|
|
372
|
+
value: n,
|
|
373
|
+
text: t ? e.slice(1, -1) : e ?? n.name
|
|
374
374
|
};
|
|
375
|
-
void 0 !== p && (
|
|
375
|
+
void 0 !== p && (r.evalIndex = p), c && (r.context = c), l.push(r), t && a(C.Paren, "]", c, p);
|
|
376
376
|
break;
|
|
377
377
|
}
|
|
378
|
-
case
|
|
378
|
+
case C.List:
|
|
379
379
|
g(f, c, p);
|
|
380
380
|
break;
|
|
381
|
-
case
|
|
382
|
-
const e =
|
|
383
|
-
e.value =
|
|
384
|
-
name:
|
|
385
|
-
scope:
|
|
386
|
-
} : { name:
|
|
381
|
+
case C.Named: {
|
|
382
|
+
const e = o(u, c, p), t = u.value;
|
|
383
|
+
e.value = t.scope ? {
|
|
384
|
+
name: t.nameId,
|
|
385
|
+
scope: t.scope
|
|
386
|
+
} : { name: t.nameId }, u.binding?.declaration && u.binding.optional && (e.value.optional = !0), u.binding && (e.type = C.Parameter, u.binding.declaration && (e.value.declaration = !0)), delete e.referenceIndex;
|
|
387
387
|
break;
|
|
388
388
|
}
|
|
389
|
-
default: void 0 !==
|
|
389
|
+
default: void 0 !== u.value && o(u, c, p), f && f.forEach((t) => e(t, c, p));
|
|
390
390
|
}
|
|
391
|
-
|
|
391
|
+
a(C.Whitespace, u.wsAfter, c, p);
|
|
392
392
|
}
|
|
393
|
-
})(
|
|
394
|
-
const
|
|
395
|
-
for (const e of l) if (e.type ===
|
|
396
|
-
const t =
|
|
397
|
-
t ? t.push(e) :
|
|
393
|
+
})(e);
|
|
394
|
+
const u = /* @__PURE__ */ new Map();
|
|
395
|
+
for (const e of l) if (e.type === C.Cell && void 0 !== e.referenceIndex) {
|
|
396
|
+
const t = u.get(e.referenceIndex);
|
|
397
|
+
t ? t.push(e) : u.set(e.referenceIndex, [e]);
|
|
398
398
|
}
|
|
399
|
-
for (const e of
|
|
400
|
-
const
|
|
399
|
+
for (const e of u.values()) 1 === e.length ? e[0].refSide = "self" : (e[0].refSide = "left", e[e.length - 1].refSide = "right");
|
|
400
|
+
const c = /* @__PURE__ */ new Map();
|
|
401
401
|
for (const e of l) if (void 0 !== e.referenceIndex && void 0 !== e.evalIndex) {
|
|
402
|
-
const t =
|
|
403
|
-
(void 0 === t || e.evalIndex < t) &&
|
|
402
|
+
const t = c.get(e.referenceIndex);
|
|
403
|
+
(void 0 === t || e.evalIndex < t) && c.set(e.referenceIndex, e.evalIndex);
|
|
404
404
|
}
|
|
405
|
-
if (
|
|
405
|
+
if (c.size > 0) {
|
|
406
406
|
for (const e of l) if (void 0 !== e.referenceIndex) {
|
|
407
|
-
const t =
|
|
407
|
+
const t = c.get(e.referenceIndex);
|
|
408
408
|
void 0 !== t && (e.evalIndex = t);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
@@ -413,64 +413,64 @@ function ge(t, r = !1, i = x) {
|
|
|
413
413
|
function ve(e, t) {
|
|
414
414
|
let n = "";
|
|
415
415
|
for (let r = 0; r < e.length; r++) {
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
418
|
-
const e =
|
|
419
|
-
if (e && void 0 !==
|
|
420
|
-
const r = t?.resolve(
|
|
421
|
-
n +=
|
|
416
|
+
const i = e[r], l = i.type;
|
|
417
|
+
if (l === C.Cell || l === C.Named || l === C.Error) {
|
|
418
|
+
const e = l === C.Cell ? i.value?.scope : (C.Named, i.value?.scope ?? void 0), r = l === C.Error ? void 0 !== i.text && d(i.text) : i.text?.includes("!") ?? !1;
|
|
419
|
+
if (e && void 0 !== i.text && !r) {
|
|
420
|
+
const r = t?.resolve(x.Sheet, e)?.toString() ?? e;
|
|
421
|
+
n += m(r) + "!" + i.text;
|
|
422
422
|
continue;
|
|
423
423
|
}
|
|
424
|
-
if (
|
|
425
|
-
n +=
|
|
424
|
+
if (l === C.Named) {
|
|
425
|
+
n += i.text ?? i.value?.name ?? "";
|
|
426
426
|
continue;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
if (
|
|
430
|
-
n +=
|
|
429
|
+
if (l === C.Parameter) {
|
|
430
|
+
n += i.text ?? i.value?.name ?? "";
|
|
431
431
|
continue;
|
|
432
432
|
}
|
|
433
|
-
const
|
|
434
|
-
"string" == typeof
|
|
433
|
+
const s = i.text ?? i.value;
|
|
434
|
+
"string" == typeof s && (n += s);
|
|
435
435
|
}
|
|
436
436
|
return n;
|
|
437
437
|
}
|
|
438
438
|
function he(e, t) {
|
|
439
439
|
let n;
|
|
440
|
-
if (
|
|
440
|
+
if (y(e, (e) => {
|
|
441
441
|
e.evalIndex === t && (n = e);
|
|
442
442
|
}), !n) return [];
|
|
443
443
|
const r = ge(n);
|
|
444
|
-
return r.length > 1 && r[0].type ===
|
|
444
|
+
return r.length > 1 && r[0].type === C.Whitespace && r.shift(), r.length > 1 && r[r.length - 1].type === C.Whitespace && r.pop(), r;
|
|
445
445
|
}
|
|
446
446
|
function me(e) {
|
|
447
|
-
return
|
|
448
|
-
if (e.type !==
|
|
447
|
+
return y(e, (e) => {
|
|
448
|
+
if (e.type !== C.TableReference) return;
|
|
449
449
|
const t = function(e) {
|
|
450
450
|
if (null !== e.value && "object" == typeof e.value) return e.value;
|
|
451
451
|
const t = e.value, n = e.inputs;
|
|
452
452
|
let r = !1, i = !1, l = !1, s = !1, o = null, a = null, u = !1;
|
|
453
453
|
const c = (e) => {
|
|
454
|
-
e?.type ===
|
|
454
|
+
e?.type === C.TableColumn && (o = e.value, a = e.value);
|
|
455
455
|
};
|
|
456
456
|
if (n) for (const e of n) {
|
|
457
457
|
const t = e.type;
|
|
458
|
-
if (t ===
|
|
458
|
+
if (t === C.TableSpecifier) {
|
|
459
459
|
const t = e.value.toUpperCase().trim();
|
|
460
460
|
"#ALL" === t ? i = !0 : "#HEADERS" === t ? l = !0 : "#TOTALS" === t ? s = !0 : "#DATA" === t ? r = !0 : "@" !== t && "#THIS ROW" !== t || (u = !0);
|
|
461
|
-
} else if (t ===
|
|
462
|
-
else if (t ===
|
|
461
|
+
} else if (t === C.TableColumn) c(e);
|
|
462
|
+
else if (t === C.Infix && ":" === e.value) {
|
|
463
463
|
const t = e.inputs?.[0], n = e.inputs?.[1];
|
|
464
|
-
t?.type ===
|
|
465
|
-
} else if (t ===
|
|
464
|
+
t?.type === C.TableColumn && (o = t.value), n?.type === C.TableColumn && (a = n.value);
|
|
465
|
+
} else if (t === C.Prefix && "@" === e.value) {
|
|
466
466
|
u = !0;
|
|
467
467
|
const t = e.inputs?.[0];
|
|
468
|
-
t?.type ===
|
|
468
|
+
t?.type === C.Infix && ":" === t.value ? (t.inputs?.[0]?.type === C.TableColumn && (o = t.inputs[0].value), t.inputs?.[1]?.type === C.TableColumn && (a = t.inputs[1].value)) : c(t);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
return {
|
|
472
472
|
tableId: t,
|
|
473
|
-
spec:
|
|
473
|
+
spec: b(i, l, r, s),
|
|
474
474
|
columnFromId: o,
|
|
475
475
|
columnToId: a,
|
|
476
476
|
isThisRow: u
|
|
@@ -483,19 +483,19 @@ function me(e) {
|
|
|
483
483
|
});
|
|
484
484
|
}
|
|
485
485
|
function ye(e) {
|
|
486
|
-
return
|
|
487
|
-
if (e.type !==
|
|
486
|
+
return y(e, (e) => {
|
|
487
|
+
if (e.type !== C.TableReference) return;
|
|
488
488
|
const t = e.inputs;
|
|
489
489
|
if (!t) return;
|
|
490
|
-
if (-1 === t.findIndex((e) => e.type ===
|
|
490
|
+
if (-1 === t.findIndex((e) => e.type === C.TableSpecifier && "#THIS ROW" === e.value.toUpperCase().trim())) return;
|
|
491
491
|
const n = [];
|
|
492
492
|
let r;
|
|
493
493
|
for (const e of t) {
|
|
494
|
-
if (e.type ===
|
|
495
|
-
e.type !==
|
|
494
|
+
if (e.type === C.TableSpecifier && "#THIS ROW" === e.value.toUpperCase().trim()) continue;
|
|
495
|
+
e.type !== C.TableColumn && (e.type !== C.Infix || ":" !== e.value) || r ? n.push(e) : r = e;
|
|
496
496
|
}
|
|
497
497
|
if (!r) return n.push({
|
|
498
|
-
type:
|
|
498
|
+
type: C.Prefix,
|
|
499
499
|
value: "@",
|
|
500
500
|
inputs: null,
|
|
501
501
|
isReference: !0
|
|
@@ -507,15 +507,15 @@ function ye(e) {
|
|
|
507
507
|
...r,
|
|
508
508
|
image: i.slice(1, -1)
|
|
509
509
|
} : r;
|
|
510
|
-
return n.push(
|
|
510
|
+
return n.push(v("@", l, !0)), {
|
|
511
511
|
...e,
|
|
512
512
|
inputs: n
|
|
513
513
|
};
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
function Ie(e) {
|
|
517
|
-
return
|
|
518
|
-
if (e.type !==
|
|
517
|
+
return y(e, (e) => {
|
|
518
|
+
if (e.type !== C.TableReference) return;
|
|
519
519
|
if (0 !== e.inputs?.length || e.error) return;
|
|
520
520
|
const t = e.value;
|
|
521
521
|
return ("string" == typeof t ? t : t?.tableId) ? {
|
|
@@ -525,8 +525,8 @@ function Ie(e) {
|
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
527
|
function be(e) {
|
|
528
|
-
return
|
|
529
|
-
if (e.type !==
|
|
528
|
+
return y(e, (e) => {
|
|
529
|
+
if (e.type !== C.TableReference || !e.inputs) return;
|
|
530
530
|
const t = e.value, n = "string" == typeof t ? t : t?.tableId, r = e.image;
|
|
531
531
|
if (!n || 91 !== r?.charCodeAt(0)) return;
|
|
532
532
|
const i = r.indexOf("]");
|
|
@@ -536,7 +536,7 @@ function be(e) {
|
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
var xe = (e) => {
|
|
539
|
-
if (e?.type !==
|
|
539
|
+
if (e?.type !== C.TableSpecifier) return 4;
|
|
540
540
|
switch (e.value.toUpperCase().trim()) {
|
|
541
541
|
case "#ALL": return 0;
|
|
542
542
|
case "#HEADERS": return 1;
|
|
@@ -546,8 +546,8 @@ var xe = (e) => {
|
|
|
546
546
|
}
|
|
547
547
|
};
|
|
548
548
|
function Re(e) {
|
|
549
|
-
return
|
|
550
|
-
if (e.type !==
|
|
549
|
+
return y(e, (e) => {
|
|
550
|
+
if (e.type !== C.TableReference) return;
|
|
551
551
|
const t = e.inputs;
|
|
552
552
|
if (!t || t.length < 2) return;
|
|
553
553
|
const n = t.map((e, t) => ({
|
|
@@ -564,8 +564,8 @@ function Re(e) {
|
|
|
564
564
|
function Ee(e) {
|
|
565
565
|
if (!e) return V.EmptyArray;
|
|
566
566
|
let t = V.EmptyArray;
|
|
567
|
-
return
|
|
568
|
-
if (e.type !==
|
|
567
|
+
return y(e, (e) => {
|
|
568
|
+
if (e.type !== C.Named || e.binding) return;
|
|
569
569
|
const n = e.value.nameId;
|
|
570
570
|
n && (t === V.EmptyArray && (t = []), t.includes(n) || t.push(n));
|
|
571
571
|
}), t;
|
|
@@ -573,12 +573,12 @@ function Ee(e) {
|
|
|
573
573
|
function Te(e, t) {
|
|
574
574
|
if (!e) return V.EmptyArray;
|
|
575
575
|
let n = V.EmptyArray;
|
|
576
|
-
return
|
|
576
|
+
return y(e, (e, r, i) => {
|
|
577
577
|
if (!e.isReference) return;
|
|
578
578
|
if (r?.isReference) return;
|
|
579
579
|
const l = e.type;
|
|
580
|
-
if (l ===
|
|
581
|
-
if (pe(i,
|
|
580
|
+
if (l === C.Named || l === C.Error || l === C.TableReference) return;
|
|
581
|
+
if (pe(i, C.TableReference)) return;
|
|
582
582
|
const s = function(e) {
|
|
583
583
|
let t = e;
|
|
584
584
|
for (; t;) {
|
|
@@ -591,15 +591,15 @@ function Te(e, t) {
|
|
|
591
591
|
let r = e;
|
|
592
592
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
593
593
|
const i = t[e];
|
|
594
|
-
if (i.type ===
|
|
594
|
+
if (i.type === C.Paren || i.isReference) {
|
|
595
595
|
r = i;
|
|
596
596
|
continue;
|
|
597
597
|
}
|
|
598
|
-
if (i.type !==
|
|
598
|
+
if (i.type !== C.Function) return !0;
|
|
599
599
|
const l = n?.(String(i.value));
|
|
600
600
|
if (!l) return !0;
|
|
601
601
|
const s = i.inputs ? i.inputs.indexOf(r) : -1;
|
|
602
|
-
return "p" !== (s >= 0 ?
|
|
602
|
+
return "p" !== (s >= 0 ? Oe(l.getDeclaration().getParameters(), s) : null)?.getRangeType();
|
|
603
603
|
}
|
|
604
604
|
return !0;
|
|
605
605
|
}(e, i, t) && (n === V.EmptyArray && (n = []), n.includes(s) || n.push(s));
|
|
@@ -609,8 +609,8 @@ var Ae = /* @__PURE__ */ new Set(["SUBTOTAL", "AGGREGATE"]);
|
|
|
609
609
|
function Se(e, t) {
|
|
610
610
|
if (!e || !t) return !1;
|
|
611
611
|
let n = !1;
|
|
612
|
-
return
|
|
613
|
-
if (n || e.type !==
|
|
612
|
+
return y(e, (e) => {
|
|
613
|
+
if (n || e.type !== C.Function) return;
|
|
614
614
|
const r = t(e.value)?.getName();
|
|
615
615
|
r && Ae.has(r.toUpperCase()) && (n = !0);
|
|
616
616
|
}), n;
|
|
@@ -618,32 +618,39 @@ function Se(e, t) {
|
|
|
618
618
|
function we(e, t) {
|
|
619
619
|
if (!e || !t) return !1;
|
|
620
620
|
let n = !1;
|
|
621
|
-
return
|
|
622
|
-
n || e.type !==
|
|
621
|
+
return y(e, (e) => {
|
|
622
|
+
n || e.type !== C.Function || "TABLE" === t(e.value)?.getName().toUpperCase() && (n = !0);
|
|
623
623
|
}), n;
|
|
624
624
|
}
|
|
625
|
-
|
|
625
|
+
function Ce(e, t) {
|
|
626
|
+
if (!e || !t) return !1;
|
|
627
|
+
let n = !1;
|
|
628
|
+
return y(e, (e) => {
|
|
629
|
+
n || e.type !== C.Function || !0 === t(e.value)?.getDeclaration().getReturnType()?.isVolatile() && (n = !0);
|
|
630
|
+
}), n;
|
|
631
|
+
}
|
|
632
|
+
var Ne = Object.freeze({
|
|
626
633
|
value: !1,
|
|
627
634
|
array: !1
|
|
628
|
-
}),
|
|
635
|
+
}), Fe = (e, t) => {
|
|
629
636
|
const n = function(e, t) {
|
|
630
|
-
if (!e || !t) return
|
|
637
|
+
if (!e || !t) return Ne;
|
|
631
638
|
let n = !1, r = !1;
|
|
632
|
-
return
|
|
639
|
+
return y(e, (e) => {
|
|
633
640
|
if (n) return;
|
|
634
641
|
const i = e.type;
|
|
635
|
-
if (i ===
|
|
636
|
-
if (i ===
|
|
637
|
-
if (i ===
|
|
638
|
-
if (i !==
|
|
642
|
+
if (i === C.Named) return void (void 0 === e.binding && (n = !0));
|
|
643
|
+
if (i === C.Prefix) return void ("@" === e.value && (n = !0));
|
|
644
|
+
if (i === C.Call) return void (n = !0);
|
|
645
|
+
if (i !== C.Function) return;
|
|
639
646
|
if (void 0 !== e.binder) return;
|
|
640
647
|
const l = t(e.value);
|
|
641
648
|
if (!l) return void (n = !0);
|
|
642
649
|
if (r || !0 !== e.implicitIntersect) return;
|
|
643
650
|
const s = l.getDeclaration().getParameters(), o = e.inputs;
|
|
644
651
|
if (o) for (let e = 0; e < o.length; e++) {
|
|
645
|
-
const n =
|
|
646
|
-
if (null !== n && n.isValueOrRange() &&
|
|
652
|
+
const n = Oe(s, e);
|
|
653
|
+
if (null !== n && n.isValueOrRange() && Me(o[e], t)) return void (r = !0);
|
|
647
654
|
}
|
|
648
655
|
}), {
|
|
649
656
|
value: !n && !r,
|
|
@@ -654,48 +661,48 @@ var Ce = Object.freeze({
|
|
|
654
661
|
isBlankCacheable: n.value,
|
|
655
662
|
isBlankCacheableArray: n.array
|
|
656
663
|
};
|
|
657
|
-
},
|
|
664
|
+
}, Pe = (e, t) => {
|
|
658
665
|
const n = e.length;
|
|
659
666
|
if (0 === n) return null;
|
|
660
667
|
if (t < n - 1) return e[t];
|
|
661
668
|
const r = e[n - 1], i = r.getRepeatingTypes();
|
|
662
669
|
return i && 0 !== i.length ? i[(t - (n - 1)) % i.length] : t < n ? e[t] : r.isRest() ? r : null;
|
|
663
670
|
};
|
|
664
|
-
function
|
|
671
|
+
function Le(e) {
|
|
665
672
|
if (!e) return V.EmptyArray;
|
|
666
|
-
let
|
|
667
|
-
const
|
|
668
|
-
e && (
|
|
669
|
-
},
|
|
670
|
-
"string" == typeof e &&
|
|
673
|
+
let n = V.EmptyArray;
|
|
674
|
+
const r = (e) => {
|
|
675
|
+
e && (n === V.EmptyArray && (n = []), n.includes(e) || n.push(e));
|
|
676
|
+
}, i = (e) => {
|
|
677
|
+
"string" == typeof e && r(t(e)?.bookId);
|
|
671
678
|
};
|
|
672
|
-
return
|
|
673
|
-
if (e.type ===
|
|
679
|
+
return y(e, (e) => {
|
|
680
|
+
if (e.type === C.Named) {
|
|
674
681
|
if (e.binding) return;
|
|
675
682
|
const t = e.value;
|
|
676
|
-
|
|
677
|
-
} else if (e.type ===
|
|
683
|
+
r(t.nameId), i(t.scope);
|
|
684
|
+
} else if (e.type === C.TableReference) {
|
|
678
685
|
const t = e.value;
|
|
679
|
-
|
|
680
|
-
} else if (e.type ===
|
|
686
|
+
r("string" == typeof t ? t : t?.tableId);
|
|
687
|
+
} else if (e.type === C.Cell) {
|
|
681
688
|
const t = e.value?.scope;
|
|
682
|
-
|
|
683
|
-
} else e.type ===
|
|
684
|
-
}),
|
|
689
|
+
i(t), f(t) && r(t);
|
|
690
|
+
} else e.type === C.Error && i(e.value?.scope);
|
|
691
|
+
}), n;
|
|
685
692
|
}
|
|
686
693
|
var ke = (e, t) => {
|
|
687
694
|
if (!0 === e.lazyArg) return !0;
|
|
688
695
|
if ("lambda" !== t?.binder?.kind) return !1;
|
|
689
696
|
const n = t.inputs;
|
|
690
697
|
return n[n.length - 1] === e;
|
|
691
|
-
},
|
|
698
|
+
}, $e = /* @__PURE__ */ new Set([
|
|
692
699
|
"IF",
|
|
693
700
|
"IFS",
|
|
694
701
|
"SWITCH",
|
|
695
702
|
"CHOOSE",
|
|
696
703
|
"IFERROR",
|
|
697
704
|
"IFNA"
|
|
698
|
-
]),
|
|
705
|
+
]), Oe = (e, t) => {
|
|
699
706
|
const n = e.length;
|
|
700
707
|
if (0 === n) return null;
|
|
701
708
|
if (t < n) return e[t];
|
|
@@ -703,24 +710,24 @@ var ke = (e, t) => {
|
|
|
703
710
|
if (!r.isRest()) return null;
|
|
704
711
|
const i = r.getRepeatingTypes();
|
|
705
712
|
return i && 0 !== i.length ? i[(t - (n - 1)) % i.length] : r;
|
|
706
|
-
},
|
|
713
|
+
}, Be = (e) => null !== e.getScalarType() && null === e.getRangeType() && null === e.getLambda() && !e.isValueOrRange(), Ve = (e, t, n) => !(e.isRest() || !Be(e) || !Me(t, n)) && !(e.isNoLift() && ze(t, n)), ze = (e, t) => {
|
|
707
714
|
if (!e) return !1;
|
|
708
715
|
const n = e.inputs;
|
|
709
716
|
switch (e.type) {
|
|
710
|
-
case
|
|
711
|
-
case
|
|
712
|
-
case
|
|
713
|
-
case
|
|
714
|
-
case
|
|
715
|
-
case
|
|
716
|
-
case
|
|
717
|
-
case
|
|
718
|
-
case
|
|
717
|
+
case C.Cell:
|
|
718
|
+
case C.Named:
|
|
719
|
+
case C.TableReference: return !0;
|
|
720
|
+
case C.Infix:
|
|
721
|
+
case C.Prefix:
|
|
722
|
+
case C.Postfix: return !0 === e.isReference && "@" !== e.value;
|
|
723
|
+
case C.Paren:
|
|
724
|
+
case C.List: return !!n && 1 === n.length && ze(n[0], t);
|
|
725
|
+
case C.Function: {
|
|
719
726
|
if (void 0 !== e.binder) return !1;
|
|
720
727
|
const r = String(e.value).toUpperCase();
|
|
721
|
-
if (
|
|
728
|
+
if ($e.has(r)) {
|
|
722
729
|
if (!n) return !1;
|
|
723
|
-
for (let e = 0; e < n.length; e++) if (
|
|
730
|
+
for (let e = 0; e < n.length; e++) if (ze(n[e], t)) return !0;
|
|
724
731
|
return !1;
|
|
725
732
|
}
|
|
726
733
|
const i = t?.(e.value);
|
|
@@ -728,54 +735,54 @@ var ke = (e, t) => {
|
|
|
728
735
|
}
|
|
729
736
|
default: return !1;
|
|
730
737
|
}
|
|
731
|
-
},
|
|
738
|
+
}, De = (e, t) => {
|
|
732
739
|
if (!e) return !1;
|
|
733
|
-
for (let n = 0; n < e.length; n++) if (
|
|
740
|
+
for (let n = 0; n < e.length; n++) if (Me(e[n], t)) return !0;
|
|
734
741
|
return !1;
|
|
735
742
|
};
|
|
736
|
-
function
|
|
743
|
+
function Me(e, t) {
|
|
737
744
|
if (!e) return !1;
|
|
738
745
|
if (void 0 !== e.arrayValued) return e.arrayValued;
|
|
739
746
|
let n;
|
|
740
747
|
const r = e.type, i = e.inputs;
|
|
741
748
|
switch (r) {
|
|
742
|
-
case
|
|
749
|
+
case C.Array:
|
|
743
750
|
n = !0;
|
|
744
751
|
break;
|
|
745
|
-
case
|
|
752
|
+
case C.Cell: {
|
|
746
753
|
const t = e.value;
|
|
747
754
|
n = t.rowIndex === Number.MIN_SAFE_INTEGER || t.colIndex === Number.MIN_SAFE_INTEGER;
|
|
748
755
|
break;
|
|
749
756
|
}
|
|
750
|
-
case
|
|
751
|
-
case
|
|
752
|
-
case
|
|
757
|
+
case C.Named:
|
|
758
|
+
case C.Call:
|
|
759
|
+
case C.TableReference:
|
|
753
760
|
n = !0;
|
|
754
761
|
break;
|
|
755
|
-
case
|
|
756
|
-
case
|
|
757
|
-
case
|
|
758
|
-
n = e.isReference ? "@" !== e.value :
|
|
762
|
+
case C.Infix:
|
|
763
|
+
case C.Prefix:
|
|
764
|
+
case C.Postfix:
|
|
765
|
+
n = e.isReference ? "@" !== e.value : De(i, t);
|
|
759
766
|
break;
|
|
760
|
-
case
|
|
761
|
-
case
|
|
762
|
-
n = !i || 1 !== i.length ||
|
|
767
|
+
case C.Paren:
|
|
768
|
+
case C.List:
|
|
769
|
+
n = !i || 1 !== i.length || Me(i[0], t);
|
|
763
770
|
break;
|
|
764
|
-
case
|
|
771
|
+
case C.Function: {
|
|
765
772
|
const r = e.binder;
|
|
766
773
|
if (void 0 !== r) {
|
|
767
|
-
n = "lambda" === r.kind || !!i &&
|
|
774
|
+
n = "lambda" === r.kind || !!i && Me(i[i.length - 1], t);
|
|
768
775
|
break;
|
|
769
776
|
}
|
|
770
777
|
const l = String(e.value).toUpperCase();
|
|
771
|
-
if (
|
|
772
|
-
n =
|
|
778
|
+
if ($e.has(l)) {
|
|
779
|
+
n = De(i, t);
|
|
773
780
|
break;
|
|
774
781
|
}
|
|
775
782
|
if ("INDEX" === l) {
|
|
776
783
|
if (n = !1, i) for (let e = 1; e < i.length; e++) {
|
|
777
784
|
const r = i[e];
|
|
778
|
-
if (!r || r.type ===
|
|
785
|
+
if (!r || r.type === C.Empty || r.isLiteral && 0 === r.value || Me(r, t)) {
|
|
779
786
|
n = !0;
|
|
780
787
|
break;
|
|
781
788
|
}
|
|
@@ -803,17 +810,17 @@ function We(e, t) {
|
|
|
803
810
|
const i = e.inputs;
|
|
804
811
|
if (!i) return;
|
|
805
812
|
const l = e.type;
|
|
806
|
-
if (l ===
|
|
813
|
+
if (l === C.Infix || l === C.Prefix || l === C.Postfix) {
|
|
807
814
|
const t = r && !e.isReference;
|
|
808
815
|
for (let e = 0; e < i.length; e++) n(i[e], t);
|
|
809
816
|
return;
|
|
810
817
|
}
|
|
811
|
-
if (l ===
|
|
818
|
+
if (l === C.Paren || l === C.List) {
|
|
812
819
|
const e = r && 1 === i.length;
|
|
813
820
|
for (let t = 0; t < i.length; t++) n(i[t], e);
|
|
814
821
|
return;
|
|
815
822
|
}
|
|
816
|
-
if (l ===
|
|
823
|
+
if (l === C.Function) {
|
|
817
824
|
const l = e.binder;
|
|
818
825
|
if (void 0 !== l) {
|
|
819
826
|
const e = i.length - 1;
|
|
@@ -822,8 +829,8 @@ function We(e, t) {
|
|
|
822
829
|
}
|
|
823
830
|
const s = r ? t?.(e.value)?.getDeclaration().getParameters() : null;
|
|
824
831
|
for (let e = 0; e < i.length; e++) {
|
|
825
|
-
const t = s ?
|
|
826
|
-
n(i[e], null !== t && (
|
|
832
|
+
const t = s ? Oe(s, e) : null;
|
|
833
|
+
n(i[e], null !== t && (Be(t) || Ge(t)));
|
|
827
834
|
}
|
|
828
835
|
return;
|
|
829
836
|
}
|
|
@@ -831,35 +838,35 @@ function We(e, t) {
|
|
|
831
838
|
};
|
|
832
839
|
n(e, !0);
|
|
833
840
|
}
|
|
834
|
-
var
|
|
841
|
+
var Ue = /* @__PURE__ */ new Set([
|
|
835
842
|
"=",
|
|
836
843
|
"<>",
|
|
837
844
|
"<",
|
|
838
845
|
">",
|
|
839
846
|
"<=",
|
|
840
847
|
">="
|
|
841
|
-
]),
|
|
842
|
-
function
|
|
843
|
-
if (!
|
|
848
|
+
]), _e = /* @__PURE__ */ new Set(["ROW", "COLUMN"]);
|
|
849
|
+
function je(t, n) {
|
|
850
|
+
if (!t || !n) return null;
|
|
844
851
|
const r = (e) => n(e.value)?.getName().toUpperCase() ?? null;
|
|
845
852
|
let i = !1;
|
|
846
|
-
if (
|
|
847
|
-
(e.hasLazyArgs || e.type ===
|
|
853
|
+
if (y(t, (e) => {
|
|
854
|
+
(e.hasLazyArgs || e.type === C.Call || void 0 !== e.binder) && (i = !0);
|
|
848
855
|
}), i) return null;
|
|
849
|
-
const l = (e) => e.type ===
|
|
856
|
+
const l = (e) => e.type === C.Number, s = (e) => e.type === C.Number || e.type === C.String || e.type === C.Boolean, o = (e) => {
|
|
850
857
|
if (!e) return !1;
|
|
851
858
|
const t = e.inputs;
|
|
852
859
|
switch (e.type) {
|
|
853
|
-
case
|
|
854
|
-
case
|
|
855
|
-
case
|
|
860
|
+
case C.Paren: return 1 === t?.length && o(t[0]);
|
|
861
|
+
case C.Prefix: return ("-" === e.value || "+" === e.value) && o(t?.[0]);
|
|
862
|
+
case C.Infix: {
|
|
856
863
|
if ("+" !== e.value && "-" !== e.value && "*" !== e.value) return !1;
|
|
857
864
|
const [n, r] = t ?? [];
|
|
858
865
|
return !(!n || !r) && (o(n) && (o(r) || l(r)) || l(n) && o(r));
|
|
859
866
|
}
|
|
860
|
-
case
|
|
867
|
+
case C.Function: {
|
|
861
868
|
const n = r(e);
|
|
862
|
-
if (null !== n &&
|
|
869
|
+
if (null !== n && _e.has(n)) return !t || 0 === t.length || 1 === t.length && t[0]?.type === C.Cell;
|
|
863
870
|
if ("MOD" === n && 2 === t?.length) {
|
|
864
871
|
const e = t[1];
|
|
865
872
|
return o(t[0]) && l(e) && 0 !== e.value;
|
|
@@ -872,13 +879,13 @@ function _e(e, n) {
|
|
|
872
879
|
if (!e) return !1;
|
|
873
880
|
const t = e.inputs;
|
|
874
881
|
switch (e.type) {
|
|
875
|
-
case
|
|
876
|
-
case
|
|
877
|
-
if (!
|
|
882
|
+
case C.Paren: return 1 === t?.length && a(t[0]);
|
|
883
|
+
case C.Infix: {
|
|
884
|
+
if (!Ue.has(e.value)) return !1;
|
|
878
885
|
const [n, r] = t ?? [];
|
|
879
886
|
return !(!n || !r) && (o(n) && (o(r) || s(r)) || s(n) && o(r));
|
|
880
887
|
}
|
|
881
|
-
case
|
|
888
|
+
case C.Function: {
|
|
882
889
|
const n = r(e);
|
|
883
890
|
if (!t || 0 === t.length) return !1;
|
|
884
891
|
if ("ISODD" === n || "ISEVEN" === n) return 1 === t.length && o(t[0]);
|
|
@@ -888,7 +895,7 @@ function _e(e, n) {
|
|
|
888
895
|
for (let n = 0; n < t.length; n++) {
|
|
889
896
|
const r = t[n];
|
|
890
897
|
if (!r) return !1;
|
|
891
|
-
if (r.type !==
|
|
898
|
+
if (r.type !== C.Boolean) {
|
|
892
899
|
if (!a(r)) return !1;
|
|
893
900
|
e = !0;
|
|
894
901
|
}
|
|
@@ -905,25 +912,25 @@ function _e(e, n) {
|
|
|
905
912
|
const t = e.inputs;
|
|
906
913
|
if (t) for (let e = 0; e < t.length; e++) c(t[e]);
|
|
907
914
|
};
|
|
908
|
-
c(
|
|
915
|
+
c(t);
|
|
909
916
|
const f = u.length;
|
|
910
917
|
if (0 === f || f > 4) return null;
|
|
911
918
|
const p = [];
|
|
912
919
|
for (let n = 0; n < 1 << f; n++) {
|
|
913
|
-
const r = (
|
|
914
|
-
const i = u.indexOf(
|
|
915
|
-
if (-1 !== i) return
|
|
916
|
-
const l = { ...
|
|
917
|
-
return delete l.evalIndex, delete l.firstCell, delete l.inLazy, delete l.lazyArg, delete l.hasLazyArgs, delete l.deferred,
|
|
920
|
+
const r = (t) => {
|
|
921
|
+
const i = u.indexOf(t);
|
|
922
|
+
if (-1 !== i) return e(n & 1 << i ? "TRUE" : "FALSE");
|
|
923
|
+
const l = { ...t };
|
|
924
|
+
return delete l.evalIndex, delete l.firstCell, delete l.inLazy, delete l.lazyArg, delete l.hasLazyArgs, delete l.deferred, t.inputs && (l.inputs = t.inputs.map((e) => e ? r(e) : e)), l;
|
|
918
925
|
};
|
|
919
|
-
p.push(r(
|
|
926
|
+
p.push(r(t));
|
|
920
927
|
}
|
|
921
928
|
return p;
|
|
922
929
|
}
|
|
923
|
-
var
|
|
924
|
-
function
|
|
925
|
-
let s, o,
|
|
926
|
-
|
|
930
|
+
var Ge = (e) => "*" === e.getRangeType() && null === e.getLambda() && e.getArrayDepth() <= (e.isRest() ? 1 : 0);
|
|
931
|
+
function He(e, t, n, r = !1, i = null, l = null) {
|
|
932
|
+
let s, o, a = n;
|
|
933
|
+
a = me(a), r || (a = ye(a), a = Re(a), a = Ie(a), a = be(a)), [s, o] = function(e) {
|
|
927
934
|
const t = /* @__PURE__ */ new Map();
|
|
928
935
|
let n = 0;
|
|
929
936
|
const r = [e];
|
|
@@ -937,67 +944,67 @@ function Ge(e, t, n, r = !1, i = null, l = null) {
|
|
|
937
944
|
return t.forEach((e, n) => {
|
|
938
945
|
n && n.inputs && (e.inputs = n.inputs.map((e) => t.get(e) ?? e));
|
|
939
946
|
}), [t.get(e), n];
|
|
940
|
-
}(
|
|
941
|
-
const
|
|
942
|
-
let
|
|
947
|
+
}(a);
|
|
948
|
+
const u = w(o), f = [], d = [], g = new de();
|
|
949
|
+
let v, h = !1;
|
|
943
950
|
(function(e, t) {
|
|
944
951
|
if (!e || !t) return;
|
|
945
952
|
const n = (e) => {
|
|
946
953
|
if (!e) return;
|
|
947
|
-
e.inLazy = !0, e.type ===
|
|
954
|
+
e.inLazy = !0, e.type === C.Named && (e.deferredResolve = !0);
|
|
948
955
|
const t = e.inputs;
|
|
949
956
|
if (t) for (let e = 0; e < t.length; e++) n(t[e]);
|
|
950
957
|
};
|
|
951
|
-
|
|
952
|
-
if (e.type !==
|
|
958
|
+
y(e, (e) => {
|
|
959
|
+
if (e.type !== C.Function) return;
|
|
953
960
|
if (void 0 !== e.binder) return;
|
|
954
961
|
const r = e.inputs;
|
|
955
962
|
if (!r || 0 === r.length) return;
|
|
956
963
|
const i = t(e.value)?.getDeclaration().getParameters();
|
|
957
964
|
if (i) for (let t = 0; t < r.length; t++) {
|
|
958
965
|
const l = r[t];
|
|
959
|
-
l && l.type !==
|
|
966
|
+
l && l.type !== C.Empty && Pe(i, t)?.isLazy() && (l.lazyArg = !0, e.hasLazyArgs = !0, n(l));
|
|
960
967
|
}
|
|
961
968
|
});
|
|
962
969
|
})(s, l);
|
|
963
970
|
const m = (e) => {
|
|
964
|
-
void 0 ===
|
|
965
|
-
let t =
|
|
966
|
-
return void 0 === t &&
|
|
967
|
-
},
|
|
971
|
+
void 0 === v && (v = /* @__PURE__ */ new Map());
|
|
972
|
+
let t = v.get(e);
|
|
973
|
+
return void 0 === t && v.set(e, t = []), t;
|
|
974
|
+
}, I = (e, t) => {
|
|
968
975
|
void 0 === e ? f.push(t) : m(e).push(t);
|
|
969
|
-
},
|
|
970
|
-
e?.type !==
|
|
976
|
+
}, b = (e) => {
|
|
977
|
+
e?.type !== C.Infix || "+" !== e.value && "-" !== e.value || (e.snapsCancellation = !0);
|
|
971
978
|
};
|
|
972
|
-
s =
|
|
979
|
+
s = y(s, (t, n, r) => {
|
|
973
980
|
const i = t.type, l = t.evalIndex;
|
|
974
|
-
if (
|
|
975
|
-
if (h = h || !
|
|
981
|
+
if (u[l] = null, i === C.TableColumn || i === C.TableSpecifier || t.isReference && pe(r, C.TableReference)) return;
|
|
982
|
+
if (h = h || !Ye(t), t.binding?.declaration) return d[t.binding.slot] = -1, void (u[l] = void 0);
|
|
976
983
|
const s = ((e, t, n) => {
|
|
977
984
|
if (ke(e, t)) return e;
|
|
978
985
|
for (let e = n.length - 1; e >= 0; e--) if (ke(n[e], n[e - 1])) return n[e];
|
|
979
986
|
})(t, n, r);
|
|
980
|
-
s === t && m(t), void 0 !== s && i ===
|
|
987
|
+
s === t && m(t), void 0 !== s && i === C.Named && (t.deferredResolve = !0);
|
|
981
988
|
const o = t.binder;
|
|
982
989
|
if (o && "let" === o.kind) {
|
|
983
990
|
const e = t.inputs, n = e?.length ?? 0;
|
|
984
991
|
let r = 0;
|
|
985
|
-
for (let t = 0; t + 1 < n && r < o.slots.length; t += 2) e[t]?.binding?.declaration && (
|
|
992
|
+
for (let t = 0; t + 1 < n && r < o.slots.length; t += 2) e[t]?.binding?.declaration && (d[o.slots[r++]] = e[t + 1]?.evalIndex ?? -1);
|
|
986
993
|
}
|
|
987
|
-
if ((t.isReference || n && n.isReference) && (
|
|
988
|
-
if (i ===
|
|
989
|
-
if (i ===
|
|
990
|
-
if (i ===
|
|
994
|
+
if ((t.isReference || n && n.isReference) && (g.processNode(t, n), t.isReference)) {
|
|
995
|
+
if (i === C.Named) return void (void 0 !== s && I(s, t));
|
|
996
|
+
if (i === C.Cell || i === C.TableReference || i === C.Error) return;
|
|
997
|
+
if (i === C.Infix || i === C.Prefix || i === C.Postfix || i === C.List) return void I(s, t);
|
|
991
998
|
}
|
|
992
|
-
if (t.isLiteral) if (i !==
|
|
999
|
+
if (t.isLiteral) if (i !== C.Array) u[l] = t.value;
|
|
993
1000
|
else {
|
|
994
|
-
const n = t.value, r = n.length, i =
|
|
1001
|
+
const n = t.value, r = n.length, i = w(r);
|
|
995
1002
|
for (let e = 0; e < r; e++) {
|
|
996
|
-
const t = n[e].value, r = t.length, l =
|
|
1003
|
+
const t = n[e].value, r = t.length, l = w(r);
|
|
997
1004
|
for (let e = 0; e < r; e++) {
|
|
998
1005
|
const n = t[e];
|
|
999
1006
|
let r = null;
|
|
1000
|
-
if (n && (r = n.type ===
|
|
1007
|
+
if (n && (r = n.type === C.Error ? p(n.value) : n.value, n.type === C.Prefix)) {
|
|
1001
1008
|
const e = n.value;
|
|
1002
1009
|
r = n.inputs[0].value, "-" === e && (r = -r);
|
|
1003
1010
|
}
|
|
@@ -1005,18 +1012,18 @@ function Ge(e, t, n, r = !1, i = null, l = null) {
|
|
|
1005
1012
|
}
|
|
1006
1013
|
i[e] = l;
|
|
1007
1014
|
}
|
|
1008
|
-
const s =
|
|
1009
|
-
|
|
1015
|
+
const s = A(i);
|
|
1016
|
+
u[l] = new E(e, s.values, s.coords, void 0, s.isLiteral);
|
|
1010
1017
|
}
|
|
1011
1018
|
else {
|
|
1012
|
-
if (i !==
|
|
1013
|
-
|
|
1019
|
+
if (i !== C.Empty) return "lambda" === t.binder?.kind && b(t.inputs[t.inputs.length - 1]), I(s, t), t;
|
|
1020
|
+
u[l] = void 0;
|
|
1014
1021
|
}
|
|
1015
|
-
}),
|
|
1022
|
+
}), b(s), v?.forEach((e, t) => {
|
|
1016
1023
|
t.deferred = e;
|
|
1017
1024
|
});
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1025
|
+
const x = w(g.cells.size);
|
|
1026
|
+
g.cells.forEach((e, t) => {
|
|
1020
1027
|
const n = t.value, r = n.colIndex, i = n.rowIndex, l = n.$colIndex, s = n.$rowIndex, o = {
|
|
1021
1028
|
colStart: r,
|
|
1022
1029
|
rowStart: i,
|
|
@@ -1027,9 +1034,9 @@ function Ge(e, t, n, r = !1, i = null, l = null) {
|
|
|
1027
1034
|
$colEnd: l,
|
|
1028
1035
|
$rowEnd: s
|
|
1029
1036
|
};
|
|
1030
|
-
r === Number.MIN_SAFE_INTEGER && (o.colEnd = Number.MAX_SAFE_INTEGER), i === Number.MIN_SAFE_INTEGER && (o.rowEnd = Number.MAX_SAFE_INTEGER), n.scope && (o.scope = n.scope),
|
|
1037
|
+
r === Number.MIN_SAFE_INTEGER && (o.colEnd = Number.MAX_SAFE_INTEGER), i === Number.MIN_SAFE_INTEGER && (o.rowEnd = Number.MAX_SAFE_INTEGER), n.scope && (o.scope = n.scope), x[e] = o;
|
|
1031
1038
|
});
|
|
1032
|
-
const R =
|
|
1039
|
+
const R = x.length, T = w(R);
|
|
1033
1040
|
for (let e = 0; e < R; e++) T[e] = {
|
|
1034
1041
|
colStart: 0,
|
|
1035
1042
|
rowStart: 0,
|
|
@@ -1037,37 +1044,37 @@ function Ge(e, t, n, r = !1, i = null, l = null) {
|
|
|
1037
1044
|
rowEnd: 0,
|
|
1038
1045
|
scope: null
|
|
1039
1046
|
};
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
|
|
1047
|
+
const S = w(g.references.size);
|
|
1048
|
+
g.references.forEach((e) => {
|
|
1049
|
+
S[e.index] = e;
|
|
1043
1050
|
});
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1046
|
-
|
|
1051
|
+
const F = [];
|
|
1052
|
+
g.rootReferences.forEach((e) => {
|
|
1053
|
+
F.push(e.index);
|
|
1047
1054
|
}), function(e, t, n = !1) {
|
|
1048
1055
|
if (n) {
|
|
1049
1056
|
const t = (e) => {
|
|
1050
1057
|
if (!e) return;
|
|
1051
1058
|
const n = e.type;
|
|
1052
|
-
n !==
|
|
1059
|
+
n !== C.Function && n !== C.Call || (e.implicitIntersect = !0);
|
|
1053
1060
|
const r = e.inputs;
|
|
1054
1061
|
if (r) for (let e = 0; e < r.length; e++) t(r[e]);
|
|
1055
1062
|
};
|
|
1056
1063
|
t(e);
|
|
1057
1064
|
return;
|
|
1058
1065
|
}
|
|
1059
|
-
const r = (e) =>
|
|
1066
|
+
const r = (e) => Me(e, t), i = (e, n) => {
|
|
1060
1067
|
if (!e) return;
|
|
1061
1068
|
const l = e.type;
|
|
1062
|
-
l !==
|
|
1069
|
+
l !== C.Function && l !== C.Call || (e.implicitIntersect = n);
|
|
1063
1070
|
const s = e.inputs;
|
|
1064
1071
|
if (s) {
|
|
1065
|
-
if (l ===
|
|
1072
|
+
if (l === C.Infix || l === C.Prefix || l === C.Postfix) {
|
|
1066
1073
|
const t = !e.isReference;
|
|
1067
1074
|
for (let e = 0; e < s.length; e++) i(s[e], (!t || !r(s[e])) && n);
|
|
1068
1075
|
return;
|
|
1069
1076
|
}
|
|
1070
|
-
if (l ===
|
|
1077
|
+
if (l === C.Function) {
|
|
1071
1078
|
const r = e.binder;
|
|
1072
1079
|
if (void 0 !== r) {
|
|
1073
1080
|
const e = "lambda" !== r.kind && n;
|
|
@@ -1079,8 +1086,8 @@ function Ge(e, t, n, r = !1, i = null, l = null) {
|
|
|
1079
1086
|
if (l) for (let e = 0; e < s.length && !o; e++) {
|
|
1080
1087
|
const n = s[e];
|
|
1081
1088
|
if (!n) continue;
|
|
1082
|
-
const r =
|
|
1083
|
-
r &&
|
|
1089
|
+
const r = Oe(l, e);
|
|
1090
|
+
r && Ve(r, n, t) && (o = !0);
|
|
1084
1091
|
}
|
|
1085
1092
|
o && (e.implicitIntersect = !1);
|
|
1086
1093
|
for (let e = 0; e < s.length; e++) i(s[e], !o && n);
|
|
@@ -1091,61 +1098,62 @@ function Ge(e, t, n, r = !1, i = null, l = null) {
|
|
|
1091
1098
|
};
|
|
1092
1099
|
i(e, !r(e));
|
|
1093
1100
|
}(s, l, !0 === n.legacyIntersect);
|
|
1094
|
-
const
|
|
1101
|
+
const L = (e) => {
|
|
1095
1102
|
const t = e.length;
|
|
1096
1103
|
for (let n = 0; n < t; n++) {
|
|
1097
1104
|
const t = e[n], r = t.type;
|
|
1098
|
-
if (r ===
|
|
1105
|
+
if (r === C.Infix) {
|
|
1099
1106
|
if (!0 === t.snapsCancellation) {
|
|
1100
1107
|
t.fn = ue[t.value];
|
|
1101
1108
|
continue;
|
|
1102
1109
|
}
|
|
1103
1110
|
t.fn = ae[t.value];
|
|
1104
|
-
} else if (r ===
|
|
1105
|
-
else if (r ===
|
|
1111
|
+
} else if (r === C.Prefix) t.fn = ce[t.value];
|
|
1112
|
+
else if (r === C.Postfix) t.fn = fe[t.value];
|
|
1106
1113
|
}
|
|
1107
1114
|
};
|
|
1108
|
-
let
|
|
1109
|
-
|
|
1110
|
-
const $ = r ?
|
|
1115
|
+
let k;
|
|
1116
|
+
L(f), v?.forEach(L);
|
|
1117
|
+
const $ = r ? c(P(e.getLocale()).decimal) : N, O = {
|
|
1111
1118
|
runtime: e,
|
|
1112
1119
|
symbols: t,
|
|
1113
1120
|
getFunction: l,
|
|
1114
1121
|
ast: s,
|
|
1115
|
-
evaluations:
|
|
1122
|
+
evaluations: u,
|
|
1116
1123
|
executions: f,
|
|
1117
|
-
bindings:
|
|
1124
|
+
bindings: d,
|
|
1118
1125
|
referencesAbsolute: T,
|
|
1119
|
-
referencesExecute:
|
|
1120
|
-
referencesRelative:
|
|
1121
|
-
referencesRoot:
|
|
1122
|
-
referenceIndices:
|
|
1126
|
+
referencesExecute: S,
|
|
1127
|
+
referencesRelative: x,
|
|
1128
|
+
referencesRoot: F,
|
|
1129
|
+
referenceIndices: g.referenceIndices,
|
|
1123
1130
|
formatReferenceIndices: Te(s, l),
|
|
1124
|
-
getTokens: () =>
|
|
1131
|
+
getTokens: () => k ??= ge(s, r, $),
|
|
1125
1132
|
namedIds: Ee(s),
|
|
1126
|
-
symbolIds:
|
|
1133
|
+
symbolIds: Le(s),
|
|
1127
1134
|
hasTotals: Se(s, l),
|
|
1128
|
-
|
|
1129
|
-
|
|
1135
|
+
hasDataTable: we(s, l),
|
|
1136
|
+
hasVolatile: Ce(s, l),
|
|
1137
|
+
...Fe(s, l),
|
|
1130
1138
|
isReferenceOnly: !h,
|
|
1131
1139
|
error: i,
|
|
1132
1140
|
transform: (n) => {
|
|
1133
|
-
let o =
|
|
1134
|
-
return o === s ? O :
|
|
1141
|
+
let o = y(s, n);
|
|
1142
|
+
return o === s ? O : He(e, t, o, r, i, l);
|
|
1135
1143
|
}
|
|
1136
1144
|
};
|
|
1137
1145
|
return O;
|
|
1138
1146
|
}
|
|
1139
|
-
function
|
|
1147
|
+
function Xe(e) {
|
|
1140
1148
|
let t = -1, n = -1;
|
|
1141
1149
|
return Number.isSafeInteger(e.previousToken?.startLine) ? (t = e.previousToken.startLine, n = e.previousToken.endColumn + 1) : Number.isSafeInteger(e.token?.startLine) && (t = e.token.startLine, n = e.token.startColumn), -1 !== t ? (e.errorLocation = {
|
|
1142
1150
|
line: t,
|
|
1143
1151
|
column: n
|
|
1144
|
-
}, new
|
|
1152
|
+
}, new L.Parse(e.message, {
|
|
1145
1153
|
line: t,
|
|
1146
1154
|
column: n,
|
|
1147
1155
|
cause: e
|
|
1148
|
-
})) : new
|
|
1156
|
+
})) : new L.Parse(e.message, { cause: e });
|
|
1149
1157
|
}
|
|
1150
1158
|
Object.freeze([
|
|
1151
1159
|
[
|
|
@@ -1167,29 +1175,29 @@ Object.freeze([
|
|
|
1167
1175
|
">="
|
|
1168
1176
|
]
|
|
1169
1177
|
]);
|
|
1170
|
-
var
|
|
1178
|
+
var Ze = Object.freeze([
|
|
1171
1179
|
":",
|
|
1172
1180
|
".:.",
|
|
1173
1181
|
".:",
|
|
1174
1182
|
":."
|
|
1175
|
-
]),
|
|
1183
|
+
]), Ke = Object.freeze([
|
|
1176
1184
|
":",
|
|
1177
1185
|
" ",
|
|
1178
1186
|
".:.",
|
|
1179
1187
|
".:",
|
|
1180
1188
|
":."
|
|
1181
|
-
]),
|
|
1189
|
+
]), qe = Object.freeze(["@"]), Je = Object.freeze(["#"]), Qe = Object.freeze(Ke.concat(Je)), Ye = (Object.freeze(Ke.concat(qe).concat(Je)), (e) => {
|
|
1182
1190
|
if (!e) return !1;
|
|
1183
1191
|
const t = e.type;
|
|
1184
|
-
if (t ===
|
|
1185
|
-
if (t ===
|
|
1186
|
-
if (t ===
|
|
1187
|
-
if (!
|
|
1192
|
+
if (t === C.Cell) return !0;
|
|
1193
|
+
if (t === C.TableReference) return !0;
|
|
1194
|
+
if (t === C.Infix) {
|
|
1195
|
+
if (!Ke.includes(e.value)) return !1;
|
|
1188
1196
|
const t = e.inputs, n = t[0], r = t[1];
|
|
1189
|
-
return
|
|
1197
|
+
return Ye(n) && Ye(r);
|
|
1190
1198
|
}
|
|
1191
|
-
return t ===
|
|
1192
|
-
}),
|
|
1199
|
+
return t === C.List && (e.inputs?.every(Ye) ?? !1);
|
|
1200
|
+
}), et = (e) => !!e && (!(e.type !== C.Infix || !Qe.includes(e.value)) || !(e.type !== C.Postfix || !Je.includes(e.value)) || e.type === C.Array || e.type === C.TableReference), tt = Object.freeze([
|
|
1193
1201
|
"+",
|
|
1194
1202
|
"-",
|
|
1195
1203
|
"*",
|
|
@@ -1202,18 +1210,18 @@ var Xe = Object.freeze([
|
|
|
1202
1210
|
"<",
|
|
1203
1211
|
">=",
|
|
1204
1212
|
"<="
|
|
1205
|
-
]),
|
|
1213
|
+
]), nt = Object.freeze(["-", "+"]), rt = (e, t) => {
|
|
1206
1214
|
if (!e) return !1;
|
|
1207
1215
|
const n = e.type;
|
|
1208
|
-
if (e.isLiteral) return n !==
|
|
1209
|
-
if (n ===
|
|
1216
|
+
if (e.isLiteral) return n !== C.Error;
|
|
1217
|
+
if (n === C.Paren || n === C.List) {
|
|
1210
1218
|
const n = e.inputs;
|
|
1211
|
-
return !(!n || 0 === n.length) && n.every((e) =>
|
|
1219
|
+
return !(!n || 0 === n.length) && n.every((e) => rt(e, t));
|
|
1212
1220
|
}
|
|
1213
|
-
if (n ===
|
|
1214
|
-
if (n ===
|
|
1215
|
-
if (n ===
|
|
1216
|
-
if (n ===
|
|
1221
|
+
if (n === C.Infix) return tt.includes(e.value);
|
|
1222
|
+
if (n === C.Prefix) return nt.includes(e.value);
|
|
1223
|
+
if (n === C.Postfix) return "%" === e.value;
|
|
1224
|
+
if (n === C.Function) {
|
|
1217
1225
|
if (!t) return !1;
|
|
1218
1226
|
const n = t(e.value);
|
|
1219
1227
|
if (!n) return !1;
|
|
@@ -1221,37 +1229,37 @@ var Xe = Object.freeze([
|
|
|
1221
1229
|
return "p" !== i && (null !== i || null === r.getLambda() && null != r.getScalarType());
|
|
1222
1230
|
}
|
|
1223
1231
|
return !1;
|
|
1224
|
-
},
|
|
1232
|
+
}, it = (e, t) => {
|
|
1225
1233
|
if (!e) return null;
|
|
1226
1234
|
let n = null;
|
|
1227
1235
|
const r = (e) => {
|
|
1228
1236
|
if (n || !e) return;
|
|
1229
|
-
if (e.type ===
|
|
1237
|
+
if (e.type === C.Infix && " " === e.value) {
|
|
1230
1238
|
const r = e.inputs, i = r?.[0], l = r?.[1];
|
|
1231
|
-
if (
|
|
1232
|
-
if (
|
|
1239
|
+
if (rt(i, t)) return void (n = i);
|
|
1240
|
+
if (rt(l, t)) return void (n = l);
|
|
1233
1241
|
}
|
|
1234
1242
|
const i = e.inputs;
|
|
1235
1243
|
if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
|
|
1236
1244
|
};
|
|
1237
1245
|
return r(e), n;
|
|
1238
|
-
},
|
|
1246
|
+
}, lt = (e, t) => {
|
|
1239
1247
|
if (!e) return null;
|
|
1240
1248
|
let n = null;
|
|
1241
1249
|
const r = (e) => {
|
|
1242
1250
|
if (n || !e) return;
|
|
1243
|
-
if (e.type ===
|
|
1251
|
+
if (e.type === C.Postfix && "#" === e.value) {
|
|
1244
1252
|
const r = e.inputs?.[0];
|
|
1245
|
-
if (r &&
|
|
1253
|
+
if (r && rt(r, t)) return void (n = r);
|
|
1246
1254
|
}
|
|
1247
1255
|
const i = e.inputs;
|
|
1248
1256
|
if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
|
|
1249
1257
|
};
|
|
1250
1258
|
return r(e), n;
|
|
1251
|
-
},
|
|
1259
|
+
}, st = (e) => {
|
|
1252
1260
|
for (let t = 0; t < e.length; t++) if (e[t].getRepeatingTypes()) return t;
|
|
1253
1261
|
return -1;
|
|
1254
|
-
},
|
|
1262
|
+
}, ot = (e, t, n) => {
|
|
1255
1263
|
const r = e[t].getRepeatingTypes(), i = r.length, l = t, s = e.length - t - 1;
|
|
1256
1264
|
let o = s;
|
|
1257
1265
|
for (; o > 0 && e[t + o].isOptional();) o--;
|
|
@@ -1276,12 +1284,12 @@ var Xe = Object.freeze([
|
|
|
1276
1284
|
};
|
|
1277
1285
|
}
|
|
1278
1286
|
return null;
|
|
1279
|
-
},
|
|
1287
|
+
}, at = (e) => {
|
|
1280
1288
|
if (!e) return null;
|
|
1281
1289
|
let t = null;
|
|
1282
1290
|
const n = (e) => {
|
|
1283
1291
|
if (t || !e) return;
|
|
1284
|
-
if (e.type ===
|
|
1292
|
+
if (e.type === C.Array && Array.isArray(e.value)) {
|
|
1285
1293
|
const n = e.value, r = (n[0]?.value)?.length ?? 0;
|
|
1286
1294
|
for (let e = 1; e < n.length && !t; e++) {
|
|
1287
1295
|
const i = (n[e]?.value)?.length ?? 0;
|
|
@@ -1292,19 +1300,19 @@ var Xe = Object.freeze([
|
|
|
1292
1300
|
if (r) for (let e = 0; e < r.length && !t; e++) n(r[e]);
|
|
1293
1301
|
};
|
|
1294
1302
|
return n(e), t;
|
|
1295
|
-
},
|
|
1303
|
+
}, ut = (e, t) => {
|
|
1296
1304
|
if (!e || !t) return null;
|
|
1297
1305
|
let n = null;
|
|
1298
1306
|
const r = (e) => {
|
|
1299
1307
|
if (n || !e) return;
|
|
1300
|
-
if (e.type ===
|
|
1308
|
+
if (e.type === C.Function) {
|
|
1301
1309
|
const r = e.value, i = t(r);
|
|
1302
1310
|
if (i) {
|
|
1303
1311
|
const t = i.getDeclaration(), l = t.getParameters(), s = e.inputs?.length ?? 0, o = t.getMaxArguments();
|
|
1304
1312
|
if (s > o) return void (n = `Too many arguments for ${r}. The most it accepts is ${o}, but got ${s}.`);
|
|
1305
|
-
const a = l.length > 0 ?
|
|
1313
|
+
const a = l.length > 0 ? st(l) : -1, u = l.length > 0 && l[l.length - 1].isRest();
|
|
1306
1314
|
if (a >= 0) {
|
|
1307
|
-
if (!
|
|
1315
|
+
if (!ot(l, a, s)) {
|
|
1308
1316
|
const e = l[a].getRepeatingTypes().length, t = l.length - 1;
|
|
1309
1317
|
n = 1 === e ? `Too few arguments for ${r}. Expected at least ${t + 1}, but got ${s}.` : `Wrong number of arguments for ${r}. Expected ${t} plus a multiple of ${e}, but got ${s}.`;
|
|
1310
1318
|
}
|
|
@@ -1319,24 +1327,24 @@ var Xe = Object.freeze([
|
|
|
1319
1327
|
if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
|
|
1320
1328
|
};
|
|
1321
1329
|
return r(e), n;
|
|
1322
|
-
},
|
|
1330
|
+
}, ct = (e, t) => {
|
|
1323
1331
|
if (!e || !t) return null;
|
|
1324
1332
|
let n = null;
|
|
1325
1333
|
const r = (e) => {
|
|
1326
1334
|
if (n || !e) return;
|
|
1327
|
-
if (e.type ===
|
|
1335
|
+
if (e.type === C.Function) {
|
|
1328
1336
|
const r = t(e.value);
|
|
1329
1337
|
if (r) {
|
|
1330
1338
|
const i = r.getDeclaration().getParameters(), l = e.inputs;
|
|
1331
1339
|
if (i.length > 0 && l) {
|
|
1332
1340
|
const e = ((e, t) => {
|
|
1333
|
-
const n = new Array(t), r = e.length, i = r > 0 ?
|
|
1341
|
+
const n = new Array(t), r = e.length, i = r > 0 ? st(e) : -1;
|
|
1334
1342
|
if (i < 0) {
|
|
1335
1343
|
const i = r > 0 ? e[r - 1] : null, l = !!i && i.isRest();
|
|
1336
1344
|
for (let s = 0; s < t; s++) n[s] = s < r ? e[s] : l ? i : null;
|
|
1337
1345
|
return n;
|
|
1338
1346
|
}
|
|
1339
|
-
const l = e[i].getRepeatingTypes(), s = l.length, o = i, a =
|
|
1347
|
+
const l = e[i].getRepeatingTypes(), s = l.length, o = i, a = ot(e, i, t), u = a ? a.suffix : r - i - 1, c = Math.max(0, t - o - u);
|
|
1340
1348
|
for (let a = 0; a < t; a++) if (a < o) n[a] = e[a];
|
|
1341
1349
|
else if (a < o + c) n[a] = l[(a - o) % s];
|
|
1342
1350
|
else {
|
|
@@ -1347,7 +1355,7 @@ var Xe = Object.freeze([
|
|
|
1347
1355
|
})(i, l.length);
|
|
1348
1356
|
for (let r = 0; r < l.length && !n; r++) {
|
|
1349
1357
|
const i = e[r];
|
|
1350
|
-
i && "p" === i.getRangeType() &&
|
|
1358
|
+
i && "p" === i.getRangeType() && rt(l[r], t) && (n = l[r]);
|
|
1351
1359
|
}
|
|
1352
1360
|
}
|
|
1353
1361
|
}
|
|
@@ -1356,42 +1364,42 @@ var Xe = Object.freeze([
|
|
|
1356
1364
|
if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
|
|
1357
1365
|
};
|
|
1358
1366
|
return r(e), n;
|
|
1359
|
-
},
|
|
1367
|
+
}, ft = (e, t) => {
|
|
1360
1368
|
if (!e) return null;
|
|
1361
1369
|
let n = null;
|
|
1362
1370
|
const r = (e) => {
|
|
1363
1371
|
if (n || !e) return;
|
|
1364
|
-
if (e.type ===
|
|
1372
|
+
if (e.type === C.Call) {
|
|
1365
1373
|
const r = e.inputs?.[0];
|
|
1366
|
-
if (r &&
|
|
1374
|
+
if (r && rt(r, t)) return void (n = "This expression always produces a value, so it cannot be called as a function.");
|
|
1367
1375
|
}
|
|
1368
1376
|
const i = e.inputs;
|
|
1369
1377
|
if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
|
|
1370
1378
|
};
|
|
1371
1379
|
return r(e), n;
|
|
1372
|
-
},
|
|
1373
|
-
if (e.type !==
|
|
1380
|
+
}, pt = (e, t) => {
|
|
1381
|
+
if (e.type !== C.Function) return;
|
|
1374
1382
|
const n = e.value;
|
|
1375
1383
|
if ("string" != typeof n) return;
|
|
1376
1384
|
const r = (t?.(n)?.getName() ?? n).toUpperCase();
|
|
1377
1385
|
return "LET" === r ? "let" : "LAMBDA" === r ? "lambda" : void 0;
|
|
1378
|
-
},
|
|
1379
|
-
if (e?.type !==
|
|
1386
|
+
}, dt = (e) => {
|
|
1387
|
+
if (e?.type !== C.Named) return;
|
|
1380
1388
|
const t = e.value;
|
|
1381
1389
|
return t?.nameId && !t.scope && !0 !== t.optional ? t.nameId : void 0;
|
|
1382
|
-
},
|
|
1383
|
-
if (e?.type ===
|
|
1390
|
+
}, gt = /^[A-Za-z_\\][A-Za-z0-9_\\]*$/, vt = /* @__PURE__ */ new Set(["TRUE", "FALSE"]), ht = (e) => {
|
|
1391
|
+
if (e?.type === C.Named) {
|
|
1384
1392
|
const t = e.value;
|
|
1385
1393
|
if (!0 !== t?.optional || !t.nameId || t.scope) return;
|
|
1386
1394
|
return t.nameId;
|
|
1387
1395
|
}
|
|
1388
|
-
if (e?.type !==
|
|
1396
|
+
if (e?.type !== C.TableReference) return;
|
|
1389
1397
|
const t = e.value;
|
|
1390
1398
|
let n;
|
|
1391
1399
|
if (null === t || "string" == typeof t) {
|
|
1392
1400
|
if (t) return;
|
|
1393
1401
|
const r = e.inputs;
|
|
1394
|
-
if (!r || 1 !== r.length || r[0]?.type !==
|
|
1402
|
+
if (!r || 1 !== r.length || r[0]?.type !== C.TableColumn) return;
|
|
1395
1403
|
const i = r[0].value;
|
|
1396
1404
|
if ("string" != typeof i) return;
|
|
1397
1405
|
n = i;
|
|
@@ -1401,29 +1409,29 @@ var Xe = Object.freeze([
|
|
|
1401
1409
|
if (!e.columnFromId || e.columnFromId !== e.columnToId) return;
|
|
1402
1410
|
n = e.columnFromId;
|
|
1403
1411
|
}
|
|
1404
|
-
return
|
|
1405
|
-
},
|
|
1406
|
-
const t =
|
|
1412
|
+
return gt.test(n) && !vt.has(n.toUpperCase()) && e.image === `[${n}]` ? n : void 0;
|
|
1413
|
+
}, mt = (e) => {
|
|
1414
|
+
const t = o(e.image ?? e.value);
|
|
1407
1415
|
t.image = e.image ?? e.value, t.wsBefore = e.wsBefore;
|
|
1408
1416
|
const n = {
|
|
1409
|
-
type:
|
|
1417
|
+
type: C.Call,
|
|
1410
1418
|
value: null,
|
|
1411
1419
|
inputs: [t, ...e.inputs ?? []],
|
|
1412
1420
|
wsAfter: e.wsAfter
|
|
1413
1421
|
};
|
|
1414
1422
|
return e.error && (n.error = e.error), n;
|
|
1415
1423
|
};
|
|
1416
|
-
function
|
|
1417
|
-
return e && t ?
|
|
1418
|
-
if (e.type ===
|
|
1424
|
+
function yt(e, t) {
|
|
1425
|
+
return e && t ? y(e, (e) => {
|
|
1426
|
+
if (e.type === C.Function && "string" == typeof e.value && !t(e.value)) return mt(e);
|
|
1419
1427
|
}) : e;
|
|
1420
1428
|
}
|
|
1421
|
-
function
|
|
1429
|
+
function It(e, t) {
|
|
1422
1430
|
const n = t.name.toUpperCase(), r = e ? e.filter((e) => e.name.toUpperCase() !== n) : [];
|
|
1423
1431
|
return r.push(t), r;
|
|
1424
1432
|
}
|
|
1425
|
-
function
|
|
1426
|
-
if (e?.type !==
|
|
1433
|
+
function bt(e) {
|
|
1434
|
+
if (e?.type !== C.Function || "lambda" !== e.binder?.kind) return;
|
|
1427
1435
|
const t = e.inputs ?? [], n = [];
|
|
1428
1436
|
for (let e = 0; e < t.length - 1; e++) {
|
|
1429
1437
|
const r = t[e];
|
|
@@ -1436,19 +1444,19 @@ function It(e) {
|
|
|
1436
1444
|
}
|
|
1437
1445
|
return n;
|
|
1438
1446
|
}
|
|
1439
|
-
var
|
|
1447
|
+
var xt = /* @__PURE__ */ new Set([
|
|
1440
1448
|
"IF",
|
|
1441
1449
|
"IFERROR",
|
|
1442
1450
|
"IFNA"
|
|
1443
1451
|
]);
|
|
1444
|
-
function
|
|
1445
|
-
if (!e || e.type !==
|
|
1452
|
+
function Rt(e, t) {
|
|
1453
|
+
if (!e || e.type !== C.Function || "string" != typeof e.value) return e;
|
|
1446
1454
|
const n = (t?.(e.value)?.getName() ?? e.value).toUpperCase();
|
|
1447
|
-
if (!
|
|
1455
|
+
if (!xt.has(n)) return e;
|
|
1448
1456
|
const r = e.inputs;
|
|
1449
1457
|
let i;
|
|
1450
1458
|
if (r) for (let e = 0; e < r.length; e++) {
|
|
1451
|
-
const n =
|
|
1459
|
+
const n = Rt(r[e], t);
|
|
1452
1460
|
n !== r[e] && ((i ??= [...r])[e] = n);
|
|
1453
1461
|
}
|
|
1454
1462
|
return {
|
|
@@ -1457,7 +1465,7 @@ function xt(e, t) {
|
|
|
1457
1465
|
passOmitted: !0
|
|
1458
1466
|
};
|
|
1459
1467
|
}
|
|
1460
|
-
function
|
|
1468
|
+
function Et(e, t = null) {
|
|
1461
1469
|
if (!e) return e;
|
|
1462
1470
|
const n = [];
|
|
1463
1471
|
let r = 0;
|
|
@@ -1477,15 +1485,15 @@ function Rt(e, t = null) {
|
|
|
1477
1485
|
} : e;
|
|
1478
1486
|
}, l = (e) => {
|
|
1479
1487
|
if (!e) return e;
|
|
1480
|
-
const s =
|
|
1488
|
+
const s = pt(e, t);
|
|
1481
1489
|
if (s) return ((e, s) => {
|
|
1482
1490
|
const o = e.inputs, a = o?.length ?? 0;
|
|
1483
1491
|
if (!o || a < 1) return i(e);
|
|
1484
1492
|
const u = n.length, c = [], f = [...o], p = (e, t = !1) => {
|
|
1485
1493
|
const i = f[e];
|
|
1486
|
-
let l =
|
|
1494
|
+
let l = dt(i), s = !1;
|
|
1487
1495
|
if (void 0 === l && t) {
|
|
1488
|
-
if (l =
|
|
1496
|
+
if (l = ht(i), void 0 === l) return;
|
|
1489
1497
|
s = !0;
|
|
1490
1498
|
} else if (void 0 === l) return;
|
|
1491
1499
|
const o = r++;
|
|
@@ -1495,7 +1503,7 @@ function Rt(e, t = null) {
|
|
|
1495
1503
|
name: l
|
|
1496
1504
|
}), c.push(o), f[e] = s ? {
|
|
1497
1505
|
...i,
|
|
1498
|
-
type:
|
|
1506
|
+
type: C.Named,
|
|
1499
1507
|
value: {
|
|
1500
1508
|
nameId: l,
|
|
1501
1509
|
scope: null
|
|
@@ -1520,7 +1528,7 @@ function Rt(e, t = null) {
|
|
|
1520
1528
|
for (let e = 0; e < a - 1; e++) p(e, !0);
|
|
1521
1529
|
f[a - 1] && (f[a - 1] = l(f[a - 1]));
|
|
1522
1530
|
} else {
|
|
1523
|
-
for (let e = 0; e + 1 < a; e += 2) f[e + 1] && (f[e + 1] =
|
|
1531
|
+
for (let e = 0; e + 1 < a; e += 2) f[e + 1] && (f[e + 1] = Rt(l(f[e + 1]), t)), p(e);
|
|
1524
1532
|
a % 2 == 1 && f[a - 1] && (f[a - 1] = l(f[a - 1]));
|
|
1525
1533
|
}
|
|
1526
1534
|
for (; n.length > u;) n.pop();
|
|
@@ -1533,22 +1541,22 @@ function Rt(e, t = null) {
|
|
|
1533
1541
|
}
|
|
1534
1542
|
};
|
|
1535
1543
|
})(e, s);
|
|
1536
|
-
if (e.type ===
|
|
1544
|
+
if (e.type === C.Function && "string" == typeof e.value) {
|
|
1537
1545
|
const r = e.value.toUpperCase();
|
|
1538
|
-
if (n.some((e) => e.key === r) && !t?.(e.value)) return i(
|
|
1546
|
+
if (n.some((e) => e.key === r) && !t?.(e.value)) return i(mt(e));
|
|
1539
1547
|
}
|
|
1540
1548
|
if (n.length > 0 && e.isReference && ":" === e.value && 2 === e.inputs?.length) {
|
|
1541
1549
|
const [t, r] = e.inputs;
|
|
1542
|
-
if (
|
|
1550
|
+
if (Tt(t) && Tt(r)) {
|
|
1543
1551
|
const l = t.image.toUpperCase(), s = r.image.toUpperCase();
|
|
1544
1552
|
if (n.some((e) => e.key === l || e.key === s)) return i({
|
|
1545
1553
|
...e,
|
|
1546
|
-
inputs: [
|
|
1554
|
+
inputs: [At(t), At(r)]
|
|
1547
1555
|
});
|
|
1548
1556
|
}
|
|
1549
1557
|
}
|
|
1550
|
-
if (e.type ===
|
|
1551
|
-
const t =
|
|
1558
|
+
if (e.type === C.Named) {
|
|
1559
|
+
const t = dt(e);
|
|
1552
1560
|
if (void 0 !== t) {
|
|
1553
1561
|
const r = t.toUpperCase();
|
|
1554
1562
|
for (let i = n.length - 1; i >= 0; i--) {
|
|
@@ -1567,7 +1575,7 @@ function Rt(e, t = null) {
|
|
|
1567
1575
|
return e;
|
|
1568
1576
|
}
|
|
1569
1577
|
const o = i(e);
|
|
1570
|
-
if (o.type ===
|
|
1578
|
+
if (o.type === C.Function && "string" == typeof o.value && "ISOMITTED" === (t?.(o.value)?.getName() ?? o.value).toUpperCase()) {
|
|
1571
1579
|
const e = o.inputs;
|
|
1572
1580
|
if (e) {
|
|
1573
1581
|
let n;
|
|
@@ -1580,7 +1588,7 @@ function Rt(e, t = null) {
|
|
|
1580
1588
|
};
|
|
1581
1589
|
continue;
|
|
1582
1590
|
}
|
|
1583
|
-
const l =
|
|
1591
|
+
const l = Rt(i, t);
|
|
1584
1592
|
l !== i && ((n ??= [...e])[r] = l);
|
|
1585
1593
|
}
|
|
1586
1594
|
if (n) return {
|
|
@@ -1593,54 +1601,54 @@ function Rt(e, t = null) {
|
|
|
1593
1601
|
};
|
|
1594
1602
|
return l(e);
|
|
1595
1603
|
}
|
|
1596
|
-
var
|
|
1597
|
-
if (e?.type !==
|
|
1604
|
+
var Tt = (e) => {
|
|
1605
|
+
if (e?.type !== C.Cell || void 0 === e.image) return !1;
|
|
1598
1606
|
const t = e.value;
|
|
1599
1607
|
return t.rowIndex === Number.MIN_SAFE_INTEGER && !0 !== t.$colIndex && !t.scope;
|
|
1600
|
-
},
|
|
1601
|
-
const t =
|
|
1602
|
-
return
|
|
1603
|
-
},
|
|
1608
|
+
}, At = (e) => {
|
|
1609
|
+
const t = o(e.image);
|
|
1610
|
+
return F(t, e), t;
|
|
1611
|
+
}, St = (e) => e?.type === C.Cell, wt = (e, t = null) => {
|
|
1604
1612
|
if (!e) return e;
|
|
1605
1613
|
let n = !1;
|
|
1606
1614
|
const r = (e) => {
|
|
1607
1615
|
if (n || !e) return;
|
|
1608
|
-
const i =
|
|
1616
|
+
const i = pt(e, t), l = e.inputs;
|
|
1609
1617
|
if (i && l) {
|
|
1610
1618
|
const e = "let" === i ? 2 : 1;
|
|
1611
|
-
for (let t = 0; t < l.length - 1; t += e) if (
|
|
1619
|
+
for (let t = 0; t < l.length - 1; t += e) if (St(l[t])) return void (n = !0);
|
|
1612
1620
|
}
|
|
1613
1621
|
if (l) for (let e = 0; e < l.length && !n; e++) r(l[e]);
|
|
1614
1622
|
};
|
|
1615
1623
|
if (r(e), !n) return e;
|
|
1616
1624
|
let i = null;
|
|
1617
|
-
const l =
|
|
1618
|
-
if (e?.type !==
|
|
1625
|
+
const l = y(e, (e) => {
|
|
1626
|
+
if (e?.type !== C.Cell) return;
|
|
1619
1627
|
const t = e.value, n = e.image;
|
|
1620
1628
|
if (!0 === t?.$colIndex || !0 === t?.$rowIndex) return void (i ??= `'${n ?? "a reference"}' cannot be absolute here. A LET/LAMBDA name that is a cell reference makes every reference in the formula a name, and a name cannot contain '$'.`);
|
|
1621
1629
|
if (void 0 === n) return;
|
|
1622
|
-
const r =
|
|
1623
|
-
|
|
1630
|
+
const r = o(n);
|
|
1631
|
+
F(r, e);
|
|
1624
1632
|
const l = t?.scope;
|
|
1625
1633
|
return l && (r.value.scope = l, r.value.scopeImage = t.scopeImage), r;
|
|
1626
1634
|
});
|
|
1627
1635
|
return i ?? l;
|
|
1628
|
-
},
|
|
1636
|
+
}, Ct = (e, t) => {
|
|
1629
1637
|
if (!e) return null;
|
|
1630
1638
|
let n = null;
|
|
1631
1639
|
const r = (e) => {
|
|
1632
1640
|
if (n || !e) return;
|
|
1633
|
-
const i =
|
|
1641
|
+
const i = pt(e, t);
|
|
1634
1642
|
i && ((e, t) => {
|
|
1635
1643
|
const r = "let" === t ? "LET" : "LAMBDA", i = e.inputs, l = i?.length ?? 0;
|
|
1636
1644
|
if (!i || l < 2) return;
|
|
1637
1645
|
if ("let" === t && l % 2 == 0) return void (n = `Wrong number of arguments for LET. Expected name/value pairs followed by a calculation, but got ${l}.`);
|
|
1638
|
-
if ("lambda" === t && i[l - 1]?.type ===
|
|
1646
|
+
if ("lambda" === t && i[l - 1]?.type === C.Empty) return void (n = "LAMBDA has no calculation: the last argument is empty.");
|
|
1639
1647
|
const s = /* @__PURE__ */ new Set(), o = "let" === t ? 2 : 1;
|
|
1640
1648
|
let a = !1;
|
|
1641
1649
|
for (let e = 0; e < l - 1; e += o) {
|
|
1642
|
-
let l =
|
|
1643
|
-
if (void 0 === l && "lambda" === t) l =
|
|
1650
|
+
let l = dt(i[e]);
|
|
1651
|
+
if (void 0 === l && "lambda" === t) l = ht(i[e]), void 0 !== l && (a = !0);
|
|
1644
1652
|
else if (void 0 !== l && a) return void (n = `Required name '${l}' cannot follow an optional name in ${r}.`);
|
|
1645
1653
|
if (void 0 === l) return void (n = `Expected a name in ${r} argument ${e + 1}; a name cannot be the output of a formula.`);
|
|
1646
1654
|
if (l.includes(".")) return void (n = `Expected a name in ${r} argument ${e + 1}; a name cannot contain '.'.`);
|
|
@@ -1654,109 +1662,109 @@ var Et = (e) => {
|
|
|
1654
1662
|
};
|
|
1655
1663
|
return r(e), n;
|
|
1656
1664
|
};
|
|
1657
|
-
function
|
|
1658
|
-
const
|
|
1659
|
-
let
|
|
1660
|
-
const
|
|
1665
|
+
function Nt(e, t, n, r, i) {
|
|
1666
|
+
const l = r;
|
|
1667
|
+
let o;
|
|
1668
|
+
const a = () => (void 0 === o && (o = i && n ? t.bind(x.Table, "", { at: {
|
|
1661
1669
|
scope: n,
|
|
1662
|
-
rowIndex:
|
|
1663
|
-
colIndex:
|
|
1664
|
-
} }) : null),
|
|
1665
|
-
return
|
|
1666
|
-
let
|
|
1667
|
-
const
|
|
1668
|
-
if (
|
|
1670
|
+
rowIndex: i.rowIndex,
|
|
1671
|
+
colIndex: i.colIndex
|
|
1672
|
+
} }) : null), o);
|
|
1673
|
+
return y(e, (e, r, i = []) => {
|
|
1674
|
+
let o;
|
|
1675
|
+
const u = e.type;
|
|
1676
|
+
if (u === C.Cell) {
|
|
1669
1677
|
const n = e.value;
|
|
1670
1678
|
if (n?.scope) {
|
|
1671
|
-
const r = t.bind(
|
|
1672
|
-
null !== r && (
|
|
1679
|
+
const r = t.bind(x.Sheet, n.scope, l);
|
|
1680
|
+
null !== r && (o || (o = { ...e }), o.value = {
|
|
1673
1681
|
...n,
|
|
1674
1682
|
scope: r
|
|
1675
1683
|
});
|
|
1676
1684
|
}
|
|
1677
|
-
} else if (
|
|
1685
|
+
} else if (u === C.Named) {
|
|
1678
1686
|
const r = e.value;
|
|
1679
1687
|
if (r && !e.binding) {
|
|
1680
|
-
const
|
|
1688
|
+
const i = function(e, t, n, r) {
|
|
1681
1689
|
if (t.scope) {
|
|
1682
|
-
const e = n.bind(
|
|
1683
|
-
if (null === e ||
|
|
1690
|
+
const e = n.bind(x.Sheet, t.scope, r);
|
|
1691
|
+
if (null === e || s(e)) return;
|
|
1684
1692
|
}
|
|
1685
|
-
const
|
|
1686
|
-
if (null ===
|
|
1687
|
-
const
|
|
1688
|
-
type:
|
|
1689
|
-
value:
|
|
1693
|
+
const i = n.bind(x.Table, t.nameId, { existing: !0 });
|
|
1694
|
+
if (null === i) return;
|
|
1695
|
+
const l = {
|
|
1696
|
+
type: C.TableReference,
|
|
1697
|
+
value: i,
|
|
1690
1698
|
inputs: null,
|
|
1691
1699
|
isReference: !0
|
|
1692
1700
|
};
|
|
1693
|
-
|
|
1694
|
-
const
|
|
1695
|
-
return "string" == typeof
|
|
1696
|
-
}(e, r, t,
|
|
1697
|
-
if (
|
|
1698
|
-
const
|
|
1699
|
-
null ===
|
|
1701
|
+
F(l, e);
|
|
1702
|
+
const o = t.scopeImage;
|
|
1703
|
+
return "string" == typeof o && void 0 !== e.image && (l.image = o + e.image), l;
|
|
1704
|
+
}(e, r, t, l);
|
|
1705
|
+
if (i) return i;
|
|
1706
|
+
const a = r.scope ? t.bind(x.Sheet, r.scope, l) : null, u = (null !== a ? s(a) ? a : t.resolve(x.Sheet, a)?.toString() ?? r.scope : r.scope) ?? n, c = t.bind(x.NamedFormula, r.nameId, u ? { scope: u } : void 0);
|
|
1707
|
+
null === c && null === a || (o || (o = { ...e }), o.value = {
|
|
1700
1708
|
...r,
|
|
1701
|
-
nameId:
|
|
1702
|
-
...null !==
|
|
1709
|
+
nameId: c ?? r.nameId,
|
|
1710
|
+
...null !== a ? { scope: a } : void 0
|
|
1703
1711
|
});
|
|
1704
1712
|
}
|
|
1705
|
-
} else if (
|
|
1713
|
+
} else if (u === C.Error) {
|
|
1706
1714
|
const n = e.value;
|
|
1707
1715
|
if (n?.scope) {
|
|
1708
|
-
const r = t.bind(
|
|
1709
|
-
null !== r && (
|
|
1716
|
+
const r = t.bind(x.Sheet, n.scope, l);
|
|
1717
|
+
null !== r && (o || (o = { ...e }), o.value = {
|
|
1710
1718
|
...n,
|
|
1711
1719
|
scope: r
|
|
1712
1720
|
});
|
|
1713
1721
|
}
|
|
1714
|
-
} else if (
|
|
1722
|
+
} else if (u === C.TableReference) {
|
|
1715
1723
|
const n = e.value;
|
|
1716
1724
|
if (n) {
|
|
1717
|
-
const r = t.bind(
|
|
1718
|
-
|
|
1725
|
+
const r = t.bind(x.Table, n);
|
|
1726
|
+
o || (o = { ...e }), null !== r && (o.value = r);
|
|
1719
1727
|
} else if ("string" == typeof n) {
|
|
1720
|
-
const n =
|
|
1721
|
-
if (null !== n &&
|
|
1728
|
+
const n = a();
|
|
1729
|
+
if (null !== n && Ft(e, t)) return {
|
|
1722
1730
|
...e,
|
|
1723
1731
|
value: n
|
|
1724
1732
|
};
|
|
1725
1733
|
}
|
|
1726
|
-
} else if (
|
|
1734
|
+
} else if (u === C.TableColumn) {
|
|
1727
1735
|
const n = e.value;
|
|
1728
1736
|
if (n) {
|
|
1729
|
-
const r = pe(
|
|
1730
|
-
|
|
1737
|
+
const r = pe(i, C.TableReference), l = r?.value || (r ? a() ?? void 0 : void 0), s = t.bind(x.TableColumn, n, l ? { tableName: l } : void 0);
|
|
1738
|
+
o || (o = { ...e }), null !== s && (o.value = s);
|
|
1731
1739
|
}
|
|
1732
|
-
} else if (
|
|
1740
|
+
} else if (u === C.Function) {
|
|
1733
1741
|
const n = e.value;
|
|
1734
1742
|
if (n) {
|
|
1735
|
-
const r = t.bind(
|
|
1736
|
-
|
|
1743
|
+
const r = t.bind(x.Function, n);
|
|
1744
|
+
o || (o = { ...e }), null !== r && (o.value = r);
|
|
1737
1745
|
}
|
|
1738
1746
|
}
|
|
1739
|
-
return
|
|
1747
|
+
return o;
|
|
1740
1748
|
});
|
|
1741
1749
|
}
|
|
1742
|
-
function
|
|
1750
|
+
function Ft(e, t) {
|
|
1743
1751
|
let n = !0;
|
|
1744
1752
|
const r = e.inputs;
|
|
1745
1753
|
if (!r) return !0;
|
|
1746
|
-
for (let e = 0; e < r.length && n; e++)
|
|
1747
|
-
e.type ===
|
|
1754
|
+
for (let e = 0; e < r.length && n; e++) y(r[e], (e) => {
|
|
1755
|
+
e.type === C.TableColumn && null === t.resolve(x.TableColumn, e.value) && (n = !1);
|
|
1748
1756
|
});
|
|
1749
1757
|
return n;
|
|
1750
1758
|
}
|
|
1751
|
-
function
|
|
1759
|
+
function Pt(e, t) {
|
|
1752
1760
|
let n = null;
|
|
1753
|
-
return
|
|
1754
|
-
if (n || e.type !==
|
|
1761
|
+
return y(e, (e) => {
|
|
1762
|
+
if (n || e.type !== C.TableReference) return;
|
|
1755
1763
|
if ("" === e.value) return void (n = "A structured reference without a table name must be in a table that has its columns.");
|
|
1756
1764
|
const r = e.value;
|
|
1757
1765
|
if (!t || "string" != typeof r) return;
|
|
1758
|
-
const
|
|
1759
|
-
null === t.bind(
|
|
1766
|
+
const i = t.resolve(x.Table, r)?.toString() ?? r;
|
|
1767
|
+
null === t.bind(x.Table, i, { existing: !0 }) ? n = `There is no table named '${i}'.` : Ft(e, t) || (n = "The table has no such column.");
|
|
1760
1768
|
}), n;
|
|
1761
1769
|
}
|
|
1762
|
-
export { ce as A, Re as C, ve as D,
|
|
1770
|
+
export { ce as A, Re as C, ve as D, yt as E, ae as O, Ze as S, ye as T, et as _, He as a, je as b, ft as c, it as d, Pt as f, he as g, ge as h, Ie as i, ue as j, fe as k, at as l, Xe as m, It as n, ut as o, ct as p, Et as r, Ct as s, We as t, lt as u, Nt as v, wt as w, be as x, me as y };
|