zsysview 0.0.26 → 0.0.27
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/dist/backup-DgoJ-AYS.js +519 -0
- package/dist/breadcrumb.vue_vue_type_script_setup_true_lang-CGEOrj8x.js +43 -0
- package/dist/change_password-CfTKlKzq.js +135 -0
- package/dist/department-SWj0HA-l.js +410 -0
- package/dist/desktop-le1cI27_.js +9 -0
- package/dist/http_api_v1-d9smAbJZ.js +1008 -0
- package/dist/index-BZZm3CTh.js +6688 -0
- package/dist/{index-BaFHeDAF.js → index-DG0x9mYD.js} +105 -105
- package/dist/index.es-DrN1BLo5.js +170 -0
- package/dist/log-D-BDBVS7.js +163 -0
- package/dist/login-DUn4tmOp.js +111 -0
- package/dist/main-Bgkb3hrI.js +293 -0
- package/dist/message-CVTa4Hb1.js +26 -0
- package/dist/position-D7u-VoeU.js +311 -0
- package/dist/role-CyCsBm0V.js +405 -0
- package/dist/self-BRTR2NdM.js +102 -0
- package/dist/sys-BZgBUI3k.js +30 -0
- package/dist/user-cl8kQwmL.js +650 -0
- package/dist/zsys_delbutton.vue_vue_type_script_setup_true_lang-Dqud3QQ4.js +72 -0
- package/dist/zsys_eventBus-CZOk9fTb.js +178 -0
- package/dist/zsys_time-4KclnYJN.js +17 -0
- package/dist/zsyslist.vue_vue_type_script_setup_true_lang-BE2Kl33t.js +466 -0
- package/dist/zsysview.es.js +1 -1
- package/package.json +1 -1
- package/dist/backup-BrCAKHW5.js +0 -519
- package/dist/breadcrumb.vue_vue_type_script_setup_true_lang-DxqktuR5.js +0 -43
- package/dist/change_password-CY87a5gc.js +0 -135
- package/dist/department-BDW7DB5F.js +0 -410
- package/dist/desktop-DgyBqclt.js +0 -9
- package/dist/http_api_v1-BQLGtV9G.js +0 -1008
- package/dist/index-DXGp4B8l.js +0 -6688
- package/dist/index.es-BcGc183Q.js +0 -170
- package/dist/log-2ZY0HGuh.js +0 -163
- package/dist/login-BAuvM04T.js +0 -111
- package/dist/main-CxdkVN-C.js +0 -293
- package/dist/message-CdVUOGzt.js +0 -26
- package/dist/position-D7wr1m96.js +0 -311
- package/dist/role-M_ZYR2ta.js +0 -405
- package/dist/self-DAB-5Co8.js +0 -102
- package/dist/sys-BjlP52cg.js +0 -30
- package/dist/user-CEaf7VIW.js +0 -650
- package/dist/zsys_delbutton.vue_vue_type_script_setup_true_lang-BYahBvHu.js +0 -72
- package/dist/zsys_eventBus-DDrk0Aw8.js +0 -178
- package/dist/zsys_time-DHEMuVgo.js +0 -17
- package/dist/zsyslist.vue_vue_type_script_setup_true_lang-Bl1QXOML.js +0 -466
|
@@ -0,0 +1,1008 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { a as useTokenStore } from "./index-BZZm3CTh.js";
|
|
3
|
+
function getDefaultExportFromCjs(x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
|
|
5
|
+
}
|
|
6
|
+
var jsonBigint = { exports: {} }, stringify = { exports: {} }, bignumber$1 = { exports: {} }, bignumber = bignumber$1.exports, hasRequiredBignumber;
|
|
7
|
+
function requireBignumber() {
|
|
8
|
+
return hasRequiredBignumber || (hasRequiredBignumber = 1, (function(module) {
|
|
9
|
+
(function(globalObject) {
|
|
10
|
+
var BigNumber, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
11
|
+
function clone(configObject) {
|
|
12
|
+
var div, convertBase, parseNumeric, P = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = !1, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
13
|
+
prefix: "",
|
|
14
|
+
groupSize: 3,
|
|
15
|
+
secondaryGroupSize: 0,
|
|
16
|
+
groupSeparator: ",",
|
|
17
|
+
decimalSeparator: ".",
|
|
18
|
+
fractionGroupSize: 0,
|
|
19
|
+
fractionGroupSeparator: " ",
|
|
20
|
+
// non-breaking space
|
|
21
|
+
suffix: ""
|
|
22
|
+
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = !0;
|
|
23
|
+
function BigNumber2(v, b) {
|
|
24
|
+
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
25
|
+
if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
|
|
26
|
+
if (b == null) {
|
|
27
|
+
if (v && v._isBigNumber === !0) {
|
|
28
|
+
x.s = v.s, !v.c || v.e > MAX_EXP ? x.c = x.e = null : v.e < MIN_EXP ? x.c = [x.e = 0] : (x.e = v.e, x.c = v.c.slice());
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
32
|
+
if (x.s = 1 / v < 0 ? (v = -v, -1) : 1, v === ~~v) {
|
|
33
|
+
for (e = 0, i = v; i >= 10; i /= 10, e++) ;
|
|
34
|
+
e > MAX_EXP ? x.c = x.e = null : (x.e = e, x.c = [v]);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
str = String(v);
|
|
38
|
+
} else {
|
|
39
|
+
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
40
|
+
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
41
|
+
}
|
|
42
|
+
(e = str.indexOf(".")) > -1 && (str = str.replace(".", "")), (i = str.search(/e/i)) > 0 ? (e < 0 && (e = i), e += +str.slice(i + 1), str = str.substring(0, i)) : e < 0 && (e = str.length);
|
|
43
|
+
} else {
|
|
44
|
+
if (intCheck(b, 2, ALPHABET.length, "Base"), b == 10 && alphabetHasNormalDecimalDigits)
|
|
45
|
+
return x = new BigNumber2(v), round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
46
|
+
if (str = String(v), isNum = typeof v == "number") {
|
|
47
|
+
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
48
|
+
if (x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1, BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15)
|
|
49
|
+
throw Error(tooManyDigits + v);
|
|
50
|
+
} else
|
|
51
|
+
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
52
|
+
for (alphabet = ALPHABET.slice(0, b), e = i = 0, len = str.length; i < len; i++)
|
|
53
|
+
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
54
|
+
if (c == ".") {
|
|
55
|
+
if (i > e) {
|
|
56
|
+
e = len;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
} else if (!caseChanged && (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase()))) {
|
|
60
|
+
caseChanged = !0, i = -1, e = 0;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
return parseNumeric(x, String(v), isNum, b);
|
|
64
|
+
}
|
|
65
|
+
isNum = !1, str = convertBase(str, b, 10, x.s), (e = str.indexOf(".")) > -1 ? str = str.replace(".", "") : e = str.length;
|
|
66
|
+
}
|
|
67
|
+
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
68
|
+
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
69
|
+
if (str = str.slice(i, ++len)) {
|
|
70
|
+
if (len -= i, isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v)))
|
|
71
|
+
throw Error(tooManyDigits + x.s * v);
|
|
72
|
+
if ((e = e - i - 1) > MAX_EXP)
|
|
73
|
+
x.c = x.e = null;
|
|
74
|
+
else if (e < MIN_EXP)
|
|
75
|
+
x.c = [x.e = 0];
|
|
76
|
+
else {
|
|
77
|
+
if (x.e = e, x.c = [], i = (e + 1) % LOG_BASE, e < 0 && (i += LOG_BASE), i < len) {
|
|
78
|
+
for (i && x.c.push(+str.slice(0, i)), len -= LOG_BASE; i < len; )
|
|
79
|
+
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
80
|
+
i = LOG_BASE - (str = str.slice(i)).length;
|
|
81
|
+
} else
|
|
82
|
+
i -= len;
|
|
83
|
+
for (; i--; str += "0") ;
|
|
84
|
+
x.c.push(+str);
|
|
85
|
+
}
|
|
86
|
+
} else
|
|
87
|
+
x.c = [x.e = 0];
|
|
88
|
+
}
|
|
89
|
+
BigNumber2.clone = clone, BigNumber2.ROUND_UP = 0, BigNumber2.ROUND_DOWN = 1, BigNumber2.ROUND_CEIL = 2, BigNumber2.ROUND_FLOOR = 3, BigNumber2.ROUND_HALF_UP = 4, BigNumber2.ROUND_HALF_DOWN = 5, BigNumber2.ROUND_HALF_EVEN = 6, BigNumber2.ROUND_HALF_CEIL = 7, BigNumber2.ROUND_HALF_FLOOR = 8, BigNumber2.EUCLID = 9, BigNumber2.config = BigNumber2.set = function(obj) {
|
|
90
|
+
var p, v;
|
|
91
|
+
if (obj != null)
|
|
92
|
+
if (typeof obj == "object") {
|
|
93
|
+
if (obj.hasOwnProperty(p = "DECIMAL_PLACES") && (v = obj[p], intCheck(v, 0, MAX, p), DECIMAL_PLACES = v), obj.hasOwnProperty(p = "ROUNDING_MODE") && (v = obj[p], intCheck(v, 0, 8, p), ROUNDING_MODE = v), obj.hasOwnProperty(p = "EXPONENTIAL_AT") && (v = obj[p], v && v.pop ? (intCheck(v[0], -MAX, 0, p), intCheck(v[1], 0, MAX, p), TO_EXP_NEG = v[0], TO_EXP_POS = v[1]) : (intCheck(v, -MAX, MAX, p), TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v))), obj.hasOwnProperty(p = "RANGE"))
|
|
94
|
+
if (v = obj[p], v && v.pop)
|
|
95
|
+
intCheck(v[0], -MAX, -1, p), intCheck(v[1], 1, MAX, p), MIN_EXP = v[0], MAX_EXP = v[1];
|
|
96
|
+
else if (intCheck(v, -MAX, MAX, p), v)
|
|
97
|
+
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
98
|
+
else
|
|
99
|
+
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
100
|
+
if (obj.hasOwnProperty(p = "CRYPTO"))
|
|
101
|
+
if (v = obj[p], v === !!v)
|
|
102
|
+
if (v)
|
|
103
|
+
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
104
|
+
CRYPTO = v;
|
|
105
|
+
else
|
|
106
|
+
throw CRYPTO = !v, Error(bignumberError + "crypto unavailable");
|
|
107
|
+
else
|
|
108
|
+
CRYPTO = v;
|
|
109
|
+
else
|
|
110
|
+
throw Error(bignumberError + p + " not true or false: " + v);
|
|
111
|
+
if (obj.hasOwnProperty(p = "MODULO_MODE") && (v = obj[p], intCheck(v, 0, 9, p), MODULO_MODE = v), obj.hasOwnProperty(p = "POW_PRECISION") && (v = obj[p], intCheck(v, 0, MAX, p), POW_PRECISION = v), obj.hasOwnProperty(p = "FORMAT"))
|
|
112
|
+
if (v = obj[p], typeof v == "object") FORMAT = v;
|
|
113
|
+
else throw Error(bignumberError + p + " not an object: " + v);
|
|
114
|
+
if (obj.hasOwnProperty(p = "ALPHABET"))
|
|
115
|
+
if (v = obj[p], typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v))
|
|
116
|
+
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789", ALPHABET = v;
|
|
117
|
+
else
|
|
118
|
+
throw Error(bignumberError + p + " invalid: " + v);
|
|
119
|
+
} else
|
|
120
|
+
throw Error(bignumberError + "Object expected: " + obj);
|
|
121
|
+
return {
|
|
122
|
+
DECIMAL_PLACES,
|
|
123
|
+
ROUNDING_MODE,
|
|
124
|
+
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
125
|
+
RANGE: [MIN_EXP, MAX_EXP],
|
|
126
|
+
CRYPTO,
|
|
127
|
+
MODULO_MODE,
|
|
128
|
+
POW_PRECISION,
|
|
129
|
+
FORMAT,
|
|
130
|
+
ALPHABET
|
|
131
|
+
};
|
|
132
|
+
}, BigNumber2.isBigNumber = function(v) {
|
|
133
|
+
if (!v || v._isBigNumber !== !0) return !1;
|
|
134
|
+
if (!BigNumber2.DEBUG) return !0;
|
|
135
|
+
var i, n, c = v.c, e = v.e, s = v.s;
|
|
136
|
+
out: if ({}.toString.call(c) == "[object Array]") {
|
|
137
|
+
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
138
|
+
if (c[0] === 0) {
|
|
139
|
+
if (e === 0 && c.length === 1) return !0;
|
|
140
|
+
break out;
|
|
141
|
+
}
|
|
142
|
+
if (i = (e + 1) % LOG_BASE, i < 1 && (i += LOG_BASE), String(c[0]).length == i) {
|
|
143
|
+
for (i = 0; i < c.length; i++)
|
|
144
|
+
if (n = c[i], n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
145
|
+
if (n !== 0) return !0;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
} else if (c === null && e === null && (s === null || s === 1 || s === -1))
|
|
149
|
+
return !0;
|
|
150
|
+
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
151
|
+
}, BigNumber2.maximum = BigNumber2.max = function() {
|
|
152
|
+
return maxOrMin(arguments, -1);
|
|
153
|
+
}, BigNumber2.minimum = BigNumber2.min = function() {
|
|
154
|
+
return maxOrMin(arguments, 1);
|
|
155
|
+
}, BigNumber2.random = (function() {
|
|
156
|
+
var pow2_53 = 9007199254740992, random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
157
|
+
return mathfloor(Math.random() * pow2_53);
|
|
158
|
+
} : function() {
|
|
159
|
+
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
160
|
+
};
|
|
161
|
+
return function(dp) {
|
|
162
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
163
|
+
if (dp == null ? dp = DECIMAL_PLACES : intCheck(dp, 0, MAX), k = mathceil(dp / LOG_BASE), CRYPTO)
|
|
164
|
+
if (crypto.getRandomValues) {
|
|
165
|
+
for (a = crypto.getRandomValues(new Uint32Array(k *= 2)); i < k; )
|
|
166
|
+
v = a[i] * 131072 + (a[i + 1] >>> 11), v >= 9e15 ? (b = crypto.getRandomValues(new Uint32Array(2)), a[i] = b[0], a[i + 1] = b[1]) : (c.push(v % 1e14), i += 2);
|
|
167
|
+
i = k / 2;
|
|
168
|
+
} else if (crypto.randomBytes) {
|
|
169
|
+
for (a = crypto.randomBytes(k *= 7); i < k; )
|
|
170
|
+
v = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6], v >= 9e15 ? crypto.randomBytes(7).copy(a, i) : (c.push(v % 1e14), i += 7);
|
|
171
|
+
i = k / 7;
|
|
172
|
+
} else
|
|
173
|
+
throw CRYPTO = !1, Error(bignumberError + "crypto unavailable");
|
|
174
|
+
if (!CRYPTO)
|
|
175
|
+
for (; i < k; )
|
|
176
|
+
v = random53bitInt(), v < 9e15 && (c[i++] = v % 1e14);
|
|
177
|
+
for (k = c[--i], dp %= LOG_BASE, k && dp && (v = POWS_TEN[LOG_BASE - dp], c[i] = mathfloor(k / v) * v); c[i] === 0; c.pop(), i--) ;
|
|
178
|
+
if (i < 0)
|
|
179
|
+
c = [e = 0];
|
|
180
|
+
else {
|
|
181
|
+
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
182
|
+
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
183
|
+
i < LOG_BASE && (e -= LOG_BASE - i);
|
|
184
|
+
}
|
|
185
|
+
return rand.e = e, rand.c = c, rand;
|
|
186
|
+
};
|
|
187
|
+
})(), BigNumber2.sum = function() {
|
|
188
|
+
for (var i = 1, args = arguments, sum = new BigNumber2(args[0]); i < args.length; ) sum = sum.plus(args[i++]);
|
|
189
|
+
return sum;
|
|
190
|
+
}, convertBase = /* @__PURE__ */ (function() {
|
|
191
|
+
var decimal = "0123456789";
|
|
192
|
+
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
193
|
+
for (var j, arr = [0], arrL, i = 0, len = str.length; i < len; ) {
|
|
194
|
+
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
195
|
+
for (arr[0] += alphabet.indexOf(str.charAt(i++)), j = 0; j < arr.length; j++)
|
|
196
|
+
arr[j] > baseOut - 1 && (arr[j + 1] == null && (arr[j + 1] = 0), arr[j + 1] += arr[j] / baseOut | 0, arr[j] %= baseOut);
|
|
197
|
+
}
|
|
198
|
+
return arr.reverse();
|
|
199
|
+
}
|
|
200
|
+
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
201
|
+
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
202
|
+
for (i >= 0 && (k = POW_PRECISION, POW_PRECISION = 0, str = str.replace(".", ""), y = new BigNumber2(baseIn), x = y.pow(str.length - i), POW_PRECISION = k, y.c = toBaseOut(
|
|
203
|
+
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
204
|
+
10,
|
|
205
|
+
baseOut,
|
|
206
|
+
decimal
|
|
207
|
+
), y.e = y.c.length), xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET)), e = k = xc.length; xc[--k] == 0; xc.pop()) ;
|
|
208
|
+
if (!xc[0]) return alphabet.charAt(0);
|
|
209
|
+
if (i < 0 ? --e : (x.c = xc, x.e = e, x.s = sign, x = div(x, y, dp, rm, baseOut), xc = x.c, r = x.r, e = x.e), d = e + dp + 1, i = xc[d], k = baseOut / 2, r = r || d < 0 || xc[d + 1] != null, r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7)), d < 1 || !xc[0])
|
|
210
|
+
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
211
|
+
else {
|
|
212
|
+
if (xc.length = d, r)
|
|
213
|
+
for (--baseOut; ++xc[--d] > baseOut; )
|
|
214
|
+
xc[d] = 0, d || (++e, xc = [1].concat(xc));
|
|
215
|
+
for (k = xc.length; !xc[--k]; ) ;
|
|
216
|
+
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
217
|
+
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
218
|
+
}
|
|
219
|
+
return str;
|
|
220
|
+
};
|
|
221
|
+
})(), div = /* @__PURE__ */ (function() {
|
|
222
|
+
function multiply(x, k, base) {
|
|
223
|
+
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
224
|
+
for (x = x.slice(); i--; )
|
|
225
|
+
xlo = x[i] % SQRT_BASE, xhi = x[i] / SQRT_BASE | 0, m = khi * xlo + xhi * klo, temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry, carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi, x[i] = temp % base;
|
|
226
|
+
return carry && (x = [carry].concat(x)), x;
|
|
227
|
+
}
|
|
228
|
+
function compare2(a, b, aL, bL) {
|
|
229
|
+
var i, cmp;
|
|
230
|
+
if (aL != bL)
|
|
231
|
+
cmp = aL > bL ? 1 : -1;
|
|
232
|
+
else
|
|
233
|
+
for (i = cmp = 0; i < aL; i++)
|
|
234
|
+
if (a[i] != b[i]) {
|
|
235
|
+
cmp = a[i] > b[i] ? 1 : -1;
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
return cmp;
|
|
239
|
+
}
|
|
240
|
+
function subtract(a, b, aL, base) {
|
|
241
|
+
for (var i = 0; aL--; )
|
|
242
|
+
a[aL] -= i, i = a[aL] < b[aL] ? 1 : 0, a[aL] = i * base + a[aL] - b[aL];
|
|
243
|
+
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
244
|
+
}
|
|
245
|
+
return function(x, y, dp, rm, base) {
|
|
246
|
+
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
247
|
+
if (!xc || !xc[0] || !yc || !yc[0])
|
|
248
|
+
return new BigNumber2(
|
|
249
|
+
// Return NaN if either NaN, or both Infinity or 0.
|
|
250
|
+
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
251
|
+
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
252
|
+
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
253
|
+
)
|
|
254
|
+
);
|
|
255
|
+
for (q = new BigNumber2(s), qc = q.c = [], e = x.e - y.e, s = dp + e + 1, base || (base = BASE, e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE), s = s / LOG_BASE | 0), i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
256
|
+
if (yc[i] > (xc[i] || 0) && e--, s < 0)
|
|
257
|
+
qc.push(1), more = !0;
|
|
258
|
+
else {
|
|
259
|
+
for (xL = xc.length, yL = yc.length, i = 0, s += 2, n = mathfloor(base / (yc[0] + 1)), n > 1 && (yc = multiply(yc, n, base), xc = multiply(xc, n, base), yL = yc.length, xL = xc.length), xi = yL, rem = xc.slice(0, yL), remL = rem.length; remL < yL; rem[remL++] = 0) ;
|
|
260
|
+
yz = yc.slice(), yz = [0].concat(yz), yc0 = yc[0], yc[1] >= base / 2 && yc0++;
|
|
261
|
+
do {
|
|
262
|
+
if (n = 0, cmp = compare2(yc, rem, yL, remL), cmp < 0) {
|
|
263
|
+
if (rem0 = rem[0], yL != remL && (rem0 = rem0 * base + (rem[1] || 0)), n = mathfloor(rem0 / yc0), n > 1)
|
|
264
|
+
for (n >= base && (n = base - 1), prod = multiply(yc, n, base), prodL = prod.length, remL = rem.length; compare2(prod, rem, prodL, remL) == 1; )
|
|
265
|
+
n--, subtract(prod, yL < prodL ? yz : yc, prodL, base), prodL = prod.length, cmp = 1;
|
|
266
|
+
else
|
|
267
|
+
n == 0 && (cmp = n = 1), prod = yc.slice(), prodL = prod.length;
|
|
268
|
+
if (prodL < remL && (prod = [0].concat(prod)), subtract(rem, prod, remL, base), remL = rem.length, cmp == -1)
|
|
269
|
+
for (; compare2(yc, rem, yL, remL) < 1; )
|
|
270
|
+
n++, subtract(rem, yL < remL ? yz : yc, remL, base), remL = rem.length;
|
|
271
|
+
} else cmp === 0 && (n++, rem = [0]);
|
|
272
|
+
qc[i++] = n, rem[0] ? rem[remL++] = xc[xi] || 0 : (rem = [xc[xi]], remL = 1);
|
|
273
|
+
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
274
|
+
more = rem[0] != null, qc[0] || qc.splice(0, 1);
|
|
275
|
+
}
|
|
276
|
+
if (base == BASE) {
|
|
277
|
+
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
278
|
+
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
279
|
+
} else
|
|
280
|
+
q.e = e, q.r = +more;
|
|
281
|
+
return q;
|
|
282
|
+
};
|
|
283
|
+
})();
|
|
284
|
+
function format(n, i, rm, id) {
|
|
285
|
+
var c0, e, ne, len, str;
|
|
286
|
+
if (rm == null ? rm = ROUNDING_MODE : intCheck(rm, 0, 8), !n.c) return n.toString();
|
|
287
|
+
if (c0 = n.c[0], ne = n.e, i == null)
|
|
288
|
+
str = coeffToString(n.c), str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
289
|
+
else if (n = round(new BigNumber2(n), i, rm), e = n.e, str = coeffToString(n.c), len = str.length, id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
290
|
+
for (; len < i; str += "0", len++) ;
|
|
291
|
+
str = toExponential(str, e);
|
|
292
|
+
} else if (i -= ne + (id === 2 && e > ne), str = toFixedPoint(str, e, "0"), e + 1 > len) {
|
|
293
|
+
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
294
|
+
} else if (i += e - len, i > 0)
|
|
295
|
+
for (e + 1 == len && (str += "."); i--; str += "0") ;
|
|
296
|
+
return n.s < 0 && c0 ? "-" + str : str;
|
|
297
|
+
}
|
|
298
|
+
function maxOrMin(args, n) {
|
|
299
|
+
for (var k, y, i = 1, x = new BigNumber2(args[0]); i < args.length; i++)
|
|
300
|
+
y = new BigNumber2(args[i]), (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) && (x = y);
|
|
301
|
+
return x;
|
|
302
|
+
}
|
|
303
|
+
function normalise(n, c, e) {
|
|
304
|
+
for (var i = 1, j = c.length; !c[--j]; c.pop()) ;
|
|
305
|
+
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
306
|
+
return (e = i + e * LOG_BASE - 1) > MAX_EXP ? n.c = n.e = null : e < MIN_EXP ? n.c = [n.e = 0] : (n.e = e, n.c = c), n;
|
|
307
|
+
}
|
|
308
|
+
parseNumeric = /* @__PURE__ */ (function() {
|
|
309
|
+
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
310
|
+
return function(x, str, isNum, b) {
|
|
311
|
+
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
312
|
+
if (isInfinityOrNaN.test(s))
|
|
313
|
+
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
314
|
+
else {
|
|
315
|
+
if (!isNum && (s = s.replace(basePrefix, function(m, p1, p2) {
|
|
316
|
+
return base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8, !b || b == base ? p1 : m;
|
|
317
|
+
}), b && (base = b, s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1")), str != s))
|
|
318
|
+
return new BigNumber2(s, base);
|
|
319
|
+
if (BigNumber2.DEBUG)
|
|
320
|
+
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
321
|
+
x.s = null;
|
|
322
|
+
}
|
|
323
|
+
x.c = x.e = null;
|
|
324
|
+
};
|
|
325
|
+
})();
|
|
326
|
+
function round(x, sd, rm, r) {
|
|
327
|
+
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
328
|
+
if (xc) {
|
|
329
|
+
out: {
|
|
330
|
+
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
331
|
+
if (i = sd - d, i < 0)
|
|
332
|
+
i += LOG_BASE, j = sd, n = xc[ni = 0], rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
333
|
+
else if (ni = mathceil((i + 1) / LOG_BASE), ni >= xc.length)
|
|
334
|
+
if (r) {
|
|
335
|
+
for (; xc.length <= ni; xc.push(0)) ;
|
|
336
|
+
n = rd = 0, d = 1, i %= LOG_BASE, j = i - LOG_BASE + 1;
|
|
337
|
+
} else
|
|
338
|
+
break out;
|
|
339
|
+
else {
|
|
340
|
+
for (n = k = xc[ni], d = 1; k >= 10; k /= 10, d++) ;
|
|
341
|
+
i %= LOG_BASE, j = i - LOG_BASE + d, rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
342
|
+
}
|
|
343
|
+
if (r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
344
|
+
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
345
|
+
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
346
|
+
xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]), r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
347
|
+
(i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7)), sd < 1 || !xc[0])
|
|
348
|
+
return xc.length = 0, r ? (sd -= x.e + 1, xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE], x.e = -sd || 0) : xc[0] = x.e = 0, x;
|
|
349
|
+
if (i == 0 ? (xc.length = ni, k = 1, ni--) : (xc.length = ni + 1, k = pows10[LOG_BASE - i], xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0), r)
|
|
350
|
+
for (; ; )
|
|
351
|
+
if (ni == 0) {
|
|
352
|
+
for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
|
|
353
|
+
for (j = xc[0] += k, k = 1; j >= 10; j /= 10, k++) ;
|
|
354
|
+
i != k && (x.e++, xc[0] == BASE && (xc[0] = 1));
|
|
355
|
+
break;
|
|
356
|
+
} else {
|
|
357
|
+
if (xc[ni] += k, xc[ni] != BASE) break;
|
|
358
|
+
xc[ni--] = 0, k = 1;
|
|
359
|
+
}
|
|
360
|
+
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
361
|
+
}
|
|
362
|
+
x.e > MAX_EXP ? x.c = x.e = null : x.e < MIN_EXP && (x.c = [x.e = 0]);
|
|
363
|
+
}
|
|
364
|
+
return x;
|
|
365
|
+
}
|
|
366
|
+
function valueOf(n) {
|
|
367
|
+
var str, e = n.e;
|
|
368
|
+
return e === null ? n.toString() : (str = coeffToString(n.c), str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0"), n.s < 0 ? "-" + str : str);
|
|
369
|
+
}
|
|
370
|
+
return P.absoluteValue = P.abs = function() {
|
|
371
|
+
var x = new BigNumber2(this);
|
|
372
|
+
return x.s < 0 && (x.s = 1), x;
|
|
373
|
+
}, P.comparedTo = function(y, b) {
|
|
374
|
+
return compare(this, new BigNumber2(y, b));
|
|
375
|
+
}, P.decimalPlaces = P.dp = function(dp, rm) {
|
|
376
|
+
var c, n, v, x = this;
|
|
377
|
+
if (dp != null)
|
|
378
|
+
return intCheck(dp, 0, MAX), rm == null ? rm = ROUNDING_MODE : intCheck(rm, 0, 8), round(new BigNumber2(x), dp + x.e + 1, rm);
|
|
379
|
+
if (!(c = x.c)) return null;
|
|
380
|
+
if (n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE, v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
381
|
+
return n < 0 && (n = 0), n;
|
|
382
|
+
}, P.dividedBy = P.div = function(y, b) {
|
|
383
|
+
return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
384
|
+
}, P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
385
|
+
return div(this, new BigNumber2(y, b), 0, 1);
|
|
386
|
+
}, P.exponentiatedBy = P.pow = function(n, m) {
|
|
387
|
+
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
388
|
+
if (n = new BigNumber2(n), n.c && !n.isInteger())
|
|
389
|
+
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
390
|
+
if (m != null && (m = new BigNumber2(m)), nIsBig = n.e > 14, !x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0])
|
|
391
|
+
return y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n))), m ? y.mod(m) : y;
|
|
392
|
+
if (nIsNeg = n.s < 0, m) {
|
|
393
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber2(NaN);
|
|
394
|
+
isModExp = !nIsNeg && x.isInteger() && m.isInteger(), isModExp && (x = x.mod(m));
|
|
395
|
+
} else {
|
|
396
|
+
if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7)))
|
|
397
|
+
return k = x.s < 0 && isOdd(n) ? -0 : 0, x.e > -1 && (k = 1 / k), new BigNumber2(nIsNeg ? 1 / k : k);
|
|
398
|
+
POW_PRECISION && (k = mathceil(POW_PRECISION / LOG_BASE + 2));
|
|
399
|
+
}
|
|
400
|
+
for (nIsBig ? (half = new BigNumber2(0.5), nIsNeg && (n.s = 1), nIsOdd = isOdd(n)) : (i = Math.abs(+valueOf(n)), nIsOdd = i % 2), y = new BigNumber2(ONE); ; ) {
|
|
401
|
+
if (nIsOdd) {
|
|
402
|
+
if (y = y.times(x), !y.c) break;
|
|
403
|
+
k ? y.c.length > k && (y.c.length = k) : isModExp && (y = y.mod(m));
|
|
404
|
+
}
|
|
405
|
+
if (i) {
|
|
406
|
+
if (i = mathfloor(i / 2), i === 0) break;
|
|
407
|
+
nIsOdd = i % 2;
|
|
408
|
+
} else if (n = n.times(half), round(n, n.e + 1, 1), n.e > 14)
|
|
409
|
+
nIsOdd = isOdd(n);
|
|
410
|
+
else {
|
|
411
|
+
if (i = +valueOf(n), i === 0) break;
|
|
412
|
+
nIsOdd = i % 2;
|
|
413
|
+
}
|
|
414
|
+
x = x.times(x), k ? x.c && x.c.length > k && (x.c.length = k) : isModExp && (x = x.mod(m));
|
|
415
|
+
}
|
|
416
|
+
return isModExp ? y : (nIsNeg && (y = ONE.div(y)), m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y);
|
|
417
|
+
}, P.integerValue = function(rm) {
|
|
418
|
+
var n = new BigNumber2(this);
|
|
419
|
+
return rm == null ? rm = ROUNDING_MODE : intCheck(rm, 0, 8), round(n, n.e + 1, rm);
|
|
420
|
+
}, P.isEqualTo = P.eq = function(y, b) {
|
|
421
|
+
return compare(this, new BigNumber2(y, b)) === 0;
|
|
422
|
+
}, P.isFinite = function() {
|
|
423
|
+
return !!this.c;
|
|
424
|
+
}, P.isGreaterThan = P.gt = function(y, b) {
|
|
425
|
+
return compare(this, new BigNumber2(y, b)) > 0;
|
|
426
|
+
}, P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
427
|
+
return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
|
|
428
|
+
}, P.isInteger = function() {
|
|
429
|
+
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
430
|
+
}, P.isLessThan = P.lt = function(y, b) {
|
|
431
|
+
return compare(this, new BigNumber2(y, b)) < 0;
|
|
432
|
+
}, P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
433
|
+
return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
|
|
434
|
+
}, P.isNaN = function() {
|
|
435
|
+
return !this.s;
|
|
436
|
+
}, P.isNegative = function() {
|
|
437
|
+
return this.s < 0;
|
|
438
|
+
}, P.isPositive = function() {
|
|
439
|
+
return this.s > 0;
|
|
440
|
+
}, P.isZero = function() {
|
|
441
|
+
return !!this.c && this.c[0] == 0;
|
|
442
|
+
}, P.minus = function(y, b) {
|
|
443
|
+
var i, j, t, xLTy, x = this, a = x.s;
|
|
444
|
+
if (y = new BigNumber2(y, b), b = y.s, !a || !b) return new BigNumber2(NaN);
|
|
445
|
+
if (a != b)
|
|
446
|
+
return y.s = -b, x.plus(y);
|
|
447
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
448
|
+
if (!xe || !ye) {
|
|
449
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
|
|
450
|
+
if (!xc[0] || !yc[0])
|
|
451
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : (
|
|
452
|
+
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
453
|
+
ROUNDING_MODE == 3 ? -0 : 0
|
|
454
|
+
));
|
|
455
|
+
}
|
|
456
|
+
if (xe = bitFloor(xe), ye = bitFloor(ye), xc = xc.slice(), a = xe - ye) {
|
|
457
|
+
for ((xLTy = a < 0) ? (a = -a, t = xc) : (ye = xe, t = yc), t.reverse(), b = a; b--; t.push(0)) ;
|
|
458
|
+
t.reverse();
|
|
459
|
+
} else
|
|
460
|
+
for (j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b, a = b = 0; b < j; b++)
|
|
461
|
+
if (xc[b] != yc[b]) {
|
|
462
|
+
xLTy = xc[b] < yc[b];
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
if (xLTy && (t = xc, xc = yc, yc = t, y.s = -y.s), b = (j = yc.length) - (i = xc.length), b > 0) for (; b--; xc[i++] = 0) ;
|
|
466
|
+
for (b = BASE - 1; j > a; ) {
|
|
467
|
+
if (xc[--j] < yc[j]) {
|
|
468
|
+
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
469
|
+
--xc[i], xc[j] += BASE;
|
|
470
|
+
}
|
|
471
|
+
xc[j] -= yc[j];
|
|
472
|
+
}
|
|
473
|
+
for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
|
|
474
|
+
return xc[0] ? normalise(y, xc, ye) : (y.s = ROUNDING_MODE == 3 ? -1 : 1, y.c = [y.e = 0], y);
|
|
475
|
+
}, P.modulo = P.mod = function(y, b) {
|
|
476
|
+
var q, s, x = this;
|
|
477
|
+
return y = new BigNumber2(y, b), !x.c || !y.s || y.c && !y.c[0] ? new BigNumber2(NaN) : !y.c || x.c && !x.c[0] ? new BigNumber2(x) : (MODULO_MODE == 9 ? (s = y.s, y.s = 1, q = div(x, y, 0, 3), y.s = s, q.s *= s) : q = div(x, y, 0, MODULO_MODE), y = x.minus(q.times(y)), !y.c[0] && MODULO_MODE == 1 && (y.s = x.s), y);
|
|
478
|
+
}, P.multipliedBy = P.times = function(y, b) {
|
|
479
|
+
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber2(y, b)).c;
|
|
480
|
+
if (!xc || !yc || !xc[0] || !yc[0])
|
|
481
|
+
return !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ? y.c = y.e = y.s = null : (y.s *= x.s, !xc || !yc ? y.c = y.e = null : (y.c = [0], y.e = 0)), y;
|
|
482
|
+
for (e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE), y.s *= x.s, xcL = xc.length, ycL = yc.length, xcL < ycL && (zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i), i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
483
|
+
for (base = BASE, sqrtBase = SQRT_BASE, i = ycL; --i >= 0; ) {
|
|
484
|
+
for (c = 0, ylo = yc[i] % sqrtBase, yhi = yc[i] / sqrtBase | 0, k = xcL, j = i + k; j > i; )
|
|
485
|
+
xlo = xc[--k] % sqrtBase, xhi = xc[k] / sqrtBase | 0, m = yhi * xlo + xhi * ylo, xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c, c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi, zc[j--] = xlo % base;
|
|
486
|
+
zc[j] = c;
|
|
487
|
+
}
|
|
488
|
+
return c ? ++e : zc.splice(0, 1), normalise(y, zc, e);
|
|
489
|
+
}, P.negated = function() {
|
|
490
|
+
var x = new BigNumber2(this);
|
|
491
|
+
return x.s = -x.s || null, x;
|
|
492
|
+
}, P.plus = function(y, b) {
|
|
493
|
+
var t, x = this, a = x.s;
|
|
494
|
+
if (y = new BigNumber2(y, b), b = y.s, !a || !b) return new BigNumber2(NaN);
|
|
495
|
+
if (a != b)
|
|
496
|
+
return y.s = -b, x.minus(y);
|
|
497
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
498
|
+
if (!xe || !ye) {
|
|
499
|
+
if (!xc || !yc) return new BigNumber2(a / 0);
|
|
500
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
|
|
501
|
+
}
|
|
502
|
+
if (xe = bitFloor(xe), ye = bitFloor(ye), xc = xc.slice(), a = xe - ye) {
|
|
503
|
+
for (a > 0 ? (ye = xe, t = yc) : (a = -a, t = xc), t.reverse(); a--; t.push(0)) ;
|
|
504
|
+
t.reverse();
|
|
505
|
+
}
|
|
506
|
+
for (a = xc.length, b = yc.length, a - b < 0 && (t = yc, yc = xc, xc = t, b = a), a = 0; b; )
|
|
507
|
+
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0, xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
508
|
+
return a && (xc = [a].concat(xc), ++ye), normalise(y, xc, ye);
|
|
509
|
+
}, P.precision = P.sd = function(sd, rm) {
|
|
510
|
+
var c, n, v, x = this;
|
|
511
|
+
if (sd != null && sd !== !!sd)
|
|
512
|
+
return intCheck(sd, 1, MAX), rm == null ? rm = ROUNDING_MODE : intCheck(rm, 0, 8), round(new BigNumber2(x), sd, rm);
|
|
513
|
+
if (!(c = x.c)) return null;
|
|
514
|
+
if (v = c.length - 1, n = v * LOG_BASE + 1, v = c[v]) {
|
|
515
|
+
for (; v % 10 == 0; v /= 10, n--) ;
|
|
516
|
+
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
517
|
+
}
|
|
518
|
+
return sd && x.e + 1 > n && (n = x.e + 1), n;
|
|
519
|
+
}, P.shiftedBy = function(k) {
|
|
520
|
+
return intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER), this.times("1e" + k);
|
|
521
|
+
}, P.squareRoot = P.sqrt = function() {
|
|
522
|
+
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
|
|
523
|
+
if (s !== 1 || !c || !c[0])
|
|
524
|
+
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
525
|
+
if (s = Math.sqrt(+valueOf(x)), s == 0 || s == 1 / 0 ? (n = coeffToString(c), (n.length + e) % 2 == 0 && (n += "0"), s = Math.sqrt(+n), e = bitFloor((e + 1) / 2) - (e < 0 || e % 2), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), r = new BigNumber2(n)) : r = new BigNumber2(s + ""), r.c[0]) {
|
|
526
|
+
for (e = r.e, s = e + dp, s < 3 && (s = 0); ; )
|
|
527
|
+
if (t = r, r = half.times(t.plus(div(x, t, dp, 1))), coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s))
|
|
528
|
+
if (r.e < e && --s, n = n.slice(s - 3, s + 1), n == "9999" || !rep && n == "4999") {
|
|
529
|
+
if (!rep && (round(t, t.e + DECIMAL_PLACES + 2, 0), t.times(t).eq(x))) {
|
|
530
|
+
r = t;
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
dp += 4, s += 4, rep = 1;
|
|
534
|
+
} else {
|
|
535
|
+
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (round(r, r.e + DECIMAL_PLACES + 2, 1), m = !r.times(r).eq(x));
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
540
|
+
}, P.toExponential = function(dp, rm) {
|
|
541
|
+
return dp != null && (intCheck(dp, 0, MAX), dp++), format(this, dp, rm, 1);
|
|
542
|
+
}, P.toFixed = function(dp, rm) {
|
|
543
|
+
return dp != null && (intCheck(dp, 0, MAX), dp = dp + this.e + 1), format(this, dp, rm);
|
|
544
|
+
}, P.toFormat = function(dp, rm, format2) {
|
|
545
|
+
var str, x = this;
|
|
546
|
+
if (format2 == null)
|
|
547
|
+
dp != null && rm && typeof rm == "object" ? (format2 = rm, rm = null) : dp && typeof dp == "object" ? (format2 = dp, dp = rm = null) : format2 = FORMAT;
|
|
548
|
+
else if (typeof format2 != "object")
|
|
549
|
+
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
550
|
+
if (str = x.toFixed(dp, rm), x.c) {
|
|
551
|
+
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
552
|
+
if (g2 && (i = g1, g1 = g2, g2 = i, len -= i), g1 > 0 && len > 0) {
|
|
553
|
+
for (i = len % g1 || g1, intPart = intDigits.substr(0, i); i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
554
|
+
g2 > 0 && (intPart += groupSeparator + intDigits.slice(i)), isNeg && (intPart = "-" + intPart);
|
|
555
|
+
}
|
|
556
|
+
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
557
|
+
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
558
|
+
"$&" + (format2.fractionGroupSeparator || "")
|
|
559
|
+
) : fractionPart) : intPart;
|
|
560
|
+
}
|
|
561
|
+
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
562
|
+
}, P.toFraction = function(md) {
|
|
563
|
+
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
564
|
+
if (md != null && (n = new BigNumber2(md), !n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)))
|
|
565
|
+
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
566
|
+
if (!xc) return new BigNumber2(x);
|
|
567
|
+
for (d = new BigNumber2(ONE), n1 = d0 = new BigNumber2(ONE), d1 = n0 = new BigNumber2(ONE), s = coeffToString(xc), e = d.e = s.length - x.e - 1, d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp], md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n, exp = MAX_EXP, MAX_EXP = 1 / 0, n = new BigNumber2(s), n0.c[0] = 0; q = div(n, d, 0, 1), d2 = d0.plus(q.times(d1)), d2.comparedTo(md) != 1; )
|
|
568
|
+
d0 = d1, d1 = d2, n1 = n0.plus(q.times(d2 = n1)), n0 = d2, d = n.minus(q.times(d2 = d)), n = d2;
|
|
569
|
+
return d2 = div(md.minus(d0), d1, 0, 1), n0 = n0.plus(d2.times(n1)), d0 = d0.plus(d2.times(d1)), n0.s = n1.s = x.s, e = e * 2, r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
570
|
+
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
571
|
+
) < 1 ? [n1, d1] : [n0, d0], MAX_EXP = exp, r;
|
|
572
|
+
}, P.toNumber = function() {
|
|
573
|
+
return +valueOf(this);
|
|
574
|
+
}, P.toPrecision = function(sd, rm) {
|
|
575
|
+
return sd != null && intCheck(sd, 1, MAX), format(this, sd, rm, 2);
|
|
576
|
+
}, P.toString = function(b) {
|
|
577
|
+
var str, n = this, s = n.s, e = n.e;
|
|
578
|
+
return e === null ? s ? (str = "Infinity", s < 0 && (str = "-" + str)) : str = "NaN" : (b == null ? str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0") : b === 10 && alphabetHasNormalDecimalDigits ? (n = round(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE), str = toFixedPoint(coeffToString(n.c), n.e, "0")) : (intCheck(b, 2, ALPHABET.length, "Base"), str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, !0)), s < 0 && n.c[0] && (str = "-" + str)), str;
|
|
579
|
+
}, P.valueOf = P.toJSON = function() {
|
|
580
|
+
return valueOf(this);
|
|
581
|
+
}, P._isBigNumber = !0, configObject != null && BigNumber2.set(configObject), BigNumber2;
|
|
582
|
+
}
|
|
583
|
+
function bitFloor(n) {
|
|
584
|
+
var i = n | 0;
|
|
585
|
+
return n > 0 || n === i ? i : i - 1;
|
|
586
|
+
}
|
|
587
|
+
function coeffToString(a) {
|
|
588
|
+
for (var s, z, i = 1, j = a.length, r = a[0] + ""; i < j; ) {
|
|
589
|
+
for (s = a[i++] + "", z = LOG_BASE - s.length; z--; s = "0" + s) ;
|
|
590
|
+
r += s;
|
|
591
|
+
}
|
|
592
|
+
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
593
|
+
return r.slice(0, j + 1 || 1);
|
|
594
|
+
}
|
|
595
|
+
function compare(x, y) {
|
|
596
|
+
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
597
|
+
if (!i || !j) return null;
|
|
598
|
+
if (a = xc && !xc[0], b = yc && !yc[0], a || b) return a ? b ? 0 : -j : i;
|
|
599
|
+
if (i != j) return i;
|
|
600
|
+
if (a = i < 0, b = k == l, !xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
601
|
+
if (!b) return k > l ^ a ? 1 : -1;
|
|
602
|
+
for (j = (k = xc.length) < (l = yc.length) ? k : l, i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
603
|
+
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
604
|
+
}
|
|
605
|
+
function intCheck(n, min, max, name) {
|
|
606
|
+
if (n < min || n > max || n !== mathfloor(n))
|
|
607
|
+
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
608
|
+
}
|
|
609
|
+
function isOdd(n) {
|
|
610
|
+
var k = n.c.length - 1;
|
|
611
|
+
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
612
|
+
}
|
|
613
|
+
function toExponential(str, e) {
|
|
614
|
+
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
615
|
+
}
|
|
616
|
+
function toFixedPoint(str, e, z) {
|
|
617
|
+
var len, zs;
|
|
618
|
+
if (e < 0) {
|
|
619
|
+
for (zs = z + "."; ++e; zs += z) ;
|
|
620
|
+
str = zs + str;
|
|
621
|
+
} else if (len = str.length, ++e > len) {
|
|
622
|
+
for (zs = z, e -= len; --e; zs += z) ;
|
|
623
|
+
str += zs;
|
|
624
|
+
} else e < len && (str = str.slice(0, e) + "." + str.slice(e));
|
|
625
|
+
return str;
|
|
626
|
+
}
|
|
627
|
+
BigNumber = clone(), BigNumber.default = BigNumber.BigNumber = BigNumber, module.exports ? module.exports = BigNumber : (globalObject || (globalObject = typeof self < "u" && self ? self : window), globalObject.BigNumber = BigNumber);
|
|
628
|
+
})(bignumber);
|
|
629
|
+
})(bignumber$1)), bignumber$1.exports;
|
|
630
|
+
}
|
|
631
|
+
var hasRequiredStringify;
|
|
632
|
+
function requireStringify() {
|
|
633
|
+
return hasRequiredStringify || (hasRequiredStringify = 1, (function(module) {
|
|
634
|
+
var BigNumber = requireBignumber(), JSON = module.exports;
|
|
635
|
+
(function() {
|
|
636
|
+
var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
|
|
637
|
+
// table of character substitutions
|
|
638
|
+
"\b": "\\b",
|
|
639
|
+
" ": "\\t",
|
|
640
|
+
"\n": "\\n",
|
|
641
|
+
"\f": "\\f",
|
|
642
|
+
"\r": "\\r",
|
|
643
|
+
'"': '\\"',
|
|
644
|
+
"\\": "\\\\"
|
|
645
|
+
}, rep;
|
|
646
|
+
function quote(string) {
|
|
647
|
+
return escapable.lastIndex = 0, escapable.test(string) ? '"' + string.replace(escapable, function(a) {
|
|
648
|
+
var c = meta[a];
|
|
649
|
+
return typeof c == "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
650
|
+
}) + '"' : '"' + string + '"';
|
|
651
|
+
}
|
|
652
|
+
function str(key, holder) {
|
|
653
|
+
var i, k, v, length, mind = gap, partial, value = holder[key], isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));
|
|
654
|
+
switch (value && typeof value == "object" && typeof value.toJSON == "function" && (value = value.toJSON(key)), typeof rep == "function" && (value = rep.call(holder, key, value)), typeof value) {
|
|
655
|
+
case "string":
|
|
656
|
+
return isBigNumber ? value : quote(value);
|
|
657
|
+
case "number":
|
|
658
|
+
return isFinite(value) ? String(value) : "null";
|
|
659
|
+
case "boolean":
|
|
660
|
+
case "null":
|
|
661
|
+
case "bigint":
|
|
662
|
+
return String(value);
|
|
663
|
+
// If the type is 'object', we might be dealing with an object or an array or
|
|
664
|
+
// null.
|
|
665
|
+
case "object":
|
|
666
|
+
if (!value)
|
|
667
|
+
return "null";
|
|
668
|
+
if (gap += indent, partial = [], Object.prototype.toString.apply(value) === "[object Array]") {
|
|
669
|
+
for (length = value.length, i = 0; i < length; i += 1)
|
|
670
|
+
partial[i] = str(i, value) || "null";
|
|
671
|
+
return v = partial.length === 0 ? "[]" : gap ? `[
|
|
672
|
+
` + gap + partial.join(`,
|
|
673
|
+
` + gap) + `
|
|
674
|
+
` + mind + "]" : "[" + partial.join(",") + "]", gap = mind, v;
|
|
675
|
+
}
|
|
676
|
+
if (rep && typeof rep == "object")
|
|
677
|
+
for (length = rep.length, i = 0; i < length; i += 1)
|
|
678
|
+
typeof rep[i] == "string" && (k = rep[i], v = str(k, value), v && partial.push(quote(k) + (gap ? ": " : ":") + v));
|
|
679
|
+
else
|
|
680
|
+
Object.keys(value).forEach(function(k2) {
|
|
681
|
+
var v2 = str(k2, value);
|
|
682
|
+
v2 && partial.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
683
|
+
});
|
|
684
|
+
return v = partial.length === 0 ? "{}" : gap ? `{
|
|
685
|
+
` + gap + partial.join(`,
|
|
686
|
+
` + gap) + `
|
|
687
|
+
` + mind + "}" : "{" + partial.join(",") + "}", gap = mind, v;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
typeof JSON.stringify != "function" && (JSON.stringify = function(value, replacer, space) {
|
|
691
|
+
var i;
|
|
692
|
+
if (gap = "", indent = "", typeof space == "number")
|
|
693
|
+
for (i = 0; i < space; i += 1)
|
|
694
|
+
indent += " ";
|
|
695
|
+
else typeof space == "string" && (indent = space);
|
|
696
|
+
if (rep = replacer, replacer && typeof replacer != "function" && (typeof replacer != "object" || typeof replacer.length != "number"))
|
|
697
|
+
throw new Error("JSON.stringify");
|
|
698
|
+
return str("", { "": value });
|
|
699
|
+
});
|
|
700
|
+
})();
|
|
701
|
+
})(stringify)), stringify.exports;
|
|
702
|
+
}
|
|
703
|
+
var parse, hasRequiredParse;
|
|
704
|
+
function requireParse() {
|
|
705
|
+
if (hasRequiredParse) return parse;
|
|
706
|
+
hasRequiredParse = 1;
|
|
707
|
+
var BigNumber = null;
|
|
708
|
+
const suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/, suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
|
|
709
|
+
var json_parse = function(options) {
|
|
710
|
+
var _options = {
|
|
711
|
+
strict: !1,
|
|
712
|
+
// not being strict means do not generate syntax errors for "duplicate key"
|
|
713
|
+
storeAsString: !1,
|
|
714
|
+
// toggles whether the values should be stored as BigNumber (default) or a string
|
|
715
|
+
alwaysParseAsBig: !1,
|
|
716
|
+
// toggles whether all numbers should be Big
|
|
717
|
+
useNativeBigInt: !1,
|
|
718
|
+
// toggles whether to use native BigInt instead of bignumber.js
|
|
719
|
+
protoAction: "error",
|
|
720
|
+
constructorAction: "error"
|
|
721
|
+
};
|
|
722
|
+
if (options != null) {
|
|
723
|
+
if (options.strict === !0 && (_options.strict = !0), options.storeAsString === !0 && (_options.storeAsString = !0), _options.alwaysParseAsBig = options.alwaysParseAsBig === !0 ? options.alwaysParseAsBig : !1, _options.useNativeBigInt = options.useNativeBigInt === !0 ? options.useNativeBigInt : !1, typeof options.constructorAction < "u")
|
|
724
|
+
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve")
|
|
725
|
+
_options.constructorAction = options.constructorAction;
|
|
726
|
+
else
|
|
727
|
+
throw new Error(
|
|
728
|
+
`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`
|
|
729
|
+
);
|
|
730
|
+
if (typeof options.protoAction < "u")
|
|
731
|
+
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve")
|
|
732
|
+
_options.protoAction = options.protoAction;
|
|
733
|
+
else
|
|
734
|
+
throw new Error(
|
|
735
|
+
`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
var at, ch, escapee = {
|
|
739
|
+
'"': '"',
|
|
740
|
+
"\\": "\\",
|
|
741
|
+
"/": "/",
|
|
742
|
+
b: "\b",
|
|
743
|
+
f: "\f",
|
|
744
|
+
n: `
|
|
745
|
+
`,
|
|
746
|
+
r: "\r",
|
|
747
|
+
t: " "
|
|
748
|
+
}, text, error = function(m) {
|
|
749
|
+
throw {
|
|
750
|
+
name: "SyntaxError",
|
|
751
|
+
message: m,
|
|
752
|
+
at,
|
|
753
|
+
text
|
|
754
|
+
};
|
|
755
|
+
}, next = function(c) {
|
|
756
|
+
return c && c !== ch && error("Expected '" + c + "' instead of '" + ch + "'"), ch = text.charAt(at), at += 1, ch;
|
|
757
|
+
}, number = function() {
|
|
758
|
+
var number2, string2 = "";
|
|
759
|
+
for (ch === "-" && (string2 = "-", next("-")); ch >= "0" && ch <= "9"; )
|
|
760
|
+
string2 += ch, next();
|
|
761
|
+
if (ch === ".")
|
|
762
|
+
for (string2 += "."; next() && ch >= "0" && ch <= "9"; )
|
|
763
|
+
string2 += ch;
|
|
764
|
+
if (ch === "e" || ch === "E")
|
|
765
|
+
for (string2 += ch, next(), (ch === "-" || ch === "+") && (string2 += ch, next()); ch >= "0" && ch <= "9"; )
|
|
766
|
+
string2 += ch, next();
|
|
767
|
+
if (number2 = +string2, !isFinite(number2))
|
|
768
|
+
error("Bad number");
|
|
769
|
+
else
|
|
770
|
+
return BigNumber == null && (BigNumber = requireBignumber()), string2.length > 15 ? _options.storeAsString ? string2 : _options.useNativeBigInt ? BigInt(string2) : new BigNumber(string2) : _options.alwaysParseAsBig ? _options.useNativeBigInt ? BigInt(number2) : new BigNumber(number2) : number2;
|
|
771
|
+
}, string = function() {
|
|
772
|
+
var hex, i, string2 = "", uffff;
|
|
773
|
+
if (ch === '"')
|
|
774
|
+
for (var startAt = at; next(); ) {
|
|
775
|
+
if (ch === '"')
|
|
776
|
+
return at - 1 > startAt && (string2 += text.substring(startAt, at - 1)), next(), string2;
|
|
777
|
+
if (ch === "\\") {
|
|
778
|
+
if (at - 1 > startAt && (string2 += text.substring(startAt, at - 1)), next(), ch === "u") {
|
|
779
|
+
for (uffff = 0, i = 0; i < 4 && (hex = parseInt(next(), 16), !!isFinite(hex)); i += 1)
|
|
780
|
+
uffff = uffff * 16 + hex;
|
|
781
|
+
string2 += String.fromCharCode(uffff);
|
|
782
|
+
} else if (typeof escapee[ch] == "string")
|
|
783
|
+
string2 += escapee[ch];
|
|
784
|
+
else
|
|
785
|
+
break;
|
|
786
|
+
startAt = at;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
error("Bad string");
|
|
790
|
+
}, white = function() {
|
|
791
|
+
for (; ch && ch <= " "; )
|
|
792
|
+
next();
|
|
793
|
+
}, word = function() {
|
|
794
|
+
switch (ch) {
|
|
795
|
+
case "t":
|
|
796
|
+
return next("t"), next("r"), next("u"), next("e"), !0;
|
|
797
|
+
case "f":
|
|
798
|
+
return next("f"), next("a"), next("l"), next("s"), next("e"), !1;
|
|
799
|
+
case "n":
|
|
800
|
+
return next("n"), next("u"), next("l"), next("l"), null;
|
|
801
|
+
}
|
|
802
|
+
error("Unexpected '" + ch + "'");
|
|
803
|
+
}, value, array = function() {
|
|
804
|
+
var array2 = [];
|
|
805
|
+
if (ch === "[") {
|
|
806
|
+
if (next("["), white(), ch === "]")
|
|
807
|
+
return next("]"), array2;
|
|
808
|
+
for (; ch; ) {
|
|
809
|
+
if (array2.push(value()), white(), ch === "]")
|
|
810
|
+
return next("]"), array2;
|
|
811
|
+
next(","), white();
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
error("Bad array");
|
|
815
|
+
}, object = function() {
|
|
816
|
+
var key, object2 = /* @__PURE__ */ Object.create(null);
|
|
817
|
+
if (ch === "{") {
|
|
818
|
+
if (next("{"), white(), ch === "}")
|
|
819
|
+
return next("}"), object2;
|
|
820
|
+
for (; ch; ) {
|
|
821
|
+
if (key = string(), white(), next(":"), _options.strict === !0 && Object.hasOwnProperty.call(object2, key) && error('Duplicate key "' + key + '"'), suspectProtoRx.test(key) === !0 ? _options.protoAction === "error" ? error("Object contains forbidden prototype property") : _options.protoAction === "ignore" ? value() : object2[key] = value() : suspectConstructorRx.test(key) === !0 ? _options.constructorAction === "error" ? error("Object contains forbidden constructor property") : _options.constructorAction === "ignore" ? value() : object2[key] = value() : object2[key] = value(), white(), ch === "}")
|
|
822
|
+
return next("}"), object2;
|
|
823
|
+
next(","), white();
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
error("Bad object");
|
|
827
|
+
};
|
|
828
|
+
return value = function() {
|
|
829
|
+
switch (white(), ch) {
|
|
830
|
+
case "{":
|
|
831
|
+
return object();
|
|
832
|
+
case "[":
|
|
833
|
+
return array();
|
|
834
|
+
case '"':
|
|
835
|
+
return string();
|
|
836
|
+
case "-":
|
|
837
|
+
return number();
|
|
838
|
+
default:
|
|
839
|
+
return ch >= "0" && ch <= "9" ? number() : word();
|
|
840
|
+
}
|
|
841
|
+
}, function(source, reviver) {
|
|
842
|
+
var result;
|
|
843
|
+
return text = source + "", at = 0, ch = " ", result = value(), white(), ch && error("Syntax error"), typeof reviver == "function" ? (function walk(holder, key) {
|
|
844
|
+
var v, value2 = holder[key];
|
|
845
|
+
return value2 && typeof value2 == "object" && Object.keys(value2).forEach(function(k) {
|
|
846
|
+
v = walk(value2, k), v !== void 0 ? value2[k] = v : delete value2[k];
|
|
847
|
+
}), reviver.call(holder, key, value2);
|
|
848
|
+
})({ "": result }, "") : result;
|
|
849
|
+
};
|
|
850
|
+
};
|
|
851
|
+
return parse = json_parse, parse;
|
|
852
|
+
}
|
|
853
|
+
var hasRequiredJsonBigint;
|
|
854
|
+
function requireJsonBigint() {
|
|
855
|
+
if (hasRequiredJsonBigint) return jsonBigint.exports;
|
|
856
|
+
hasRequiredJsonBigint = 1;
|
|
857
|
+
var json_stringify = requireStringify().stringify, json_parse = requireParse();
|
|
858
|
+
return jsonBigint.exports = function(options) {
|
|
859
|
+
return {
|
|
860
|
+
parse: json_parse(options),
|
|
861
|
+
stringify: json_stringify
|
|
862
|
+
};
|
|
863
|
+
}, jsonBigint.exports.parse = json_parse(), jsonBigint.exports.stringify = json_stringify, jsonBigint.exports;
|
|
864
|
+
}
|
|
865
|
+
var jsonBigintExports = requireJsonBigint();
|
|
866
|
+
const JSONbig = /* @__PURE__ */ getDefaultExportFromCjs(jsonBigintExports), store = useTokenStore();
|
|
867
|
+
let http_axios = axios.create({
|
|
868
|
+
transformResponse: [(data) => {
|
|
869
|
+
try {
|
|
870
|
+
return JSONbig.parse(data);
|
|
871
|
+
} catch (error) {
|
|
872
|
+
throw console.error("JSON parse error:", error), error;
|
|
873
|
+
}
|
|
874
|
+
}],
|
|
875
|
+
transformRequest: [(data) => JSONbig.stringify(data)]
|
|
876
|
+
// transformRequest: [(data) => {
|
|
877
|
+
// return JSON.stringify(data, (_, value) => {
|
|
878
|
+
// if (typeof value === 'bigint') {
|
|
879
|
+
// return value.toString(); // 自动转换 BigInt
|
|
880
|
+
// }
|
|
881
|
+
// return value;
|
|
882
|
+
// });
|
|
883
|
+
// }],
|
|
884
|
+
});
|
|
885
|
+
http_axios.interceptors.request.use((config) => (console.log(store.token.value), config.headers.authorization = "Bearer " + store.token.value, config));
|
|
886
|
+
http_axios.interceptors.response.use((res) => (res.data.error_code == 100 && store.saveToken("none"), typeof res.headers.authorization < "u" && store.saveToken(res.headers.authorization), res), (err) => Promise.reject(err));
|
|
887
|
+
class HttpApiReturnData {
|
|
888
|
+
error_code;
|
|
889
|
+
message;
|
|
890
|
+
data;
|
|
891
|
+
constructor() {
|
|
892
|
+
this.error_code = 1, this.message = "未知错误", this.data = {};
|
|
893
|
+
}
|
|
894
|
+
get IsSuccess() {
|
|
895
|
+
return this.error_code == 0;
|
|
896
|
+
}
|
|
897
|
+
static fromObject(obj) {
|
|
898
|
+
const instance = new HttpApiReturnData();
|
|
899
|
+
return Object.assign(instance, obj), instance;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
const hostUrl = `${window.location.protocol}//${window.location.host}/`;
|
|
903
|
+
class HttpApiV1 {
|
|
904
|
+
//系统基础接口
|
|
905
|
+
static api_host = hostUrl;
|
|
906
|
+
//'http://localhost:1788/' //1788
|
|
907
|
+
//当前用户
|
|
908
|
+
static url_login = "api/login";
|
|
909
|
+
static url_usercenter = "api/user_center";
|
|
910
|
+
static url_change_password = "api/change_password";
|
|
911
|
+
static url_user_permission = "api/user_permission";
|
|
912
|
+
//用户管理
|
|
913
|
+
static url_user_save = "api/user_save";
|
|
914
|
+
static url_user_list = "api/user_list";
|
|
915
|
+
static url_user_export = "api/user_export";
|
|
916
|
+
static url_user_del = "api/user_del";
|
|
917
|
+
static url_user_detail = "api/user_detail";
|
|
918
|
+
static url_user_change_pwd = "api/user_change_pwd";
|
|
919
|
+
//组织架构
|
|
920
|
+
static url_department_save = "api/department_save";
|
|
921
|
+
static url_department_list = "api/department_list";
|
|
922
|
+
static url_department_del = "api/department_del";
|
|
923
|
+
static url_department_detail = "api/department_detail";
|
|
924
|
+
//职务
|
|
925
|
+
static url_position_list = "api/position_list";
|
|
926
|
+
static url_position_detail = "api/position_detail";
|
|
927
|
+
static url_position_save = "api/position_save";
|
|
928
|
+
static url_position_del = "api/position_del";
|
|
929
|
+
//系统日志
|
|
930
|
+
static url_syslog_list = "api/syslog_list";
|
|
931
|
+
static url_syslog_config_detail = "api/syslog_config_detail";
|
|
932
|
+
static url_syslog_config_save = "api/syslog_config_save";
|
|
933
|
+
//备份
|
|
934
|
+
static url_backup_start = "api/backup_start";
|
|
935
|
+
static url_backup_list = "api/backup_list";
|
|
936
|
+
static url_backup_del = "api/backup_del";
|
|
937
|
+
static url_backup_config_get = "api/backup_config_get";
|
|
938
|
+
static url_backup_config_save = "api/backup_config_save";
|
|
939
|
+
//权限
|
|
940
|
+
static url_syspermission_list = "api/permission_list";
|
|
941
|
+
static url_sysrole_list = "api/role_list";
|
|
942
|
+
static url_sysrole_del = "api/role_del";
|
|
943
|
+
static url_sysrole_save = "api/role_save";
|
|
944
|
+
static url_sysrole_detail = "api/role_detail";
|
|
945
|
+
//导出
|
|
946
|
+
static url_export_detail = "api/export_detail";
|
|
947
|
+
static url_export_file = "api/export_file";
|
|
948
|
+
// 系统
|
|
949
|
+
static url_system_publish = "api/system_publish";
|
|
950
|
+
//应用级接口==========================
|
|
951
|
+
//桌面
|
|
952
|
+
static url_desktop = "api/desktop";
|
|
953
|
+
static url_desktop_config_detail = "api/desktop_config_detail";
|
|
954
|
+
static url_desktop_config_save = "api/desktop_config_save";
|
|
955
|
+
//数据看板
|
|
956
|
+
static url_chart_weekly = "api/chart_weekly";
|
|
957
|
+
static url_chart_all = "api/chart_all";
|
|
958
|
+
static url_chart_last = "api/chart_last";
|
|
959
|
+
//事件
|
|
960
|
+
static url_event_list = "api/event_list";
|
|
961
|
+
static url_event_detail = "api/event_detail";
|
|
962
|
+
static url_event_file = "api/event_file";
|
|
963
|
+
static url_event_dispose = "api/event_dispose";
|
|
964
|
+
//规则
|
|
965
|
+
static url_rule_list = "api/rule_list";
|
|
966
|
+
static url_rule_save = "api/rule_save";
|
|
967
|
+
static url_rule_del = "api/rule_del";
|
|
968
|
+
static url_rule_detail = "api/rule_detail";
|
|
969
|
+
//时间模板
|
|
970
|
+
static url_time_list = "api/time_list";
|
|
971
|
+
static url_time_save = "api/time_save";
|
|
972
|
+
static url_time_del = "api/time_del";
|
|
973
|
+
static url_time_detail = "api/time_detail";
|
|
974
|
+
//区域
|
|
975
|
+
static url_area_save = "api/area_save";
|
|
976
|
+
static url_area_list = "api/area_list";
|
|
977
|
+
static url_area_del = "api/area_del";
|
|
978
|
+
static url_area_detail = "api/area_detail";
|
|
979
|
+
//设备
|
|
980
|
+
static url_equipment_save = "api/equipment_save";
|
|
981
|
+
static url_equipment_list = "api/equipment_list";
|
|
982
|
+
static url_equipment_detail = "api/equipment_detail";
|
|
983
|
+
static url_equipment_del = "api/equipment_del";
|
|
984
|
+
//通道画面
|
|
985
|
+
static url_channel_save = "api/channel_save";
|
|
986
|
+
static url_channel_list = "api/channel_list";
|
|
987
|
+
static url_channel_detail = "api/channel_detail";
|
|
988
|
+
static url_channel_del = "api/channel_del";
|
|
989
|
+
static GetFullApiUrl(api) {
|
|
990
|
+
return this.api_host + api;
|
|
991
|
+
}
|
|
992
|
+
static async Post(url, obj) {
|
|
993
|
+
try {
|
|
994
|
+
let res = await http_axios.post(this.api_host + url, obj);
|
|
995
|
+
return HttpApiReturnData.fromObject(res.data);
|
|
996
|
+
} catch (err) {
|
|
997
|
+
return console.log(err), Promise.reject("访问服务器失败");
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
// http_axios.interceptors.response.use(res=>{
|
|
1001
|
+
// return res
|
|
1002
|
+
// },err=>{
|
|
1003
|
+
// return Promise.reject(err)
|
|
1004
|
+
// })
|
|
1005
|
+
}
|
|
1006
|
+
export {
|
|
1007
|
+
HttpApiV1 as H
|
|
1008
|
+
};
|