@sheetxl/sdk 0.8.0-beta.12 → 0.8.0-beta.14
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/{CBYMTDzMf1Vh7pkw.mjs → 3t4S9eda2I6jFad0.mjs} +1 -1
- package/browser/esm/{Bg5Di9GLNAkbqQ1P.mjs → AXlD9K1gCwPU4gCO.mjs} +1926 -1298
- package/browser/esm/{w6Jea0TiclPrYZ2M.mjs → B1aH_qa-czVyEVHd.mjs} +509 -509
- package/browser/esm/{DZiivy0NmO1Vnyzk.mjs → BEDfJP2tcuRy2Y2E.mjs} +2 -2
- package/browser/esm/{BdCJNawfifyPupCP.mjs → BLYl-afJe_3std8i.mjs} +1 -1
- package/browser/esm/{D2RZh0O9neOsyLAE.mjs → BPPMKyMn65i1a1mE.mjs} +69 -48
- package/browser/esm/{yuhcOYw6SHQ-RCm3.mjs → BSXQAXwZdJKYTO4P.mjs} +30 -30
- package/browser/esm/{-Jx-jNHmtIQQfLvK.mjs → BVqIknGhQCLUB_7Q.mjs} +1 -1
- package/browser/esm/{fXWUMDhZ5yMSO629.mjs → BWoz4kQdA5KKJfl6.mjs} +1 -1
- package/browser/esm/{DwwR3O2sEZApPSTF.mjs → Bdcd3QOzsc0aVMjN.mjs} +3 -3
- package/browser/esm/{2mIwPy2D2JUX-9wx.mjs → BpwULQPKbb4R9Jew.mjs} +2 -2
- package/browser/esm/{CwOPLXU3-9ZHGyOT.mjs → C7hpfT-sX2lyLS-D.mjs} +1 -1
- package/browser/esm/{BIHrHjRGWVlJglcp.mjs → CImFKFaYToUH-bSE.mjs} +2 -2
- package/browser/esm/{BTFBedJMRWGvZyCE.mjs → CM_X1zZYzEUPaNJL.mjs} +1 -1
- package/browser/esm/CPIWV3Enlh_BF2TY.mjs +19 -0
- package/browser/esm/{CndRBvVfQUJIYRRj.mjs → ChYgQL-8qIDFmX31.mjs} +50 -50
- package/browser/esm/{BudSIfXBAsTxvu-K.mjs → CtC__ALh4I8PKIln.mjs} +10071 -9246
- package/browser/esm/{qO-ujUrgq6H3TQix.mjs → Cy8uYCggktF83278.mjs} +1 -1
- package/browser/esm/D2NFcBM4xsv0JJ1q.mjs +184 -0
- package/browser/esm/{D9xNz46kAfXMZzp4.mjs → D39XcmtPXVtMN4yF.mjs} +2 -2
- package/browser/esm/{CdEO8CEee6lEhabA.mjs → DBvu0tdSf-5vol4e.mjs} +2 -2
- package/browser/esm/{Tah7cnFb_HNZdLtj.mjs → DIfAk63CvaOZ3QKi.mjs} +3 -3
- package/browser/esm/{B3wf5vZCsWfWsDbj.mjs → D_XMi4_5iO2rkET5.mjs} +1 -1
- package/browser/esm/{DgrAuRD2qr2DvFeJ.mjs → Dh84MDs-OhdCPCIg.mjs} +44 -44
- package/browser/esm/{DPhGQLNGmDZwODwJ.mjs → Dhw5XEJYFrkYjdU2.mjs} +94 -94
- package/browser/esm/{Cxjxk0ncRKx80I-w.mjs → DiXeQjc0WJGLSVEo.mjs} +1 -1
- package/browser/esm/DnR0xY7_iE3TmMcg.mjs +348 -0
- package/browser/esm/{DK899HhWX1HINMC1.mjs → DnqwX3-2NfGBaXXl.mjs} +25 -25
- package/browser/esm/{D64dM68B1pKYFzdP.mjs → DonQz2Tc3k9lNT8E.mjs} +2 -2
- package/browser/esm/{Bt8_m94tBdks209L.mjs → DvvqmUQ9Z0NFm1-4.mjs} +1 -1
- package/browser/esm/{BnC4-27Igwb8oDf2.mjs → Ln4gsmhqH1LyoANj.mjs} +44 -43
- package/browser/esm/{CUzYuYTTGsChC_kZ.mjs → MuNBN02MyZ558c_K.mjs} +2052 -1583
- package/browser/esm/{CRkYR-siY2C994KV.mjs → SwLp-iElwDjfcJtv.mjs} +1 -1
- package/browser/esm/{C9u8FUewte5ugUjH.mjs → UMQTbO0zNmBpzW1V.mjs} +725 -716
- package/browser/esm/aRXqxIzjuSLwawMh.mjs +18 -0
- package/browser/esm/index.mjs +482 -440
- package/browser/esm/{hCQJcmIzPDxDEv2q.mjs → oSCy1X5CJ1iYtGDp.mjs} +2 -2
- package/browser/esm/{DobHLF6VjHr7Xi40.mjs → qCqzZW74-fhaIG2V.mjs} +1 -1
- package/browser/esm/{CNdjyofiRu6CYOrr.mjs → r_EZapMBdyS4gUd-.mjs} +50 -48
- package/browser/esm/yuF8SbWfjBfrxcq5.mjs +367 -0
- package/licenses/dependencies.txt +71 -1
- package/node/esm/99miMotf3dOuG5Jk.mjs +372 -0
- package/node/esm/{-TA0MneBDKdGhsib.mjs → B3hBxzqJ2_hUylNr.mjs} +3329 -2852
- package/node/esm/{BNXLOEddJ6O9gYws.mjs → B5VmOC0jO9Zbh9Mq.mjs} +2 -2
- package/node/esm/{DhS6yWjrrSNIJMsn.mjs → B6jhx5pHPs2W5GE7.mjs} +234 -225
- package/node/esm/{DUTmDHbFbhLDT4F3.mjs → BCjHRVU8tC5lYypg.mjs} +1 -1
- package/node/esm/BEBt5fo__rvT2q_u.mjs +310 -0
- package/node/esm/{icn2nX5Z8e_3mNAv.mjs → BELc5aQ_pFPgbiso.mjs} +1 -1
- package/node/esm/{DrCf6ITcBhVOFpRj.mjs → BEdxa3I4VOiCsvy7.mjs} +7 -7
- package/node/esm/{D3ptRKzASqBut1DE.mjs → BLPrFp_jKGYgWPX1.mjs} +2 -2
- package/node/esm/{BskP3b8vUoIOGLY6.mjs → BSVttk12GXNfKZ9k.mjs} +2 -2
- package/node/esm/{D4ROK9UwDpS6jO3Z.mjs → BXg-D8Rc_iyB8p7X.mjs} +1 -1
- package/node/esm/{DV5CU37aEbFbWFL0.mjs → BfEdeOg4iYXaYTlh.mjs} +1 -1
- package/node/esm/BuyAYLI4s33-vmgG.mjs +18 -0
- package/node/esm/{C_xf5Bz30VqiJjXn.mjs → C-5JLSNof0FhkuFd.mjs} +1 -1
- package/node/esm/{eimUGjiIP-b8HiM6.mjs → C3S4hF1vn0NyJPPd.mjs} +52 -52
- package/node/esm/{BL2iiEoqxDEV2Xrg.mjs → CI8UIWR01z9QDlzH.mjs} +3348 -2610
- package/node/esm/{pYtP7wPyS96NQyXS.mjs → CPsGyt3vnOdLTShj.mjs} +25 -25
- package/node/esm/{CG-qBU5BAaVz7e-P.mjs → Ccocd9DTvOnlOE9D.mjs} +1 -1
- package/node/esm/{C14-R6tifRh7pc0p.mjs → CdSTmD2ZvG9NesNR.mjs} +1 -1
- package/node/esm/{Q_S1g46ZOTrdhTae.mjs → Crn6dnSQQRCQAnQ-.mjs} +1 -1
- package/node/esm/{DdoiuKg9BKubtF1V.mjs → Cyeq1rDslIqF1LKz.mjs} +1 -1
- package/node/esm/{Ci_zLYmCD7e-C79O.mjs → D30rC6AWaGGf3CaC.mjs} +1 -1
- package/node/esm/D4Y1WJgjiFEgbWrW.mjs +115 -0
- package/node/esm/{Vocy-I9dKzZMr0Ct.mjs → DLdXl0O0TXuyqLU4.mjs} +10898 -10685
- package/node/esm/{D8hO07ToAibIuniw.mjs → DbPUG2DcQ3T_QhcJ.mjs} +138 -136
- package/node/esm/{lGJ42sHqg5if2bba.mjs → DeFE8QfuCeGw-mvd.mjs} +458 -458
- package/node/esm/{CiIymQN6aJCul62g.mjs → DiCMnYA2bttmrX3q.mjs} +9 -9
- package/node/esm/{DhTya_mhmN53vskv.mjs → Dlk2ZYExFgQ0xE2H.mjs} +1 -1
- package/node/esm/{Btw4148Ot8ifhNc1.mjs → I-FZojIFWluC6X-j.mjs} +1 -1
- package/node/esm/{C99zzq8DImQXi4BQ.mjs → Lj98EH6coGdKUzuS.mjs} +10 -10
- package/node/esm/{B-HUPAcqvK0eeeCz.mjs → NA-8urR7T1NCwrgD.mjs} +38 -37
- package/node/esm/{DxazKtROyaI51dWl.mjs → YpOpRyciqQLIY1-G.mjs} +1 -1
- package/node/esm/{CkRYLed8Mmn3giNg.mjs → b3XnssSr9lmvAC2N.mjs} +2 -2
- package/node/esm/clgEkmEwfB28nkz2.mjs +351 -0
- package/node/esm/index.mjs +584 -540
- package/node/esm/{CRt3vXe6YmXzqk3H.mjs → pF2vCOTmrxPAB41Q.mjs} +102 -102
- package/node/esm/{CBuEu5Jk-LfaDy-H.mjs → uLrulyR7IXq0SF4j.mjs} +44 -44
- package/node/esm/{C_aL7CGS1lrNn1Ng.mjs → xRGObcoaGDnAZFnj.mjs} +1 -1
- package/package.json +10 -7
- 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 +4 -0
- package/resources/locales/en/model.msg.json +4 -0
- package/types/scripting-api.json +9339 -9320
- package/types/scripting.d.ts +322 -200
- 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/anomalies/_FocusTable.d.ts +0 -6
- package/types/src/calculation/Calculation.d.ts +20 -95
- package/types/src/calculation/ExternalBookBindings.d.ts +0 -26
- package/types/src/calculation/NamedFormulaCollection.d.ts +6 -2
- 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 +0 -13
- 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 +0 -52
- package/types/src/calculation/engine/CalcBackend.d.ts +15 -157
- package/types/src/calculation/engine/index.d.ts +0 -8
- package/types/src/calculation/executor/CalcExecutor.d.ts +13 -130
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +30 -11
- 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 +0 -19
- package/types/src/calculation/formula/FormulaBlock.d.ts +0 -28
- package/types/src/calculation/formula/FormulaRecordView.d.ts +0 -15
- package/types/src/calculation/formula/IFormulaBlock.d.ts +0 -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/grid/CalcGrid.d.ts +5 -59
- package/types/src/calculation/grid/CalcGridBackend.d.ts +8 -9
- package/types/src/calculation/grid/CalcGridProxy.d.ts +0 -13
- package/types/src/calculation/grid/CalcGridUtils.d.ts +18 -22
- package/types/src/calculation/grid/ICalcGrid.d.ts +13 -98
- package/types/src/calculation/grid/_CalcRequest.d.ts +1 -29
- package/types/src/calculation/spatial/CircularEntry.d.ts +0 -10
- package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +52 -82
- package/types/src/calculation/spatial/SpillEntry.d.ts +10 -7
- package/types/src/calculation/state/CalcScope.d.ts +0 -9
- package/types/src/calculation/state/CalcState.d.ts +0 -12
- package/types/src/calculation/state/CalculationContext.d.ts +4 -37
- package/types/src/calculation/state/DeferredCalls.d.ts +11 -64
- package/types/src/calculation/state/IContextContainer.d.ts +4 -60
- package/types/src/calculation/state/_KeepBlanks.d.ts +5 -0
- package/types/src/calculation/state/_PendingOverlayGrid.d.ts +46 -33
- package/types/src/calculation/state/_WhatIfLayer.d.ts +0 -14
- 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 +14 -28
- package/types/src/cellRange/ICellRange.d.ts +22 -11
- 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/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 +0 -19
- package/types/src/chart/resolve/_ResolvedChart.d.ts +0 -6
- 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 +1 -23
- 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 +13 -14
- package/types/src/fetch/IFetcher.d.ts +2 -1
- package/types/src/fetch/_WorkbookFetch.d.ts +1 -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/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/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 +0 -12
- 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/richData/RichDataRegistry.d.ts +6 -0
- package/types/src/scripting/TypedFunction.d.ts +0 -109
- package/types/src/scripting/enumManifest.browser.d.ts +7 -2
- package/types/src/sheet/IWorksheet.d.ts +2 -5
- package/types/src/sheet/NamedCellRange.d.ts +0 -21
- package/types/src/sheet/SheetCell.d.ts +8 -2
- package/types/src/sheet/Worksheet.d.ts +7 -48
- package/types/src/sheet/_DelimitedText.d.ts +13 -0
- package/types/src/sheet/_IgnoredErrors.d.ts +0 -12
- package/types/src/sheet/_ScalarListFactory.d.ts +0 -19
- package/types/src/sheet/_SheetCoords.d.ts +0 -7
- package/types/src/sheet/_SheetFilterUtils.d.ts +0 -8
- package/types/src/sheet/_SheetStateReader.d.ts +0 -10
- package/types/src/sheet/_SheetStateTypes.d.ts +0 -3
- 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/Workbook.d.ts +0 -10
- package/browser/esm/2WuhYrIpYmOR5H73.mjs +0 -698
- package/browser/esm/CTe2qfmIUEad6FJv.mjs +0 -199
- package/browser/esm/CfRqiPDg6RBTg1EN.mjs +0 -367
- package/browser/esm/DVroRnhi-5IDXNgM.mjs +0 -210
- package/browser/esm/DwZCT7DZiiXoTweg.mjs +0 -14
- package/node/esm/BSvOluusoDM4z_dx.mjs +0 -811
- package/node/esm/CPI58duc0j0a-HpJ.mjs +0 -115
- package/node/esm/DggQ23jKMpwhENfa.mjs +0 -372
- package/node/esm/Dn1M7YWi25DeeYUb.mjs +0 -210
- package/node/esm/ZXPFcsT2zrALCZux.mjs +0 -289
|
@@ -1,31 +1,31 @@
|
|
|
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.14
|
|
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 {
|
|
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 "./DLdXl0O0TXuyqLU4.mjs";
|
|
8
|
+
import { nn as P } from "./CI8UIWR01z9QDlzH.mjs";
|
|
9
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, M = (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
13
|
if (t < 0) return L.BuiltIn.Div0;
|
|
14
14
|
if (0 === t) return NaN;
|
|
15
15
|
}
|
|
16
16
|
if (e < 0) {
|
|
17
|
-
if (Number.isInteger(t) && Math.abs(t) <= 4294967294) return
|
|
17
|
+
if (Number.isInteger(t) && Math.abs(t) <= 4294967294) return h(e ** t);
|
|
18
18
|
const n = Number((1 / t).toPrecision(15));
|
|
19
|
-
return Number.isInteger(n) && 1 === Math.abs(n % 2) ?
|
|
19
|
+
return Number.isInteger(n) && 1 === Math.abs(n % 2) ? h(-((-e) ** t)) : NaN;
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return h(e ** t);
|
|
22
22
|
}, G = (e = "", t = "") => {
|
|
23
23
|
null === e && (e = ""), null === t && (t = "");
|
|
24
24
|
const n = typeof t;
|
|
25
25
|
"boolean" === typeof e && (e = r(e)), "boolean" === n && (t = r(t));
|
|
26
26
|
const i = "" + e + t;
|
|
27
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),
|
|
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",
|
|
@@ -45,19 +45,19 @@ var z = (e, t) => e + t, D = (e, t) => e - t, M = (e, t) => T(e + t, e), W = (e,
|
|
|
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 && L.isError(t) ? t : n && L.isError(n) ? n :
|
|
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 (
|
|
53
|
+
if (l(t) || l(n)) return L.BuiltIn.Value;
|
|
54
54
|
if (B(t) || B(n)) return L.BuiltIn.Value;
|
|
55
55
|
if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) && L.isError(t)) return t;
|
|
56
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,
|
|
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?.();
|
|
@@ -70,9 +70,9 @@ var z = (e, t) => e + t, D = (e, t) => e - t, M = (e, t) => T(e + t, e), W = (e,
|
|
|
70
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 && L.isError(e) ? e : t && L.isError(t) ? t : U(e, t),
|
|
75
|
+
return r.broadcast(i, (e, t) => e && L.isError(e) ? e : t && L.isError(t) ? t : U(e, t), Q);
|
|
76
76
|
}, se = (e) => e.getCode() <= L.Code.NA ? e : L.BuiltIn.Value, oe = (e, t, n, r, i) => {
|
|
77
77
|
if (L.isError(t)) return se(t);
|
|
78
78
|
if (n && L.isError(n)) return se(n);
|
|
@@ -93,18 +93,18 @@ var z = (e, t) => e + t, D = (e, t) => e - t, M = (e, t) => T(e + t, e), W = (e,
|
|
|
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, r) => oe(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) => {
|
|
@@ -114,17 +114,17 @@ var z = (e, t) => e + t, D = (e, t) => e - t, M = (e, t) => T(e + t, e), W = (e,
|
|
|
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
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
|
-
">": (e, t, n) => re(e, t, n,
|
|
124
|
+
">": (e, t, n) => re(e, t, n, Z),
|
|
125
125
|
"<": (e, t, n) => re(e, t, n, q),
|
|
126
|
-
">=": (e, t, n) => re(e, t, n,
|
|
127
|
-
"<=": (e, t, n) => re(e, t, n,
|
|
126
|
+
">=": (e, t, n) => re(e, t, n, K),
|
|
127
|
+
"<=": (e, t, n) => re(e, t, n, J)
|
|
128
128
|
}, ue = {
|
|
129
129
|
"+": (e, t, n) => ne(e, t, n, M),
|
|
130
130
|
"-": (e, t, n) => ne(e, t, n, W)
|
|
@@ -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,11 +204,11 @@ var de = class {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
function ge(e, t = !1, r =
|
|
207
|
+
function ge(e, t = !1, r = N) {
|
|
208
208
|
const l = [], s = /* @__PURE__ */ new Set(), o = (e, n, r) => {
|
|
209
209
|
const i = {
|
|
210
210
|
type: e.type,
|
|
211
|
-
value: e.type ===
|
|
211
|
+
value: e.type === C.Error ? R(e.value) : e.value
|
|
212
212
|
};
|
|
213
213
|
void 0 !== e.image && (i.text = ((e) => {
|
|
214
214
|
const n = t ? e.value?.scopeImage : void 0;
|
|
@@ -218,7 +218,7 @@ function ge(e, t = !1, r = A) {
|
|
|
218
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
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,112 +226,112 @@ function ge(e, t = !1, r = A) {
|
|
|
226
226
|
};
|
|
227
227
|
void 0 !== r && (s.evalIndex = r), n && (s.context = n), l.push(s);
|
|
228
228
|
};
|
|
229
|
-
(function e(u,
|
|
230
|
-
const
|
|
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, i), s < l - 1 && a(
|
|
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
235
|
if (u.isLiteral) {
|
|
236
|
-
if (a(
|
|
237
|
-
a(
|
|
236
|
+
if (a(C.Whitespace, u.wsBefore, c, p), d === C.Array) {
|
|
237
|
+
a(C.Type, "{", c, p);
|
|
238
238
|
const t = u.value, n = t.length;
|
|
239
239
|
for (let i = 0; i < n; i++) {
|
|
240
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
|
-
a(
|
|
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
|
-
i < n - 1 && (a(
|
|
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
|
-
u.error || a(
|
|
248
|
-
} else
|
|
249
|
-
type:
|
|
247
|
+
u.error || a(C.Type, "}", c, p);
|
|
248
|
+
} else d === C.String ? (u = {
|
|
249
|
+
type: d,
|
|
250
250
|
value: "\"" + `${u.value}`.replace(/"/g, "\"\"") + "\"",
|
|
251
251
|
image: u.image
|
|
252
|
-
}, o(u,
|
|
253
|
-
a(
|
|
254
|
-
} else if (
|
|
255
|
-
else if (
|
|
256
|
-
else if (
|
|
257
|
-
u.inputs?.[0] && e(u.inputs[0],
|
|
258
|
-
const t = o(u,
|
|
259
|
-
"#" === u.value && void 0 !== t.text && !u.wsBefore && s.has(n) && (n.text = (n.text ?? "") + t.text, t.text = ""), a(
|
|
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
|
-
a(
|
|
262
|
-
const
|
|
263
|
-
switch (
|
|
264
|
-
case
|
|
261
|
+
a(C.Whitespace, u.wsBefore, c, p);
|
|
262
|
+
const f = u.inputs;
|
|
263
|
+
switch (d) {
|
|
264
|
+
case C.Function: {
|
|
265
265
|
const t = String(u.value), n = {
|
|
266
|
-
type:
|
|
266
|
+
type: C.Function,
|
|
267
267
|
value: t,
|
|
268
268
|
text: u.image ?? t,
|
|
269
269
|
evalIndex: u.evalIndex
|
|
270
270
|
};
|
|
271
|
-
|
|
271
|
+
c && (n.context = c), l.push(n);
|
|
272
272
|
const i = {
|
|
273
273
|
name: t,
|
|
274
274
|
argIndex: -1,
|
|
275
275
|
type: u.binder?.kind ?? "function"
|
|
276
276
|
};
|
|
277
|
-
if (
|
|
278
|
-
const t =
|
|
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
279
|
let s = i.bound;
|
|
280
280
|
for (let o = 0; o < t; o++) {
|
|
281
|
-
const u = l && o >= l ?
|
|
281
|
+
const u = l && o >= l ? f[o - l] : void 0;
|
|
282
282
|
if (u?.binding?.declaration) {
|
|
283
|
-
const e = u.value.nameId, t = "let" === n ? bt(
|
|
283
|
+
const e = u.value.nameId, t = "let" === n ? bt(f[o - 1]) : void 0;
|
|
284
284
|
s = It(s, t ? {
|
|
285
285
|
name: e,
|
|
286
286
|
params: t
|
|
287
287
|
} : { name: e });
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const c = {
|
|
290
290
|
...i,
|
|
291
291
|
argIndex: o
|
|
292
292
|
};
|
|
293
|
-
s && (
|
|
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
|
-
u.error || a(
|
|
296
|
+
u.error || a(C.Paren, ")", i, u.evalIndex);
|
|
297
297
|
break;
|
|
298
298
|
}
|
|
299
|
-
case
|
|
299
|
+
case C.Call: {
|
|
300
300
|
const t = i(u), s = l.length;
|
|
301
|
-
if (t && e(t,
|
|
301
|
+
if (t && e(t, c, p), t?.type === C.Named) for (let e = s; e < l.length; e++) {
|
|
302
302
|
const t = l[e];
|
|
303
|
-
t.type !==
|
|
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
305
|
const o = {
|
|
306
|
-
name: t?.type ===
|
|
306
|
+
name: t?.type === C.Named ? t.value.nameId : "",
|
|
307
307
|
argIndex: -1,
|
|
308
308
|
type: "function"
|
|
309
309
|
};
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
for (let t = 0; t <
|
|
310
|
+
c?.bound && (o.bound = c.bound), a(C.Paren, "(", o, u.evalIndex);
|
|
311
|
+
const f = n(u), d = f.length;
|
|
312
|
+
for (let t = 0; t < d; t++) {
|
|
313
313
|
const n = {
|
|
314
314
|
...o,
|
|
315
315
|
argIndex: t
|
|
316
316
|
};
|
|
317
|
-
e(
|
|
317
|
+
e(f[t], n, p), t < d - 1 && a(C.Separator, ",", n, p, r.separatorFunction);
|
|
318
318
|
}
|
|
319
|
-
u.error || a(
|
|
319
|
+
u.error || a(C.Paren, ")", o, u.evalIndex);
|
|
320
320
|
break;
|
|
321
321
|
}
|
|
322
|
-
case
|
|
323
|
-
o(u,
|
|
322
|
+
case C.Cell:
|
|
323
|
+
o(u, c, p);
|
|
324
324
|
break;
|
|
325
|
-
case
|
|
326
|
-
a(
|
|
325
|
+
case C.Paren:
|
|
326
|
+
a(d, "(", c, p), g(f, c, p), u.error || a(d, ")", c, p);
|
|
327
327
|
break;
|
|
328
|
-
case
|
|
328
|
+
case C.TableReference: {
|
|
329
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
|
-
let
|
|
334
|
+
let d, g = !1;
|
|
335
335
|
if (n && o) {
|
|
336
336
|
let e = 0;
|
|
337
337
|
if (91 === o.charCodeAt(0)) {
|
|
@@ -339,138 +339,138 @@ function ge(e, t = !1, r = A) {
|
|
|
339
339
|
-1 !== t && 33 === o.charCodeAt(t + 1) && (e = t + 2);
|
|
340
340
|
}
|
|
341
341
|
const n = o.indexOf("[", e);
|
|
342
|
-
if (
|
|
343
|
-
else if (!
|
|
342
|
+
if (g = 0 === n && null != f, n > 0) d = o.slice(0, n);
|
|
343
|
+
else if (!f) {
|
|
344
344
|
const e = o.lastIndexOf("!");
|
|
345
|
-
|
|
345
|
+
d = t || -1 === e ? o : o.slice(e + 1);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
if (!n ||
|
|
349
|
-
const t =
|
|
348
|
+
if (!n || g && t || a(C.TableReference, n, c, p, d), f && a(C.Paren, "[", r, p), f) {
|
|
349
|
+
const t = f.length;
|
|
350
350
|
for (let n = 0; n < t; n++) {
|
|
351
351
|
const i = {
|
|
352
352
|
...r,
|
|
353
353
|
argIndex: n
|
|
354
354
|
};
|
|
355
|
-
e(
|
|
355
|
+
e(f[n], i, p), n < t - 1 && a(C.Separator, ",", i, p);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
for (let e = i; e < l.length; e++) void 0 !==
|
|
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
|
|
363
|
+
case C.TableSpecifier:
|
|
364
|
+
case C.TableColumn: {
|
|
365
365
|
const e = u.image, t = null != e && e.startsWith("[") && e.endsWith("]");
|
|
366
|
-
t && a(
|
|
366
|
+
t && a(C.Paren, "[", c, p);
|
|
367
367
|
const n = {
|
|
368
|
-
table: "table" ===
|
|
368
|
+
table: "table" === c?.type ? c.name : "",
|
|
369
369
|
name: u.value
|
|
370
370
|
}, r = {
|
|
371
|
-
type:
|
|
371
|
+
type: d,
|
|
372
372
|
value: n,
|
|
373
373
|
text: t ? e.slice(1, -1) : e ?? n.name
|
|
374
374
|
};
|
|
375
|
-
void 0 !==
|
|
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
|
|
379
|
-
|
|
378
|
+
case C.List:
|
|
379
|
+
g(f, c, p);
|
|
380
380
|
break;
|
|
381
|
-
case
|
|
382
|
-
const e = o(u,
|
|
381
|
+
case C.Named: {
|
|
382
|
+
const e = o(u, c, p), t = u.value;
|
|
383
383
|
e.value = t.scope ? {
|
|
384
384
|
name: t.nameId,
|
|
385
385
|
scope: t.scope
|
|
386
|
-
} : { name: t.nameId }, u.binding?.declaration && u.binding.optional && (e.value.optional = !0), u.binding && (e.type =
|
|
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 !== u.value && o(u,
|
|
389
|
+
default: void 0 !== u.value && o(u, c, p), f && f.forEach((t) => e(t, c, p));
|
|
390
390
|
}
|
|
391
|
-
a(
|
|
391
|
+
a(C.Whitespace, u.wsAfter, c, p);
|
|
392
392
|
}
|
|
393
393
|
})(e);
|
|
394
394
|
const u = /* @__PURE__ */ new Map();
|
|
395
|
-
for (const e of l) if (e.type ===
|
|
395
|
+
for (const e of l) if (e.type === C.Cell && void 0 !== e.referenceIndex) {
|
|
396
396
|
const t = u.get(e.referenceIndex);
|
|
397
397
|
t ? t.push(e) : u.set(e.referenceIndex, [e]);
|
|
398
398
|
}
|
|
399
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
|
|
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
|
}
|
|
411
411
|
return l;
|
|
412
412
|
}
|
|
413
|
-
function ve(e,
|
|
414
|
-
let
|
|
415
|
-
for (let
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
418
|
-
const e =
|
|
419
|
-
if (e && void 0 !==
|
|
420
|
-
const
|
|
421
|
-
|
|
413
|
+
function ve(e, t) {
|
|
414
|
+
let n = "";
|
|
415
|
+
for (let r = 0; r < e.length; r++) {
|
|
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
|
-
|
|
424
|
+
if (l === C.Named) {
|
|
425
|
+
n += i.text ?? i.value?.name ?? "";
|
|
426
426
|
continue;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
if (
|
|
430
|
-
|
|
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
|
-
return
|
|
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
|
-
const
|
|
454
|
-
e?.type ===
|
|
453
|
+
const c = (e) => {
|
|
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
|
|
@@ -482,40 +482,40 @@ function me(e) {
|
|
|
482
482
|
};
|
|
483
483
|
});
|
|
484
484
|
}
|
|
485
|
-
function ye(
|
|
486
|
-
return
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
if (!
|
|
490
|
-
if (-1 ===
|
|
491
|
-
const
|
|
492
|
-
let
|
|
493
|
-
for (const e of
|
|
494
|
-
if (e.type ===
|
|
495
|
-
e.type !==
|
|
485
|
+
function ye(e) {
|
|
486
|
+
return y(e, (e) => {
|
|
487
|
+
if (e.type !== C.TableReference) return;
|
|
488
|
+
const t = e.inputs;
|
|
489
|
+
if (!t) return;
|
|
490
|
+
if (-1 === t.findIndex((e) => e.type === C.TableSpecifier && "#THIS ROW" === e.value.toUpperCase().trim())) return;
|
|
491
|
+
const n = [];
|
|
492
|
+
let r;
|
|
493
|
+
for (const e of t) {
|
|
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
|
-
if (!
|
|
498
|
-
type:
|
|
497
|
+
if (!r) return n.push({
|
|
498
|
+
type: C.Prefix,
|
|
499
499
|
value: "@",
|
|
500
500
|
inputs: null,
|
|
501
501
|
isReference: !0
|
|
502
502
|
}), {
|
|
503
|
-
...
|
|
504
|
-
inputs:
|
|
503
|
+
...e,
|
|
504
|
+
inputs: n
|
|
505
505
|
};
|
|
506
|
-
const
|
|
507
|
-
...
|
|
508
|
-
image:
|
|
509
|
-
} :
|
|
510
|
-
return
|
|
511
|
-
...
|
|
512
|
-
inputs:
|
|
506
|
+
const i = r.image ?? r.value, l = i.startsWith("[") && i.endsWith("]") ? {
|
|
507
|
+
...r,
|
|
508
|
+
image: i.slice(1, -1)
|
|
509
|
+
} : r;
|
|
510
|
+
return n.push(v("@", l, !0)), {
|
|
511
|
+
...e,
|
|
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,11 +591,11 @@ 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;
|
|
@@ -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,15 +618,15 @@ 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
626
|
if (!e || !t) return !1;
|
|
627
627
|
let n = !1;
|
|
628
|
-
return
|
|
629
|
-
n || e.type !==
|
|
628
|
+
return y(e, (e) => {
|
|
629
|
+
n || e.type !== C.Function || !0 === t(e.value)?.getDeclaration().getReturnType()?.isVolatile() && (n = !0);
|
|
630
630
|
}), n;
|
|
631
631
|
}
|
|
632
632
|
var Ne = Object.freeze({
|
|
@@ -636,13 +636,13 @@ var Ne = Object.freeze({
|
|
|
636
636
|
const n = function(e, t) {
|
|
637
637
|
if (!e || !t) return Ne;
|
|
638
638
|
let n = !1, r = !1;
|
|
639
|
-
return
|
|
639
|
+
return y(e, (e) => {
|
|
640
640
|
if (n) return;
|
|
641
641
|
const i = e.type;
|
|
642
|
-
if (i ===
|
|
643
|
-
if (i ===
|
|
644
|
-
if (i ===
|
|
645
|
-
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;
|
|
646
646
|
if (void 0 !== e.binder) return;
|
|
647
647
|
const l = t(e.value);
|
|
648
648
|
if (!l) return void (n = !0);
|
|
@@ -670,25 +670,25 @@ var Ne = Object.freeze({
|
|
|
670
670
|
};
|
|
671
671
|
function Le(e) {
|
|
672
672
|
if (!e) return V.EmptyArray;
|
|
673
|
-
let
|
|
674
|
-
const
|
|
675
|
-
e && (
|
|
676
|
-
},
|
|
677
|
-
"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);
|
|
678
678
|
};
|
|
679
|
-
return
|
|
680
|
-
if (e.type ===
|
|
679
|
+
return y(e, (e) => {
|
|
680
|
+
if (e.type === C.Named) {
|
|
681
681
|
if (e.binding) return;
|
|
682
682
|
const t = e.value;
|
|
683
|
-
|
|
684
|
-
} else if (e.type ===
|
|
683
|
+
r(t.nameId), i(t.scope);
|
|
684
|
+
} else if (e.type === C.TableReference) {
|
|
685
685
|
const t = e.value;
|
|
686
|
-
|
|
687
|
-
} else if (e.type ===
|
|
686
|
+
r("string" == typeof t ? t : t?.tableId);
|
|
687
|
+
} else if (e.type === C.Cell) {
|
|
688
688
|
const t = e.value?.scope;
|
|
689
|
-
|
|
690
|
-
} else e.type ===
|
|
691
|
-
}),
|
|
689
|
+
i(t), f(t) && r(t);
|
|
690
|
+
} else e.type === C.Error && i(e.value?.scope);
|
|
691
|
+
}), n;
|
|
692
692
|
}
|
|
693
693
|
var ke = (e, t) => {
|
|
694
694
|
if (!0 === e.lazyArg) return !0;
|
|
@@ -714,15 +714,15 @@ var ke = (e, t) => {
|
|
|
714
714
|
if (!e) return !1;
|
|
715
715
|
const n = e.inputs;
|
|
716
716
|
switch (e.type) {
|
|
717
|
-
case
|
|
718
|
-
case
|
|
719
|
-
case
|
|
720
|
-
case
|
|
721
|
-
case
|
|
722
|
-
case
|
|
723
|
-
case
|
|
724
|
-
case
|
|
725
|
-
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: {
|
|
726
726
|
if (void 0 !== e.binder) return !1;
|
|
727
727
|
const r = String(e.value).toUpperCase();
|
|
728
728
|
if ($e.has(r)) {
|
|
@@ -746,29 +746,29 @@ function Me(e, t) {
|
|
|
746
746
|
let n;
|
|
747
747
|
const r = e.type, i = e.inputs;
|
|
748
748
|
switch (r) {
|
|
749
|
-
case
|
|
749
|
+
case C.Array:
|
|
750
750
|
n = !0;
|
|
751
751
|
break;
|
|
752
|
-
case
|
|
752
|
+
case C.Cell: {
|
|
753
753
|
const t = e.value;
|
|
754
754
|
n = t.rowIndex === Number.MIN_SAFE_INTEGER || t.colIndex === Number.MIN_SAFE_INTEGER;
|
|
755
755
|
break;
|
|
756
756
|
}
|
|
757
|
-
case
|
|
758
|
-
case
|
|
759
|
-
case
|
|
757
|
+
case C.Named:
|
|
758
|
+
case C.Call:
|
|
759
|
+
case C.TableReference:
|
|
760
760
|
n = !0;
|
|
761
761
|
break;
|
|
762
|
-
case
|
|
763
|
-
case
|
|
764
|
-
case
|
|
762
|
+
case C.Infix:
|
|
763
|
+
case C.Prefix:
|
|
764
|
+
case C.Postfix:
|
|
765
765
|
n = e.isReference ? "@" !== e.value : De(i, t);
|
|
766
766
|
break;
|
|
767
|
-
case
|
|
768
|
-
case
|
|
767
|
+
case C.Paren:
|
|
768
|
+
case C.List:
|
|
769
769
|
n = !i || 1 !== i.length || Me(i[0], t);
|
|
770
770
|
break;
|
|
771
|
-
case
|
|
771
|
+
case C.Function: {
|
|
772
772
|
const r = e.binder;
|
|
773
773
|
if (void 0 !== r) {
|
|
774
774
|
n = "lambda" === r.kind || !!i && Me(i[i.length - 1], t);
|
|
@@ -782,7 +782,7 @@ function Me(e, t) {
|
|
|
782
782
|
if ("INDEX" === l) {
|
|
783
783
|
if (n = !1, i) for (let e = 1; e < i.length; e++) {
|
|
784
784
|
const r = i[e];
|
|
785
|
-
if (!r || r.type ===
|
|
785
|
+
if (!r || r.type === C.Empty || r.isLiteral && 0 === r.value || Me(r, t)) {
|
|
786
786
|
n = !0;
|
|
787
787
|
break;
|
|
788
788
|
}
|
|
@@ -810,17 +810,17 @@ function We(e, t) {
|
|
|
810
810
|
const i = e.inputs;
|
|
811
811
|
if (!i) return;
|
|
812
812
|
const l = e.type;
|
|
813
|
-
if (l ===
|
|
813
|
+
if (l === C.Infix || l === C.Prefix || l === C.Postfix) {
|
|
814
814
|
const t = r && !e.isReference;
|
|
815
815
|
for (let e = 0; e < i.length; e++) n(i[e], t);
|
|
816
816
|
return;
|
|
817
817
|
}
|
|
818
|
-
if (l ===
|
|
818
|
+
if (l === C.Paren || l === C.List) {
|
|
819
819
|
const e = r && 1 === i.length;
|
|
820
820
|
for (let t = 0; t < i.length; t++) n(i[t], e);
|
|
821
821
|
return;
|
|
822
822
|
}
|
|
823
|
-
if (l ===
|
|
823
|
+
if (l === C.Function) {
|
|
824
824
|
const l = e.binder;
|
|
825
825
|
if (void 0 !== l) {
|
|
826
826
|
const e = i.length - 1;
|
|
@@ -846,57 +846,57 @@ var Ue = /* @__PURE__ */ new Set([
|
|
|
846
846
|
"<=",
|
|
847
847
|
">="
|
|
848
848
|
]), _e = /* @__PURE__ */ new Set(["ROW", "COLUMN"]);
|
|
849
|
-
function je(
|
|
850
|
-
if (!
|
|
851
|
-
const
|
|
852
|
-
let
|
|
853
|
-
if (
|
|
854
|
-
(e.hasLazyArgs || e.type ===
|
|
855
|
-
}),
|
|
856
|
-
const
|
|
849
|
+
function je(t, n) {
|
|
850
|
+
if (!t || !n) return null;
|
|
851
|
+
const r = (e) => n(e.value)?.getName().toUpperCase() ?? null;
|
|
852
|
+
let i = !1;
|
|
853
|
+
if (y(t, (e) => {
|
|
854
|
+
(e.hasLazyArgs || e.type === C.Call || void 0 !== e.binder) && (i = !0);
|
|
855
|
+
}), i) return null;
|
|
856
|
+
const l = (e) => e.type === C.Number, s = (e) => e.type === C.Number || e.type === C.String || e.type === C.Boolean, o = (e) => {
|
|
857
857
|
if (!e) return !1;
|
|
858
858
|
const t = e.inputs;
|
|
859
859
|
switch (e.type) {
|
|
860
|
-
case
|
|
861
|
-
case
|
|
862
|
-
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: {
|
|
863
863
|
if ("+" !== e.value && "-" !== e.value && "*" !== e.value) return !1;
|
|
864
864
|
const [n, r] = t ?? [];
|
|
865
|
-
return !(!n || !r) && (
|
|
865
|
+
return !(!n || !r) && (o(n) && (o(r) || l(r)) || l(n) && o(r));
|
|
866
866
|
}
|
|
867
|
-
case
|
|
868
|
-
const
|
|
869
|
-
if (null !==
|
|
870
|
-
if ("MOD" ===
|
|
867
|
+
case C.Function: {
|
|
868
|
+
const n = r(e);
|
|
869
|
+
if (null !== n && _e.has(n)) return !t || 0 === t.length || 1 === t.length && t[0]?.type === C.Cell;
|
|
870
|
+
if ("MOD" === n && 2 === t?.length) {
|
|
871
871
|
const e = t[1];
|
|
872
|
-
return
|
|
872
|
+
return o(t[0]) && l(e) && 0 !== e.value;
|
|
873
873
|
}
|
|
874
874
|
return !1;
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
return !1;
|
|
878
|
-
},
|
|
878
|
+
}, a = (e) => {
|
|
879
879
|
if (!e) return !1;
|
|
880
880
|
const t = e.inputs;
|
|
881
881
|
switch (e.type) {
|
|
882
|
-
case
|
|
883
|
-
case
|
|
882
|
+
case C.Paren: return 1 === t?.length && a(t[0]);
|
|
883
|
+
case C.Infix: {
|
|
884
884
|
if (!Ue.has(e.value)) return !1;
|
|
885
885
|
const [n, r] = t ?? [];
|
|
886
|
-
return !(!n || !r) && (
|
|
886
|
+
return !(!n || !r) && (o(n) && (o(r) || s(r)) || s(n) && o(r));
|
|
887
887
|
}
|
|
888
|
-
case
|
|
889
|
-
const
|
|
888
|
+
case C.Function: {
|
|
889
|
+
const n = r(e);
|
|
890
890
|
if (!t || 0 === t.length) return !1;
|
|
891
|
-
if ("ISODD" ===
|
|
892
|
-
if ("NOT" ===
|
|
893
|
-
if ("AND" ===
|
|
891
|
+
if ("ISODD" === n || "ISEVEN" === n) return 1 === t.length && o(t[0]);
|
|
892
|
+
if ("NOT" === n) return 1 === t.length && a(t[0]);
|
|
893
|
+
if ("AND" === n || "OR" === n || "XOR" === n) {
|
|
894
894
|
let e = !1;
|
|
895
895
|
for (let n = 0; n < t.length; n++) {
|
|
896
896
|
const r = t[n];
|
|
897
897
|
if (!r) return !1;
|
|
898
|
-
if (r.type !==
|
|
899
|
-
if (!
|
|
898
|
+
if (r.type !== C.Boolean) {
|
|
899
|
+
if (!a(r)) return !1;
|
|
900
900
|
e = !0;
|
|
901
901
|
}
|
|
902
902
|
}
|
|
@@ -906,24 +906,24 @@ function je(e, t) {
|
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
908
|
return !1;
|
|
909
|
-
},
|
|
909
|
+
}, u = [], c = (e) => {
|
|
910
910
|
if (!e) return;
|
|
911
|
-
if (
|
|
911
|
+
if (a(e)) return void u.push(e);
|
|
912
912
|
const t = e.inputs;
|
|
913
|
-
if (t) for (let e = 0; e < t.length; e++)
|
|
913
|
+
if (t) for (let e = 0; e < t.length; e++) c(t[e]);
|
|
914
914
|
};
|
|
915
|
-
|
|
916
|
-
const f =
|
|
915
|
+
c(t);
|
|
916
|
+
const f = u.length;
|
|
917
917
|
if (0 === f || f > 4) return null;
|
|
918
918
|
const p = [];
|
|
919
|
-
for (let
|
|
920
|
-
const
|
|
921
|
-
const
|
|
922
|
-
if (-1 !==
|
|
923
|
-
const
|
|
924
|
-
return delete
|
|
919
|
+
for (let n = 0; n < 1 << f; n++) {
|
|
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;
|
|
925
925
|
};
|
|
926
|
-
p.push(
|
|
926
|
+
p.push(r(t));
|
|
927
927
|
}
|
|
928
928
|
return p;
|
|
929
929
|
}
|
|
@@ -945,66 +945,66 @@ function He(e, t, n, r = !1, i = null, l = null) {
|
|
|
945
945
|
n && n.inputs && (e.inputs = n.inputs.map((e) => t.get(e) ?? e));
|
|
946
946
|
}), [t.get(e), n];
|
|
947
947
|
}(a);
|
|
948
|
-
const u =
|
|
949
|
-
let
|
|
948
|
+
const u = w(o), f = [], d = [], g = new de();
|
|
949
|
+
let v, h = !1;
|
|
950
950
|
(function(e, t) {
|
|
951
951
|
if (!e || !t) return;
|
|
952
952
|
const n = (e) => {
|
|
953
953
|
if (!e) return;
|
|
954
|
-
e.inLazy = !0, e.type ===
|
|
954
|
+
e.inLazy = !0, e.type === C.Named && (e.deferredResolve = !0);
|
|
955
955
|
const t = e.inputs;
|
|
956
956
|
if (t) for (let e = 0; e < t.length; e++) n(t[e]);
|
|
957
957
|
};
|
|
958
|
-
|
|
959
|
-
if (e.type !==
|
|
958
|
+
y(e, (e) => {
|
|
959
|
+
if (e.type !== C.Function) return;
|
|
960
960
|
if (void 0 !== e.binder) return;
|
|
961
961
|
const r = e.inputs;
|
|
962
962
|
if (!r || 0 === r.length) return;
|
|
963
963
|
const i = t(e.value)?.getDeclaration().getParameters();
|
|
964
964
|
if (i) for (let t = 0; t < r.length; t++) {
|
|
965
965
|
const l = r[t];
|
|
966
|
-
l && l.type !==
|
|
966
|
+
l && l.type !== C.Empty && Pe(i, t)?.isLazy() && (l.lazyArg = !0, e.hasLazyArgs = !0, n(l));
|
|
967
967
|
}
|
|
968
968
|
});
|
|
969
969
|
})(s, l);
|
|
970
970
|
const m = (e) => {
|
|
971
|
-
void 0 ===
|
|
972
|
-
let t =
|
|
973
|
-
return void 0 === t &&
|
|
974
|
-
},
|
|
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) => {
|
|
975
975
|
void 0 === e ? f.push(t) : m(e).push(t);
|
|
976
|
-
},
|
|
977
|
-
e?.type !==
|
|
976
|
+
}, b = (e) => {
|
|
977
|
+
e?.type !== C.Infix || "+" !== e.value && "-" !== e.value || (e.snapsCancellation = !0);
|
|
978
978
|
};
|
|
979
|
-
s =
|
|
979
|
+
s = y(s, (t, n, r) => {
|
|
980
980
|
const i = t.type, l = t.evalIndex;
|
|
981
|
-
if (u[l] = null, i ===
|
|
982
|
-
if (
|
|
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);
|
|
983
983
|
const s = ((e, t, n) => {
|
|
984
984
|
if (ke(e, t)) return e;
|
|
985
985
|
for (let e = n.length - 1; e >= 0; e--) if (ke(n[e], n[e - 1])) return n[e];
|
|
986
986
|
})(t, n, r);
|
|
987
|
-
s === t && m(t), void 0 !== s && i ===
|
|
987
|
+
s === t && m(t), void 0 !== s && i === C.Named && (t.deferredResolve = !0);
|
|
988
988
|
const o = t.binder;
|
|
989
989
|
if (o && "let" === o.kind) {
|
|
990
990
|
const e = t.inputs, n = e?.length ?? 0;
|
|
991
991
|
let r = 0;
|
|
992
|
-
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);
|
|
993
993
|
}
|
|
994
|
-
if ((t.isReference || n && n.isReference) && (
|
|
995
|
-
if (i ===
|
|
996
|
-
if (i ===
|
|
997
|
-
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);
|
|
998
998
|
}
|
|
999
|
-
if (t.isLiteral) if (i !==
|
|
999
|
+
if (t.isLiteral) if (i !== C.Array) u[l] = t.value;
|
|
1000
1000
|
else {
|
|
1001
|
-
const n = t.value, r = n.length, i =
|
|
1001
|
+
const n = t.value, r = n.length, i = w(r);
|
|
1002
1002
|
for (let e = 0; e < r; e++) {
|
|
1003
|
-
const t = n[e].value, r = t.length, l =
|
|
1003
|
+
const t = n[e].value, r = t.length, l = w(r);
|
|
1004
1004
|
for (let e = 0; e < r; e++) {
|
|
1005
1005
|
const n = t[e];
|
|
1006
1006
|
let r = null;
|
|
1007
|
-
if (n && (r = n.type ===
|
|
1007
|
+
if (n && (r = n.type === C.Error ? p(n.value) : n.value, n.type === C.Prefix)) {
|
|
1008
1008
|
const e = n.value;
|
|
1009
1009
|
r = n.inputs[0].value, "-" === e && (r = -r);
|
|
1010
1010
|
}
|
|
@@ -1012,18 +1012,18 @@ function He(e, t, n, r = !1, i = null, l = null) {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
i[e] = l;
|
|
1014
1014
|
}
|
|
1015
|
-
const s =
|
|
1016
|
-
u[l] = new
|
|
1015
|
+
const s = A(i);
|
|
1016
|
+
u[l] = new E(e, s.values, s.coords, void 0, s.isLiteral);
|
|
1017
1017
|
}
|
|
1018
1018
|
else {
|
|
1019
|
-
if (i !==
|
|
1019
|
+
if (i !== C.Empty) return "lambda" === t.binder?.kind && b(t.inputs[t.inputs.length - 1]), I(s, t), t;
|
|
1020
1020
|
u[l] = void 0;
|
|
1021
1021
|
}
|
|
1022
|
-
}),
|
|
1022
|
+
}), b(s), v?.forEach((e, t) => {
|
|
1023
1023
|
t.deferred = e;
|
|
1024
1024
|
});
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1025
|
+
const x = w(g.cells.size);
|
|
1026
|
+
g.cells.forEach((e, t) => {
|
|
1027
1027
|
const n = t.value, r = n.colIndex, i = n.rowIndex, l = n.$colIndex, s = n.$rowIndex, o = {
|
|
1028
1028
|
colStart: r,
|
|
1029
1029
|
rowStart: i,
|
|
@@ -1034,29 +1034,29 @@ function He(e, t, n, r = !1, i = null, l = null) {
|
|
|
1034
1034
|
$colEnd: l,
|
|
1035
1035
|
$rowEnd: s
|
|
1036
1036
|
};
|
|
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),
|
|
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;
|
|
1038
1038
|
});
|
|
1039
|
-
const
|
|
1040
|
-
for (let e = 0; e <
|
|
1039
|
+
const R = x.length, T = w(R);
|
|
1040
|
+
for (let e = 0; e < R; e++) T[e] = {
|
|
1041
1041
|
colStart: 0,
|
|
1042
1042
|
rowStart: 0,
|
|
1043
1043
|
colEnd: 0,
|
|
1044
1044
|
rowEnd: 0,
|
|
1045
1045
|
scope: null
|
|
1046
1046
|
};
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1049
|
-
|
|
1047
|
+
const S = w(g.references.size);
|
|
1048
|
+
g.references.forEach((e) => {
|
|
1049
|
+
S[e.index] = e;
|
|
1050
1050
|
});
|
|
1051
1051
|
const F = [];
|
|
1052
|
-
|
|
1052
|
+
g.rootReferences.forEach((e) => {
|
|
1053
1053
|
F.push(e.index);
|
|
1054
1054
|
}), function(e, t, n = !1) {
|
|
1055
1055
|
if (n) {
|
|
1056
1056
|
const t = (e) => {
|
|
1057
1057
|
if (!e) return;
|
|
1058
1058
|
const n = e.type;
|
|
1059
|
-
n !==
|
|
1059
|
+
n !== C.Function && n !== C.Call || (e.implicitIntersect = !0);
|
|
1060
1060
|
const r = e.inputs;
|
|
1061
1061
|
if (r) for (let e = 0; e < r.length; e++) t(r[e]);
|
|
1062
1062
|
};
|
|
@@ -1066,15 +1066,15 @@ function He(e, t, n, r = !1, i = null, l = null) {
|
|
|
1066
1066
|
const r = (e) => Me(e, t), i = (e, n) => {
|
|
1067
1067
|
if (!e) return;
|
|
1068
1068
|
const l = e.type;
|
|
1069
|
-
l !==
|
|
1069
|
+
l !== C.Function && l !== C.Call || (e.implicitIntersect = n);
|
|
1070
1070
|
const s = e.inputs;
|
|
1071
1071
|
if (s) {
|
|
1072
|
-
if (l ===
|
|
1072
|
+
if (l === C.Infix || l === C.Prefix || l === C.Postfix) {
|
|
1073
1073
|
const t = !e.isReference;
|
|
1074
1074
|
for (let e = 0; e < s.length; e++) i(s[e], (!t || !r(s[e])) && n);
|
|
1075
1075
|
return;
|
|
1076
1076
|
}
|
|
1077
|
-
if (l ===
|
|
1077
|
+
if (l === C.Function) {
|
|
1078
1078
|
const r = e.binder;
|
|
1079
1079
|
if (void 0 !== r) {
|
|
1080
1080
|
const e = "lambda" !== r.kind && n;
|
|
@@ -1102,31 +1102,31 @@ function He(e, t, n, r = !1, i = null, l = null) {
|
|
|
1102
1102
|
const t = e.length;
|
|
1103
1103
|
for (let n = 0; n < t; n++) {
|
|
1104
1104
|
const t = e[n], r = t.type;
|
|
1105
|
-
if (r ===
|
|
1105
|
+
if (r === C.Infix) {
|
|
1106
1106
|
if (!0 === t.snapsCancellation) {
|
|
1107
1107
|
t.fn = ue[t.value];
|
|
1108
1108
|
continue;
|
|
1109
1109
|
}
|
|
1110
1110
|
t.fn = ae[t.value];
|
|
1111
|
-
} else if (r ===
|
|
1112
|
-
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];
|
|
1113
1113
|
}
|
|
1114
1114
|
};
|
|
1115
1115
|
let k;
|
|
1116
|
-
L(f),
|
|
1117
|
-
const $ = r ?
|
|
1116
|
+
L(f), v?.forEach(L);
|
|
1117
|
+
const $ = r ? c(P(e.getLocale()).decimal) : N, O = {
|
|
1118
1118
|
runtime: e,
|
|
1119
1119
|
symbols: t,
|
|
1120
1120
|
getFunction: l,
|
|
1121
1121
|
ast: s,
|
|
1122
1122
|
evaluations: u,
|
|
1123
1123
|
executions: f,
|
|
1124
|
-
bindings:
|
|
1125
|
-
referencesAbsolute:
|
|
1126
|
-
referencesExecute:
|
|
1127
|
-
referencesRelative:
|
|
1124
|
+
bindings: d,
|
|
1125
|
+
referencesAbsolute: T,
|
|
1126
|
+
referencesExecute: S,
|
|
1127
|
+
referencesRelative: x,
|
|
1128
1128
|
referencesRoot: F,
|
|
1129
|
-
referenceIndices:
|
|
1129
|
+
referenceIndices: g.referenceIndices,
|
|
1130
1130
|
formatReferenceIndices: Te(s, l),
|
|
1131
1131
|
getTokens: () => k ??= ge(s, r, $),
|
|
1132
1132
|
namedIds: Ee(s),
|
|
@@ -1135,10 +1135,10 @@ function He(e, t, n, r = !1, i = null, l = null) {
|
|
|
1135
1135
|
hasDataTable: we(s, l),
|
|
1136
1136
|
hasVolatile: Ce(s, l),
|
|
1137
1137
|
...Fe(s, l),
|
|
1138
|
-
isReferenceOnly: !
|
|
1138
|
+
isReferenceOnly: !h,
|
|
1139
1139
|
error: i,
|
|
1140
1140
|
transform: (n) => {
|
|
1141
|
-
let o =
|
|
1141
|
+
let o = y(s, n);
|
|
1142
1142
|
return o === s ? O : He(e, t, o, r, i, l);
|
|
1143
1143
|
}
|
|
1144
1144
|
};
|
|
@@ -1175,29 +1175,29 @@ Object.freeze([
|
|
|
1175
1175
|
">="
|
|
1176
1176
|
]
|
|
1177
1177
|
]);
|
|
1178
|
-
var
|
|
1178
|
+
var Ze = Object.freeze([
|
|
1179
1179
|
":",
|
|
1180
1180
|
".:.",
|
|
1181
1181
|
".:",
|
|
1182
1182
|
":."
|
|
1183
|
-
]),
|
|
1183
|
+
]), Ke = Object.freeze([
|
|
1184
1184
|
":",
|
|
1185
1185
|
" ",
|
|
1186
1186
|
".:.",
|
|
1187
1187
|
".:",
|
|
1188
1188
|
":."
|
|
1189
|
-
]), qe = Object.freeze(["@"]),
|
|
1189
|
+
]), qe = Object.freeze(["@"]), Je = Object.freeze(["#"]), Qe = Object.freeze(Ke.concat(Je)), Ye = (Object.freeze(Ke.concat(qe).concat(Je)), (e) => {
|
|
1190
1190
|
if (!e) return !1;
|
|
1191
1191
|
const t = e.type;
|
|
1192
|
-
if (t ===
|
|
1193
|
-
if (t ===
|
|
1194
|
-
if (t ===
|
|
1195
|
-
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;
|
|
1196
1196
|
const t = e.inputs, n = t[0], r = t[1];
|
|
1197
1197
|
return Ye(n) && Ye(r);
|
|
1198
1198
|
}
|
|
1199
|
-
return t ===
|
|
1200
|
-
}), et = (e) => !!e && (!(e.type !==
|
|
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([
|
|
1201
1201
|
"+",
|
|
1202
1202
|
"-",
|
|
1203
1203
|
"*",
|
|
@@ -1213,15 +1213,15 @@ var Ke = Object.freeze([
|
|
|
1213
1213
|
]), nt = Object.freeze(["-", "+"]), rt = (e, t) => {
|
|
1214
1214
|
if (!e) return !1;
|
|
1215
1215
|
const n = e.type;
|
|
1216
|
-
if (e.isLiteral) return n !==
|
|
1217
|
-
if (n ===
|
|
1216
|
+
if (e.isLiteral) return n !== C.Error;
|
|
1217
|
+
if (n === C.Paren || n === C.List) {
|
|
1218
1218
|
const n = e.inputs;
|
|
1219
1219
|
return !(!n || 0 === n.length) && n.every((e) => rt(e, t));
|
|
1220
1220
|
}
|
|
1221
|
-
if (n ===
|
|
1222
|
-
if (n ===
|
|
1223
|
-
if (n ===
|
|
1224
|
-
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) {
|
|
1225
1225
|
if (!t) return !1;
|
|
1226
1226
|
const n = t(e.value);
|
|
1227
1227
|
if (!n) return !1;
|
|
@@ -1234,7 +1234,7 @@ var Ke = Object.freeze([
|
|
|
1234
1234
|
let n = null;
|
|
1235
1235
|
const r = (e) => {
|
|
1236
1236
|
if (n || !e) return;
|
|
1237
|
-
if (e.type ===
|
|
1237
|
+
if (e.type === C.Infix && " " === e.value) {
|
|
1238
1238
|
const r = e.inputs, i = r?.[0], l = r?.[1];
|
|
1239
1239
|
if (rt(i, t)) return void (n = i);
|
|
1240
1240
|
if (rt(l, t)) return void (n = l);
|
|
@@ -1248,7 +1248,7 @@ var Ke = Object.freeze([
|
|
|
1248
1248
|
let n = null;
|
|
1249
1249
|
const r = (e) => {
|
|
1250
1250
|
if (n || !e) return;
|
|
1251
|
-
if (e.type ===
|
|
1251
|
+
if (e.type === C.Postfix && "#" === e.value) {
|
|
1252
1252
|
const r = e.inputs?.[0];
|
|
1253
1253
|
if (r && rt(r, t)) return void (n = r);
|
|
1254
1254
|
}
|
|
@@ -1289,7 +1289,7 @@ var Ke = Object.freeze([
|
|
|
1289
1289
|
let t = null;
|
|
1290
1290
|
const n = (e) => {
|
|
1291
1291
|
if (t || !e) return;
|
|
1292
|
-
if (e.type ===
|
|
1292
|
+
if (e.type === C.Array && Array.isArray(e.value)) {
|
|
1293
1293
|
const n = e.value, r = (n[0]?.value)?.length ?? 0;
|
|
1294
1294
|
for (let e = 1; e < n.length && !t; e++) {
|
|
1295
1295
|
const i = (n[e]?.value)?.length ?? 0;
|
|
@@ -1305,7 +1305,7 @@ var Ke = Object.freeze([
|
|
|
1305
1305
|
let n = null;
|
|
1306
1306
|
const r = (e) => {
|
|
1307
1307
|
if (n || !e) return;
|
|
1308
|
-
if (e.type ===
|
|
1308
|
+
if (e.type === C.Function) {
|
|
1309
1309
|
const r = e.value, i = t(r);
|
|
1310
1310
|
if (i) {
|
|
1311
1311
|
const t = i.getDeclaration(), l = t.getParameters(), s = e.inputs?.length ?? 0, o = t.getMaxArguments();
|
|
@@ -1332,7 +1332,7 @@ var Ke = Object.freeze([
|
|
|
1332
1332
|
let n = null;
|
|
1333
1333
|
const r = (e) => {
|
|
1334
1334
|
if (n || !e) return;
|
|
1335
|
-
if (e.type ===
|
|
1335
|
+
if (e.type === C.Function) {
|
|
1336
1336
|
const r = t(e.value);
|
|
1337
1337
|
if (r) {
|
|
1338
1338
|
const i = r.getDeclaration().getParameters(), l = e.inputs;
|
|
@@ -1369,7 +1369,7 @@ var Ke = Object.freeze([
|
|
|
1369
1369
|
let n = null;
|
|
1370
1370
|
const r = (e) => {
|
|
1371
1371
|
if (n || !e) return;
|
|
1372
|
-
if (e.type ===
|
|
1372
|
+
if (e.type === C.Call) {
|
|
1373
1373
|
const r = e.inputs?.[0];
|
|
1374
1374
|
if (r && rt(r, t)) return void (n = "This expression always produces a value, so it cannot be called as a function.");
|
|
1375
1375
|
}
|
|
@@ -1378,28 +1378,28 @@ var Ke = Object.freeze([
|
|
|
1378
1378
|
};
|
|
1379
1379
|
return r(e), n;
|
|
1380
1380
|
}, pt = (e, t) => {
|
|
1381
|
-
if (e.type !==
|
|
1381
|
+
if (e.type !== C.Function) return;
|
|
1382
1382
|
const n = e.value;
|
|
1383
1383
|
if ("string" != typeof n) return;
|
|
1384
1384
|
const r = (t?.(n)?.getName() ?? n).toUpperCase();
|
|
1385
1385
|
return "LET" === r ? "let" : "LAMBDA" === r ? "lambda" : void 0;
|
|
1386
1386
|
}, dt = (e) => {
|
|
1387
|
-
if (e?.type !==
|
|
1387
|
+
if (e?.type !== C.Named) return;
|
|
1388
1388
|
const t = e.value;
|
|
1389
1389
|
return t?.nameId && !t.scope && !0 !== t.optional ? t.nameId : void 0;
|
|
1390
1390
|
}, gt = /^[A-Za-z_\\][A-Za-z0-9_\\]*$/, vt = /* @__PURE__ */ new Set(["TRUE", "FALSE"]), ht = (e) => {
|
|
1391
|
-
if (e?.type ===
|
|
1391
|
+
if (e?.type === C.Named) {
|
|
1392
1392
|
const t = e.value;
|
|
1393
1393
|
if (!0 !== t?.optional || !t.nameId || t.scope) return;
|
|
1394
1394
|
return t.nameId;
|
|
1395
1395
|
}
|
|
1396
|
-
if (e?.type !==
|
|
1396
|
+
if (e?.type !== C.TableReference) return;
|
|
1397
1397
|
const t = e.value;
|
|
1398
1398
|
let n;
|
|
1399
1399
|
if (null === t || "string" == typeof t) {
|
|
1400
1400
|
if (t) return;
|
|
1401
1401
|
const r = e.inputs;
|
|
1402
|
-
if (!r || 1 !== r.length || r[0]?.type !==
|
|
1402
|
+
if (!r || 1 !== r.length || r[0]?.type !== C.TableColumn) return;
|
|
1403
1403
|
const i = r[0].value;
|
|
1404
1404
|
if ("string" != typeof i) return;
|
|
1405
1405
|
n = i;
|
|
@@ -1414,7 +1414,7 @@ var Ke = Object.freeze([
|
|
|
1414
1414
|
const t = o(e.image ?? e.value);
|
|
1415
1415
|
t.image = e.image ?? e.value, t.wsBefore = e.wsBefore;
|
|
1416
1416
|
const n = {
|
|
1417
|
-
type:
|
|
1417
|
+
type: C.Call,
|
|
1418
1418
|
value: null,
|
|
1419
1419
|
inputs: [t, ...e.inputs ?? []],
|
|
1420
1420
|
wsAfter: e.wsAfter
|
|
@@ -1422,8 +1422,8 @@ var Ke = Object.freeze([
|
|
|
1422
1422
|
return e.error && (n.error = e.error), n;
|
|
1423
1423
|
};
|
|
1424
1424
|
function yt(e, t) {
|
|
1425
|
-
return e && t ?
|
|
1426
|
-
if (e.type ===
|
|
1425
|
+
return e && t ? y(e, (e) => {
|
|
1426
|
+
if (e.type === C.Function && "string" == typeof e.value && !t(e.value)) return mt(e);
|
|
1427
1427
|
}) : e;
|
|
1428
1428
|
}
|
|
1429
1429
|
function It(e, t) {
|
|
@@ -1431,7 +1431,7 @@ function It(e, t) {
|
|
|
1431
1431
|
return r.push(t), r;
|
|
1432
1432
|
}
|
|
1433
1433
|
function bt(e) {
|
|
1434
|
-
if (e?.type !==
|
|
1434
|
+
if (e?.type !== C.Function || "lambda" !== e.binder?.kind) return;
|
|
1435
1435
|
const t = e.inputs ?? [], n = [];
|
|
1436
1436
|
for (let e = 0; e < t.length - 1; e++) {
|
|
1437
1437
|
const r = t[e];
|
|
@@ -1450,7 +1450,7 @@ var xt = /* @__PURE__ */ new Set([
|
|
|
1450
1450
|
"IFNA"
|
|
1451
1451
|
]);
|
|
1452
1452
|
function Rt(e, t) {
|
|
1453
|
-
if (!e || e.type !==
|
|
1453
|
+
if (!e || e.type !== C.Function || "string" != typeof e.value) return e;
|
|
1454
1454
|
const n = (t?.(e.value)?.getName() ?? e.value).toUpperCase();
|
|
1455
1455
|
if (!xt.has(n)) return e;
|
|
1456
1456
|
const r = e.inputs;
|
|
@@ -1489,8 +1489,8 @@ function Et(e, t = null) {
|
|
|
1489
1489
|
if (s) return ((e, s) => {
|
|
1490
1490
|
const o = e.inputs, a = o?.length ?? 0;
|
|
1491
1491
|
if (!o || a < 1) return i(e);
|
|
1492
|
-
const u = n.length,
|
|
1493
|
-
const i =
|
|
1492
|
+
const u = n.length, c = [], f = [...o], p = (e, t = !1) => {
|
|
1493
|
+
const i = f[e];
|
|
1494
1494
|
let l = dt(i), s = !1;
|
|
1495
1495
|
if (void 0 === l && t) {
|
|
1496
1496
|
if (l = ht(i), void 0 === l) return;
|
|
@@ -1501,9 +1501,9 @@ function Et(e, t = null) {
|
|
|
1501
1501
|
key: l.toUpperCase(),
|
|
1502
1502
|
slot: o,
|
|
1503
1503
|
name: l
|
|
1504
|
-
}),
|
|
1504
|
+
}), c.push(o), f[e] = s ? {
|
|
1505
1505
|
...i,
|
|
1506
|
-
type:
|
|
1506
|
+
type: C.Named,
|
|
1507
1507
|
value: {
|
|
1508
1508
|
nameId: l,
|
|
1509
1509
|
scope: null
|
|
@@ -1525,23 +1525,23 @@ function Et(e, t = null) {
|
|
|
1525
1525
|
};
|
|
1526
1526
|
};
|
|
1527
1527
|
if ("lambda" === s) {
|
|
1528
|
-
for (let e = 0; e < a - 1; e++)
|
|
1529
|
-
|
|
1528
|
+
for (let e = 0; e < a - 1; e++) p(e, !0);
|
|
1529
|
+
f[a - 1] && (f[a - 1] = l(f[a - 1]));
|
|
1530
1530
|
} else {
|
|
1531
|
-
for (let e = 0; e + 1 < a; e += 2)
|
|
1532
|
-
a % 2 == 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);
|
|
1532
|
+
a % 2 == 1 && f[a - 1] && (f[a - 1] = l(f[a - 1]));
|
|
1533
1533
|
}
|
|
1534
1534
|
for (; n.length > u;) n.pop();
|
|
1535
1535
|
return {
|
|
1536
1536
|
...e,
|
|
1537
|
-
inputs:
|
|
1537
|
+
inputs: f,
|
|
1538
1538
|
binder: {
|
|
1539
1539
|
kind: s,
|
|
1540
|
-
slots:
|
|
1540
|
+
slots: c
|
|
1541
1541
|
}
|
|
1542
1542
|
};
|
|
1543
1543
|
})(e, s);
|
|
1544
|
-
if (e.type ===
|
|
1544
|
+
if (e.type === C.Function && "string" == typeof e.value) {
|
|
1545
1545
|
const r = e.value.toUpperCase();
|
|
1546
1546
|
if (n.some((e) => e.key === r) && !t?.(e.value)) return i(mt(e));
|
|
1547
1547
|
}
|
|
@@ -1555,7 +1555,7 @@ function Et(e, t = null) {
|
|
|
1555
1555
|
});
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
|
-
if (e.type ===
|
|
1558
|
+
if (e.type === C.Named) {
|
|
1559
1559
|
const t = dt(e);
|
|
1560
1560
|
if (void 0 !== t) {
|
|
1561
1561
|
const r = t.toUpperCase();
|
|
@@ -1575,7 +1575,7 @@ function Et(e, t = null) {
|
|
|
1575
1575
|
return e;
|
|
1576
1576
|
}
|
|
1577
1577
|
const o = i(e);
|
|
1578
|
-
if (o.type ===
|
|
1578
|
+
if (o.type === C.Function && "string" == typeof o.value && "ISOMITTED" === (t?.(o.value)?.getName() ?? o.value).toUpperCase()) {
|
|
1579
1579
|
const e = o.inputs;
|
|
1580
1580
|
if (e) {
|
|
1581
1581
|
let n;
|
|
@@ -1602,13 +1602,13 @@ function Et(e, t = null) {
|
|
|
1602
1602
|
return l(e);
|
|
1603
1603
|
}
|
|
1604
1604
|
var Tt = (e) => {
|
|
1605
|
-
if (e?.type !==
|
|
1605
|
+
if (e?.type !== C.Cell || void 0 === e.image) return !1;
|
|
1606
1606
|
const t = e.value;
|
|
1607
1607
|
return t.rowIndex === Number.MIN_SAFE_INTEGER && !0 !== t.$colIndex && !t.scope;
|
|
1608
1608
|
}, At = (e) => {
|
|
1609
1609
|
const t = o(e.image);
|
|
1610
|
-
return
|
|
1611
|
-
}, St = (e) => e?.type ===
|
|
1610
|
+
return F(t, e), t;
|
|
1611
|
+
}, St = (e) => e?.type === C.Cell, wt = (e, t = null) => {
|
|
1612
1612
|
if (!e) return e;
|
|
1613
1613
|
let n = !1;
|
|
1614
1614
|
const r = (e) => {
|
|
@@ -1622,17 +1622,17 @@ var Tt = (e) => {
|
|
|
1622
1622
|
};
|
|
1623
1623
|
if (r(e), !n) return e;
|
|
1624
1624
|
let i = null;
|
|
1625
|
-
const
|
|
1626
|
-
if (e?.type !==
|
|
1625
|
+
const l = y(e, (e) => {
|
|
1626
|
+
if (e?.type !== C.Cell) return;
|
|
1627
1627
|
const t = e.value, n = e.image;
|
|
1628
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 '$'.`);
|
|
1629
1629
|
if (void 0 === n) return;
|
|
1630
1630
|
const r = o(n);
|
|
1631
|
-
|
|
1632
|
-
const
|
|
1633
|
-
return
|
|
1631
|
+
F(r, e);
|
|
1632
|
+
const l = t?.scope;
|
|
1633
|
+
return l && (r.value.scope = l, r.value.scopeImage = t.scopeImage), r;
|
|
1634
1634
|
});
|
|
1635
|
-
return i ??
|
|
1635
|
+
return i ?? l;
|
|
1636
1636
|
}, Ct = (e, t) => {
|
|
1637
1637
|
if (!e) return null;
|
|
1638
1638
|
let n = null;
|
|
@@ -1643,7 +1643,7 @@ var Tt = (e) => {
|
|
|
1643
1643
|
const r = "let" === t ? "LET" : "LAMBDA", i = e.inputs, l = i?.length ?? 0;
|
|
1644
1644
|
if (!i || l < 2) return;
|
|
1645
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}.`);
|
|
1646
|
-
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.");
|
|
1647
1647
|
const s = /* @__PURE__ */ new Set(), o = "let" === t ? 2 : 1;
|
|
1648
1648
|
let a = !1;
|
|
1649
1649
|
for (let e = 0; e < l - 1; e += o) {
|
|
@@ -1662,109 +1662,109 @@ var Tt = (e) => {
|
|
|
1662
1662
|
};
|
|
1663
1663
|
return r(e), n;
|
|
1664
1664
|
};
|
|
1665
|
-
function Nt(e, n, r, i
|
|
1666
|
-
const
|
|
1667
|
-
let
|
|
1668
|
-
const
|
|
1669
|
-
scope:
|
|
1670
|
-
rowIndex:
|
|
1671
|
-
colIndex:
|
|
1672
|
-
} }) : null),
|
|
1673
|
-
return
|
|
1674
|
-
let
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1679
|
-
const
|
|
1680
|
-
null !==
|
|
1681
|
-
...
|
|
1682
|
-
scope:
|
|
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: {
|
|
1669
|
+
scope: n,
|
|
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) {
|
|
1677
|
+
const n = e.value;
|
|
1678
|
+
if (n?.scope) {
|
|
1679
|
+
const r = t.bind(x.Sheet, n.scope, l);
|
|
1680
|
+
null !== r && (o || (o = { ...e }), o.value = {
|
|
1681
|
+
...n,
|
|
1682
|
+
scope: r
|
|
1683
1683
|
});
|
|
1684
1684
|
}
|
|
1685
|
-
} else if (
|
|
1686
|
-
const
|
|
1687
|
-
if (
|
|
1688
|
-
const
|
|
1689
|
-
if (
|
|
1690
|
-
const e =
|
|
1691
|
-
if (null === e ||
|
|
1685
|
+
} else if (u === C.Named) {
|
|
1686
|
+
const r = e.value;
|
|
1687
|
+
if (r && !e.binding) {
|
|
1688
|
+
const i = function(e, t, n, r) {
|
|
1689
|
+
if (t.scope) {
|
|
1690
|
+
const e = n.bind(x.Sheet, t.scope, r);
|
|
1691
|
+
if (null === e || s(e)) return;
|
|
1692
1692
|
}
|
|
1693
|
-
const
|
|
1694
|
-
if (null ===
|
|
1695
|
-
const
|
|
1696
|
-
type:
|
|
1697
|
-
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,
|
|
1698
1698
|
inputs: null,
|
|
1699
1699
|
isReference: !0
|
|
1700
1700
|
};
|
|
1701
|
-
l
|
|
1702
|
-
const
|
|
1703
|
-
return "string" == typeof
|
|
1704
|
-
}(e,
|
|
1705
|
-
if (
|
|
1706
|
-
const
|
|
1707
|
-
null ===
|
|
1708
|
-
...
|
|
1709
|
-
nameId:
|
|
1710
|
-
...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 = {
|
|
1708
|
+
...r,
|
|
1709
|
+
nameId: c ?? r.nameId,
|
|
1710
|
+
...null !== a ? { scope: a } : void 0
|
|
1711
1711
|
});
|
|
1712
1712
|
}
|
|
1713
|
-
} else if (
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1716
|
-
const
|
|
1717
|
-
null !==
|
|
1718
|
-
...
|
|
1719
|
-
scope:
|
|
1713
|
+
} else if (u === C.Error) {
|
|
1714
|
+
const n = e.value;
|
|
1715
|
+
if (n?.scope) {
|
|
1716
|
+
const r = t.bind(x.Sheet, n.scope, l);
|
|
1717
|
+
null !== r && (o || (o = { ...e }), o.value = {
|
|
1718
|
+
...n,
|
|
1719
|
+
scope: r
|
|
1720
1720
|
});
|
|
1721
1721
|
}
|
|
1722
|
-
} else if (
|
|
1723
|
-
const
|
|
1724
|
-
if (
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1727
|
-
} else if ("string" == typeof
|
|
1728
|
-
const
|
|
1729
|
-
if (null !==
|
|
1722
|
+
} else if (u === C.TableReference) {
|
|
1723
|
+
const n = e.value;
|
|
1724
|
+
if (n) {
|
|
1725
|
+
const r = t.bind(x.Table, n);
|
|
1726
|
+
o || (o = { ...e }), null !== r && (o.value = r);
|
|
1727
|
+
} else if ("string" == typeof n) {
|
|
1728
|
+
const n = a();
|
|
1729
|
+
if (null !== n && Ft(e, t)) return {
|
|
1730
1730
|
...e,
|
|
1731
|
-
value:
|
|
1731
|
+
value: n
|
|
1732
1732
|
};
|
|
1733
1733
|
}
|
|
1734
|
-
} else if (
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1737
|
-
const
|
|
1738
|
-
|
|
1734
|
+
} else if (u === C.TableColumn) {
|
|
1735
|
+
const n = e.value;
|
|
1736
|
+
if (n) {
|
|
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);
|
|
1739
1739
|
}
|
|
1740
|
-
} else if (
|
|
1741
|
-
const
|
|
1742
|
-
if (
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1740
|
+
} else if (u === C.Function) {
|
|
1741
|
+
const n = e.value;
|
|
1742
|
+
if (n) {
|
|
1743
|
+
const r = t.bind(x.Function, n);
|
|
1744
|
+
o || (o = { ...e }), null !== r && (o.value = r);
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
|
-
return
|
|
1747
|
+
return o;
|
|
1748
1748
|
});
|
|
1749
1749
|
}
|
|
1750
|
-
function Ft(e,
|
|
1751
|
-
let
|
|
1752
|
-
const
|
|
1753
|
-
if (!
|
|
1754
|
-
for (let e = 0; e <
|
|
1755
|
-
e.type ===
|
|
1750
|
+
function Ft(e, t) {
|
|
1751
|
+
let n = !0;
|
|
1752
|
+
const r = e.inputs;
|
|
1753
|
+
if (!r) return !0;
|
|
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);
|
|
1756
1756
|
});
|
|
1757
|
-
return
|
|
1757
|
+
return n;
|
|
1758
1758
|
}
|
|
1759
|
-
function Pt(e,
|
|
1760
|
-
let
|
|
1761
|
-
return
|
|
1762
|
-
if (
|
|
1763
|
-
if ("" === e.value) return void (
|
|
1764
|
-
const
|
|
1765
|
-
if (!
|
|
1766
|
-
const
|
|
1767
|
-
null ===
|
|
1768
|
-
}),
|
|
1759
|
+
function Pt(e, t) {
|
|
1760
|
+
let n = null;
|
|
1761
|
+
return y(e, (e) => {
|
|
1762
|
+
if (n || e.type !== C.TableReference) return;
|
|
1763
|
+
if ("" === e.value) return void (n = "A structured reference without a table name must be in a table that has its columns.");
|
|
1764
|
+
const r = e.value;
|
|
1765
|
+
if (!t || "string" != typeof r) return;
|
|
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.");
|
|
1768
|
+
}), n;
|
|
1769
1769
|
}
|
|
1770
|
-
export { ce as A, Re as C, ve as D, yt as E, ae as O,
|
|
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 };
|