@sheetxl/sdk 0.7.28-beta.2 → 0.7.28-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/browser/cjs/{BREMLtxkQhtNSVra.cjs → BF14ZEAnaqxXroSj.cjs} +1 -1
  2. package/browser/cjs/{BG7YDVxiC4ErxvF1.cjs → BXtvdT1Z-MsB_o5F.cjs} +1 -1
  3. package/browser/cjs/Bc4JjVVZfFo3R4He.cjs +33 -0
  4. package/browser/cjs/{CQf4zxkBmheTVbjX.cjs → CD2RXdnfqSYNc6gX.cjs} +2 -2
  5. package/browser/cjs/DcLpXGexEtOxi-dD.cjs +1 -0
  6. package/browser/cjs/index.cjs +2 -2
  7. package/browser/esm/{DN4d5bDBkti28wuc.mjs → 0Mj5WKM362q6CECb.mjs} +213 -207
  8. package/browser/esm/{BxIOX1TojvA-1ZZP.mjs → CHSahmMFYNB0Ajkf.mjs} +2 -2
  9. package/browser/esm/{CZO1RubmqnJV96rq.mjs → CKk58ZLcrllMzfou.mjs} +2 -2
  10. package/browser/esm/{DRWu3TmcE9JFf78V.mjs → CPTtL2f6_4iblmFM.mjs} +2 -2
  11. package/browser/esm/{DPOelA1J3WHbMXyh.mjs → CoA-sUxjiIUIpTUF.mjs} +2 -2
  12. package/browser/esm/{vHWuKF-ftK7LM1uw.mjs → DBIu6NUHIcxOOBQp.mjs} +1 -1
  13. package/browser/esm/{CB_4gdPPPruwremH.mjs → Dy4Sdpju1T2icURu.mjs} +4748 -3883
  14. package/browser/esm/index.mjs +419 -411
  15. package/node/esm/{XQhP3dYwF_tEuswB.mjs → BtGxbEbBm79YvF_k.mjs} +303 -297
  16. package/node/esm/{B-tgcZihStNV9CbZ.mjs → DUYP6faJJHCaW1Xf.mjs} +1 -1
  17. package/node/esm/{C8tfYGL3wHy9IDDc.mjs → DqgWsVXROpSgKq6c.mjs} +2 -2
  18. package/node/esm/index.mjs +8686 -7802
  19. package/package.json +6 -6
  20. package/resources/locales/de/model.msg.json +12 -0
  21. package/resources/locales/en/model.msg.json +12 -0
  22. package/types/scripting-enums.json +2 -0
  23. package/types/scripting.d.ts +341 -15
  24. package/types/src/anchored/IAnchored.d.ts +27 -0
  25. package/types/src/calculation/Calculation.d.ts +21 -12
  26. package/types/src/calculation/ICalculation.d.ts +183 -0
  27. package/types/src/calculation/compiler/CompilerUtils.d.ts +20 -0
  28. package/types/src/calculation/compiler/FormulaParser.d.ts +32 -6
  29. package/types/src/calculation/executor/CalcExecutor.d.ts +204 -13
  30. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +31 -0
  31. package/types/src/calculation/executor/CircularReference.d.ts +81 -0
  32. package/types/src/calculation/functions/Operators.d.ts +1 -1
  33. package/types/src/calculation/grid/CalcGrid.d.ts +5 -1
  34. package/types/src/calculation/grid/CalcGridUtils.d.ts +3 -2
  35. package/types/src/calculation/grid/ICalcGrid.d.ts +23 -1
  36. package/types/src/calculation/spatial/CircularEntry.d.ts +18 -0
  37. package/types/src/calculation/spatial/index.d.ts +1 -0
  38. package/types/src/calculation/state/CalcNode.d.ts +24 -17
  39. package/types/src/calculation/state/CalcState.d.ts +78 -15
  40. package/types/src/calculation/state/CalculationContext.d.ts +39 -0
  41. package/types/src/calculation/state/_ReadObservedGrid.d.ts +90 -0
  42. package/types/src/cell/ICell.d.ts +16 -0
  43. package/types/src/cellRange/ICellRange.d.ts +72 -6
  44. package/types/src/condition/AnchoredConditional.d.ts +26 -6
  45. package/types/src/conditionalFormat/ConditionalFormat.d.ts +8 -1
  46. package/types/src/conditionalFormat/IConditionalFormat.d.ts +4 -1
  47. package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +6 -2
  48. package/types/src/dataValidation/IDataValidationCollection.d.ts +6 -2
  49. package/types/src/hyperlink/IHyperlink.d.ts +3 -1
  50. package/types/src/hyperlink/_Hyperlink.d.ts +6 -0
  51. package/types/src/lib/utils/utils.browser.d.ts +5 -0
  52. package/types/src/license/LicenseDetails.d.ts +5 -0
  53. package/types/src/primitives/CalcSignal.d.ts +20 -0
  54. package/types/src/protectedRange/IProtectedRangeCollection.d.ts +7 -2
  55. package/types/src/scripting/_ScriptUtils.d.ts +13 -0
  56. package/types/src/sheet/Sheet.d.ts +33 -2
  57. package/types/src/sheet/SheetCell.d.ts +2 -0
  58. package/types/src/sheet/SheetRange.d.ts +12 -1
  59. package/types/src/sheet/_SheetStateTypes.d.ts +14 -1
  60. package/types/src/style/IStyle.d.ts +5 -0
  61. package/types/src/table/AnchoredTable.d.ts +17 -1
  62. package/types/src/text/TextUtils.d.ts +18 -0
  63. package/browser/cjs/DoemwsUQoGCk0vBK.cjs +0 -33
  64. package/browser/cjs/_c2uwwpr03Y7lzIj.cjs +0 -1
@@ -1,57 +1,57 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.7.28-beta.2
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.7.28-beta.4
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 { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, b as O, et as k, g as ee, j as A, k as j, nt as M, q as N, tt as P, v as F, w as te, x as ne, y as I, z as L } from "./CB_4gdPPPruwremH.mjs";
8
- import { a as R, i as re, n as z, o as B, r as V, t as H } from "./DRWu3TmcE9JFf78V.mjs";
9
- import { FormulaError as U } from "@sheetxl/primitives";
10
- import { CommonUtils as W } from "@sheetxl/utils";
11
- var G = [
7
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, b as O, et as ee, g as te, j as k, k as A, nt as j, q as M, rt as N, tt as P, v as F, w as I, x as L, y as R, z as ne } from "./Dy4Sdpju1T2icURu.mjs";
8
+ import { a as z, i as re, n as B, o as V, r as H, t as U } from "./CPTtL2f6_4iblmFM.mjs";
9
+ import { FormulaError as W } from "@sheetxl/primitives";
10
+ import { CommonUtils as G } from "@sheetxl/utils";
11
+ var K = [
12
12
  "All",
13
13
  "Data",
14
14
  "Headers",
15
15
  "Totals",
16
16
  "This Row"
17
- ], K = class {
18
- constructor(e = P) {
17
+ ], q = class {
18
+ constructor(e = j) {
19
19
  let t = function(e) {
20
- let t = [...G];
20
+ let t = [...K];
21
21
  if (e) for (let n of Object.values(e)) {
22
22
  let e = n?.trim();
23
23
  e && !t.some((t) => t.toLowerCase() === e.toLowerCase()) && t.push(e);
24
24
  }
25
25
  return t.sort((e, t) => t.length - e.length), t.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
26
- }(e.specifiers), n = R({
26
+ }(e.specifiers), n = z({
27
27
  name: "WhiteSpace",
28
28
  pattern: /\s+/,
29
- group: B.SKIPPED
30
- }), r = R({
29
+ group: V.SKIPPED
30
+ }), r = z({
31
31
  name: "TableSpecifier",
32
32
  pattern: RegExp(`\\[#(?:${t})\\]`, "i")
33
33
  }), i = [
34
34
  n,
35
35
  r,
36
- R({
36
+ z({
37
37
  name: "BracketedColumn",
38
38
  pattern: /\[([^[\]]*)\]/,
39
39
  longer_alt: [r]
40
40
  }),
41
- R({
41
+ z({
42
42
  name: "BareSpecifier",
43
43
  pattern: RegExp(`#(?:${t})`, "i")
44
44
  }),
45
- R({
45
+ z({
46
46
  name: "ColumnSep",
47
47
  pattern: /:/
48
48
  }),
49
- R({
49
+ z({
50
50
  name: "ListSep",
51
51
  pattern: new RegExp(e.separators.separatorFunction.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))
52
52
  })
53
53
  ];
54
- this._lexer = new B(i, { ensureOptimizations: !0 });
54
+ this._lexer = new V(i, { ensureOptimizations: !0 });
55
55
  let a = {};
56
56
  i.forEach((e) => {
57
57
  a[e.name] = e;
@@ -63,9 +63,9 @@ var G = [
63
63
  tokenize(e) {
64
64
  return this._lexer.tokenize(e);
65
65
  }
66
- }, q = class extends z {
67
- constructor(e = P) {
68
- let t = new K(e), n = t.getVocabulary();
66
+ }, J = class extends B {
67
+ constructor(e = j) {
68
+ let t = new q(e), n = t.getVocabulary();
69
69
  super(n, {
70
70
  nodeLocationTracking: "none",
71
71
  maxLookahead: 2,
@@ -88,13 +88,13 @@ var G = [
88
88
  }), c.RULE("ruleItem", () => c.OR([{ ALT: () => c.SUBRULE(c.ruleSpecifier) }, { ALT: () => c.SUBRULE(c.ruleColumnOrRange) }])), c.RULE("ruleSpecifier", () => c.OR([{ ALT: () => {
89
89
  let t = c.CONSUME(r);
90
90
  return c.ACTION(() => {
91
- let n = E(t.image, e);
91
+ let n = _(t.image, e);
92
92
  return n.image = t.image, n;
93
93
  });
94
94
  } }, { ALT: () => {
95
95
  let t = c.CONSUME(a);
96
96
  return c.ACTION(() => {
97
- let n = E(t.image, e);
97
+ let n = _(t.image, e);
98
98
  return n.image = t.image, n;
99
99
  });
100
100
  } }])), c.RULE("ruleColumnOrRange", () => {
@@ -102,11 +102,11 @@ var G = [
102
102
  return c.OPTION(() => {
103
103
  t = c.CONSUME(o), n = c.CONSUME2(i);
104
104
  }), c.ACTION(() => {
105
- let r = T(e.image);
105
+ let r = w(e.image);
106
106
  if (r.image = e.image, !n) return r;
107
- let i = T(n.image);
107
+ let i = w(n.image);
108
108
  i.image = n.image;
109
- let a = f(":", r, i, !0);
109
+ let a = v(":", r, i, !0);
110
110
  return a.image = t?.image ?? ":", a;
111
111
  });
112
112
  }), c.performSelfAnalysis();
@@ -123,23 +123,23 @@ var G = [
123
123
  if (n === "@") {
124
124
  let e = t.slice(1).trim();
125
125
  if (!e) {
126
- let e = C("@", null, !0);
126
+ let e = s("@", null, !0);
127
127
  return e.image = "@", [e];
128
128
  }
129
- let n = T(e);
129
+ let n = w(e);
130
130
  n.image = e;
131
- let r = C("@", n, !0);
131
+ let r = s("@", n, !0);
132
132
  return r.image = "@", [r];
133
133
  }
134
134
  if (n !== "[" && n !== "#") {
135
- let t = T(e);
135
+ let t = w(e);
136
136
  return t.image = e, [t];
137
137
  }
138
138
  return this._parseInner(t);
139
139
  }
140
140
  parse(e, t, n) {
141
141
  let r = () => ({
142
- root: w("", []),
142
+ root: E("", []),
143
143
  errors: []
144
144
  });
145
145
  if (!n) return r();
@@ -147,22 +147,22 @@ var G = [
147
147
  if (i === -1) return r();
148
148
  let a = n.slice(0, i), o = n.slice(i + 1, -1);
149
149
  return {
150
- root: w(a, this._parseContent(o)),
150
+ root: E(a, this._parseContent(o)),
151
151
  errors: this.errors.length > 0 ? [...this.errors] : []
152
152
  };
153
153
  }
154
- }, J = /* @__PURE__ */ new Set([
154
+ }, Y = /* @__PURE__ */ new Set([
155
155
  ":",
156
156
  ".:.",
157
157
  ".:",
158
158
  ":."
159
- ]), Y = /* @__PURE__ */ new Set([
159
+ ]), ie = /* @__PURE__ */ new Set([
160
160
  ".:.",
161
161
  ".:",
162
162
  ":."
163
163
  ]), X = (e) => {
164
164
  if (!e) return null;
165
- if (e.type === k.Cell) {
165
+ if (e.type === P.Cell) {
166
166
  let t = e.value;
167
167
  return t.rowIndex === -(2 ** 53 - 1) ? "col" : t.colIndex === -(2 ** 53 - 1) ? "row" : null;
168
168
  }
@@ -179,34 +179,32 @@ function $(e, t) {
179
179
  }
180
180
  return `Unexpected '${n}'`;
181
181
  }
182
- var ie = {
183
- ...V,
182
+ var ae = {
183
+ ...H,
184
184
  buildNoViableAltMessage: (e) => $(e.actual, e.previous),
185
185
  buildEarlyExitMessage: (e) => $(e.actual, e.previous),
186
186
  buildNotAllInputParsedMessage: (e) => {
187
187
  let t = e.firstRedundant?.image;
188
- return t ? `Unexpected '${t}'` : V.buildNotAllInputParsedMessage(e);
188
+ return t ? `Unexpected '${t}'` : H.buildNotAllInputParsedMessage(e);
189
189
  },
190
190
  buildMismatchTokenMessage: (e) => {
191
191
  let t = e.actual?.image;
192
- return e.expected === re && t ? `Unexpected '${t}'` : V.buildMismatchTokenMessage(e);
192
+ return e.expected === re && t ? `Unexpected '${t}'` : H.buildMismatchTokenMessage(e);
193
193
  }
194
- }, ae = class extends z {
195
- constructor(e) {
196
- let t = e?.lexer ?? H.shared(e?.lexerOptions), r = t.getVocabulary();
197
- super(r, {
194
+ }, oe = class extends B {
195
+ constructor(r) {
196
+ let i = r?.lexer ?? U.shared(r?.lexerOptions), a = i.getVocabulary();
197
+ super(a, {
198
198
  skipValidations: !0,
199
199
  recoveryEnabled: !0,
200
- ...e,
200
+ ...r,
201
201
  nodeLocationTracking: "full",
202
- errorMessageProvider: ie,
202
+ errorMessageProvider: ae,
203
203
  maxLookahead: 1
204
204
  }), this._ruleInfixOp = this.RULE("ruleInfixOp", () => {
205
- let { PlusOp: e, MinOp: t, MulOp: n, DivOp: r, ExOp: i, ConcatOp: a, GtOp: o, EqOp: s, LtOp: c, NeqOp: l, GteOp: u, LteOp: d } = this._vocab, p = [];
206
- return p.push({ node: this.SUBRULE(this._rulePostfixOp) }), this.MANY(() => {
207
- let f = this.OR(this._c1 ||= [
208
- { ALT: () => this.CONSUME(e).image },
209
- { ALT: () => this.CONSUME(t).image },
205
+ let { PlusOp: n, MinOp: r, MulOp: i, DivOp: a, ExOp: o, ConcatOp: s, GtOp: c, EqOp: l, LtOp: u, NeqOp: d, GteOp: f, LteOp: p } = this._vocab, m = [];
206
+ return m.push({ node: this.SUBRULE(this._rulePostfixOp) }), this.MANY(() => {
207
+ let t = this.OR(this._c1 ||= [
210
208
  { ALT: () => this.CONSUME(n).image },
211
209
  { ALT: () => this.CONSUME(r).image },
212
210
  { ALT: () => this.CONSUME(i).image },
@@ -216,70 +214,74 @@ var ie = {
216
214
  { ALT: () => this.CONSUME(c).image },
217
215
  { ALT: () => this.CONSUME(l).image },
218
216
  { ALT: () => this.CONSUME(u).image },
219
- { ALT: () => this.CONSUME(d).image }
220
- ]), m = {
221
- value: f,
217
+ { ALT: () => this.CONSUME(d).image },
218
+ { ALT: () => this.CONSUME(f).image },
219
+ { ALT: () => this.CONSUME(p).image }
220
+ ]), h = {
221
+ value: t,
222
222
  index: this.getLexerPosition(),
223
- isRange: _.includes(f)
224
- }, h = this.SUBRULE2(this._rulePostfixOp);
225
- p.push({
226
- op: m,
227
- node: h
223
+ isRange: e.includes(t)
224
+ }, g = this.SUBRULE2(this._rulePostfixOp);
225
+ m.push({
226
+ op: h,
227
+ node: g
228
228
  });
229
229
  }), this.ACTION(() => {
230
- let e = p.length - 1, t = j.length;
231
- for (let n = 0; e > 0 && n < t; n++) {
232
- let t = j[n], r = 1;
233
- for (; r < p.length;) {
234
- let n = p[r].op;
235
- if (t.includes(n.value)) {
236
- let t = p[r - 1].node, i = p[r].node, a = f(n.value, t, i, n.isRange);
237
- a = this._tag(a, n.index), p[r - 1].node = a, p.splice(r, 1), e--;
238
- } else r++;
230
+ let e = m.length - 1, n = t.length;
231
+ for (let r = 0; e > 0 && r < n; r++) {
232
+ let n = t[r], i = 1;
233
+ for (; i < m.length;) {
234
+ let t = m[i].op;
235
+ if (n.includes(t.value)) {
236
+ let n = m[i - 1].node, r = m[i].node, a = v(t.value, n, r, t.isRange);
237
+ a = this._tag(a, t.index), m[i - 1].node = a, m.splice(i, 1), e--;
238
+ } else i++;
239
239
  }
240
240
  }
241
- }), p[0].node;
241
+ }), m[0].node;
242
242
  }), this._rulePlusMinusOp = this.RULE("rulePlusMinusOp", () => {
243
243
  let { PlusOp: e, MinOp: t } = this._vocab;
244
244
  return this.OR([{ ALT: () => this.CONSUME(e) }, { ALT: () => this.CONSUME(t) }]);
245
245
  }), this._rulePostfixOp = this.RULE("rulePostfixOp", () => {
246
- let { PercentOp: e, ArrayAnchorOp: t } = this._vocab, n = this.SUBRULE(this._rulePrefixOp), r = [];
246
+ let { PercentOp: t } = this._vocab, n = this.SUBRULE(this._rulePrefixOp), r = [];
247
247
  return this.MANY(() => {
248
- let n = this.OR([{ ALT: () => this.CONSUME(e).image }, { ALT: () => this.CONSUME(t).image }]);
248
+ let e = this.CONSUME(t).image;
249
249
  this.ACTION(() => {
250
- r.push([n, this.getLexerPosition()]);
250
+ r.push([e, this.getLexerPosition()]);
251
251
  });
252
252
  }), this.ACTION(() => {
253
- let e = r.length;
254
- if (e !== 0) for (let t = 0; t < e; t++) {
255
- let e = r[t], i = e[0], a = e[1], o = _.includes(i);
256
- n = x(i, n, o), n = this._tag(n, a);
253
+ let t = r.length;
254
+ if (t !== 0) for (let i = 0; i < t; i++) {
255
+ let t = r[i], a = t[0], o = t[1], s = e.includes(a);
256
+ n = C(a, n, s), n = this._tag(n, o);
257
257
  }
258
258
  }), n;
259
259
  }), this._rulePrefixOp = this.RULE("rulePrefixOp", () => {
260
- let { PlusOp: e, MinOp: t, ImplicitIntersectOp: n } = this._vocab, r = [];
260
+ let { PlusOp: t, MinOp: n, ImplicitIntersectOp: r } = this._vocab, i = [];
261
261
  this.MANY(() => {
262
- let i = this.OR([
263
- { ALT: () => this.CONSUME(e).image },
262
+ let e = this.OR([
264
263
  { ALT: () => this.CONSUME(t).image },
265
- { ALT: () => this.CONSUME(n).image }
264
+ { ALT: () => this.CONSUME(n).image },
265
+ { ALT: () => this.CONSUME(r).image }
266
266
  ]);
267
267
  this.ACTION(() => {
268
- r.push([i, this.getLexerPosition()]);
268
+ i.push([e, this.getLexerPosition()]);
269
269
  });
270
270
  });
271
- let i = this.SUBRULE(this._ruleRangeOp);
271
+ let a = this.SUBRULE(this._ruleRangeOp);
272
272
  return this.ACTION(() => {
273
- let e = r.length;
274
- if (e !== 0) for (let t = e - 1; t >= 0; t--) {
275
- let e = r[t], n = e[0], a = e[1], o = _.includes(n);
276
- i = C(n, i, o), i = this._tag(i, a);
273
+ let t = i.length;
274
+ if (t !== 0) for (let n = t - 1; n >= 0; n--) {
275
+ let t = i[n], r = t[0], o = t[1], c = e.includes(r);
276
+ a = s(r, a, c), a = this._tag(a, o);
277
277
  }
278
- }), i;
278
+ }), a;
279
279
  }), this._ruleRangeOp = this.RULE("ruleRangeOp", () => {
280
- let { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: n, RangeTrimTrailingOp: r } = this._vocab, i = [];
281
- return i.push({ node: this.SUBRULE(this._ruleCallOp) }), this.MANY(() => {
282
- let a = {
280
+ let { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: n, RangeTrimTrailingOp: r, ArrayAnchorOp: i } = this._vocab, a = [];
281
+ return a.push({ node: this.SUBRULE(this._ruleCallOp) }), this.MANY2(() => {
282
+ this.CONSUME(i), a.push({ anchor: this.getLexerPosition() });
283
+ }), this.MANY(() => {
284
+ let o = {
283
285
  value: this.OR(this._c2 ||= [
284
286
  { ALT: () => this.CONSUME(e).image },
285
287
  { ALT: () => this.CONSUME(t).image },
@@ -287,17 +289,24 @@ var ie = {
287
289
  { ALT: () => this.CONSUME(r).image }
288
290
  ]),
289
291
  index: this.getLexerPosition()
290
- }, o = this.SUBRULE2(this._ruleCallOp);
291
- i.push({
292
- op: a,
293
- node: o
292
+ }, s = this.SUBRULE2(this._ruleCallOp);
293
+ a.push({
294
+ op: o,
295
+ node: s
296
+ }), this.MANY3(() => {
297
+ this.CONSUME2(i), a.push({ anchor: this.getLexerPosition() });
294
298
  });
295
299
  }), this.ACTION(() => {
296
- for (let e = 1; e < i.length; e++) {
297
- let t = i[e].op, n = f(t.value, i[0].node, i[e].node, !0);
298
- n = this._tag(n, t.index), i[0].node = n;
300
+ for (let e = 1; e < a.length; e++) {
301
+ let t = a[e];
302
+ if (t.anchor !== void 0) {
303
+ a[0].node = this._tag(C("#", a[0].node, !0), t.anchor);
304
+ continue;
305
+ }
306
+ let n = t.op, r = v(n.value, a[0].node, t.node, !0);
307
+ r = this._tag(r, n.index), a[0].node = r;
299
308
  }
300
- }), i[0].node;
309
+ }), a[0].node;
301
310
  }), this._ruleCallOp = this.RULE("ruleCallOp", () => {
302
311
  let { OpenParen: e, CloseParen: t } = this._vocab, n = this.SUBRULE(this._ruleFormula);
303
312
  return this.MANY({
@@ -307,7 +316,7 @@ var ie = {
307
316
  },
308
317
  DEF: () => {
309
318
  this.CONSUME(e);
310
- let r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), a = n, o = this.ACTION(() => this._tag(p(a, i), r)), s = this.OPTION(() => this.CONSUME(t));
319
+ let r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), a = n, o = this.ACTION(() => this._tag(m(a, i), r)), s = this.OPTION(() => this.CONSUME(t));
311
320
  this.ACTION(() => {
312
321
  s || this._reportError(o, "Missing closing parenthesis ')'", r), this._tagClose(o, this.getLexerPosition()), n = o;
313
322
  });
@@ -329,7 +338,7 @@ var ie = {
329
338
  for (; e.length > 1;) {
330
339
  let t = e.length - 1;
331
340
  for (let n = 0; n < t; n++) {
332
- let r = e[n], i = e[n + 1], a = f(" ", r, i, !0), o = this._tokenMap.get(r);
341
+ let r = e[n], i = e[n + 1], a = v(" ", r, i, !0), o = this._tokenMap.get(r);
333
342
  o && delete o.tokenIndexClose;
334
343
  let s = this._tokenMap.get(i), c = s?.tokenIndex;
335
344
  if (c !== void 0) {
@@ -359,77 +368,77 @@ var ie = {
359
368
  }), t;
360
369
  }), this._ruleParen = this.RULE("ruleParen", () => {
361
370
  let { OpenParen: e, CloseParen: t } = this._vocab;
362
- return this._processParen(k.Paren, e, t);
371
+ return this._processParen(P.Paren, e, t);
363
372
  }), this._ruleLiteralArray = this.RULE("ruleLiteralArray", () => {
364
- let { OpenCurlyParen: e, CloseCurlyParen: t, ColSeparator: r, RowSeparator: i } = this._vocab, a = n();
373
+ let { OpenCurlyParen: e, CloseCurlyParen: t, ColSeparator: n, RowSeparator: r } = this._vocab, i = S();
365
374
  this.CONSUME(e);
366
- let o = this.getLexerPosition(), s = this.ACTION(() => this._tag(v(a), o)), c = this.SUBRULE(this._ruleLiteralForArray);
375
+ let a = this.getLexerPosition(), o = this.ACTION(() => this._tag(ne(i), a)), s = this.SUBRULE(this._ruleLiteralForArray);
367
376
  this.ACTION(() => {
368
- a.value.push(c);
377
+ i.value.push(s);
369
378
  }), this.MANY(() => {
370
379
  let e = !1;
371
380
  this.OR([{ ALT: () => {
372
- this.CONSUME(r), e = !0;
373
- } }, { ALT: () => this.CONSUME(i) }]);
381
+ this.CONSUME(n), e = !0;
382
+ } }, { ALT: () => this.CONSUME(r) }]);
374
383
  let t = this.SUBRULE2(this._ruleLiteralForArray);
375
384
  this.ACTION(() => {
376
- e || (a = n(), s.value.push(a)), a.value.push(t);
385
+ e || (i = S(), o.value.push(i)), i.value.push(t);
377
386
  });
378
387
  });
379
- let l = this.OPTION(() => this.CONSUME(t));
380
- return s = this.ACTION(() => (l || this._reportError(s, "Missing closing parenthesis '}'", o), this._tagClose(s, this.getLexerPosition()))), s;
388
+ let c = this.OPTION(() => this.CONSUME(t));
389
+ return o = this.ACTION(() => (c || this._reportError(o, "Missing closing parenthesis '}'", a), this._tagClose(o, this.getLexerPosition()))), o;
381
390
  }), this._ruleLiteralForArray = this.RULE("ruleLiteralForArray", () => {
382
- let { StringToken: e, BooleanToken: t, LiteralError: n, RefError: r } = this._vocab;
391
+ let { StringToken: e, BooleanToken: t, LiteralError: r, RefError: i } = this._vocab;
383
392
  return this.OR([
384
393
  { ALT: () => {
385
- let e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), n = this.ACTION(() => this._tag(c(t.image, this._locale), this.getLexerPosition()));
386
- return this.ACTION(() => e ? s(e.image, n) : n);
394
+ let e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), n = this.ACTION(() => this._tag(x(t.image, this._locale), this.getLexerPosition()));
395
+ return this.ACTION(() => e ? d(e.image, n) : n);
387
396
  } },
388
397
  { ALT: () => {
389
398
  let t = this.CONSUME(e);
390
- return this.ACTION(() => this._tag(u(t.image), this.getLexerPosition()));
399
+ return this.ACTION(() => this._tag(T(t.image), this.getLexerPosition()));
391
400
  } },
392
401
  { ALT: () => {
393
402
  let e = this.CONSUME(t);
394
- return this.ACTION(() => this._tag(A(e.image, this._locale), this.getLexerPosition()));
403
+ return this.ACTION(() => this._tag(p(e.image, this._locale), this.getLexerPosition()));
395
404
  } },
396
405
  { ALT: () => {
397
- let e = this.CONSUME(n);
398
- return this.ACTION(() => this._tag(L(e.image, this._locale), this.getLexerPosition()));
406
+ let e = this.CONSUME(r);
407
+ return this.ACTION(() => this._tag(n(e.image, this._locale), this.getLexerPosition()));
399
408
  } },
400
409
  { ALT: () => {
401
- let e = this.CONSUME(r);
402
- return this.ACTION(() => this._tag(d(e.image, this._locale), this.getLexerPosition()));
410
+ let e = this.CONSUME(i);
411
+ return this.ACTION(() => this._tag(M(e.image, this._locale), this.getLexerPosition()));
403
412
  } }
404
413
  ]);
405
414
  }), this._ruleLiteral = this.RULE("ruleLiteral", () => {
406
- let { StringToken: e, BooleanToken: t, LiteralError: n, RefError: r } = this._vocab;
415
+ let { StringToken: e, BooleanToken: t, LiteralError: r, RefError: i } = this._vocab;
407
416
  return this.OR([
408
417
  { ALT: () => {
409
418
  let e = this.SUBRULE(this._ruleNumber);
410
- return this.ACTION(() => this._tag(c(e.image, this._locale), this.getLexerPosition()));
419
+ return this.ACTION(() => this._tag(x(e.image, this._locale), this.getLexerPosition()));
411
420
  } },
412
421
  { ALT: () => {
413
422
  let t = this.CONSUME(e);
414
- return this.ACTION(() => this._tag(u(t.image), this.getLexerPosition()));
423
+ return this.ACTION(() => this._tag(T(t.image), this.getLexerPosition()));
415
424
  } },
416
425
  { ALT: () => {
417
426
  let e = this.CONSUME(t);
418
- return this.ACTION(() => this._tag(A(e.image, this._locale), this.getLexerPosition()));
427
+ return this.ACTION(() => this._tag(p(e.image, this._locale), this.getLexerPosition()));
419
428
  } },
420
429
  { ALT: () => {
421
- let e = this.CONSUME(n);
422
- return this.ACTION(() => this._tag(L(e.image, this._locale), this.getLexerPosition()));
430
+ let e = this.CONSUME(r);
431
+ return this.ACTION(() => this._tag(n(e.image, this._locale), this.getLexerPosition()));
423
432
  } },
424
433
  { ALT: () => {
425
- let e = this.CONSUME(r);
426
- return this.ACTION(() => this._tag(d(e.image, this._locale), this.getLexerPosition()));
434
+ let e = this.CONSUME(i);
435
+ return this.ACTION(() => this._tag(M(e.image, this._locale), this.getLexerPosition()));
427
436
  } }
428
437
  ]);
429
438
  }), this._ruleFunction = this.RULE("ruleFunction", () => {
430
439
  let { FunctionToken: e, OpenParen: t, CloseParen: n } = this._vocab, r = this.CONSUME(e).image, i = this.getLexerPosition();
431
440
  this.CONSUME(t);
432
- let a = this.SUBRULE(this._ruleFunctionArguments), o = this.ACTION(() => this._tag(l(r, a), i)), s = this.OPTION(() => this.CONSUME(n));
441
+ let a = this.SUBRULE(this._ruleFunctionArguments), o = this.ACTION(() => this._tag(f(r, a), i)), s = this.OPTION(() => this.CONSUME(n));
433
442
  return o = this.ACTION(() => (s || this._reportError(o, "Missing closing parenthesis ')'", i), this._tagClose(o, this.getLexerPosition()))), o;
434
443
  }), this._ruleFunctionArguments = this.RULE("ruleFunctionArguments", () => {
435
444
  let { ArgSeparator: e, CloseParen: t } = this._vocab, n = [];
@@ -439,11 +448,11 @@ var ie = {
439
448
  let t;
440
449
  this.OPTION2(() => {
441
450
  t = this.SUBRULE(this._ruleIntersectOp);
442
- }), t = this.ACTION(() => t ?? this._tagClose(o(), this.getLexerPosition())), n.push(t), this.MANY(() => {
451
+ }), t = this.ACTION(() => t ?? this._tagClose(l(), this.getLexerPosition())), n.push(t), this.MANY(() => {
443
452
  let t;
444
453
  this.CONSUME(e), this.OPTION3(() => {
445
454
  t = this.SUBRULE2(this._ruleIntersectOp);
446
- }), t = this.ACTION(() => t ?? this._tagClose(o(), this.getLexerPosition())), n.push(t);
455
+ }), t = this.ACTION(() => t ?? this._tagClose(l(), this.getLexerPosition())), n.push(t);
447
456
  });
448
457
  }
449
458
  }), n;
@@ -462,13 +471,13 @@ var ie = {
462
471
  return this._tag(e.root, n);
463
472
  });
464
473
  }), this._ruleReference = this.RULE("ruleReference", () => {
465
- let { Sheet: e, SheetQuoted: t, DivOp: n, MulOp: r, PlusOp: i, MinOp: a, ArgSeparator: o, Cell: s, ArrayAnchorOp: c, NamedToken: l, SingleQuotedString: u, Column: f, AbsRow: p, DigitToken: h, RefError: _ } = this._vocab, v;
474
+ let { Sheet: e, SheetQuoted: t, DivOp: n, MulOp: r, PlusOp: i, MinOp: a, ArgSeparator: s, Cell: l, NamedToken: d, SingleQuotedString: f, Column: p, AbsRow: m, DigitToken: h, RefError: _ } = this._vocab, v;
466
475
  this.OPTION2({
467
476
  GATE: () => {
468
- for (let s = 1; s < 6; s++) {
469
- let c = this.LA(s);
477
+ for (let o = 1; o < 6; o++) {
478
+ let c = this.LA(o);
470
479
  if (c.tokenType === e || c.tokenType === t) return !0;
471
- if (c.image === "" || c.image === ")" || c.tokenType === n || c.tokenType === r || c.tokenType === i || c.tokenType === a || c.tokenType === o) break;
480
+ if (c.image === "" || c.image === ")" || c.tokenType === n || c.tokenType === r || c.tokenType === i || c.tokenType === a || c.tokenType === s) break;
472
481
  }
473
482
  return !1;
474
483
  },
@@ -478,40 +487,37 @@ var ie = {
478
487
  });
479
488
  let y = this.OR([
480
489
  { ALT: () => {
481
- let e = this.CONSUME(s), t = this.getLexerPosition(), n = this.OPTION(() => this.CONSUME(c));
482
- return this.ACTION(() => {
483
- let r = this._tag(m(e.image, this.rowIndex, this.colIndex), t);
484
- return n ? this._tag(x("#", r, !0), t) : r;
485
- });
490
+ let e = this.CONSUME(l), t = this.getLexerPosition();
491
+ return this.ACTION(() => this._tag(g(e.image, this.rowIndex, this.colIndex), t));
486
492
  } },
487
493
  { ALT: () => {
488
- let e = this.OR2([{ ALT: () => this.CONSUME(l) }, { ALT: () => this.CONSUME(u) }]);
489
- return this.ACTION(() => this._tag(S(e.image), this.getLexerPosition()));
494
+ let e = this.OR2([{ ALT: () => this.CONSUME(d) }, { ALT: () => this.CONSUME(f) }]);
495
+ return this.ACTION(() => this._tag(c(e.image), this.getLexerPosition()));
490
496
  } },
491
497
  { ALT: () => this.SUBRULE(this._ruleBracketedString) },
492
498
  { ALT: () => this.SUBRULE(this._ruleFunction) },
493
499
  { ALT: () => {
494
- let e = this.CONSUME(f);
495
- return this.ACTION(() => this._tag(g(e.image, this.colIndex), this.getLexerPosition()));
500
+ let e = this.CONSUME(p);
501
+ return this.ACTION(() => this._tag(o(e.image, this.colIndex), this.getLexerPosition()));
496
502
  } },
497
503
  { ALT: () => {
498
- let e = this.CONSUME(p);
499
- return this.ACTION(() => this._tag(N(e.image, this.rowIndex), this.getLexerPosition()));
504
+ let e = this.CONSUME(m);
505
+ return this.ACTION(() => this._tag(u(e.image, this.rowIndex), this.getLexerPosition()));
500
506
  } },
501
507
  { ALT: () => {
502
508
  let e = this.CONSUME(h);
503
- return this.ACTION(() => this._tag(N(e.image, this.rowIndex), this.getLexerPosition()));
509
+ return this.ACTION(() => this._tag(u(e.image, this.rowIndex), this.getLexerPosition()));
504
510
  } },
505
511
  { ALT: () => {
506
512
  let e = this.CONSUME(_);
507
- return this.ACTION(() => this._tag(d(e.image, this._locale), this.getLexerPosition()));
513
+ return this.ACTION(() => this._tag(M(e.image, this._locale), this.getLexerPosition()));
508
514
  } }
509
515
  ]);
510
516
  return this.ACTION(() => {
511
517
  if (v && y) {
512
518
  if (v.name === "") return void this._reportError(y, `'${v.image}' is not a valid sheet reference — a '!' needs a sheet name before it`);
513
519
  let e = y;
514
- y.type === k.Postfix && y.inputs?.[0] && (e = y.inputs[0]), e.type !== k.Cell && e.type !== k.Named && e.type !== k.Row && e.type !== k.TableColumn && e.type !== k.Error || (e.value.scope = v.name, e.value.scopeImage = v.image);
520
+ y.type === P.Postfix && y.inputs?.[0] && (e = y.inputs[0]), e.type !== P.Cell && e.type !== P.Named && e.type !== P.Row && e.type !== P.TableColumn && e.type !== P.Error || (e.value.scope = v.name, e.value.scopeImage = v.image);
515
521
  }
516
522
  }), y;
517
523
  }), this._rulePrefixSheetName = this.RULE("rulePrefixSheetName", () => {
@@ -550,47 +556,47 @@ var ie = {
550
556
  return this.MANY(() => {
551
557
  this.CONSUME(e), n.push(this.SUBRULE2(this._ruleIntersectOp));
552
558
  }), this.ACTION(() => n.length === 0 ? t : {
553
- type: k.List,
559
+ type: P.List,
554
560
  value: ",",
555
561
  inputs: [t, ...n],
556
562
  isReference: !0
557
563
  });
558
- }), this._lexer = t, this._locale = t.getLocale(), this._vocab = r, this._srParser = e?.srParser ?? new q(this._locale), this.performSelfAnalysis();
564
+ }), this._lexer = i, this._locale = i.getLocale(), this._vocab = a, this._srParser = r?.srParser ?? new J(this._locale), this.performSelfAnalysis();
559
565
  }
560
566
  getLexer() {
561
567
  return this._lexer;
562
568
  }
563
- parse(n, r, i, a) {
564
- let o = this._lexer.tokenize(i), s;
565
- if (!o) return {
569
+ parse(e, t, n, r) {
570
+ let i = this._lexer.tokenize(n), a;
571
+ if (!i) return {
566
572
  root: {
567
- type: k.Unparsed,
568
- value: i
573
+ type: P.Unparsed,
574
+ value: n
569
575
  },
570
576
  errors: []
571
577
  };
572
- let c = o.tokens;
573
- if (c.length === 0) throw new U.Parse(Q);
574
- return this.input = c, this._inputText = i, this._inputTextLength = i.length, this.rowIndex = n, this.colIndex = r, this._astErrors = [], this._tokenMap = /* @__PURE__ */ new Map(), this.reset(), s = this._ruleRoot(), s && this._bindAllWhitespace(s), s = e(s, (e, r) => {
575
- let i = e.type, a = r?.isReference ? r.value : void 0, o = typeof a == "string" && J.has(a), s = typeof a == "string" && Y.has(a), c = o ? r.inputs : void 0, l = c ? c[0] === e ? c[1] : c[0] : void 0, u = this._lexer.getMaxRow();
576
- if (o && i !== k.Cell && Number.isInteger(e.value)) {
577
- let r = N(e.image, n);
578
- return t(r, e), X(l) === "row" ? Z(e.image, u) || this._reportError(r, `'${e.image}' is not a valid row — rows run from 1 to ${u}`) : this._reportError(r, `'${e.image}' is not a valid reference — a whole row can only pair with another row (as in ${e.image}:${e.image})`), r;
578
+ let o = i.tokens;
579
+ if (o.length === 0) throw new W.Parse(Q);
580
+ return this.input = o, this._inputText = n, this._inputTextLength = n.length, this.rowIndex = e, this.colIndex = t, this._astErrors = [], this._tokenMap = /* @__PURE__ */ new Map(), this.reset(), a = this._ruleRoot(), a && this._bindAllWhitespace(a), a = ee(a, (t, n) => {
581
+ let r = t.type, i = n?.isReference ? n.value : void 0, a = typeof i == "string" && Y.has(i), o = typeof i == "string" && ie.has(i), s = a ? n.inputs : void 0, l = s ? s[0] === t ? s[1] : s[0] : void 0, d = this._lexer.getMaxRow();
582
+ if (a && r !== P.Cell && Number.isInteger(t.value)) {
583
+ let n = u(t.image, e);
584
+ return k(n, t), X(l) === "row" ? Z(t.image, d) || this._reportError(n, `'${t.image}' is not a valid row — rows run from 1 to ${d}`) : this._reportError(n, `'${t.image}' is not a valid reference — a whole row can only pair with another row (as in ${t.image}:${t.image})`), n;
579
585
  }
580
- if (s && i === k.Named) return this._reportError(e, `'${e.image ?? e.value?.nameId}' is a name — '${a}' needs a cell or range on both sides`), e;
581
- if (i === k.Cell) {
582
- let n = e.value, r = n.colIndex === -(2 ** 53 - 1), i = n.rowIndex === -(2 ** 53 - 1);
583
- if ((r || i) && X(l) === (r ? "row" : "col")) return r && !Z(e.image, u) && this._reportError(e, `'${e.image}' is not a valid row — rows run from 1 to ${u}`), e;
584
- if (r || i || n.colIndex >= 16384) {
585
- let o = S(e.image);
586
- t(o, e);
587
- let c = n.scope;
588
- return c && (o.value.scope = c, o.value.scopeImage = n.scopeImage), r ? this._reportError(o, `'${e.image}' is not a valid reference — a row needs a column (use ${e.image}:${e.image} for the whole row)`) : i && e.image.includes("$") ? this._reportError(o, `'${e.image}' is not a valid reference — a whole column can only pair with another column (as in ${e.image}:${e.image})`) : s && this._reportError(o, `'${e.image}' is a name — '${a}' needs a cell or range on both sides`), o;
586
+ if (o && r === P.Named) return this._reportError(t, `'${t.image ?? t.value?.nameId}' is a name — '${i}' needs a cell or range on both sides`), t;
587
+ if (r === P.Cell) {
588
+ let e = t.value, n = e.colIndex === -(2 ** 53 - 1), r = e.rowIndex === -(2 ** 53 - 1);
589
+ if ((n || r) && X(l) === (n ? "row" : "col")) return n && !Z(t.image, d) && this._reportError(t, `'${t.image}' is not a valid row — rows run from 1 to ${d}`), t;
590
+ if (n || r || e.colIndex >= 16384) {
591
+ let a = c(t.image);
592
+ k(a, t);
593
+ let s = e.scope;
594
+ return s && (a.value.scope = s, a.value.scopeImage = e.scopeImage), n ? this._reportError(a, `'${t.image}' is not a valid reference — a row needs a column (use ${t.image}:${t.image} for the whole row)`) : r && t.image.includes("$") ? this._reportError(a, `'${t.image}' is not a valid reference — a whole column can only pair with another column (as in ${t.image}:${t.image})`) : o && this._reportError(a, `'${t.image}' is a name — '${i}' needs a cell or range on both sides`), a;
589
595
  }
590
596
  }
591
- return e;
592
- }), a && s && (s = ee(s, a, null)), {
593
- root: s,
597
+ return t;
598
+ }), r && a && (a = te(a, r, null)), {
599
+ root: a,
594
600
  errors: [...this.errors, ...this._astErrors]
595
601
  };
596
602
  }
@@ -646,26 +652,26 @@ var ie = {
646
652
  _bindAllWhitespace(e) {
647
653
  if (e) {
648
654
  if (this._bindNodeWhitespace(e), e.inputs) for (let t of e.inputs) t && this._bindAllWhitespace(t);
649
- if (e.type === k.Array && Array.isArray(e.value)) {
655
+ if (e.type === P.Array && Array.isArray(e.value)) {
650
656
  for (let t of e.value) if (t && Array.isArray(t.value)) for (let e of t.value) e && this._bindAllWhitespace(e);
651
657
  }
652
658
  }
653
659
  }
654
- }, oe = class {
660
+ }, se = class {
655
661
  constructor(e) {
656
- e = { ...e }, this._editing = e.profile === "editing", this._parser = new ae(e);
662
+ e = { ...e }, this._editing = e.profile === "editing", this._parser = new oe(e);
657
663
  }
658
664
  compile(e, t, n, o, s, c, l, u) {
659
665
  if (o.length === 0) {
660
- let t = new U.Parse(Q);
666
+ let t = new W.Parse(Q);
661
667
  return this._compileUnparsed(e, s, o, {
662
668
  input: o,
663
669
  cause: t,
664
670
  causes: [t]
665
671
  });
666
672
  }
667
- if (o.length > M.MAX_EXPRESSION_LENGTH) {
668
- let t = new U.Parse((d = o.length, `A formula must not be longer than ${M.MAX_EXPRESSION_LENGTH} characters (this one is ${d})`));
673
+ if (o.length > N.MAX_EXPRESSION_LENGTH) {
674
+ let t = new W.Parse((d = o.length, `A formula must not be longer than ${N.MAX_EXPRESSION_LENGTH} characters (this one is ${d})`));
669
675
  return this._compileUnparsed(e, s, o, {
670
676
  input: o,
671
677
  cause: t,
@@ -678,20 +684,20 @@ var ie = {
678
684
  let e = this._parser.parse(t, n, o, u);
679
685
  f = e.root, m = e.errors;
680
686
  } catch (e) {
681
- p = U.isError(e, U.Code.Parse) ? e : new U.Parse(e.message, e);
687
+ p = W.isError(e, W.Code.Parse) ? e : new W.Parse(e.message, e);
682
688
  }
683
689
  let g = [];
684
- for (let e of m) g.push(b(e));
690
+ for (let e of m) g.push(a(e));
685
691
  if (f) {
686
- r(f, c ?? null) && g.push(new U.Parse("The implicit intersection operator ' ' requires a cell or range on both sides")), te(f, c ?? null) && g.push(new U.Parse("Expected a reference; a value cannot be converted to one."));
687
- let e = I(f, c ?? null);
688
- e && g.push(new U.Parse(e));
692
+ I(f, c ?? null) && g.push(new W.Parse("The implicit intersection operator ' ' requires a cell or range on both sides")), r(f, c ?? null) && g.push(new W.Parse("The spill anchor operator '#' requires a cell or range")), b(f, c ?? null) && g.push(new W.Parse("Expected a reference; a value cannot be converted to one."));
693
+ let e = R(f, c ?? null);
694
+ e && g.push(new W.Parse(e));
689
695
  let t = O(f, c ?? null);
690
- t && g.push(new U.Parse(t));
691
- let n = ne(f, c ?? null);
692
- n && g.push(new U.Parse(n));
696
+ t && g.push(new W.Parse(t));
697
+ let n = L(f, c ?? null);
698
+ n && g.push(new W.Parse(n));
693
699
  let i = y(f);
694
- i && g.push(new U.Parse(i));
700
+ i && g.push(new W.Parse(i));
695
701
  }
696
702
  g.length > 0 && !p && (p = g[0]);
697
703
  let _ = null;
@@ -706,9 +712,9 @@ var ie = {
706
712
  }
707
713
  return this._compileUnparsed(e, s, o, _);
708
714
  }
709
- f = i(f, c ?? null), f = D(f, c ?? null), s && (f = a(f, s, l));
715
+ f = h(f, c ?? null), f = D(f, c ?? null), s && (f = i(f, s, l));
710
716
  let v = F(e, s, f, this._editing, _, c ?? null);
711
- return this._editing && _ && h(v.getTokens(), s) !== o ? this._recoverCompiled(e, t, n, o, s, _, l) || this._compileUnparsed(e, s, o, _) : v;
717
+ return this._editing && _ && A(v.getTokens(), s) !== o ? this._recoverCompiled(e, t, n, o, s, _, l) || this._compileUnparsed(e, s, o, _) : v;
712
718
  }
713
719
  autoCorrect(e) {
714
720
  let t;
@@ -734,21 +740,21 @@ var ie = {
734
740
  symbols: t,
735
741
  getFunction: null,
736
742
  ast: null,
737
- evaluations: W.EmptyArray,
738
- executions: W.EmptyArray,
739
- bindings: W.EmptyArray,
740
- referencesAbsolute: W.EmptyArray,
741
- referencesExecute: W.EmptyArray,
742
- referencesRelative: W.EmptyArray,
743
- referencesRoot: W.EmptyArray,
744
- referenceIndices: W.EmptyArray,
743
+ evaluations: G.EmptyArray,
744
+ executions: G.EmptyArray,
745
+ bindings: G.EmptyArray,
746
+ referencesAbsolute: G.EmptyArray,
747
+ referencesExecute: G.EmptyArray,
748
+ referencesRelative: G.EmptyArray,
749
+ referencesRoot: G.EmptyArray,
750
+ referenceIndices: G.EmptyArray,
745
751
  getTokens: () => [{
746
- type: k.Unparsed,
752
+ type: P.Unparsed,
747
753
  value: n,
748
754
  text: n
749
755
  }],
750
- namedIds: W.EmptyArray,
751
- symbolIds: W.EmptyArray,
756
+ namedIds: G.EmptyArray,
757
+ symbolIds: G.EmptyArray,
752
758
  hasTotals: !1,
753
759
  isReferenceOnly: !1,
754
760
  error: r,
@@ -756,7 +762,7 @@ var ie = {
756
762
  };
757
763
  return i;
758
764
  }
759
- _recoverCompiled(e, t, n, r, i, o, s) {
765
+ _recoverCompiled(e, t, n, r, a, o, s) {
760
766
  let c, l = r.length;
761
767
  try {
762
768
  let e = this._parser.getLexer().tokenize(r, !1);
@@ -776,14 +782,14 @@ var ie = {
776
782
  } catch {
777
783
  continue;
778
784
  }
779
- if (!u || u.type === k.Unparsed) continue;
785
+ if (!u || u.type === P.Unparsed) continue;
780
786
  try {
781
787
  let t = D(u, null);
782
- d = F(e, i, i ? a(t, i, s) : t, !0, o);
788
+ d = F(e, a, a ? i(t, a, s) : t, !0, o);
783
789
  } catch {
784
790
  continue;
785
791
  }
786
- if (h(d.getTokens(), i) !== l) continue;
792
+ if (A(d.getTokens(), a) !== l) continue;
787
793
  let f = r.slice(c);
788
794
  if (f.length === 0) return d;
789
795
  let p, m = {
@@ -797,16 +803,16 @@ var ie = {
797
803
  }
798
804
  _appendUnparsedTail(e, t) {
799
805
  let n = [];
800
- for (let t of e) t.type === k.Paren && t.text === "(" ? n.push({
806
+ for (let t of e) t.type === P.Paren && t.text === "(" ? n.push({
801
807
  ctx: t.context,
802
808
  argIndex: 0
803
- }) : t.type === k.Paren && t.text === ")" ? n.pop() : t.type === k.Separator && n.length > 0 && n[n.length - 1].argIndex++;
809
+ }) : t.type === P.Paren && t.text === ")" ? n.pop() : t.type === P.Separator && n.length > 0 && n[n.length - 1].argIndex++;
804
810
  let r = n.length > 0 ? n[n.length - 1] : void 0, i = r?.ctx ? {
805
811
  ...r.ctx,
806
812
  argIndex: r.ctx.argIndex === -1 ? r.argIndex : r.ctx.argIndex
807
813
  } : void 0, a = (t, n) => {
808
814
  let r = {
809
- type: k.Unparsed,
815
+ type: P.Unparsed,
810
816
  value: t,
811
817
  text: t
812
818
  };
@@ -815,4 +821,4 @@ var ie = {
815
821
  s >= 0 && (s === 0 || !/[A-Za-z0-9_.]/.test(t[s - 1])) ? (s > 0 && a(t.slice(0, s)), a(t.slice(s), !0)) : a(t);
816
822
  }
817
823
  };
818
- export { oe as FormulaCompiler };
824
+ export { se as FormulaCompiler };