@univerjs/engine-formula 0.10.14-nightly.202511031023 → 0.10.14-nightly.202511070640
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 +284 -262
- package/lib/index.js +284 -262
- 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 +3 -3
package/lib/es/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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
};
|
|
@@ -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) {
|
|
@@ -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 {
|
|
@@ -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;
|
|
@@ -10802,7 +10821,7 @@ 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) {
|
|
@@ -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
|
}
|
|
@@ -17579,8 +17598,8 @@ class F1 extends V {
|
|
|
17579
17598
|
const D = $(b);
|
|
17580
17599
|
if (typeof D != "number")
|
|
17581
17600
|
return D;
|
|
17582
|
-
const L = +R.getValue(), U = +p.getValue(), x = Math.floor(+N.getValue()),
|
|
17583
|
-
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);
|
|
17584
17603
|
}
|
|
17585
17604
|
_getResult(e, t, r, n, s, o, u, c) {
|
|
17586
17605
|
let l = $t(e, t, o);
|
|
@@ -17903,7 +17922,7 @@ class Z1 extends V {
|
|
|
17903
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);
|
|
17904
17923
|
if (S)
|
|
17905
17924
|
return D;
|
|
17906
|
-
const [U, x,
|
|
17925
|
+
const [U, x, k, Q, ne] = L, z = +U.getValue(), G = +x.getValue(), ge = +k.getValue();
|
|
17907
17926
|
let de = +Q.getValue();
|
|
17908
17927
|
const Ee = Math.floor(+ne.getValue());
|
|
17909
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));
|
|
@@ -17946,7 +17965,7 @@ class z1 extends V {
|
|
|
17946
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);
|
|
17947
17966
|
if (S)
|
|
17948
17967
|
return D;
|
|
17949
|
-
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();
|
|
17950
17969
|
if (z < 0 || G < 0 || ge <= 0 || de <= 0 || de > ge || Ee <= 0)
|
|
17951
17970
|
return g.create(m.NUM);
|
|
17952
17971
|
const pe = na(z, G, ge, de, Ee);
|
|
@@ -18100,7 +18119,7 @@ class s0 extends V {
|
|
|
18100
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);
|
|
18101
18120
|
if (D)
|
|
18102
18121
|
return L;
|
|
18103
|
-
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);
|
|
18104
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);
|
|
18105
18124
|
});
|
|
18106
18125
|
return c === 1 && l === 1 ? E.get(0, 0) : E;
|
|
@@ -18190,9 +18209,9 @@ class o0 extends V {
|
|
|
18190
18209
|
u.isArray() ? u.getColumnCount() : 1,
|
|
18191
18210
|
c.isArray() ? c.getColumnCount() : 1
|
|
18192
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) => {
|
|
18193
|
-
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);
|
|
18194
18213
|
if (x)
|
|
18195
|
-
return
|
|
18214
|
+
return k;
|
|
18196
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();
|
|
18197
18216
|
if (me < 1 || Math.floor(me) > Math.ceil(ve))
|
|
18198
18217
|
return g.create(m.NUM);
|
|
@@ -18282,10 +18301,10 @@ class c0 extends V {
|
|
|
18282
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);
|
|
18283
18302
|
if (p)
|
|
18284
18303
|
return N;
|
|
18285
|
-
const [w, S, D, L] = M, U = +w.getValue(), x = +S.getValue(),
|
|
18286
|
-
if (
|
|
18304
|
+
const [w, S, D, L] = M, U = +w.getValue(), x = +S.getValue(), k = +D.getValue(), Q = +L.getValue();
|
|
18305
|
+
if (k === 0)
|
|
18287
18306
|
return g.create(m.DIV_BY_ZERO);
|
|
18288
|
-
const ne = Q * U * (x /
|
|
18307
|
+
const ne = Q * U * (x / k - 1);
|
|
18289
18308
|
return y.create(ne);
|
|
18290
18309
|
});
|
|
18291
18310
|
return s === 1 && o === 1 ? h.get(0, 0) : h;
|
|
@@ -18450,7 +18469,7 @@ class m0 extends V {
|
|
|
18450
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);
|
|
18451
18470
|
if (D)
|
|
18452
18471
|
return L;
|
|
18453
|
-
const [x,
|
|
18472
|
+
const [x, k, Q, ne, z] = U, G = +x.getValue(), ge = +k.getValue(), de = +Q.getValue(), Ee = +ne.getValue();
|
|
18454
18473
|
let pe = +z.getValue();
|
|
18455
18474
|
if (pe = pe ? 1 : 0, G === 0 && ge === 0)
|
|
18456
18475
|
return g.create(m.DIV_BY_ZERO);
|
|
@@ -18554,12 +18573,12 @@ class d0 extends V {
|
|
|
18554
18573
|
const x = $(R);
|
|
18555
18574
|
if (typeof x != "number")
|
|
18556
18575
|
return x;
|
|
18557
|
-
const
|
|
18558
|
-
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))
|
|
18559
18578
|
return g.create(m.VALUE);
|
|
18560
|
-
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))
|
|
18561
18580
|
return g.create(m.NUM);
|
|
18562
|
-
const ge = Uu(D, L, U, x,
|
|
18581
|
+
const ge = Uu(D, L, U, x, k, Q, ne, z, G);
|
|
18563
18582
|
return y.create(ge);
|
|
18564
18583
|
}
|
|
18565
18584
|
_validDate(e, t, r, n, s) {
|
|
@@ -18593,8 +18612,8 @@ class C0 extends V {
|
|
|
18593
18612
|
const x = $(R);
|
|
18594
18613
|
if (typeof x != "number")
|
|
18595
18614
|
return x;
|
|
18596
|
-
const
|
|
18597
|
-
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);
|
|
18598
18617
|
}
|
|
18599
18618
|
_validDate(e, t, r, n, s) {
|
|
18600
18619
|
return this._getDateCorrectOrder(e, t, r, n) && vu(e, t, s) && Mr(n, e, s);
|
|
@@ -18632,12 +18651,12 @@ class _0 extends V {
|
|
|
18632
18651
|
const D = $(E);
|
|
18633
18652
|
if (typeof D != "number")
|
|
18634
18653
|
return D;
|
|
18635
|
-
const L = +b.getValue(), U = +R.getValue(), x = +p.getValue(),
|
|
18636
|
-
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))
|
|
18637
18656
|
return g.create(m.VALUE);
|
|
18638
|
-
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))
|
|
18639
18658
|
return g.create(m.NUM);
|
|
18640
|
-
const ne = this._getResult(w, S, D, L, U, x,
|
|
18659
|
+
const ne = this._getResult(w, S, D, L, U, x, k, Q);
|
|
18641
18660
|
return y.create(ne);
|
|
18642
18661
|
}
|
|
18643
18662
|
_validDate(e, t, r, n) {
|
|
@@ -18695,12 +18714,12 @@ class A0 extends V {
|
|
|
18695
18714
|
const D = $(E);
|
|
18696
18715
|
if (typeof D != "number")
|
|
18697
18716
|
return D;
|
|
18698
|
-
const L = +b.getValue(), U = +R.getValue(), x = +p.getValue(),
|
|
18699
|
-
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))
|
|
18700
18719
|
return g.create(m.VALUE);
|
|
18701
|
-
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))
|
|
18702
18721
|
return g.create(m.NUM);
|
|
18703
|
-
const ne = this._getResult(w, S, D, L, U, x,
|
|
18722
|
+
const ne = this._getResult(w, S, D, L, U, x, k, Q);
|
|
18704
18723
|
return y.create(ne);
|
|
18705
18724
|
}
|
|
18706
18725
|
_validDate(e, t, r, n) {
|
|
@@ -18789,7 +18808,7 @@ class b0 extends V {
|
|
|
18789
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);
|
|
18790
18809
|
if (D)
|
|
18791
18810
|
return L;
|
|
18792
|
-
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();
|
|
18793
18812
|
if (G <= -1)
|
|
18794
18813
|
return g.create(m.NUM);
|
|
18795
18814
|
const me = qr(G, ge, de, Ee, pe ? 1 : 0);
|
|
@@ -18821,9 +18840,9 @@ class y0 extends V {
|
|
|
18821
18840
|
u.isArray() ? u.getColumnCount() : 1,
|
|
18822
18841
|
c.isArray() ? c.getColumnCount() : 1
|
|
18823
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) => {
|
|
18824
|
-
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);
|
|
18825
18844
|
if (x)
|
|
18826
|
-
return
|
|
18845
|
+
return k;
|
|
18827
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();
|
|
18828
18847
|
if (me < 1 || Math.floor(me) > Math.ceil(ve) || me - ve >= 1)
|
|
18829
18848
|
return g.create(m.NUM);
|
|
@@ -18914,7 +18933,7 @@ class V0 extends V {
|
|
|
18914
18933
|
const D = this._getDateCorrectOrder(p, R, N);
|
|
18915
18934
|
if (M < 0 || w < 0 || S < 0 || S > 4 || !D)
|
|
18916
18935
|
return g.create(m.NUM);
|
|
18917
|
-
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;
|
|
18918
18937
|
return y.create(Q);
|
|
18919
18938
|
}
|
|
18920
18939
|
_getDateCorrectOrder(e, t, r) {
|
|
@@ -18945,7 +18964,7 @@ class N0 extends V {
|
|
|
18945
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);
|
|
18946
18965
|
if (D)
|
|
18947
18966
|
return L;
|
|
18948
|
-
const [x,
|
|
18967
|
+
const [x, k, Q, ne, z] = U, G = +x.getValue(), ge = +k.getValue(), de = +Q.getValue(), Ee = +ne.getValue();
|
|
18949
18968
|
let pe = +z.getValue();
|
|
18950
18969
|
pe = pe ? 1 : 0;
|
|
18951
18970
|
const me = G === 0 ? -de * ge - Ee : ((1 - (1 + G) ** ge) / G * de * (1 + G * pe) - Ee) / (1 + G) ** ge;
|
|
@@ -18976,8 +18995,8 @@ class O0 extends V {
|
|
|
18976
18995
|
c.isArray() ? c.getColumnCount() : 1,
|
|
18977
18996
|
l.isArray() ? l.getColumnCount() : 1
|
|
18978
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) => {
|
|
18979
|
-
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:
|
|
18980
|
-
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)
|
|
18981
19000
|
return Q;
|
|
18982
19001
|
const [z, G, ge, de, Ee, pe] = ne, me = +z.getValue(), ve = +G.getValue(), ht = +ge.getValue(), Dt = +de.getValue();
|
|
18983
19002
|
let Lt = +Ee.getValue();
|
|
@@ -19270,7 +19289,7 @@ class j0 extends V {
|
|
|
19270
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);
|
|
19271
19290
|
if (M)
|
|
19272
19291
|
return w;
|
|
19273
|
-
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();
|
|
19274
19293
|
if (z < 0 || G < 0 || ge < 0 || de < 0 || Ee < 0 || Ee > ge || de > Ee || pe < 0)
|
|
19275
19294
|
return g.create(m.NUM);
|
|
19276
19295
|
if (ge === 0 && de === 0 && Ee === 0)
|
|
@@ -19691,7 +19710,7 @@ class I0 extends V {
|
|
|
19691
19710
|
const D = this._getDateCorrectOrder(p, R, N);
|
|
19692
19711
|
if (M < 0 || w <= 0 || S < 0 || S > 4 || !D)
|
|
19693
19712
|
return g.create(m.NUM);
|
|
19694
|
-
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);
|
|
19695
19714
|
return y.create(Q);
|
|
19696
19715
|
}
|
|
19697
19716
|
_getDateCorrectOrder(e, t, r) {
|
|
@@ -22840,7 +22859,7 @@ class fC extends V {
|
|
|
22840
22859
|
const u = Is(n), c = Bs(r);
|
|
22841
22860
|
o = s.binarySearch(e, u, c);
|
|
22842
22861
|
} else if (r === 2) {
|
|
22843
|
-
const u = s.compare(e,
|
|
22862
|
+
const u = s.compare(e, F.EQUALS);
|
|
22844
22863
|
let c;
|
|
22845
22864
|
if (n !== -1 ? c = u.getFirstTruePosition() : c = u.getLastTruePosition(), c == null)
|
|
22846
22865
|
return g.create(m.NA);
|
|
@@ -25350,7 +25369,7 @@ class F_ extends V {
|
|
|
25350
25369
|
super(...arguments);
|
|
25351
25370
|
A(this, "minParams", 2);
|
|
25352
25371
|
A(this, "maxParams", 2);
|
|
25353
|
-
A(this, "_compareType",
|
|
25372
|
+
A(this, "_compareType", F.EQUALS);
|
|
25354
25373
|
}
|
|
25355
25374
|
setCompareType(e) {
|
|
25356
25375
|
this._compareType = e;
|
|
@@ -26808,20 +26827,20 @@ class wA extends V {
|
|
|
26808
26827
|
const { coefficients: o, X: u, XTXInverse: c } = s;
|
|
26809
26828
|
let l = [];
|
|
26810
26829
|
if (n) {
|
|
26811
|
-
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 = [];
|
|
26812
26831
|
for (let x = 0; x < u.length; x++) {
|
|
26813
|
-
let
|
|
26832
|
+
let k = R;
|
|
26814
26833
|
for (let Q = E - 2; Q >= 0; Q--)
|
|
26815
|
-
|
|
26816
|
-
p.push(
|
|
26834
|
+
k += o[0][E - 2 - Q] * u[x][Q];
|
|
26835
|
+
p.push(k);
|
|
26817
26836
|
}
|
|
26818
26837
|
let N = 0, M = 0;
|
|
26819
26838
|
for (let x = 0; x < h; x++)
|
|
26820
26839
|
N += (f[x] - d) ** 2, M += (f[x] - p[x]) ** 2;
|
|
26821
26840
|
const w = N - M, S = N === 0 ? 0 : w / N, D = [];
|
|
26822
26841
|
for (let x = _ - 1; x >= 0; x--) {
|
|
26823
|
-
const
|
|
26824
|
-
D.push(
|
|
26842
|
+
const k = C > 0 ? Math.sqrt(M / C * c[x][x]) : 0;
|
|
26843
|
+
D.push(k);
|
|
26825
26844
|
}
|
|
26826
26845
|
if (r) {
|
|
26827
26846
|
const x = D.shift();
|
|
@@ -26929,25 +26948,25 @@ class SA extends V {
|
|
|
26929
26948
|
const { coefficients: o, Y: u, X: c, XTXInverse: l } = s;
|
|
26930
26949
|
let f = [];
|
|
26931
26950
|
if (n) {
|
|
26932
|
-
const h = u.flat(), d = h.length, _ = r ? h.reduce((
|
|
26933
|
-
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++) {
|
|
26934
26953
|
let Q = p;
|
|
26935
26954
|
for (let ne = b - 2; ne >= 0; ne--)
|
|
26936
|
-
Q *= o[0][b - 2 - ne] ** c[
|
|
26955
|
+
Q *= o[0][b - 2 - ne] ** c[k][ne];
|
|
26937
26956
|
N.push(Math.log(Q));
|
|
26938
26957
|
}
|
|
26939
26958
|
let M = 0, w = 0;
|
|
26940
|
-
for (let
|
|
26941
|
-
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);
|
|
26942
26961
|
Number.isFinite(w) || (w = 0);
|
|
26943
26962
|
const S = M - w, D = M === 0 ? 0 : S / M, L = [];
|
|
26944
|
-
for (let
|
|
26945
|
-
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;
|
|
26946
26965
|
L.push(Q);
|
|
26947
26966
|
}
|
|
26948
26967
|
if (r) {
|
|
26949
|
-
const
|
|
26950
|
-
L.push(
|
|
26968
|
+
const k = L.shift();
|
|
26969
|
+
L.push(k);
|
|
26951
26970
|
} else
|
|
26952
26971
|
L.push(m.NA);
|
|
26953
26972
|
const U = E > 0 ? Math.sqrt(w / E) : 0, x = E > 0 ? S / (b - 1) / (w / E) : m.NUM;
|
|
@@ -30574,7 +30593,7 @@ class mb extends V {
|
|
|
30574
30593
|
return r;
|
|
30575
30594
|
const [u] = o, c = +u.getValue();
|
|
30576
30595
|
let l = r;
|
|
30577
|
-
c && (l = r.filter((h) => h !== null));
|
|
30596
|
+
c && (l = r.filter((h) => h !== null && h !== ""));
|
|
30578
30597
|
let f = "";
|
|
30579
30598
|
for (let h = 0; h < l.length; h++)
|
|
30580
30599
|
l[h] !== null && (f += l[h]), h < l.length - 1 && (f += e[h % e.length]);
|
|
@@ -31573,7 +31592,7 @@ export {
|
|
|
31573
31592
|
Wi as UniverFormulaEnginePlugin,
|
|
31574
31593
|
Io as ValueNodeFactory,
|
|
31575
31594
|
Mt as ValueObjectFactory,
|
|
31576
|
-
|
|
31595
|
+
F as compareToken,
|
|
31577
31596
|
Ic as convertUnitDataToRuntime,
|
|
31578
31597
|
Wh as deserializeRangeForR1C1,
|
|
31579
31598
|
Dr as deserializeRangeWithSheet,
|
|
@@ -31614,8 +31633,10 @@ export {
|
|
|
31614
31633
|
Wc as isReferenceStrings,
|
|
31615
31634
|
Xb as matchRefDrawToken,
|
|
31616
31635
|
K as matchToken,
|
|
31636
|
+
Ds as needsQuoting,
|
|
31617
31637
|
Kb as normalizeSheetName,
|
|
31618
31638
|
X as operatorToken,
|
|
31639
|
+
Ls as quoteSheetName,
|
|
31619
31640
|
$e as sequenceNodeType,
|
|
31620
31641
|
Ft as serializeRange,
|
|
31621
31642
|
Ss as serializeRangeToRefString,
|
|
@@ -31623,5 +31644,6 @@ export {
|
|
|
31623
31644
|
Gc as serializeRangeWithSpreadsheet,
|
|
31624
31645
|
fs as singleReferenceToGrid,
|
|
31625
31646
|
yi as strip,
|
|
31626
|
-
ba as stripErrorMargin
|
|
31647
|
+
ba as stripErrorMargin,
|
|
31648
|
+
ui as unquoteSheetName
|
|
31627
31649
|
};
|