@univerjs/engine-formula 0.6.2 → 0.6.3-nightly.202503051607

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 Yu = Object.defineProperty;
2
2
  var Hu = (i, a, e) => a in i ? Yu(i, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[a] = e;
3
3
  var A = (i, a, e) => Hu(i, typeof a != "symbol" ? a + "" : a, e);
4
- import { ObjectMatrix as Ce, CommandType as Ie, RANGE_TYPE as Ze, AbsoluteRefType as Se, Tools as ze, createIdentifier as ft, Disposable as Oe, IUniverInstanceService as sa, LRUMap as Gu, hashAlgorithm as Qu, moveRangeByOffset as aa, isValidRange as Wu, isFormulaString as yt, isFormulaId as Pt, Rectangle as Ka, cellToRange as qu, Inject as Ve, UniverInstanceType as Dr, LocaleService as Ku, LocaleType as Mr, numfmt as gt, BuildTextUtils as Xu, isRealNum as Q, CellValueType as Rt, toDisposable as Zu, Injector as Gi, sortRules as zu, RTree as Rs, IConfigService as ia, requestImmediateMacroTask as Ju, ICommandService as ar, BooleanNumber as ec, DataStreamTreeTokenType as ve, DisposableCollection as tc, Optional as rc, Plugin as nc, merge as sc, touchDependencies as as } from "@univerjs/core";
4
+ import { ObjectMatrix as Ce, CommandType as Ie, RANGE_TYPE as Ze, AbsoluteRefType as Se, Tools as ze, createIdentifier as lt, Disposable as Oe, IUniverInstanceService as sa, LRUMap as Gu, hashAlgorithm as Qu, moveRangeByOffset as aa, isValidRange as Wu, isFormulaString as yt, isFormulaId as Pt, Rectangle as Ka, cellToRange as qu, Inject as Ve, UniverInstanceType as Dr, LocaleService as Ku, LocaleType as Mr, numfmt as gt, BuildTextUtils as Xu, isRealNum as Q, CellValueType as Rt, toDisposable as Zu, Injector as Gi, sortRules as zu, RTree as ps, IConfigService as ia, requestImmediateMacroTask as Ju, ICommandService as ar, BooleanNumber as ec, DataStreamTreeTokenType as ve, DisposableCollection as tc, Optional as rc, Plugin as nc, merge as sc, touchDependencies as is } from "@univerjs/core";
5
5
  import { Subject as cr, BehaviorSubject as Qi, distinctUntilChanged as Wi, combineLatest as ac, map as ic, Observable as oc, shareReplay as uc } from "rxjs";
6
6
  import { isTextFormat as cc } from "@univerjs/engine-numfmt";
7
7
  import { DataSyncPrimaryController as lc } from "@univerjs/rpc";
@@ -59,7 +59,7 @@ const tn = /* @__PURE__ */ new Map([
59
59
  /* LESS_THAN_OR_EQUAL */
60
60
  ]);
61
61
  var K = /* @__PURE__ */ ((i) => (i.OPEN_BRACKET = "(", i.CLOSE_BRACKET = ")", i.COMMA = ",", i.SINGLE_QUOTATION = "'", i.DOUBLE_QUOTATION = '"', i.OPEN_BRACES = "{", i.CLOSE_BRACES = "}", i.COLON = ":", i.OPEN_SQUARE_BRACKET = "[", i.CLOSE_SQUARE_BRACKET = "]", i))(K || {}), Je = /* @__PURE__ */ ((i) => (i.PERCENTAGE = "%", i.POUND = "#", i))(Je || {});
62
- const is = /* @__PURE__ */ new Set([
62
+ const os = /* @__PURE__ */ new Set([
63
63
  "%",
64
64
  "#"
65
65
  /* POUND */
@@ -161,7 +161,7 @@ function Rc(i) {
161
161
  }
162
162
  return a;
163
163
  }
164
- const Ki = '\\[([^\\[\\]\\/?:"<>|*\\\\]+)\\]', za = new RegExp(Ki), pc = "((?![\\[\\]\\/?*\\\\]).)*!", Tt = "$", oa = "\\s*?:\\s*?", fn = "[A-Za-z]+", hn = "[1-9][0-9]*", Rr = `'?(${Ki})?(${pc})?'?`, ps = `\\${Tt}?${fn}\\${Tt}?${hn}`, Vc = `^(${Me.AT})?${Rr}${ps}${oa}${ps}$`, Ja = new RegExp(Vc), Nc = `^${Rr}\\s*?${ps}(${Je.POUND})?$`, ei = new RegExp(Nc), Oc = `^${Rr}\\${Tt}?${hn}${oa}\\${Tt}?${hn}$`, ti = new RegExp(Oc), Mc = `^${Rr}\\${Tt}?${fn}${oa}\\${Tt}?${fn}$`, ri = new RegExp(Mc), Sc = `^${Rr}\\s*?\\${Tt}?${hn}$`, ni = new RegExp(Sc), wc = `^${Rr}\\s*?\\${Tt}?${fn}$`, si = new RegExp(wc), Dc = "{.*?}", ai = new RegExp(Dc, "g");
164
+ const Ki = '\\[([^\\[\\]\\/?:"<>|*\\\\]+)\\]', za = new RegExp(Ki), pc = "((?![\\[\\]\\/?*\\\\]).)*!", Tt = "$", oa = "\\s*?:\\s*?", hn = "[A-Za-z]+", mn = "[1-9][0-9]*", Rr = `'?(${Ki})?(${pc})?'?`, Vs = `\\${Tt}?${hn}\\${Tt}?${mn}`, Vc = `^(${Me.AT})?${Rr}${Vs}${oa}${Vs}$`, Ja = new RegExp(Vc), Nc = `^${Rr}\\s*?${Vs}(${Je.POUND})?$`, ei = new RegExp(Nc), Oc = `^${Rr}\\${Tt}?${mn}${oa}\\${Tt}?${mn}$`, ti = new RegExp(Oc), Mc = `^${Rr}\\${Tt}?${hn}${oa}\\${Tt}?${hn}$`, ri = new RegExp(Mc), Sc = `^${Rr}\\s*?\\${Tt}?${mn}$`, ni = new RegExp(Sc), wc = `^${Rr}\\s*?\\${Tt}?${hn}$`, si = new RegExp(wc), Dc = "{.*?}", ai = new RegExp(Dc, "g");
165
165
  function Tr(i) {
166
166
  return ei.lastIndex = 0, ei.test(i);
167
167
  }
@@ -190,7 +190,7 @@ const jc = {
190
190
  id: "formula.mutation.register-function",
191
191
  type: Ie.MUTATION,
192
192
  handler: () => !0
193
- }, Vs = {
193
+ }, Ns = {
194
194
  id: "formula.mutation.set-array-formula-data",
195
195
  type: Ie.MUTATION,
196
196
  handler: (i, a) => !0
@@ -242,13 +242,13 @@ function Tc(i, a) {
242
242
  return `${to(i)}!${hr(a)}`;
243
243
  }
244
244
  function Bc(i, a, e) {
245
- return Os(i) || Os(a) ? `'[${Ms(i)}]${Ms(a)}'!${hr(e)}` : `[${i}]${a}!${hr(e)}`;
245
+ return Ms(i) || Ms(a) ? `'[${Ss(i)}]${Ss(a)}'!${hr(e)}` : `[${i}]${a}!${hr(e)}`;
246
246
  }
247
- function Ns(i) {
247
+ function Os(i) {
248
248
  const { unitId: a, sheetName: e, range: t } = i;
249
249
  return a != null && a.length > 0 && e != null && e.length > 0 ? Bc(a, e, t) : e != null && e.length > 0 ? Tc(e, t) : hr(t);
250
250
  }
251
- function os(i) {
251
+ function us(i) {
252
252
  const a = Number.parseInt(i.replace(Uc, "")) - 1, e = ze.ABCatNum(i.replace(vc, "")), t = nn(i);
253
253
  return {
254
254
  row: a,
@@ -268,10 +268,10 @@ function ua(i) {
268
268
  unitId: e
269
269
  };
270
270
  }
271
- function mn(i) {
271
+ function gn(i) {
272
272
  const { refBody: a, sheetName: e, unitId: t } = ua(i), r = a.indexOf(":");
273
273
  if (r === -1) {
274
- const _ = os(a), C = _.row, E = _.column, b = _.absoluteRefType;
274
+ const _ = us(a), C = _.row, E = _.column, b = _.absoluteRefType;
275
275
  return {
276
276
  unitId: t,
277
277
  sheetName: e,
@@ -285,7 +285,7 @@ function mn(i) {
285
285
  }
286
286
  };
287
287
  }
288
- const n = a.substring(0, r), s = a.substring(r + 1), o = os(n), u = os(s), c = o.row > u.row ? u.row : o.row, l = o.column > u.column ? u.column : o.column, f = o.row > u.row ? o.row : u.row, h = o.column > u.column ? o.column : u.column;
288
+ const n = a.substring(0, r), s = a.substring(r + 1), o = us(n), u = us(s), c = o.row > u.row ? u.row : o.row, l = o.column > u.column ? u.column : o.column, f = o.row > u.row ? o.row : u.row, h = o.column > u.column ? o.column : u.column;
289
289
  let d = Ze.NORMAL;
290
290
  return Number.isNaN(c) && Number.isNaN(f) ? d = Ze.COLUMN : Number.isNaN(l) && Number.isNaN(h) && (d = Ze.ROW), {
291
291
  unitId: t,
@@ -306,7 +306,7 @@ function sn(i) {
306
306
  const a = eo(i);
307
307
  if (!xc(a) || Ic.includes(a.toUpperCase().trim()))
308
308
  return !1;
309
- const { range: e } = mn(a);
309
+ const { range: e } = gn(a);
310
310
  return !(e.endColumn >= 16384);
311
311
  }
312
312
  function eo(i) {
@@ -327,7 +327,7 @@ function eo(i) {
327
327
  function Fb(i, a) {
328
328
  const e = (i == null ? void 0 : i.split(",")) || [];
329
329
  return i === "" || e.length === 0 ? [] : Fc(i) ? e.map((n) => {
330
- const s = mn(n);
330
+ const s = gn(n);
331
331
  return {
332
332
  unitId: s.unitId,
333
333
  sheetId: a(s.sheetName),
@@ -339,13 +339,13 @@ function Fb(i, a) {
339
339
  function Fc(i) {
340
340
  return ((i == null ? void 0 : i.split(",")) || []).every((e) => sn(e.trim()));
341
341
  }
342
- function Os(i) {
342
+ function Ms(i) {
343
343
  return i.length === 0 ? !1 : !!(Cc(i) || kc(i) || $c(i) || Yc(i) || /[\s!$%^&*()+\-=\[\]{};':"\\|,.<>\/?()]/.test(i));
344
344
  }
345
345
  function to(i) {
346
- return Os(i) ? `'${Ms(i)}'` : i;
346
+ return Ms(i) ? `'${Ss(i)}'` : i;
347
347
  }
348
- function Ms(i) {
348
+ function Ss(i) {
349
349
  return i.replace(/'/g, "''");
350
350
  }
351
351
  function oi(i) {
@@ -366,7 +366,7 @@ var Hc = Object.getOwnPropertyDescriptor, Gc = (i, a, e, t) => {
366
366
  (s = i[n]) && (r = s(r) || r);
367
367
  return r;
368
368
  }, Qc = (i, a) => (e, t) => a(e, t, i);
369
- let Ss = class extends Oe {
369
+ let ws = class extends Oe {
370
370
  constructor(a) {
371
371
  super();
372
372
  // 18.2.6 definedNames (Defined Names)
@@ -464,10 +464,10 @@ let Ss = class extends Oe {
464
464
  this._nameCacheMap[a][t.name] = t;
465
465
  }
466
466
  };
467
- Ss = Gc([
467
+ ws = Gc([
468
468
  Qc(0, sa)
469
- ], Ss);
470
- const pr = ft("univer.formula.defined-names.service"), kb = (i, a) => {
469
+ ], ws);
470
+ const pr = lt("univer.formula.defined-names.service"), kb = (i, a) => {
471
471
  const { unitId: e, id: t } = a;
472
472
  return {
473
473
  ...i.get(pr).getValueById(e, t),
@@ -514,7 +514,7 @@ const pr = ft("univer.formula.defined-names.service"), kb = (i, a) => {
514
514
  id: "formula.mutation.set-formula-calculation-stop",
515
515
  type: Ie.MUTATION,
516
516
  handler: () => !0
517
- }, gn = {
517
+ }, dn = {
518
518
  id: "formula.mutation.set-formula-calculation-notification",
519
519
  type: Ie.MUTATION,
520
520
  handler: () => !0
@@ -567,16 +567,16 @@ class Nt {
567
567
  return a.length <= 64 ? a : Qu(a).toString();
568
568
  }
569
569
  }
570
- const ht = "P_1", Ut = "R_1", mr = "L_1", Br = "LR_1", uo = "LO_1", Kc = "LET", Lr = "LAMBDA", Xc = "CUBE", Zc = /* @__PURE__ */ new Set(["RAND", "RANDBETWEEN", "NOW", "TODAY"]), ws = new Nt(1e5);
570
+ const ft = "P_1", Ut = "R_1", mr = "L_1", Br = "LR_1", uo = "LO_1", Kc = "LET", Lr = "LAMBDA", Xc = "CUBE", Zc = /* @__PURE__ */ new Set(["RAND", "RANDBETWEEN", "NOW", "TODAY"]), Ds = new Nt(1e5);
571
571
  function gr(i) {
572
- const a = ws.get(i);
572
+ const a = Ds.get(i);
573
573
  if (a)
574
574
  return a;
575
- const e = mn(i);
576
- return ws.set(i, e), mn(i);
575
+ const e = gn(i);
576
+ return Ds.set(i, e), gn(i);
577
577
  }
578
578
  function zc() {
579
- ws.clear();
579
+ Ds.clear();
580
580
  }
581
581
  var $e = /* @__PURE__ */ ((i) => (i[i.NORMAL = 0] = "NORMAL", i[i.NUMBER = 1] = "NUMBER", i[i.STRING = 2] = "STRING", i[i.FUNCTION = 3] = "FUNCTION", i[i.REFERENCE = 4] = "REFERENCE", i[i.ARRAY = 5] = "ARRAY", i[i.DEFINED_NAME = 6] = "DEFINED_NAME", i))($e || {});
582
582
  function ui(i) {
@@ -692,7 +692,7 @@ class ae {
692
692
  return r;
693
693
  }
694
694
  }
695
- const co = 2e3, us = new Nt(co), cs = new Nt(co);
695
+ const co = 2e3, cs = new Nt(co), ls = new Nt(co);
696
696
  class ga extends Oe {
697
697
  constructor() {
698
698
  super(...arguments);
@@ -717,7 +717,7 @@ class ga extends Oe {
717
717
  }
718
718
  // Table3[[#All],[Column1]:[Column2]]
719
719
  dispose() {
720
- this._resetTemp(), this._currentLexerNode.dispose(), us.clear(), cs.clear();
720
+ this._resetTemp(), this._currentLexerNode.dispose(), cs.clear(), ls.clear();
721
721
  }
722
722
  getUpLevel() {
723
723
  return this._upLevel;
@@ -762,7 +762,7 @@ class ga extends Oe {
762
762
  let s = n.getParent(), o = n;
763
763
  for (; s; ) {
764
764
  const u = s.getToken();
765
- if (u !== ht && !rn(u) && s.getStartIndex() !== -1) {
765
+ if (u !== ft && !rn(u) && s.getStartIndex() !== -1) {
766
766
  const c = s.getChildren().indexOf(o);
767
767
  return {
768
768
  functionName: u,
@@ -789,19 +789,19 @@ class ga extends Oe {
789
789
  let u = o.getParent(), c = 0;
790
790
  for (s[1] === K.OPEN_BRACKET && c++; u; ) {
791
791
  const l = u.getToken();
792
- l !== ht && l !== K.COLON && u.getStartIndex() !== -1 && l.toUpperCase() !== Lr && (t === 0 ? c += 1 : t--), u = u.getParent();
792
+ l !== ft && l !== K.COLON && u.getStartIndex() !== -1 && l.toUpperCase() !== Lr && (t === 0 ? c += 1 : t--), u = u.getParent();
793
793
  }
794
794
  return c;
795
795
  }
796
796
  sequenceNodesBuilder(e) {
797
- const t = cs.get(e);
797
+ const t = ls.get(e);
798
798
  if (t)
799
799
  return [...t];
800
800
  const r = this._getSequenceArray(e);
801
801
  if (r.length === 0)
802
802
  return;
803
803
  const n = this.getSequenceNode(r);
804
- return cs.set(e, [...n]), n;
804
+ return ls.set(e, [...n]), n;
805
805
  }
806
806
  convertRefersToAbsolute(e, t, r, n = "") {
807
807
  const s = this.sequenceNodesBuilder(e);
@@ -819,7 +819,7 @@ class ga extends Oe {
819
819
  ..._,
820
820
  startAbsoluteRefType: t,
821
821
  endAbsoluteRefType: r
822
- }, R = Ns({
822
+ }, R = Os({
823
823
  range: b,
824
824
  unitId: E,
825
825
  sheetName: C || n
@@ -856,7 +856,7 @@ class ga extends Oe {
856
856
  } else
857
857
  C = aa(C, t, r, n);
858
858
  let E = "";
859
- Wu(C) ? E = Ns({
859
+ Wu(C) ? E = Os({
860
860
  range: C,
861
861
  unitId: _,
862
862
  sheetName: d
@@ -875,7 +875,7 @@ class ga extends Oe {
875
875
  if (this._currentLexerNode.getChildren().length === 0)
876
876
  return !0;
877
877
  const e = this._currentLexerNode.getChildren()[0];
878
- return !!(e instanceof ae || Dt.has(e) || is.has(e) || e === Me.AT || e === K.COMMA || e === K.COLON || e === K.OPEN_BRACKET);
878
+ return !!(e instanceof ae || Dt.has(e) || os.has(e) || e === Me.AT || e === K.COMMA || e === K.COLON || e === K.OPEN_BRACKET);
879
879
  }
880
880
  // eslint-disable-next-line complexity
881
881
  getSequenceNode(e) {
@@ -983,7 +983,7 @@ class ga extends Oe {
983
983
  }
984
984
  treeBuilder(e, t = !0, r, n) {
985
985
  if (t === !0) {
986
- const h = us.get(e), d = n == null ? void 0 : n(e);
986
+ const h = cs.get(e), d = n == null ? void 0 : n(e);
987
987
  if (h && !d)
988
988
  return h;
989
989
  }
@@ -1003,7 +1003,7 @@ class ga extends Oe {
1003
1003
  if (f && (this._currentLexerNode = f), t) {
1004
1004
  if (!this._suffixExpressionHandler(this._currentLexerNode))
1005
1005
  return m.VALUE;
1006
- us.set(e, this._currentLexerNode);
1006
+ cs.set(e, this._currentLexerNode);
1007
1007
  }
1008
1008
  return u && this._currentLexerNode.setDefinedNames(l), this._currentLexerNode;
1009
1009
  }
@@ -1249,7 +1249,7 @@ class ga extends Oe {
1249
1249
  const r = this._findPreviousToken(e, t) || "", n = e.length - 1 === t;
1250
1250
  if (!n && this._isOperatorToken(r) || n && Ac(r))
1251
1251
  return !0;
1252
- if (is.has(r)) {
1252
+ if (os.has(r)) {
1253
1253
  const s = this._findSecondLastNonSpaceToken(e, t);
1254
1254
  if (s == null || bc(s))
1255
1255
  return !0;
@@ -1358,7 +1358,7 @@ class ga extends Oe {
1358
1358
  return m.VALUE;
1359
1359
  this._addSequenceArray(t, c, u), u++, this._addSequenceArray(t, l, u), u++, this._closeBracket();
1360
1360
  continue;
1361
- } else l && this._newAndPushCurrentLexerNode(ht, u);
1361
+ } else l && this._newAndPushCurrentLexerNode(ft, u);
1362
1362
  } else
1363
1363
  this._pushNodeToChildren(c), this._openBracket(
1364
1364
  0
@@ -1415,12 +1415,12 @@ class ga extends Oe {
1415
1415
  if (l === 1 || l == null) {
1416
1416
  if (this._pushNodeToChildren(this._segment), this._resetSegment(), !this._setParentCurrentLexerNode() && u !== o - 1 && l != null)
1417
1417
  return m.VALUE;
1418
- this._newAndPushCurrentLexerNode(ht, u);
1418
+ this._newAndPushCurrentLexerNode(ft, u);
1419
1419
  } else {
1420
1420
  const f = new ae();
1421
1421
  f.setToken(Xc);
1422
1422
  const h = new ae();
1423
- h.setToken(ht), h.changeToParent(f);
1423
+ h.setToken(ft), h.changeToParent(f);
1424
1424
  const d = this._currentLexerNode.getParent();
1425
1425
  if (d && d.getToken() === K.COLON) {
1426
1426
  const _ = d.getParent();
@@ -1432,15 +1432,15 @@ class ga extends Oe {
1432
1432
  this._changeCurrentBracket(
1433
1433
  1
1434
1434
  /* FUNCTION */
1435
- ), this._pushNodeToChildren(this._segment), this._resetSegment(), this._currentLexerNode = f, this._newAndPushCurrentLexerNode(ht, u);
1435
+ ), this._pushNodeToChildren(this._segment), this._resetSegment(), this._currentLexerNode = f, this._newAndPushCurrentLexerNode(ft, u);
1436
1436
  }
1437
1437
  } else if (c === K.COLON && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isBracesClose() && this.isSquareBracketClose()) {
1438
1438
  const l = new ae();
1439
1439
  l.setToken(c);
1440
1440
  const f = new ae();
1441
- f.setToken(ht), f.setParent(l);
1441
+ f.setToken(ft), f.setParent(l);
1442
1442
  const h = new ae();
1443
- h.setToken(ht), h.setParent(l), l.getChildren().push(f, h);
1443
+ h.setToken(ft), h.setParent(l), l.getChildren().push(f, h);
1444
1444
  let d = l, _ = 0;
1445
1445
  if (this._segmentCount() > 0) {
1446
1446
  let C, E, b = 0;
@@ -1459,7 +1459,7 @@ class ga extends Oe {
1459
1459
  C && C.changeToParent(f);
1460
1460
  }
1461
1461
  this._setCurrentLexerNode(d), this._currentLexerNode = h, this._openColon(_);
1462
- } else if (is.has(c) && this._checkSimilarErrorToken(c, u, s) && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isSquareBracketClose() && this.isBracesClose()) {
1462
+ } else if (os.has(c) && this._checkSimilarErrorToken(c, u, s) && this.isSingleQuotationClose() && this.isDoubleQuotationClose() && this.isSquareBracketClose() && this.isBracesClose()) {
1463
1463
  this._pushNodeToChildren(this._segment);
1464
1464
  const l = new ae();
1465
1465
  l.setToken(c);
@@ -1874,7 +1874,7 @@ function li(i, a, e, t) {
1874
1874
  }
1875
1875
  };
1876
1876
  }
1877
- const nl = class Ds {
1877
+ const nl = class Ls {
1878
1878
  /**
1879
1879
  * Accept two comparable values and creates new instance of interval
1880
1880
  * Predicate Interval.comparable_less(low, high) supposed to return true on these values
@@ -1889,7 +1889,7 @@ const nl = class Ds {
1889
1889
  * @returns {Interval}
1890
1890
  */
1891
1891
  clone() {
1892
- return new Ds(this.low, this.high);
1892
+ return new Ls(this.low, this.high);
1893
1893
  }
1894
1894
  /**
1895
1895
  * Propery max returns clone of this interval
@@ -1936,7 +1936,7 @@ const nl = class Ds {
1936
1936
  * @returns {Interval}
1937
1937
  */
1938
1938
  merge(a) {
1939
- return new Ds(
1939
+ return new Ls(
1940
1940
  this.low === void 0 ? a.low : this.low < a.low ? this.low : a.low,
1941
1941
  this.high === void 0 ? a.high : this.high > a.high ? this.high : a.high
1942
1942
  );
@@ -2383,7 +2383,7 @@ var al = Object.getOwnPropertyDescriptor, il = (i, a, e, t) => {
2383
2383
  (s = i[n]) && (r = s(r) || r);
2384
2384
  return r;
2385
2385
  }, hi = (i, a) => (e, t) => a(e, t, i);
2386
- let Ls = class extends Oe {
2386
+ let Ps = class extends Oe {
2387
2387
  constructor(a, e) {
2388
2388
  super();
2389
2389
  A(this, "_unitData", {});
@@ -2606,18 +2606,18 @@ let Ls = class extends Oe {
2606
2606
  };
2607
2607
  }
2608
2608
  };
2609
- Ls = il([
2609
+ Ps = il([
2610
2610
  hi(0, sa),
2611
2611
  hi(1, Ve(Ku))
2612
- ], Ls);
2613
- const Ft = ft(
2612
+ ], Ps);
2613
+ const Ft = lt(
2614
2614
  "univer.formula.current-data.service"
2615
2615
  );
2616
2616
  var ol = Object.getOwnPropertyDescriptor, ul = (i, a, e, t) => {
2617
2617
  for (var r = t > 1 ? void 0 : t ? ol(a, e) : a, n = i.length - 1, s; n >= 0; n--)
2618
2618
  (s = i[n]) && (r = s(r) || r);
2619
2619
  return r;
2620
- }, ls = (i, a) => (e, t) => a(e, t, i);
2620
+ }, fs = (i, a) => (e, t) => a(e, t, i);
2621
2621
  let dr = class extends Oe {
2622
2622
  constructor(i, a, e) {
2623
2623
  super(), this._definedNamesService = i, this._lexerTreeBuilder = a, this._formulaCurrentConfigService = e;
@@ -2682,9 +2682,9 @@ let dr = class extends Oe {
2682
2682
  }
2683
2683
  };
2684
2684
  dr = ul([
2685
- ls(0, pr),
2686
- ls(1, Ve(ga)),
2687
- ls(2, Ft)
2685
+ fs(0, pr),
2686
+ fs(1, Ve(ga)),
2687
+ fs(2, Ft)
2688
2688
  ], dr);
2689
2689
  function an(i) {
2690
2690
  if (i == null)
@@ -2761,16 +2761,16 @@ function Yb(i, a, e) {
2761
2761
  const o = n || s;
2762
2762
  return r.n.pattern = o, a;
2763
2763
  }
2764
- const Ps = new Nt(1e5);
2764
+ const xs = new Nt(1e5);
2765
2765
  function mi(i) {
2766
- const a = Ps.get(i);
2766
+ const a = xs.get(i);
2767
2767
  if (a !== void 0)
2768
2768
  return a;
2769
2769
  const e = hl(i);
2770
- return Ps.set(i, e), e;
2770
+ return xs.set(i, e), e;
2771
2771
  }
2772
2772
  function fl() {
2773
- Ps.clear();
2773
+ xs.clear();
2774
2774
  }
2775
2775
  function hl(i) {
2776
2776
  if (ml(i))
@@ -2822,16 +2822,16 @@ function Cl(i) {
2822
2822
  };
2823
2823
  const t = gt.parseNumber(a);
2824
2824
  if (t && t.z)
2825
- return fs(a, t.v, t.z);
2825
+ return hs(a, t.v, t.z);
2826
2826
  const r = gt.parseDate(a);
2827
2827
  if (r && r.z)
2828
- return fs(a, r.v, r.z);
2828
+ return hs(a, r.v, r.z);
2829
2829
  const n = gt.parseTime(a);
2830
- return n && n.z ? fs(a, n.v, n.z) : {
2830
+ return n && n.z ? hs(a, n.v, n.z) : {
2831
2831
  isNumberPattern: !1
2832
2832
  };
2833
2833
  }
2834
- function fs(i, a, e) {
2834
+ function hs(i, a, e) {
2835
2835
  return _a.set(i, {
2836
2836
  value: a,
2837
2837
  pattern: e
@@ -2844,7 +2844,7 @@ function fs(i, a, e) {
2844
2844
  function _l() {
2845
2845
  _a.clear();
2846
2846
  }
2847
- class Bn {
2847
+ class In {
2848
2848
  constructor() {
2849
2849
  A(this, "pattern", "");
2850
2850
  }
@@ -2882,7 +2882,7 @@ class Bn {
2882
2882
  return !1;
2883
2883
  }
2884
2884
  }
2885
- class kt extends Bn {
2885
+ class kt extends In {
2886
2886
  constructor(e) {
2887
2887
  super();
2888
2888
  A(this, "_customData");
@@ -3177,17 +3177,17 @@ class kt extends Bn {
3177
3177
  return g.create(m.VALUE);
3178
3178
  }
3179
3179
  }
3180
- const Al = 1e3, xs = new Nt(Al);
3180
+ const Al = 1e3, js = new Nt(Al);
3181
3181
  class g extends kt {
3182
3182
  constructor(a, e = "") {
3183
3183
  super(a), this._errorType = a, this._errorContent = e;
3184
3184
  }
3185
3185
  static create(a, e = "") {
3186
- const t = `${a}-${e}`, r = xs.get(t);
3186
+ const t = `${a}-${e}`, r = js.get(t);
3187
3187
  if (r)
3188
3188
  return r;
3189
3189
  const n = new g(a, e);
3190
- return xs.set(t, n), n;
3190
+ return js.set(t, n), n;
3191
3191
  }
3192
3192
  getValue() {
3193
3193
  return this._errorType;
@@ -3218,13 +3218,13 @@ function El(i) {
3218
3218
  return (i == null ? void 0 : i.v) || 0;
3219
3219
  }
3220
3220
  var Wt = /* @__PURE__ */ ((i) => (i[i.MIN = 0] = "MIN", i[i.MAX = 1] = "MAX", i))(Wt || {}), Le = /* @__PURE__ */ ((i) => (i[i.NORMAL = 0] = "NORMAL", i[i.MIN = 1] = "MIN", i[i.MAX = 2] = "MAX", i))(Le || {});
3221
- function dn() {
3221
+ function Cn() {
3222
3222
  return Intl && Intl.Collator ? new Intl.Collator(void 0, { numeric: !1 }).compare : (i, a) => i.localeCompare(a);
3223
3223
  }
3224
3224
  function bl(i) {
3225
3225
  return i.indexOf("*") > -1 || i.indexOf("?") > -1;
3226
3226
  }
3227
- function hs(i, a) {
3227
+ function ms(i, a) {
3228
3228
  const e = Rl(a).replace(/~?[*?]/g, (r) => r.startsWith("~") ? `\\${r.substring(1)}` : r === "*" ? ".*" : r === "?" ? "." : r);
3229
3229
  return new RegExp(`^${e}$`).test(i);
3230
3230
  }
@@ -3235,14 +3235,14 @@ function yl(i, a, e) {
3235
3235
  let t = !1;
3236
3236
  switch (e) {
3237
3237
  case $.EQUALS:
3238
- t = hs(i, a);
3238
+ t = ms(i, a);
3239
3239
  break;
3240
3240
  case $.NOT_EQUAL:
3241
- t = !hs(i, a);
3241
+ t = !ms(i, a);
3242
3242
  break;
3243
3243
  case $.GREATER_THAN:
3244
3244
  case $.GREATER_THAN_OR_EQUAL:
3245
- t = hs(i, a) || i > di(a);
3245
+ t = ms(i, a) || i > di(a);
3246
3246
  break;
3247
3247
  case $.LESS_THAN:
3248
3248
  case $.LESS_THAN_OR_EQUAL:
@@ -3254,7 +3254,7 @@ function yl(i, a, e) {
3254
3254
  function Rl(i) {
3255
3255
  return i.replace(/[.+^${}()|[\]\\]/g, "\\$&");
3256
3256
  }
3257
- function js(i) {
3257
+ function Us(i) {
3258
3258
  switch (i) {
3259
3259
  case 1:
3260
3260
  return 2;
@@ -3266,7 +3266,7 @@ function js(i) {
3266
3266
  return 0;
3267
3267
  }
3268
3268
  }
3269
- function Us(i) {
3269
+ function vs(i) {
3270
3270
  return i === -2 ? 1 : 0;
3271
3271
  }
3272
3272
  function Aa(i) {
@@ -3294,13 +3294,13 @@ function Aa(i) {
3294
3294
  return a;
3295
3295
  }
3296
3296
  /*!
3297
- * decimal.js v10.4.3
3297
+ * decimal.js v10.5.0
3298
3298
  * An arbitrary-precision Decimal type for JavaScript.
3299
3299
  * https://github.com/MikeMcl/decimal.js
3300
- * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
3300
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
3301
3301
  * MIT Licence
3302
3302
  */
3303
- var vs = 9e15, $t = 1e9, Ts = "0123456789abcdef", Cn = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", _n = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", Bs = {
3303
+ var Ts = 9e15, $t = 1e9, Bs = "0123456789abcdef", _n = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", An = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", Is = {
3304
3304
  // These values must be integers within the stated ranges (inclusive).
3305
3305
  // Most of these values can be changed at run-time using the `Decimal.config` method.
3306
3306
  // The maximum number of significant digits of the result of a calculation or base conversion.
@@ -3353,12 +3353,12 @@ var vs = 9e15, $t = 1e9, Ts = "0123456789abcdef", Cn = "2.3025850929940456840179
3353
3353
  // -1 to -EXP_LIMIT
3354
3354
  // The maximum exponent value, above which overflow to Infinity occurs.
3355
3355
  // JavaScript numbers: 308 (1.7976931348623157e+308)
3356
- maxE: vs,
3356
+ maxE: Ts,
3357
3357
  // 1 to EXP_LIMIT
3358
3358
  // Whether to use cryptographically-secure random number generation, if available.
3359
3359
  crypto: !1
3360
3360
  // true/false
3361
- }, ho, pt, ue = !0, In = "[DecimalError] ", Bt = In + "Invalid argument: ", mo = In + "Precision limit exceeded", go = In + "crypto unavailable", Co = "[object Decimal]", Be = Math.floor, Pe = Math.pow, pl = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Vl = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Nl = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, _o = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, ct = 1e7, te = 7, Ol = 9007199254740991, Ml = Cn.length - 1, Is = _n.length - 1, B = { toStringTag: Co };
3361
+ }, ho, pt, ue = !0, Fn = "[DecimalError] ", Bt = Fn + "Invalid argument: ", mo = Fn + "Precision limit exceeded", go = Fn + "crypto unavailable", Co = "[object Decimal]", Be = Math.floor, Pe = Math.pow, pl = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, Vl = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Nl = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, _o = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, ut = 1e7, te = 7, Ol = 9007199254740991, Ml = _n.length - 1, Fs = An.length - 1, B = { toStringTag: Co };
3362
3362
  B.absoluteValue = B.abs = function() {
3363
3363
  var i = new this.constructor(this);
3364
3364
  return i.s < 0 && (i.s = 1), J(i);
@@ -3436,7 +3436,7 @@ B.hyperbolicCosine = B.cosh = function() {
3436
3436
  var i, a, e, t, r, n = this, s = n.constructor, o = new s(1);
3437
3437
  if (!n.isFinite()) return new s(n.s ? 1 / 0 : NaN);
3438
3438
  if (n.isZero()) return o;
3439
- e = s.precision, t = s.rounding, s.precision = e + Math.max(n.e, n.sd()) + 4, s.rounding = 1, r = n.d.length, r < 32 ? (i = Math.ceil(r / 3), a = (1 / kn(4, i)).toString()) : (i = 16, a = "2.3283064365386962890625e-10"), n = Cr(s, 1, n.times(a), new s(1), !0);
3439
+ e = s.precision, t = s.rounding, s.precision = e + Math.max(n.e, n.sd()) + 4, s.rounding = 1, r = n.d.length, r < 32 ? (i = Math.ceil(r / 3), a = (1 / $n(4, i)).toString()) : (i = 16, a = "2.3283064365386962890625e-10"), n = Cr(s, 1, n.times(a), new s(1), !0);
3440
3440
  for (var u, c = i, l = new s(8); c--; )
3441
3441
  u = n.times(n), n = o.minus(u.times(l.minus(u.times(l))));
3442
3442
  return J(n, s.precision = e, s.rounding = t, !0);
@@ -3447,7 +3447,7 @@ B.hyperbolicSine = B.sinh = function() {
3447
3447
  if (a = n.precision, e = n.rounding, n.precision = a + Math.max(r.e, r.sd()) + 4, n.rounding = 1, t = r.d.length, t < 3)
3448
3448
  r = Cr(n, 2, r, r, !0);
3449
3449
  else {
3450
- i = 1.4 * Math.sqrt(t), i = i > 16 ? 16 : i | 0, r = r.times(1 / kn(5, i)), r = Cr(n, 2, r, r, !0);
3450
+ i = 1.4 * Math.sqrt(t), i = i > 16 ? 16 : i | 0, r = r.times(1 / $n(5, i)), r = Cr(n, 2, r, r, !0);
3451
3451
  for (var s, o = new n(5), u = new n(16), c = new n(20); i--; )
3452
3452
  s = r.times(r), r = r.times(o.plus(s.times(u.times(s).plus(c))));
3453
3453
  }
@@ -3458,8 +3458,8 @@ B.hyperbolicTangent = B.tanh = function() {
3458
3458
  return e.isFinite() ? e.isZero() ? new t(e) : (i = t.precision, a = t.rounding, t.precision = i + 7, t.rounding = 1, pe(e.sinh(), e.cosh(), t.precision = i, t.rounding = a)) : new t(e.s);
3459
3459
  };
3460
3460
  B.inverseCosine = B.acos = function() {
3461
- var i, a = this, e = a.constructor, t = a.abs().cmp(1), r = e.precision, n = e.rounding;
3462
- return t !== -1 ? t === 0 ? a.isNeg() ? ut(e, r, n) : new e(0) : new e(NaN) : a.isZero() ? ut(e, r + 4, n).times(0.5) : (e.precision = r + 6, e.rounding = 1, a = a.asin(), i = ut(e, r + 4, n).times(0.5), e.precision = r, e.rounding = n, i.minus(a));
3461
+ var i = this, a = i.constructor, e = i.abs().cmp(1), t = a.precision, r = a.rounding;
3462
+ return e !== -1 ? e === 0 ? i.isNeg() ? mt(a, t, r) : new a(0) : new a(NaN) : i.isZero() ? mt(a, t + 4, r).times(0.5) : (a.precision = t + 6, a.rounding = 1, i = new a(1).minus(i).div(i.plus(1)).sqrt().atan(), a.precision = t, a.rounding = r, i.times(2));
3463
3463
  };
3464
3464
  B.inverseHyperbolicCosine = B.acosh = function() {
3465
3465
  var i, a, e = this, t = e.constructor;
@@ -3475,19 +3475,19 @@ B.inverseHyperbolicTangent = B.atanh = function() {
3475
3475
  };
3476
3476
  B.inverseSine = B.asin = function() {
3477
3477
  var i, a, e, t, r = this, n = r.constructor;
3478
- return r.isZero() ? new n(r) : (a = r.abs().cmp(1), e = n.precision, t = n.rounding, a !== -1 ? a === 0 ? (i = ut(n, e + 4, t).times(0.5), i.s = r.s, i) : new n(NaN) : (n.precision = e + 6, n.rounding = 1, r = r.div(new n(1).minus(r.times(r)).sqrt().plus(1)).atan(), n.precision = e, n.rounding = t, r.times(2)));
3478
+ return r.isZero() ? new n(r) : (a = r.abs().cmp(1), e = n.precision, t = n.rounding, a !== -1 ? a === 0 ? (i = mt(n, e + 4, t).times(0.5), i.s = r.s, i) : new n(NaN) : (n.precision = e + 6, n.rounding = 1, r = r.div(new n(1).minus(r.times(r)).sqrt().plus(1)).atan(), n.precision = e, n.rounding = t, r.times(2)));
3479
3479
  };
3480
3480
  B.inverseTangent = B.atan = function() {
3481
3481
  var i, a, e, t, r, n, s, o, u, c = this, l = c.constructor, f = l.precision, h = l.rounding;
3482
3482
  if (c.isFinite()) {
3483
3483
  if (c.isZero())
3484
3484
  return new l(c);
3485
- if (c.abs().eq(1) && f + 4 <= Is)
3486
- return s = ut(l, f + 4, h).times(0.25), s.s = c.s, s;
3485
+ if (c.abs().eq(1) && f + 4 <= Fs)
3486
+ return s = mt(l, f + 4, h).times(0.25), s.s = c.s, s;
3487
3487
  } else {
3488
3488
  if (!c.s) return new l(NaN);
3489
- if (f + 4 <= Is)
3490
- return s = ut(l, f + 4, h).times(0.5), s.s = c.s, s;
3489
+ if (f + 4 <= Fs)
3490
+ return s = mt(l, f + 4, h).times(0.5), s.s = c.s, s;
3491
3491
  }
3492
3492
  for (l.precision = o = f + 10, l.rounding = 1, e = Math.min(28, o / te + 2 | 0), i = e; i; --i) c = c.div(c.times(c).plus(1).sqrt().plus(1));
3493
3493
  for (ue = !1, a = Math.ceil(o / te), t = 1, u = c.times(c), s = new l(c), r = c; i !== -1; )
@@ -3535,9 +3535,9 @@ B.logarithm = B.log = function(i) {
3535
3535
  for (r = e[0]; r % 10 === 0; ) r /= 10;
3536
3536
  n = r !== 1;
3537
3537
  }
3538
- if (ue = !1, o = f + d, s = jt(c, o), t = a ? An(l, o + 10) : jt(i, o), u = pe(s, t, o, 1), xr(u.d, r = f, h))
3538
+ if (ue = !1, o = f + d, s = jt(c, o), t = a ? En(l, o + 10) : jt(i, o), u = pe(s, t, o, 1), xr(u.d, r = f, h))
3539
3539
  do
3540
- if (o += 10, s = jt(c, o), t = a ? An(l, o + 10) : jt(i, o), u = pe(s, t, o, 1), !n) {
3540
+ if (o += 10, s = jt(c, o), t = a ? En(l, o + 10) : jt(i, o), u = pe(s, t, o, 1), !n) {
3541
3541
  +Ue(u.d).slice(r + 1, r + 15) + 1 == 1e14 && (u = J(u, f + 1, 0));
3542
3542
  break;
3543
3543
  }
@@ -3570,21 +3570,21 @@ B.minus = B.sub = function(i) {
3570
3570
  for (f && (a = c, c = h, h = a, i.s = -i.s), s = c.length, t = h.length - s; t > 0; --t) c[s++] = 0;
3571
3571
  for (t = h.length; t > n; ) {
3572
3572
  if (c[--t] < h[t]) {
3573
- for (r = t; r && c[--r] === 0; ) c[r] = ct - 1;
3574
- --c[r], c[t] += ct;
3573
+ for (r = t; r && c[--r] === 0; ) c[r] = ut - 1;
3574
+ --c[r], c[t] += ut;
3575
3575
  }
3576
3576
  c[t] -= h[t];
3577
3577
  }
3578
3578
  for (; c[--s] === 0; ) c.pop();
3579
3579
  for (; c[0] === 0; c.shift()) --e;
3580
- return c[0] ? (i.d = c, i.e = Fn(c, e), ue ? J(i, o, u) : i) : new _(u === 3 ? -0 : 0);
3580
+ return c[0] ? (i.d = c, i.e = kn(c, e), ue ? J(i, o, u) : i) : new _(u === 3 ? -0 : 0);
3581
3581
  };
3582
3582
  B.modulo = B.mod = function(i) {
3583
3583
  var a, e = this, t = e.constructor;
3584
3584
  return i = new t(i), !e.d || !i.s || i.d && !i.d[0] ? new t(NaN) : !i.d || e.d && !e.d[0] ? J(new t(e), t.precision, t.rounding) : (ue = !1, t.modulo == 9 ? (a = pe(e, i.abs(), 0, 3, 1), a.s *= i.s) : a = pe(e, i, 0, t.modulo, 1), a = a.times(i), ue = !0, e.minus(a));
3585
3585
  };
3586
3586
  B.naturalExponential = B.exp = function() {
3587
- return Fs(this);
3587
+ return ks(this);
3588
3588
  };
3589
3589
  B.naturalLogarithm = B.ln = function() {
3590
3590
  return jt(this);
@@ -3606,9 +3606,9 @@ B.plus = B.add = function(i) {
3606
3606
  e.reverse();
3607
3607
  }
3608
3608
  for (s = c.length, r = l.length, s - r < 0 && (r = s, e = l, l = c, c = e), a = 0; r; )
3609
- a = (c[--r] = c[r] + l[r] + a) / ct | 0, c[r] %= ct;
3609
+ a = (c[--r] = c[r] + l[r] + a) / ut | 0, c[r] %= ut;
3610
3610
  for (a && (c.unshift(a), ++t), s = c.length; c[--s] == 0; ) c.pop();
3611
- return i.d = c, i.e = Fn(c, t), ue ? J(i, o, u) : i;
3611
+ return i.d = c, i.e = kn(c, t), ue ? J(i, o, u) : i;
3612
3612
  };
3613
3613
  B.precision = B.sd = function(i) {
3614
3614
  var a, e = this;
@@ -3652,11 +3652,11 @@ B.times = B.mul = function(i) {
3652
3652
  for (e = Be(l.e / te) + Be(i.e / te), u = h.length, c = d.length, u < c && (n = h, h = d, d = n, s = u, u = c, c = s), n = [], s = u + c, t = s; t--; ) n.push(0);
3653
3653
  for (t = c; --t >= 0; ) {
3654
3654
  for (a = 0, r = u + t; r > t; )
3655
- o = n[r] + d[t] * h[r - t - 1] + a, n[r--] = o % ct | 0, a = o / ct | 0;
3656
- n[r] = (n[r] + a) % ct | 0;
3655
+ o = n[r] + d[t] * h[r - t - 1] + a, n[r--] = o % ut | 0, a = o / ut | 0;
3656
+ n[r] = (n[r] + a) % ut | 0;
3657
3657
  }
3658
3658
  for (; !n[--s]; ) n.pop();
3659
- return a ? ++e : n.shift(), i.d = n, i.e = Fn(n, e), ue ? J(i, f.precision, f.rounding) : i;
3659
+ return a ? ++e : n.shift(), i.d = n, i.e = kn(n, e), ue ? J(i, f.precision, f.rounding) : i;
3660
3660
  };
3661
3661
  B.toBinary = function(i, a) {
3662
3662
  return Ea(this, 2, i, a);
@@ -3719,7 +3719,7 @@ B.toPower = B.pow = function(i) {
3719
3719
  if ((i.d[a] & 1) == 0 && (s = 1), o.e == 0 && o.d[0] == 1 && o.d.length == 1)
3720
3720
  return o.s = s, o;
3721
3721
  }
3722
- return e = Pe(+o, c), a = e == 0 || !isFinite(e) ? Be(c * (Math.log("0." + Ue(o.d)) / Math.LN10 + o.e + 1)) : new u(e + "").e, a > u.maxE + 1 || a < u.minE - 1 ? new u(a > 0 ? s / 0 : 0) : (ue = !1, u.rounding = o.s = 1, e = Math.min(12, (a + "").length), r = Fs(i.times(jt(o, t + e)), t), r.d && (r = J(r, t + 5, 1), xr(r.d, t, n) && (a = t + 10, r = J(Fs(i.times(jt(o, a + e)), a), a + 5, 1), +Ue(r.d).slice(t + 1, t + 15) + 1 == 1e14 && (r = J(r, t + 1, 0)))), r.s = s, ue = !0, u.rounding = n, J(r, t, n));
3722
+ return e = Pe(+o, c), a = e == 0 || !isFinite(e) ? Be(c * (Math.log("0." + Ue(o.d)) / Math.LN10 + o.e + 1)) : new u(e + "").e, a > u.maxE + 1 || a < u.minE - 1 ? new u(a > 0 ? s / 0 : 0) : (ue = !1, u.rounding = o.s = 1, e = Math.min(12, (a + "").length), r = ks(i.times(jt(o, t + e)), t), r.d && (r = J(r, t + 5, 1), xr(r.d, t, n) && (a = t + 10, r = J(ks(i.times(jt(o, a + e)), a), a + 5, 1), +Ue(r.d).slice(t + 1, t + 15) + 1 == 1e14 && (r = J(r, t + 1, 0)))), r.s = s, ue = !0, u.rounding = n, J(r, t, n));
3723
3723
  };
3724
3724
  B.toPrecision = function(i, a) {
3725
3725
  var e, t = this, r = t.constructor;
@@ -3763,7 +3763,7 @@ function xr(i, a, e, t) {
3763
3763
  function on(i, a, e) {
3764
3764
  for (var t, r = [0], n, s = 0, o = i.length; s < o; ) {
3765
3765
  for (n = r.length; n--; ) r[n] *= a;
3766
- for (r[0] += Ts.indexOf(i.charAt(s++)), t = 0; t < r.length; t++)
3766
+ for (r[0] += Bs.indexOf(i.charAt(s++)), t = 0; t < r.length; t++)
3767
3767
  r[t] > e - 1 && (r[t + 1] === void 0 && (r[t + 1] = 0), r[t + 1] += r[t] / e | 0, r[t] %= e);
3768
3768
  }
3769
3769
  return r.reverse();
@@ -3771,7 +3771,7 @@ function on(i, a, e) {
3771
3771
  function Sl(i, a) {
3772
3772
  var e, t, r;
3773
3773
  if (a.isZero()) return a;
3774
- t = a.d.length, t < 32 ? (e = Math.ceil(t / 3), r = (1 / kn(4, e)).toString()) : (e = 16, r = "2.3283064365386962890625e-10"), i.precision += e, a = Cr(i, 1, a.times(r), new i(1));
3774
+ t = a.d.length, t < 32 ? (e = Math.ceil(t / 3), r = (1 / $n(4, e)).toString()) : (e = 16, r = "2.3283064365386962890625e-10"), i.precision += e, a = Cr(i, 1, a.times(r), new i(1));
3775
3775
  for (var n = e; n--; ) {
3776
3776
  var s = a.times(a);
3777
3777
  a = s.times(s).minus(s).times(8).plus(1);
@@ -3812,7 +3812,7 @@ var pe = /* @__PURE__ */ function() {
3812
3812
  z && z[0] == 0 || !G ? ne * 0 : ne / 0
3813
3813
  )
3814
3814
  );
3815
- for (u ? (d = 1, l = t.e - r.e) : (u = ct, d = te, l = Be(t.e / d) - Be(r.e / d)), x = G.length, L = z.length, b = new W(ne), R = b.d = [], f = 0; G[f] == (z[f] || 0); f++) ;
3815
+ for (u ? (d = 1, l = t.e - r.e) : (u = ut, d = te, l = Be(t.e / d) - Be(r.e / d)), x = G.length, L = z.length, b = new W(ne), R = b.d = [], f = 0; G[f] == (z[f] || 0); f++) ;
3816
3816
  if (G[f] > (z[f] || 0) && l--, n == null ? (S = n = W.precision, s = W.rounding) : o ? S = n + (t.e - r.e) + 1 : S = n, S < 0)
3817
3817
  R.push(1), _ = !0;
3818
3818
  else {
@@ -3864,10 +3864,10 @@ function J(i, a, e, t) {
3864
3864
  if (h == 0) {
3865
3865
  for (n = 1, s = f[0]; s >= 10; s /= 10) n++;
3866
3866
  for (s = f[0] += o, o = 1; s >= 10; s /= 10) o++;
3867
- n != o && (i.e++, f[0] == ct && (f[0] = 1));
3867
+ n != o && (i.e++, f[0] == ut && (f[0] = 1));
3868
3868
  break;
3869
3869
  } else {
3870
- if (f[h] += o, f[h] != ct) break;
3870
+ if (f[h] += o, f[h] != ut) break;
3871
3871
  f[h--] = 0, o = 1;
3872
3872
  }
3873
3873
  for (n = f.length; f[--n] === 0; ) f.pop();
@@ -3879,19 +3879,19 @@ function Ct(i, a, e) {
3879
3879
  var t, r = i.e, n = Ue(i.d), s = n.length;
3880
3880
  return a ? (e && (t = e - s) > 0 ? n = n.charAt(0) + "." + n.slice(1) + Lt(t) : s > 1 && (n = n.charAt(0) + "." + n.slice(1)), n = n + (i.e < 0 ? "e" : "e+") + i.e) : r < 0 ? (n = "0." + Lt(-r - 1) + n, e && (t = e - s) > 0 && (n += Lt(t))) : r >= s ? (n += Lt(r + 1 - s), e && (t = e - r - 1) > 0 && (n = n + "." + Lt(t))) : ((t = r + 1) < s && (n = n.slice(0, t) + "." + n.slice(t)), e && (t = e - s) > 0 && (r + 1 === s && (n += "."), n += Lt(t))), n;
3881
3881
  }
3882
- function Fn(i, a) {
3882
+ function kn(i, a) {
3883
3883
  var e = i[0];
3884
3884
  for (a *= te; e >= 10; e /= 10) a++;
3885
3885
  return a;
3886
3886
  }
3887
- function An(i, a, e) {
3887
+ function En(i, a, e) {
3888
3888
  if (a > Ml)
3889
3889
  throw ue = !0, e && (i.precision = e), Error(mo);
3890
- return J(new i(Cn), a, 1, !0);
3890
+ return J(new i(_n), a, 1, !0);
3891
3891
  }
3892
- function ut(i, a, e) {
3893
- if (a > Is) throw Error(mo);
3894
- return J(new i(_n), a, e, !0);
3892
+ function mt(i, a, e) {
3893
+ if (a > Fs) throw Error(mo);
3894
+ return J(new i(An), a, e, !0);
3895
3895
  }
3896
3896
  function Ao(i) {
3897
3897
  var a = i.length - 1, e = a * te + 1;
@@ -3920,16 +3920,16 @@ function Ci(i) {
3920
3920
  return i.d[i.d.length - 1] & 1;
3921
3921
  }
3922
3922
  function bo(i, a, e) {
3923
- for (var t, r = new i(a[0]), n = 0; ++n < a.length; )
3924
- if (t = new i(a[n]), t.s)
3925
- r[e](t) && (r = t);
3926
- else {
3927
- r = t;
3923
+ for (var t, r, n = new i(a[0]), s = 0; ++s < a.length; ) {
3924
+ if (r = new i(a[s]), !r.s) {
3925
+ n = r;
3928
3926
  break;
3929
3927
  }
3930
- return r;
3928
+ t = n.cmp(r), (t === e || t === 0 && n.s === e) && (n = r);
3929
+ }
3930
+ return n;
3931
3931
  }
3932
- function Fs(i, a) {
3932
+ function ks(i, a) {
3933
3933
  var e, t, r, n, s, o, u, c = 0, l = 0, f = 0, h = i.constructor, d = h.rounding, _ = h.precision;
3934
3934
  if (!i.d || !i.d[0] || i.e > 17)
3935
3935
  return new h(i.d ? i.d[0] ? i.s < 0 ? 0 : 1 / 0 : 1 : i.s ? i.s < 0 ? 0 : i : NaN);
@@ -3958,10 +3958,10 @@ function jt(i, a) {
3958
3958
  C = C.times(i), e = Ue(C.d), t = e.charAt(0), d++;
3959
3959
  n = C.e, t > 1 ? (C = new b("0." + e), n++) : C = new b(t + "." + e.slice(1));
3960
3960
  } else
3961
- return c = An(b, l + 2, p).times(n + ""), C = jt(new b(t + "." + e.slice(1)), l - _).plus(c), b.precision = p, a == null ? J(C, p, R, ue = !0) : C;
3961
+ return c = En(b, l + 2, p).times(n + ""), C = jt(new b(t + "." + e.slice(1)), l - _).plus(c), b.precision = p, a == null ? J(C, p, R, ue = !0) : C;
3962
3962
  for (f = C, u = s = C = pe(C.minus(1), C.plus(1), l, 1), h = J(C.times(C), l, 1), r = 3; ; ) {
3963
3963
  if (s = J(s.times(h), l, 1), c = u.plus(pe(s, new b(r), l, 1)), Ue(c.d).slice(0, l) === Ue(u.d).slice(0, l))
3964
- if (u = u.times(2), n !== 0 && (u = u.plus(An(b, l + 2, p).times(n + ""))), u = pe(u, new b(d), l, 1), a == null)
3964
+ if (u = u.times(2), n !== 0 && (u = u.plus(En(b, l + 2, p).times(n + ""))), u = pe(u, new b(d), l, 1), a == null)
3965
3965
  if (xr(u.d, l - _, R, o))
3966
3966
  b.precision = l += _, c = s = C = pe(f.minus(1), f.plus(1), l, 1), h = J(C.times(C), l, 1), r = o = 1;
3967
3967
  else
@@ -3974,7 +3974,7 @@ function jt(i, a) {
3974
3974
  function yo(i) {
3975
3975
  return String(i.s * i.s / 0);
3976
3976
  }
3977
- function ks(i, a) {
3977
+ function un(i, a) {
3978
3978
  var e, t, r;
3979
3979
  for ((e = a.indexOf(".")) > -1 && (a = a.replace(".", "")), (t = a.search(/e/i)) > 0 ? (e < 0 && (e = t), e += +a.slice(t + 1), a = a.substring(0, t)) : e < 0 && (e = a.length), t = 0; a.charCodeAt(t) === 48; t++) ;
3980
3980
  for (r = a.length; a.charCodeAt(r - 1) === 48; --r) ;
@@ -3993,7 +3993,7 @@ function ks(i, a) {
3993
3993
  function wl(i, a) {
3994
3994
  var e, t, r, n, s, o, u, c, l;
3995
3995
  if (a.indexOf("_") > -1) {
3996
- if (a = a.replace(/(\d)_(?=\d)/g, "$1"), _o.test(a)) return ks(i, a);
3996
+ if (a = a.replace(/(\d)_(?=\d)/g, "$1"), _o.test(a)) return un(i, a);
3997
3997
  } else if (a === "Infinity" || a === "NaN")
3998
3998
  return +a || (i.s = NaN), i.e = NaN, i.d = null, i;
3999
3999
  if (Vl.test(a))
@@ -4004,14 +4004,14 @@ function wl(i, a) {
4004
4004
  e = 8;
4005
4005
  else
4006
4006
  throw Error(Bt + a);
4007
- for (n = a.search(/p/i), n > 0 ? (u = +a.slice(n + 1), a = a.substring(2, n)) : a = a.slice(2), n = a.indexOf("."), s = n >= 0, t = i.constructor, s && (a = a.replace(".", ""), o = a.length, n = o - n, r = Eo(t, new t(e), n, n * 2)), c = on(a, e, ct), l = c.length - 1, n = l; c[n] === 0; --n) c.pop();
4008
- return n < 0 ? new t(i.s * 0) : (i.e = Fn(c, l), i.d = c, ue = !1, s && (i = pe(i, r, o * 4)), u && (i = i.times(Math.abs(u) < 54 ? Pe(2, u) : P.pow(2, u))), ue = !0, i);
4007
+ for (n = a.search(/p/i), n > 0 ? (u = +a.slice(n + 1), a = a.substring(2, n)) : a = a.slice(2), n = a.indexOf("."), s = n >= 0, t = i.constructor, s && (a = a.replace(".", ""), o = a.length, n = o - n, r = Eo(t, new t(e), n, n * 2)), c = on(a, e, ut), l = c.length - 1, n = l; c[n] === 0; --n) c.pop();
4008
+ return n < 0 ? new t(i.s * 0) : (i.e = kn(c, l), i.d = c, ue = !1, s && (i = pe(i, r, o * 4)), u && (i = i.times(Math.abs(u) < 54 ? Pe(2, u) : P.pow(2, u))), ue = !0, i);
4009
4009
  }
4010
4010
  function Dl(i, a) {
4011
4011
  var e, t = a.d.length;
4012
4012
  if (t < 3)
4013
4013
  return a.isZero() ? a : Cr(i, 2, a, a);
4014
- e = 1.4 * Math.sqrt(t), e = e > 16 ? 16 : e | 0, a = a.times(1 / kn(5, e)), a = Cr(i, 2, a, a);
4014
+ e = 1.4 * Math.sqrt(t), e = e > 16 ? 16 : e | 0, a = a.times(1 / $n(5, e)), a = Cr(i, 2, a, a);
4015
4015
  for (var r, n = new i(5), s = new i(16), o = new i(20); e--; )
4016
4016
  r = a.times(a), a = a.times(n.plus(r.times(s.times(r).minus(o))));
4017
4017
  return a;
@@ -4027,12 +4027,12 @@ function Cr(i, a, e, t, r) {
4027
4027
  }
4028
4028
  return ue = !0, s.d.length = l + 1, s;
4029
4029
  }
4030
- function kn(i, a) {
4030
+ function $n(i, a) {
4031
4031
  for (var e = i; --a; ) e *= i;
4032
4032
  return e;
4033
4033
  }
4034
4034
  function Ro(i, a) {
4035
- var e, t = a.s < 0, r = ut(i, i.precision, 1), n = r.times(0.5);
4035
+ var e, t = a.s < 0, r = mt(i, i.precision, 1), n = r.times(0.5);
4036
4036
  if (a = a.abs(), a.lte(n))
4037
4037
  return pt = t ? 4 : 1, a;
4038
4038
  if (e = a.divToInt(r), e.isZero())
@@ -4057,13 +4057,13 @@ function Ea(i, a, e, t) {
4057
4057
  for (; ++f[--e] > r - 1; )
4058
4058
  f[e] = 0, e || (++n, f.unshift(1));
4059
4059
  for (u = f.length; !f[u - 1]; --u) ;
4060
- for (s = 0, l = ""; s < u; s++) l += Ts.charAt(f[s]);
4060
+ for (s = 0, l = ""; s < u; s++) l += Bs.charAt(f[s]);
4061
4061
  if (_) {
4062
4062
  if (u > 1)
4063
4063
  if (a == 16 || a == 8) {
4064
4064
  for (s = a == 16 ? 4 : 3, --u; u % s; u++) l += "0";
4065
4065
  for (f = on(l, r, a), u = f.length; !f[u - 1]; --u) ;
4066
- for (s = 1, l = "1."; s < u; s++) l += Ts.charAt(f[s]);
4066
+ for (s = 1, l = "1."; s < u; s++) l += Bs.charAt(f[s]);
4067
4067
  } else
4068
4068
  l = l.charAt(0) + "." + l.slice(1);
4069
4069
  l = l + (n < 0 ? "p" : "p+") + n;
@@ -4108,7 +4108,7 @@ function Bl(i) {
4108
4108
  function Il(i, a) {
4109
4109
  i = new this(i), a = new this(a);
4110
4110
  var e, t = this.precision, r = this.rounding, n = t + 4;
4111
- return !i.s || !a.s ? e = new this(NaN) : !i.d && !a.d ? (e = ut(this, n, 1).times(a.s > 0 ? 0.25 : 0.75), e.s = i.s) : !a.d || i.isZero() ? (e = a.s < 0 ? ut(this, t, r) : new this(0), e.s = i.s) : !i.d || a.isZero() ? (e = ut(this, n, 1).times(0.5), e.s = i.s) : a.s < 0 ? (this.precision = n, this.rounding = 1, e = this.atan(pe(i, a, n, 1)), a = ut(this, n, 1), this.precision = t, this.rounding = r, e = i.s < 0 ? e.minus(a) : e.plus(a)) : e = this.atan(pe(i, a, n, 1)), e;
4111
+ return !i.s || !a.s ? e = new this(NaN) : !i.d && !a.d ? (e = mt(this, n, 1).times(a.s > 0 ? 0.25 : 0.75), e.s = i.s) : !a.d || i.isZero() ? (e = a.s < 0 ? mt(this, t, r) : new this(0), e.s = i.s) : !i.d || a.isZero() ? (e = mt(this, n, 1).times(0.5), e.s = i.s) : a.s < 0 ? (this.precision = n, this.rounding = 1, e = this.atan(pe(i, a, n, 1)), a = mt(this, n, 1), this.precision = t, this.rounding = r, e = i.s < 0 ? e.minus(a) : e.plus(a)) : e = this.atan(pe(i, a, n, 1)), e;
4112
4112
  }
4113
4113
  function Fl(i) {
4114
4114
  return new this(i).cbrt();
@@ -4120,7 +4120,7 @@ function $l(i, a, e) {
4120
4120
  return new this(i).clamp(a, e);
4121
4121
  }
4122
4122
  function Yl(i) {
4123
- if (!i || typeof i != "object") throw Error(In + "Object expected");
4123
+ if (!i || typeof i != "object") throw Error(Fn + "Object expected");
4124
4124
  var a, e, t, r = i.defaults === !0, n = [
4125
4125
  "precision",
4126
4126
  1,
@@ -4133,10 +4133,10 @@ function Yl(i) {
4133
4133
  0,
4134
4134
  "toExpPos",
4135
4135
  0,
4136
- vs,
4136
+ Ts,
4137
4137
  "maxE",
4138
4138
  0,
4139
- vs,
4139
+ Ts,
4140
4140
  "minE",
4141
4141
  -9e15,
4142
4142
  0,
@@ -4145,10 +4145,10 @@ function Yl(i) {
4145
4145
  9
4146
4146
  ];
4147
4147
  for (a = 0; a < n.length; a += 3)
4148
- if (e = n[a], r && (this[e] = Bs[e]), (t = i[e]) !== void 0)
4148
+ if (e = n[a], r && (this[e] = Is[e]), (t = i[e]) !== void 0)
4149
4149
  if (Be(t) === t && t >= n[a + 1] && t <= n[a + 2]) this[e] = t;
4150
4150
  else throw Error(Bt + e + ": " + t);
4151
- if (e = "crypto", r && (this[e] = Bs[e]), (t = i[e]) !== void 0)
4151
+ if (e = "crypto", r && (this[e] = Is[e]), (t = i[e]) !== void 0)
4152
4152
  if (t === !0 || t === !1 || t === 0 || t === 1)
4153
4153
  if (t)
4154
4154
  if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
@@ -4185,14 +4185,18 @@ function po(i) {
4185
4185
  for (s = 0, o = n; o >= 10; o /= 10) s++;
4186
4186
  ue ? s > r.maxE ? (c.e = NaN, c.d = null) : s < r.minE ? (c.e = 0, c.d = [0]) : (c.e = s, c.d = [n]) : (c.e = s, c.d = [n]);
4187
4187
  return;
4188
- } else if (n * 0 !== 0) {
4188
+ }
4189
+ if (n * 0 !== 0) {
4189
4190
  n || (c.s = NaN), c.e = NaN, c.d = null;
4190
4191
  return;
4191
4192
  }
4192
- return ks(c, n.toString());
4193
- } else if (u !== "string")
4194
- throw Error(Bt + n);
4195
- return (o = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (o === 43 && (n = n.slice(1)), c.s = 1), _o.test(n) ? ks(c, n) : wl(c, n);
4193
+ return un(c, n.toString());
4194
+ }
4195
+ if (u === "string")
4196
+ return (o = n.charCodeAt(0)) === 45 ? (n = n.slice(1), c.s = -1) : (o === 43 && (n = n.slice(1)), c.s = 1), _o.test(n) ? un(c, n) : wl(c, n);
4197
+ if (u === "bigint")
4198
+ return n < 0 ? (n = -n, c.s = -1) : c.s = 1, un(c, n.toString());
4199
+ throw Error(Bt + n);
4196
4200
  }
4197
4201
  if (r.prototype = B, r.ROUND_UP = 0, r.ROUND_DOWN = 1, r.ROUND_CEIL = 2, r.ROUND_FLOOR = 3, r.ROUND_HALF_UP = 4, r.ROUND_HALF_DOWN = 5, r.ROUND_HALF_EVEN = 6, r.ROUND_HALF_CEIL = 7, r.ROUND_HALF_FLOOR = 8, r.EUCLID = 9, r.config = r.set = Yl, r.clone = po, r.isDecimal = Ai, r.abs = Ll, r.acos = Pl, r.acosh = xl, r.add = jl, r.asin = Ul, r.asinh = vl, r.atan = Tl, r.atanh = Bl, r.atan2 = Il, r.cbrt = Fl, r.ceil = kl, r.clamp = $l, r.cos = Hl, r.cosh = Gl, r.div = Ql, r.exp = Wl, r.floor = ql, r.hypot = Kl, r.ln = Xl, r.log = Zl, r.log10 = Jl, r.log2 = zl, r.max = ef, r.min = tf, r.mod = rf, r.mul = nf, r.pow = sf, r.random = af, r.round = of, r.sign = uf, r.sin = cf, r.sinh = lf, r.sqrt = ff, r.sub = hf, r.sum = mf, r.tan = gf, r.tanh = df, r.trunc = Cf, i === void 0 && (i = {}), i && i.defaults !== !0)
4198
4202
  for (t = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], a = 0; a < t.length; ) i.hasOwnProperty(e = t[a++]) || (i[e] = this[e]);
@@ -4235,10 +4239,10 @@ function Jl(i) {
4235
4239
  return new this(i).log(10);
4236
4240
  }
4237
4241
  function ef() {
4238
- return bo(this, arguments, "lt");
4242
+ return bo(this, arguments, -1);
4239
4243
  }
4240
4244
  function tf() {
4241
- return bo(this, arguments, "gt");
4245
+ return bo(this, arguments, 1);
4242
4246
  }
4243
4247
  function rf(i, a) {
4244
4248
  return new this(i).mod(a);
@@ -4306,9 +4310,9 @@ function Cf(i) {
4306
4310
  }
4307
4311
  B[Symbol.for("nodejs.util.inspect.custom")] = B.toString;
4308
4312
  B[Symbol.toStringTag] = "Decimal";
4309
- var P = B.constructor = po(Bs);
4310
- Cn = new P(Cn);
4313
+ var P = B.constructor = po(Is);
4311
4314
  _n = new P(_n);
4315
+ An = new P(An);
4312
4316
  function _f(i, a) {
4313
4317
  const e = i + a;
4314
4318
  return Number.isSafeInteger(e) ? e : new P(i).add(a).toNumber();
@@ -4326,18 +4330,18 @@ function Ef(i, a) {
4326
4330
  return Number.isSafeInteger(e) ? e : new P(i).div(a).toNumber();
4327
4331
  }
4328
4332
  function vt(i, a) {
4329
- const e = 10 ** Math.trunc(a), t = $n(i, e);
4333
+ const e = 10 ** Math.trunc(a), t = Yn(i, e);
4330
4334
  return Math.round(Vr(i, e) + t) / e;
4331
4335
  }
4332
4336
  function We(i, a) {
4333
- const e = 10 ** Math.trunc(a), t = $n(i, e);
4337
+ const e = 10 ** Math.trunc(a), t = Yn(i, e);
4334
4338
  return Math.floor(Vr(i, e) + t) / e;
4335
4339
  }
4336
4340
  function Ye(i, a) {
4337
- const e = 10 ** Math.trunc(a), t = $n(i, e);
4341
+ const e = 10 ** Math.trunc(a), t = Yn(i, e);
4338
4342
  return Math.ceil(Vr(i, e) - t) / e;
4339
4343
  }
4340
- function $n(i, a) {
4344
+ function Yn(i, a) {
4341
4345
  return Number.EPSILON * Math.max(1, Math.abs(Vr(i, a)));
4342
4346
  }
4343
4347
  function Ei(i, a) {
@@ -4377,9 +4381,9 @@ function Mf(i, a = 12, e = 1e-10) {
4377
4381
  function Sf(i) {
4378
4382
  return i - Math.trunc(i);
4379
4383
  }
4380
- const Tn = class Tn extends kt {
4384
+ const Bn = class Bn extends kt {
4381
4385
  static create() {
4382
- return this._instance = this._instance || new Tn(0), this._instance;
4386
+ return this._instance = this._instance || new Bn(0), this._instance;
4383
4387
  }
4384
4388
  isNull() {
4385
4389
  return !0;
@@ -4499,8 +4503,8 @@ const Tn = class Tn extends kt {
4499
4503
  return T.create(!1);
4500
4504
  }
4501
4505
  };
4502
- A(Tn, "_instance");
4503
- let ie = Tn;
4506
+ A(Bn, "_instance");
4507
+ let ie = Bn;
4504
4508
  const qt = class qt extends kt {
4505
4509
  constructor(e) {
4506
4510
  super(e);
@@ -4645,7 +4649,7 @@ const qt = class qt extends kt {
4645
4649
  return this._convertToNumber().ceil(e);
4646
4650
  }
4647
4651
  convertToNumberObjectValue() {
4648
- return Hn(this.getValue());
4652
+ return Gn(this.getValue());
4649
4653
  }
4650
4654
  convertToBooleanObjectValue() {
4651
4655
  return this;
@@ -5045,7 +5049,7 @@ class y extends kt {
5045
5049
  return this;
5046
5050
  }
5047
5051
  convertToBooleanObjectValue() {
5048
- return Yn(!0);
5052
+ return Hn(!0);
5049
5053
  }
5050
5054
  _compareInfinity(e, t, r) {
5051
5055
  let n = !1;
@@ -5164,7 +5168,7 @@ class j extends kt {
5164
5168
  }
5165
5169
  }
5166
5170
  convertToNumberObjectValue() {
5167
- return Hn(this.getValue());
5171
+ return Gn(this.getValue());
5168
5172
  }
5169
5173
  convertToBooleanObjectValue() {
5170
5174
  return T.create(!0);
@@ -5174,7 +5178,7 @@ class j extends kt {
5174
5178
  return T.create(n);
5175
5179
  }
5176
5180
  }
5177
- function Yn(i) {
5181
+ function Hn(i) {
5178
5182
  if (typeof i == "boolean")
5179
5183
  return T.create(i);
5180
5184
  let a = !1;
@@ -5189,7 +5193,7 @@ function Df(i) {
5189
5193
  let a = i.toString();
5190
5194
  return a.charAt(0) === '"' && a.charAt(a.length - 1) === '"' && (a = a.slice(1, -1), a = a.replace(/""/g, '"')), j.create(a);
5191
5195
  }
5192
- function Hn(i, a = "") {
5196
+ function Gn(i, a = "") {
5193
5197
  if (typeof i == "boolean") {
5194
5198
  let e = 0;
5195
5199
  return i && (e = 1), y.create(e, a);
@@ -5545,7 +5549,7 @@ class q extends kt {
5545
5549
  * @returns
5546
5550
  */
5547
5551
  _binarySearch(e, t, r, n = Wt.MIN, s = Le.MIN) {
5548
- const o = dn(), u = Number(e.getValue()), c = !Number.isNaN(u);
5552
+ const o = Cn(), u = Number(e.getValue()), c = !Number.isNaN(u);
5549
5553
  let l = 0, f = t.length - 1, h = -1, d = -1, _ = -1;
5550
5554
  for (; l <= f; ) {
5551
5555
  const C = Math.floor((l + f) / 2), E = t[C];
@@ -5894,7 +5898,7 @@ class q extends kt {
5894
5898
  this._flattenCache = null, this._sliceCache.clear();
5895
5899
  }
5896
5900
  _sort(e) {
5897
- const t = dn();
5901
+ const t = Cn();
5898
5902
  return (r, n) => {
5899
5903
  const s = r[e], o = n[e];
5900
5904
  return s == null ? 1 : o == null ? -1 : s.isError() && s.isError() ? 0 : s.isError() ? 1 : o.isError() ? -1 : t(
@@ -6206,7 +6210,7 @@ class Vt {
6206
6210
  if (yr.has(e))
6207
6211
  return g.create(e);
6208
6212
  if (e === er.TRUE || e === er.FALSE)
6209
- return Yn(a);
6213
+ return Hn(a);
6210
6214
  if (Q(a))
6211
6215
  return y.create(Number(a));
6212
6216
  const { isNumberPattern: t, value: r, pattern: n } = Cl(a);
@@ -6215,15 +6219,15 @@ class Vt {
6215
6219
  const s = a.replace(/\n/g, "").replace(/\r/g, "");
6216
6220
  return !xf(s) && Pc(s) ? q.create(s) : Df(a);
6217
6221
  }
6218
- return typeof a == "number" ? Hn(a) : g.create(m.VALUE);
6222
+ return typeof a == "number" ? Gn(a) : g.create(m.VALUE);
6219
6223
  }
6220
6224
  }
6221
6225
  function xf(i) {
6222
6226
  const a = i.trim();
6223
6227
  return a.startsWith('"') && a.endsWith('"');
6224
6228
  }
6225
- const jf = 1e4, En = new Nt(jf);
6226
- class Gn extends Bn {
6229
+ const jf = 1e4, bn = new Nt(jf);
6230
+ class Qn extends In {
6227
6231
  constructor(e) {
6228
6232
  super();
6229
6233
  A(this, "_forcedSheetId", "");
@@ -6457,9 +6461,9 @@ class Gn extends Bn {
6457
6461
  return g.create(t);
6458
6462
  if (e.t === Rt.NUMBER) {
6459
6463
  const r = this._getPatternByCell(e);
6460
- return cc(r) ? j.create(t.toString()) : Hn(t, r);
6464
+ return cc(r) ? j.create(t.toString()) : Gn(t, r);
6461
6465
  }
6462
- return e.t === Rt.STRING || e.t === Rt.FORCE_STRING ? j.create(t.toString()) : e.t === Rt.BOOLEAN ? Yn(t) : Vt.create(t);
6466
+ return e.t === Rt.STRING || e.t === Rt.FORCE_STRING ? j.create(t.toString()) : e.t === Rt.BOOLEAN ? Hn(t) : Vt.create(t);
6463
6467
  }
6464
6468
  _getPatternByCell(e) {
6465
6469
  var n;
@@ -6527,7 +6531,7 @@ class Gn extends Bn {
6527
6531
  }
6528
6532
  toArrayValueObject(e = !0) {
6529
6533
  var _;
6530
- const { startRow: t, endRow: r, startColumn: n, endColumn: s } = this.getRangePosition(), o = `${this.getUnitId()}_${this.getSheetId()}_${t}_${r}_${n}_${s}`, u = En.get(o);
6534
+ const { startRow: t, endRow: r, startColumn: n, endColumn: s } = this.getRangePosition(), o = `${this.getUnitId()}_${this.getSheetId()}_${t}_${r}_${n}_${s}`, u = bn.get(o);
6531
6535
  if (u && e)
6532
6536
  return u;
6533
6537
  const c = r - t + 1, l = s - n + 1;
@@ -6547,7 +6551,7 @@ class Gn extends Bn {
6547
6551
  row: t,
6548
6552
  column: n
6549
6553
  }, d = q.create(h);
6550
- return e && En.set(o, d), d;
6554
+ return e && bn.set(o, d), d;
6551
6555
  }
6552
6556
  toUnitRange() {
6553
6557
  return {
@@ -6572,7 +6576,7 @@ class Gn extends Bn {
6572
6576
  return q.create(e);
6573
6577
  }
6574
6578
  }
6575
- class Uf extends Bn {
6579
+ class Uf extends In {
6576
6580
  constructor(a) {
6577
6581
  super(), this._promise = a;
6578
6582
  }
@@ -6583,7 +6587,7 @@ class Uf extends Bn {
6583
6587
  return this._promise;
6584
6588
  }
6585
6589
  }
6586
- class vf extends Bn {
6590
+ class vf extends In {
6587
6591
  constructor(a) {
6588
6592
  super(), this._promiseList = a;
6589
6593
  }
@@ -6613,7 +6617,7 @@ class vf extends Bn {
6613
6617
  return q.create(e);
6614
6618
  }
6615
6619
  }
6616
- class bn extends Gn {
6620
+ class yn extends Qn {
6617
6621
  constructor(a, e, t) {
6618
6622
  super(""), this.setRangeData(a), e && this.setForcedSheetIdDirect(e), t && this.setForcedUnitIdDirect(t);
6619
6623
  }
@@ -6621,7 +6625,7 @@ class bn extends Gn {
6621
6625
  return !0;
6622
6626
  }
6623
6627
  }
6624
- class ba extends Gn {
6628
+ class ba extends Qn {
6625
6629
  constructor(a) {
6626
6630
  super(a);
6627
6631
  const e = gr(a);
@@ -6646,7 +6650,7 @@ class ba extends Gn {
6646
6650
  return t > n ? (o.startRow = n, o.endRow = t) : (o.startRow = t, o.endRow = n), r > s ? (o.startColumn = s, o.endColumn = r) : (o.startColumn = r, o.endColumn = s), a.startAbsoluteRefType && (o.startAbsoluteRefType = a.startAbsoluteRefType), e.startAbsoluteRefType && (o.endAbsoluteRefType = e.startAbsoluteRefType), o;
6647
6651
  }
6648
6652
  _createRange(a) {
6649
- const e = new bn(
6653
+ const e = new yn(
6650
6654
  a,
6651
6655
  this.getForcedSheetId(),
6652
6656
  this.getForcedUnitId()
@@ -6660,7 +6664,7 @@ class ba extends Gn {
6660
6664
  return s && e.setForcedUnitIdDirect(s), e;
6661
6665
  }
6662
6666
  }
6663
- class ya extends Gn {
6667
+ class ya extends Qn {
6664
6668
  constructor(a) {
6665
6669
  super(a);
6666
6670
  const e = gr(a);
@@ -6691,7 +6695,7 @@ class ya extends Gn {
6691
6695
  return n > s ? t.endColumn = n : (t.startColumn = n, t.endColumn = s), r.startAbsoluteRefType && (t.endAbsoluteRefType = r.startAbsoluteRefType), t.rangeType = Ze.COLUMN, this.setToken(`${this.getToken()}${K.COLON}${e.getToken()}`), this;
6692
6696
  }
6693
6697
  }
6694
- class Ra extends Gn {
6698
+ class Ra extends Qn {
6695
6699
  constructor(a) {
6696
6700
  super(a);
6697
6701
  const e = gr(a);
@@ -6781,7 +6785,7 @@ function pa(i) {
6781
6785
  }
6782
6786
  return [$.EQUALS, Vt.create(i)];
6783
6787
  }
6784
- function Qn(i, a, e, t) {
6788
+ function Wn(i, a, e, t) {
6785
6789
  if (!e)
6786
6790
  if (a.isString()) {
6787
6791
  const r = `${a.getValue()}`, [n, s] = pa(r);
@@ -6794,7 +6798,7 @@ function Tf(i, a) {
6794
6798
  const e = Math.max(i.isArray() ? i.getRowCount() : 1, a.isArray() ? a.getRowCount() : 1), t = Math.max(i.isArray() ? i.getColumnCount() : 1, a.isArray() ? a.getColumnCount() : 1), r = O(e, t, i), n = O(e, t, a);
6795
6799
  return r.mapValue((s, o, u) => {
6796
6800
  const c = n.get(o, u);
6797
- return s != null && s.isError() ? s : c != null && c.isError() ? c : s != null && s.isBoolean() && (c != null && c.isBoolean()) ? Yn(s.getValue() && c.getValue()) : T.create(!1);
6801
+ return s != null && s.isError() ? s : c != null && c.isError() ? c : s != null && s.isBoolean() && (c != null && c.isBoolean()) ? Hn(s.getValue() && c.getValue()) : T.create(!1);
6798
6802
  });
6799
6803
  }
6800
6804
  function Bf(i) {
@@ -6886,8 +6890,8 @@ function Fr(i, a, e, t = !1) {
6886
6890
  O(a, e, o, g.create(m.NA)).iterator((c, l, f) => {
6887
6891
  if (!c)
6888
6892
  return;
6889
- let h = Qn(s, c);
6890
- if (t && (h = Wn(h, s, c)), r[l] === void 0 && (r[l] = []), r[l][f] === void 0) {
6893
+ let h = Wn(s, c);
6894
+ if (t && (h = qn(h, s, c)), r[l] === void 0 && (r[l] = []), r[l][f] === void 0) {
6891
6895
  r[l][f] = h;
6892
6896
  return;
6893
6897
  }
@@ -6896,7 +6900,7 @@ function Fr(i, a, e, t = !1) {
6896
6900
  }
6897
6901
  return r;
6898
6902
  }
6899
- function Wn(i, a, e) {
6903
+ function qn(i, a, e) {
6900
6904
  const [t, r] = pa(`${e.getValue()}`);
6901
6905
  return i.mapValue((n, s, o) => {
6902
6906
  const u = a.get(s, o);
@@ -6925,7 +6929,7 @@ function If(i, a) {
6925
6929
  const e = i.isString() && i.getValue() === "", t = a.isString() && a.getValue() === "";
6926
6930
  return !!((e || i.isNull()) && (t || a.isNull()) || i.isString() && !e && a.isString() && !t);
6927
6931
  }
6928
- var un = /* @__PURE__ */ ((i) => (i[i.CELL = 0] = "CELL", i[i.COLUMN = 1] = "COLUMN", i[i.ROW = 2] = "ROW", i))(un || {});
6932
+ var cn = /* @__PURE__ */ ((i) => (i[i.CELL = 0] = "CELL", i[i.COLUMN = 1] = "COLUMN", i[i.ROW = 2] = "ROW", i))(cn || {});
6929
6933
  function Ff(i, a) {
6930
6934
  let e;
6931
6935
  switch (a) {
@@ -7283,7 +7287,7 @@ let Ys = class extends Oe {
7283
7287
  Ys = Yf([
7284
7288
  Hf(0, Ft)
7285
7289
  ], Ys);
7286
- const Ot = ft("univer.formula.runtime.service");
7290
+ const Ot = lt("univer.formula.runtime.service");
7287
7291
  var oe = /* @__PURE__ */ ((i) => (i[i.REFERENCE = 1] = "REFERENCE", i[i.VALUE = 2] = "VALUE", i[i.OPERATOR = 3] = "OPERATOR", i[i.FUNCTION = 4] = "FUNCTION", i[i.LAMBDA = 5] = "LAMBDA", i[i.LAMBDA_PARAMETER = 6] = "LAMBDA_PARAMETER", i[i.ERROR = 7] = "ERROR", i[i.BASE = 8] = "BASE", i[i.ROOT = 9] = "ROOT", i[i.UNION = 10] = "UNION", i[i.PREFIX = 11] = "PREFIX", i[i.SUFFIX = 12] = "SUFFIX", i[i.NULL = 13] = "NULL", i))(oe || {});
7288
7292
  const _t = /* @__PURE__ */ new Map([
7289
7293
  [1, 7],
@@ -7446,7 +7450,7 @@ class No extends Et {
7446
7450
  return new Hs(Ut);
7447
7451
  }
7448
7452
  }
7449
- const Yt = ft("univer.formula-function.service");
7453
+ const Yt = lt("univer.formula-function.service");
7450
7454
  class Gf extends Oe {
7451
7455
  constructor() {
7452
7456
  super(...arguments);
@@ -7510,7 +7514,7 @@ var Te = /* @__PURE__ */ ((i) => (i.COMPARE = "COMPARE", i.DIVIDED = "DIVIDED",
7510
7514
  (s = i[n]) && (r = s(r) || r);
7511
7515
  return r;
7512
7516
  }, pi = (i, a) => (e, t) => a(e, t, i);
7513
- class yn extends Ge {
7517
+ class Rn extends Ge {
7514
7518
  constructor(a, e, t) {
7515
7519
  super(e), this._runtimeService = a, this._operatorString = e, this._functionExecutor = t;
7516
7520
  }
@@ -7536,7 +7540,7 @@ class yn extends Ge {
7536
7540
  return l !== u && c !== o || o === c && u === l ? g.create(m.VALUE) : c === o && n >= u && n <= l ? e.getCellByColumn(n) : u === l && r >= o && r <= c ? e.getCellByRow(r) : e.isTable() ? e.getCellByPosition(r) : g.create(m.VALUE);
7537
7541
  }
7538
7542
  }
7539
- let Rn = class extends Et {
7543
+ let pn = class extends Et {
7540
7544
  constructor(i, a) {
7541
7545
  super(), this._functionService = i, this._runtimeService = a;
7542
7546
  }
@@ -7552,15 +7556,15 @@ let Rn = class extends Et {
7552
7556
  let t = "";
7553
7557
  if (e === Me.MINUS)
7554
7558
  t = Te.MINUS;
7555
- else return e === Me.AT ? new yn(this._runtimeService, e) : void 0;
7559
+ else return e === Me.AT ? new Rn(this._runtimeService, e) : void 0;
7556
7560
  const r = this._functionService.getExecutor(t);
7557
- return r ? new yn(this._runtimeService, e, r) : (console.error(`No function ${a}`), xe.create(m.NAME));
7561
+ return r ? new Rn(this._runtimeService, e, r) : (console.error(`No function ${a}`), xe.create(m.NAME));
7558
7562
  }
7559
7563
  };
7560
- Rn = Wf([
7564
+ pn = Wf([
7561
7565
  pi(0, Yt),
7562
7566
  pi(1, Ot)
7563
- ], Rn);
7567
+ ], pn);
7564
7568
  new RegExp(Me.MINUS, "g");
7565
7569
  new RegExp(Me.AT, "g");
7566
7570
  function Oo(i, a, e) {
@@ -7569,9 +7573,9 @@ function Oo(i, a, e) {
7569
7573
  let o = 0;
7570
7574
  if (s[0] === Me.MINUS) {
7571
7575
  const u = a.getExecutor(Te.MINUS);
7572
- t = new yn(e, Me.MINUS, u), o++;
7576
+ t = new Rn(e, Me.MINUS, u), o++;
7573
7577
  }
7574
- return s[0] === Me.AT && (r = new yn(e, Me.AT), t && r.setParent(t), o++), o > 0 && (n = n.slice(o)), { tokenTrim: n, minusPrefixNode: t, atPrefixNode: r };
7578
+ return s[0] === Me.AT && (r = new Rn(e, Me.AT), t && r.setParent(t), o++), o > 0 && (n = n.slice(o)), { tokenTrim: n, minusPrefixNode: t, atPrefixNode: r };
7575
7579
  }
7576
7580
  var qf = Object.getOwnPropertyDescriptor, Kf = (i, a, e, t) => {
7577
7581
  for (var r = t > 1 ? void 0 : t ? qf(a, e) : a, n = i.length - 1, s; n >= 0; n--)
@@ -7728,7 +7732,7 @@ class Zf extends Ge {
7728
7732
  this.setValue(g.create(m.NAME));
7729
7733
  }
7730
7734
  }
7731
- let pn = class extends Et {
7735
+ let Vn = class extends Et {
7732
7736
  constructor(i, a, e, t, r, n) {
7733
7737
  super(), this._functionService = i, this._currentConfigService = a, this._runtimeService = e, this._definedNamesService = t, this._injector = r, this._formulaDataModel = n;
7734
7738
  }
@@ -7763,14 +7767,14 @@ let pn = class extends Et {
7763
7767
  return ((e = (a = i.getParent()) == null ? void 0 : a.getParent()) == null ? void 0 : e.getToken()) === K.COLON;
7764
7768
  }
7765
7769
  };
7766
- pn = Kf([
7770
+ Vn = Kf([
7767
7771
  or(0, Yt),
7768
7772
  or(1, Ft),
7769
7773
  or(2, Ot),
7770
7774
  or(3, pr),
7771
7775
  or(4, Ve(Gi)),
7772
7776
  or(5, Ve(Pr))
7773
- ], pn);
7777
+ ], Vn);
7774
7778
  var zf = Object.getOwnPropertyDescriptor, Jf = (i, a, e, t) => {
7775
7779
  for (var r = t > 1 ? void 0 : t ? zf(a, e) : a, n = i.length - 1, s; n >= 0; n--)
7776
7780
  (s = i[n]) && (r = s(r) || r);
@@ -7992,7 +7996,7 @@ class sh extends Ge {
7992
7996
  // return Promise.resolve(AstNodePromiseType.SUCCESS);
7993
7997
  // }
7994
7998
  }
7995
- let Vn = class extends Et {
7999
+ let Nn = class extends Et {
7996
8000
  constructor(i, a) {
7997
8001
  super(), this._runtimeService = i, this._interpreter = a;
7998
8002
  }
@@ -8030,10 +8034,10 @@ let Vn = class extends Et {
8030
8034
  Va(i, a, e);
8031
8035
  }
8032
8036
  };
8033
- Vn = nh([
8037
+ Nn = nh([
8034
8038
  Vi(0, Ot),
8035
8039
  Vi(1, Ve(_r))
8036
- ], Vn);
8040
+ ], Nn);
8037
8041
  function wo(i) {
8038
8042
  if (!i)
8039
8043
  return;
@@ -8120,7 +8124,7 @@ class lh extends Ge {
8120
8124
  );
8121
8125
  }
8122
8126
  }
8123
- let Nn = class extends Et {
8127
+ let On = class extends Et {
8124
8128
  constructor(i) {
8125
8129
  super(), this._functionService = i;
8126
8130
  }
@@ -8142,15 +8146,15 @@ let Nn = class extends Et {
8142
8146
  return this.create(a);
8143
8147
  }
8144
8148
  };
8145
- Nn = uh([
8149
+ On = uh([
8146
8150
  ch(0, Yt)
8147
- ], Nn);
8151
+ ], On);
8148
8152
  var fh = Object.getOwnPropertyDescriptor, hh = (i, a, e, t) => {
8149
8153
  for (var r = t > 1 ? void 0 : t ? fh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
8150
8154
  (s = i[n]) && (r = s(r) || r);
8151
8155
  return r;
8152
- }, ms = (i, a) => (e, t) => a(e, t, i);
8153
- class gs extends Ge {
8156
+ }, gs = (i, a) => (e, t) => a(e, t, i);
8157
+ class ds extends Ge {
8154
8158
  constructor(e, t, r, n, s = !1) {
8155
8159
  super(r);
8156
8160
  A(this, "_refOffsetX", 0);
@@ -8176,7 +8180,7 @@ class gs extends Ge {
8176
8180
  };
8177
8181
  }
8178
8182
  }
8179
- let On = class extends Et {
8183
+ let Mn = class extends Et {
8180
8184
  constructor(i, a, e) {
8181
8185
  super(), this._currentConfigService = i, this._formulaRuntimeService = a, this._functionService = e;
8182
8186
  }
@@ -8191,7 +8195,7 @@ let On = class extends Et {
8191
8195
  if (!a && s.charAt(0) === '"' && s.charAt(s.length - 1) === '"')
8192
8196
  return;
8193
8197
  let c;
8194
- if (Tr(s) ? c = new gs(r, n, s, un.CELL, t) : a && this._checkParentIsUnionOperator(i) && (zi(s) ? c = new gs(r, n, s, un.ROW, t) : Ji(s) && (c = new gs(r, n, s, un.COLUMN, t))), c)
8198
+ if (Tr(s) ? c = new ds(r, n, s, cn.CELL, t) : a && this._checkParentIsUnionOperator(i) && (zi(s) ? c = new ds(r, n, s, cn.ROW, t) : Ji(s) && (c = new ds(r, n, s, cn.COLUMN, t))), c)
8195
8199
  return u ? c.setParent(u) : o && c.setParent(o), c;
8196
8200
  }
8197
8201
  _checkParentIsUnionOperator(i) {
@@ -8199,16 +8203,16 @@ let On = class extends Et {
8199
8203
  return ((e = (a = i.getParent()) == null ? void 0 : a.getParent()) == null ? void 0 : e.getToken().trim()) === K.COLON;
8200
8204
  }
8201
8205
  };
8202
- On = hh([
8203
- ms(0, Ft),
8204
- ms(1, Ot),
8205
- ms(2, Yt)
8206
- ], On);
8206
+ Mn = hh([
8207
+ gs(0, Ft),
8208
+ gs(1, Ot),
8209
+ gs(2, Yt)
8210
+ ], Mn);
8207
8211
  var mh = Object.getOwnPropertyDescriptor, gh = (i, a, e, t) => {
8208
8212
  for (var r = t > 1 ? void 0 : t ? mh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
8209
8213
  (s = i[n]) && (r = s(r) || r);
8210
8214
  return r;
8211
- }, ds = (i, a) => (e, t) => a(e, t, i);
8215
+ }, Cs = (i, a) => (e, t) => a(e, t, i);
8212
8216
  class Ni extends Ge {
8213
8217
  constructor(a, e, t, r) {
8214
8218
  super(t), this._currentConfigService = a, this._lexer = e, this._operatorString = t, this._functionExecutor = r;
@@ -8239,7 +8243,7 @@ class Ni extends Ge {
8239
8243
  return o && this._lexer.treeBuilder(o), g.create(m.VALUE);
8240
8244
  }
8241
8245
  }
8242
- let Mn = class extends Et {
8246
+ let Sn = class extends Et {
8243
8247
  constructor(i, a, e) {
8244
8248
  super(), this._functionService = i, this._lexer = a, this._currentConfigService = e;
8245
8249
  }
@@ -8260,11 +8264,11 @@ let Mn = class extends Et {
8260
8264
  return t ? new Ni(this._currentConfigService, this._lexer, a, t) : (console.error(`No function ${i}`), xe.create(m.NAME));
8261
8265
  }
8262
8266
  };
8263
- Mn = gh([
8264
- ds(0, Yt),
8265
- ds(1, Ve(dr)),
8266
- ds(2, Ft)
8267
- ], Mn);
8267
+ Sn = gh([
8268
+ Cs(0, Yt),
8269
+ Cs(1, Ve(dr)),
8270
+ Cs(2, Ft)
8271
+ ], Sn);
8268
8272
  var dh = Object.getOwnPropertyDescriptor, Ch = (i, a, e, t) => {
8269
8273
  for (var r = t > 1 ? void 0 : t ? dh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
8270
8274
  (s = i[n]) && (r = s(r) || r);
@@ -8288,7 +8292,7 @@ class Ah extends Ge {
8288
8292
  return a.isError() || e.isError() || !a.isReferenceObject() || !e.isReferenceObject() ? g.create(m.REF) : (a = a, e = e, kf(a, e));
8289
8293
  }
8290
8294
  }
8291
- let Sn = class extends Et {
8295
+ let wn = class extends Et {
8292
8296
  constructor(i) {
8293
8297
  super(), this._functionService = i;
8294
8298
  }
@@ -8306,9 +8310,9 @@ let Sn = class extends Et {
8306
8310
  return this.create(e);
8307
8311
  }
8308
8312
  };
8309
- Sn = Ch([
8313
+ wn = Ch([
8310
8314
  _h(0, Yt)
8311
- ], Sn);
8315
+ ], wn);
8312
8316
  class Eh extends Ge {
8313
8317
  constructor(a) {
8314
8318
  super(a);
@@ -8414,7 +8418,7 @@ let jr = class extends Oe {
8414
8418
  const f = this._changeLetToLambda(a);
8415
8419
  return f != null ? this._parse(f, e) : xe.create(m.ERROR);
8416
8420
  }
8417
- if (o === ht) {
8421
+ if (o === ft) {
8418
8422
  if (s = e, r === 0)
8419
8423
  return new ih(Ut).setParent(e), s;
8420
8424
  } else {
@@ -8435,7 +8439,7 @@ let jr = class extends Oe {
8435
8439
  continue;
8436
8440
  let d = null;
8437
8441
  if (h instanceof ae) {
8438
- if (h.getToken() === ht && h.getChildren().length === 0) {
8442
+ if (h.getToken() === ft && h.getChildren().length === 0) {
8439
8443
  const _ = (l = h.getParent()) == null ? void 0 : l.getChildren();
8440
8444
  if (_ && _.length === 1)
8441
8445
  return xe.create(m.NAME);
@@ -8527,14 +8531,14 @@ let jr = class extends Oe {
8527
8531
  jr = yh([
8528
8532
  it(0, Ot),
8529
8533
  it(1, Ve(No)),
8530
- it(2, Ve(pn)),
8531
- it(3, Ve(Vn)),
8534
+ it(2, Ve(Vn)),
8535
+ it(3, Ve(Nn)),
8532
8536
  it(4, Ve(Do)),
8533
- it(5, Ve(Nn)),
8534
- it(6, Ve(Rn)),
8535
- it(7, Ve(On)),
8536
- it(8, Ve(Mn)),
8537
- it(9, Ve(Sn)),
8537
+ it(5, Ve(On)),
8538
+ it(6, Ve(pn)),
8539
+ it(7, Ve(Mn)),
8540
+ it(8, Ve(Sn)),
8541
+ it(9, Ve(wn)),
8538
8542
  it(10, Ve(Lo))
8539
8543
  ], jr);
8540
8544
  class Rh extends Oe {
@@ -8549,7 +8553,7 @@ class Rh extends Oe {
8549
8553
  A(this, "_definedNameMap", /* @__PURE__ */ new Map());
8550
8554
  // unitId -> definedName -> treeId
8551
8555
  A(this, "_otherFormulaDataMainData", /* @__PURE__ */ new Set());
8552
- A(this, "_dependencyRTreeCache", new Rs());
8556
+ A(this, "_dependencyRTreeCache", new ps());
8553
8557
  A(this, "_dependencyTreeIdLast", 0);
8554
8558
  }
8555
8559
  buildDependencyTree(e, t) {
@@ -8881,7 +8885,7 @@ class ph extends Rh {
8881
8885
  this._allTreeMap.set(e.treeId, e);
8882
8886
  }
8883
8887
  }
8884
- const qn = ft(
8888
+ const Kn = lt(
8885
8889
  "univer.formula.dependency-manager.service"
8886
8890
  );
8887
8891
  class Vh extends Oe {
@@ -8927,7 +8931,7 @@ class Vh extends Oe {
8927
8931
  return this._referenceExecutorMap;
8928
8932
  }
8929
8933
  }
8930
- const Ur = ft(
8934
+ const Ur = lt(
8931
8935
  "univer.formula.feature-calculation-manager.service"
8932
8936
  );
8933
8937
  class Nh extends Oe {
@@ -9003,7 +9007,7 @@ class Nh extends Oe {
9003
9007
  return this._otherFormulaData;
9004
9008
  }
9005
9009
  }
9006
- const Oa = ft(
9010
+ const Oa = lt(
9007
9011
  "univer.formula.other-formula-manager.service"
9008
9012
  ), Oh = 5e3, Gs = new Nt(Oh);
9009
9013
  function Oi(i, a, e, t, r) {
@@ -9172,7 +9176,7 @@ class Mi extends xo {
9172
9176
  return this.refTree == null ? "" : this.refTree.formulaId;
9173
9177
  }
9174
9178
  }
9175
- class Cs extends xo {
9179
+ class _s extends xo {
9176
9180
  constructor(e) {
9177
9181
  super();
9178
9182
  A(this, "isCache", !1);
@@ -9317,12 +9321,12 @@ var Sh = Object.getOwnPropertyDescriptor, wh = (i, a, e, t) => {
9317
9321
  function ur(i) {
9318
9322
  return i.getLastTreeId() || 0;
9319
9323
  }
9320
- const Ws = ft("engine-formula.dependency-generator");
9324
+ const Ws = lt("engine-formula.dependency-generator");
9321
9325
  let qs = class extends Oe {
9322
9326
  constructor(a, e, t, r, n, s, o, u) {
9323
9327
  super();
9324
9328
  A(this, "_updateRangeFlattenCache", /* @__PURE__ */ new Map());
9325
- A(this, "_dependencyRTreeCacheForAddressFunction", new Rs());
9329
+ A(this, "_dependencyRTreeCacheForAddressFunction", new ps());
9326
9330
  A(this, "_executedAddressFunctionNodeIds", /* @__PURE__ */ new Set());
9327
9331
  this._currentConfigService = a, this._runtimeService = e, this._otherFormulaManagerService = t, this._featureCalculationManagerService = r, this._interpreter = n, this._astTreeBuilder = s, this._lexer = o, this._dependencyManagerService = u;
9328
9332
  }
@@ -9503,7 +9507,7 @@ let qs = class extends Oe {
9503
9507
  });
9504
9508
  }
9505
9509
  _getFeatureFormulaTree(a, e, t) {
9506
- const { unitId: r, subUnitId: n, dependencyRanges: s, getDirtyData: o } = t, u = e || ur(this._dependencyManagerService), c = new Cs(u);
9510
+ const { unitId: r, subUnitId: n, dependencyRanges: s, getDirtyData: o } = t, u = e || ur(this._dependencyManagerService), c = new _s(u);
9507
9511
  c.unitId = r, c.subUnitId = n, c.rangeList = s, c.getDirtyData = o;
9508
9512
  const l = o(this._currentConfigService.getDirtyData(), this._runtimeService.getAllRuntimeData()), f = this._convertDirtyRangesToUnitRange(l.dirtyRanges);
9509
9513
  return c.featureDirtyRanges = f, c.featureId = a, c.type = Qs.FEATURE_FORMULA, this._dependencyManagerService.addFeatureFormulaDependency(r, n, a, c), this._dependencyManagerService.getFeatureFormulaDependency(t.unitId, t.subUnitId, a) && (c.isCache = !0), c;
@@ -9523,7 +9527,7 @@ let qs = class extends Oe {
9523
9527
  const f = this._dependencyManagerService.hasOtherFormulaDataMainData(l), h = u[l], { f: d, ranges: _ } = h;
9524
9528
  let C = !1;
9525
9529
  f && (C = !0);
9526
- const E = Oi(r, d, this._lexer, this._astTreeBuilder, this._currentConfigService), { firstRow: b, firstColumn: R } = this._getFirstCellOfRange(_), p = this._dependencyManagerService.getOtherFormulaDependency(r, o, l), N = (p == null ? void 0 : p.getValue(0, 0)) || ur(this._dependencyManagerService), M = new Cs(N);
9530
+ const E = Oi(r, d, this._lexer, this._astTreeBuilder, this._currentConfigService), { firstRow: b, firstColumn: R } = this._getFirstCellOfRange(_), p = this._dependencyManagerService.getOtherFormulaDependency(r, o, l), N = (p == null ? void 0 : p.getValue(0, 0)) || ur(this._dependencyManagerService), M = new _s(N);
9527
9531
  for (let S = 0; S < _.length; S++) {
9528
9532
  const w = _[S], { startRow: D, startColumn: L, endRow: U, endColumn: x } = w;
9529
9533
  for (let F = D; F <= U; F++)
@@ -9584,7 +9588,7 @@ let qs = class extends Oe {
9584
9588
  }
9585
9589
  }
9586
9590
  _createFDtree(a, e, t, r, n, s) {
9587
- const { f: o, x: u = 0, y: c = 0 } = s, l = new Cs(ur(this._dependencyManagerService)), f = n[a][e], h = Oi(a, o, this._lexer, this._astTreeBuilder, this._currentConfigService);
9591
+ const { f: o, x: u = 0, y: c = 0 } = s, l = new _s(ur(this._dependencyManagerService)), f = n[a][e], h = Oi(a, o, this._lexer, this._astTreeBuilder, this._currentConfigService);
9588
9592
  return l.node = h, l.formula = o, l.unitId = a, l.subUnitId = e, l.row = t, l.column = r, l.rowCount = f.rowCount, l.columnCount = f.columnCount, l;
9589
9593
  }
9590
9594
  _createVirtualFDtree(a, e) {
@@ -9680,7 +9684,7 @@ let qs = class extends Oe {
9680
9684
  u.length !== 0 && await this._calculateAddressFunctionRuntimeData(a, u);
9681
9685
  }
9682
9686
  async _calculateListByFunctionRefNode(a) {
9683
- const e = new Rs();
9687
+ const e = new ps();
9684
9688
  for (let t = 0, r = a.length; t < r; t++) {
9685
9689
  const n = a[t];
9686
9690
  e.insert({
@@ -9916,14 +9920,14 @@ qs = wh([
9916
9920
  wt(4, Ve(_r)),
9917
9921
  wt(5, Ve(jr)),
9918
9922
  wt(6, Ve(dr)),
9919
- wt(7, qn)
9923
+ wt(7, Kn)
9920
9924
  ], qs);
9921
9925
  var Dh = Object.getOwnPropertyDescriptor, Lh = (i, a, e, t) => {
9922
9926
  for (var r = t > 1 ? void 0 : t ? Dh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
9923
9927
  (s = i[n]) && (r = s(r) || r);
9924
9928
  return r;
9925
9929
  }, Qt = (i, a) => (e, t) => a(e, t, i);
9926
- const Ph = 500, Ks = ft("engine-formula.calculate-formula.service");
9930
+ const Ph = 500, Ks = lt("engine-formula.calculate-formula.service");
9927
9931
  let Xs = class extends Oe {
9928
9932
  constructor(a, e, t, r, n, s, o) {
9929
9933
  super();
@@ -9934,7 +9938,7 @@ let Xs = class extends Oe {
9934
9938
  this._configService = a, this._lexer = e, this._currentConfigService = t, this._runtimeService = r, this._formulaDependencyGenerator = n, this._interpreter = s, this._astTreeBuilder = o;
9935
9939
  }
9936
9940
  dispose() {
9937
- super.dispose(), this._executionInProgressListener$.complete(), this._executionCompleteListener$.complete(), En.clear(), bt.clear(), xs.clear(), $s.clear();
9941
+ super.dispose(), this._executionInProgressListener$.complete(), this._executionCompleteListener$.complete(), bn.clear(), bt.clear(), js.clear(), $s.clear();
9938
9942
  }
9939
9943
  /**
9940
9944
  * Stop the execution of the formula.
@@ -9958,7 +9962,7 @@ let Xs = class extends Oe {
9958
9962
  async execute(a) {
9959
9963
  this._runtimeService.setFormulaExecuteStage(Xe.START), this._executionInProgressListener$.next(this._runtimeService.getRuntimeState()), this._currentConfigService.load(a), this._runtimeService.reset();
9960
9964
  const e = a.maxIteration || lo;
9961
- for (let t = 0; t < e && (this._runtimeService.setFormulaCycleIndex(t), await this._execute(), En.clear(), !!this._runtimeService.isCycleDependency()); t++)
9965
+ for (let t = 0; t < e && (this._runtimeService.setFormulaCycleIndex(t), await this._execute(), bn.clear(), !!this._runtimeService.isCycleDependency()); t++)
9962
9966
  ;
9963
9967
  this._runtimeService.setFormulaExecuteStage(Xe.CALCULATION_COMPLETED), this._executionInProgressListener$.next(this._runtimeService.getRuntimeState()), this._executionCompleteListener$.next(this._runtimeService.getAllRuntimeData()), bt.clear(), this._runtimeService.reset();
9964
9968
  }
@@ -10058,8 +10062,8 @@ var xh = Object.getOwnPropertyDescriptor, jh = (i, a, e, t) => {
10058
10062
  for (var r = t > 1 ? void 0 : t ? xh(a, e) : a, n = i.length - 1, s; n >= 0; n--)
10059
10063
  (s = i[n]) && (r = s(r) || r);
10060
10064
  return r;
10061
- }, _s = (i, a) => (e, t) => a(e, t, i);
10062
- let wn = class extends Oe {
10065
+ }, As = (i, a) => (e, t) => a(e, t, i);
10066
+ let Dn = class extends Oe {
10063
10067
  constructor(i, a, e) {
10064
10068
  super(), this._commandService = i, this._calculateFormulaService = a, this._formulaDataModel = e, this._initialize();
10065
10069
  }
@@ -10074,7 +10078,7 @@ let wn = class extends Oe {
10074
10078
  else if (i.id === no.id) {
10075
10079
  const a = i.params;
10076
10080
  this._calculate(a);
10077
- } else if (i.id === Vs.id) {
10081
+ } else if (i.id === Ns.id) {
10078
10082
  const a = i.params;
10079
10083
  if (a == null)
10080
10084
  return;
@@ -10116,7 +10120,7 @@ let wn = class extends Oe {
10116
10120
  break;
10117
10121
  }
10118
10122
  this._commandService.executeCommand(
10119
- gn.id,
10123
+ dn.id,
10120
10124
  {
10121
10125
  functionsExecutedState: a
10122
10126
  },
@@ -10126,7 +10130,7 @@ let wn = class extends Oe {
10126
10130
  );
10127
10131
  }), this._calculateFormulaService.executionInProgressListener$.subscribe((i) => {
10128
10132
  this._commandService.executeCommand(
10129
- gn.id,
10133
+ dn.id,
10130
10134
  {
10131
10135
  stageInfo: i
10132
10136
  },
@@ -10143,7 +10147,7 @@ let wn = class extends Oe {
10143
10147
  return;
10144
10148
  }
10145
10149
  t && (this._formulaDataModel.clearPreviousArrayFormulaCellData(n), this._formulaDataModel.mergeArrayFormulaCellData(r), this._formulaDataModel.mergeArrayFormulaRange(t), this._commandService.executeCommand(
10146
- Vs.id,
10150
+ Ns.id,
10147
10151
  {
10148
10152
  arrayFormulaRange: this._formulaDataModel.getArrayFormulaRange(),
10149
10153
  arrayFormulaCellData: this._formulaDataModel.getArrayFormulaCellData()
@@ -10163,11 +10167,11 @@ let wn = class extends Oe {
10163
10167
  );
10164
10168
  }
10165
10169
  };
10166
- wn = jh([
10167
- _s(0, ar),
10168
- _s(1, Ks),
10169
- _s(2, Ve(Pr))
10170
- ], wn);
10170
+ Dn = jh([
10171
+ As(0, ar),
10172
+ As(1, Ks),
10173
+ As(2, Ve(Pr))
10174
+ ], Dn);
10171
10175
  const Si = /[\[\]]/g;
10172
10176
  function wi(i, a) {
10173
10177
  if (Si.test(i)) {
@@ -10176,7 +10180,7 @@ function wi(i, a) {
10176
10180
  }
10177
10181
  return Number(i) - 1;
10178
10182
  }
10179
- function As(i, a = 0, e = 0) {
10183
+ function Es(i, a = 0, e = 0) {
10180
10184
  i = i.toLocaleUpperCase();
10181
10185
  const t = i.split(/[RC]/), r = t[1], n = t[2], s = wi(r, a), o = wi(n, e);
10182
10186
  return {
@@ -10188,7 +10192,7 @@ function As(i, a = 0, e = 0) {
10188
10192
  function Uh(i, a = 0, e = 0) {
10189
10193
  const { refBody: t, sheetName: r, unitId: n } = ua(i), s = t.indexOf(":");
10190
10194
  if (s === -1) {
10191
- const C = As(t, a, e), E = C.row, b = C.column, R = C.absoluteRefType;
10195
+ const C = Es(t, a, e), E = C.row, b = C.column, R = C.absoluteRefType;
10192
10196
  return {
10193
10197
  unitId: n,
10194
10198
  sheetName: r,
@@ -10202,7 +10206,7 @@ function Uh(i, a = 0, e = 0) {
10202
10206
  }
10203
10207
  };
10204
10208
  }
10205
- const o = t.substring(0, s), u = t.substring(s + 1), c = As(o, a, e), l = As(u, a, e), f = c.row, h = c.column, d = l.row, _ = l.column;
10209
+ const o = t.substring(0, s), u = t.substring(s + 1), c = Es(o, a, e), l = Es(u, a, e), f = c.row, h = c.column, d = l.row, _ = l.column;
10206
10210
  return {
10207
10211
  unitId: n,
10208
10212
  sheetName: r,
@@ -10584,13 +10588,13 @@ class V {
10584
10588
  return a;
10585
10589
  }
10586
10590
  createReferenceObject(a, e) {
10587
- const t = a.getForcedUnitId(), r = a.getForcedSheetId() || "", n = a.getForcedSheetName(), o = Ns({
10591
+ const t = a.getForcedUnitId(), r = a.getForcedSheetId() || "", n = a.getForcedSheetName(), o = Os({
10588
10592
  unitId: t,
10589
10593
  sheetName: n,
10590
10594
  range: e
10591
10595
  });
10592
10596
  let u;
10593
- return Tr(o) ? u = new ba(o) : zi(o) ? u = new Ra(o) : Ji(o) ? u = new ya(o) : u = new bn(e, r, t), this._setReferenceDefault(a, u);
10597
+ return Tr(o) ? u = new ba(o) : zi(o) ? u = new Ra(o) : Ji(o) ? u = new ya(o) : u = new yn(e, r, t), this._setReferenceDefault(a, u);
10594
10598
  }
10595
10599
  _setReferenceDefault(a, e) {
10596
10600
  return this.unitId == null || this.subUnitId == null ? g.create(m.REF) : (e.setDefaultUnitId(this.unitId), e.setDefaultSheetId(this.subUnitId), e.setUnitData(a.getUnitData()), e.setRuntimeData(a.getRuntimeData()), e.setArrayFormulaCellData(a.getArrayFormulaCellData()), e.setRuntimeArrayFormulaCellData(a.getRuntimeArrayFormulaCellData()), e);
@@ -10809,6 +10813,7 @@ function Zt(i) {
10809
10813
  return 0;
10810
10814
  const a = [
10811
10815
  -1.3026537197817094,
10816
+ // eslint-disable-next-line no-loss-of-precision
10812
10817
  0.6419697923564902,
10813
10818
  0.019476473204185836,
10814
10819
  -0.00956151478680863,
@@ -10890,7 +10895,7 @@ function Di(i, a) {
10890
10895
  const e = zs(i, a);
10891
10896
  return e === 0 ? 0 : Math.abs(i * a) / e;
10892
10897
  }
10893
- function Kn(i) {
10898
+ function Xn(i) {
10894
10899
  const a = i.length;
10895
10900
  if (a === 1)
10896
10901
  return i[0][0];
@@ -10898,11 +10903,11 @@ function Kn(i) {
10898
10903
  return i[0][0] * i[1][1] - i[0][1] * i[1][0];
10899
10904
  let e = 0;
10900
10905
  for (let t = 0; t < a; t++)
10901
- e += (t % 2 === 0 ? 1 : -1) * i[0][t] * Kn(jo(i, 0, t));
10906
+ e += (t % 2 === 0 ? 1 : -1) * i[0][t] * Xn(jo(i, 0, t));
10902
10907
  return e;
10903
10908
  }
10904
10909
  function kh(i) {
10905
- const a = Kn(i);
10910
+ const a = Xn(i);
10906
10911
  return a === 0 ? null : i.length === 1 ? [[1 / a]] : $h(i).map((r) => r.map((n) => n / a));
10907
10912
  }
10908
10913
  function jo(i, a, e) {
@@ -10913,7 +10918,7 @@ function $h(i) {
10913
10918
  for (let t = 0; t < a; t++)
10914
10919
  for (let r = 0; r < a; r++) {
10915
10920
  const n = (t + r) % 2 === 0 ? 1 : -1;
10916
- e[r][t] = n * Kn(jo(i, t, r));
10921
+ e[r][t] = n * Xn(jo(i, t, r));
10917
10922
  }
10918
10923
  return e;
10919
10924
  }
@@ -10922,7 +10927,7 @@ function fr(i, a) {
10922
10927
  (t, r) => e.reduce((n, s, o) => n + s * a[o][r], 0)
10923
10928
  ));
10924
10929
  }
10925
- function mt(i) {
10930
+ function ht(i) {
10926
10931
  return i[0].map((a, e) => i.map((t) => t[e]));
10927
10932
  }
10928
10933
  function Yh(i) {
@@ -10930,7 +10935,7 @@ function Yh(i) {
10930
10935
  return a ? null : Gh(e, t);
10931
10936
  }
10932
10937
  function Hh(i) {
10933
- const a = mt(i), e = a.length, t = a[0].length;
10938
+ const a = ht(i), e = a.length, t = a[0].length;
10934
10939
  let r = !0, n = !1;
10935
10940
  const s = Js(e, t, 0), o = new Array(t).fill(0).map((u, c) => c);
10936
10941
  for (let u = 0; u < t; u++) {
@@ -11008,26 +11013,26 @@ function Qh(i) {
11008
11013
  const a = Wh(i);
11009
11014
  if (!a)
11010
11015
  return null;
11011
- const { matrixU: e, matrixS: t, matrixV: r } = a, n = mt(e), s = Array.from({ length: t.length }, () => new Array(i[0].length).fill(0)), o = Math.max(i.length, i[0].length) * Number.EPSILON * t[0];
11016
+ const { matrixU: e, matrixS: t, matrixV: r } = a, n = ht(e), s = Array.from({ length: t.length }, () => new Array(i[0].length).fill(0)), o = Math.max(i.length, i[0].length) * Number.EPSILON * t[0];
11012
11017
  for (let u = 0; u < t.length; u++)
11013
11018
  Math.abs(t[u]) > o && (s[u][u] = 1 / t[u]);
11014
11019
  return fr(r, fr(s, n));
11015
11020
  }
11016
11021
  function Wh(i) {
11017
- const a = mt(i), e = a.length, t = a[0].length;
11022
+ const a = ht(i), e = a.length, t = a[0].length;
11018
11023
  if (e < t)
11019
11024
  return null;
11020
11025
  const r = new Array(t).fill(0), n = new Array(t).fill(0), s = Array.from({ length: t }, () => new Array(t).fill(0));
11021
11026
  let o = Number.EPSILON, u = 0, c = 0, l = 0;
11022
11027
  for (let C = 0; C < t; C++) {
11023
- if (r[C] = u, c = Es(a, C, e, C, C), c <= 1e-64 / o)
11028
+ if (r[C] = u, c = bs(a, C, e, C, C), c <= 1e-64 / o)
11024
11029
  u = 0;
11025
11030
  else {
11026
11031
  u = Math.sqrt(c), a[C][C] >= 0 && (u = -u);
11027
11032
  const b = a[C][C] * u - c;
11028
11033
  a[C][C] -= u;
11029
11034
  for (let R = C + 1; R < t; R++) {
11030
- c = Es(a, C, e, C, R);
11035
+ c = bs(a, C, e, C, R);
11031
11036
  for (let p = C; p < e; p++)
11032
11037
  a[p][R] += c / b * a[p][C];
11033
11038
  }
@@ -11072,7 +11077,7 @@ function Wh(i) {
11072
11077
  a[C][E] = 0;
11073
11078
  if (u !== 0) {
11074
11079
  for (let E = C + 1; E < t; E++) {
11075
- c = Es(a, C + 1, e, C, E);
11080
+ c = bs(a, C + 1, e, C, E);
11076
11081
  for (let b = C; b < e; b++)
11077
11082
  a[b][E] += c / (a[C][C] * u) * a[b][C];
11078
11083
  }
@@ -11161,7 +11166,7 @@ function Xr(i, a) {
11161
11166
  let e = 0;
11162
11167
  return Math.abs(i) > Math.abs(a) ? (e = a / i, Math.abs(i) * Math.sqrt(1 + e * e)) : a !== 0 ? (e = i / a, Math.abs(a) * Math.sqrt(1 + e * e)) : 0;
11163
11168
  }
11164
- function Es(i, a, e, t, r) {
11169
+ function bs(i, a, e, t, r) {
11165
11170
  let n = 0;
11166
11171
  for (let s = a; s < e; s++)
11167
11172
  n += i[s][t] * i[s][r];
@@ -11215,7 +11220,7 @@ const Zr = /* @__PURE__ */ new Map([
11215
11220
  [1, 4, 5, 9, 10, 40, 45, 49, 50, 90, 95, 99, 100, 400, 450, 490, 495, 499, 500, 900, 950, 990, 995, 999, 1e3, 4e3]
11216
11221
  ];
11217
11222
  function Uo(i, a, e) {
11218
- return i <= 0 ? 0 : i >= 1 ? 1 : Xn(i, a, e);
11223
+ return i <= 0 ? 0 : i >= 1 ? 1 : Zn(i, a, e);
11219
11224
  }
11220
11225
  function Xh(i, a, e) {
11221
11226
  return i <= 0 || i >= 1 ? 0 : a === 1 && e === 1 ? 1 : a < 512 && e < 512 ? i ** (a - 1) * (1 - i) ** (e - 1) / Pa(a, e) : Math.exp((a - 1) * Math.log(i) + (e - 1) * Math.log(1 - i) - xa(a, e));
@@ -11241,13 +11246,13 @@ function La(i, a, e) {
11241
11246
  for (let c = 0; c < 10; c++) {
11242
11247
  if (r === 0 || r === 1)
11243
11248
  return r;
11244
- if (s = Xn(r, a, e) - i, o = Math.exp((a - 1) * Math.log(r) + (e - 1) * Math.log(1 - r) + n), u = s / o, r -= o = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / r - (e - 1) / (1 - r)))), r <= 0 && (r = 0.5 * (r + o)), r >= 1 && (r = 0.5 * (r + o + 1)), Math.abs(o) < t * r && c > 0)
11249
+ if (s = Zn(r, a, e) - i, o = Math.exp((a - 1) * Math.log(r) + (e - 1) * Math.log(1 - r) + n), u = s / o, r -= o = u / (1 - 0.5 * Math.min(1, u * ((a - 1) / r - (e - 1) / (1 - r)))), r <= 0 && (r = 0.5 * (r + o)), r >= 1 && (r = 0.5 * (r + o + 1)), Math.abs(o) < t * r && c > 0)
11245
11250
  break;
11246
11251
  }
11247
11252
  return r;
11248
11253
  }
11249
- function Xn(i, a, e) {
11250
- const t = i === 0 || i === 1 ? 0 : Math.exp(lt(a + e) - lt(a) - lt(e) + a * Math.log(i) + e * Math.log(1 - i));
11254
+ function Zn(i, a, e) {
11255
+ const t = i === 0 || i === 1 ? 0 : Math.exp(ct(a + e) - ct(a) - ct(e) + a * Math.log(i) + e * Math.log(1 - i));
11251
11256
  return i < (a + 1) / (a + e + 2) ? t * Pi(i, a, e) / a : 1 - t * Pi(1 - i, e, a) / e;
11252
11257
  }
11253
11258
  function Pi(i, a, e) {
@@ -11262,10 +11267,10 @@ function Pi(i, a, e) {
11262
11267
  return o;
11263
11268
  }
11264
11269
  function Pa(i, a) {
11265
- return i + a > 170 ? Math.exp(xa(i, a)) : cn(i) * cn(a) / cn(i + a);
11270
+ return i + a > 170 ? Math.exp(xa(i, a)) : ln(i) * ln(a) / ln(i + a);
11266
11271
  }
11267
11272
  function xa(i, a) {
11268
- return lt(i) + lt(a) - lt(i + a);
11273
+ return ct(i) + ct(a) - ct(i + a);
11269
11274
  }
11270
11275
  function vo(i, a, e) {
11271
11276
  if (i < 0)
@@ -11286,13 +11291,13 @@ function Ua(i, a) {
11286
11291
  return i <= 0 ? 0 : Ta(a / 2, i / 2);
11287
11292
  }
11288
11293
  function Zh(i, a) {
11289
- return i < 0 ? 0 : i === 0 && a === 2 ? 0.5 : Math.exp((a / 2 - 1) * Math.log(i) - i / 2 - a / 2 * Math.log(2) - lt(a / 2));
11294
+ return i < 0 ? 0 : i === 0 && a === 2 ? 0.5 : Math.exp((a / 2 - 1) * Math.log(i) - i / 2 - a / 2 * Math.log(2) - ct(a / 2));
11290
11295
  }
11291
11296
  function To(i, a) {
11292
11297
  return i <= 0 ? 0 : i >= 1 ? 1 / 0 : 2 * Fo(i, a / 2);
11293
11298
  }
11294
11299
  function va(i, a, e) {
11295
- return i < 0 ? 0 : Xn(a * i / (a * i + e), a / 2, e / 2);
11300
+ return i < 0 ? 0 : Zn(a * i / (a * i + e), a / 2, e / 2);
11296
11301
  }
11297
11302
  function zh(i, a, e) {
11298
11303
  if (i < 0)
@@ -11327,7 +11332,7 @@ function Io(i, a, e) {
11327
11332
  const l = u / c;
11328
11333
  return s - l * o + l * i;
11329
11334
  }
11330
- function cn(i) {
11335
+ function ln(i) {
11331
11336
  const a = [
11332
11337
  -1.716185138865495,
11333
11338
  24.76565080557592,
@@ -11342,9 +11347,10 @@ function cn(i) {
11342
11347
  315.35062697960416,
11343
11348
  -1015.1563674902192,
11344
11349
  -3107.771671572311,
11350
+ // eslint-disable-next-line no-loss-of-precision
11345
11351
  22538.11842098015,
11352
+ // eslint-disable-next-line no-loss-of-precision
11346
11353
  4755.846277527881,
11347
- // eslint-disable-line
11348
11354
  -134659.9598649693,
11349
11355
  -115132.2596755535
11350
11356
  ];
@@ -11376,12 +11382,12 @@ function tm(i, a, e) {
11376
11382
  return i <= 0 ? 0 : Ta(a, i / e);
11377
11383
  }
11378
11384
  function rm(i, a, e) {
11379
- return i < 0 ? 0 : i === 0 && a === 1 ? 1 / e : Math.exp((a - 1) * Math.log(i) - i / e - lt(a) - a * Math.log(e));
11385
+ return i < 0 ? 0 : i === 0 && a === 1 ? 1 / e : Math.exp((a - 1) * Math.log(i) - i / e - ct(a) - a * Math.log(e));
11380
11386
  }
11381
11387
  function nm(i, a, e) {
11382
11388
  return i <= 0 ? 0 : i >= 1 ? 1 / 0 : e * Fo(i, a);
11383
11389
  }
11384
- function lt(i) {
11390
+ function ct(i) {
11385
11391
  const a = [
11386
11392
  76.18009172947146,
11387
11393
  -86.50532032941678,
@@ -11401,7 +11407,7 @@ function lt(i) {
11401
11407
  function Ta(i, a) {
11402
11408
  if (a < 0 || i <= 0)
11403
11409
  return Number.NaN;
11404
- const e = 1e-30, t = -~(Math.log(i >= 1 ? i : 1 / i) * 8.5 + i * 0.4 + 17), r = lt(i), n = Math.exp(-a + i * Math.log(a) - r);
11410
+ const e = 1e-30, t = -~(Math.log(i >= 1 ? i : 1 / i) * 8.5 + i * 0.4 + 17), r = ct(i), n = Math.exp(-a + i * Math.log(a) - r);
11405
11411
  let s = i, o = 1 / i, u = o;
11406
11412
  if (a < i + 1) {
11407
11413
  if (n === 0)
@@ -11433,7 +11439,7 @@ function Fo(i, a) {
11433
11439
  const o = 1 - a * (0.253 + a * 0.12);
11434
11440
  i < o ? e = (i / o) ** (1 / a) : e = 1 - Math.log(1 - (i - o) / (1 - o));
11435
11441
  }
11436
- const t = 1e-8, r = lt(a);
11442
+ const t = 1e-8, r = ct(a);
11437
11443
  let n, s;
11438
11444
  for (let o = 0; o < 12; o++) {
11439
11445
  if (e <= 0)
@@ -11459,7 +11465,7 @@ function am(i, a, e) {
11459
11465
  return i <= 0 ? 0 : Math.exp(-Math.log(i) - 0.5 * Math.log(2 * Math.PI) - Math.log(e) - (Math.log(i) - a) ** 2 / (2 * e * e));
11460
11466
  }
11461
11467
  function im(i, a, e) {
11462
- return Math.exp(Zn(i, a, e));
11468
+ return Math.exp(zn(i, a, e));
11463
11469
  }
11464
11470
  function om(i, a, e) {
11465
11471
  if (i < 0)
@@ -11478,7 +11484,7 @@ function $r(i, a, e) {
11478
11484
  function $o(i, a, e) {
11479
11485
  return Math.exp(-0.5 * Math.log(2 * Math.PI) - Math.log(e) - (i - a) ** 2 / (2 * e * e));
11480
11486
  }
11481
- function Zn(i, a, e) {
11487
+ function zn(i, a, e) {
11482
11488
  return -1.4142135623730951 * e * Fh(2 * i) + a;
11483
11489
  }
11484
11490
  function um(i, a) {
@@ -11491,14 +11497,14 @@ function Yo(i, a) {
11491
11497
  return Math.exp(-a) * a ** i / lr(i);
11492
11498
  }
11493
11499
  function Yr(i, a) {
11494
- const e = 0.5 * Xn(a / (i ** 2 + a), a / 2, 0.5);
11500
+ const e = 0.5 * Zn(a / (i ** 2 + a), a / 2, 0.5);
11495
11501
  return i < 0 ? e : 1 - e;
11496
11502
  }
11497
11503
  function cm(i, a) {
11498
11504
  const e = (1 + i ** 2 / a) ** (-(a + 1) / 2);
11499
11505
  return 1 / (Math.sqrt(a) * Pa(0.5, a / 2)) * e;
11500
11506
  }
11501
- function zn(i, a) {
11507
+ function Jn(i, a) {
11502
11508
  let e = La(2 * Math.min(i, 1 - i), 0.5 * a, 0.5);
11503
11509
  return e = Math.sqrt(a * (1 - e) / e), i > 0.5 ? e : -e;
11504
11510
  }
@@ -11536,7 +11542,7 @@ function et(i, a, e, t, r) {
11536
11542
  noCalculate: o
11537
11543
  };
11538
11544
  }
11539
- function Jn(i, a, e) {
11545
+ function es(i, a, e) {
11540
11546
  const t = i.isArray() ? i.getRowCount() : 1, r = i.isArray() ? i.getColumnCount() : 1;
11541
11547
  let n = t, s = r;
11542
11548
  if (a && !a.isNull() && (n = a.isArray() ? a.getRowCount() : 1, s = a.isArray() ? a.getColumnCount() : 1, t === 1 && s !== r || r === 1 && n !== t || t !== 1 && r !== 1 && (n !== t || s !== r)))
@@ -11570,7 +11576,7 @@ function dt(i) {
11570
11576
  }
11571
11577
  return t;
11572
11578
  }
11573
- function es(i, a) {
11579
+ function ts(i, a) {
11574
11580
  const e = [];
11575
11581
  let t = 1;
11576
11582
  for (let r = 0; r < i; r++) {
@@ -11580,7 +11586,7 @@ function es(i, a) {
11580
11586
  }
11581
11587
  return e;
11582
11588
  }
11583
- function ts(i, a, e, t) {
11589
+ function rs(i, a, e, t) {
11584
11590
  let r = a;
11585
11591
  t && (r = a.map((o) => Math.log(o)));
11586
11592
  let n, s;
@@ -11642,18 +11648,18 @@ function fm(i, a) {
11642
11648
  intercept: 0
11643
11649
  };
11644
11650
  }
11645
- function rs(i, a, e, t, r) {
11651
+ function ns(i, a, e, t, r) {
11646
11652
  const n = i.length === 1 && i[0].length > 1;
11647
11653
  let s = i;
11648
11654
  r && (s = i.map((C) => C.map((E) => Math.log(E))));
11649
11655
  let o = a, u = e;
11650
- n && (s = mt(s), o = mt(o), u = mt(u)), t && (o = o.map((C) => [...C, 1]));
11651
- const c = mt(o), l = fr(c, o), f = fr(c, s);
11656
+ n && (s = ht(s), o = ht(o), u = ht(u)), t && (o = o.map((C) => [...C, 1]));
11657
+ const c = ht(o), l = fr(c, o), f = fr(c, s);
11652
11658
  let h = Yh(l);
11653
11659
  if (!h && (h = Qh(l), !h))
11654
11660
  return g.create(m.NA);
11655
11661
  let d = fr(h, f);
11656
- t || d.push([0]), d = mt(d);
11662
+ t || d.push([0]), d = ht(d);
11657
11663
  const _ = d[0].pop();
11658
11664
  if (d[0].reverse(), d[0].push(_), r)
11659
11665
  for (let C = 0; C < d[0].length; C++)
@@ -11917,7 +11923,7 @@ class Xo extends V {
11917
11923
  const [p, N, M] = R, S = +p.getValue(), w = +N.getValue(), D = Math.floor(+M.getValue());
11918
11924
  if (S <= 0 || S >= 1 || w <= 0 || D < 1)
11919
11925
  return g.create(m.NUM);
11920
- const L = Math.abs(Zn(S / 2, 0, 1) * w / Math.sqrt(D));
11926
+ const L = Math.abs(zn(S / 2, 0, 1) * w / Math.sqrt(D));
11921
11927
  return y.create(L);
11922
11928
  });
11923
11929
  return n === 1 && s === 1 ? l.get(0, 0) : l;
@@ -12355,7 +12361,7 @@ class ou extends V {
12355
12361
  const [u, c, l] = o, f = +u.getValue(), h = +c.getValue(), d = +l.getValue();
12356
12362
  if (f <= 0 || f >= 1 || d <= 0)
12357
12363
  return g.create(m.NUM);
12358
- const _ = Zn(f, h, d);
12364
+ const _ = zn(f, h, d);
12359
12365
  return y.create(_);
12360
12366
  }
12361
12367
  }
@@ -12379,7 +12385,7 @@ class uu extends V {
12379
12385
  const [s] = n, o = +s.getValue();
12380
12386
  if (o <= 0 || o >= 1)
12381
12387
  return g.create(m.NUM);
12382
- const u = Zn(o, 0, 1);
12388
+ const u = zn(o, 0, 1);
12383
12389
  return y.create(u);
12384
12390
  }
12385
12391
  }
@@ -12604,7 +12610,7 @@ class du extends V {
12604
12610
  const [o, u] = s, c = +o.getValue(), l = Math.floor(+u.getValue());
12605
12611
  if (c <= 0 || c > 1 || l < 1 || l > 10 ** 10)
12606
12612
  return g.create(m.NUM);
12607
- const f = Math.abs(zn(c / 2, l));
12613
+ const f = Math.abs(Jn(c / 2, l));
12608
12614
  return Number.isNaN(f) || !Number.isFinite(f) ? g.create(m.NUM) : y.create(f);
12609
12615
  }
12610
12616
  }
@@ -13804,7 +13810,7 @@ function pu(i) {
13804
13810
  }
13805
13811
  return Ru[Number(i)] || [];
13806
13812
  }
13807
- function Dn(i, a, e = 1, t) {
13813
+ function Ln(i, a, e = 1, t) {
13808
13814
  const r = pu(e), n = Math.floor(i), s = Math.floor(a), o = s > n ? n : s;
13809
13815
  let u = 0;
13810
13816
  const c = Math.abs(Math.floor(a) - Math.floor(i)) + 1;
@@ -13817,7 +13823,7 @@ function Dn(i, a, e = 1, t) {
13817
13823
  }
13818
13824
  return s >= n ? u : -u;
13819
13825
  }
13820
- function Ln(i, a, e = 1, t) {
13826
+ function Pn(i, a, e = 1, t) {
13821
13827
  const r = pu(e), n = Math.floor(i);
13822
13828
  let s = n, o = Math.abs(a);
13823
13829
  for (let u = 1; u <= o; u++) {
@@ -13935,7 +13941,7 @@ const Ym = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Hm = [31, 28, 31, 3
13935
13941
  function Gr(i, a) {
13936
13942
  return km(i) ? Ym[a] : Hm[a];
13937
13943
  }
13938
- function ns(i) {
13944
+ function ss(i) {
13939
13945
  return $m(i) ? 366 : 365;
13940
13946
  }
13941
13947
  function Vu(i, a) {
@@ -13945,7 +13951,7 @@ function Vu(i, a) {
13945
13951
  case 4:
13946
13952
  return 360;
13947
13953
  case 1:
13948
- return ns(re(i).getUTCFullYear());
13954
+ return ss(re(i).getUTCFullYear());
13949
13955
  case 3:
13950
13956
  return 365;
13951
13957
  default:
@@ -14442,7 +14448,7 @@ class sg extends V {
14442
14448
  return u;
14443
14449
  if (r)
14444
14450
  return this._getResultByHolidays(o, u, r);
14445
- const c = Dn(o, u);
14451
+ const c = Ln(o, u);
14446
14452
  return y.create(c);
14447
14453
  }
14448
14454
  _getResultByHolidays(e, t, r) {
@@ -14467,7 +14473,7 @@ class sg extends V {
14467
14473
  return o;
14468
14474
  n.push(o);
14469
14475
  }
14470
- const s = Dn(e, t, 1, n);
14476
+ const s = Ln(e, t, 1, n);
14471
14477
  return y.create(s);
14472
14478
  }
14473
14479
  }
@@ -14515,7 +14521,7 @@ class ag extends V {
14515
14521
  return l;
14516
14522
  if (n)
14517
14523
  return this._getResultByHolidays(c, l, u, n);
14518
- const f = Dn(c, l, u);
14524
+ const f = Ln(c, l, u);
14519
14525
  return y.create(f);
14520
14526
  }
14521
14527
  _getResultByHolidays(e, t, r, n) {
@@ -14540,7 +14546,7 @@ class ag extends V {
14540
14546
  return u;
14541
14547
  s.push(u);
14542
14548
  }
14543
- const o = Dn(e, t, r, s);
14549
+ const o = Ln(e, t, r, s);
14544
14550
  return y.create(o);
14545
14551
  }
14546
14552
  }
@@ -14827,7 +14833,7 @@ class gg extends V {
14827
14833
  return g.create(m.VALUE);
14828
14834
  if (r)
14829
14835
  return this._getResultByHolidays(o, u, r);
14830
- const c = Ln(o, u);
14836
+ const c = Pn(o, u);
14831
14837
  return typeof c != "number" ? c : y.create(c);
14832
14838
  }
14833
14839
  _getResultByHolidays(e, t, r) {
@@ -14852,7 +14858,7 @@ class gg extends V {
14852
14858
  return o;
14853
14859
  n.push(o);
14854
14860
  }
14855
- const s = Ln(e, t, 1, n);
14861
+ const s = Pn(e, t, 1, n);
14856
14862
  return typeof s != "number" ? s : y.create(s);
14857
14863
  }
14858
14864
  }
@@ -14887,7 +14893,7 @@ class dg extends V {
14887
14893
  return g.create(m.NUM);
14888
14894
  if (n)
14889
14895
  return this._getResultByHolidays(c, l, f, n);
14890
- const h = Ln(c, l, f);
14896
+ const h = Pn(c, l, f);
14891
14897
  return typeof h != "number" ? h : y.create(h);
14892
14898
  }
14893
14899
  _checkArrayError(e) {
@@ -14922,7 +14928,7 @@ class dg extends V {
14922
14928
  return u;
14923
14929
  s.push(u);
14924
14930
  }
14925
- const o = Ln(e, t, r, s);
14931
+ const o = Pn(e, t, r, s);
14926
14932
  return typeof o != "number" ? o : y.create(o);
14927
14933
  }
14928
14934
  }
@@ -17051,7 +17057,7 @@ const R1 = [
17051
17057
  [y1, Z.OCT2HEX]
17052
17058
  ];
17053
17059
  var ee = /* @__PURE__ */ ((i) => (i.ACCRINT = "ACCRINT", i.ACCRINTM = "ACCRINTM", i.AMORDEGRC = "AMORDEGRC", i.AMORLINC = "AMORLINC", i.COUPDAYBS = "COUPDAYBS", i.COUPDAYS = "COUPDAYS", i.COUPDAYSNC = "COUPDAYSNC", i.COUPNCD = "COUPNCD", i.COUPNUM = "COUPNUM", i.COUPPCD = "COUPPCD", i.CUMIPMT = "CUMIPMT", i.CUMPRINC = "CUMPRINC", i.DB = "DB", i.DDB = "DDB", i.DISC = "DISC", i.DOLLARDE = "DOLLARDE", i.DOLLARFR = "DOLLARFR", i.DURATION = "DURATION", i.EFFECT = "EFFECT", i.FV = "FV", i.FVSCHEDULE = "FVSCHEDULE", i.INTRATE = "INTRATE", i.IPMT = "IPMT", i.IRR = "IRR", i.ISPMT = "ISPMT", i.MDURATION = "MDURATION", i.MIRR = "MIRR", i.NOMINAL = "NOMINAL", i.NPER = "NPER", i.NPV = "NPV", i.ODDFPRICE = "ODDFPRICE", i.ODDFYIELD = "ODDFYIELD", i.ODDLPRICE = "ODDLPRICE", i.ODDLYIELD = "ODDLYIELD", i.PDURATION = "PDURATION", i.PMT = "PMT", i.PPMT = "PPMT", i.PRICE = "PRICE", i.PRICEDISC = "PRICEDISC", i.PRICEMAT = "PRICEMAT", i.PV = "PV", i.RATE = "RATE", i.RECEIVED = "RECEIVED", i.RRI = "RRI", i.SLN = "SLN", i.SYD = "SYD", i.TBILLEQ = "TBILLEQ", i.TBILLPRICE = "TBILLPRICE", i.TBILLYIELD = "TBILLYIELD", i.VDB = "VDB", i.XIRR = "XIRR", i.XNPV = "XNPV", i.YIELD = "YIELD", i.YIELDDISC = "YIELDDISC", i.YIELDMAT = "YIELDMAT", i))(ee || {});
17054
- function ss(i, a, e, t) {
17060
+ function as(i, a, e, t) {
17055
17061
  const r = It(i, a, e), { days: n } = _e(r, i, t);
17056
17062
  return n;
17057
17063
  }
@@ -17089,7 +17095,7 @@ function It(i, a, e) {
17089
17095
  return ye(r);
17090
17096
  }
17091
17097
  function Ou(i, a, e, t, r, n) {
17092
- const s = ss(i, a, r, n), o = qe(i, a, r, n), u = nr(i, a, r), c = (o - s) / o - 1, l = t / r + 1, f = e * 100 / r;
17098
+ const s = as(i, a, r, n), o = qe(i, a, r, n), u = nr(i, a, r), c = (o - s) / o - 1, l = t / r + 1, f = e * 100 / r;
17093
17099
  let h = 0, d = 0;
17094
17100
  for (let E = 1; E <= u; E++) {
17095
17101
  const b = E + c, R = f / l ** b;
@@ -17253,8 +17259,8 @@ function O1(i, a) {
17253
17259
  while (Math.abs(_) > 1e-7 && f < 60);
17254
17260
  return C;
17255
17261
  }
17256
- function ln(i, a, e, t, r, n, s) {
17257
- const o = nr(i, a, n), u = qe(i, a, n, s), c = ss(i, a, n, s);
17262
+ function fn(i, a, e, t, r, n, s) {
17263
+ const o = nr(i, a, n), u = qe(i, a, n, s), c = as(i, a, n, s);
17258
17264
  if (o === 1) {
17259
17265
  const h = u - c, d = 100 * e / n + r, _ = t / n * h / u + 1, C = 100 * e / n * c / u;
17260
17266
  return d / _ - C;
@@ -17405,7 +17411,7 @@ class D1 extends V {
17405
17411
  return g.create(m.VALUE);
17406
17412
  if (![1, 2, 4].includes(E) || b < 0 || b > 4 || Math.floor(_) >= Math.floor(C))
17407
17413
  return g.create(m.NUM);
17408
- const R = ss(_, C, E, b);
17414
+ const R = as(_, C, E, b);
17409
17415
  return y.create(R);
17410
17416
  }
17411
17417
  }
@@ -18568,7 +18574,7 @@ class c0 extends V {
18568
18574
  return g.create(m.VALUE);
18569
18575
  if (S < 0 || w < 0 || D <= 0 || ![1, 2, 4].includes(L) || U < 0 || U > 4 || N >= M || !Or(N, M, L))
18570
18576
  return g.create(m.NUM);
18571
- const x = ln(N, M, S, w, D, L, U);
18577
+ const x = fn(N, M, S, w, D, L, U);
18572
18578
  return y.create(x);
18573
18579
  }
18574
18580
  }
@@ -18867,7 +18873,7 @@ class A0 extends V {
18867
18873
  return g.create(m.VALUE);
18868
18874
  if (d <= 0 || f >= h)
18869
18875
  return g.create(m.NUM);
18870
- const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ns(E);
18876
+ const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ss(E);
18871
18877
  if (_ > b)
18872
18878
  return g.create(m.NUM);
18873
18879
  let R = 365 * d / (360 - d * _);
@@ -18901,7 +18907,7 @@ class E0 extends V {
18901
18907
  return g.create(m.VALUE);
18902
18908
  if (d <= 0 || f >= h)
18903
18909
  return g.create(m.NUM);
18904
- const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ns(E);
18910
+ const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ss(E);
18905
18911
  if (_ > b)
18906
18912
  return g.create(m.NUM);
18907
18913
  const R = 100 * (1 - d * _ / 360);
@@ -18929,7 +18935,7 @@ class b0 extends V {
18929
18935
  return g.create(m.VALUE);
18930
18936
  if (d <= 0 || f >= h)
18931
18937
  return g.create(m.NUM);
18932
- const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ns(E);
18938
+ const _ = Math.floor(h) - Math.floor(f), E = re(f).getUTCFullYear(), b = ss(E);
18933
18939
  if (_ > b)
18934
18940
  return g.create(m.NUM);
18935
18941
  const R = (100 - d) / d * 360 / _;
@@ -19326,12 +19332,12 @@ class V0 extends V {
19326
19332
  }
19327
19333
  _getResult(e, t, r, n, s, o, u) {
19328
19334
  if (nr(e, t, o) > 1) {
19329
- let E = r || 0.01, b = ln(e, t, r, E, s, o, u), R = b - n;
19335
+ let E = r || 0.01, b = fn(e, t, r, E, s, o, u), R = b - n;
19330
19336
  for (let p = 0; p < 100 && Math.abs(R) > 1e-7; p++)
19331
- b = ln(e, t, r, 1.01 * E, s, o, u), E += -R / (b - n - R) * E * 0.01, R = ln(e, t, r, E, s, o, u) - n;
19337
+ b = fn(e, t, r, 1.01 * E, s, o, u), E += -R / (b - n - R) * E * 0.01, R = fn(e, t, r, E, s, o, u) - n;
19332
19338
  return E;
19333
19339
  }
19334
- const l = ss(e, t, o, u), f = qe(e, t, o, u), { days: h } = _e(e, t, u), d = n / 100 + l / f * r / o;
19340
+ const l = as(e, t, o, u), f = qe(e, t, o, u), { days: h } = _e(e, t, u), d = n / 100 + l / f * r / o;
19335
19341
  return (s / 100 + r / o - d) / d * o * f / h;
19336
19342
  }
19337
19343
  }
@@ -21293,7 +21299,7 @@ class xd extends V {
21293
21299
  return g.create(m.REF);
21294
21300
  const n = this._convertToDefinedName(r);
21295
21301
  if (t === 0) {
21296
- const f = Uh(n), { range: h, sheetName: d, unitId: _ } = f, C = new bn(h);
21302
+ const f = Uh(n), { range: h, sheetName: d, unitId: _ } = f, C = new yn(h);
21297
21303
  return C.setForcedUnitIdDirect(_), C.setForcedSheetName(d), this._setDefault(C);
21298
21304
  }
21299
21305
  if (Tr(n))
@@ -21305,7 +21311,7 @@ class xd extends V {
21305
21311
  const s = gr(n), { range: o, sheetName: u, unitId: c } = s;
21306
21312
  if (Number.isNaN(o.startRow) || o.endRow + 1 > 1048576 || Number.isNaN(o.startColumn) || o.endColumn + 1 > 16384)
21307
21313
  return g.create(m.REF);
21308
- const l = new bn(o);
21314
+ const l = new yn(o);
21309
21315
  return l.setForcedUnitIdDirect(c), l.setForcedSheetName(u), this._setDefault(l);
21310
21316
  }
21311
21317
  _setDefault(e) {
@@ -21611,7 +21617,7 @@ class Id extends V {
21611
21617
  }
21612
21618
  }
21613
21619
  _sort(e, t = 1) {
21614
- const r = dn();
21620
+ const r = Cn();
21615
21621
  return t === 1 ? this._sortAsc(e, r) : this._sortDesc(e, r);
21616
21622
  }
21617
21623
  _sortAsc(e, t) {
@@ -21776,7 +21782,7 @@ class Fd extends V {
21776
21782
  return n;
21777
21783
  }
21778
21784
  _sort(e, t) {
21779
- const r = dn();
21785
+ const r = Cn();
21780
21786
  return (n, s) => {
21781
21787
  let o = n[e], u = s[e], c = this._compare(o, u, t[0], r);
21782
21788
  if (c === 0 && t.length > 1) {
@@ -22431,7 +22437,7 @@ class Xd extends V {
22431
22437
  }
22432
22438
  _handleExpandObject(e, t, r, n, s, o = 0) {
22433
22439
  if ((s === 2 || s === -2) && n !== 2) {
22434
- const u = Us(s), c = js(n);
22440
+ const u = vs(s), c = Us(n);
22435
22441
  return this.binarySearchExpand(
22436
22442
  e,
22437
22443
  t,
@@ -22452,7 +22458,7 @@ class Xd extends V {
22452
22458
  }
22453
22459
  _handleSingleObject(e, t, r, n, s) {
22454
22460
  if ((s === 2 || s === -2) && n !== 2) {
22455
- const o = Us(s), u = js(n);
22461
+ const o = vs(s), u = Us(n);
22456
22462
  return this.binarySearch(e, t, r, o, u);
22457
22463
  }
22458
22464
  return n === 2 ? this.fuzzySearch(e, t, r, s !== -1) : n === -1 || n === 1 ? this.orderSearch(
@@ -22510,7 +22516,7 @@ class Zd extends V {
22510
22516
  _handleSingleObject(e, t, r, n) {
22511
22517
  let s;
22512
22518
  if ((n === 2 || n === -2) && r !== 2) {
22513
- const o = Us(n), u = js(r);
22519
+ const o = vs(n), u = Us(r);
22514
22520
  s = t.binarySearch(e, o, u);
22515
22521
  } else if (r === 2) {
22516
22522
  const o = t.compare(e, $.EQUALS);
@@ -23479,7 +23485,7 @@ class TC extends V {
23479
23485
  }
23480
23486
  if (t !== r)
23481
23487
  return g.create(m.VALUE);
23482
- const s = Kn(n);
23488
+ const s = Xn(n);
23483
23489
  return y.create(s);
23484
23490
  }
23485
23491
  }
@@ -24594,8 +24600,8 @@ class d_ extends V {
24594
24600
  if (!e.isReferenceObject() || r && !r.isReferenceObject())
24595
24601
  return g.create(m.VALUE);
24596
24602
  const n = e.toArrayValueObject();
24597
- let s = Qn(n, t);
24598
- s = Wn(s, n, t);
24603
+ let s = Wn(n, t);
24604
+ s = qn(s, n, t);
24599
24605
  const o = n.getRowCount(), u = n.getColumnCount();
24600
24606
  let c = n;
24601
24607
  if (r) {
@@ -24930,7 +24936,7 @@ class V_ extends V {
24930
24936
  return _;
24931
24937
  if (d.isString() && (d = d.convertToNumberObjectValue()), d.isError())
24932
24938
  return d;
24933
- const C = +_.getValue(), E = +d.getValue(), b = 10 ** Math.trunc(E), R = $n(C, b), p = Math.trunc(Vr(C, b) + R) / b;
24939
+ const C = +_.getValue(), E = +d.getValue(), b = 10 ** Math.trunc(E), R = Yn(C, b), p = Math.trunc(Vr(C, b) + R) / b;
24934
24940
  return y.create(p);
24935
24941
  });
24936
24942
  return n === 1 && s === 1 ? c.get(0, 0) : c;
@@ -25328,8 +25334,8 @@ class B_ extends V {
25328
25334
  return s.isReferenceObject() && (s = s.toArrayValueObject()), r && !(r != null && r.isReferenceObject()) ? g.create(m.NA) : (s = s, s.isArray() ? s.map((o) => this._handleSingleObject(n, o, r)) : this._handleSingleObject(n, s, r));
25329
25335
  }
25330
25336
  _handleSingleObject(e, t, r) {
25331
- let n = Qn(e, t);
25332
- n = Wn(n, e, t);
25337
+ let n = Wn(e, t);
25338
+ n = qn(n, e, t);
25333
25339
  let s = r ? this._createRangeReferenceObject(r, e) : e;
25334
25340
  if (!s)
25335
25341
  return g.create(m.VALUE);
@@ -25575,7 +25581,7 @@ class H_ extends V {
25575
25581
  return g.create(m.NUM);
25576
25582
  if (D === 1)
25577
25583
  return g.create(m.DIV_BY_ZERO);
25578
- const L = Math.abs(zn(S / 2, D - 1) * w / Math.sqrt(D));
25584
+ const L = Math.abs(Jn(S / 2, D - 1) * w / Math.sqrt(D));
25579
25585
  return y.create(L);
25580
25586
  });
25581
25587
  return n === 1 && s === 1 ? l.get(0, 0) : l;
@@ -25683,8 +25689,8 @@ class K_ extends V {
25683
25689
  return e.isError() || t.isError() ? g.create(m.NA) : e.isArray() ? t.isArray() ? t.mapValue((r) => this._handleSingleObject(e, r)) : this._handleSingleObject(e, t) : g.create(m.VALUE);
25684
25690
  }
25685
25691
  _handleSingleObject(e, t) {
25686
- let r = Qn(e, t);
25687
- r = Wn(r, e, t);
25692
+ let r = Wn(e, t);
25693
+ r = qn(r, e, t);
25688
25694
  const n = e.pick(r);
25689
25695
  return this._countA(n);
25690
25696
  }
@@ -26076,7 +26082,7 @@ class aA extends V {
26076
26082
  const [s] = n, o = +s.getValue();
26077
26083
  if (o === 0 || o < 0 && o % 1 === 0)
26078
26084
  return g.create(m.NUM);
26079
- const u = cn(o);
26085
+ const u = ln(o);
26080
26086
  return Number.isNaN(u) || !Number.isFinite(u) ? g.create(m.NUM) : y.create(u);
26081
26087
  }
26082
26088
  }
@@ -26100,7 +26106,7 @@ class vi extends V {
26100
26106
  const [s] = n, o = +s.getValue();
26101
26107
  if (o <= 0)
26102
26108
  return g.create(m.NUM);
26103
- const u = lt(o);
26109
+ const u = ct(o);
26104
26110
  return Math.abs(u) < 1e-15 ? y.create(0) : y.create(u);
26105
26111
  }
26106
26112
  }
@@ -26177,7 +26183,7 @@ class uA extends V {
26177
26183
  A(this, "maxParams", 4);
26178
26184
  }
26179
26185
  calculate(e, t, r, n) {
26180
- const { isError: s, errorObject: o } = Jn(e, t, r);
26186
+ const { isError: s, errorObject: o } = es(e, t, r);
26181
26187
  if (s)
26182
26188
  return o;
26183
26189
  const u = dt(e);
@@ -26199,7 +26205,7 @@ class uA extends V {
26199
26205
  return e.length === 1 && t.length > 1 || e[0].length === 1 && t[0].length > 1 ? e.length === 1 && t.length > 1 && (n ? t.length + 1 : t.length) > e[0].length || e[0].length === 1 && t[0].length > 1 && (n ? t[0].length + 1 : t[0].length) > e.length ? g.create(m.NA) : this._getResultByMultipleVariables(e, t, r, n) : this._getResultBySimpleVariables(e, t, r, n);
26200
26206
  }
26201
26207
  _getResultByMultipleVariables(e, t, r, n) {
26202
- const s = e.length === 1 && e[0].length > 1, o = rs(e, t, r, n, !0);
26208
+ const s = e.length === 1 && e[0].length > 1, o = ns(e, t, r, n, !0);
26203
26209
  if (o instanceof g)
26204
26210
  return o;
26205
26211
  const { coefficients: u, newX: c } = o, l = u[0].length, f = u[0][l - 1];
@@ -26211,14 +26217,14 @@ class uA extends V {
26211
26217
  _ *= u[0][l - 2 - C] ** c[d][C];
26212
26218
  h[d].push(_);
26213
26219
  }
26214
- return s && (h = mt(h)), q.createByArray(h);
26220
+ return s && (h = ht(h)), q.createByArray(h);
26215
26221
  }
26216
26222
  _getResultBySimpleVariables(e, t, r, n) {
26217
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = ts(o, s, n, !0), l = r.map((f) => f.map((h) => c * u ** h));
26223
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = rs(o, s, n, !0), l = r.map((f) => f.map((h) => c * u ** h));
26218
26224
  return q.createByArray(l);
26219
26225
  }
26220
26226
  _getKnownXsValues(e, t) {
26221
- return !t || t.isNull() ? es(e.length, e[0].length) : dt(t);
26227
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
26222
26228
  }
26223
26229
  _getNewXsValues(e, t) {
26224
26230
  return !t || t.isNull() ? e : dt(t);
@@ -26438,7 +26444,7 @@ class gA extends V {
26438
26444
  A(this, "maxParams", 4);
26439
26445
  }
26440
26446
  calculate(e, t, r, n) {
26441
- const { isError: s, errorObject: o } = Jn(e, t);
26447
+ const { isError: s, errorObject: o } = es(e, t);
26442
26448
  if (s)
26443
26449
  return o;
26444
26450
  const u = dt(e);
@@ -26461,7 +26467,7 @@ class gA extends V {
26461
26467
  return e.length === 1 && t.length > 1 || e[0].length === 1 && t[0].length > 1 ? e.length === 1 && t.length > 1 && (r ? t.length + 1 : t.length) > e[0].length || e[0].length === 1 && t[0].length > 1 && (r ? t[0].length + 1 : t[0].length) > e.length ? g.create(m.NA) : this._getResultByMultipleVariables(e, t, r, n) : this._getResultBySimpleVariables(e, t, r, n);
26462
26468
  }
26463
26469
  _getResultByMultipleVariables(e, t, r, n) {
26464
- const s = rs(e, t, t, r, !1);
26470
+ const s = ns(e, t, t, r, !1);
26465
26471
  if (s instanceof g)
26466
26472
  return s;
26467
26473
  const { coefficients: o, X: u, XTXInverse: c } = s;
@@ -26508,7 +26514,7 @@ class gA extends V {
26508
26514
  return q.createByArray(l);
26509
26515
  }
26510
26516
  _getResultBySimpleVariables(e, t, r, n) {
26511
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = ts(o, s, r, !1);
26517
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = rs(o, s, r, !1);
26512
26518
  if (Number.isNaN(u))
26513
26519
  return g.create(m.NA);
26514
26520
  let l = [];
@@ -26548,7 +26554,7 @@ class gA extends V {
26548
26554
  return q.createByArray(l);
26549
26555
  }
26550
26556
  _getKnownXsValues(e, t) {
26551
- return !t || t.isNull() ? es(e.length, e[0].length) : dt(t);
26557
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
26552
26558
  }
26553
26559
  }
26554
26560
  class dA extends V {
@@ -26558,7 +26564,7 @@ class dA extends V {
26558
26564
  A(this, "maxParams", 4);
26559
26565
  }
26560
26566
  calculate(e, t, r, n) {
26561
- const { isError: s, errorObject: o } = Jn(e, t);
26567
+ const { isError: s, errorObject: o } = es(e, t);
26562
26568
  if (s)
26563
26569
  return o;
26564
26570
  const u = dt(e);
@@ -26582,7 +26588,7 @@ class dA extends V {
26582
26588
  }
26583
26589
  // eslint-disable-next-line max-lines-per-function
26584
26590
  _getResultByMultipleVariables(e, t, r, n) {
26585
- const s = rs(e, t, t, r, !0);
26591
+ const s = ns(e, t, t, r, !0);
26586
26592
  if (s instanceof g)
26587
26593
  return s;
26588
26594
  const { coefficients: o, Y: u, X: c, XTXInverse: l } = s;
@@ -26630,7 +26636,7 @@ class dA extends V {
26630
26636
  return q.createByArray(f);
26631
26637
  }
26632
26638
  _getResultBySimpleVariables(e, t, r, n) {
26633
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c, Y: l } = ts(o, s, r, !0);
26639
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c, Y: l } = rs(o, s, r, !0);
26634
26640
  if (Number.isNaN(u))
26635
26641
  return g.create(m.NA);
26636
26642
  let f = [];
@@ -26668,7 +26674,7 @@ class dA extends V {
26668
26674
  return q.createByArray(f);
26669
26675
  }
26670
26676
  _getKnownXsValues(e, t) {
26671
- return !t || t.isNull() ? es(e.length, e[0].length) : dt(t);
26677
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
26672
26678
  }
26673
26679
  }
26674
26680
  class CA extends V {
@@ -26729,7 +26735,7 @@ class _A extends V {
26729
26735
  const f = 1 - l, h = r.length, d = r.reduce((b, R) => b + R, 0) / h, _ = r.reduce((b, R) => b + (R - d) ** 2, 0) / (h - 1), C = Math.sqrt(_);
26730
26736
  if (C <= 0)
26731
26737
  return g.create(m.NUM);
26732
- const E = Math.abs(zn(f / 2, h - 1) * C / Math.sqrt(h));
26738
+ const E = Math.abs(Jn(f / 2, h - 1) * C / Math.sqrt(h));
26733
26739
  return y.create(E);
26734
26740
  }
26735
26741
  _getRangeValues(e) {
@@ -28029,7 +28035,7 @@ class XA extends V {
28029
28035
  const [o, u] = s, c = +o.getValue(), l = Math.floor(+u.getValue());
28030
28036
  if (c <= 0 || c > 1 || l < 1 || l > 10 ** 10)
28031
28037
  return g.create(m.NUM);
28032
- const f = zn(c, l);
28038
+ const f = Jn(c, l);
28033
28039
  return Number.isNaN(f) || !Number.isFinite(f) ? g.create(m.NUM) : y.create(f);
28034
28040
  }
28035
28041
  }
@@ -28040,7 +28046,7 @@ class ZA extends V {
28040
28046
  A(this, "maxParams", 4);
28041
28047
  }
28042
28048
  calculate(e, t, r, n) {
28043
- const { isError: s, errorObject: o } = Jn(e, t, r);
28049
+ const { isError: s, errorObject: o } = es(e, t, r);
28044
28050
  if (s)
28045
28051
  return o;
28046
28052
  const u = dt(e);
@@ -28062,7 +28068,7 @@ class ZA extends V {
28062
28068
  return e.length === 1 && t.length > 1 || e[0].length === 1 && t[0].length > 1 ? e.length === 1 && t.length > 1 && (n ? t.length + 1 : t.length) > e[0].length || e[0].length === 1 && t[0].length > 1 && (n ? t[0].length + 1 : t[0].length) > e.length ? g.create(m.NA) : this._getResultByMultipleVariables(e, t, r, n) : this._getResultBySimpleVariables(e, t, r, n);
28063
28069
  }
28064
28070
  _getResultByMultipleVariables(e, t, r, n) {
28065
- const s = e.length === 1 && e[0].length > 1, o = rs(e, t, r, n, !1);
28071
+ const s = e.length === 1 && e[0].length > 1, o = ns(e, t, r, n, !1);
28066
28072
  if (o instanceof g)
28067
28073
  return o;
28068
28074
  const { coefficients: u, newX: c } = o, l = u[0].length, f = u[0][l - 1];
@@ -28074,17 +28080,17 @@ class ZA extends V {
28074
28080
  _ += u[0][l - 2 - C] * c[d][C];
28075
28081
  h[d].push(_);
28076
28082
  }
28077
- return s && (h = mt(h)), q.createByArray(h);
28083
+ return s && (h = ht(h)), q.createByArray(h);
28078
28084
  }
28079
28085
  _getResultBySimpleVariables(e, t, r, n) {
28080
- const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = ts(o, s, n, !1);
28086
+ const s = e.flat(), o = t.flat(), { slope: u, intercept: c } = rs(o, s, n, !1);
28081
28087
  if (Number.isNaN(u))
28082
28088
  return g.create(m.NA);
28083
28089
  const l = r.map((f) => f.map((h) => u * h + c));
28084
28090
  return q.createByArray(l);
28085
28091
  }
28086
28092
  _getKnownXsValues(e, t) {
28087
- return !t || t.isNull() ? es(e.length, e[0].length) : dt(t);
28093
+ return !t || t.isNull() ? ts(e.length, e[0].length) : dt(t);
28088
28094
  }
28089
28095
  _getNewXsValues(e, t) {
28090
28096
  return !t || t.isNull() ? e : dt(t);
@@ -30642,7 +30648,7 @@ let na = class extends Oe {
30642
30648
  super();
30643
30649
  A(this, "_computingCompleted$", new oc((a) => {
30644
30650
  this._commandService.onCommandExecuted((e) => {
30645
- if (e.id !== gn.id) return;
30651
+ if (e.id !== dn.id) return;
30646
30652
  const t = e.params;
30647
30653
  if (t.stageInfo)
30648
30654
  return a.next(
@@ -30667,7 +30673,7 @@ var db = Object.getOwnPropertyDescriptor, Cb = (i, a, e, t) => {
30667
30673
  (s = i[n]) && (r = s(r) || r);
30668
30674
  return r;
30669
30675
  }, Jr = (i, a) => (e, t) => a(e, t, i);
30670
- let Pn = class extends Oe {
30676
+ let xn = class extends Oe {
30671
30677
  constructor(i, a, e, t) {
30672
30678
  super(), this._commandService = i, this._functionService = a, this._configService = e, this._dataSyncPrimaryController = t, this._initialize();
30673
30679
  }
@@ -30677,10 +30683,10 @@ let Pn = class extends Oe {
30677
30683
  _registerCommands() {
30678
30684
  [
30679
30685
  io,
30680
- Vs,
30686
+ Ns,
30681
30687
  no,
30682
30688
  so,
30683
- gn,
30689
+ dn,
30684
30690
  ao,
30685
30691
  ca,
30686
30692
  ro,
@@ -30723,18 +30729,18 @@ let Pn = class extends Oe {
30723
30729
  this._functionService.registerExecutors(...a);
30724
30730
  }
30725
30731
  };
30726
- Pn = Cb([
30732
+ xn = Cb([
30727
30733
  Jr(0, ar),
30728
30734
  Jr(1, Yt),
30729
30735
  Jr(2, ia),
30730
30736
  Jr(3, rc(lc))
30731
- ], Pn);
30737
+ ], xn);
30732
30738
  var _b = Object.getOwnPropertyDescriptor, Ab = (i, a, e, t) => {
30733
30739
  for (var r = t > 1 ? void 0 : t ? _b(a, e) : a, n = i.length - 1, s; n >= 0; n--)
30734
30740
  (s = i[n]) && (r = s(r) || r);
30735
30741
  return r;
30736
30742
  }, en = (i, a) => (e, t) => a(e, t, i);
30737
- let xn = class extends Oe {
30743
+ let jn = class extends Oe {
30738
30744
  constructor(i, a, e) {
30739
30745
  super(), this._commandService = i, this._dependencyManagerService = a, this._featureCalculationManagerService = e, this._initialize();
30740
30746
  }
@@ -30810,18 +30816,18 @@ let xn = class extends Oe {
30810
30816
  this._dependencyManagerService.removeFormulaDependencyByDefinedName(e, t);
30811
30817
  }
30812
30818
  };
30813
- xn = Ab([
30819
+ jn = Ab([
30814
30820
  en(0, ar),
30815
30821
  en(1, Ur),
30816
- en(1, qn),
30822
+ en(1, Kn),
30817
30823
  en(2, Ur)
30818
- ], xn);
30824
+ ], jn);
30819
30825
  var Eb = Object.getOwnPropertyDescriptor, bb = (i, a, e, t) => {
30820
30826
  for (var r = t > 1 ? void 0 : t ? Eb(a, e) : a, n = i.length - 1, s; n >= 0; n--)
30821
30827
  (s = i[n]) && (r = s(r) || r);
30822
30828
  return r;
30823
30829
  }, ki = (i, a) => (e, t) => a(e, t, i);
30824
- let jn = class extends Oe {
30830
+ let Un = class extends Oe {
30825
30831
  constructor(i, a) {
30826
30832
  super(), this._commandService = i, this._featureCalculationManagerService = a, this._initialize();
30827
30833
  }
@@ -30848,16 +30854,16 @@ let jn = class extends Oe {
30848
30854
  );
30849
30855
  }
30850
30856
  };
30851
- jn = bb([
30857
+ Un = bb([
30852
30858
  ki(0, ar),
30853
30859
  ki(1, Ur)
30854
- ], jn);
30860
+ ], Un);
30855
30861
  var yb = Object.getOwnPropertyDescriptor, Rb = (i, a, e, t) => {
30856
30862
  for (var r = t > 1 ? void 0 : t ? yb(a, e) : a, n = i.length - 1, s; n >= 0; n--)
30857
30863
  (s = i[n]) && (r = s(r) || r);
30858
30864
  return r;
30859
- }, bs = (i, a) => (e, t) => a(e, t, i);
30860
- let Un = class extends Oe {
30865
+ }, ys = (i, a) => (e, t) => a(e, t, i);
30866
+ let vn = class extends Oe {
30861
30867
  constructor(i, a, e) {
30862
30868
  super(), this._commandService = i, this._otherFormulaManagerService = a, this._dependencyManagerService = e, this._initialize();
30863
30869
  }
@@ -30886,11 +30892,11 @@ let Un = class extends Oe {
30886
30892
  );
30887
30893
  }
30888
30894
  };
30889
- Un = Rb([
30890
- bs(0, ar),
30891
- bs(1, Oa),
30892
- bs(2, qn)
30893
- ], Un);
30895
+ vn = Rb([
30896
+ ys(0, ar),
30897
+ ys(1, Oa),
30898
+ ys(2, Kn)
30899
+ ], vn);
30894
30900
  class pb extends Oe {
30895
30901
  constructor() {
30896
30902
  super(...arguments);
@@ -30920,13 +30926,13 @@ class pb extends Oe {
30920
30926
  this._tableOptionMap.set(e, t);
30921
30927
  }
30922
30928
  }
30923
- const $u = ft("univer.formula.super-table.service");
30929
+ const $u = lt("univer.formula.super-table.service");
30924
30930
  var Vb = Object.getOwnPropertyDescriptor, Nb = (i, a, e, t) => {
30925
30931
  for (var r = t > 1 ? void 0 : t ? Vb(a, e) : a, n = i.length - 1, s; n >= 0; n--)
30926
30932
  (s = i[n]) && (r = s(r) || r);
30927
30933
  return r;
30928
30934
  }, $i = (i, a) => (e, t) => a(e, t, i);
30929
- let vn = class extends Oe {
30935
+ let Tn = class extends Oe {
30930
30936
  constructor(i, a) {
30931
30937
  super(), this._commandService = i, this._superTableService = a, this._initialize();
30932
30938
  }
@@ -30959,10 +30965,10 @@ let vn = class extends Oe {
30959
30965
  );
30960
30966
  }
30961
30967
  };
30962
- vn = Nb([
30968
+ Tn = Nb([
30963
30969
  $i(0, ar),
30964
30970
  $i(1, $u)
30965
- ], vn);
30971
+ ], Tn);
30966
30972
  class Ob extends Oe {
30967
30973
  constructor() {
30968
30974
  super(...arguments);
@@ -30987,7 +30993,7 @@ class Ob extends Oe {
30987
30993
  return this._dirtyConversionMap;
30988
30994
  }
30989
30995
  }
30990
- const Mb = ft(
30996
+ const Mb = lt(
30991
30997
  "univer.formula.active-dirty-manager.service"
30992
30998
  );
30993
30999
  var Sb = Object.getOwnPropertyDescriptor, wb = (i, a, e, t) => {
@@ -30996,8 +31002,8 @@ var Sb = Object.getOwnPropertyDescriptor, wb = (i, a, e, t) => {
30996
31002
  return r;
30997
31003
  }, Yi = (i, a) => (e, t) => a(e, t, i);
30998
31004
  const Db = "UNIVER_ENGINE_FORMULA_PLUGIN";
30999
- var ys;
31000
- let Hi = (ys = class extends nc {
31005
+ var Rs;
31006
+ let Hi = (Rs = class extends nc {
31001
31007
  constructor(i = fi, a, e) {
31002
31008
  super(), this._config = i, this._injector = a, this._configService = e;
31003
31009
  const { ...t } = sc(
@@ -31012,19 +31018,19 @@ let Hi = (ys = class extends nc {
31012
31018
  }
31013
31019
  onReady() {
31014
31020
  var i;
31015
- as(this._injector, [
31016
- [Pn],
31017
- [vn]
31018
- ]), (i = this._config) != null && i.notExecuteFormula || as(this._injector, [
31021
+ is(this._injector, [
31022
+ [xn],
31023
+ [Tn]
31024
+ ]), (i = this._config) != null && i.notExecuteFormula || is(this._injector, [
31025
+ [vn],
31019
31026
  [Un],
31020
31027
  [jn],
31021
- [xn],
31022
- [wn]
31028
+ [Dn]
31023
31029
  ]);
31024
31030
  }
31025
31031
  onRendered() {
31026
31032
  var i;
31027
- (i = this._config) != null && i.notExecuteFormula || as(this._injector, [
31033
+ (i = this._config) != null && i.notExecuteFormula || is(this._injector, [
31028
31034
  [Ks],
31029
31035
  [Ws]
31030
31036
  ]);
@@ -31033,7 +31039,7 @@ let Hi = (ys = class extends nc {
31033
31039
  const i = !this._config.notExecuteFormula, a = [
31034
31040
  // Services
31035
31041
  [Yt, { useClass: Gf }],
31036
- [pr, { useClass: Ss }],
31042
+ [pr, { useClass: ws }],
31037
31043
  [Mb, { useClass: Ob }],
31038
31044
  [$u, { useClass: pb }],
31039
31045
  [ku],
@@ -31042,35 +31048,35 @@ let Hi = (ys = class extends nc {
31042
31048
  // Engine
31043
31049
  [ga],
31044
31050
  //Controllers
31045
- [Pn],
31046
- [vn],
31051
+ [xn],
31052
+ [Tn],
31047
31053
  [na]
31048
31054
  ];
31049
31055
  i && a.push(
31050
31056
  // Services
31051
31057
  [Oa, { useClass: Nh }],
31052
31058
  [Ot, { useClass: Ys }],
31053
- [Ft, { useClass: Ls }],
31059
+ [Ft, { useClass: Ps }],
31054
31060
  [Ur, { useClass: Vh }],
31055
31061
  //Controller
31056
- [wn],
31057
- [Un],
31058
- [xn],
31062
+ [Dn],
31063
+ [vn],
31059
31064
  [jn],
31065
+ [Un],
31060
31066
  // Calculation engine
31061
31067
  [_r],
31062
31068
  [jr],
31063
31069
  [dr],
31064
31070
  // AstNode factory
31065
31071
  [No],
31066
- [pn],
31067
31072
  [Vn],
31068
- [Do],
31069
31073
  [Nn],
31070
- [Rn],
31074
+ [Do],
31071
31075
  [On],
31076
+ [pn],
31072
31077
  [Mn],
31073
31078
  [Sn],
31079
+ [wn],
31074
31080
  [Lo]
31075
31081
  ), a.forEach((e) => this._injector.add(e));
31076
31082
  }
@@ -31078,11 +31084,11 @@ let Hi = (ys = class extends nc {
31078
31084
  var i;
31079
31085
  (i = this._config) != null && i.notExecuteFormula || [
31080
31086
  [Ks, { useClass: Xs }],
31081
- [qn, { useClass: ph }],
31087
+ [Kn, { useClass: ph }],
31082
31088
  [Ws, { useClass: qs }]
31083
31089
  ].forEach((e) => this._injector.add(e));
31084
31090
  }
31085
- }, A(ys, "pluginName", Db), ys);
31091
+ }, A(Rs, "pluginName", Db), Rs);
31086
31092
  Hi = wb([
31087
31093
  Yi(1, Ve(Gi)),
31088
31094
  Yi(2, ia)
@@ -31096,15 +31102,15 @@ export {
31096
31102
  Hb as AsyncCustomFunction,
31097
31103
  Uf as AsyncObject,
31098
31104
  V as BaseFunction,
31099
- Gn as BaseReferenceObject,
31105
+ Qn as BaseReferenceObject,
31100
31106
  kt as BaseValueObject,
31101
31107
  er as BooleanValue,
31102
31108
  T as BooleanValueObject,
31103
- wn as CalculateController,
31109
+ Dn as CalculateController,
31104
31110
  Xs as CalculateFormulaService,
31105
31111
  Rm as CustomFunction,
31106
31112
  Ph as DEFAULT_INTERVAL_COUNT,
31107
- Ss as DefinedNamesService,
31113
+ ws as DefinedNamesService,
31108
31114
  Rh as DependencyManagerBaseService,
31109
31115
  ph as DependencyManagerService,
31110
31116
  $b as ENGINE_FORMULA_CYCLE_REFERENCE_COUNT,
@@ -31128,23 +31134,23 @@ export {
31128
31134
  lb as FUNCTION_NAMES_UNIVER,
31129
31135
  Fu as FUNCTION_NAMES_WEB,
31130
31136
  Vh as FeatureCalculationManagerService,
31131
- Ls as FormulaCurrentConfigService,
31137
+ Ps as FormulaCurrentConfigService,
31132
31138
  Pr as FormulaDataModel,
31133
31139
  qs as FormulaDependencyGenerator,
31134
- Cs as FormulaDependencyTree,
31140
+ _s as FormulaDependencyTree,
31135
31141
  Qs as FormulaDependencyTreeType,
31136
31142
  Mi as FormulaDependencyTreeVirtual,
31137
31143
  Xe as FormulaExecuteStageType,
31138
31144
  wr as FormulaExecutedStateType,
31139
31145
  Ys as FormulaRuntimeService,
31140
- pn as FunctionNodeFactory,
31146
+ Vn as FunctionNodeFactory,
31141
31147
  Gf as FunctionService,
31142
31148
  mc as FunctionType,
31143
31149
  ku as GlobalComputingStatusService,
31144
31150
  Mb as IActiveDirtyManagerService,
31145
31151
  Ks as ICalculateFormulaService,
31146
31152
  pr as IDefinedNamesService,
31147
- qn as IDependencyManagerService,
31153
+ Kn as IDependencyManagerService,
31148
31154
  Ur as IFeatureCalculationManagerService,
31149
31155
  Ft as IFormulaCurrentConfigService,
31150
31156
  Ws as IFormulaDependencyGenerator,
@@ -31153,7 +31159,7 @@ export {
31153
31159
  Oa as IOtherFormulaManagerService,
31154
31160
  $u as ISuperTableService,
31155
31161
  _r as Interpreter,
31156
- Vn as LambdaNodeFactory,
31162
+ Nn as LambdaNodeFactory,
31157
31163
  Do as LambdaParameterNodeFactory,
31158
31164
  Na as LambdaValueObjectObject,
31159
31165
  dr as Lexer,
@@ -31161,21 +31167,21 @@ export {
31161
31167
  ga as LexerTreeBuilder,
31162
31168
  ie as NullValueObject,
31163
31169
  y as NumberValueObject,
31164
- Nn as OperatorNodeFactory,
31170
+ On as OperatorNodeFactory,
31165
31171
  Nh as OtherFormulaManagerService,
31166
- Rn as PrefixNodeFactory,
31167
- bn as RangeReferenceObject,
31168
- On as ReferenceNodeFactory,
31172
+ pn as PrefixNodeFactory,
31173
+ yn as RangeReferenceObject,
31174
+ Mn as ReferenceNodeFactory,
31169
31175
  jc as RegisterFunctionMutation,
31170
31176
  ro as RemoveDefinedNameMutation,
31171
31177
  fa as RemoveFeatureCalculationMutation,
31172
31178
  ma as RemoveOtherFormulaMutation,
31173
31179
  qc as RemoveSuperTableMutation,
31174
- Vs as SetArrayFormulaDataMutation,
31180
+ Ns as SetArrayFormulaDataMutation,
31175
31181
  ca as SetDefinedNameMutation,
31176
31182
  kb as SetDefinedNameMutationFactory,
31177
31183
  la as SetFeatureCalculationMutation,
31178
- gn as SetFormulaCalculationNotificationMutation,
31184
+ dn as SetFormulaCalculationNotificationMutation,
31179
31185
  ao as SetFormulaCalculationResultMutation,
31180
31186
  no as SetFormulaCalculationStartMutation,
31181
31187
  so as SetFormulaCalculationStopMutation,
@@ -31184,16 +31190,16 @@ export {
31184
31190
  Wc as SetSuperTableMutation,
31185
31191
  oo as SetSuperTableOptionMutation,
31186
31192
  j as StringValueObject,
31187
- Mn as SuffixNodeFactory,
31193
+ Sn as SuffixNodeFactory,
31188
31194
  pb as SuperTableService,
31189
- Sn as UnionNodeFactory,
31195
+ wn as UnionNodeFactory,
31190
31196
  Hi as UniverFormulaEnginePlugin,
31191
31197
  Lo as ValueNodeFactory,
31192
31198
  Vt as ValueObjectFactory,
31193
31199
  $ as compareToken,
31194
31200
  yc as convertUnitDataToRuntime,
31195
31201
  Uh as deserializeRangeForR1C1,
31196
- mn as deserializeRangeWithSheet,
31202
+ gn as deserializeRangeWithSheet,
31197
31203
  gr as deserializeRangeWithSheetWithCache,
31198
31204
  Ih as functionArray,
31199
31205
  Em as functionCompatibility,
@@ -31234,10 +31240,10 @@ export {
31234
31240
  X as operatorToken,
31235
31241
  $e as sequenceNodeType,
31236
31242
  hr as serializeRange,
31237
- Ns as serializeRangeToRefString,
31243
+ Os as serializeRangeToRefString,
31238
31244
  Tc as serializeRangeWithSheet,
31239
31245
  Bc as serializeRangeWithSpreadsheet,
31240
- os as singleReferenceToGrid,
31246
+ us as singleReferenceToGrid,
31241
31247
  yi as strip,
31242
31248
  Mf as stripErrorMargin
31243
31249
  };