@univerjs/engine-formula 0.1.0-alpha.3 → 0.1.0-beta.0

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/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var Or = Object.defineProperty;
2
2
  var Ir = (s, r, e) => r in s ? Or(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
3
3
  var m = (s, r, e) => (Ir(s, typeof r != "symbol" ? r + "" : r, e), e);
4
- import { ObjectMatrix as O, LRUMap as xr, hashAlgorithm as vr, Disposable as I, deserializeRangeWithSheet as ft, Rectangle as Mr, isValidRange as Pr, serializeRangeToRefString as Vr, Tools as je, isFormulaString as we, isFormulaId as Fe, IUniverInstanceService as It, CommandType as Q, isRealNum as Br, isNullCell as St, CellValueType as se, sortRules as kr, OnLifecycle as le, LifecycleStages as he, requestImmediateMacroTask as $r, IConfigService as Qr, ICommandService as Ue, Plugin as jr } from "@univerjs/core";
4
+ import { ObjectMatrix as O, LRUMap as xr, hashAlgorithm as vr, Disposable as I, deserializeRangeWithSheet as ft, Rectangle as Mr, isValidRange as Pr, serializeRangeToRefString as Vr, Tools as je, isFormulaString as Le, isFormulaId as Fe, IUniverInstanceService as It, CommandType as Q, isRealNum as Br, isNullCell as St, CellValueType as se, sortRules as kr, OnLifecycle as le, LifecycleStages as he, requestImmediateMacroTask as $r, IConfigService as Qr, ICommandService as Ue, Plugin as jr } from "@univerjs/core";
5
5
  import { Inject as b, createIdentifier as Se, Injector as Oe } from "@wendellhu/redi";
6
6
  import { Subject as gt } from "rxjs";
7
7
  function Gr(s, r, e, t, n) {
@@ -54,7 +54,7 @@ const We = /* @__PURE__ */ new Map([
54
54
  "<="
55
55
  /* LESS_THAN_OR_EQUAL */
56
56
  ]);
57
- var L = /* @__PURE__ */ ((s) => (s.OPEN_BRACKET = "(", s.CLOSE_BRACKET = ")", s.COMMA = ",", s.SINGLE_QUOTATION = "'", s.DOUBLE_QUOTATION = '"', s.OPEN_BRACES = "{", s.CLOSE_BRACES = "}", s.COLON = ":", s.OPEN_SQUARE_BRACKET = "[", s.CLOSE_SQUARE_BRACKET = "]", s))(L || {}), oe = /* @__PURE__ */ ((s) => (s.PERCENTAGE = "%", s.POUND = "#", s))(oe || {});
57
+ var w = /* @__PURE__ */ ((s) => (s.OPEN_BRACKET = "(", s.CLOSE_BRACKET = ")", s.COMMA = ",", s.SINGLE_QUOTATION = "'", s.DOUBLE_QUOTATION = '"', s.OPEN_BRACES = "{", s.CLOSE_BRACES = "}", s.COLON = ":", s.OPEN_SQUARE_BRACKET = "[", s.CLOSE_SQUARE_BRACKET = "]", s))(w || {}), oe = /* @__PURE__ */ ((s) => (s.PERCENTAGE = "%", s.POUND = "#", s))(oe || {});
58
58
  const Xr = /* @__PURE__ */ new Set([
59
59
  "%",
60
60
  "#"
@@ -64,7 +64,7 @@ var P = /* @__PURE__ */ ((s) => (s.AT = "@", s.MINUS = "-", s))(P || {});
64
64
  const hr = [
65
65
  ...Object.values(A),
66
66
  ...Object.values(H),
67
- ...Object.values(L),
67
+ ...Object.values(w),
68
68
  ...Object.values(oe),
69
69
  ...Object.values(P)
70
70
  ];
@@ -309,12 +309,12 @@ class Pt extends I {
309
309
  a.push(c);
310
310
  continue;
311
311
  }
312
- const { token: l } = c, f = ft(l), { range: d, sheetName: p, unitId: N } = f, g = Mr.moveOffset(d, t, n);
312
+ const { token: l } = c, f = ft(l), { range: _, sheetName: N, unitId: p } = f, g = Mr.moveOffset(_, t, n);
313
313
  let C = "";
314
314
  Pr(g) ? C = Vr({
315
315
  range: g,
316
- unitId: N,
317
- sheetName: p
316
+ unitId: p,
317
+ sheetName: N
318
318
  }) : C = h.REF, a.push({
319
319
  ...c,
320
320
  token: C
@@ -329,8 +329,8 @@ class Pt extends I {
329
329
  */
330
330
  checkIfAddBracket(e) {
331
331
  let t = 0, n = e.length - 1, i = e[n];
332
- for (; i === L.CLOSE_BRACKET || i === " "; )
333
- i === L.CLOSE_BRACKET && t++, i = e[--n];
332
+ for (; i === w.CLOSE_BRACKET || i === " "; )
333
+ i === w.CLOSE_BRACKET && t++, i = e[--n];
334
334
  const a = this._getCurrentParamIndex(e, e.length - 2);
335
335
  if (a == null || a === h.VALUE)
336
336
  return 0;
@@ -340,7 +340,7 @@ class Pt extends I {
340
340
  let u = o.getParent(), c = 0;
341
341
  for (; u; ) {
342
342
  const l = u.getToken();
343
- l !== de && l !== L.COLON && u.getStartIndex() !== -1 && (t === 0 ? c += 1 : t--), u = u.getParent();
343
+ l !== de && l !== w.COLON && u.getStartIndex() !== -1 && (t === 0 ? c += 1 : t--), u = u.getParent();
344
344
  }
345
345
  return c;
346
346
  }
@@ -359,53 +359,53 @@ class Pt extends I {
359
359
  let n = !1;
360
360
  for (let i = 0, a = e.length; i < a; i++) {
361
361
  const o = e[i], u = e[i - 1], { segment: c, currentString: l, cur: f } = o;
362
- if (l === L.DOUBLE_QUOTATION && (n = !0), (c !== "" || i === 0) && i !== a - 1) {
362
+ if (l === w.DOUBLE_QUOTATION && (n = !0), (c !== "" || i === 0) && i !== a - 1) {
363
363
  t.push(l);
364
364
  continue;
365
365
  }
366
- let d = (u == null ? void 0 : u.segment) || "";
367
- const p = i - d.length;
368
- let N = i - 1;
366
+ let _ = (u == null ? void 0 : u.segment) || "";
367
+ const N = i - _.length;
368
+ let p = i - 1;
369
369
  const g = i - 1;
370
- if (i === a - 1 && this._isLastMergeString(l) && (d += l, N += 1), d === "" || We.has(d)) {
370
+ if (i === a - 1 && this._isLastMergeString(l) && (_ += l, p += 1), _ === "" || We.has(_)) {
371
371
  t.push(l);
372
372
  continue;
373
373
  }
374
- const C = d.trim(), R = this._replacePrefixString(C);
375
- n === !0 && C[C.length - 1] === L.DOUBLE_QUOTATION ? (n = !1, this._pushSequenceNode(
374
+ const C = _.trim(), R = this._replacePrefixString(C);
375
+ n === !0 && C[C.length - 1] === w.DOUBLE_QUOTATION ? (n = !1, this._pushSequenceNode(
376
376
  t,
377
377
  {
378
378
  nodeType: K.STRING,
379
- token: d,
380
- startIndex: p,
381
- endIndex: N
379
+ token: _,
380
+ startIndex: N,
381
+ endIndex: p
382
382
  },
383
383
  g
384
384
  )) : new RegExp(vt).test(R) ? this._pushSequenceNode(
385
385
  t,
386
386
  {
387
387
  nodeType: K.REFERENCE,
388
- token: d,
389
- startIndex: p,
390
- endIndex: N
388
+ token: _,
389
+ startIndex: N,
390
+ endIndex: p
391
391
  },
392
392
  g
393
393
  ) : je.isStringNumber(C) ? this._pushSequenceNode(
394
394
  t,
395
395
  {
396
396
  nodeType: K.NUMBER,
397
- token: d,
398
- startIndex: p,
399
- endIndex: N
397
+ token: _,
398
+ startIndex: N,
399
+ endIndex: p
400
400
  },
401
401
  g
402
402
  ) : C.length > 0 && this._pushSequenceNode(
403
403
  t,
404
404
  {
405
405
  nodeType: K.FUNCTION,
406
- token: d,
407
- startIndex: p,
408
- endIndex: N
406
+ token: _,
407
+ startIndex: N,
408
+ endIndex: p
409
409
  },
410
410
  g
411
411
  ), (i !== a - 1 || !this._isLastMergeString(l)) && t.push(l);
@@ -416,7 +416,7 @@ class Pt extends I {
416
416
  return this._nodeMaker(e, void 0, t);
417
417
  }
418
418
  _isLastMergeString(e) {
419
- return e === L.DOUBLE_QUOTATION || je.isStringNumber(e) || !Yt(e);
419
+ return e === w.DOUBLE_QUOTATION || je.isStringNumber(e) || !Yt(e);
420
420
  }
421
421
  /**
422
422
  * Merge array and handle ref operations
@@ -429,14 +429,14 @@ class Pt extends I {
429
429
  const a = e[i];
430
430
  if (typeof a == "string") {
431
431
  const o = e[i - 1];
432
- if (a.trim() === L.CLOSE_BRACES && o != null && typeof o != "string" && o.nodeType === K.FUNCTION && o.token.trim().substring(0, 1) === L.OPEN_BRACES) {
432
+ if (a.trim() === w.CLOSE_BRACES && o != null && typeof o != "string" && o.nodeType === K.FUNCTION && o.token.trim().substring(0, 1) === w.OPEN_BRACES) {
433
433
  o.nodeType = K.ARRAY, o.token += a, o.endIndex += a.length, i++;
434
434
  continue;
435
435
  }
436
436
  t.push(a);
437
437
  } else {
438
438
  const o = e[i + 1], u = e[i + 2];
439
- o === L.COLON && typeof a != "string" && u != null && typeof u != "string" && rn((a.token + o + u.token).trim()) && (a.nodeType = K.REFERENCE, a.token += o + u.token, a.endIndex = u.endIndex, i += 2), t.push(a);
439
+ o === w.COLON && typeof a != "string" && u != null && typeof u != "string" && rn((a.token + o + u.token).trim()) && (a.nodeType = K.REFERENCE, a.token += o + u.token, a.endIndex = u.endIndex, i += 2), t.push(a);
440
440
  }
441
441
  i++;
442
442
  }
@@ -489,26 +489,26 @@ class Pt extends I {
489
489
  continue;
490
490
  if (Be.has(f)) {
491
491
  for (; a.length > 0; ) {
492
- const d = (o = a[a.length - 1]) == null ? void 0 : o.trim();
493
- if (!d || d === L.OPEN_BRACKET)
492
+ const _ = (o = a[a.length - 1]) == null ? void 0 : o.trim();
493
+ if (!_ || _ === w.OPEN_BRACKET)
494
494
  break;
495
- const p = We.get(d), N = We.get(f);
496
- if (!p || !N)
495
+ const N = We.get(_), p = We.get(f);
496
+ if (!N || !p)
497
497
  break;
498
- if (N > p)
498
+ if (p > N)
499
499
  i.push(a.pop());
500
500
  else
501
501
  break;
502
502
  }
503
503
  a.push(l);
504
- } else if (f === L.OPEN_BRACKET)
504
+ } else if (f === w.OPEN_BRACKET)
505
505
  a.push(l);
506
- else if (f === L.CLOSE_BRACKET)
506
+ else if (f === w.CLOSE_BRACKET)
507
507
  for (; a.length > 0; ) {
508
- const d = (u = a[a.length - 1]) == null ? void 0 : u.trim();
509
- if (!d)
508
+ const _ = (u = a[a.length - 1]) == null ? void 0 : u.trim();
509
+ if (!_)
510
510
  break;
511
- if (d === L.OPEN_BRACKET) {
511
+ if (_ === w.OPEN_BRACKET) {
512
512
  a.pop();
513
513
  break;
514
514
  }
@@ -661,7 +661,7 @@ class Pt extends I {
661
661
  }
662
662
  }
663
663
  _negativeCondition(e) {
664
- return !!(Be.has(e) || e === L.OPEN_BRACKET || e === L.COMMA || e === "");
664
+ return !!(Be.has(e) || e === w.OPEN_BRACKET || e === w.COMMA || e === "");
665
665
  }
666
666
  _getSequenceArray(e) {
667
667
  const t = [];
@@ -679,14 +679,14 @@ class Pt extends I {
679
679
  const u = i[o];
680
680
  if (n === o)
681
681
  return [this._currentLexerNode, u];
682
- if (u === L.OPEN_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
682
+ if (u === w.OPEN_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
683
683
  if (this._segmentCount() > 0 || this.isLambdaOpen()) {
684
684
  this.isLambdaClose() && (this._newAndPushCurrentLexerNode(this._segment, o), this._resetSegment()), this._openBracket(
685
685
  1
686
686
  /* FUNCTION */
687
687
  ), this._closeLambda();
688
688
  const c = i[o + 1];
689
- if (c && c === L.CLOSE_BRACKET) {
689
+ if (c && c === w.CLOSE_BRACKET) {
690
690
  if (!this._setParentCurrentLexerNode() && o !== a - 1)
691
691
  return h.VALUE;
692
692
  o++;
@@ -697,14 +697,14 @@ class Pt extends I {
697
697
  0
698
698
  /* NORMAL */
699
699
  );
700
- else if (u === L.CLOSE_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose()) {
700
+ else if (u === w.CLOSE_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose()) {
701
701
  this._pushNodeToChildren(this._segment), this._resetSegment();
702
702
  const c = this._getCurrentBracket();
703
703
  if (c === 0)
704
704
  this._pushNodeToChildren(u);
705
705
  else if (c === 1) {
706
706
  const l = i[o + 1];
707
- if (l && l === L.OPEN_BRACKET) {
707
+ if (l && l === w.OPEN_BRACKET) {
708
708
  if (!this._setParentCurrentLexerNode() && o !== a - 1)
709
709
  return h.VALUE;
710
710
  this._newAndPushCurrentLexerNode(be, o, !0), this._openLambda();
@@ -713,31 +713,31 @@ class Pt extends I {
713
713
  } else
714
714
  return h.VALUE;
715
715
  this._closeBracket();
716
- } else if (u === L.OPEN_BRACES && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
716
+ } else if (u === w.OPEN_BRACES && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
717
717
  this._pushSegment(u), this._openBraces();
718
- else if (u === L.CLOSE_BRACES && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
718
+ else if (u === w.CLOSE_BRACES && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
719
719
  this._pushSegment(u), this._pushNodeToChildren(this._segment), this._resetSegment(), this._closeBraces();
720
- else if (u === L.OPEN_SQUARE_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
720
+ else if (u === w.OPEN_SQUARE_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
721
721
  this._segment.length > 0 && this._openTableBracket(), this._pushSegment(u), this._openSquareBracket();
722
- else if (u === L.CLOSE_SQUARE_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
722
+ else if (u === w.CLOSE_SQUARE_BRACKET && this.isSingleQuotationClose() && this.isDoubleQuotationClose())
723
723
  this._closeSquareBracket(), this.isSquareBracketClose() ? (this._pushSegment(u), this._isTableBracket() && (this._pushNodeToChildren(this._segment), this._resetSegment()), this._closeTableBracket()) : this._pushSegment(u);
724
- else if (u === L.DOUBLE_QUOTATION && this.isSingleQuotationClose() && this.isBracesClose() && this.isSquareBracketClose()) {
724
+ else if (u === w.DOUBLE_QUOTATION && this.isSingleQuotationClose() && this.isBracesClose() && this.isSquareBracketClose()) {
725
725
  if (this.isDoubleQuotationClose())
726
726
  this._openDoubleQuotation();
727
727
  else {
728
728
  const c = i[o + 1];
729
- c && c === L.DOUBLE_QUOTATION ? o++ : this._closeDoubleQuotation();
729
+ c && c === w.DOUBLE_QUOTATION ? o++ : this._closeDoubleQuotation();
730
730
  }
731
731
  this._pushSegment(u);
732
- } else if (u === L.SINGLE_QUOTATION && this.isDoubleQuotationClose()) {
732
+ } else if (u === w.SINGLE_QUOTATION && this.isDoubleQuotationClose()) {
733
733
  if (this.isSingleQuotationClose())
734
734
  this._openSingleQuotation();
735
735
  else {
736
736
  const c = i[o + 1];
737
- c && c === L.SINGLE_QUOTATION ? o++ : this._closeSingleQuotation();
737
+ c && c === w.SINGLE_QUOTATION ? o++ : this._closeSingleQuotation();
738
738
  }
739
739
  this._pushSegment(u);
740
- } else if (u === L.COMMA && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isBracesClose() && this.isSquareBracketClose()) {
740
+ } else if (u === w.COMMA && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isBracesClose() && this.isSquareBracketClose()) {
741
741
  const c = this._getCurrentBracket();
742
742
  if (c === 1 || c == null) {
743
743
  if (this._pushNodeToChildren(this._segment), this._resetSegment(), !this._setParentCurrentLexerNode() && o !== a - 1 && c != null)
@@ -745,32 +745,32 @@ class Pt extends I {
745
745
  this._newAndPushCurrentLexerNode(de, o);
746
746
  } else
747
747
  return h.VALUE;
748
- } else if (u === L.COLON && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isBracesClose() && this.isSquareBracketClose()) {
748
+ } else if (u === w.COLON && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isBracesClose() && this.isSquareBracketClose()) {
749
749
  const c = new y();
750
750
  c.setToken(u);
751
751
  const l = new y();
752
752
  l.setToken(de), l.setParent(c);
753
753
  const f = new y();
754
754
  f.setToken(de), f.setParent(c), c.getChildren().push(l, f);
755
- let d = c, p = 0;
755
+ let _ = c, N = 0;
756
756
  if (this._segmentCount() > 0) {
757
- let N, g, C = 0;
757
+ let p, g, C = 0;
758
758
  const R = this._segment.trim(), S = R[0], T = R[1];
759
- if (S === P.MINUS && (N = new y(), N.setToken(P.MINUS), C++), (S === P.AT || T === P.AT) && (g = new y(), g.setToken(P.AT), N && (N.addChildren(g), g.setParent(N)), C++), C > 0 && (this._segment = R.slice(C)), p = C, g)
759
+ if (S === P.MINUS && (p = new y(), p.setToken(P.MINUS), C++), (S === P.AT || T === P.AT) && (g = new y(), g.setToken(P.AT), p && (p.addChildren(g), g.setParent(p)), C++), C > 0 && (this._segment = R.slice(C)), N = C, g)
760
760
  if (g.addChildren(c), c.setParent(g), g.getParent()) {
761
761
  const G = g.getParent();
762
- G && (d = G);
762
+ G && (_ = G);
763
763
  } else
764
- d = g;
764
+ _ = g;
765
765
  else
766
- N && (d = N, N.addChildren(c), c.setParent(N));
767
- const w = new y();
768
- w.setToken(this._segment), w.setParent(l), l.getChildren().push(w), this._resetSegment();
766
+ p && (_ = p, p.addChildren(c), c.setParent(p));
767
+ const L = new y();
768
+ L.setToken(this._segment), L.setParent(l), l.getChildren().push(L), this._resetSegment();
769
769
  } else {
770
- const N = this._getLastChildCurrentLexerNode();
771
- N && N.changeToParent(l);
770
+ const p = this._getLastChildCurrentLexerNode();
771
+ p && p.changeToParent(l);
772
772
  }
773
- this._setCurrentLexerNode(d), this._currentLexerNode = f, this._openColon(p);
773
+ this._setCurrentLexerNode(_), this._currentLexerNode = f, this._openColon(N);
774
774
  } else if (Xr.has(u) && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isSquareBracketClose()) {
775
775
  this._pushNodeToChildren(this._segment);
776
776
  const c = new y();
@@ -836,12 +836,12 @@ let ce = class extends I {
836
836
  this._arrayFormulaCellData[e][n]
837
837
  )), i.forValue((l, f) => {
838
838
  var R;
839
- const d = (R = a == null ? void 0 : a[l]) == null ? void 0 : R[f];
840
- if (d == null)
839
+ const _ = (R = a == null ? void 0 : a[l]) == null ? void 0 : R[f];
840
+ if (_ == null)
841
841
  return !0;
842
- const { startRow: p, startColumn: N, endRow: g, endColumn: C } = d;
843
- for (let S = p; S <= g; S++)
844
- for (let T = N; T <= C; T++)
842
+ const { startRow: N, startColumn: p, endRow: g, endColumn: C } = _;
843
+ for (let S = N; S <= g; S++)
844
+ for (let T = p; T <= C; T++)
845
845
  o.setValue(S, T, null);
846
846
  }), this._arrayFormulaCellData[e][n] = o.getData();
847
847
  });
@@ -859,9 +859,9 @@ let ce = class extends I {
859
859
  const l = a == null ? void 0 : a.getValue(u, c);
860
860
  if (l == null)
861
861
  return !0;
862
- const { startRow: f, startColumn: d, endRow: p, endColumn: N } = l;
863
- for (let g = f; g <= p; g++)
864
- for (let C = d; C <= N; C++)
862
+ const { startRow: f, startColumn: _, endRow: N, endColumn: p } = l;
863
+ for (let g = f; g <= N; g++)
864
+ for (let C = _; C <= p; C++)
865
865
  o.setValue(g, C, null);
866
866
  }), i.forValue((u, c, l) => {
867
867
  o.setValue(u, c, l);
@@ -940,45 +940,45 @@ let ce = class extends I {
940
940
  const u = o[r];
941
941
  u[e] == null && (u[e] = {});
942
942
  const c = new O(u[e]);
943
- n.forValue((l, f, d) => {
944
- const p = (d == null ? void 0 : d.f) || "", N = (d == null ? void 0 : d.si) || "", g = we(p), C = Fe(N);
943
+ n.forValue((l, f, _) => {
944
+ const N = (_ == null ? void 0 : _.f) || "", p = (_ == null ? void 0 : _.si) || "", g = Le(N), C = Fe(p);
945
945
  if (g && C)
946
946
  c.setValue(l, f, {
947
- f: p,
948
- si: N
949
- }), i.set(N, { f: p, r: l, c: f });
947
+ f: N,
948
+ si: p
949
+ }), i.set(p, { f: N, r: l, c: f });
950
950
  else if (g && !C)
951
951
  c.setValue(l, f, {
952
- f: p
952
+ f: N
953
953
  });
954
954
  else if (!g && C)
955
955
  c.setValue(l, f, {
956
956
  f: "",
957
- si: N
957
+ si: p
958
958
  });
959
959
  else if (!g && !C && c.getValue(l, f)) {
960
960
  const R = c.getValue(l, f), S = (R == null ? void 0 : R.f) || "", T = (R == null ? void 0 : R.si) || "";
961
- we(S) && Fe(T) && a.set(T, S), c.realDeleteValue(l, f);
961
+ Le(S) && Fe(T) && a.set(T, S), c.realDeleteValue(l, f);
962
962
  }
963
- }), c.forValue((l, f, d) => {
964
- const p = (d == null ? void 0 : d.f) || "", N = (d == null ? void 0 : d.si) || "";
965
- if (Fe(N)) {
966
- const g = i.get(N), C = a.get(N);
967
- if (g && !we(p)) {
963
+ }), c.forValue((l, f, _) => {
964
+ const N = (_ == null ? void 0 : _.f) || "", p = (_ == null ? void 0 : _.si) || "";
965
+ if (Fe(p)) {
966
+ const g = i.get(p), C = a.get(p);
967
+ if (g && !Le(N)) {
968
968
  const R = g.f, S = f - g.c, T = l - g.r;
969
- c.setValue(l, f, { f: R, si: N, x: S, y: T });
969
+ c.setValue(l, f, { f: R, si: p, x: S, y: T });
970
970
  } else if (typeof C == "string") {
971
- const R = d.x || 0, S = d.y || 0, T = this._lexerTreeBuilder.moveFormulaRefOffset(C, R, S);
972
- a.set(N, {
971
+ const R = _.x || 0, S = _.y || 0, T = this._lexerTreeBuilder.moveFormulaRefOffset(C, R, S);
972
+ a.set(p, {
973
973
  r: l,
974
974
  c: f,
975
975
  f: T
976
- }), c.setValue(l, f, { f: T, si: N });
976
+ }), c.setValue(l, f, { f: T, si: p });
977
977
  } else if (typeof C == "object") {
978
978
  const R = f - C.c, S = l - C.r;
979
979
  c.setValue(l, f, {
980
980
  f: C.f,
981
- si: N,
981
+ si: p,
982
982
  x: R,
983
983
  y: S
984
984
  });
@@ -996,8 +996,8 @@ let ce = class extends I {
996
996
  const a = new O(i[e]);
997
997
  let o = null;
998
998
  return a.forValue((u, c, l) => {
999
- const { f, si: d, x: p = 0, y: N = 0 } = l;
1000
- if (d === r && f.length > 0 && p === 0 && N === 0)
999
+ const { f, si: _, x: N = 0, y: p = 0 } = l;
1000
+ if (_ === r && f.length > 0 && N === 0 && p === 0)
1001
1001
  return o = l, !1;
1002
1002
  }), o;
1003
1003
  }
@@ -1011,8 +1011,8 @@ let ce = class extends I {
1011
1011
  return t;
1012
1012
  const i = n[r];
1013
1013
  return i[e] == null || new O(i[e]).forValue((o, u, c) => {
1014
- const l = (c == null ? void 0 : c.f) || "", f = (c == null ? void 0 : c.si) || "", d = (c == null ? void 0 : c.x) || 0, p = (c == null ? void 0 : c.y) || 0;
1015
- we(l) && Fe(f) && d === 0 && p === 0 && t.set(f, { f: l, r: o, c: u });
1014
+ const l = (c == null ? void 0 : c.f) || "", f = (c == null ? void 0 : c.si) || "", _ = (c == null ? void 0 : c.x) || 0, N = (c == null ? void 0 : c.y) || 0;
1015
+ Le(l) && Fe(f) && _ === 0 && N === 0 && t.set(f, { f: l, r: o, c: u });
1016
1016
  }), t;
1017
1017
  }
1018
1018
  };
@@ -1023,23 +1023,23 @@ ce = cn([
1023
1023
  function ln(s, r, e, t) {
1024
1024
  const n = /* @__PURE__ */ new Map(), i = new O();
1025
1025
  t.forValue((a, o, u) => {
1026
- const c = (u == null ? void 0 : u.f) || "", l = (u == null ? void 0 : u.si) || "", f = we(c), d = Fe(l);
1027
- f && d ? (i.setValue(a, o, {
1026
+ const c = (u == null ? void 0 : u.f) || "", l = (u == null ? void 0 : u.si) || "", f = Le(c), _ = Fe(l);
1027
+ f && _ ? (i.setValue(a, o, {
1028
1028
  f: c,
1029
1029
  si: l
1030
- }), n.set(l, { f: c, r: a, c: o })) : f && !d ? i.setValue(a, o, {
1030
+ }), n.set(l, { f: c, r: a, c: o })) : f && !_ ? i.setValue(a, o, {
1031
1031
  f: c
1032
- }) : !f && d && i.setValue(a, o, {
1032
+ }) : !f && _ && i.setValue(a, o, {
1033
1033
  f: "",
1034
1034
  si: l
1035
1035
  });
1036
1036
  }), i.forValue((a, o, u) => {
1037
1037
  const c = (u == null ? void 0 : u.f) || "", l = (u == null ? void 0 : u.si) || "";
1038
- if (Fe(l) && !we(c)) {
1038
+ if (Fe(l) && !Le(c)) {
1039
1039
  const f = n.get(l);
1040
1040
  if (f) {
1041
- const d = f.f, p = o - f.c, N = a - f.r;
1042
- i.setValue(a, o, { f: d, si: l, x: p, y: N });
1041
+ const _ = f.f, N = o - f.c, p = a - f.r;
1042
+ i.setValue(a, o, { f: _, si: l, x: N, y: p });
1043
1043
  }
1044
1044
  }
1045
1045
  }), s[r][e] = i.getData();
@@ -1081,7 +1081,7 @@ const Zi = (s) => {
1081
1081
  id: "formula.mutation.set-formula-calculation-stop",
1082
1082
  type: Q.MUTATION,
1083
1083
  handler: () => !0
1084
- }, Lt = {
1084
+ }, wt = {
1085
1085
  id: "formula.mutation.set-formula-calculation-notification",
1086
1086
  type: Q.MUTATION,
1087
1087
  handler: () => !0
@@ -1276,34 +1276,34 @@ class ve extends Dr {
1276
1276
  return !1;
1277
1277
  }
1278
1278
  getNegative() {
1279
- return _.create(h.NAME);
1279
+ return d.create(h.NAME);
1280
1280
  }
1281
1281
  getReciprocal() {
1282
- return _.create(h.NAME);
1282
+ return d.create(h.NAME);
1283
1283
  }
1284
1284
  plus(r) {
1285
- return _.create(h.NAME);
1285
+ return d.create(h.NAME);
1286
1286
  }
1287
1287
  minus(r) {
1288
- return _.create(h.NAME);
1288
+ return d.create(h.NAME);
1289
1289
  }
1290
1290
  multiply(r) {
1291
- return _.create(h.NAME);
1291
+ return d.create(h.NAME);
1292
1292
  }
1293
1293
  divided(r) {
1294
- return _.create(h.NAME);
1294
+ return d.create(h.NAME);
1295
1295
  }
1296
1296
  map(r) {
1297
- return _.create(h.NAME);
1297
+ return d.create(h.NAME);
1298
1298
  }
1299
1299
  product(r, e) {
1300
1300
  return e(this, r);
1301
1301
  }
1302
1302
  compare(r, e) {
1303
- return _.create(h.NAME);
1303
+ return d.create(h.NAME);
1304
1304
  }
1305
1305
  wildcard(r, e) {
1306
- return _.create(h.NAME);
1306
+ return d.create(h.NAME);
1307
1307
  }
1308
1308
  isEqual(r) {
1309
1309
  return this.compare(r, A.EQUALS);
@@ -1324,25 +1324,25 @@ class ve extends Dr {
1324
1324
  return this.compare(r, A.GREATER_THAN);
1325
1325
  }
1326
1326
  concatenateFront(r) {
1327
- return _.create(h.NAME);
1327
+ return d.create(h.NAME);
1328
1328
  }
1329
1329
  concatenateBack(r) {
1330
- return _.create(h.NAME);
1330
+ return d.create(h.NAME);
1331
1331
  }
1332
1332
  plusBy(r) {
1333
- return _.create(h.NAME);
1333
+ return d.create(h.NAME);
1334
1334
  }
1335
1335
  minusBy(r) {
1336
- return _.create(h.NAME);
1336
+ return d.create(h.NAME);
1337
1337
  }
1338
1338
  multiplyBy(r) {
1339
- return _.create(h.NAME);
1339
+ return d.create(h.NAME);
1340
1340
  }
1341
1341
  dividedBy(r) {
1342
- return _.create(h.NAME);
1342
+ return d.create(h.NAME);
1343
1343
  }
1344
1344
  compareBy(r, e) {
1345
- return _.create(h.NAME);
1345
+ return d.create(h.NAME);
1346
1346
  }
1347
1347
  concatenate(r, e = W.FRONT) {
1348
1348
  let t = this.getValue().toString();
@@ -1357,52 +1357,52 @@ class ve extends Dr {
1357
1357
  return t;
1358
1358
  }
1359
1359
  pow(r) {
1360
- return _.create(h.VALUE);
1360
+ return d.create(h.VALUE);
1361
1361
  }
1362
1362
  powInverse(r) {
1363
- return _.create(h.VALUE);
1363
+ return d.create(h.VALUE);
1364
1364
  }
1365
1365
  sqrt() {
1366
- return _.create(h.VALUE);
1366
+ return d.create(h.VALUE);
1367
1367
  }
1368
1368
  cbrt() {
1369
- return _.create(h.VALUE);
1369
+ return d.create(h.VALUE);
1370
1370
  }
1371
1371
  cos() {
1372
- return _.create(h.VALUE);
1372
+ return d.create(h.VALUE);
1373
1373
  }
1374
1374
  acos() {
1375
- return _.create(h.VALUE);
1375
+ return d.create(h.VALUE);
1376
1376
  }
1377
1377
  acosh() {
1378
- return _.create(h.VALUE);
1378
+ return d.create(h.VALUE);
1379
1379
  }
1380
1380
  sin() {
1381
- return _.create(h.VALUE);
1381
+ return d.create(h.VALUE);
1382
1382
  }
1383
1383
  asin() {
1384
- return _.create(h.VALUE);
1384
+ return d.create(h.VALUE);
1385
1385
  }
1386
1386
  asinh() {
1387
- return _.create(h.VALUE);
1387
+ return d.create(h.VALUE);
1388
1388
  }
1389
1389
  tan() {
1390
- return _.create(h.VALUE);
1390
+ return d.create(h.VALUE);
1391
1391
  }
1392
1392
  tanh() {
1393
- return _.create(h.VALUE);
1393
+ return d.create(h.VALUE);
1394
1394
  }
1395
1395
  atan() {
1396
- return _.create(h.VALUE);
1396
+ return d.create(h.VALUE);
1397
1397
  }
1398
1398
  atan2(r) {
1399
- return _.create(h.VALUE);
1399
+ return d.create(h.VALUE);
1400
1400
  }
1401
1401
  atan2Inverse(r) {
1402
- return _.create(h.VALUE);
1402
+ return d.create(h.VALUE);
1403
1403
  }
1404
1404
  atanh() {
1405
- return _.create(h.VALUE);
1405
+ return d.create(h.VALUE);
1406
1406
  }
1407
1407
  /**
1408
1408
  * Calculate the mean of the entire array.
@@ -1439,42 +1439,42 @@ class ve extends Dr {
1439
1439
  return this;
1440
1440
  }
1441
1441
  log() {
1442
- return _.create(h.VALUE);
1442
+ return d.create(h.VALUE);
1443
1443
  }
1444
1444
  log10() {
1445
- return _.create(h.VALUE);
1445
+ return d.create(h.VALUE);
1446
1446
  }
1447
1447
  exp() {
1448
- return _.create(h.VALUE);
1448
+ return d.create(h.VALUE);
1449
1449
  }
1450
1450
  abs() {
1451
- return _.create(h.VALUE);
1451
+ return d.create(h.VALUE);
1452
1452
  }
1453
1453
  round(r) {
1454
- return _.create(h.VALUE);
1454
+ return d.create(h.VALUE);
1455
1455
  }
1456
1456
  roundInverse(r) {
1457
- return _.create(h.VALUE);
1457
+ return d.create(h.VALUE);
1458
1458
  }
1459
1459
  floor(r) {
1460
- return _.create(h.VALUE);
1460
+ return d.create(h.VALUE);
1461
1461
  }
1462
1462
  floorInverse(r) {
1463
- return _.create(h.VALUE);
1463
+ return d.create(h.VALUE);
1464
1464
  }
1465
1465
  ceil(r) {
1466
- return _.create(h.VALUE);
1466
+ return d.create(h.VALUE);
1467
1467
  }
1468
1468
  ceilInverse(r) {
1469
- return _.create(h.VALUE);
1469
+ return d.create(h.VALUE);
1470
1470
  }
1471
1471
  }
1472
- class _ extends ve {
1472
+ class d extends ve {
1473
1473
  constructor(r, e = "") {
1474
1474
  super(r), this._errorType = r, this._errorContent = e;
1475
1475
  }
1476
1476
  static create(r, e) {
1477
- return new _(r, e);
1477
+ return new d(r, e);
1478
1478
  }
1479
1479
  getErrorType() {
1480
1480
  return this._errorType;
@@ -1490,11 +1490,11 @@ class _ extends ve {
1490
1490
  }
1491
1491
  }
1492
1492
  var Cn = 20, En = 1, Ae = 1e6, Kt = 1e6, pn = -7, Nn = 21, An = !1, qe = "[big.js] ", De = qe + "Invalid ", dt = De + "decimal places", Rn = De + "rounding mode", yr = qe + "Division by zero", F = {}, Z = void 0, Sn = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
1493
- function Lr() {
1493
+ function wr() {
1494
1494
  function s(r) {
1495
1495
  var e = this;
1496
1496
  if (!(e instanceof s))
1497
- return r === Z ? Lr() : new s(r);
1497
+ return r === Z ? wr() : new s(r);
1498
1498
  if (r instanceof s)
1499
1499
  e.s = r.s, e.e = r.e, e.c = r.c.slice();
1500
1500
  else {
@@ -1587,8 +1587,8 @@ F.div = function(s) {
1587
1587
  throw Error(yr);
1588
1588
  if (!t[0])
1589
1589
  return s.s = i, s.c = [s.e = 0], s;
1590
- var o, u, c, l, f, d = n.slice(), p = o = n.length, N = t.length, g = t.slice(0, o), C = g.length, R = s, S = R.c = [], T = 0, w = a + (R.e = r.e - s.e) + 1;
1591
- for (R.s = i, i = w < 0 ? 0 : w, d.unshift(0); C++ < o; )
1590
+ var o, u, c, l, f, _ = n.slice(), N = o = n.length, p = t.length, g = t.slice(0, o), C = g.length, R = s, S = R.c = [], T = 0, L = a + (R.e = r.e - s.e) + 1;
1591
+ for (R.s = i, i = L < 0 ? 0 : L, _.unshift(0); C++ < o; )
1592
1592
  g.push(0);
1593
1593
  do {
1594
1594
  for (c = 0; c < 10; c++) {
@@ -1601,7 +1601,7 @@ F.div = function(s) {
1601
1601
  break;
1602
1602
  }
1603
1603
  if (l < 0) {
1604
- for (u = C == o ? n : d; C; ) {
1604
+ for (u = C == o ? n : _; C; ) {
1605
1605
  if (g[--C] < u[C]) {
1606
1606
  for (f = C; f && !g[--f]; )
1607
1607
  g[f] = 9;
@@ -1614,9 +1614,9 @@ F.div = function(s) {
1614
1614
  } else
1615
1615
  break;
1616
1616
  }
1617
- S[T++] = l ? c : ++c, g[0] && l ? g[C] = t[p] || 0 : g = [t[p]];
1618
- } while ((p++ < N || g[0] !== Z) && i--);
1619
- return !S[0] && T != 1 && (S.shift(), R.e--, w--), T > w && ye(R, w, e.RM, g[0] !== Z), R;
1617
+ S[T++] = l ? c : ++c, g[0] && l ? g[C] = t[N] || 0 : g = [t[N]];
1618
+ } while ((N++ < p || g[0] !== Z) && i--);
1619
+ return !S[0] && T != 1 && (S.shift(), R.e--, L--), T > L && ye(R, L, e.RM, g[0] !== Z), R;
1620
1620
  };
1621
1621
  F.eq = function(s) {
1622
1622
  return this.cmp(s) === 0;
@@ -1637,11 +1637,11 @@ F.minus = F.sub = function(s) {
1637
1637
  var r, e, t, n, i = this, a = i.constructor, o = i.s, u = (s = new a(s)).s;
1638
1638
  if (o != u)
1639
1639
  return s.s = -u, i.plus(s);
1640
- var c = i.c.slice(), l = i.e, f = s.c, d = s.e;
1640
+ var c = i.c.slice(), l = i.e, f = s.c, _ = s.e;
1641
1641
  if (!c[0] || !f[0])
1642
1642
  return f[0] ? s.s = -u : c[0] ? s = new a(i) : s.s = 1, s;
1643
- if (o = l - d) {
1644
- for ((n = o < 0) ? (o = -o, t = c) : (d = l, t = f), t.reverse(), u = o; u--; )
1643
+ if (o = l - _) {
1644
+ for ((n = o < 0) ? (o = -o, t = c) : (_ = l, t = f), t.reverse(), u = o; u--; )
1645
1645
  t.push(0);
1646
1646
  t.reverse();
1647
1647
  } else
@@ -1664,8 +1664,8 @@ F.minus = F.sub = function(s) {
1664
1664
  for (; c[--u] === 0; )
1665
1665
  c.pop();
1666
1666
  for (; c[0] === 0; )
1667
- c.shift(), --d;
1668
- return c[0] || (s.s = 1, c = [d = 0]), s.c = c, s.e = d, s;
1667
+ c.shift(), --_;
1668
+ return c[0] || (s.s = 1, c = [_ = 0]), s.c = c, s.e = _, s;
1669
1669
  };
1670
1670
  F.mod = function(s) {
1671
1671
  var r, e = this, t = e.constructor, n = e.s, i = (s = new t(s)).s;
@@ -1788,8 +1788,8 @@ F.valueOf = function() {
1788
1788
  throw Error(qe + "valueOf disallowed");
1789
1789
  return Me(s, s.e <= r.NE || s.e >= r.PE, !0);
1790
1790
  };
1791
- var $ = Lr();
1792
- function wt(s) {
1791
+ var $ = wr();
1792
+ function Lt(s) {
1793
1793
  let r;
1794
1794
  switch (s) {
1795
1795
  case A.EQUALS:
@@ -1831,7 +1831,7 @@ function Jt(s, r) {
1831
1831
  function er(s, r) {
1832
1832
  return s ** r;
1833
1833
  }
1834
- class wr extends ve {
1834
+ class Lr extends ve {
1835
1835
  isNull() {
1836
1836
  return !0;
1837
1837
  }
@@ -1914,16 +1914,16 @@ class wr extends ve {
1914
1914
  return new E(0, !0);
1915
1915
  }
1916
1916
  log() {
1917
- return _.create(h.NUM);
1917
+ return d.create(h.NUM);
1918
1918
  }
1919
1919
  log10() {
1920
- return _.create(h.NUM);
1920
+ return d.create(h.NUM);
1921
1921
  }
1922
1922
  exp() {
1923
- return _.create(h.NUM);
1923
+ return d.create(h.NUM);
1924
1924
  }
1925
1925
  abs() {
1926
- return _.create(h.NUM);
1926
+ return d.create(h.NUM);
1927
1927
  }
1928
1928
  round(r) {
1929
1929
  return new E(0, !0).round(r);
@@ -1963,7 +1963,7 @@ class Y extends ve {
1963
1963
  return e && (t = 1), new E(-t, !0);
1964
1964
  }
1965
1965
  getReciprocal() {
1966
- return this.getValue() ? new E(1, !0) : _.create(h.DIV_BY_ZERO);
1966
+ return this.getValue() ? new E(1, !0) : d.create(h.DIV_BY_ZERO);
1967
1967
  }
1968
1968
  plus(e) {
1969
1969
  return this._convertTonNumber().plus(e);
@@ -2114,17 +2114,17 @@ class E extends ve {
2114
2114
  return e.isArray() ? e.concatenateFront(this) : new j(this.concatenate(e.getValue(), W.BACK));
2115
2115
  }
2116
2116
  compare(e, t) {
2117
- return e.isArray() ? e.compare(this, wt(t)) : this.compareBy(e.getValue(), t);
2117
+ return e.isArray() ? e.compare(this, Lt(t)) : this.compareBy(e.getValue(), t);
2118
2118
  }
2119
2119
  plusBy(e) {
2120
2120
  const t = this.getValue();
2121
2121
  if (typeof e == "string")
2122
- return _.create(h.VALUE);
2122
+ return d.create(h.VALUE);
2123
2123
  if (typeof e == "number") {
2124
2124
  if (!Number.isFinite(t) || !Number.isFinite(e))
2125
- return _.create(h.NUM);
2125
+ return d.create(h.NUM);
2126
2126
  const n = $(t).plus(e).toNumber();
2127
- return Number.isFinite(n) ? new E(n) : _.create(h.NUM);
2127
+ return Number.isFinite(n) ? new E(n) : d.create(h.NUM);
2128
2128
  }
2129
2129
  return typeof e == "boolean" ? new E(
2130
2130
  $(t).plus(e ? 1 : 0).toNumber()
@@ -2133,12 +2133,12 @@ class E extends ve {
2133
2133
  minusBy(e) {
2134
2134
  const t = this.getValue();
2135
2135
  if (typeof e == "string")
2136
- return _.create(h.VALUE);
2136
+ return d.create(h.VALUE);
2137
2137
  if (typeof e == "number") {
2138
2138
  if (!Number.isFinite(t) || !Number.isFinite(e))
2139
- return _.create(h.NUM);
2139
+ return d.create(h.NUM);
2140
2140
  const n = $(t).minus(e).toNumber();
2141
- return Number.isFinite(n) ? new E(n) : _.create(h.NUM);
2141
+ return Number.isFinite(n) ? new E(n) : d.create(h.NUM);
2142
2142
  }
2143
2143
  return typeof e == "boolean" ? new E(
2144
2144
  $(t).minus(e ? 1 : 0).toNumber()
@@ -2147,12 +2147,12 @@ class E extends ve {
2147
2147
  multiplyBy(e) {
2148
2148
  const t = this.getValue();
2149
2149
  if (typeof e == "string")
2150
- return _.create(h.VALUE);
2150
+ return d.create(h.VALUE);
2151
2151
  if (typeof e == "number") {
2152
2152
  if (!Number.isFinite(t) || !Number.isFinite(e))
2153
- return _.create(h.NUM);
2153
+ return d.create(h.NUM);
2154
2154
  const n = $(t).times(e).toNumber();
2155
- return Number.isFinite(n) ? new E(n) : _.create(h.NUM);
2155
+ return Number.isFinite(n) ? new E(n) : d.create(h.NUM);
2156
2156
  }
2157
2157
  return typeof e == "boolean" ? new E(
2158
2158
  $(t).times(e ? 1 : 0).toNumber()
@@ -2161,16 +2161,16 @@ class E extends ve {
2161
2161
  dividedBy(e) {
2162
2162
  const t = this.getValue();
2163
2163
  if (typeof e == "string")
2164
- return _.create(h.VALUE);
2164
+ return d.create(h.VALUE);
2165
2165
  if (typeof e == "number") {
2166
2166
  if (e === 0)
2167
- return _.create(h.DIV_BY_ZERO);
2167
+ return d.create(h.DIV_BY_ZERO);
2168
2168
  if (!Number.isFinite(t) || !Number.isFinite(e))
2169
- return _.create(h.NUM);
2169
+ return d.create(h.NUM);
2170
2170
  const n = $(t).div(e).toNumber();
2171
- return Number.isFinite(n) ? new E(n) : _.create(h.NUM);
2171
+ return Number.isFinite(n) ? new E(n) : d.create(h.NUM);
2172
2172
  }
2173
- return typeof e == "boolean" ? e === !1 ? _.create(h.DIV_BY_ZERO) : new E($(t).div(1).toNumber()) : this;
2173
+ return typeof e == "boolean" ? e === !1 ? d.create(h.DIV_BY_ZERO) : new E($(t).div(1).toNumber()) : this;
2174
2174
  }
2175
2175
  compareBy(e, t) {
2176
2176
  const n = this.getValue();
@@ -2232,152 +2232,152 @@ class E extends ve {
2232
2232
  return e.powInverse(this);
2233
2233
  const t = this.getValue(), n = e.getValue();
2234
2234
  if (typeof n == "string")
2235
- return _.create(h.VALUE);
2235
+ return d.create(h.VALUE);
2236
2236
  if (typeof n == "number") {
2237
2237
  if (!Number.isFinite(t) || !Number.isFinite(n))
2238
- return _.create(h.NUM);
2238
+ return d.create(h.NUM);
2239
2239
  const i = er(t, n);
2240
- return Number.isFinite(i) ? new E(i) : _.create(h.NUM);
2240
+ return Number.isFinite(i) ? new E(i) : d.create(h.NUM);
2241
2241
  }
2242
2242
  return typeof n == "boolean" ? new E(er(t, n ? 1 : 0)) : this;
2243
2243
  }
2244
2244
  sqrt() {
2245
2245
  const e = this.getValue();
2246
2246
  if (!Number.isFinite(e))
2247
- return _.create(h.NUM);
2247
+ return d.create(h.NUM);
2248
2248
  const t = $(e).sqrt().toNumber();
2249
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2249
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2250
2250
  }
2251
2251
  cbrt() {
2252
2252
  const e = this.getValue();
2253
2253
  if (!Number.isFinite(e))
2254
- return _.create(h.NUM);
2254
+ return d.create(h.NUM);
2255
2255
  const t = Math.cbrt(e);
2256
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2256
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2257
2257
  }
2258
2258
  cos() {
2259
2259
  const e = this.getValue();
2260
2260
  if (!Number.isFinite(e))
2261
- return _.create(h.NUM);
2261
+ return d.create(h.NUM);
2262
2262
  const t = Math.cos(e);
2263
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2263
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2264
2264
  }
2265
2265
  acos() {
2266
2266
  const e = this.getValue();
2267
2267
  if (!Number.isFinite(e))
2268
- return _.create(h.NUM);
2268
+ return d.create(h.NUM);
2269
2269
  const t = Math.acos(e);
2270
- return Number.isNaN(t) ? _.create(h.NUM) : new E(t);
2270
+ return Number.isNaN(t) ? d.create(h.NUM) : new E(t);
2271
2271
  }
2272
2272
  acosh() {
2273
2273
  const e = this.getValue();
2274
2274
  if (!Number.isFinite(e))
2275
- return _.create(h.NUM);
2275
+ return d.create(h.NUM);
2276
2276
  const t = Math.acosh(e);
2277
- return Number.isNaN(t) ? _.create(h.NUM) : new E(t);
2277
+ return Number.isNaN(t) ? d.create(h.NUM) : new E(t);
2278
2278
  }
2279
2279
  sin() {
2280
2280
  const e = this.getValue();
2281
2281
  if (!Number.isFinite(e))
2282
- return _.create(h.NUM);
2282
+ return d.create(h.NUM);
2283
2283
  const t = Math.sin(e);
2284
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2284
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2285
2285
  }
2286
2286
  asin() {
2287
2287
  const e = this.getValue();
2288
2288
  if (!Number.isFinite(e))
2289
- return _.create(h.NUM);
2289
+ return d.create(h.NUM);
2290
2290
  const t = Math.asin(e);
2291
- return Number.isNaN(t) ? _.create(h.NUM) : new E(t);
2291
+ return Number.isNaN(t) ? d.create(h.NUM) : new E(t);
2292
2292
  }
2293
2293
  asinh() {
2294
2294
  const e = this.getValue();
2295
2295
  if (!Number.isFinite(e))
2296
- return _.create(h.NUM);
2296
+ return d.create(h.NUM);
2297
2297
  const t = Math.asinh(e);
2298
- return Number.isNaN(t) ? _.create(h.NUM) : new E(t);
2298
+ return Number.isNaN(t) ? d.create(h.NUM) : new E(t);
2299
2299
  }
2300
2300
  tan() {
2301
2301
  const e = this.getValue();
2302
2302
  if (!Number.isFinite(e))
2303
- return _.create(h.NUM);
2303
+ return d.create(h.NUM);
2304
2304
  const t = Math.tan(e);
2305
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2305
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2306
2306
  }
2307
2307
  tanh() {
2308
2308
  const e = this.getValue();
2309
2309
  if (!Number.isFinite(e))
2310
- return _.create(h.NUM);
2310
+ return d.create(h.NUM);
2311
2311
  const t = Math.tanh(e);
2312
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2312
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2313
2313
  }
2314
2314
  atan() {
2315
2315
  const e = this.getValue();
2316
2316
  if (!Number.isFinite(e))
2317
- return _.create(h.NUM);
2317
+ return d.create(h.NUM);
2318
2318
  const t = Math.atan(e);
2319
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2319
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2320
2320
  }
2321
2321
  atan2(e) {
2322
2322
  if (e.isArray())
2323
2323
  return e.atan2Inverse(this);
2324
2324
  const t = this.getValue(), n = e.getValue();
2325
2325
  if (typeof n == "string")
2326
- return _.create(h.VALUE);
2326
+ return d.create(h.VALUE);
2327
2327
  if (typeof n == "number") {
2328
2328
  if (!Number.isFinite(t) || !Number.isFinite(n))
2329
- return _.create(h.NUM);
2329
+ return d.create(h.NUM);
2330
2330
  const i = Math.atan2(t, n);
2331
- return Number.isFinite(i) ? new E(i) : _.create(h.NUM);
2331
+ return Number.isFinite(i) ? new E(i) : d.create(h.NUM);
2332
2332
  }
2333
2333
  return typeof n == "boolean" ? new E(Math.atan2(t, n ? 1 : 0)) : this;
2334
2334
  }
2335
2335
  atanh() {
2336
2336
  const e = this.getValue();
2337
2337
  if (!Number.isFinite(e))
2338
- return _.create(h.NUM);
2338
+ return d.create(h.NUM);
2339
2339
  const t = Math.atanh(e);
2340
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2340
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2341
2341
  }
2342
2342
  log() {
2343
2343
  const e = this.getValue();
2344
2344
  if (typeof e == "number" && e <= 0 || !Number.isFinite(e))
2345
- return _.create(h.NUM);
2345
+ return d.create(h.NUM);
2346
2346
  const t = Math.log(e);
2347
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2347
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2348
2348
  }
2349
2349
  log10() {
2350
2350
  const e = this.getValue();
2351
2351
  if (typeof e == "number" && e <= 0 || !Number.isFinite(e))
2352
- return _.create(h.NUM);
2352
+ return d.create(h.NUM);
2353
2353
  const t = Math.log10(e);
2354
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2354
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2355
2355
  }
2356
2356
  exp() {
2357
2357
  const e = this.getValue();
2358
2358
  if (!Number.isFinite(e))
2359
- return _.create(h.NUM);
2359
+ return d.create(h.NUM);
2360
2360
  const t = Math.exp(e);
2361
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2361
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2362
2362
  }
2363
2363
  abs() {
2364
2364
  const e = this.getValue();
2365
2365
  if (!Number.isFinite(e))
2366
- return _.create(h.NUM);
2366
+ return d.create(h.NUM);
2367
2367
  const t = Math.abs(e);
2368
- return Number.isFinite(t) ? new E(t) : _.create(h.NUM);
2368
+ return Number.isFinite(t) ? new E(t) : d.create(h.NUM);
2369
2369
  }
2370
2370
  round(e) {
2371
2371
  if (e.isArray())
2372
2372
  return e.roundInverse(this);
2373
2373
  const t = this.getValue(), n = e.getValue();
2374
2374
  if (typeof n == "string")
2375
- return _.create(h.VALUE);
2375
+ return d.create(h.VALUE);
2376
2376
  if (typeof n == "number") {
2377
2377
  if (!Number.isFinite(t) || !Number.isFinite(n))
2378
- return _.create(h.NUM);
2378
+ return d.create(h.NUM);
2379
2379
  const i = Wt(t, n);
2380
- return Number.isFinite(i) ? new E(i) : _.create(h.NUM);
2380
+ return Number.isFinite(i) ? new E(i) : d.create(h.NUM);
2381
2381
  }
2382
2382
  return typeof n == "boolean" ? new E(Wt(t, n ? 1 : 0)) : this;
2383
2383
  }
@@ -2386,12 +2386,12 @@ class E extends ve {
2386
2386
  return e.floorInverse(this);
2387
2387
  const t = this.getValue(), n = e.getValue();
2388
2388
  if (typeof n == "string")
2389
- return _.create(h.VALUE);
2389
+ return d.create(h.VALUE);
2390
2390
  if (typeof n == "number") {
2391
2391
  if (!Number.isFinite(t) || !Number.isFinite(n))
2392
- return _.create(h.NUM);
2392
+ return d.create(h.NUM);
2393
2393
  const i = Zt(t, n);
2394
- return Number.isFinite(i) ? new E(i) : _.create(h.NUM);
2394
+ return Number.isFinite(i) ? new E(i) : d.create(h.NUM);
2395
2395
  }
2396
2396
  return typeof n == "boolean" ? new E(Zt(t, n ? 1 : 0)) : this;
2397
2397
  }
@@ -2400,12 +2400,12 @@ class E extends ve {
2400
2400
  return e.ceilInverse(this);
2401
2401
  const t = this.getValue(), n = e.getValue();
2402
2402
  if (typeof n == "string")
2403
- return _.create(h.VALUE);
2403
+ return d.create(h.VALUE);
2404
2404
  if (typeof n == "number") {
2405
2405
  if (!Number.isFinite(t) || !Number.isFinite(n))
2406
- return _.create(h.NUM);
2406
+ return d.create(h.NUM);
2407
2407
  const i = Jt(t, n);
2408
- return Number.isFinite(i) ? new E(i) : _.create(h.NUM);
2408
+ return Number.isFinite(i) ? new E(i) : d.create(h.NUM);
2409
2409
  }
2410
2410
  return typeof n == "boolean" ? new E(Jt(t, n ? 1 : 0)) : this;
2411
2411
  }
@@ -2458,10 +2458,10 @@ class j extends ve {
2458
2458
  return e.isArray() ? e.concatenateFront(this) : new j(this.concatenate(e.getValue(), W.BACK));
2459
2459
  }
2460
2460
  compare(e, t) {
2461
- return e.isArray() ? e.compare(this, wt(t)) : this.compareBy(e.getValue(), t);
2461
+ return e.isArray() ? e.compare(this, Lt(t)) : this.compareBy(e.getValue(), t);
2462
2462
  }
2463
2463
  wildcard(e, t) {
2464
- return e.isArray() ? e.wildcard(this, wt(t)) : this._checkWildcard(e.getValue(), t);
2464
+ return e.isArray() ? e.wildcard(this, Lt(t)) : this._checkWildcard(e.getValue(), t);
2465
2465
  }
2466
2466
  compareBy(e, t) {
2467
2467
  const n = this.getValue();
@@ -2523,7 +2523,7 @@ class j extends ve {
2523
2523
  function yn(s) {
2524
2524
  return "";
2525
2525
  }
2526
- function Ln(s = []) {
2526
+ function wn(s = []) {
2527
2527
  const r = [];
2528
2528
  for (let e = 0; e < s.length; e++) {
2529
2529
  const t = s[e];
@@ -2677,12 +2677,12 @@ class pe extends ve {
2677
2677
  let n = 0, i = this._rowCount - 1, a = 1, o = 0, u = this._columnCount - 1, c = 1;
2678
2678
  e != null && (n = e[0] || 0, i = e[1] || this._rowCount - 1, a = e[2] || 1), t != null && (o = t[0] || 0, u = t[1] || this._columnCount - 1, c = t[2] || 1);
2679
2679
  const l = [], f = this._value;
2680
- let d = 0, p = 0;
2681
- for (let N = n; N <= i; N += a) {
2682
- p = 0, l[d] == null && (l[d] = []);
2680
+ let _ = 0, N = 0;
2681
+ for (let p = n; p <= i; p += a) {
2682
+ N = 0, l[_] == null && (l[_] = []);
2683
2683
  for (let g = o; g <= u; g += c)
2684
- l[d][p] = f[N][g], p++;
2685
- d++;
2684
+ l[_][N] = f[p][g], N++;
2685
+ _++;
2686
2686
  }
2687
2687
  return this._createNewArray(l, l.length, l[0].length);
2688
2688
  }
@@ -2825,7 +2825,7 @@ class pe extends ve {
2825
2825
  const c = [];
2826
2826
  for (let l = 0; l < n; l++) {
2827
2827
  const f = (o = (a = this._value) == null ? void 0 : a[u]) == null ? void 0 : o[l];
2828
- f ? f.isError() ? c[l] = f : c[l] = e(f, u, l) : c[l] = _.create(h.VALUE);
2828
+ f ? f.isError() ? c[l] = f : c[l] = e(f, u, l) : c[l] = d.create(h.VALUE);
2829
2829
  }
2830
2830
  i.push(c);
2831
2831
  }
@@ -2893,7 +2893,7 @@ class pe extends ve {
2893
2893
  return this.map((t) => t.isError() ? t : e.atan2(t));
2894
2894
  }
2895
2895
  mean() {
2896
- const e = this.sum(), t = this.count();
2896
+ const e = this.sum(), t = this.countA();
2897
2897
  return e.divided(t);
2898
2898
  }
2899
2899
  median() {
@@ -2907,15 +2907,26 @@ class pe extends ve {
2907
2907
  return e.get(0, (t - 1) / 2);
2908
2908
  }
2909
2909
  var() {
2910
- const e = this.flatten(), t = this.mean();
2911
- let n = null;
2912
- const i = [];
2913
- return e.iterator((a, o, u) => {
2914
- let c = null;
2915
- if (a && a.isError())
2916
- return n = !0, !1;
2917
- a == null ? c = new E(0) : c = a.minus(t).pow(new E(2, !0)), i[o] == null && (i[o] = []), i[o][u] = c;
2918
- }), n ? _.create(h.VALUE) : new pe("").mean();
2910
+ const e = this.mean(), t = [];
2911
+ this.iterator((f, _, N) => {
2912
+ (f == null || f.isError() || f.isString()) && (f = new E(0));
2913
+ let p = f.minus(e).pow(new E(2, !0));
2914
+ p.isError() && (p = new E(0)), t[_] == null && (t[_] = []), t[_][N] = p;
2915
+ });
2916
+ const { _rowCount: n, _columnCount: i, _unitId: a, _sheetId: o, _currentRow: u, _currentColumn: c } = this;
2917
+ return new pe({
2918
+ calculateValueList: t,
2919
+ rowCount: n,
2920
+ columnCount: i,
2921
+ unitId: a,
2922
+ sheetId: o,
2923
+ row: u,
2924
+ column: c
2925
+ }).mean();
2926
+ }
2927
+ std() {
2928
+ const e = this.var();
2929
+ return e.isError() ? e : e.sqrt();
2919
2930
  }
2920
2931
  log() {
2921
2932
  return this.map((e) => e.isError() ? e : e.log());
@@ -2960,7 +2971,7 @@ class pe extends ve {
2960
2971
  return this.map((t) => t.isError() ? t : e.ceil(t));
2961
2972
  }
2962
2973
  toValue() {
2963
- return Ln(this._value);
2974
+ return wn(this._value);
2964
2975
  }
2965
2976
  _sort(e) {
2966
2977
  const t = dn();
@@ -2988,12 +2999,12 @@ class pe extends ve {
2988
2999
  const c = e.getRowCount(), l = e.getColumnCount();
2989
3000
  if (a = Math.max(c, a), o = Math.max(l, o), c === 1 && l === 1) {
2990
3001
  const f = e.getFirstCell();
2991
- for (let d = 0; d < o; d++)
3002
+ for (let _ = 0; _ < o; _++)
2992
3003
  i.push(f);
2993
3004
  } else if (c === 1 && this._columnCount > 1) {
2994
3005
  const f = e.getArrayValue();
2995
- for (let d = 0; d < o; d++)
2996
- i.push(f[0][d]);
3006
+ for (let _ = 0; _ < o; _++)
3007
+ i.push(f[0][_]);
2997
3008
  } else
2998
3009
  return this._batchOperatorArray(e, t, n);
2999
3010
  } else
@@ -3007,14 +3018,14 @@ class pe extends ve {
3007
3018
  return this._createNewArray(u, a, o);
3008
3019
  }
3009
3020
  _batchOperatorValue(e, t, n, i, a) {
3010
- var p, N;
3021
+ var N, p;
3011
3022
  const o = this._rowCount;
3012
3023
  let u = !1;
3013
- const c = this.getUnitId(), l = this.getSheetId(), f = this.getCurrentRow(), d = this.getCurrentColumn();
3024
+ const c = this.getUnitId(), l = this.getSheetId(), f = this.getCurrentRow(), _ = this.getCurrentColumn();
3014
3025
  if (i === 4 && (u = ge.canUseCache(
3015
3026
  c,
3016
3027
  l,
3017
- t + d,
3028
+ t + _,
3018
3029
  f,
3019
3030
  f + o - 1
3020
3031
  ), u === !0)) {
@@ -3022,7 +3033,7 @@ class pe extends ve {
3022
3033
  const g = ge.getCellPositions(
3023
3034
  c,
3024
3035
  l,
3025
- t + d,
3036
+ t + _,
3026
3037
  e.getValue()
3027
3038
  );
3028
3039
  if (g != null)
@@ -3032,7 +3043,7 @@ class pe extends ve {
3032
3043
  const g = ge.getCellValuePositions(
3033
3044
  c,
3034
3045
  l,
3035
- t + d
3046
+ t + _
3036
3047
  );
3037
3048
  g != null && g.forEach((C, R) => {
3038
3049
  let S;
@@ -3042,8 +3053,8 @@ class pe extends ve {
3042
3053
  e,
3043
3054
  a
3044
3055
  ))
3045
- for (let w = 0; w < o; w++)
3046
- n[w] == null && (n[w] = []), C.includes(w + f) ? n[w][t] = new Y(!0) : n[w][t] = new Y(!1);
3056
+ for (let L = 0; L < o; L++)
3057
+ n[L] == null && (n[L] = []), C.includes(L + f) ? n[L][t] = new Y(!0) : n[L][t] = new Y(!1);
3047
3058
  });
3048
3059
  }
3049
3060
  return;
@@ -3051,17 +3062,17 @@ class pe extends ve {
3051
3062
  ge.setContinueBuildingCache(
3052
3063
  c,
3053
3064
  l,
3054
- t + d,
3065
+ t + _,
3055
3066
  f,
3056
3067
  f + o - 1
3057
3068
  );
3058
3069
  for (let g = 0; g < o; g++) {
3059
- const C = (N = (p = this._value) == null ? void 0 : p[g]) == null ? void 0 : N[t];
3070
+ const C = (p = (N = this._value) == null ? void 0 : N[g]) == null ? void 0 : p[t];
3060
3071
  if (n[g] == null && (n[g] = []), C && e)
3061
3072
  if (C.isError())
3062
3073
  n[g][t] = C;
3063
3074
  else if (e.isError())
3064
- n[g][t] = _.create(h.VALUE);
3075
+ n[g][t] = d.create(h.VALUE);
3065
3076
  else
3066
3077
  switch (i) {
3067
3078
  case 1:
@@ -3080,7 +3091,7 @@ class pe extends ve {
3080
3091
  a ? n[g][t] = C.compare(
3081
3092
  e,
3082
3093
  a
3083
- ) : n[g][t] = _.create(h.VALUE);
3094
+ ) : n[g][t] = d.create(h.VALUE);
3084
3095
  break;
3085
3096
  case 5:
3086
3097
  n[g][t] = C.concatenateFront(e);
@@ -3092,13 +3103,13 @@ class pe extends ve {
3092
3103
  a ? n[g][t] = C.product(
3093
3104
  e,
3094
3105
  a
3095
- ) : n[g][t] = _.create(h.VALUE);
3106
+ ) : n[g][t] = d.create(h.VALUE);
3096
3107
  break;
3097
3108
  case 8:
3098
3109
  a ? n[g][t] = C.wildcard(
3099
3110
  e,
3100
3111
  a
3101
- ) : n[g][t] = _.create(h.VALUE);
3112
+ ) : n[g][t] = d.create(h.VALUE);
3102
3113
  break;
3103
3114
  case 9:
3104
3115
  n[g][t] = C.pow(e);
@@ -3117,24 +3128,24 @@ class pe extends ve {
3117
3128
  break;
3118
3129
  }
3119
3130
  else
3120
- n[g][t] = _.create(h.NA);
3131
+ n[g][t] = d.create(h.NA);
3121
3132
  C != null && (C.isError() ? ge.set(
3122
3133
  c,
3123
3134
  l,
3124
- t + d,
3135
+ t + _,
3125
3136
  C.getErrorType(),
3126
3137
  g + f
3127
3138
  ) : ge.set(
3128
3139
  c,
3129
3140
  l,
3130
- t + d,
3141
+ t + _,
3131
3142
  C.getValue(),
3132
3143
  g + f
3133
3144
  ));
3134
3145
  }
3135
3146
  }
3136
3147
  _batchOperatorArray(e, t, n) {
3137
- var f, d, p, N, g, C, R, S, T, w, G, ie;
3148
+ var f, _, N, p, g, C, R, S, T, L, G, ie;
3138
3149
  let i = e.getRowCount(), a = e.getColumnCount();
3139
3150
  i < this._rowCount && (i = this._rowCount), a < this._columnCount && (a = this._columnCount);
3140
3151
  const o = [], u = e.getArrayValue(), c = this._checkArrayCalculateType(this), l = this._checkArrayCalculateType(e);
@@ -3142,9 +3153,9 @@ class pe extends ve {
3142
3153
  const x = [];
3143
3154
  for (let U = 0; U < a; U++) {
3144
3155
  let v;
3145
- c === 3 ? v = (d = (f = this._value) == null ? void 0 : f[0]) == null ? void 0 : d[0] : c === 1 ? v = (N = (p = this._value) == null ? void 0 : p[0]) == null ? void 0 : N[U] : c === 2 ? v = (C = (g = this._value) == null ? void 0 : g[X]) == null ? void 0 : C[0] : v = (S = (R = this._value) == null ? void 0 : R[X]) == null ? void 0 : S[U];
3156
+ c === 3 ? v = (_ = (f = this._value) == null ? void 0 : f[0]) == null ? void 0 : _[0] : c === 1 ? v = (p = (N = this._value) == null ? void 0 : N[0]) == null ? void 0 : p[U] : c === 2 ? v = (C = (g = this._value) == null ? void 0 : g[X]) == null ? void 0 : C[0] : v = (S = (R = this._value) == null ? void 0 : R[X]) == null ? void 0 : S[U];
3146
3157
  let M;
3147
- if (l === 3 ? M = (T = u == null ? void 0 : u[0]) == null ? void 0 : T[0] : l === 1 ? M = (w = u == null ? void 0 : u[0]) == null ? void 0 : w[U] : l === 2 ? M = (G = u == null ? void 0 : u[X]) == null ? void 0 : G[0] : M = (ie = u == null ? void 0 : u[X]) == null ? void 0 : ie[U], v && M)
3158
+ if (l === 3 ? M = (T = u == null ? void 0 : u[0]) == null ? void 0 : T[0] : l === 1 ? M = (L = u == null ? void 0 : u[0]) == null ? void 0 : L[U] : l === 2 ? M = (G = u == null ? void 0 : u[X]) == null ? void 0 : G[0] : M = (ie = u == null ? void 0 : u[X]) == null ? void 0 : ie[U], v && M)
3148
3159
  if (v.isError())
3149
3160
  x[U] = v;
3150
3161
  else if (M.isError())
@@ -3167,7 +3178,7 @@ class pe extends ve {
3167
3178
  n ? x[U] = v.compare(
3168
3179
  M,
3169
3180
  n
3170
- ) : x[U] = _.create(h.VALUE);
3181
+ ) : x[U] = d.create(h.VALUE);
3171
3182
  break;
3172
3183
  case 5:
3173
3184
  x[U] = v.concatenateFront(
@@ -3183,13 +3194,13 @@ class pe extends ve {
3183
3194
  n ? x[U] = v.product(
3184
3195
  M,
3185
3196
  n
3186
- ) : x[U] = _.create(h.VALUE);
3197
+ ) : x[U] = d.create(h.VALUE);
3187
3198
  break;
3188
3199
  case 8:
3189
3200
  n ? x[U] = v.wildcard(
3190
3201
  M,
3191
3202
  n
3192
- ) : x[U] = _.create(h.VALUE);
3203
+ ) : x[U] = d.create(h.VALUE);
3193
3204
  break;
3194
3205
  case 9:
3195
3206
  x[U] = v.pow(M);
@@ -3208,7 +3219,7 @@ class pe extends ve {
3208
3219
  break;
3209
3220
  }
3210
3221
  else
3211
- x[U] = _.create(h.NA);
3222
+ x[U] = d.create(h.NA);
3212
3223
  }
3213
3224
  o.push(x);
3214
3225
  }
@@ -3227,9 +3238,9 @@ class pe extends ve {
3227
3238
  const c = t[o].split(","), l = c.length;
3228
3239
  a < l && (a = l);
3229
3240
  const f = [];
3230
- for (let d = 0; d < l; d++) {
3231
- const p = c[d].trim();
3232
- f.push(Ge.create(p));
3241
+ for (let _ = 0; _ < l; _++) {
3242
+ const N = c[_].trim();
3243
+ f.push(Ge.create(N));
3233
3244
  }
3234
3245
  i.push(f);
3235
3246
  }
@@ -3256,10 +3267,10 @@ class Ge {
3256
3267
  const e = r.toLocaleUpperCase();
3257
3268
  return e === Ne.TRUE || e === Ne.FALSE ? new Y(e) : Br(r) ? new E(r) : new RegExp(tn, "g").test(r) ? new pe(r) : new j(r);
3258
3269
  }
3259
- return typeof r == "number" ? Number.isFinite(r) ? new E(r, !0) : _.create(h.NUM) : _.create(h.NA);
3270
+ return typeof r == "number" ? Number.isFinite(r) ? new E(r, !0) : d.create(h.NUM) : d.create(h.NA);
3260
3271
  }
3261
3272
  }
3262
- const wn = 1e5, Ft = new _t(wn);
3273
+ const Ln = 1e5, Ft = new _t(Ln);
3263
3274
  class Xe extends Dr {
3264
3275
  constructor(e) {
3265
3276
  super();
@@ -3312,20 +3323,20 @@ class Xe extends Dr {
3312
3323
  iterator(e) {
3313
3324
  const { startRow: t, endRow: n, startColumn: i, endColumn: a } = this.getRangePosition();
3314
3325
  if (this._checkIfWorksheetMiss())
3315
- return e(new _(h.VALUE), t, i);
3326
+ return e(new d(h.VALUE), t, i);
3316
3327
  for (let o = t; o <= n; o++)
3317
3328
  for (let u = i; u <= a; u++) {
3318
3329
  const c = o + this._refOffsetY, l = u + this._refOffsetX;
3319
3330
  if (c < 0 || l < 0)
3320
- return e(new _(h.REF), o, u);
3331
+ return e(new d(h.REF), o, u);
3321
3332
  const f = this.getCellData(c, l);
3322
- let d = !1;
3333
+ let _ = !1;
3323
3334
  if (f == null || St(f)) {
3324
- d = e(null, o, u);
3335
+ _ = e(null, o, u);
3325
3336
  continue;
3326
3337
  }
3327
- const p = this.getCellValueObject(f);
3328
- if (d = e(p, o, u), d === !1)
3338
+ const N = this.getCellValueObject(f);
3339
+ if (_ = e(N, o, u), _ === !1)
3329
3340
  return;
3330
3341
  }
3331
3342
  }
@@ -3431,7 +3442,7 @@ class Xe extends Dr {
3431
3442
  return !1;
3432
3443
  }
3433
3444
  unionBy(e) {
3434
- return _.create(h.REF);
3445
+ return d.create(h.REF);
3435
3446
  }
3436
3447
  unionRange(e, t) {
3437
3448
  return {
@@ -3443,7 +3454,7 @@ class Xe extends Dr {
3443
3454
  }
3444
3455
  getCellValueObject(e) {
3445
3456
  const t = e.v || 0;
3446
- return Hr.has(t) ? _.create(t) : e.t === se.NUMBER ? new E(t) : e.t === se.STRING || e.t === se.FORCE_STRING ? new j(t) : e.t === se.BOOLEAN ? new Y(t) : Ge.create(t);
3457
+ return Hr.has(t) ? d.create(t) : e.t === se.NUMBER ? new E(t) : e.t === se.STRING || e.t === se.FORCE_STRING ? new j(t) : e.t === se.BOOLEAN ? new Y(t) : Ge.create(t);
3447
3458
  }
3448
3459
  getCellByRow(e) {
3449
3460
  return this.getCellByPosition(e);
@@ -3485,16 +3496,16 @@ class Xe extends Dr {
3485
3496
  getCellByPosition(e, t) {
3486
3497
  e || (e = this._rangeData.startRow), t || (t = this._rangeData.startColumn);
3487
3498
  const n = this.getCellData(e, t);
3488
- return n ? this.getCellValueObject(n) : _.create(h.VALUE);
3499
+ return n ? this.getCellValueObject(n) : d.create(h.VALUE);
3489
3500
  }
3490
3501
  toArrayValueObject() {
3491
3502
  const { startRow: e, endRow: t, startColumn: n, endColumn: i } = this.getRangePosition(), a = `${this.getUnitId()}_${this.getSheetId()}_${e + this._refOffsetY}_${t + this._refOffsetY}_${n + this._refOffsetX}_${i + this._refOffsetX}`, o = Ft.get(a);
3492
3503
  if (o)
3493
3504
  return o;
3494
3505
  const u = t - e + 1, c = i - n + 1, l = new Array(u);
3495
- this.iterator((p, N, g) => {
3496
- const C = N - e, R = g - n;
3497
- l[C] || (l[C] = new Array(c)), p == null && (p = new wr(0)), l[C][R] = p;
3506
+ this.iterator((N, p, g) => {
3507
+ const C = p - e, R = g - n;
3508
+ l[C] || (l[C] = new Array(c)), N == null && (N = new Lr(0)), l[C][R] = N;
3498
3509
  });
3499
3510
  const f = {
3500
3511
  calculateValueList: l,
@@ -3504,8 +3515,8 @@ class Xe extends Dr {
3504
3515
  sheetId: this.getSheetId(),
3505
3516
  row: e,
3506
3517
  column: n
3507
- }, d = new pe(f);
3508
- return Ft.set(a, d), d;
3518
+ }, _ = new pe(f);
3519
+ return Ft.set(a, _), _;
3509
3520
  }
3510
3521
  toUnitRange() {
3511
3522
  return {
@@ -3542,7 +3553,7 @@ class B extends I {
3542
3553
  return !1;
3543
3554
  }
3544
3555
  calculate(...r) {
3545
- return _.create(h.VALUE);
3556
+ return d.create(h.VALUE);
3546
3557
  }
3547
3558
  checkArrayType(r) {
3548
3559
  return r.isReferenceObject() || r.isValueObject() && r.isArray();
@@ -3876,12 +3887,12 @@ let Ut = class extends I {
3876
3887
  c[n] == null && (c[n] = new O()), this._runtimeClearArrayFormulaCellData[i] === void 0 && (this._runtimeClearArrayFormulaCellData[i] = {});
3877
3888
  const l = this._runtimeClearArrayFormulaCellData[i];
3878
3889
  l[n] == null && (l[n] = new O());
3879
- const f = a[n], d = c[n], p = l[n];
3890
+ const f = a[n], _ = c[n], N = l[n];
3880
3891
  if (r.isReferenceObject() || r.isValueObject() && r.isArray()) {
3881
- const N = r, { startRow: g, startColumn: C, endRow: R, endColumn: S } = N.getRangePosition();
3892
+ const p = r, { startRow: g, startColumn: C, endRow: R, endColumn: S } = p.getRangePosition();
3882
3893
  if (g === R && C === S) {
3883
- const w = this._objectValueToCellValue(N.getFirstCell());
3884
- f.setValue(e, t, w), p.setValue(e, t, w);
3894
+ const L = this._objectValueToCellValue(p.getFirstCell());
3895
+ f.setValue(e, t, L), N.setValue(e, t, L);
3885
3896
  return;
3886
3897
  }
3887
3898
  const T = {
@@ -3891,23 +3902,23 @@ let Ut = class extends I {
3891
3902
  endColumn: S - C + t
3892
3903
  };
3893
3904
  if (this._checkIfArrayFormulaRangeHasData(i, n, e, t, T)) {
3894
- const w = this._objectValueToCellValue(new _(h.SPILL));
3895
- f.setValue(e, t, w), p.setValue(e, t, w);
3905
+ const L = this._objectValueToCellValue(new d(h.SPILL));
3906
+ f.setValue(e, t, L), N.setValue(e, t, L);
3896
3907
  } else {
3897
- const w = new _(h.SPILL);
3898
- N.iterator((G, ie, X) => {
3908
+ const L = new d(h.SPILL);
3909
+ p.iterator((G, ie, X) => {
3899
3910
  const x = this._objectValueToCellValue(G);
3900
3911
  if (ie === g && X === C) {
3901
- if (G != null && G.isError() && G.isEqualType(w))
3902
- return p.setValue(e, t, {}), f.setValue(e, t, { ...this._objectValueToCellValue(w) }), !1;
3912
+ if (G != null && G.isError() && G.isEqualType(L))
3913
+ return N.setValue(e, t, {}), f.setValue(e, t, { ...this._objectValueToCellValue(L) }), !1;
3903
3914
  f.setValue(e, t, { ...x });
3904
3915
  }
3905
- d.setValue(ie - g + e, X - C + t, x);
3916
+ _.setValue(ie - g + e, X - C + t, x);
3906
3917
  }), u.setValue(e, t, T), o[n] = u.getData();
3907
3918
  }
3908
3919
  } else {
3909
- const N = this._objectValueToCellValue(r);
3910
- f.setValue(e, t, N), p.setValue(e, t, N);
3920
+ const p = this._objectValueToCellValue(r);
3921
+ f.setValue(e, t, p), N.setValue(e, t, p);
3911
3922
  }
3912
3923
  }
3913
3924
  getUnitData() {
@@ -3984,14 +3995,14 @@ let Ut = class extends I {
3984
3995
  }
3985
3996
  }
3986
3997
  _checkIfArrayFormulaRangeHasData(r, e, t, n, i) {
3987
- var f, d, p, N, g, C;
3998
+ var f, _, N, p, g, C;
3988
3999
  const { startRow: a, startColumn: o, endRow: u, endColumn: c } = i, l = this._currentConfigService.getUnitData();
3989
4000
  for (let R = a; R <= u; R++)
3990
4001
  for (let S = o; S <= c; S++) {
3991
4002
  if (R === t && n === S)
3992
4003
  continue;
3993
- const T = (p = (d = (f = this._runtimeData) == null ? void 0 : f[r]) == null ? void 0 : d[e]) == null ? void 0 : p.getValue(R, S), w = (C = (g = (N = l == null ? void 0 : l[r]) == null ? void 0 : N[e]) == null ? void 0 : g.cellData) == null ? void 0 : C.getValue(R, S);
3994
- if ((!St(T) || !St(w)) && this._isInDirtyRange(r, e, R, S))
4004
+ const T = (N = (_ = (f = this._runtimeData) == null ? void 0 : f[r]) == null ? void 0 : _[e]) == null ? void 0 : N.getValue(R, S), L = (C = (g = (p = l == null ? void 0 : l[r]) == null ? void 0 : p[e]) == null ? void 0 : g.cellData) == null ? void 0 : C.getValue(R, S);
4005
+ if ((!St(T) || !St(L)) && this._isInDirtyRange(r, e, R, S))
3995
4006
  return !0;
3996
4007
  }
3997
4008
  return !1;
@@ -4156,7 +4167,7 @@ class V extends q {
4156
4167
  constructor(e) {
4157
4168
  super(e);
4158
4169
  m(this, "_errorValueObject");
4159
- this._errorValueObject = _.create(e);
4170
+ this._errorValueObject = d.create(e);
4160
4171
  }
4161
4172
  get nodeType() {
4162
4173
  return D.ERROR;
@@ -4241,7 +4252,7 @@ class $n extends I {
4241
4252
  return this._functionDescriptions.has(e);
4242
4253
  }
4243
4254
  }
4244
- const Le = Se("univer.formula.function.service");
4255
+ const we = Se("univer.formula.function.service");
4245
4256
  var Qn = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, Gn = (s, r, e, t) => {
4246
4257
  for (var n = t > 1 ? void 0 : t ? jn(r, e) : r, i = s.length - 1, a; i >= 0; i--)
4247
4258
  (a = s[i]) && (n = (t ? a(r, e, n) : a(n)) || n);
@@ -4259,16 +4270,16 @@ class st extends q {
4259
4270
  let t;
4260
4271
  if (e == null)
4261
4272
  throw new Error("object is null");
4262
- this._operatorString === P.MINUS ? t = this._functionExecutor.calculate(new E(0), e) : this._operatorString === P.AT ? t = this._handlerAT(e) : t = _.create(h.VALUE), this.setValue(t);
4273
+ this._operatorString === P.MINUS ? t = this._functionExecutor.calculate(new E(0), e) : this._operatorString === P.AT ? t = this._handlerAT(e) : t = d.create(h.VALUE), this.setValue(t);
4263
4274
  }
4264
4275
  _handlerAT(r) {
4265
4276
  if (!r.isReferenceObject())
4266
- return _.create(h.VALUE);
4277
+ return d.create(h.VALUE);
4267
4278
  const e = r;
4268
4279
  if (e.isCell())
4269
- return _.create(h.VALUE);
4280
+ return d.create(h.VALUE);
4270
4281
  const t = this._accessor.get(J), n = t.currentRow || 0, i = t.currentColumn || 0;
4271
- return e.isRow() ? e.getCellByColumn(i) : e.isColumn() ? e.getCellByRow(n) : e.isRange() || e.isTable() ? e.getCellByPosition() : _.create(h.VALUE);
4282
+ return e.isRow() ? e.getCellByColumn(i) : e.isColumn() ? e.getCellByRow(n) : e.isRange() || e.isTable() ? e.getCellByPosition() : d.create(h.VALUE);
4272
4283
  }
4273
4284
  }
4274
4285
  let it = class extends re {
@@ -4294,7 +4305,7 @@ let it = class extends re {
4294
4305
  }
4295
4306
  };
4296
4307
  it = Gn([
4297
- tr(0, Le),
4308
+ tr(0, we),
4298
4309
  tr(1, b(Oe))
4299
4310
  ], it);
4300
4311
  var Hn = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, qn = (s, r, e, t) => {
@@ -4356,7 +4367,7 @@ let at = class extends re {
4356
4367
  }
4357
4368
  };
4358
4369
  at = qn([
4359
- rr(0, Le),
4370
+ rr(0, we),
4360
4371
  rr(1, b(Oe))
4361
4372
  ], at);
4362
4373
  function Tr(s) {
@@ -4461,7 +4472,7 @@ class rs extends q {
4461
4472
  }
4462
4473
  execute() {
4463
4474
  const r = this._getRootLexerNode(this._currentLambdaPrivacyVar.get(this._lambdaParameter));
4464
- r ? this.setValue(r.getValue()) : this.setValue(_.create(h.SPILL));
4475
+ r ? this.setValue(r.getValue()) : this.setValue(d.create(h.SPILL));
4465
4476
  }
4466
4477
  _getRootLexerNode(r) {
4467
4478
  if (!r)
@@ -4494,7 +4505,7 @@ class ns extends q {
4494
4505
  return D.NULL;
4495
4506
  }
4496
4507
  execute() {
4497
- this.setValue(new wr(0));
4508
+ this.setValue(new Lr(0));
4498
4509
  }
4499
4510
  }
4500
4511
  var ss = Object.defineProperty, is = Object.getOwnPropertyDescriptor, as = (s, r, e, t) => {
@@ -4541,7 +4552,7 @@ let ut = class extends re {
4541
4552
  }
4542
4553
  };
4543
4554
  ut = as([
4544
- os(0, Le)
4555
+ os(0, we)
4545
4556
  ], ut);
4546
4557
  class cs extends I {
4547
4558
  constructor() {
@@ -4584,7 +4595,7 @@ class jt extends Xe {
4584
4595
  }
4585
4596
  unionBy(r) {
4586
4597
  if (!r.isCell())
4587
- return _.create(h.REF);
4598
+ return d.create(h.REF);
4588
4599
  const e = r, t = this.unionRange(this.getRangeData(), e.getRangeData());
4589
4600
  return this._createRange(t);
4590
4601
  }
@@ -4630,13 +4641,13 @@ class ls extends Xe {
4630
4641
  }
4631
4642
  unionBy(r) {
4632
4643
  if (!r.isColumn())
4633
- return _.create(h.REF);
4644
+ return d.create(h.REF);
4634
4645
  const e = r;
4635
4646
  if (e.getForcedSheetName() !== void 0)
4636
- return _.create(h.REF);
4647
+ return d.create(h.REF);
4637
4648
  const t = this.getRangeData();
4638
4649
  if (t.endColumn !== -1)
4639
- return _.create(h.REF);
4650
+ return d.create(h.REF);
4640
4651
  const n = e.getRangeData().startColumn, i = t.startColumn;
4641
4652
  return n > i ? t.endColumn = n : (t.startColumn = n, t.endColumn = i), this;
4642
4653
  }
@@ -4659,13 +4670,13 @@ class hs extends Xe {
4659
4670
  }
4660
4671
  unionBy(r) {
4661
4672
  if (!r.isRow())
4662
- return _.create(h.REF);
4673
+ return d.create(h.REF);
4663
4674
  const e = r;
4664
4675
  if (e.getForcedSheetName() !== void 0)
4665
- return _.create(h.REF);
4676
+ return d.create(h.REF);
4666
4677
  const t = this.getRangeData();
4667
4678
  if (t.endRow !== -1)
4668
- return _.create(h.REF);
4679
+ return d.create(h.REF);
4669
4680
  const n = e.getRangeData().startRow, i = t.startRow;
4670
4681
  return n > i ? t.endRow = n : (t.startRow = n, t.endRow = i), this;
4671
4682
  }
@@ -4676,13 +4687,13 @@ class fs extends Xe {
4676
4687
  const i = this._tableData.sheetId, a = this._tableData.range, o = this._tableData.titleMap;
4677
4688
  this.setForcedSheetIdDirect(i);
4678
4689
  const u = this._stringToColumnData(this._columnDataString, o, n), c = u.startColumn, l = u.endColumn, f = u.type;
4679
- let d = -1, p = -1;
4680
- const N = a.startRow, g = a.startColumn;
4681
- f === me.ALL ? (d = N, p = g) : f === me.DATA ? (d = N + 1, p = g) : f === me.HEADERS ? (d = N, p = N) : f === me.TOTALS && (d = g, p = g), this.setRangeData({
4690
+ let _ = -1, N = -1;
4691
+ const p = a.startRow, g = a.startColumn;
4692
+ f === me.ALL ? (_ = p, N = g) : f === me.DATA ? (_ = p + 1, N = g) : f === me.HEADERS ? (_ = p, N = p) : f === me.TOTALS && (_ = g, N = g), this.setRangeData({
4682
4693
  startColumn: c,
4683
4694
  endColumn: l,
4684
- startRow: d,
4685
- endRow: p
4695
+ startRow: _,
4696
+ endRow: N
4686
4697
  });
4687
4698
  }
4688
4699
  isTable() {
@@ -4690,7 +4701,7 @@ class fs extends Xe {
4690
4701
  }
4691
4702
  _stringToColumnData(r, e, t) {
4692
4703
  r = r.substring(1, -1);
4693
- const n = r.indexOf(L.COMMA);
4704
+ const n = r.indexOf(w.COMMA);
4694
4705
  let i = -1, a = -1, o = me.ALL;
4695
4706
  if (n === -1) {
4696
4707
  const u = this._columnHandler(r, e);
@@ -4707,7 +4718,7 @@ class fs extends Xe {
4707
4718
  }
4708
4719
  _columnHandler(r, e, t = !1) {
4709
4720
  let n = -1, i = -1;
4710
- const a = r.indexOf(L.COLON);
4721
+ const a = r.indexOf(w.COLON);
4711
4722
  if (new RegExp(fr, "g").test(r)) {
4712
4723
  const o = r.substring(0, a).substring(1, -1), u = r.substring(a + 1).substring(1, -1);
4713
4724
  n = e.get(o) ?? -1, i = e.get(u) ?? -1;
@@ -4793,14 +4804,14 @@ class sr extends q {
4793
4804
  let t;
4794
4805
  if (e == null)
4795
4806
  throw new Error("object is null");
4796
- this._operatorString === oe.PERCENTAGE ? t = this._functionExecutor.calculate(e, new E(100)) : this._operatorString === oe.POUND ? t = this._handlerPound(e) : t = _.create(h.VALUE), this.setValue(t);
4807
+ this._operatorString === oe.PERCENTAGE ? t = this._functionExecutor.calculate(e, new E(100)) : this._operatorString === oe.POUND ? t = this._handlerPound(e) : t = d.create(h.VALUE), this.setValue(t);
4797
4808
  }
4798
4809
  _handlerPound(r) {
4799
- var l, f, d, p;
4810
+ var l, f, _, N;
4800
4811
  if (!r.isReferenceObject() || !r.isCell())
4801
- return _.create(h.VALUE);
4802
- const e = this._accessor.get(Pe), t = this._accessor.get(Re), n = r, i = n.getRangeData(), a = n.getUnitId(), o = n.getSheetId(), u = e.getFormulaData(), c = (p = (d = (f = (l = u == null ? void 0 : u[a]) == null ? void 0 : l[o]) == null ? void 0 : f[i.startRow]) == null ? void 0 : d[i.startColumn]) == null ? void 0 : p.f;
4803
- return c && t.treeBuilder(c), _.create(h.VALUE);
4812
+ return d.create(h.VALUE);
4813
+ const e = this._accessor.get(Pe), t = this._accessor.get(Re), n = r, i = n.getRangeData(), a = n.getUnitId(), o = n.getSheetId(), u = e.getFormulaData(), c = (N = (_ = (f = (l = u == null ? void 0 : u[a]) == null ? void 0 : l[o]) == null ? void 0 : f[i.startRow]) == null ? void 0 : _[i.startColumn]) == null ? void 0 : N.f;
4814
+ return c && t.treeBuilder(c), d.create(h.VALUE);
4804
4815
  }
4805
4816
  }
4806
4817
  let lt = class extends re {
@@ -4826,7 +4837,7 @@ let lt = class extends re {
4826
4837
  }
4827
4838
  };
4828
4839
  lt = Es([
4829
- nr(0, Le),
4840
+ nr(0, we),
4830
4841
  nr(1, b(Oe))
4831
4842
  ], lt);
4832
4843
  var ps = Object.defineProperty, Ns = Object.getOwnPropertyDescriptor, As = (s, r, e, t) => {
@@ -4846,7 +4857,7 @@ class Ss extends q {
4846
4857
  if (e == null || t == null)
4847
4858
  throw new Error("leftNode and rightNode");
4848
4859
  let n;
4849
- this._operatorString === L.COLON ? n = this._functionExecutor.calculate(e, t) : n = _.create(h.NAME), this.setValue(n);
4860
+ this._operatorString === w.COLON ? n = this._functionExecutor.calculate(e, t) : n = d.create(h.NAME), this.setValue(n);
4850
4861
  }
4851
4862
  }
4852
4863
  let ht = class extends re {
@@ -4864,12 +4875,12 @@ let ht = class extends re {
4864
4875
  if (!(s instanceof y))
4865
4876
  return;
4866
4877
  const e = s.getToken().trim();
4867
- if (!(e.charAt(0) === '"' && e.charAt(e.length - 1) === '"') && e === L.COLON)
4878
+ if (!(e.charAt(0) === '"' && e.charAt(e.length - 1) === '"') && e === w.COLON)
4868
4879
  return this.create(e);
4869
4880
  }
4870
4881
  };
4871
4882
  ht = As([
4872
- Rs(0, Le)
4883
+ Rs(0, we)
4873
4884
  ], ht);
4874
4885
  class Ds extends q {
4875
4886
  constructor(r) {
@@ -4906,8 +4917,8 @@ class Ur extends re {
4906
4917
  return this._checkValueNode(r);
4907
4918
  }
4908
4919
  }
4909
- var ys = Object.defineProperty, Ls = Object.getOwnPropertyDescriptor, ws = (s, r, e, t) => {
4910
- for (var n = t > 1 ? void 0 : t ? Ls(r, e) : r, i = s.length - 1, a; i >= 0; i--)
4920
+ var ys = Object.defineProperty, ws = Object.getOwnPropertyDescriptor, Ls = (s, r, e, t) => {
4921
+ for (var n = t > 1 ? void 0 : t ? ws(r, e) : r, i = s.length - 1, a; i >= 0; i--)
4911
4922
  (a = s[i]) && (n = (t ? a(r, e, n) : a(n)) || n);
4912
4923
  return t && n && ys(r, e, n), n;
4913
4924
  }, z = (s, r) => (e, t) => r(e, t, s);
@@ -4934,16 +4945,16 @@ let He = class extends I {
4934
4945
  return !1;
4935
4946
  const a = [...i.keys()], o = r.getChildren(), u = o.length;
4936
4947
  for (let f = 0; f < u; f++) {
4937
- const d = o[f];
4938
- if (d instanceof y)
4939
- this._parse(d, n);
4948
+ const _ = o[f];
4949
+ if (_ instanceof y)
4950
+ this._parse(_, n);
4940
4951
  else
4941
4952
  return !1;
4942
4953
  }
4943
4954
  const c = n.getChildren(), l = c.length;
4944
4955
  for (let f = 0; f < l; f++) {
4945
- const d = c[f];
4946
- i.set(a[f], d);
4956
+ const _ = c[f];
4957
+ i.set(a[f], _);
4947
4958
  }
4948
4959
  return n.setParent(e), e;
4949
4960
  }
@@ -4999,58 +5010,58 @@ let He = class extends I {
4999
5010
  continue;
5000
5011
  } else if (zn(f) && l !== n - 1)
5001
5012
  continue;
5002
- let d = null;
5013
+ let _ = null;
5003
5014
  if (f instanceof y) {
5004
- if (d = this._parse(f, a), d === a)
5015
+ if (_ = this._parse(f, a), _ === a)
5005
5016
  continue;
5006
5017
  } else
5007
- d = this._checkAstNode(f);
5008
- if (d == null)
5018
+ _ = this._checkAstNode(f);
5019
+ if (_ == null)
5009
5020
  return V.create(h.ERROR);
5010
- if (d = this._getTopParent(d), d == null)
5021
+ if (_ = this._getTopParent(_), _ == null)
5011
5022
  return;
5012
- switch (d.nodeType) {
5023
+ switch (_.nodeType) {
5013
5024
  case D.ERROR:
5014
- return d;
5025
+ return _;
5015
5026
  case D.FUNCTION:
5016
- i.push(d);
5027
+ i.push(_);
5017
5028
  break;
5018
5029
  case D.LAMBDA:
5019
- i.push(d);
5030
+ i.push(_);
5020
5031
  break;
5021
5032
  case D.LAMBDA_PARAMETER:
5022
- i.push(d);
5033
+ i.push(_);
5023
5034
  break;
5024
5035
  case D.OPERATOR: {
5025
- const p = i.pop(), N = i.pop();
5026
- if (N)
5027
- N.setParent(d);
5036
+ const N = i.pop(), p = i.pop();
5037
+ if (p)
5038
+ p.setParent(_);
5028
5039
  else
5029
5040
  return V.create(h.ERROR);
5030
- if (p)
5031
- p.setParent(d);
5041
+ if (N)
5042
+ N.setParent(_);
5032
5043
  else
5033
5044
  return V.create(h.ERROR);
5034
- i.push(d);
5045
+ i.push(_);
5035
5046
  break;
5036
5047
  }
5037
5048
  case D.REFERENCE:
5038
- d.setRefOffset(this._refOffsetX, this._refOffsetY), i.push(d);
5049
+ _.setRefOffset(this._refOffsetX, this._refOffsetY), i.push(_);
5039
5050
  break;
5040
5051
  case D.ROOT:
5041
- i.push(d);
5052
+ i.push(_);
5042
5053
  break;
5043
5054
  case D.UNION:
5044
- i.push(d);
5055
+ i.push(_);
5045
5056
  break;
5046
5057
  case D.VALUE:
5047
- i.push(d);
5058
+ i.push(_);
5048
5059
  break;
5049
5060
  case D.PREFIX:
5050
- i.push(d);
5061
+ i.push(_);
5051
5062
  break;
5052
5063
  case D.SUFFIX:
5053
- i.push(d);
5064
+ i.push(_);
5054
5065
  break;
5055
5066
  }
5056
5067
  }
@@ -5081,7 +5092,7 @@ let He = class extends I {
5081
5092
  ].sort(kr);
5082
5093
  }
5083
5094
  };
5084
- He = ws([
5095
+ He = Ls([
5085
5096
  z(0, J),
5086
5097
  z(1, b(Fr)),
5087
5098
  z(2, b(at)),
@@ -5168,7 +5179,7 @@ let Ye = class extends I {
5168
5179
  }
5169
5180
  async executeAsync(s) {
5170
5181
  if (!s)
5171
- return _.create(h.VALUE);
5182
+ return d.create(h.VALUE);
5172
5183
  await this._executeAsync(s);
5173
5184
  const r = s.getValue();
5174
5185
  if (r == null)
@@ -5177,7 +5188,7 @@ let Ye = class extends I {
5177
5188
  }
5178
5189
  execute(s) {
5179
5190
  if (!s)
5180
- return _.create(h.VALUE);
5191
+ return d.create(h.VALUE);
5181
5192
  this._execute(s);
5182
5193
  const r = s.getValue();
5183
5194
  if (r == null)
@@ -5276,19 +5287,19 @@ class Nt extends I {
5276
5287
  if (this.rangeList.length === 0)
5277
5288
  return !1;
5278
5289
  for (let o = 0, u = this.rangeList.length; o < u; o++) {
5279
- const c = this.rangeList[o], { unitId: l, sheetId: f, range: d } = c;
5290
+ const c = this.rangeList[o], { unitId: l, sheetId: f, range: _ } = c;
5280
5291
  if (!e.has(l))
5281
5292
  continue;
5282
- const p = e.get(l);
5283
- if (!p.has(f))
5293
+ const N = e.get(l);
5294
+ if (!N.has(f))
5284
5295
  continue;
5285
- const N = p.get(f), g = (i = n == null ? void 0 : n[l]) == null ? void 0 : i[f];
5286
- for (const C of N) {
5287
- const { startRow: R, startColumn: S, endRow: T, endColumn: w } = C;
5288
- if (!(d.startRow > T || d.endRow < R || d.startColumn > w || d.endColumn < S)) {
5296
+ const p = N.get(f), g = (i = n == null ? void 0 : n[l]) == null ? void 0 : i[f];
5297
+ for (const C of p) {
5298
+ const { startRow: R, startColumn: S, endRow: T, endColumn: L } = C;
5299
+ if (!(_.startRow > T || _.endRow < R || _.startColumn > L || _.endColumn < S)) {
5289
5300
  let G = !0;
5290
5301
  if (g == null || g.forValue((ie, X) => {
5291
- if (ie >= d.startRow && ie <= d.endRow && X >= d.startColumn && X <= d.endColumn)
5302
+ if (ie >= _.startRow && ie <= _.endRow && X >= _.startColumn && X <= _.endColumn)
5292
5303
  return G = !1, !1;
5293
5304
  }), G)
5294
5305
  return !0;
@@ -5379,26 +5390,26 @@ let $e = class extends I {
5379
5390
  for (const a of t) {
5380
5391
  const o = r[a], u = Object.keys(o);
5381
5392
  for (const c of u)
5382
- new O(o[c]).forValue((f, d, p) => {
5383
- if (p == null)
5393
+ new O(o[c]).forValue((f, _, N) => {
5394
+ if (N == null)
5384
5395
  return !0;
5385
- const { f: N, x: g, y: C } = p, R = this._generateAstNode(N, g, C), S = new Nt();
5386
- S.node = R, S.formula = N, S.unitId = a, S.subComponentId = c, S.row = f, S.column = d, i.push(S);
5396
+ const { f: p, x: g, y: C } = N, R = this._generateAstNode(p, g, C), S = new Nt();
5397
+ S.node = R, S.formula = p, S.unitId = a, S.subComponentId = c, S.row = f, S.column = _, i.push(S);
5387
5398
  });
5388
5399
  }
5389
5400
  for (const a of n) {
5390
5401
  const o = e[a], u = Object.keys(o);
5391
5402
  for (const c of u) {
5392
5403
  const l = o[c], f = Object.keys(l);
5393
- for (const d of f) {
5394
- const p = l[d], { f: N } = p, g = this._generateAstNode(N), C = new Nt();
5395
- C.node = g, C.formula = N, C.unitId = a, C.subComponentId = c, C.formulaId = d, i.push(C);
5404
+ for (const _ of f) {
5405
+ const N = l[_], { f: p } = N, g = this._generateAstNode(p), C = new Nt();
5406
+ C.node = g, C.formula = p, C.unitId = a, C.subComponentId = c, C.formulaId = _, i.push(C);
5396
5407
  }
5397
5408
  }
5398
5409
  }
5399
5410
  this._featureCalculationManagerService.getReferenceExecutorMap().forEach((a, o) => {
5400
- const { unitId: u, subComponentId: c, dependencyRanges: l, getDirtyData: f } = a, d = new Nt();
5401
- d.unitId = u, d.subComponentId = c, d.getDirtyData = f, d.featureId = o, d.rangeList = l, i.push(d);
5411
+ const { unitId: u, subComponentId: c, dependencyRanges: l, getDirtyData: f } = a, _ = new Nt();
5412
+ _.unitId = u, _.subComponentId = c, _.getDirtyData = f, _.featureId = o, _.rangeList = l, i.push(_);
5402
5413
  });
5403
5414
  for (let a = 0, o = i.length; a < o; a++) {
5404
5415
  const u = i[a];
@@ -5520,17 +5531,17 @@ let $e = class extends I {
5520
5531
  * @returns
5521
5532
  */
5522
5533
  _includeTree(r) {
5523
- var c, l, f, d;
5534
+ var c, l, f, _;
5524
5535
  const e = r.unitId, t = r.subComponentId, n = r.featureId;
5525
5536
  if (n != null) {
5526
- const p = this._currentConfigService.getDirtyUnitFeatureMap();
5527
- if (((l = (c = p == null ? void 0 : p[e]) == null ? void 0 : c[t]) == null ? void 0 : l[n]) != null)
5537
+ const N = this._currentConfigService.getDirtyUnitFeatureMap();
5538
+ if (((l = (c = N == null ? void 0 : N[e]) == null ? void 0 : c[t]) == null ? void 0 : l[n]) != null)
5528
5539
  return !0;
5529
5540
  }
5530
- const i = (d = (f = this._currentConfigService.getExcludedRange()) == null ? void 0 : f[e]) == null ? void 0 : d[t];
5541
+ const i = (_ = (f = this._currentConfigService.getExcludedRange()) == null ? void 0 : f[e]) == null ? void 0 : _[t];
5531
5542
  let a = !1;
5532
- if (i == null || i.forValue((p, N) => {
5533
- if (r.row === p && r.column === N)
5543
+ if (i == null || i.forValue((N, p) => {
5544
+ if (r.row === N && r.column === p)
5534
5545
  return a = !0, !1;
5535
5546
  }), a || !this._updateRangeFlattenCache.has(e))
5536
5547
  return !1;
@@ -5538,8 +5549,8 @@ let $e = class extends I {
5538
5549
  if (!o.has(t))
5539
5550
  return !1;
5540
5551
  const u = o.get(t);
5541
- for (const p of u)
5542
- if (r.inRangeData(p))
5552
+ for (const N of u)
5553
+ if (r.inRangeData(N))
5543
5554
  return !0;
5544
5555
  return !1;
5545
5556
  }
@@ -5643,8 +5654,8 @@ let Qe = class extends I {
5643
5654
  if (u == null)
5644
5655
  return !0;
5645
5656
  const c = new O();
5646
- u.forValue((l, f, d) => {
5647
- c.setValue(l, f, !0), t.push({ unitId: i, sheetId: o, range: d });
5657
+ u.forValue((l, f, _) => {
5658
+ c.setValue(l, f, !0), t.push({ unitId: i, sheetId: o, range: _ });
5648
5659
  }), n[i] == null && (n[i] = {}), n[i][o] = c;
5649
5660
  });
5650
5661
  }), Object.keys(e).forEach((i) => {
@@ -5772,7 +5783,7 @@ let Ze = class extends I {
5772
5783
  break;
5773
5784
  }
5774
5785
  this._commandService.executeCommand(
5775
- Lt.id,
5786
+ wt.id,
5776
5787
  {
5777
5788
  functionsExecutedState: r
5778
5789
  },
@@ -5796,7 +5807,7 @@ let Ze = class extends I {
5796
5807
  ) : console.log(
5797
5808
  `Stage ${i} .There are ${r} functions to be executed, ${e} complete.`
5798
5809
  ), this._commandService.executeCommand(
5799
- Lt.id,
5810
+ wt.id,
5800
5811
  {
5801
5812
  stageInfo: s
5802
5813
  },
@@ -5843,7 +5854,7 @@ Ze = Gs([
5843
5854
  const Hs = [];
5844
5855
  class Ys extends B {
5845
5856
  calculate(r, e) {
5846
- return _.create(h.VALUE);
5857
+ return d.create(h.VALUE);
5847
5858
  }
5848
5859
  }
5849
5860
  const qs = [[Ys, $t.CONCATENATE]], Xs = [], zs = [], Ks = [], Ws = [], Zs = [], Js = [], ei = [];
@@ -5863,7 +5874,7 @@ const ni = [
5863
5874
  ];
5864
5875
  class si extends B {
5865
5876
  calculate(r, e) {
5866
- return _.create(h.VALUE);
5877
+ return d.create(h.VALUE);
5867
5878
  }
5868
5879
  }
5869
5880
  class ii extends B {
@@ -5903,16 +5914,16 @@ function oi(s, r) {
5903
5914
  class ui extends B {
5904
5915
  calculate(...r) {
5905
5916
  if (r.length < 2 || r.length > 3)
5906
- return _.create(h.NA);
5917
+ return d.create(h.NA);
5907
5918
  const e = r[0], t = r[1], n = r[2];
5908
5919
  if (e.isError() || t.isError() || n && n.isError())
5909
- return _.create(h.VALUE);
5920
+ return d.create(h.VALUE);
5910
5921
  let i = new E(0);
5911
5922
  if (e.isReferenceObject() || e.isValueObject() && e.isArray()) {
5912
5923
  const o = oi(e, t).getArrayValue(), u = n || e, { startRow: c, startColumn: l } = u.getRangePosition();
5913
- u.iterator((f, d, p) => {
5924
+ u.iterator((f, _, N) => {
5914
5925
  if (!(f != null && f.isError())) {
5915
- const g = o[d - c][p - l].getValue() ? f : new E(0);
5926
+ const g = o[_ - c][N - l].getValue() ? f : new E(0);
5916
5927
  i = i.plus(g);
5917
5928
  }
5918
5929
  });
@@ -5931,7 +5942,7 @@ class ui extends B {
5931
5942
  }
5932
5943
  class ci extends B {
5933
5944
  calculate(...r) {
5934
- return _.create(h.VALUE);
5945
+ return d.create(h.VALUE);
5935
5946
  }
5936
5947
  }
5937
5948
  const li = [
@@ -5949,12 +5960,12 @@ class hi extends B {
5949
5960
  this._compareType = e;
5950
5961
  }
5951
5962
  calculate(e, t) {
5952
- return e.isError() || t.isError() ? _.create(h.VALUE) : (e.isReferenceObject() && (e = e.toArrayValueObject()), t.isReferenceObject() && (t = t.toArrayValueObject()), e.compare(t, this._compareType));
5963
+ return e.isError() || t.isError() ? d.create(h.VALUE) : (e.isReferenceObject() && (e = e.toArrayValueObject()), t.isReferenceObject() && (t = t.toArrayValueObject()), e.compare(t, this._compareType));
5953
5964
  }
5954
5965
  }
5955
5966
  class fi extends B {
5956
5967
  calculate(r, e) {
5957
- return r.isError() || e.isError() ? _.create(h.VALUE) : (r.isReferenceObject() && (r = r.toArrayValueObject()), e.isReferenceObject() && (e = e.toArrayValueObject()), !e.isArray() && e.getValue() === 0 ? _.create(h.DIV_BY_ZERO) : r.divided(e));
5968
+ return r.isError() || e.isError() ? d.create(h.VALUE) : (r.isReferenceObject() && (r = r.toArrayValueObject()), e.isReferenceObject() && (e = e.toArrayValueObject()), !e.isArray() && e.getValue() === 0 ? d.create(h.DIV_BY_ZERO) : r.divided(e));
5958
5969
  }
5959
5970
  }
5960
5971
  class _i extends B {
@@ -5964,12 +5975,12 @@ class _i extends B {
5964
5975
  }
5965
5976
  class di extends B {
5966
5977
  calculate(r, e) {
5967
- return r.isError() || e.isError() ? _.create(h.VALUE) : (r.isReferenceObject() && (r = r.toArrayValueObject()), e.isReferenceObject() && (e = e.toArrayValueObject()), r.multiply(e));
5978
+ return r.isError() || e.isError() ? d.create(h.VALUE) : (r.isReferenceObject() && (r = r.toArrayValueObject()), e.isReferenceObject() && (e = e.toArrayValueObject()), r.multiply(e));
5968
5979
  }
5969
5980
  }
5970
5981
  class mi extends B {
5971
5982
  calculate(r, e) {
5972
- return r.isError() || e.isError() ? _.create(h.VALUE) : (r.isReferenceObject() && (r = r.toArrayValueObject()), e.isReferenceObject() && (e = e.toArrayValueObject()), r.plus(e));
5983
+ return r.isError() || e.isError() ? d.create(h.VALUE) : (r.isReferenceObject() && (r = r.toArrayValueObject()), e.isReferenceObject() && (e = e.toArrayValueObject()), r.plus(e));
5973
5984
  }
5974
5985
  }
5975
5986
  class gi extends B {
@@ -5981,7 +5992,7 @@ class gi extends B {
5981
5992
  this._compareType = e;
5982
5993
  }
5983
5994
  calculate(e, t) {
5984
- return e.isError() || t.isError() || !e.isReferenceObject() || !t.isReferenceObject() ? _.create(h.REF) : (e = e, t = t, e.isCell() && t.isCell() || e.isRow() && t.isRow() || e.isColumn() && t.isColumn() ? e.unionBy(t) : _.create(h.REF));
5995
+ return e.isError() || t.isError() || !e.isReferenceObject() || !t.isReferenceObject() ? d.create(h.REF) : (e = e, t = t, e.isCell() && t.isCell() || e.isRow() && t.isRow() || e.isColumn() && t.isColumn() ? e.unionBy(t) : d.create(h.REF));
5985
5996
  }
5986
5997
  }
5987
5998
  const Ci = [
@@ -6068,10 +6079,10 @@ const Ri = [
6068
6079
  [ir, Ce.MIN],
6069
6080
  [Ni, Ce.COUNTA]
6070
6081
  ], Si = [], Di = [], yi = [];
6071
- var Li = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, Fi = (s, r, e, t) => {
6072
- for (var n = t > 1 ? void 0 : t ? wi(r, e) : r, i = s.length - 1, a; i >= 0; i--)
6082
+ var wi = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, Fi = (s, r, e, t) => {
6083
+ for (var n = t > 1 ? void 0 : t ? Li(r, e) : r, i = s.length - 1, a; i >= 0; i--)
6073
6084
  (a = s[i]) && (n = (t ? a(r, e, n) : a(n)) || n);
6074
- return t && n && Li(r, e, n), n;
6085
+ return t && n && wi(r, e, n), n;
6075
6086
  }, Rt = (s, r) => (e, t) => r(e, t, s);
6076
6087
  let Je = class extends I {
6077
6088
  constructor(s, r, e) {
@@ -6086,7 +6097,7 @@ let Je = class extends I {
6086
6097
  yt,
6087
6098
  Cr,
6088
6099
  Er,
6089
- Lt,
6100
+ wt,
6090
6101
  pr,
6091
6102
  Vt,
6092
6103
  Bt,
@@ -6128,7 +6139,7 @@ Je = Fi([
6128
6139
  le(he.Ready, Je),
6129
6140
  Rt(0, Ue),
6130
6141
  Rt(1, b(Oe)),
6131
- Rt(2, Le)
6142
+ Rt(2, we)
6132
6143
  ], Je);
6133
6144
  var Ti = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ui = (s, r, e, t) => {
6134
6145
  for (var n = t > 1 ? void 0 : t ? bi(r, e) : r, i = s.length - 1, a; i >= 0; i--)
@@ -6299,7 +6310,7 @@ let lr = class extends jr {
6299
6310
  var r;
6300
6311
  const s = [
6301
6312
  // Services
6302
- [Le, { useClass: $n }],
6313
+ [we, { useClass: $n }],
6303
6314
  [Gt, { useClass: Fs }],
6304
6315
  [mt, { useClass: Tn }],
6305
6316
  // Models
@@ -6355,7 +6366,7 @@ export {
6355
6366
  Y as BooleanValueObject,
6356
6367
  Qe as CalculateFormulaService,
6357
6368
  h as ErrorType,
6358
- _ as ErrorValueObject,
6369
+ d as ErrorValueObject,
6359
6370
  Ji as FUNCTION_NAMES_ARRAY,
6360
6371
  $t as FUNCTION_NAMES_COMPATIBILITY,
6361
6372
  ea as FUNCTION_NAMES_CUBE,
@@ -6378,7 +6389,7 @@ export {
6378
6389
  $n as FunctionService,
6379
6390
  Yr as FunctionType,
6380
6391
  Gt as IFeatureCalculationManagerService,
6381
- Le as IFunctionService,
6392
+ we as IFunctionService,
6382
6393
  y as LexerNode,
6383
6394
  Pt as LexerTreeBuilder,
6384
6395
  E as NumberValueObject,
@@ -6392,7 +6403,7 @@ export {
6392
6403
  Zi as SetArrayFormulaDataUndoMutationFactory,
6393
6404
  Vt as SetDefinedNameMutation,
6394
6405
  mr as SetFeatureCalculationMutation,
6395
- Lt as SetFormulaCalculationNotificationMutation,
6406
+ wt as SetFormulaCalculationNotificationMutation,
6396
6407
  pr as SetFormulaCalculationResultMutation,
6397
6408
  Cr as SetFormulaCalculationStartMutation,
6398
6409
  Er as SetFormulaCalculationStopMutation,
@@ -6410,7 +6421,7 @@ export {
6410
6421
  ln as initSheetFormulaData,
6411
6422
  Yt as isFormulaLexerToken,
6412
6423
  Gr as isInDirtyRange,
6413
- L as matchToken,
6424
+ w as matchToken,
6414
6425
  Wi as normalizeSheetName,
6415
6426
  K as sequenceNodeType
6416
6427
  };