@univerjs/engine-formula 0.10.14 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +374 -361
- package/lib/index.js +374 -361
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +14 -6
- package/lib/types/engine/analysis/lexer.d.ts +1 -5
- package/lib/types/engine/ast-node/base-ast-node.d.ts +1 -2
- package/lib/types/engine/utils/reference.d.ts +12 -0
- package/lib/types/index.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function bc(i, a, e, t, r) {
|
|
|
18
18
|
}
|
|
19
19
|
var m = /* @__PURE__ */ ((i) => (i.DIV_BY_ZERO = "#DIV/0!", i.NAME = "#NAME?", i.VALUE = "#VALUE!", i.NUM = "#NUM!", i.NA = "#N/A", i.CYCLE = "#CYCLE!", i.REF = "#REF!", i.SPILL = "#SPILL!", i.CALC = "#CALC!", i.ERROR = "#ERROR!", i.CONNECT = "#GETTING_DATA", i.NULL = "#NULL!", i))(m || {});
|
|
20
20
|
const or = new Set(Object.values(m)), za = [...new Set(Object.values(m).map((i) => i.length))];
|
|
21
|
-
var yc = /* @__PURE__ */ ((i) => (i[i.Financial = 0] = "Financial", i[i.Date = 1] = "Date", i[i.Math = 2] = "Math", i[i.Statistical = 3] = "Statistical", i[i.Lookup = 4] = "Lookup", i[i.Database = 5] = "Database", i[i.Text = 6] = "Text", i[i.Logical = 7] = "Logical", i[i.Information = 8] = "Information", i[i.Engineering = 9] = "Engineering", i[i.Cube = 10] = "Cube", i[i.Compatibility = 11] = "Compatibility", i[i.Web = 12] = "Web", i[i.Array = 13] = "Array", i[i.Univer = 14] = "Univer", i[i.User = 15] = "User", i[i.DefinedName = 16] = "DefinedName", i))(yc || {}), X = /* @__PURE__ */ ((i) => (i.PLUS = "+", i.MINUS = "-", i.MULTIPLY = "*", i.DIVIDED = "/", i.CONCATENATE = "&", i.POWER = "^", i.EQUALS = "=", i.NOT_EQUAL = "<>", i.GREATER_THAN = ">", i.GREATER_THAN_OR_EQUAL = ">=", i.LESS_THAN = "<", i.LESS_THAN_OR_EQUAL = "<=", i))(X || {}),
|
|
21
|
+
var yc = /* @__PURE__ */ ((i) => (i[i.Financial = 0] = "Financial", i[i.Date = 1] = "Date", i[i.Math = 2] = "Math", i[i.Statistical = 3] = "Statistical", i[i.Lookup = 4] = "Lookup", i[i.Database = 5] = "Database", i[i.Text = 6] = "Text", i[i.Logical = 7] = "Logical", i[i.Information = 8] = "Information", i[i.Engineering = 9] = "Engineering", i[i.Cube = 10] = "Cube", i[i.Compatibility = 11] = "Compatibility", i[i.Web = 12] = "Web", i[i.Array = 13] = "Array", i[i.Univer = 14] = "Univer", i[i.User = 15] = "User", i[i.DefinedName = 16] = "DefinedName", i))(yc || {}), X = /* @__PURE__ */ ((i) => (i.PLUS = "+", i.MINUS = "-", i.MULTIPLY = "*", i.DIVIDED = "/", i.CONCATENATE = "&", i.POWER = "^", i.EQUALS = "=", i.NOT_EQUAL = "<>", i.GREATER_THAN = ">", i.GREATER_THAN_OR_EQUAL = ">=", i.LESS_THAN = "<", i.LESS_THAN_OR_EQUAL = "<=", i))(X || {}), F = /* @__PURE__ */ ((i) => (i.EQUALS = "=", i.NOT_EQUAL = "<>", i.GREATER_THAN = ">", i.GREATER_THAN_OR_EQUAL = ">=", i.LESS_THAN = "<", i.LESS_THAN_OR_EQUAL = "<=", i))(F || {});
|
|
22
22
|
const sn = /* @__PURE__ */ new Map([
|
|
23
23
|
["<>", 4],
|
|
24
24
|
["<", 4],
|
|
@@ -50,7 +50,7 @@ const ls = /* @__PURE__ */ new Set([
|
|
|
50
50
|
]);
|
|
51
51
|
var Me = /* @__PURE__ */ ((i) => (i.AT = "@", i.MINUS = "-", i.PLUS = "+", i))(Me || {});
|
|
52
52
|
const pc = " ", zi = [
|
|
53
|
-
...Object.values(
|
|
53
|
+
...Object.values(F),
|
|
54
54
|
...Object.values(X),
|
|
55
55
|
...Object.values(K),
|
|
56
56
|
...Object.values(tt),
|
|
@@ -971,31 +971,98 @@ class ga extends Ne {
|
|
|
971
971
|
nodeMakerTest(e) {
|
|
972
972
|
return this._nodeMaker(e);
|
|
973
973
|
}
|
|
974
|
-
treeBuilder(e, t = !0, r
|
|
974
|
+
treeBuilder(e, t = !0, r) {
|
|
975
|
+
var f;
|
|
975
976
|
if (t === !0) {
|
|
976
|
-
const h = hs.get(e), d =
|
|
977
|
+
const h = hs.get(e), d = r && ((f = this._simpleCheckDefinedName) == null ? void 0 : f.call(this, e, r));
|
|
977
978
|
if (h && !d)
|
|
978
979
|
return h;
|
|
979
980
|
}
|
|
980
981
|
this._resetCurrentLexerNode(), this._currentLexerNode.setToken(Tt);
|
|
981
|
-
const
|
|
982
|
-
let
|
|
983
|
-
if (
|
|
984
|
-
return
|
|
985
|
-
let
|
|
982
|
+
const n = [];
|
|
983
|
+
let s = this._nodeMaker(e, n);
|
|
984
|
+
if (s === m.VALUE || n.length === 0)
|
|
985
|
+
return s;
|
|
986
|
+
let o = !1, u = "", c = [];
|
|
986
987
|
if (r) {
|
|
987
|
-
const { hasDefinedName: h, sequenceString: d, definedNames: _ } = r
|
|
988
|
-
|
|
988
|
+
const { hasDefinedName: h, sequenceString: d, definedNames: _ } = this._handleDefinedName(n, r);
|
|
989
|
+
o = h, u = d, c = _;
|
|
989
990
|
}
|
|
990
|
-
if (
|
|
991
|
-
return
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
991
|
+
if (o && (this._resetCurrentLexerNode(), this._currentLexerNode.setToken(Tt), s = this._nodeMaker(`=${u}`), s === m.VALUE))
|
|
992
|
+
return s;
|
|
993
|
+
const l = this._getTopNode(this._currentLexerNode);
|
|
994
|
+
if (l && (this._currentLexerNode = l), t) {
|
|
994
995
|
if (!this._suffixExpressionHandler(this._currentLexerNode))
|
|
995
996
|
return m.VALUE;
|
|
996
997
|
hs.set(e, this._currentLexerNode);
|
|
997
998
|
}
|
|
998
|
-
return
|
|
999
|
+
return o && this._currentLexerNode.setDefinedNames(c), this._currentLexerNode;
|
|
1000
|
+
}
|
|
1001
|
+
_handleDefinedName(e, t) {
|
|
1002
|
+
const { unitId: r, getValueByName: n } = t;
|
|
1003
|
+
if (r == null)
|
|
1004
|
+
return {
|
|
1005
|
+
sequenceString: "",
|
|
1006
|
+
hasDefinedName: !1,
|
|
1007
|
+
definedNames: []
|
|
1008
|
+
};
|
|
1009
|
+
const s = this.getSequenceNode(e);
|
|
1010
|
+
let o = "", u = !1;
|
|
1011
|
+
const c = [];
|
|
1012
|
+
for (let l = 0, f = s.length; l < f; l++) {
|
|
1013
|
+
const h = s[l];
|
|
1014
|
+
if (typeof h == "string") {
|
|
1015
|
+
o += h;
|
|
1016
|
+
continue;
|
|
1017
|
+
}
|
|
1018
|
+
const { nodeType: d, token: _ } = h;
|
|
1019
|
+
if (d === $e.REFERENCE || d === $e.FUNCTION) {
|
|
1020
|
+
const C = n(r, _);
|
|
1021
|
+
if (C) {
|
|
1022
|
+
const E = C.formulaOrRefString, b = this._handleNestedDefinedName(E, t);
|
|
1023
|
+
if (b == null || typeof b != "object")
|
|
1024
|
+
o += b || m.NAME, u = !0, c.push(_);
|
|
1025
|
+
else if (typeof b == "object") {
|
|
1026
|
+
const { sequenceString: R, definedNames: p } = b;
|
|
1027
|
+
o += R, p.forEach((N) => {
|
|
1028
|
+
c.push(N);
|
|
1029
|
+
}), u = !0;
|
|
1030
|
+
}
|
|
1031
|
+
} else this._checkDefinedNameDirty(_, t) ? (o += m.NAME, u = !0, c.push(_)) : o += _;
|
|
1032
|
+
} else
|
|
1033
|
+
o += _;
|
|
1034
|
+
}
|
|
1035
|
+
return {
|
|
1036
|
+
sequenceString: o,
|
|
1037
|
+
hasDefinedName: u,
|
|
1038
|
+
definedNames: c
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
_handleNestedDefinedName(e, t) {
|
|
1042
|
+
const r = [], n = this._nodeMaker(e, r);
|
|
1043
|
+
return n === m.VALUE || r.length === 0 ? n : this._handleDefinedName(r, t);
|
|
1044
|
+
}
|
|
1045
|
+
_simpleCheckDefinedName(e, t) {
|
|
1046
|
+
const { getDirtyDefinedNameMap: r, unitId: n } = t, s = r(), o = n;
|
|
1047
|
+
if (o != null && s[o] != null) {
|
|
1048
|
+
const u = Object.keys(s[o]);
|
|
1049
|
+
for (let c = 0, l = u.length; c < l; c++) {
|
|
1050
|
+
const f = u[c];
|
|
1051
|
+
if (e.indexOf(f) > -1)
|
|
1052
|
+
return !0;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
return !1;
|
|
1056
|
+
}
|
|
1057
|
+
_checkDefinedNameDirty(e, t) {
|
|
1058
|
+
const { getDirtyDefinedNameMap: r, unitId: n } = t, s = r(), o = n;
|
|
1059
|
+
if (o != null && s[o] != null) {
|
|
1060
|
+
const u = Object.keys(s[o]);
|
|
1061
|
+
for (let c = 0, l = u.length; c < l; c++)
|
|
1062
|
+
if (u[c] === e)
|
|
1063
|
+
return !0;
|
|
1064
|
+
}
|
|
1065
|
+
return !1;
|
|
999
1066
|
}
|
|
1000
1067
|
// eslint-disable-next-line complexity
|
|
1001
1068
|
_suffixExpressionHandler(e) {
|
|
@@ -2664,62 +2731,11 @@ let Ar = class extends Ne {
|
|
|
2664
2731
|
super(), this._definedNamesService = i, this._lexerTreeBuilder = a, this._formulaCurrentConfigService = e;
|
|
2665
2732
|
}
|
|
2666
2733
|
treeBuilder(i, a = !0) {
|
|
2667
|
-
return this._lexerTreeBuilder.treeBuilder(i, a,
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
const t = Object.keys(a[e]);
|
|
2673
|
-
for (let r = 0, n = t.length; r < n; r++) {
|
|
2674
|
-
const s = t[r];
|
|
2675
|
-
if (i.indexOf(s) > -1)
|
|
2676
|
-
return !0;
|
|
2677
|
-
}
|
|
2678
|
-
}
|
|
2679
|
-
return !1;
|
|
2680
|
-
}
|
|
2681
|
-
_checkDefinedNameDirty(i) {
|
|
2682
|
-
const a = this._formulaCurrentConfigService.getDirtyDefinedNameMap(), e = this._formulaCurrentConfigService.getExecuteUnitId();
|
|
2683
|
-
if (e != null && a[e] != null) {
|
|
2684
|
-
const t = Object.keys(a[e]);
|
|
2685
|
-
for (let r = 0, n = t.length; r < n; r++)
|
|
2686
|
-
if (t[r] === i)
|
|
2687
|
-
return !0;
|
|
2688
|
-
}
|
|
2689
|
-
return !1;
|
|
2690
|
-
}
|
|
2691
|
-
_injectDefinedName(i) {
|
|
2692
|
-
const a = this._formulaCurrentConfigService.getExecuteUnitId();
|
|
2693
|
-
if (a == null)
|
|
2694
|
-
return {
|
|
2695
|
-
sequenceString: "",
|
|
2696
|
-
hasDefinedName: !1,
|
|
2697
|
-
definedNames: []
|
|
2698
|
-
};
|
|
2699
|
-
const e = this._lexerTreeBuilder.getSequenceNode(i);
|
|
2700
|
-
let t = "", r = !1;
|
|
2701
|
-
const n = [];
|
|
2702
|
-
for (let s = 0, o = e.length; s < o; s++) {
|
|
2703
|
-
const u = e[s];
|
|
2704
|
-
if (typeof u == "string") {
|
|
2705
|
-
t += u;
|
|
2706
|
-
continue;
|
|
2707
|
-
}
|
|
2708
|
-
const { nodeType: c, token: l } = u;
|
|
2709
|
-
if (c === $e.REFERENCE || c === $e.FUNCTION) {
|
|
2710
|
-
const f = this._definedNamesService.getValueByName(a, l);
|
|
2711
|
-
if (f) {
|
|
2712
|
-
let h = f.formulaOrRefString;
|
|
2713
|
-
h.substring(0, 1) === X.EQUALS && (h = h.substring(1)), t += h, n.push(f.name), r = !0;
|
|
2714
|
-
} else this._checkDefinedNameDirty(l) ? (t += m.NAME, r = !0, n.push(l)) : t += l;
|
|
2715
|
-
} else
|
|
2716
|
-
t += l;
|
|
2717
|
-
}
|
|
2718
|
-
return {
|
|
2719
|
-
sequenceString: t,
|
|
2720
|
-
hasDefinedName: r,
|
|
2721
|
-
definedNames: n
|
|
2722
|
-
};
|
|
2734
|
+
return this._lexerTreeBuilder.treeBuilder(i, a, {
|
|
2735
|
+
unitId: this._formulaCurrentConfigService.getExecuteUnitId(),
|
|
2736
|
+
getValueByName: this._definedNamesService.getValueByName.bind(this._definedNamesService),
|
|
2737
|
+
getDirtyDefinedNameMap: this._formulaCurrentConfigService.getDirtyDefinedNameMap.bind(this._formulaCurrentConfigService)
|
|
2738
|
+
});
|
|
2723
2739
|
}
|
|
2724
2740
|
};
|
|
2725
2741
|
Ar = Cl([
|
|
@@ -3047,22 +3063,22 @@ class Ht extends Hn {
|
|
|
3047
3063
|
return g.create(m.NAME);
|
|
3048
3064
|
}
|
|
3049
3065
|
isEqual(e) {
|
|
3050
|
-
return this.compare(e,
|
|
3066
|
+
return this.compare(e, F.EQUALS);
|
|
3051
3067
|
}
|
|
3052
3068
|
isNotEqual(e) {
|
|
3053
|
-
return this.compare(e,
|
|
3069
|
+
return this.compare(e, F.NOT_EQUAL);
|
|
3054
3070
|
}
|
|
3055
3071
|
isGreaterThanOrEqual(e) {
|
|
3056
|
-
return this.compare(e,
|
|
3072
|
+
return this.compare(e, F.GREATER_THAN_OR_EQUAL);
|
|
3057
3073
|
}
|
|
3058
3074
|
isLessThanOrEqual(e) {
|
|
3059
|
-
return this.compare(e,
|
|
3075
|
+
return this.compare(e, F.LESS_THAN_OR_EQUAL);
|
|
3060
3076
|
}
|
|
3061
3077
|
isLessThan(e) {
|
|
3062
|
-
return this.compare(e,
|
|
3078
|
+
return this.compare(e, F.LESS_THAN);
|
|
3063
3079
|
}
|
|
3064
3080
|
isGreaterThan(e) {
|
|
3065
|
-
return this.compare(e,
|
|
3081
|
+
return this.compare(e, F.GREATER_THAN);
|
|
3066
3082
|
}
|
|
3067
3083
|
concatenateFront(e) {
|
|
3068
3084
|
return g.create(m.NAME);
|
|
@@ -3286,18 +3302,18 @@ function di(i) {
|
|
|
3286
3302
|
function Sl(i, a, e) {
|
|
3287
3303
|
let t = !1;
|
|
3288
3304
|
switch (e) {
|
|
3289
|
-
case
|
|
3305
|
+
case F.EQUALS:
|
|
3290
3306
|
t = Cs(i, a);
|
|
3291
3307
|
break;
|
|
3292
|
-
case
|
|
3308
|
+
case F.NOT_EQUAL:
|
|
3293
3309
|
t = !Cs(i, a);
|
|
3294
3310
|
break;
|
|
3295
|
-
case
|
|
3296
|
-
case
|
|
3311
|
+
case F.GREATER_THAN:
|
|
3312
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
3297
3313
|
t = Cs(i, a) || i > di(a);
|
|
3298
3314
|
break;
|
|
3299
|
-
case
|
|
3300
|
-
case
|
|
3315
|
+
case F.LESS_THAN:
|
|
3316
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
3301
3317
|
t = i < di(a);
|
|
3302
3318
|
break;
|
|
3303
3319
|
}
|
|
@@ -3324,23 +3340,23 @@ function Is(i) {
|
|
|
3324
3340
|
function Aa(i) {
|
|
3325
3341
|
let a;
|
|
3326
3342
|
switch (i) {
|
|
3327
|
-
case
|
|
3328
|
-
a =
|
|
3343
|
+
case F.EQUALS:
|
|
3344
|
+
a = F.EQUALS;
|
|
3329
3345
|
break;
|
|
3330
|
-
case
|
|
3331
|
-
a =
|
|
3346
|
+
case F.GREATER_THAN:
|
|
3347
|
+
a = F.LESS_THAN;
|
|
3332
3348
|
break;
|
|
3333
|
-
case
|
|
3334
|
-
a =
|
|
3349
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
3350
|
+
a = F.LESS_THAN_OR_EQUAL;
|
|
3335
3351
|
break;
|
|
3336
|
-
case
|
|
3337
|
-
a =
|
|
3352
|
+
case F.LESS_THAN:
|
|
3353
|
+
a = F.GREATER_THAN;
|
|
3338
3354
|
break;
|
|
3339
|
-
case
|
|
3340
|
-
a =
|
|
3355
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
3356
|
+
a = F.GREATER_THAN_OR_EQUAL;
|
|
3341
3357
|
break;
|
|
3342
|
-
case
|
|
3343
|
-
a =
|
|
3358
|
+
case F.NOT_EQUAL:
|
|
3359
|
+
a = F.NOT_EQUAL;
|
|
3344
3360
|
break;
|
|
3345
3361
|
}
|
|
3346
3362
|
return a;
|
|
@@ -3855,7 +3871,7 @@ var Ve = /* @__PURE__ */ (function() {
|
|
|
3855
3871
|
for (; !t[0] && t.length > 1; ) t.shift();
|
|
3856
3872
|
}
|
|
3857
3873
|
return function(t, r, n, s, o, u) {
|
|
3858
|
-
var c, l, f, h, d, _, C, E, b, R, p, N, M, w, S, D, L, U, x,
|
|
3874
|
+
var c, l, f, h, d, _, C, E, b, R, p, N, M, w, S, D, L, U, x, k, Q = t.constructor, ne = t.s == r.s ? 1 : -1, z = t.d, G = r.d;
|
|
3859
3875
|
if (!z || !z[0] || !G || !G[0])
|
|
3860
3876
|
return new Q(
|
|
3861
3877
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
@@ -3874,9 +3890,9 @@ var Ve = /* @__PURE__ */ (function() {
|
|
|
3874
3890
|
_ = h || f < L;
|
|
3875
3891
|
} else {
|
|
3876
3892
|
for (h = u / (G[0] + 1) | 0, h > 1 && (G = i(G, h, u), z = i(z, h, u), x = G.length, L = z.length), D = x, p = z.slice(0, x), N = p.length; N < x; ) p[N++] = 0;
|
|
3877
|
-
|
|
3893
|
+
k = G.slice(), k.unshift(0), U = G[0], G[1] >= u / 2 && ++U;
|
|
3878
3894
|
do
|
|
3879
|
-
h = 0, c = a(G, p, x, N), c < 0 ? (M = p[0], x != N && (M = M * u + (p[1] || 0)), h = M / U | 0, h > 1 ? (h >= u && (h = u - 1), C = i(G, h, u), E = C.length, N = p.length, c = a(C, p, E, N), c == 1 && (h--, e(C, x < E ?
|
|
3895
|
+
h = 0, c = a(G, p, x, N), c < 0 ? (M = p[0], x != N && (M = M * u + (p[1] || 0)), h = M / U | 0, h > 1 ? (h >= u && (h = u - 1), C = i(G, h, u), E = C.length, N = p.length, c = a(C, p, E, N), c == 1 && (h--, e(C, x < E ? k : G, E, u))) : (h == 0 && (c = h = 1), C = G.slice()), E = C.length, E < N && C.unshift(0), e(p, C, N, u), c == -1 && (N = p.length, c = a(G, p, x, N), c < 1 && (h++, e(p, x < N ? k : G, N, u))), N = p.length) : c === 0 && (h++, p = [0]), R[f++] = h, c && p[0] ? p[N++] = z[D] || 0 : (p = [z[D]], N = 1);
|
|
3880
3896
|
while ((D++ < L || p[0] !== void 0) && w--);
|
|
3881
3897
|
_ = p[0] !== void 0;
|
|
3882
3898
|
}
|
|
@@ -4556,7 +4572,7 @@ const $n = class $n extends Ht {
|
|
|
4556
4572
|
}
|
|
4557
4573
|
};
|
|
4558
4574
|
A($n, "_instance");
|
|
4559
|
-
let
|
|
4575
|
+
let ce = $n;
|
|
4560
4576
|
const Xt = class Xt extends Ht {
|
|
4561
4577
|
constructor(e) {
|
|
4562
4578
|
super(e);
|
|
@@ -4610,13 +4626,13 @@ const Xt = class Xt extends Ht {
|
|
|
4610
4626
|
}
|
|
4611
4627
|
_compareString(e) {
|
|
4612
4628
|
switch (e) {
|
|
4613
|
-
case
|
|
4614
|
-
case
|
|
4629
|
+
case F.GREATER_THAN:
|
|
4630
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
4615
4631
|
return !0;
|
|
4616
|
-
case
|
|
4617
|
-
case
|
|
4618
|
-
case
|
|
4619
|
-
case
|
|
4632
|
+
case F.EQUALS:
|
|
4633
|
+
case F.LESS_THAN:
|
|
4634
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
4635
|
+
case F.NOT_EQUAL:
|
|
4620
4636
|
return !1;
|
|
4621
4637
|
}
|
|
4622
4638
|
}
|
|
@@ -4869,13 +4885,13 @@ class y extends Ht {
|
|
|
4869
4885
|
}
|
|
4870
4886
|
_compareString(e) {
|
|
4871
4887
|
switch (e) {
|
|
4872
|
-
case
|
|
4873
|
-
case
|
|
4874
|
-
case
|
|
4888
|
+
case F.EQUALS:
|
|
4889
|
+
case F.GREATER_THAN:
|
|
4890
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
4875
4891
|
return !1;
|
|
4876
|
-
case
|
|
4877
|
-
case
|
|
4878
|
-
case
|
|
4892
|
+
case F.LESS_THAN:
|
|
4893
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
4894
|
+
case F.NOT_EQUAL:
|
|
4879
4895
|
return !0;
|
|
4880
4896
|
}
|
|
4881
4897
|
}
|
|
@@ -4884,29 +4900,29 @@ class y extends Ht {
|
|
|
4884
4900
|
}
|
|
4885
4901
|
_compareFiniteNumber(e, t, r) {
|
|
4886
4902
|
switch (r) {
|
|
4887
|
-
case
|
|
4903
|
+
case F.EQUALS:
|
|
4888
4904
|
return bi(e, t);
|
|
4889
|
-
case
|
|
4905
|
+
case F.GREATER_THAN:
|
|
4890
4906
|
return Df(e, t);
|
|
4891
|
-
case
|
|
4907
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
4892
4908
|
return Lf(e, t);
|
|
4893
|
-
case
|
|
4909
|
+
case F.LESS_THAN:
|
|
4894
4910
|
return Pf(e, t);
|
|
4895
|
-
case
|
|
4911
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
4896
4912
|
return xf(e, t);
|
|
4897
|
-
case
|
|
4913
|
+
case F.NOT_EQUAL:
|
|
4898
4914
|
return !bi(e, t);
|
|
4899
4915
|
}
|
|
4900
4916
|
}
|
|
4901
4917
|
_compareBoolean(e) {
|
|
4902
4918
|
switch (e) {
|
|
4903
|
-
case
|
|
4904
|
-
case
|
|
4905
|
-
case
|
|
4919
|
+
case F.EQUALS:
|
|
4920
|
+
case F.GREATER_THAN:
|
|
4921
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
4906
4922
|
return !1;
|
|
4907
|
-
case
|
|
4908
|
-
case
|
|
4909
|
-
case
|
|
4923
|
+
case F.LESS_THAN:
|
|
4924
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
4925
|
+
case F.NOT_EQUAL:
|
|
4910
4926
|
return !0;
|
|
4911
4927
|
}
|
|
4912
4928
|
}
|
|
@@ -5122,22 +5138,22 @@ class y extends Ht {
|
|
|
5122
5138
|
_compareInfinity(e, t, r) {
|
|
5123
5139
|
let n = !1;
|
|
5124
5140
|
switch (r) {
|
|
5125
|
-
case
|
|
5141
|
+
case F.EQUALS:
|
|
5126
5142
|
n = e === t;
|
|
5127
5143
|
break;
|
|
5128
|
-
case
|
|
5144
|
+
case F.GREATER_THAN:
|
|
5129
5145
|
n = e > t;
|
|
5130
5146
|
break;
|
|
5131
|
-
case
|
|
5147
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
5132
5148
|
n = e >= t;
|
|
5133
5149
|
break;
|
|
5134
|
-
case
|
|
5150
|
+
case F.LESS_THAN:
|
|
5135
5151
|
n = e < t;
|
|
5136
5152
|
break;
|
|
5137
|
-
case
|
|
5153
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
5138
5154
|
n = e <= t;
|
|
5139
5155
|
break;
|
|
5140
|
-
case
|
|
5156
|
+
case F.NOT_EQUAL:
|
|
5141
5157
|
n = e !== t;
|
|
5142
5158
|
break;
|
|
5143
5159
|
}
|
|
@@ -5209,41 +5225,41 @@ class j extends Ht {
|
|
|
5209
5225
|
}
|
|
5210
5226
|
_compareString(e, t, r) {
|
|
5211
5227
|
switch (r) {
|
|
5212
|
-
case
|
|
5228
|
+
case F.EQUALS:
|
|
5213
5229
|
return e === t;
|
|
5214
|
-
case
|
|
5230
|
+
case F.GREATER_THAN:
|
|
5215
5231
|
return e > t;
|
|
5216
|
-
case
|
|
5232
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
5217
5233
|
return e >= t;
|
|
5218
|
-
case
|
|
5234
|
+
case F.LESS_THAN:
|
|
5219
5235
|
return e < t;
|
|
5220
|
-
case
|
|
5236
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
5221
5237
|
return e <= t;
|
|
5222
|
-
case
|
|
5238
|
+
case F.NOT_EQUAL:
|
|
5223
5239
|
return e !== t;
|
|
5224
5240
|
}
|
|
5225
5241
|
}
|
|
5226
5242
|
_compareNumber(e) {
|
|
5227
5243
|
switch (e) {
|
|
5228
|
-
case
|
|
5229
|
-
case
|
|
5230
|
-
case
|
|
5244
|
+
case F.NOT_EQUAL:
|
|
5245
|
+
case F.GREATER_THAN:
|
|
5246
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
5231
5247
|
return !0;
|
|
5232
|
-
case
|
|
5233
|
-
case
|
|
5234
|
-
case
|
|
5248
|
+
case F.EQUALS:
|
|
5249
|
+
case F.LESS_THAN:
|
|
5250
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
5235
5251
|
return !1;
|
|
5236
5252
|
}
|
|
5237
5253
|
}
|
|
5238
5254
|
_compareBoolean(e) {
|
|
5239
5255
|
switch (e) {
|
|
5240
|
-
case
|
|
5241
|
-
case
|
|
5242
|
-
case
|
|
5256
|
+
case F.EQUALS:
|
|
5257
|
+
case F.GREATER_THAN:
|
|
5258
|
+
case F.GREATER_THAN_OR_EQUAL:
|
|
5243
5259
|
return !1;
|
|
5244
|
-
case
|
|
5245
|
-
case
|
|
5246
|
-
case
|
|
5260
|
+
case F.LESS_THAN:
|
|
5261
|
+
case F.LESS_THAN_OR_EQUAL:
|
|
5262
|
+
case F.NOT_EQUAL:
|
|
5247
5263
|
return !0;
|
|
5248
5264
|
}
|
|
5249
5265
|
}
|
|
@@ -5474,11 +5490,11 @@ class q extends Ht {
|
|
|
5474
5490
|
}
|
|
5475
5491
|
getFirstCell() {
|
|
5476
5492
|
const { startRow: e, startColumn: t } = this.getRangePosition();
|
|
5477
|
-
return this.get(e, t) || this._defaultValue ||
|
|
5493
|
+
return this.get(e, t) || this._defaultValue || ce.create();
|
|
5478
5494
|
}
|
|
5479
5495
|
getLastCell() {
|
|
5480
5496
|
const { endRow: e, endColumn: t } = this.getRangePosition();
|
|
5481
|
-
return this.get(e, t) || this._defaultValue ||
|
|
5497
|
+
return this.get(e, t) || this._defaultValue || ce.create();
|
|
5482
5498
|
}
|
|
5483
5499
|
/**
|
|
5484
5500
|
* Referring to matrix calculations,
|
|
@@ -5494,7 +5510,7 @@ class q extends Ht {
|
|
|
5494
5510
|
pickRaw(e) {
|
|
5495
5511
|
const t = e.getRowCount(), r = e.getColumnCount();
|
|
5496
5512
|
if (t !== this._rowCount || r !== this._columnCount)
|
|
5497
|
-
return [[
|
|
5513
|
+
return [[ce.create()]];
|
|
5498
5514
|
const n = [];
|
|
5499
5515
|
n[0] = [];
|
|
5500
5516
|
for (let s = 0; s < t; s++)
|
|
@@ -5572,7 +5588,7 @@ class q extends Ht {
|
|
|
5572
5588
|
if (!d[p])
|
|
5573
5589
|
return;
|
|
5574
5590
|
let M = d[p][N] || this._defaultValue;
|
|
5575
|
-
M == null && (M =
|
|
5591
|
+
M == null && (M = ce.create()), h[_][C] = M, C++;
|
|
5576
5592
|
}
|
|
5577
5593
|
_++;
|
|
5578
5594
|
}
|
|
@@ -5603,7 +5619,7 @@ class q extends Ht {
|
|
|
5603
5619
|
if (f == null)
|
|
5604
5620
|
return !0;
|
|
5605
5621
|
let _;
|
|
5606
|
-
if (n === !0 ? _ = f.compare(e,
|
|
5622
|
+
if (n === !0 ? _ = f.compare(e, F.EQUALS) : _ = f.isEqual(e), (_ == null ? void 0 : _.getValue()) === !0)
|
|
5607
5623
|
return s = f, u = { row: h, column: d }, !1;
|
|
5608
5624
|
t === Le.MAX ? f.isGreaterThan(e).getValue() === !0 && (o == null || f.minus(e).abs().isLessThanOrEqual(o.minus(e).abs()).getValue() === !0) && (o = f, c = { row: h, column: d }) : t === Le.MIN && f.isLessThan(e).getValue() === !0 && (o == null || f.minus(e).abs().isLessThanOrEqual(o.minus(e).abs()).getValue() === !0) && (o = f, c = { row: h, column: d });
|
|
5609
5625
|
};
|
|
@@ -5778,7 +5794,7 @@ class q extends Ht {
|
|
|
5778
5794
|
);
|
|
5779
5795
|
}
|
|
5780
5796
|
map(e) {
|
|
5781
|
-
const t = (r, n, s) => r == null ?
|
|
5797
|
+
const t = (r, n, s) => r == null ? ce.create() : r.isError() ? r : e(r, n, s);
|
|
5782
5798
|
return this.mapValue(t);
|
|
5783
5799
|
}
|
|
5784
5800
|
mapValue(e) {
|
|
@@ -5792,7 +5808,7 @@ class q extends Ht {
|
|
|
5792
5808
|
u[c] = g.create(m.VALUE);
|
|
5793
5809
|
else {
|
|
5794
5810
|
const f = l[c] || this._defaultValue;
|
|
5795
|
-
f ? u[c] = e(f, o, c) : u[c] =
|
|
5811
|
+
f ? u[c] = e(f, o, c) : u[c] = ce.create();
|
|
5796
5812
|
}
|
|
5797
5813
|
}
|
|
5798
5814
|
n.push(u);
|
|
@@ -5873,12 +5889,12 @@ class q extends Ht {
|
|
|
5873
5889
|
median() {
|
|
5874
5890
|
const e = this.flattenPosition().numberArray, t = this._createNewArray([e], 1, e.length), r = t.getColumnCount();
|
|
5875
5891
|
if (r <= 1)
|
|
5876
|
-
return t.get(0, 0) ||
|
|
5892
|
+
return t.get(0, 0) || ce.create();
|
|
5877
5893
|
if (t.sortByRow(0), r % 2 === 0) {
|
|
5878
|
-
const n = t.get(0, r / 2) ||
|
|
5894
|
+
const n = t.get(0, r / 2) || ce.create(), s = t.get(0, r / 2 - 1) || ce.create();
|
|
5879
5895
|
return n.plus(s).divided(y.create(2));
|
|
5880
5896
|
}
|
|
5881
|
-
return t.get(0, (r - 1) / 2) ||
|
|
5897
|
+
return t.get(0, (r - 1) / 2) || ce.create();
|
|
5882
5898
|
}
|
|
5883
5899
|
/**
|
|
5884
5900
|
* ┌──────────────┬────────────────────────────────┬───────────────────┐
|
|
@@ -6042,61 +6058,64 @@ class q extends Ht {
|
|
|
6042
6058
|
f + u - 1
|
|
6043
6059
|
);
|
|
6044
6060
|
if (d.length > 0) {
|
|
6045
|
-
|
|
6046
|
-
|
|
6061
|
+
let C = !1;
|
|
6062
|
+
if (s === F.EQUALS) {
|
|
6063
|
+
const E = We.getCellPositions(
|
|
6047
6064
|
c,
|
|
6048
6065
|
l,
|
|
6049
6066
|
t + h,
|
|
6050
6067
|
e.getValue(),
|
|
6051
6068
|
d
|
|
6052
6069
|
);
|
|
6053
|
-
|
|
6054
|
-
if (
|
|
6070
|
+
E != null && (E.forEach((b) => {
|
|
6071
|
+
if (b < f || b > f + u - 1)
|
|
6055
6072
|
return;
|
|
6056
|
-
const
|
|
6057
|
-
r[
|
|
6058
|
-
});
|
|
6073
|
+
const R = b - f;
|
|
6074
|
+
r[R] == null && (r[R] = []), r[R][t] = T.create(!0);
|
|
6075
|
+
}), C = !0);
|
|
6059
6076
|
} else {
|
|
6060
|
-
const
|
|
6077
|
+
const E = We.getCellValuePositions(
|
|
6061
6078
|
c,
|
|
6062
6079
|
l,
|
|
6063
6080
|
t + h
|
|
6064
6081
|
);
|
|
6065
|
-
|
|
6066
|
-
let
|
|
6067
|
-
or.has(
|
|
6068
|
-
let
|
|
6069
|
-
|
|
6070
|
-
|
|
6082
|
+
E != null && E.forEach((b, R) => {
|
|
6083
|
+
let p = ce.create();
|
|
6084
|
+
or.has(R) ? p = g.create(R) : typeof R == "string" ? p = j.create(R) : typeof R == "number" ? p = y.create(R) : typeof R == "boolean" && (p = T.create(R));
|
|
6085
|
+
let N;
|
|
6086
|
+
p.isError() ? N = p : e.isError() ? N = e : N = p.compare(e, s, o), (N.isError() || N.getValue() === !0) && b.forEach((M) => {
|
|
6087
|
+
M >= f && M <= f + u - 1 && (r[M - f] == null && (r[M - f] = []), r[M - f][t] = N);
|
|
6071
6088
|
});
|
|
6072
6089
|
});
|
|
6073
6090
|
}
|
|
6074
|
-
if (
|
|
6075
|
-
|
|
6076
|
-
const
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6091
|
+
if (!(s === F.EQUALS && !C && !o)) {
|
|
6092
|
+
if (_.length > 0)
|
|
6093
|
+
for (const E of _) {
|
|
6094
|
+
const [b, R] = E;
|
|
6095
|
+
for (let p = b; p <= R; p++)
|
|
6096
|
+
this.__batchOperatorRowValue(
|
|
6097
|
+
e,
|
|
6098
|
+
t,
|
|
6099
|
+
r,
|
|
6100
|
+
n,
|
|
6101
|
+
p - f,
|
|
6102
|
+
c,
|
|
6103
|
+
l,
|
|
6104
|
+
f,
|
|
6105
|
+
h,
|
|
6106
|
+
s,
|
|
6107
|
+
o
|
|
6108
|
+
);
|
|
6109
|
+
We.setContinueBuildingCache(
|
|
6084
6110
|
c,
|
|
6085
6111
|
l,
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
o
|
|
6112
|
+
t + h,
|
|
6113
|
+
b,
|
|
6114
|
+
R
|
|
6090
6115
|
);
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
t + h,
|
|
6095
|
-
E,
|
|
6096
|
-
b
|
|
6097
|
-
);
|
|
6098
|
-
}
|
|
6099
|
-
return;
|
|
6116
|
+
}
|
|
6117
|
+
return;
|
|
6118
|
+
}
|
|
6100
6119
|
}
|
|
6101
6120
|
}
|
|
6102
6121
|
for (let d = 0; d < u; d++)
|
|
@@ -6173,7 +6192,7 @@ class q extends Ht {
|
|
|
6173
6192
|
}
|
|
6174
6193
|
else
|
|
6175
6194
|
r[s][t] = g.create(m.NA);
|
|
6176
|
-
d != null && (d.isError() ? We.set(
|
|
6195
|
+
d != null && (d.isNull() || (d.isError() ? We.set(
|
|
6177
6196
|
o,
|
|
6178
6197
|
u,
|
|
6179
6198
|
t + l,
|
|
@@ -6185,7 +6204,7 @@ class q extends Ht {
|
|
|
6185
6204
|
t + l,
|
|
6186
6205
|
d.getValue(),
|
|
6187
6206
|
s + c
|
|
6188
|
-
));
|
|
6207
|
+
)));
|
|
6189
6208
|
}
|
|
6190
6209
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
6191
6210
|
_batchOperatorArray(e, t, r, n) {
|
|
@@ -6290,7 +6309,7 @@ class q extends Ht {
|
|
|
6290
6309
|
class Mt {
|
|
6291
6310
|
static create(a, e = !1) {
|
|
6292
6311
|
if (a == null)
|
|
6293
|
-
return
|
|
6312
|
+
return ce.create();
|
|
6294
6313
|
if (typeof a == "boolean")
|
|
6295
6314
|
return T.create(a);
|
|
6296
6315
|
if (typeof a == "string") {
|
|
@@ -6639,7 +6658,7 @@ class Xn extends Hn {
|
|
|
6639
6658
|
const f = new Array(c);
|
|
6640
6659
|
this.iterator((C, E, b) => {
|
|
6641
6660
|
const R = E - t, p = b - n;
|
|
6642
|
-
f[R] || (f[R] = new Array(l)), C == null && (C =
|
|
6661
|
+
f[R] || (f[R] = new Array(l)), C == null && (C = ce.create()), f[R][p] = C;
|
|
6643
6662
|
});
|
|
6644
6663
|
const h = {
|
|
6645
6664
|
calculateValueList: f,
|
|
@@ -6846,7 +6865,7 @@ function O(i, a, e, t) {
|
|
|
6846
6865
|
continue;
|
|
6847
6866
|
}
|
|
6848
6867
|
if (o >= r || c >= n) {
|
|
6849
|
-
u.push(t != null ? t :
|
|
6868
|
+
u.push(t != null ? t : ce.create());
|
|
6850
6869
|
continue;
|
|
6851
6870
|
}
|
|
6852
6871
|
const l = e.get(o, c);
|
|
@@ -6870,19 +6889,19 @@ function Fr(i, a, e, t = "", r = "") {
|
|
|
6870
6889
|
}
|
|
6871
6890
|
function Va(i) {
|
|
6872
6891
|
const a = [
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6892
|
+
F.EQUALS,
|
|
6893
|
+
F.NOT_EQUAL,
|
|
6894
|
+
F.GREATER_THAN_OR_EQUAL,
|
|
6895
|
+
F.GREATER_THAN,
|
|
6896
|
+
F.LESS_THAN_OR_EQUAL,
|
|
6897
|
+
F.LESS_THAN
|
|
6879
6898
|
];
|
|
6880
6899
|
for (const e of a)
|
|
6881
6900
|
if (i.startsWith(e)) {
|
|
6882
6901
|
const t = i.substring(e.length);
|
|
6883
6902
|
return [e, Mt.create(t)];
|
|
6884
6903
|
}
|
|
6885
|
-
return [
|
|
6904
|
+
return [F.EQUALS, Mt.create(i)];
|
|
6886
6905
|
}
|
|
6887
6906
|
function Zn(i, a, e, t) {
|
|
6888
6907
|
if (!e)
|
|
@@ -6890,7 +6909,7 @@ function Zn(i, a, e, t) {
|
|
|
6890
6909
|
const r = `${a.getValue()}`, [n, s] = Va(r);
|
|
6891
6910
|
e = n, a = s;
|
|
6892
6911
|
} else
|
|
6893
|
-
e =
|
|
6912
|
+
e = F.EQUALS;
|
|
6894
6913
|
return i.compare(a, e, t);
|
|
6895
6914
|
}
|
|
6896
6915
|
function Hf(i, a) {
|
|
@@ -7055,7 +7074,7 @@ function zn(i, a, e) {
|
|
|
7055
7074
|
return n;
|
|
7056
7075
|
if (u != null && u.isError() && r.isError() && u.getValue() === r.getValue())
|
|
7057
7076
|
return T.create(!0);
|
|
7058
|
-
if (t ===
|
|
7077
|
+
if (t === F.EQUALS || t === F.NOT_EQUAL) {
|
|
7059
7078
|
if (u != null && u.isNumber() && r.isString()) {
|
|
7060
7079
|
const c = r.convertToNumberObjectValue();
|
|
7061
7080
|
if (c.isNumber())
|
|
@@ -7066,9 +7085,9 @@ function zn(i, a, e) {
|
|
|
7066
7085
|
if (c.isNumber())
|
|
7067
7086
|
return c.compare(r, t);
|
|
7068
7087
|
}
|
|
7069
|
-
if (t ===
|
|
7088
|
+
if (t === F.EQUALS)
|
|
7070
7089
|
return T.create(!1);
|
|
7071
|
-
if (t ===
|
|
7090
|
+
if (t === F.NOT_EQUAL)
|
|
7072
7091
|
return T.create(!0);
|
|
7073
7092
|
}
|
|
7074
7093
|
return T.create(!1);
|
|
@@ -7343,15 +7362,15 @@ let Ws = class extends Ne {
|
|
|
7343
7362
|
const S = this._currentConfigService.getUnitData();
|
|
7344
7363
|
E.iterator((D, L, U) => {
|
|
7345
7364
|
var ne, z;
|
|
7346
|
-
const x = L - b + e,
|
|
7365
|
+
const x = L - b + e, k = U - R + t, Q = (z = (ne = S[o]) == null ? void 0 : ne[s]) == null ? void 0 : z.cellData.getValue(x, k);
|
|
7347
7366
|
if (L === b && U === R)
|
|
7348
7367
|
_.setValue(e, t, w);
|
|
7349
7368
|
else if (Q != null)
|
|
7350
|
-
Q.v == null && (Q.v = ""), _.setValue(x,
|
|
7369
|
+
Q.v == null && (Q.v = ""), _.setValue(x, k, Q);
|
|
7351
7370
|
else {
|
|
7352
|
-
if (this._isInOtherArrayFormulaRange(o, s, e, t, x,
|
|
7371
|
+
if (this._isInOtherArrayFormulaRange(o, s, e, t, x, k))
|
|
7353
7372
|
return !0;
|
|
7354
|
-
_.setValue(x,
|
|
7373
|
+
_.setValue(x, k, { v: "" });
|
|
7355
7374
|
}
|
|
7356
7375
|
});
|
|
7357
7376
|
} else {
|
|
@@ -7371,8 +7390,8 @@ let Ws = class extends Ne {
|
|
|
7371
7390
|
return C.setValue(e, t, {}), d.setValue(e, t, { ...this._getValueObjectOfRuntimeData(w) }), !1;
|
|
7372
7391
|
d.setValue(e, t, { ...U });
|
|
7373
7392
|
}
|
|
7374
|
-
const x = D - b + e,
|
|
7375
|
-
_.setValue(x,
|
|
7393
|
+
const x = D - b + e, k = L - R + t;
|
|
7394
|
+
_.setValue(x, k, U);
|
|
7376
7395
|
});
|
|
7377
7396
|
}
|
|
7378
7397
|
} else {
|
|
@@ -8373,7 +8392,7 @@ class bh extends Ge {
|
|
|
8373
8392
|
return ie.NULL;
|
|
8374
8393
|
}
|
|
8375
8394
|
execute() {
|
|
8376
|
-
this.setValue(
|
|
8395
|
+
this.setValue(ce.create());
|
|
8377
8396
|
}
|
|
8378
8397
|
}
|
|
8379
8398
|
var Y = /* @__PURE__ */ ((i) => (i.ABS = "ABS", i.ACOS = "ACOS", i.ACOSH = "ACOSH", i.ACOT = "ACOT", i.ACOTH = "ACOTH", i.AGGREGATE = "AGGREGATE", i.ARABIC = "ARABIC", i.ASIN = "ASIN", i.ASINH = "ASINH", i.ATAN = "ATAN", i.ATAN2 = "ATAN2", i.ATANH = "ATANH", i.BASE = "BASE", i.CEILING = "CEILING", i.CEILING_MATH = "CEILING.MATH", i.CEILING_PRECISE = "CEILING.PRECISE", i.COMBIN = "COMBIN", i.COMBINA = "COMBINA", i.COS = "COS", i.COSH = "COSH", i.COT = "COT", i.COTH = "COTH", i.CSC = "CSC", i.CSCH = "CSCH", i.DECIMAL = "DECIMAL", i.DEGREES = "DEGREES", i.EVEN = "EVEN", i.EXP = "EXP", i.FACT = "FACT", i.FACTDOUBLE = "FACTDOUBLE", i.FLOOR = "FLOOR", i.FLOOR_MATH = "FLOOR.MATH", i.FLOOR_PRECISE = "FLOOR.PRECISE", i.GCD = "GCD", i.INT = "INT", i.ISO_CEILING = "ISO.CEILING", i.LCM = "LCM", i.LET = "LET", i.LN = "LN", i.LOG = "LOG", i.LOG10 = "LOG10", i.MDETERM = "MDETERM", i.MINVERSE = "MINVERSE", i.MMULT = "MMULT", i.MOD = "MOD", i.MROUND = "MROUND", i.MULTINOMIAL = "MULTINOMIAL", i.MUNIT = "MUNIT", i.ODD = "ODD", i.PI = "PI", i.POWER = "POWER", i.PRODUCT = "PRODUCT", i.QUOTIENT = "QUOTIENT", i.RADIANS = "RADIANS", i.RAND = "RAND", i.RANDARRAY = "RANDARRAY", i.RANDBETWEEN = "RANDBETWEEN", i.ROMAN = "ROMAN", i.ROUND = "ROUND", i.ROUNDBANK = "ROUNDBANK", i.ROUNDDOWN = "ROUNDDOWN", i.ROUNDUP = "ROUNDUP", i.SEC = "SEC", i.SECH = "SECH", i.SERIESSUM = "SERIESSUM", i.SEQUENCE = "SEQUENCE", i.SIGN = "SIGN", i.SIN = "SIN", i.SINH = "SINH", i.SQRT = "SQRT", i.SQRTPI = "SQRTPI", i.SUBTOTAL = "SUBTOTAL", i.SUM = "SUM", i.SUMIF = "SUMIF", i.SUMIFS = "SUMIFS", i.SUMPRODUCT = "SUMPRODUCT", i.SUMSQ = "SUMSQ", i.SUMX2MY2 = "SUMX2MY2", i.SUMX2PY2 = "SUMX2PY2", i.SUMXMY2 = "SUMXMY2", i.TAN = "TAN", i.TANH = "TANH", i.TRUNC = "TRUNC", i))(Y || {}), se = /* @__PURE__ */ ((i) => (i.ASC = "ASC", i.ARRAYTOTEXT = "ARRAYTOTEXT", i.BAHTTEXT = "BAHTTEXT", i.CHAR = "CHAR", i.CLEAN = "CLEAN", i.CODE = "CODE", i.CONCAT = "CONCAT", i.CONCATENATE = "CONCATENATE", i.DBCS = "DBCS", i.DOLLAR = "DOLLAR", i.EXACT = "EXACT", i.FIND = "FIND", i.FINDB = "FINDB", i.FIXED = "FIXED", i.LEFT = "LEFT", i.LEFTB = "LEFTB", i.LEN = "LEN", i.LENB = "LENB", i.LOWER = "LOWER", i.MID = "MID", i.MIDB = "MIDB", i.NUMBERSTRING = "NUMBERSTRING", i.NUMBERVALUE = "NUMBERVALUE", i.PHONETIC = "PHONETIC", i.PROPER = "PROPER", i.REGEXEXTRACT = "REGEXEXTRACT", i.REGEXMATCH = "REGEXMATCH", i.REGEXREPLACE = "REGEXREPLACE", i.REPLACE = "REPLACE", i.REPLACEB = "REPLACEB", i.REPT = "REPT", i.RIGHT = "RIGHT", i.RIGHTB = "RIGHTB", i.SEARCH = "SEARCH", i.SEARCHB = "SEARCHB", i.SUBSTITUTE = "SUBSTITUTE", i.T = "T", i.TEXT = "TEXT", i.TEXTAFTER = "TEXTAFTER", i.TEXTBEFORE = "TEXTBEFORE", i.TEXTJOIN = "TEXTJOIN", i.TEXTSPLIT = "TEXTSPLIT", i.TRIM = "TRIM", i.UNICHAR = "UNICHAR", i.UNICODE = "UNICODE", i.UPPER = "UPPER", i.VALUE = "VALUE", i.VALUETOTEXT = "VALUETOTEXT", i.CALL = "CALL", i.EUROCONVERT = "EUROCONVERT", i.REGISTER_ID = "REGISTER.ID", i))(se || {}), yh = Object.getOwnPropertyDescriptor, Rh = (i, a, e, t) => {
|
|
@@ -8398,7 +8417,7 @@ class Vh extends Ge {
|
|
|
8398
8417
|
this.setValue(g.create(m.VALUE));
|
|
8399
8418
|
return;
|
|
8400
8419
|
}
|
|
8401
|
-
r == null && (r =
|
|
8420
|
+
r == null && (r = ce.create()), n == null && (n = ce.create()), r.isReferenceObject() && (r = r.toArrayValueObject()), n.isReferenceObject() && (n = n.toArrayValueObject()), this.setValue(
|
|
8402
8421
|
this._functionExecutor.calculate(
|
|
8403
8422
|
r,
|
|
8404
8423
|
n
|
|
@@ -9791,9 +9810,9 @@ let Zs = class extends Ne {
|
|
|
9791
9810
|
const E = Vi(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)) || cr(this._dependencyManagerService), M = new bs(N);
|
|
9792
9811
|
for (let w = 0; w < _.length; w++) {
|
|
9793
9812
|
const S = _[w], { startRow: D, startColumn: L, endRow: U, endColumn: x } = S;
|
|
9794
|
-
for (let
|
|
9813
|
+
for (let k = D; k <= U; k++)
|
|
9795
9814
|
for (let Q = L; Q <= x; Q++) {
|
|
9796
|
-
const ne = Q - R, z =
|
|
9815
|
+
const ne = Q - R, z = k - b;
|
|
9797
9816
|
if (ne === 0 && z === 0) {
|
|
9798
9817
|
M.node = E, M.formula = d, M.unitId = r, M.subUnitId = o, M.formulaId = l, M.type = Ks.OTHER_FORMULA, M.isCache = C, t.push(M), this._dependencyManagerService.addOtherFormulaDependency(r, o, l, M), this._dependencyManagerService.addFormulaDependencyByDefinedName(M);
|
|
9799
9818
|
continue;
|
|
@@ -10789,7 +10808,7 @@ class V {
|
|
|
10789
10808
|
if (s == null)
|
|
10790
10809
|
return g.create(m.NA);
|
|
10791
10810
|
let o;
|
|
10792
|
-
return t.getRowCount() === 1 ? o = t.get(0, s) ||
|
|
10811
|
+
return t.getRowCount() === 1 ? o = t.get(0, s) || ce.create() : o = t.get(s, 0) || ce.create(), o.isNull() ? y.create(0) : o;
|
|
10793
10812
|
}
|
|
10794
10813
|
_getOneFirstByRaw(a) {
|
|
10795
10814
|
return a.length === 0 ? g.create(m.NA) : a[0][0] || g.create(m.NA);
|
|
@@ -10802,14 +10821,14 @@ class V {
|
|
|
10802
10821
|
return r ? this._getOneFirstByRaw(n) : this._getOneLastByRaw(n);
|
|
10803
10822
|
}
|
|
10804
10823
|
fuzzySearch(a, e, t, r = !0) {
|
|
10805
|
-
const n = t.pickRaw(e.compare(a,
|
|
10824
|
+
const n = t.pickRaw(e.compare(a, F.EQUALS));
|
|
10806
10825
|
return r ? this._getOneFirstByRaw(n) : this._getOneLastByRaw(n);
|
|
10807
10826
|
}
|
|
10808
10827
|
orderSearch(a, e, t, r = Le.MIN, n = !1) {
|
|
10809
10828
|
const s = e.orderSearch(a, r, n);
|
|
10810
10829
|
if (s == null)
|
|
10811
10830
|
return g.create(m.NA);
|
|
10812
|
-
const o = t.get(s.row, s.column) ||
|
|
10831
|
+
const o = t.get(s.row, s.column) || ce.create();
|
|
10813
10832
|
return o.isNull() ? g.create(m.NA) : o;
|
|
10814
10833
|
}
|
|
10815
10834
|
binarySearchExpand(a, e, t, r = 0, n, s) {
|
|
@@ -10822,7 +10841,7 @@ class V {
|
|
|
10822
10841
|
return r ? o = s.getFirstTruePosition() : o = s.getLastTruePosition(), o == null ? g.create(m.NA) : n === 0 ? t.slice([o.row, o.row + 1]) : t.slice(void 0, [o.column, o.column + 1]);
|
|
10823
10842
|
}
|
|
10824
10843
|
fuzzySearchExpand(a, e, t, r = !0, n = 0) {
|
|
10825
|
-
const s = e.compare(a,
|
|
10844
|
+
const s = e.compare(a, F.EQUALS);
|
|
10826
10845
|
let o;
|
|
10827
10846
|
return r ? o = s.getFirstTruePosition() : o = s.getLastTruePosition(), o == null ? g.create(m.NA) : n === 0 ? t.slice([o.row, o.row + 1]) : t.slice(void 0, [o.column, o.column + 1]);
|
|
10828
10847
|
}
|
|
@@ -14248,12 +14267,6 @@ class sg extends V {
|
|
|
14248
14267
|
A(this, "maxParams", 3);
|
|
14249
14268
|
}
|
|
14250
14269
|
calculate(e, t, r) {
|
|
14251
|
-
if (e.isError())
|
|
14252
|
-
return e;
|
|
14253
|
-
if (t.isError())
|
|
14254
|
-
return t;
|
|
14255
|
-
if (r.isError())
|
|
14256
|
-
return r;
|
|
14257
14270
|
const n = Math.max(
|
|
14258
14271
|
e.isArray() ? e.getRowCount() : 1,
|
|
14259
14272
|
t.isArray() ? t.getRowCount() : 1,
|
|
@@ -14262,25 +14275,27 @@ class sg extends V {
|
|
|
14262
14275
|
e.isArray() ? e.getColumnCount() : 1,
|
|
14263
14276
|
t.isArray() ? t.getColumnCount() : 1,
|
|
14264
14277
|
r.isArray() ? r.getColumnCount() : 1
|
|
14265
|
-
), o = O(n, s, e), u = O(n, s, t), c = O(n, s, r)
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
return l;
|
|
14270
|
-
if (d.isError())
|
|
14271
|
-
return d;
|
|
14278
|
+
), o = O(n, s, e, g.create(m.NA)), u = O(n, s, t, g.create(m.NA)), c = O(n, s, r, g.create(m.NA)), l = o.map((f, h, d) => {
|
|
14279
|
+
const _ = u.get(h, d), C = c.get(h, d);
|
|
14280
|
+
if (f.isError())
|
|
14281
|
+
return f;
|
|
14272
14282
|
if (_.isError())
|
|
14273
14283
|
return _;
|
|
14274
|
-
if (
|
|
14275
|
-
return
|
|
14276
|
-
|
|
14277
|
-
|
|
14278
|
-
|
|
14284
|
+
if (C.isError())
|
|
14285
|
+
return C;
|
|
14286
|
+
const { isError: E, errorObject: b, variants: R } = B(f, _, C);
|
|
14287
|
+
if (E)
|
|
14288
|
+
return b;
|
|
14289
|
+
const [p, N, M] = R;
|
|
14290
|
+
let w = Math.floor(+p.getValue());
|
|
14291
|
+
const S = Math.floor(+N.getValue()), D = Math.floor(+M.getValue());
|
|
14292
|
+
if (w < 0 || w > 9999)
|
|
14279
14293
|
return g.create(m.NUM);
|
|
14280
|
-
|
|
14281
|
-
const
|
|
14282
|
-
return
|
|
14294
|
+
w >= 0 && w < 1899 && (w += 1900);
|
|
14295
|
+
const L = new Date(w, S - 1, D), U = Re(L);
|
|
14296
|
+
return U < 0 ? g.create(m.NUM) : y.create(U, $a);
|
|
14283
14297
|
});
|
|
14298
|
+
return n === 1 && s === 1 ? l.get(0, 0) : l;
|
|
14284
14299
|
}
|
|
14285
14300
|
}
|
|
14286
14301
|
class ag extends V {
|
|
@@ -14483,7 +14498,7 @@ class lg extends V {
|
|
|
14483
14498
|
t.isArray() ? t.getColumnCount() : 1
|
|
14484
14499
|
), s = O(r, n, e), o = O(r, n, t);
|
|
14485
14500
|
return s.map((u, c, l) => {
|
|
14486
|
-
const f = o.get(c, l) ||
|
|
14501
|
+
const f = o.get(c, l) || ce.create();
|
|
14487
14502
|
if (u.isError())
|
|
14488
14503
|
return u;
|
|
14489
14504
|
if (f.isError())
|
|
@@ -14886,7 +14901,7 @@ class yg extends V {
|
|
|
14886
14901
|
return o.map((l, f, h) => this._calculateTime(l, u, c, f, h));
|
|
14887
14902
|
}
|
|
14888
14903
|
_calculateTime(e, t, r, n, s) {
|
|
14889
|
-
let o = e, u = t.get(n, s) ||
|
|
14904
|
+
let o = e, u = t.get(n, s) || ce.create(), c = r.get(n, s) || ce.create();
|
|
14890
14905
|
if ((o.isString() || o.isBoolean()) && (o = o.convertToNumberObjectValue()), (u.isString() || u.isBoolean()) && (u = u.convertToNumberObjectValue()), (c.isString() || c.isBoolean()) && (c = c.convertToNumberObjectValue()), o.isError())
|
|
14891
14906
|
return o;
|
|
14892
14907
|
if (u.isError())
|
|
@@ -15658,7 +15673,7 @@ P.prototype.cos = function() {
|
|
|
15658
15673
|
const i = this.toNumber();
|
|
15659
15674
|
return new P(Math.cos(i));
|
|
15660
15675
|
};
|
|
15661
|
-
let he = class
|
|
15676
|
+
let he = class ue {
|
|
15662
15677
|
constructor(a) {
|
|
15663
15678
|
A(this, "_inumber", "");
|
|
15664
15679
|
A(this, "_realNum", 0);
|
|
@@ -15687,8 +15702,8 @@ let he = class ce {
|
|
|
15687
15702
|
return o;
|
|
15688
15703
|
}
|
|
15689
15704
|
static createByComplexStr(a, e, t) {
|
|
15690
|
-
const r =
|
|
15691
|
-
return new
|
|
15705
|
+
const r = ue.getComplex(a, e, t);
|
|
15706
|
+
return new ue(r);
|
|
15692
15707
|
}
|
|
15693
15708
|
_getImReal() {
|
|
15694
15709
|
if (this._inumber === 0 || this._inumber === "0") {
|
|
@@ -15754,7 +15769,7 @@ let he = class ce {
|
|
|
15754
15769
|
return this._isError;
|
|
15755
15770
|
}
|
|
15756
15771
|
toString() {
|
|
15757
|
-
return
|
|
15772
|
+
return ue.getComplex(this._realNum, this._iNum, this._suffix);
|
|
15758
15773
|
}
|
|
15759
15774
|
isDifferentSuffixes(a) {
|
|
15760
15775
|
const e = a.getSuffix();
|
|
@@ -15769,15 +15784,15 @@ let he = class ce {
|
|
|
15769
15784
|
return this._iNum < 0 && (e = -e), e;
|
|
15770
15785
|
}
|
|
15771
15786
|
Conjugate() {
|
|
15772
|
-
return
|
|
15787
|
+
return ue.getComplex(this._realNum, -this._iNum, this._suffix);
|
|
15773
15788
|
}
|
|
15774
15789
|
Cos() {
|
|
15775
15790
|
if (this._iNum) {
|
|
15776
15791
|
const a = P.cos(this._realNum).mul(P.cosh(this._iNum)).toNumber(), e = P.sin(this._realNum).mul(P.sinh(this._iNum)).negated().toNumber();
|
|
15777
|
-
return
|
|
15792
|
+
return ue.getComplex(a, e, this._suffix);
|
|
15778
15793
|
} else {
|
|
15779
15794
|
const a = P.cos(this._realNum).toNumber();
|
|
15780
|
-
return
|
|
15795
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15781
15796
|
}
|
|
15782
15797
|
}
|
|
15783
15798
|
Cosh() {
|
|
@@ -15785,19 +15800,19 @@ let he = class ce {
|
|
|
15785
15800
|
return this._isError = !0, "";
|
|
15786
15801
|
if (this._iNum) {
|
|
15787
15802
|
const a = P.cosh(this._realNum).mul(P.cos(this._iNum)).toNumber(), e = P.sinh(this._realNum).mul(P.sin(this._iNum)).toNumber();
|
|
15788
|
-
return
|
|
15803
|
+
return ue.getComplex(a, e, this._suffix);
|
|
15789
15804
|
} else {
|
|
15790
15805
|
const a = P.cosh(this._realNum).toNumber();
|
|
15791
|
-
return
|
|
15806
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15792
15807
|
}
|
|
15793
15808
|
}
|
|
15794
15809
|
Cot() {
|
|
15795
15810
|
if (this._iNum) {
|
|
15796
15811
|
const a = P.cosh(this._iNum * 2).sub(P.cos(this._realNum * 2)), e = P.sin(this._realNum * 2).div(a).toNumber(), t = P.sinh(this._iNum * 2).div(a).negated().toNumber();
|
|
15797
|
-
return
|
|
15812
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15798
15813
|
} else {
|
|
15799
15814
|
const a = new P(1).div(P.tan(this._realNum)).toNumber();
|
|
15800
|
-
return
|
|
15815
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15801
15816
|
}
|
|
15802
15817
|
}
|
|
15803
15818
|
Coth() {
|
|
@@ -15805,45 +15820,45 @@ let he = class ce {
|
|
|
15805
15820
|
return this._isError = !0, "";
|
|
15806
15821
|
if (this._iNum) {
|
|
15807
15822
|
const a = P.cosh(this._realNum * 2).sub(P.cos(this._iNum * 2)), e = P.sinh(this._realNum * 2).div(a).toNumber(), t = P.sin(this._iNum * 2).div(a).negated().toNumber();
|
|
15808
|
-
return
|
|
15823
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15809
15824
|
} else {
|
|
15810
15825
|
const a = new P(1).div(P.tanh(this._realNum)).toNumber();
|
|
15811
|
-
return
|
|
15826
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15812
15827
|
}
|
|
15813
15828
|
}
|
|
15814
15829
|
Csc() {
|
|
15815
15830
|
if (this._iNum) {
|
|
15816
15831
|
const a = P.cosh(this._iNum * 2).sub(P.cos(this._realNum * 2)), e = P.sin(this._realNum).mul(P.cosh(this._iNum)).mul(2).div(a).toNumber(), t = P.cos(this._realNum).mul(P.sinh(this._iNum)).mul(-2).div(a).toNumber();
|
|
15817
|
-
return
|
|
15832
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15818
15833
|
} else {
|
|
15819
15834
|
const a = new P(1).div(P.sin(this._realNum)).toNumber();
|
|
15820
|
-
return
|
|
15835
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15821
15836
|
}
|
|
15822
15837
|
}
|
|
15823
15838
|
Csch() {
|
|
15824
15839
|
if (!Number.isFinite(Math.sinh(this._realNum)) || !Number.isFinite(Math.cosh(this._realNum)))
|
|
15825
|
-
return
|
|
15840
|
+
return ue.getComplex(0, 0, this._suffix);
|
|
15826
15841
|
if (this._iNum) {
|
|
15827
15842
|
const a = P.cosh(this._realNum * 2).sub(P.cos(this._iNum * 2)), e = P.sinh(this._realNum).mul(P.cos(this._iNum)).mul(2).div(a).toNumber(), t = P.cosh(this._realNum).mul(P.sin(this._iNum)).mul(-2).div(a).toNumber();
|
|
15828
|
-
return
|
|
15843
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15829
15844
|
} else {
|
|
15830
15845
|
const a = new P(1).div(P.sinh(this._realNum)).toNumber();
|
|
15831
|
-
return
|
|
15846
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15832
15847
|
}
|
|
15833
15848
|
}
|
|
15834
15849
|
Div(a) {
|
|
15835
15850
|
const e = new P(this._realNum), t = new P(this._iNum), r = new P(a.getRealNum()), n = new P(a.getINum()), s = r.mul(r).add(n.mul(n)), o = e.mul(r).add(t.mul(n)).div(s).toNumber(), u = t.mul(r).sub(e.mul(n)).div(s).toNumber(), c = this._suffix === "" ? a.getSuffix() : this._suffix;
|
|
15836
|
-
return
|
|
15851
|
+
return ue.getComplex(o, u, c);
|
|
15837
15852
|
}
|
|
15838
15853
|
Exp() {
|
|
15839
15854
|
if (!Number.isFinite(Math.exp(this._realNum)))
|
|
15840
15855
|
return this._isError = !0, "";
|
|
15841
15856
|
const a = P.exp(this._realNum).mul(P.cos(this._iNum)).toNumber(), e = P.exp(this._realNum).mul(P.sin(this._iNum)).toNumber();
|
|
15842
|
-
return
|
|
15857
|
+
return ue.getComplex(a, e, this._suffix);
|
|
15843
15858
|
}
|
|
15844
15859
|
Ln() {
|
|
15845
15860
|
const a = P.sqrt(P.pow(this._realNum, 2).add(P.pow(this._iNum, 2))), e = P.ln(a).toNumber(), t = P.acos(new P(this._realNum).div(a)).toNumber();
|
|
15846
|
-
return
|
|
15861
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15847
15862
|
}
|
|
15848
15863
|
Log(a) {
|
|
15849
15864
|
const e = P.sqrt(P.pow(this._realNum, 2).add(P.pow(this._iNum, 2))), t = P.ln(e);
|
|
@@ -15853,47 +15868,47 @@ let he = class ce {
|
|
|
15853
15868
|
if (o.eq(0))
|
|
15854
15869
|
return this._isError = !0, "";
|
|
15855
15870
|
const u = t.mul(n).add(r.mul(s)).div(o).toNumber(), c = r.mul(n).sub(t.mul(s)).div(o).toNumber();
|
|
15856
|
-
return
|
|
15871
|
+
return ue.getComplex(u, c, this._suffix);
|
|
15857
15872
|
}
|
|
15858
15873
|
Power(a) {
|
|
15859
15874
|
if (this._realNum === 0 && this._iNum === 0)
|
|
15860
|
-
return a > 0 ?
|
|
15875
|
+
return a > 0 ? ue.getComplex(this._realNum, this._iNum, this._suffix) : (this._isError = !0, "");
|
|
15861
15876
|
let e = P.sqrt(P.pow(this._realNum, 2).add(P.pow(this._iNum, 2))), t = P.acos(new P(this._realNum).div(e));
|
|
15862
15877
|
this._iNum < 0 && (t = t.negated()), e = P.pow(e, a), t = t.mul(a);
|
|
15863
15878
|
const r = P.cos(t).mul(e).toNumber(), n = P.sin(t).mul(e).toNumber();
|
|
15864
|
-
return !Number.isFinite(r) || !Number.isFinite(n) ? (this._isError = !0, "") :
|
|
15879
|
+
return !Number.isFinite(r) || !Number.isFinite(n) ? (this._isError = !0, "") : ue.getComplex(r, n, this._suffix);
|
|
15865
15880
|
}
|
|
15866
15881
|
Product(a) {
|
|
15867
15882
|
const e = new P(this._realNum), t = new P(this._iNum), r = new P(a.getRealNum()), n = new P(a.getINum()), s = e.mul(r).sub(t.mul(n)).toNumber(), o = e.mul(n).add(t.mul(r)).toNumber(), u = this._suffix === "" ? a.getSuffix() : this._suffix;
|
|
15868
|
-
return
|
|
15883
|
+
return ue.getComplex(s, o, u);
|
|
15869
15884
|
}
|
|
15870
15885
|
Sec() {
|
|
15871
15886
|
if (this._iNum) {
|
|
15872
15887
|
const a = P.cosh(this._iNum * 2).add(P.cos(this._realNum * 2)), e = P.cos(this._realNum).mul(P.cosh(this._iNum)).mul(2).div(a).toNumber(), t = P.sin(this._realNum).mul(P.sinh(this._iNum)).mul(2).div(a).toNumber();
|
|
15873
|
-
return
|
|
15888
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15874
15889
|
} else {
|
|
15875
15890
|
const a = new P(1).div(P.cos(this._realNum)).toNumber();
|
|
15876
|
-
return
|
|
15891
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15877
15892
|
}
|
|
15878
15893
|
}
|
|
15879
15894
|
Sech() {
|
|
15880
15895
|
if (!Number.isFinite(Math.sinh(this._realNum * 2)) || !Number.isFinite(Math.cosh(this._realNum * 2)))
|
|
15881
|
-
return
|
|
15896
|
+
return ue.getComplex(0, 0, this._suffix);
|
|
15882
15897
|
if (this._iNum) {
|
|
15883
15898
|
const a = P.cosh(this._realNum * 2).add(P.cos(this._iNum * 2)), e = P.cosh(this._realNum).mul(P.cos(this._iNum)).mul(2).div(a).toNumber(), t = P.sinh(this._realNum).mul(P.sin(this._iNum)).mul(-2).div(a).toNumber();
|
|
15884
|
-
return
|
|
15899
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15885
15900
|
} else {
|
|
15886
15901
|
const a = new P(1).div(P.cosh(this._realNum)).toNumber();
|
|
15887
|
-
return
|
|
15902
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15888
15903
|
}
|
|
15889
15904
|
}
|
|
15890
15905
|
Sin() {
|
|
15891
15906
|
if (this._iNum) {
|
|
15892
15907
|
const a = P.sin(this._realNum).mul(P.cosh(this._iNum)).toNumber(), e = P.cos(this._realNum).mul(P.sinh(this._iNum)).toNumber();
|
|
15893
|
-
return
|
|
15908
|
+
return ue.getComplex(a, e, this._suffix);
|
|
15894
15909
|
} else {
|
|
15895
15910
|
const a = P.sin(this._realNum).toNumber();
|
|
15896
|
-
return
|
|
15911
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15897
15912
|
}
|
|
15898
15913
|
}
|
|
15899
15914
|
Sinh() {
|
|
@@ -15901,10 +15916,10 @@ let he = class ce {
|
|
|
15901
15916
|
return this._isError = !0, "";
|
|
15902
15917
|
if (this._iNum) {
|
|
15903
15918
|
const a = P.sinh(this._realNum).mul(P.cos(this._iNum)).toNumber(), e = P.cosh(this._realNum).mul(P.sin(this._iNum)).toNumber();
|
|
15904
|
-
return
|
|
15919
|
+
return ue.getComplex(a, e, this._suffix);
|
|
15905
15920
|
} else {
|
|
15906
15921
|
const a = P.sinh(this._realNum).toNumber();
|
|
15907
|
-
return
|
|
15922
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15908
15923
|
}
|
|
15909
15924
|
}
|
|
15910
15925
|
Sqrt() {
|
|
@@ -15912,23 +15927,23 @@ let he = class ce {
|
|
|
15912
15927
|
let t = P.acos(new P(this._realNum).div(a));
|
|
15913
15928
|
this._iNum < 0 && (t = t.negated());
|
|
15914
15929
|
const r = e.mul(P.cos(t.div(2).toNumber())).toNumber(), n = e.mul(P.sin(t.div(2))).toNumber();
|
|
15915
|
-
return
|
|
15930
|
+
return ue.getComplex(r, n, this._suffix);
|
|
15916
15931
|
}
|
|
15917
15932
|
Sub(a) {
|
|
15918
15933
|
const e = new P(this._realNum), t = new P(this._iNum), r = new P(a.getRealNum()), n = new P(a.getINum()), s = e.sub(r).toNumber(), o = t.sub(n).toNumber(), u = this._suffix === "" ? a.getSuffix() : this._suffix;
|
|
15919
|
-
return
|
|
15934
|
+
return ue.getComplex(s, o, u);
|
|
15920
15935
|
}
|
|
15921
15936
|
Sum(a) {
|
|
15922
15937
|
const e = new P(this._realNum), t = new P(this._iNum), r = new P(a.getRealNum()), n = new P(a.getINum()), s = e.add(r).toNumber(), o = t.add(n).toNumber(), u = this._suffix === "" ? a.getSuffix() : this._suffix;
|
|
15923
|
-
return
|
|
15938
|
+
return ue.getComplex(s, o, u);
|
|
15924
15939
|
}
|
|
15925
15940
|
Tan() {
|
|
15926
15941
|
if (this._iNum) {
|
|
15927
15942
|
const a = P.cos(this._realNum * 2).add(P.cosh(this._iNum * 2)), e = P.sin(this._realNum * 2).div(a).toNumber(), t = P.sinh(this._iNum * 2).div(a).toNumber();
|
|
15928
|
-
return
|
|
15943
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15929
15944
|
} else {
|
|
15930
15945
|
const a = P.tan(this._realNum).toNumber();
|
|
15931
|
-
return
|
|
15946
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15932
15947
|
}
|
|
15933
15948
|
}
|
|
15934
15949
|
Tanh() {
|
|
@@ -15936,10 +15951,10 @@ let he = class ce {
|
|
|
15936
15951
|
return this._isError = !0, "";
|
|
15937
15952
|
if (this._iNum) {
|
|
15938
15953
|
const a = P.cosh(this._realNum * 2).add(P.cos(this._iNum * 2)), e = P.sinh(this._realNum * 2).div(a).toNumber(), t = P.sin(this._iNum * 2).div(a).toNumber();
|
|
15939
|
-
return
|
|
15954
|
+
return ue.getComplex(e, t, this._suffix);
|
|
15940
15955
|
} else {
|
|
15941
15956
|
const a = P.tanh(this._realNum).toNumber();
|
|
15942
|
-
return
|
|
15957
|
+
return ue.getComplex(a, this._iNum, this._suffix);
|
|
15943
15958
|
}
|
|
15944
15959
|
}
|
|
15945
15960
|
};
|
|
@@ -17583,8 +17598,8 @@ class F1 extends V {
|
|
|
17583
17598
|
const D = $(b);
|
|
17584
17599
|
if (typeof D != "number")
|
|
17585
17600
|
return D;
|
|
17586
|
-
const L = +R.getValue(), U = +p.getValue(), x = Math.floor(+N.getValue()),
|
|
17587
|
-
return Number.isNaN(L) || Number.isNaN(U) || Number.isNaN(x) || Number.isNaN(
|
|
17601
|
+
const L = +R.getValue(), U = +p.getValue(), x = Math.floor(+N.getValue()), k = Math.floor(+M.getValue()), Q = +f.getValue();
|
|
17602
|
+
return Number.isNaN(L) || Number.isNaN(U) || Number.isNaN(x) || Number.isNaN(k) || Number.isNaN(Q) ? g.create(m.VALUE) : L <= 0 || U <= 0 || ![1, 2, 4].includes(x) || k < 0 || k > 4 || Math.floor(w) >= Math.floor(D) ? g.create(m.NUM) : this._getResult(w, S, D, L, U, x, k, Q);
|
|
17588
17603
|
}
|
|
17589
17604
|
_getResult(e, t, r, n, s, o, u, c) {
|
|
17590
17605
|
let l = $t(e, t, o);
|
|
@@ -17907,7 +17922,7 @@ class Z1 extends V {
|
|
|
17907
17922
|
const p = f.get(b, R), N = h.get(b, R), M = d.get(b, R), w = _.get(b, R), { isError: S, errorObject: D, variants: L } = B(E, p, N, M, w);
|
|
17908
17923
|
if (S)
|
|
17909
17924
|
return D;
|
|
17910
|
-
const [U, x,
|
|
17925
|
+
const [U, x, k, Q, ne] = L, z = +U.getValue(), G = +x.getValue(), ge = +k.getValue();
|
|
17911
17926
|
let de = +Q.getValue();
|
|
17912
17927
|
const Ee = Math.floor(+ne.getValue());
|
|
17913
17928
|
return z < 0 || G < 0 || ge <= 0 || de <= 0 || Math.floor(de) > Math.floor(ge) || Ee < 1 || Ee > 12 ? g.create(m.NUM) : (de < 1 && (de = 1), de = Math.floor(de), this._getResult(z, G, ge, de, Ee, b, R));
|
|
@@ -17950,7 +17965,7 @@ class z1 extends V {
|
|
|
17950
17965
|
const p = f.get(b, R), N = h.get(b, R), M = d.get(b, R), w = _.get(b, R), { isError: S, errorObject: D, variants: L } = B(E, p, N, M, w);
|
|
17951
17966
|
if (S)
|
|
17952
17967
|
return D;
|
|
17953
|
-
const [U, x,
|
|
17968
|
+
const [U, x, k, Q, ne] = L, z = +U.getValue(), G = +x.getValue(), ge = +k.getValue(), de = +Q.getValue(), Ee = +ne.getValue();
|
|
17954
17969
|
if (z < 0 || G < 0 || ge <= 0 || de <= 0 || de > ge || Ee <= 0)
|
|
17955
17970
|
return g.create(m.NUM);
|
|
17956
17971
|
const pe = na(z, G, ge, de, Ee);
|
|
@@ -18104,7 +18119,7 @@ class s0 extends V {
|
|
|
18104
18119
|
const N = h.get(R, p), M = d.get(R, p), w = _.get(R, p), S = C.get(R, p), { isError: D, errorObject: L, variants: U } = B(b, N, M, w, S);
|
|
18105
18120
|
if (D)
|
|
18106
18121
|
return L;
|
|
18107
|
-
const [x,
|
|
18122
|
+
const [x, k, Q, ne, z] = U, G = +x.getValue(), ge = +k.getValue(), de = +Q.getValue(), Ee = +ne.getValue(), pe = +z.getValue(), me = ar(G, ge, de, Ee, pe ? 1 : 0);
|
|
18108
18123
|
return Number.isNaN(me) || !Number.isFinite(me) ? g.create(m.NUM) : R === 0 && p === 0 ? y.create(me, ze(this.getLocale())) : y.create(me);
|
|
18109
18124
|
});
|
|
18110
18125
|
return c === 1 && l === 1 ? E.get(0, 0) : E;
|
|
@@ -18194,9 +18209,9 @@ class o0 extends V {
|
|
|
18194
18209
|
u.isArray() ? u.getColumnCount() : 1,
|
|
18195
18210
|
c.isArray() ? c.getColumnCount() : 1
|
|
18196
18211
|
), h = O(l, f, e, g.create(m.NA)), d = O(l, f, t, g.create(m.NA)), _ = O(l, f, r, g.create(m.NA)), C = O(l, f, n, g.create(m.NA)), E = O(l, f, u, g.create(m.NA)), b = O(l, f, c, g.create(m.NA)), R = h.map((p, N, M) => {
|
|
18197
|
-
const w = d.get(N, M), S = _.get(N, M), D = C.get(N, M), L = E.get(N, M), U = b.get(N, M), { isError: x, errorObject:
|
|
18212
|
+
const w = d.get(N, M), S = _.get(N, M), D = C.get(N, M), L = E.get(N, M), U = b.get(N, M), { isError: x, errorObject: k, variants: Q } = B(p, w, S, D, L, U);
|
|
18198
18213
|
if (x)
|
|
18199
|
-
return
|
|
18214
|
+
return k;
|
|
18200
18215
|
const [ne, z, G, ge, de, Ee] = Q, pe = +ne.getValue(), me = +z.getValue(), ve = +G.getValue(), ht = +ge.getValue(), Dt = +de.getValue(), Lt = +Ee.getValue();
|
|
18201
18216
|
if (me < 1 || Math.floor(me) > Math.ceil(ve))
|
|
18202
18217
|
return g.create(m.NUM);
|
|
@@ -18286,10 +18301,10 @@ class c0 extends V {
|
|
|
18286
18301
|
const E = c.get(_, C), b = l.get(_, C), R = f.get(_, C), { isError: p, errorObject: N, variants: M } = B(d, E, b, R);
|
|
18287
18302
|
if (p)
|
|
18288
18303
|
return N;
|
|
18289
|
-
const [w, S, D, L] = M, U = +w.getValue(), x = +S.getValue(),
|
|
18290
|
-
if (
|
|
18304
|
+
const [w, S, D, L] = M, U = +w.getValue(), x = +S.getValue(), k = +D.getValue(), Q = +L.getValue();
|
|
18305
|
+
if (k === 0)
|
|
18291
18306
|
return g.create(m.DIV_BY_ZERO);
|
|
18292
|
-
const ne = Q * U * (x /
|
|
18307
|
+
const ne = Q * U * (x / k - 1);
|
|
18293
18308
|
return y.create(ne);
|
|
18294
18309
|
});
|
|
18295
18310
|
return s === 1 && o === 1 ? h.get(0, 0) : h;
|
|
@@ -18454,7 +18469,7 @@ class m0 extends V {
|
|
|
18454
18469
|
const N = h.get(R, p), M = d.get(R, p), w = _.get(R, p), S = C.get(R, p), { isError: D, errorObject: L, variants: U } = B(b, N, M, w, S);
|
|
18455
18470
|
if (D)
|
|
18456
18471
|
return L;
|
|
18457
|
-
const [x,
|
|
18472
|
+
const [x, k, Q, ne, z] = U, G = +x.getValue(), ge = +k.getValue(), de = +Q.getValue(), Ee = +ne.getValue();
|
|
18458
18473
|
let pe = +z.getValue();
|
|
18459
18474
|
if (pe = pe ? 1 : 0, G === 0 && ge === 0)
|
|
18460
18475
|
return g.create(m.DIV_BY_ZERO);
|
|
@@ -18558,12 +18573,12 @@ class d0 extends V {
|
|
|
18558
18573
|
const x = $(R);
|
|
18559
18574
|
if (typeof x != "number")
|
|
18560
18575
|
return x;
|
|
18561
|
-
const
|
|
18562
|
-
if (Number.isNaN(
|
|
18576
|
+
const k = +p.getValue(), Q = +N.getValue(), ne = +M.getValue(), z = Math.floor(+w.getValue()), G = Math.floor(+S.getValue());
|
|
18577
|
+
if (Number.isNaN(k) || Number.isNaN(Q) || Number.isNaN(ne) || Number.isNaN(z) || Number.isNaN(G))
|
|
18563
18578
|
return g.create(m.VALUE);
|
|
18564
|
-
if (
|
|
18579
|
+
if (k < 0 || Q < 0 || ne <= 0 || ![1, 2, 4].includes(z) || G < 0 || G > 4 || !this._validDate(L, x, D, U, z))
|
|
18565
18580
|
return g.create(m.NUM);
|
|
18566
|
-
const ge = Uu(D, L, U, x,
|
|
18581
|
+
const ge = Uu(D, L, U, x, k, Q, ne, z, G);
|
|
18567
18582
|
return y.create(ge);
|
|
18568
18583
|
}
|
|
18569
18584
|
_validDate(e, t, r, n, s) {
|
|
@@ -18597,8 +18612,8 @@ class C0 extends V {
|
|
|
18597
18612
|
const x = $(R);
|
|
18598
18613
|
if (typeof x != "number")
|
|
18599
18614
|
return x;
|
|
18600
|
-
const
|
|
18601
|
-
return Number.isNaN(
|
|
18615
|
+
const k = +p.getValue(), Q = +N.getValue(), ne = +M.getValue(), z = Math.floor(+w.getValue()), G = Math.floor(+S.getValue());
|
|
18616
|
+
return Number.isNaN(k) || Number.isNaN(Q) || Number.isNaN(ne) || Number.isNaN(z) || Number.isNaN(G) ? g.create(m.VALUE) : k < 0 || Q <= 0 || ne <= 0 || ![1, 2, 4].includes(z) || G < 0 || G > 4 || !this._validDate(L, x, D, U, z) ? g.create(m.NUM) : this._getResult(D, L, U, x, k, Q, ne, z, G);
|
|
18602
18617
|
}
|
|
18603
18618
|
_validDate(e, t, r, n, s) {
|
|
18604
18619
|
return this._getDateCorrectOrder(e, t, r, n) && vu(e, t, s) && Mr(n, e, s);
|
|
@@ -18636,12 +18651,12 @@ class _0 extends V {
|
|
|
18636
18651
|
const D = $(E);
|
|
18637
18652
|
if (typeof D != "number")
|
|
18638
18653
|
return D;
|
|
18639
|
-
const L = +b.getValue(), U = +R.getValue(), x = +p.getValue(),
|
|
18640
|
-
if (Number.isNaN(L) || Number.isNaN(U) || Number.isNaN(x) || Number.isNaN(
|
|
18654
|
+
const L = +b.getValue(), U = +R.getValue(), x = +p.getValue(), k = Math.floor(+N.getValue()), Q = Math.floor(+M.getValue());
|
|
18655
|
+
if (Number.isNaN(L) || Number.isNaN(U) || Number.isNaN(x) || Number.isNaN(k) || Number.isNaN(Q))
|
|
18641
18656
|
return g.create(m.VALUE);
|
|
18642
|
-
if (L < 0 || U < 0 || x <= 0 || ![1, 2, 4].includes(
|
|
18657
|
+
if (L < 0 || U < 0 || x <= 0 || ![1, 2, 4].includes(k) || Q < 0 || Q > 4 || !this._validDate(S, w, D, k))
|
|
18643
18658
|
return g.create(m.NUM);
|
|
18644
|
-
const ne = this._getResult(w, S, D, L, U, x,
|
|
18659
|
+
const ne = this._getResult(w, S, D, L, U, x, k, Q);
|
|
18645
18660
|
return y.create(ne);
|
|
18646
18661
|
}
|
|
18647
18662
|
_validDate(e, t, r, n) {
|
|
@@ -18699,12 +18714,12 @@ class A0 extends V {
|
|
|
18699
18714
|
const D = $(E);
|
|
18700
18715
|
if (typeof D != "number")
|
|
18701
18716
|
return D;
|
|
18702
|
-
const L = +b.getValue(), U = +R.getValue(), x = +p.getValue(),
|
|
18703
|
-
if (Number.isNaN(L) || Number.isNaN(U) || Number.isNaN(x) || Number.isNaN(
|
|
18717
|
+
const L = +b.getValue(), U = +R.getValue(), x = +p.getValue(), k = Math.floor(+N.getValue()), Q = Math.floor(+M.getValue());
|
|
18718
|
+
if (Number.isNaN(L) || Number.isNaN(U) || Number.isNaN(x) || Number.isNaN(k) || Number.isNaN(Q))
|
|
18704
18719
|
return g.create(m.VALUE);
|
|
18705
|
-
if (L < 0 || U <= 0 || x <= 0 || ![1, 2, 4].includes(
|
|
18720
|
+
if (L < 0 || U <= 0 || x <= 0 || ![1, 2, 4].includes(k) || Q < 0 || Q > 4 || !this._validDate(S, w, D, k))
|
|
18706
18721
|
return g.create(m.NUM);
|
|
18707
|
-
const ne = this._getResult(w, S, D, L, U, x,
|
|
18722
|
+
const ne = this._getResult(w, S, D, L, U, x, k, Q);
|
|
18708
18723
|
return y.create(ne);
|
|
18709
18724
|
}
|
|
18710
18725
|
_validDate(e, t, r, n) {
|
|
@@ -18793,7 +18808,7 @@ class b0 extends V {
|
|
|
18793
18808
|
const N = h.get(R, p), M = d.get(R, p), w = _.get(R, p), S = C.get(R, p), { isError: D, errorObject: L, variants: U } = B(b, N, M, w, S);
|
|
18794
18809
|
if (D)
|
|
18795
18810
|
return L;
|
|
18796
|
-
const [x,
|
|
18811
|
+
const [x, k, Q, ne, z] = U, G = +x.getValue(), ge = +k.getValue(), de = +Q.getValue(), Ee = +ne.getValue(), pe = +z.getValue();
|
|
18797
18812
|
if (G <= -1)
|
|
18798
18813
|
return g.create(m.NUM);
|
|
18799
18814
|
const me = qr(G, ge, de, Ee, pe ? 1 : 0);
|
|
@@ -18825,9 +18840,9 @@ class y0 extends V {
|
|
|
18825
18840
|
u.isArray() ? u.getColumnCount() : 1,
|
|
18826
18841
|
c.isArray() ? c.getColumnCount() : 1
|
|
18827
18842
|
), h = O(l, f, e, g.create(m.NA)), d = O(l, f, t, g.create(m.NA)), _ = O(l, f, r, g.create(m.NA)), C = O(l, f, n, g.create(m.NA)), E = O(l, f, u, g.create(m.NA)), b = O(l, f, c, g.create(m.NA)), R = h.map((p, N, M) => {
|
|
18828
|
-
const w = d.get(N, M), S = _.get(N, M), D = C.get(N, M), L = E.get(N, M), U = b.get(N, M), { isError: x, errorObject:
|
|
18843
|
+
const w = d.get(N, M), S = _.get(N, M), D = C.get(N, M), L = E.get(N, M), U = b.get(N, M), { isError: x, errorObject: k, variants: Q } = B(p, w, S, D, L, U);
|
|
18829
18844
|
if (x)
|
|
18830
|
-
return
|
|
18845
|
+
return k;
|
|
18831
18846
|
const [ne, z, G, ge, de, Ee] = Q, pe = +ne.getValue(), me = +z.getValue(), ve = +G.getValue(), ht = +ge.getValue(), Dt = +de.getValue(), Lt = +Ee.getValue();
|
|
18832
18847
|
if (me < 1 || Math.floor(me) > Math.ceil(ve) || me - ve >= 1)
|
|
18833
18848
|
return g.create(m.NUM);
|
|
@@ -18918,7 +18933,7 @@ class V0 extends V {
|
|
|
18918
18933
|
const D = this._getDateCorrectOrder(p, R, N);
|
|
18919
18934
|
if (M < 0 || w < 0 || S < 0 || S > 4 || !D)
|
|
18920
18935
|
return g.create(m.NUM);
|
|
18921
|
-
const L = Du(R, S), { days: U } = _e(R, p, S), { days: x } = _e(N, p, S), { days:
|
|
18936
|
+
const L = Du(R, S), { days: U } = _e(R, p, S), { days: x } = _e(N, p, S), { days: k } = _e(N, R, S), Q = (100 + x / L * M * 100) / (1 + U / L * w) - k / L * M * 100;
|
|
18922
18937
|
return y.create(Q);
|
|
18923
18938
|
}
|
|
18924
18939
|
_getDateCorrectOrder(e, t, r) {
|
|
@@ -18949,7 +18964,7 @@ class N0 extends V {
|
|
|
18949
18964
|
const N = h.get(R, p), M = d.get(R, p), w = _.get(R, p), S = C.get(R, p), { isError: D, errorObject: L, variants: U } = B(b, N, M, w, S);
|
|
18950
18965
|
if (D)
|
|
18951
18966
|
return L;
|
|
18952
|
-
const [x,
|
|
18967
|
+
const [x, k, Q, ne, z] = U, G = +x.getValue(), ge = +k.getValue(), de = +Q.getValue(), Ee = +ne.getValue();
|
|
18953
18968
|
let pe = +z.getValue();
|
|
18954
18969
|
pe = pe ? 1 : 0;
|
|
18955
18970
|
const me = G === 0 ? -de * ge - Ee : ((1 - (1 + G) ** ge) / G * de * (1 + G * pe) - Ee) / (1 + G) ** ge;
|
|
@@ -18980,8 +18995,8 @@ class O0 extends V {
|
|
|
18980
18995
|
c.isArray() ? c.getColumnCount() : 1,
|
|
18981
18996
|
l.isArray() ? l.getColumnCount() : 1
|
|
18982
18997
|
), d = O(f, h, e, g.create(m.NA)), _ = O(f, h, t, g.create(m.NA)), C = O(f, h, r, g.create(m.NA)), E = O(f, h, u, g.create(m.NA)), b = O(f, h, c, g.create(m.NA)), R = O(f, h, l, g.create(m.NA)), p = d.map((N, M, w) => {
|
|
18983
|
-
const S = _.get(M, w), D = C.get(M, w), L = E.get(M, w), U = b.get(M, w), x = R.get(M, w), { isError:
|
|
18984
|
-
if (
|
|
18998
|
+
const S = _.get(M, w), D = C.get(M, w), L = E.get(M, w), U = b.get(M, w), x = R.get(M, w), { isError: k, errorObject: Q, variants: ne } = B(N, S, D, L, U, x);
|
|
18999
|
+
if (k)
|
|
18985
19000
|
return Q;
|
|
18986
19001
|
const [z, G, ge, de, Ee, pe] = ne, me = +z.getValue(), ve = +G.getValue(), ht = +ge.getValue(), Dt = +de.getValue();
|
|
18987
19002
|
let Lt = +Ee.getValue();
|
|
@@ -19274,7 +19289,7 @@ class j0 extends V {
|
|
|
19274
19289
|
const C = t.get(d, _), E = r.get(d, _), b = n.get(d, _), R = s.get(d, _), p = o.get(d, _), N = u.get(d, _), { isError: M, errorObject: w, variants: S } = B(h, C, E, b, R, p, N);
|
|
19275
19290
|
if (M)
|
|
19276
19291
|
return w;
|
|
19277
|
-
const [D, L, U, x,
|
|
19292
|
+
const [D, L, U, x, k, Q, ne] = S, z = +D.getValue(), G = +L.getValue(), ge = +U.getValue(), de = +x.getValue(), Ee = +k.getValue(), pe = +Q.getValue(), me = +ne.getValue();
|
|
19278
19293
|
if (z < 0 || G < 0 || ge < 0 || de < 0 || Ee < 0 || Ee > ge || de > Ee || pe < 0)
|
|
19279
19294
|
return g.create(m.NUM);
|
|
19280
19295
|
if (ge === 0 && de === 0 && Ee === 0)
|
|
@@ -19695,7 +19710,7 @@ class I0 extends V {
|
|
|
19695
19710
|
const D = this._getDateCorrectOrder(p, R, N);
|
|
19696
19711
|
if (M < 0 || w <= 0 || S < 0 || S > 4 || !D)
|
|
19697
19712
|
return g.create(m.NUM);
|
|
19698
|
-
const L = Du(R, S), { days: U } = _e(R, p, S), { days: x } = _e(N, p, S), { days:
|
|
19713
|
+
const L = Du(R, S), { days: U } = _e(R, p, S), { days: x } = _e(N, p, S), { days: k } = _e(N, R, S), Q = ((1 + x / L * M) / (w / 100 + k / L * M) - 1) / (U / L);
|
|
19699
19714
|
return y.create(Q);
|
|
19700
19715
|
}
|
|
19701
19716
|
_getDateCorrectOrder(e, t, r) {
|
|
@@ -20497,7 +20512,7 @@ class Ad extends V {
|
|
|
20497
20512
|
(o) => O(t, r, o, g.create(m.NA))
|
|
20498
20513
|
), s = n[0].map((o, u, c) => {
|
|
20499
20514
|
for (let l = 0; l < n.length; l += 2) {
|
|
20500
|
-
const f = n[l].get(u, c) ||
|
|
20515
|
+
const f = n[l].get(u, c) || ce.create(), h = n[l + 1].get(u, c) || ce.create();
|
|
20501
20516
|
if (f.isNull())
|
|
20502
20517
|
continue;
|
|
20503
20518
|
if (f.isError())
|
|
@@ -20819,7 +20834,7 @@ class Md extends V {
|
|
|
20819
20834
|
calculate(e, ...t) {
|
|
20820
20835
|
if (e.isError())
|
|
20821
20836
|
return e;
|
|
20822
|
-
const r = t.length % 2 !== 0, n = r ? t[t.length - 1] :
|
|
20837
|
+
const r = t.length % 2 !== 0, n = r ? t[t.length - 1] : ce.create();
|
|
20823
20838
|
return !e.isArray() && !t.some((s) => s.isArray()) ? this._handleNonArrayInputs(e, t, n, r) : this._handleArrayInputs(e, t, n, r);
|
|
20824
20839
|
}
|
|
20825
20840
|
_handleNonArrayInputs(e, t, r, n) {
|
|
@@ -20848,7 +20863,7 @@ class Md extends V {
|
|
|
20848
20863
|
), l = O(s, o, r, g.create(m.NA));
|
|
20849
20864
|
return u.map((f, h, d) => {
|
|
20850
20865
|
for (let C = 0; C < c.length - (n ? 1 : 0); C += 2) {
|
|
20851
|
-
const E = c[C].get(h, d) ||
|
|
20866
|
+
const E = c[C].get(h, d) || ce.create(), b = c[C + 1].get(h, d) || ce.create();
|
|
20852
20867
|
if (!E.isNull()) {
|
|
20853
20868
|
if (E.isError() || f.isError())
|
|
20854
20869
|
return E.isError() ? E : f;
|
|
@@ -20856,7 +20871,7 @@ class Md extends V {
|
|
|
20856
20871
|
return b.isNull() ? g.create(m.NA) : b;
|
|
20857
20872
|
}
|
|
20858
20873
|
}
|
|
20859
|
-
const _ = l.get(h, d) ||
|
|
20874
|
+
const _ = l.get(h, d) || ce.create();
|
|
20860
20875
|
return _.isNull() ? g.create(m.NA) : _;
|
|
20861
20876
|
});
|
|
20862
20877
|
}
|
|
@@ -22844,7 +22859,7 @@ class fC extends V {
|
|
|
22844
22859
|
const u = Is(n), c = Bs(r);
|
|
22845
22860
|
o = s.binarySearch(e, u, c);
|
|
22846
22861
|
} else if (r === 2) {
|
|
22847
|
-
const u = s.compare(e,
|
|
22862
|
+
const u = s.compare(e, F.EQUALS);
|
|
22848
22863
|
let c;
|
|
22849
22864
|
if (n !== -1 ? c = u.getFirstTruePosition() : c = u.getLastTruePosition(), c == null)
|
|
22850
22865
|
return g.create(m.NA);
|
|
@@ -25082,7 +25097,7 @@ class x_ extends V {
|
|
|
25082
25097
|
return this._calculateSingleCell(e, t);
|
|
25083
25098
|
{
|
|
25084
25099
|
const l = e.flatten(), f = t.flatten();
|
|
25085
|
-
let h =
|
|
25100
|
+
let h = ce.create();
|
|
25086
25101
|
const d = [], _ = [];
|
|
25087
25102
|
let C = 0;
|
|
25088
25103
|
return l.iterator((E, b, R) => {
|
|
@@ -25134,7 +25149,7 @@ class j_ extends V {
|
|
|
25134
25149
|
return this._calculateSingleCell(e, t);
|
|
25135
25150
|
{
|
|
25136
25151
|
const l = e.flatten(), f = t.flatten();
|
|
25137
|
-
let h =
|
|
25152
|
+
let h = ce.create();
|
|
25138
25153
|
const d = [], _ = [];
|
|
25139
25154
|
let C = 0;
|
|
25140
25155
|
return l.iterator((E, b, R) => {
|
|
@@ -25186,7 +25201,7 @@ class U_ extends V {
|
|
|
25186
25201
|
return this._calculateSingleCell(e, t);
|
|
25187
25202
|
{
|
|
25188
25203
|
const l = e.flatten(), f = t.flatten();
|
|
25189
|
-
let h =
|
|
25204
|
+
let h = ce.create();
|
|
25190
25205
|
const d = [], _ = [];
|
|
25191
25206
|
let C = 0;
|
|
25192
25207
|
return l.iterator((E, b, R) => {
|
|
@@ -25354,7 +25369,7 @@ class F_ extends V {
|
|
|
25354
25369
|
super(...arguments);
|
|
25355
25370
|
A(this, "minParams", 2);
|
|
25356
25371
|
A(this, "maxParams", 2);
|
|
25357
|
-
A(this, "_compareType",
|
|
25372
|
+
A(this, "_compareType", F.EQUALS);
|
|
25358
25373
|
}
|
|
25359
25374
|
setCompareType(e) {
|
|
25360
25375
|
this._compareType = e;
|
|
@@ -26170,9 +26185,9 @@ class mA extends V {
|
|
|
26170
26185
|
if (e.isError())
|
|
26171
26186
|
return e;
|
|
26172
26187
|
if (e.isNull() || e.isBoolean())
|
|
26173
|
-
return
|
|
26188
|
+
return ce.create();
|
|
26174
26189
|
const t = e.getValue();
|
|
26175
|
-
return W(t) ? y.create(+t) :
|
|
26190
|
+
return W(t) ? y.create(+t) : ce.create();
|
|
26176
26191
|
}
|
|
26177
26192
|
}
|
|
26178
26193
|
class gA extends V {
|
|
@@ -26812,20 +26827,20 @@ class wA extends V {
|
|
|
26812
26827
|
const { coefficients: o, X: u, XTXInverse: c } = s;
|
|
26813
26828
|
let l = [];
|
|
26814
26829
|
if (n) {
|
|
26815
|
-
const f = e.flat(), h = f.length, d = r ? f.reduce((x,
|
|
26830
|
+
const f = e.flat(), h = f.length, d = r ? f.reduce((x, k) => x + k, 0) / h : 0, _ = c.length, C = h - _, E = o[0].length, b = new Array(E - 2).fill(m.NA), R = o[0][E - 1], p = [];
|
|
26816
26831
|
for (let x = 0; x < u.length; x++) {
|
|
26817
|
-
let
|
|
26832
|
+
let k = R;
|
|
26818
26833
|
for (let Q = E - 2; Q >= 0; Q--)
|
|
26819
|
-
|
|
26820
|
-
p.push(
|
|
26834
|
+
k += o[0][E - 2 - Q] * u[x][Q];
|
|
26835
|
+
p.push(k);
|
|
26821
26836
|
}
|
|
26822
26837
|
let N = 0, M = 0;
|
|
26823
26838
|
for (let x = 0; x < h; x++)
|
|
26824
26839
|
N += (f[x] - d) ** 2, M += (f[x] - p[x]) ** 2;
|
|
26825
26840
|
const w = N - M, S = N === 0 ? 0 : w / N, D = [];
|
|
26826
26841
|
for (let x = _ - 1; x >= 0; x--) {
|
|
26827
|
-
const
|
|
26828
|
-
D.push(
|
|
26842
|
+
const k = C > 0 ? Math.sqrt(M / C * c[x][x]) : 0;
|
|
26843
|
+
D.push(k);
|
|
26829
26844
|
}
|
|
26830
26845
|
if (r) {
|
|
26831
26846
|
const x = D.shift();
|
|
@@ -26933,25 +26948,25 @@ class SA extends V {
|
|
|
26933
26948
|
const { coefficients: o, Y: u, X: c, XTXInverse: l } = s;
|
|
26934
26949
|
let f = [];
|
|
26935
26950
|
if (n) {
|
|
26936
|
-
const h = u.flat(), d = h.length, _ = r ? h.reduce((
|
|
26937
|
-
for (let
|
|
26951
|
+
const h = u.flat(), d = h.length, _ = r ? h.reduce((k, Q) => k + Q, 0) / d : 0, C = l.length, E = d - C, b = o[0].length, R = new Array(b - 2).fill(m.NA), p = o[0][b - 1], N = [];
|
|
26952
|
+
for (let k = 0; k < c.length; k++) {
|
|
26938
26953
|
let Q = p;
|
|
26939
26954
|
for (let ne = b - 2; ne >= 0; ne--)
|
|
26940
|
-
Q *= o[0][b - 2 - ne] ** c[
|
|
26955
|
+
Q *= o[0][b - 2 - ne] ** c[k][ne];
|
|
26941
26956
|
N.push(Math.log(Q));
|
|
26942
26957
|
}
|
|
26943
26958
|
let M = 0, w = 0;
|
|
26944
|
-
for (let
|
|
26945
|
-
M += (h[
|
|
26959
|
+
for (let k = 0; k < d; k++)
|
|
26960
|
+
M += (h[k] - _) ** 2, !(!r && !Number.isFinite(N[k])) && (w += (h[k] - N[k]) ** 2);
|
|
26946
26961
|
Number.isFinite(w) || (w = 0);
|
|
26947
26962
|
const S = M - w, D = M === 0 ? 0 : S / M, L = [];
|
|
26948
|
-
for (let
|
|
26949
|
-
const Q = E > 0 ? Math.sqrt(w / E * l[
|
|
26963
|
+
for (let k = C - 1; k >= 0; k--) {
|
|
26964
|
+
const Q = E > 0 ? Math.sqrt(w / E * l[k][k]) : 0;
|
|
26950
26965
|
L.push(Q);
|
|
26951
26966
|
}
|
|
26952
26967
|
if (r) {
|
|
26953
|
-
const
|
|
26954
|
-
L.push(
|
|
26968
|
+
const k = L.shift();
|
|
26969
|
+
L.push(k);
|
|
26955
26970
|
} else
|
|
26956
26971
|
L.push(m.NA);
|
|
26957
26972
|
const U = E > 0 ? Math.sqrt(w / E) : 0, x = E > 0 ? S / (b - 1) / (w / E) : m.NUM;
|
|
@@ -28946,7 +28961,7 @@ class ME extends V {
|
|
|
28946
28961
|
), n = Math.max(
|
|
28947
28962
|
e.isArray() ? e.getColumnCount() : 1,
|
|
28948
28963
|
t.isArray() ? t.getColumnCount() : 1
|
|
28949
|
-
), s = O(r, n, e,
|
|
28964
|
+
), s = O(r, n, e, ce.create()), o = O(r, n, t, ce.create()), u = s.mapValue((c, l, f) => {
|
|
28950
28965
|
const h = o.get(l, f);
|
|
28951
28966
|
return c.isError() ? c : h.isError() ? h : this._handleSingleObject(c, h);
|
|
28952
28967
|
});
|
|
@@ -29161,7 +29176,7 @@ class xE extends V {
|
|
|
29161
29176
|
), s = Math.max(
|
|
29162
29177
|
e.isArray() ? e.getColumnCount() : 1,
|
|
29163
29178
|
r.isArray() ? r.getColumnCount() : 1
|
|
29164
|
-
), o = O(n, s, e,
|
|
29179
|
+
), o = O(n, s, e, ce.create()), u = O(n, s, r, ce.create()), c = o.mapValue((l, f, h) => {
|
|
29165
29180
|
const d = u.get(f, h);
|
|
29166
29181
|
return l.isError() ? l : d.isError() ? d : this._handleSingleObject(l, d);
|
|
29167
29182
|
});
|
|
@@ -30314,12 +30329,7 @@ class lb extends V {
|
|
|
30314
30329
|
if (c.isBoolean())
|
|
30315
30330
|
return c;
|
|
30316
30331
|
let d = c.getValue();
|
|
30317
|
-
|
|
30318
|
-
if (!W(d))
|
|
30319
|
-
return c;
|
|
30320
|
-
d = Number(d);
|
|
30321
|
-
}
|
|
30322
|
-
h.isNull() && (h = j.create(" "));
|
|
30332
|
+
c.isNull() && (d = 0), c.isString() && W(d) && (d = Number(d)), h.isNull() && (h = j.create(" "));
|
|
30323
30333
|
const _ = `${h.getValue()}`, C = qa(_, d);
|
|
30324
30334
|
return j.create(_ === " " ? C.trimEnd() : C);
|
|
30325
30335
|
});
|
|
@@ -30578,7 +30588,7 @@ class mb extends V {
|
|
|
30578
30588
|
return r;
|
|
30579
30589
|
const [u] = o, c = +u.getValue();
|
|
30580
30590
|
let l = r;
|
|
30581
|
-
c && (l = r.filter((h) => h !== null));
|
|
30591
|
+
c && (l = r.filter((h) => h !== null && h !== ""));
|
|
30582
30592
|
let f = "";
|
|
30583
30593
|
for (let h = 0; h < l.length; h++)
|
|
30584
30594
|
l[h] !== null && (f += l[h]), h < l.length - 1 && (f += e[h % e.length]);
|
|
@@ -31545,7 +31555,7 @@ export {
|
|
|
31545
31555
|
Ar as Lexer,
|
|
31546
31556
|
ae as LexerNode,
|
|
31547
31557
|
ga as LexerTreeBuilder,
|
|
31548
|
-
|
|
31558
|
+
ce as NullValueObject,
|
|
31549
31559
|
y as NumberValueObject,
|
|
31550
31560
|
wn as OperatorNodeFactory,
|
|
31551
31561
|
Ih as OtherFormulaManagerService,
|
|
@@ -31577,7 +31587,7 @@ export {
|
|
|
31577
31587
|
Wi as UniverFormulaEnginePlugin,
|
|
31578
31588
|
Io as ValueNodeFactory,
|
|
31579
31589
|
Mt as ValueObjectFactory,
|
|
31580
|
-
|
|
31590
|
+
F as compareToken,
|
|
31581
31591
|
Ic as convertUnitDataToRuntime,
|
|
31582
31592
|
Wh as deserializeRangeForR1C1,
|
|
31583
31593
|
Dr as deserializeRangeWithSheet,
|
|
@@ -31618,8 +31628,10 @@ export {
|
|
|
31618
31628
|
Wc as isReferenceStrings,
|
|
31619
31629
|
Xb as matchRefDrawToken,
|
|
31620
31630
|
K as matchToken,
|
|
31631
|
+
Ds as needsQuoting,
|
|
31621
31632
|
Kb as normalizeSheetName,
|
|
31622
31633
|
X as operatorToken,
|
|
31634
|
+
Ls as quoteSheetName,
|
|
31623
31635
|
$e as sequenceNodeType,
|
|
31624
31636
|
Ft as serializeRange,
|
|
31625
31637
|
Ss as serializeRangeToRefString,
|
|
@@ -31627,5 +31639,6 @@ export {
|
|
|
31627
31639
|
Gc as serializeRangeWithSpreadsheet,
|
|
31628
31640
|
fs as singleReferenceToGrid,
|
|
31629
31641
|
yi as strip,
|
|
31630
|
-
ba as stripErrorMargin
|
|
31642
|
+
ba as stripErrorMargin,
|
|
31643
|
+
ui as unquoteSheetName
|
|
31631
31644
|
};
|