@base-web-kits/base-tools-ts 1.3.13 → 1.3.15
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/index.cjs +2057 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2095 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -7
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
5
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
8
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
9
|
var __pow = Math.pow;
|
|
@@ -15,6 +19,25 @@ var __spreadValues = (a, b) => {
|
|
|
15
19
|
}
|
|
16
20
|
return a;
|
|
17
21
|
};
|
|
22
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
23
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
35
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
36
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
37
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
39
|
+
mod
|
|
40
|
+
));
|
|
18
41
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
42
|
var __async = (__this, __arguments, generator) => {
|
|
20
43
|
return new Promise((resolve, reject) => {
|
|
@@ -37,6 +60,681 @@ var __async = (__this, __arguments, generator) => {
|
|
|
37
60
|
});
|
|
38
61
|
};
|
|
39
62
|
|
|
63
|
+
// node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js
|
|
64
|
+
var require_dayjs_min = __commonJS({
|
|
65
|
+
"node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js"(exports, module) {
|
|
66
|
+
"use strict";
|
|
67
|
+
!(function(t, e) {
|
|
68
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
69
|
+
})(exports, (function() {
|
|
70
|
+
"use strict";
|
|
71
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
72
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
73
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
74
|
+
} }, m = function(t2, e2, n2) {
|
|
75
|
+
var r2 = String(t2);
|
|
76
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
77
|
+
}, v = { s: m, z: function(t2) {
|
|
78
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
79
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
80
|
+
}, m: function t2(e2, n2) {
|
|
81
|
+
if (e2.date() < n2.date()) return -t2(n2, e2);
|
|
82
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
83
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
84
|
+
}, a: function(t2) {
|
|
85
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
86
|
+
}, p: function(t2) {
|
|
87
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
88
|
+
}, u: function(t2) {
|
|
89
|
+
return void 0 === t2;
|
|
90
|
+
} }, g = "en", D = {};
|
|
91
|
+
D[g] = M;
|
|
92
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
93
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
94
|
+
}, w = function t2(e2, n2, r2) {
|
|
95
|
+
var i2;
|
|
96
|
+
if (!e2) return g;
|
|
97
|
+
if ("string" == typeof e2) {
|
|
98
|
+
var s2 = e2.toLowerCase();
|
|
99
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
100
|
+
var u2 = e2.split("-");
|
|
101
|
+
if (!i2 && u2.length > 1) return t2(u2[0]);
|
|
102
|
+
} else {
|
|
103
|
+
var a2 = e2.name;
|
|
104
|
+
D[a2] = e2, i2 = a2;
|
|
105
|
+
}
|
|
106
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
107
|
+
}, O = function(t2, e2) {
|
|
108
|
+
if (S(t2)) return t2.clone();
|
|
109
|
+
var n2 = "object" == typeof e2 ? e2 : {};
|
|
110
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
111
|
+
}, b = v;
|
|
112
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
113
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
114
|
+
};
|
|
115
|
+
var _ = (function() {
|
|
116
|
+
function M2(t2) {
|
|
117
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
118
|
+
}
|
|
119
|
+
var m2 = M2.prototype;
|
|
120
|
+
return m2.parse = function(t2) {
|
|
121
|
+
this.$d = (function(t3) {
|
|
122
|
+
var e2 = t3.date, n2 = t3.utc;
|
|
123
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
124
|
+
if (b.u(e2)) return /* @__PURE__ */ new Date();
|
|
125
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
126
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
127
|
+
var r2 = e2.match($);
|
|
128
|
+
if (r2) {
|
|
129
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
130
|
+
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return new Date(e2);
|
|
134
|
+
})(t2), this.init();
|
|
135
|
+
}, m2.init = function() {
|
|
136
|
+
var t2 = this.$d;
|
|
137
|
+
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
138
|
+
}, m2.$utils = function() {
|
|
139
|
+
return b;
|
|
140
|
+
}, m2.isValid = function() {
|
|
141
|
+
return !(this.$d.toString() === l);
|
|
142
|
+
}, m2.isSame = function(t2, e2) {
|
|
143
|
+
var n2 = O(t2);
|
|
144
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
145
|
+
}, m2.isAfter = function(t2, e2) {
|
|
146
|
+
return O(t2) < this.startOf(e2);
|
|
147
|
+
}, m2.isBefore = function(t2, e2) {
|
|
148
|
+
return this.endOf(e2) < O(t2);
|
|
149
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
150
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
151
|
+
}, m2.unix = function() {
|
|
152
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
153
|
+
}, m2.valueOf = function() {
|
|
154
|
+
return this.$d.getTime();
|
|
155
|
+
}, m2.startOf = function(t2, e2) {
|
|
156
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
157
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
158
|
+
return r2 ? i2 : i2.endOf(a);
|
|
159
|
+
}, $2 = function(t3, e3) {
|
|
160
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
161
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
162
|
+
switch (f2) {
|
|
163
|
+
case h:
|
|
164
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
165
|
+
case c:
|
|
166
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
167
|
+
case o:
|
|
168
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
169
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
170
|
+
case a:
|
|
171
|
+
case d:
|
|
172
|
+
return $2(v2 + "Hours", 0);
|
|
173
|
+
case u:
|
|
174
|
+
return $2(v2 + "Minutes", 1);
|
|
175
|
+
case s:
|
|
176
|
+
return $2(v2 + "Seconds", 2);
|
|
177
|
+
case i:
|
|
178
|
+
return $2(v2 + "Milliseconds", 3);
|
|
179
|
+
default:
|
|
180
|
+
return this.clone();
|
|
181
|
+
}
|
|
182
|
+
}, m2.endOf = function(t2) {
|
|
183
|
+
return this.startOf(t2, false);
|
|
184
|
+
}, m2.$set = function(t2, e2) {
|
|
185
|
+
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
186
|
+
if (o2 === c || o2 === h) {
|
|
187
|
+
var y2 = this.clone().set(d, 1);
|
|
188
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
189
|
+
} else l2 && this.$d[l2]($2);
|
|
190
|
+
return this.init(), this;
|
|
191
|
+
}, m2.set = function(t2, e2) {
|
|
192
|
+
return this.clone().$set(t2, e2);
|
|
193
|
+
}, m2.get = function(t2) {
|
|
194
|
+
return this[b.p(t2)]();
|
|
195
|
+
}, m2.add = function(r2, f2) {
|
|
196
|
+
var d2, l2 = this;
|
|
197
|
+
r2 = Number(r2);
|
|
198
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
199
|
+
var e2 = O(l2);
|
|
200
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
201
|
+
};
|
|
202
|
+
if ($2 === c) return this.set(c, this.$M + r2);
|
|
203
|
+
if ($2 === h) return this.set(h, this.$y + r2);
|
|
204
|
+
if ($2 === a) return y2(1);
|
|
205
|
+
if ($2 === o) return y2(7);
|
|
206
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
207
|
+
return b.w(m3, this);
|
|
208
|
+
}, m2.subtract = function(t2, e2) {
|
|
209
|
+
return this.add(-1 * t2, e2);
|
|
210
|
+
}, m2.format = function(t2) {
|
|
211
|
+
var e2 = this, n2 = this.$locale();
|
|
212
|
+
if (!this.isValid()) return n2.invalidDate || l;
|
|
213
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
214
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
215
|
+
}, d2 = function(t3) {
|
|
216
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
217
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
218
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
219
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
220
|
+
};
|
|
221
|
+
return r2.replace(y, (function(t3, r3) {
|
|
222
|
+
return r3 || (function(t4) {
|
|
223
|
+
switch (t4) {
|
|
224
|
+
case "YY":
|
|
225
|
+
return String(e2.$y).slice(-2);
|
|
226
|
+
case "YYYY":
|
|
227
|
+
return b.s(e2.$y, 4, "0");
|
|
228
|
+
case "M":
|
|
229
|
+
return a2 + 1;
|
|
230
|
+
case "MM":
|
|
231
|
+
return b.s(a2 + 1, 2, "0");
|
|
232
|
+
case "MMM":
|
|
233
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
234
|
+
case "MMMM":
|
|
235
|
+
return h2(c2, a2);
|
|
236
|
+
case "D":
|
|
237
|
+
return e2.$D;
|
|
238
|
+
case "DD":
|
|
239
|
+
return b.s(e2.$D, 2, "0");
|
|
240
|
+
case "d":
|
|
241
|
+
return String(e2.$W);
|
|
242
|
+
case "dd":
|
|
243
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
244
|
+
case "ddd":
|
|
245
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
246
|
+
case "dddd":
|
|
247
|
+
return o2[e2.$W];
|
|
248
|
+
case "H":
|
|
249
|
+
return String(s2);
|
|
250
|
+
case "HH":
|
|
251
|
+
return b.s(s2, 2, "0");
|
|
252
|
+
case "h":
|
|
253
|
+
return d2(1);
|
|
254
|
+
case "hh":
|
|
255
|
+
return d2(2);
|
|
256
|
+
case "a":
|
|
257
|
+
return $2(s2, u2, true);
|
|
258
|
+
case "A":
|
|
259
|
+
return $2(s2, u2, false);
|
|
260
|
+
case "m":
|
|
261
|
+
return String(u2);
|
|
262
|
+
case "mm":
|
|
263
|
+
return b.s(u2, 2, "0");
|
|
264
|
+
case "s":
|
|
265
|
+
return String(e2.$s);
|
|
266
|
+
case "ss":
|
|
267
|
+
return b.s(e2.$s, 2, "0");
|
|
268
|
+
case "SSS":
|
|
269
|
+
return b.s(e2.$ms, 3, "0");
|
|
270
|
+
case "Z":
|
|
271
|
+
return i2;
|
|
272
|
+
}
|
|
273
|
+
return null;
|
|
274
|
+
})(t3) || i2.replace(":", "");
|
|
275
|
+
}));
|
|
276
|
+
}, m2.utcOffset = function() {
|
|
277
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
278
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
279
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
280
|
+
return b.m(y2, m3);
|
|
281
|
+
};
|
|
282
|
+
switch (M3) {
|
|
283
|
+
case h:
|
|
284
|
+
$2 = D2() / 12;
|
|
285
|
+
break;
|
|
286
|
+
case c:
|
|
287
|
+
$2 = D2();
|
|
288
|
+
break;
|
|
289
|
+
case f:
|
|
290
|
+
$2 = D2() / 3;
|
|
291
|
+
break;
|
|
292
|
+
case o:
|
|
293
|
+
$2 = (g2 - v2) / 6048e5;
|
|
294
|
+
break;
|
|
295
|
+
case a:
|
|
296
|
+
$2 = (g2 - v2) / 864e5;
|
|
297
|
+
break;
|
|
298
|
+
case u:
|
|
299
|
+
$2 = g2 / n;
|
|
300
|
+
break;
|
|
301
|
+
case s:
|
|
302
|
+
$2 = g2 / e;
|
|
303
|
+
break;
|
|
304
|
+
case i:
|
|
305
|
+
$2 = g2 / t;
|
|
306
|
+
break;
|
|
307
|
+
default:
|
|
308
|
+
$2 = g2;
|
|
309
|
+
}
|
|
310
|
+
return l2 ? $2 : b.a($2);
|
|
311
|
+
}, m2.daysInMonth = function() {
|
|
312
|
+
return this.endOf(c).$D;
|
|
313
|
+
}, m2.$locale = function() {
|
|
314
|
+
return D[this.$L];
|
|
315
|
+
}, m2.locale = function(t2, e2) {
|
|
316
|
+
if (!t2) return this.$L;
|
|
317
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
318
|
+
return r2 && (n2.$L = r2), n2;
|
|
319
|
+
}, m2.clone = function() {
|
|
320
|
+
return b.w(this.$d, this);
|
|
321
|
+
}, m2.toDate = function() {
|
|
322
|
+
return new Date(this.valueOf());
|
|
323
|
+
}, m2.toJSON = function() {
|
|
324
|
+
return this.isValid() ? this.toISOString() : null;
|
|
325
|
+
}, m2.toISOString = function() {
|
|
326
|
+
return this.$d.toISOString();
|
|
327
|
+
}, m2.toString = function() {
|
|
328
|
+
return this.$d.toUTCString();
|
|
329
|
+
}, M2;
|
|
330
|
+
})(), k = _.prototype;
|
|
331
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
|
|
332
|
+
k[t2[1]] = function(e2) {
|
|
333
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
334
|
+
};
|
|
335
|
+
})), O.extend = function(t2, e2) {
|
|
336
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
337
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
338
|
+
return O(1e3 * t2);
|
|
339
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
340
|
+
}));
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
// node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js
|
|
345
|
+
var require_customParseFormat = __commonJS({
|
|
346
|
+
"node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js"(exports, module) {
|
|
347
|
+
"use strict";
|
|
348
|
+
!(function(e, t) {
|
|
349
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
|
|
350
|
+
})(exports, (function() {
|
|
351
|
+
"use strict";
|
|
352
|
+
var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
|
|
353
|
+
return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
|
|
354
|
+
};
|
|
355
|
+
var f = function(e2) {
|
|
356
|
+
return function(t2) {
|
|
357
|
+
this[e2] = +t2;
|
|
358
|
+
};
|
|
359
|
+
}, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
|
|
360
|
+
(this.zone || (this.zone = {})).offset = (function(e3) {
|
|
361
|
+
if (!e3) return 0;
|
|
362
|
+
if ("Z" === e3) return 0;
|
|
363
|
+
var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
|
|
364
|
+
return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
|
|
365
|
+
})(e2);
|
|
366
|
+
}], u = function(e2) {
|
|
367
|
+
var t2 = s[e2];
|
|
368
|
+
return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
|
|
369
|
+
}, d = function(e2, t2) {
|
|
370
|
+
var n2, r2 = s.meridiem;
|
|
371
|
+
if (r2) {
|
|
372
|
+
for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
|
|
373
|
+
n2 = i2 > 12;
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
} else n2 = e2 === (t2 ? "pm" : "PM");
|
|
377
|
+
return n2;
|
|
378
|
+
}, c = { A: [o, function(e2) {
|
|
379
|
+
this.afternoon = d(e2, false);
|
|
380
|
+
}], a: [o, function(e2) {
|
|
381
|
+
this.afternoon = d(e2, true);
|
|
382
|
+
}], Q: [n, function(e2) {
|
|
383
|
+
this.month = 3 * (e2 - 1) + 1;
|
|
384
|
+
}], S: [n, function(e2) {
|
|
385
|
+
this.milliseconds = 100 * +e2;
|
|
386
|
+
}], SS: [r, function(e2) {
|
|
387
|
+
this.milliseconds = 10 * +e2;
|
|
388
|
+
}], SSS: [/\d{3}/, function(e2) {
|
|
389
|
+
this.milliseconds = +e2;
|
|
390
|
+
}], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
|
|
391
|
+
var t2 = s.ordinal, n2 = e2.match(/\d+/);
|
|
392
|
+
if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
|
|
393
|
+
}], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
|
|
394
|
+
var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
|
|
395
|
+
return e3.slice(0, 3);
|
|
396
|
+
}))).indexOf(e2) + 1;
|
|
397
|
+
if (n2 < 1) throw new Error();
|
|
398
|
+
this.month = n2 % 12 || n2;
|
|
399
|
+
}], MMMM: [o, function(e2) {
|
|
400
|
+
var t2 = u("months").indexOf(e2) + 1;
|
|
401
|
+
if (t2 < 1) throw new Error();
|
|
402
|
+
this.month = t2 % 12 || t2;
|
|
403
|
+
}], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
|
|
404
|
+
this.year = a(e2);
|
|
405
|
+
}], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
|
|
406
|
+
function l(n2) {
|
|
407
|
+
var r2, i2;
|
|
408
|
+
r2 = n2, i2 = s && s.formats;
|
|
409
|
+
for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
|
|
410
|
+
var o3 = r3 && r3.toUpperCase();
|
|
411
|
+
return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
|
|
412
|
+
return t3 || n4.slice(1);
|
|
413
|
+
}));
|
|
414
|
+
}))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
|
|
415
|
+
var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
|
|
416
|
+
o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
|
|
417
|
+
}
|
|
418
|
+
return function(e2) {
|
|
419
|
+
for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
|
|
420
|
+
var i3 = o2[n3];
|
|
421
|
+
if ("string" == typeof i3) r3 += i3.length;
|
|
422
|
+
else {
|
|
423
|
+
var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
|
|
424
|
+
f3.call(t2, u3), e2 = e2.replace(u3, "");
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return (function(e3) {
|
|
428
|
+
var t3 = e3.afternoon;
|
|
429
|
+
if (void 0 !== t3) {
|
|
430
|
+
var n4 = e3.hours;
|
|
431
|
+
t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
|
|
432
|
+
}
|
|
433
|
+
})(t2), t2;
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
return function(e2, t2, n2) {
|
|
437
|
+
n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
|
|
438
|
+
var r2 = t2.prototype, i2 = r2.parse;
|
|
439
|
+
r2.parse = function(e3) {
|
|
440
|
+
var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
|
|
441
|
+
this.$u = r3;
|
|
442
|
+
var a2 = o2[1];
|
|
443
|
+
if ("string" == typeof a2) {
|
|
444
|
+
var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
|
|
445
|
+
h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
|
|
446
|
+
try {
|
|
447
|
+
if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
|
|
448
|
+
var i3 = l(t4)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
|
|
449
|
+
o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
|
|
450
|
+
var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
|
|
451
|
+
return c3 ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
|
|
452
|
+
} catch (e5) {
|
|
453
|
+
return /* @__PURE__ */ new Date("");
|
|
454
|
+
}
|
|
455
|
+
})(t3, a2, r3, n2), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
|
|
456
|
+
} else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
|
|
457
|
+
o2[1] = a2[m - 1];
|
|
458
|
+
var M = n2.apply(this, o2);
|
|
459
|
+
if (M.isValid()) {
|
|
460
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
|
|
464
|
+
}
|
|
465
|
+
else i2.call(this, e3);
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
}));
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
// node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js
|
|
473
|
+
var require_utc = __commonJS({
|
|
474
|
+
"node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js"(exports, module) {
|
|
475
|
+
"use strict";
|
|
476
|
+
!(function(t, i) {
|
|
477
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_utc = i();
|
|
478
|
+
})(exports, (function() {
|
|
479
|
+
"use strict";
|
|
480
|
+
var t = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
|
|
481
|
+
return function(s, f, n) {
|
|
482
|
+
var u = f.prototype;
|
|
483
|
+
n.utc = function(t2) {
|
|
484
|
+
var i2 = { date: t2, utc: true, args: arguments };
|
|
485
|
+
return new f(i2);
|
|
486
|
+
}, u.utc = function(i2) {
|
|
487
|
+
var e2 = n(this.toDate(), { locale: this.$L, utc: true });
|
|
488
|
+
return i2 ? e2.add(this.utcOffset(), t) : e2;
|
|
489
|
+
}, u.local = function() {
|
|
490
|
+
return n(this.toDate(), { locale: this.$L, utc: false });
|
|
491
|
+
};
|
|
492
|
+
var r = u.parse;
|
|
493
|
+
u.parse = function(t2) {
|
|
494
|
+
t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), r.call(this, t2);
|
|
495
|
+
};
|
|
496
|
+
var o = u.init;
|
|
497
|
+
u.init = function() {
|
|
498
|
+
if (this.$u) {
|
|
499
|
+
var t2 = this.$d;
|
|
500
|
+
this.$y = t2.getUTCFullYear(), this.$M = t2.getUTCMonth(), this.$D = t2.getUTCDate(), this.$W = t2.getUTCDay(), this.$H = t2.getUTCHours(), this.$m = t2.getUTCMinutes(), this.$s = t2.getUTCSeconds(), this.$ms = t2.getUTCMilliseconds();
|
|
501
|
+
} else o.call(this);
|
|
502
|
+
};
|
|
503
|
+
var a = u.utcOffset;
|
|
504
|
+
u.utcOffset = function(s2, f2) {
|
|
505
|
+
var n2 = this.$utils().u;
|
|
506
|
+
if (n2(s2)) return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
|
|
507
|
+
if ("string" == typeof s2 && (s2 = (function(t2) {
|
|
508
|
+
void 0 === t2 && (t2 = "");
|
|
509
|
+
var s3 = t2.match(i);
|
|
510
|
+
if (!s3) return null;
|
|
511
|
+
var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
|
|
512
|
+
return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
|
|
513
|
+
})(s2), null === s2)) return this;
|
|
514
|
+
var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
|
|
515
|
+
if (0 === u2) return this.utc(f2);
|
|
516
|
+
var r2 = this.clone();
|
|
517
|
+
if (f2) return r2.$offset = u2, r2.$u = false, r2;
|
|
518
|
+
var o2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
519
|
+
return (r2 = this.local().add(u2 + o2, t)).$offset = u2, r2.$x.$localOffset = o2, r2;
|
|
520
|
+
};
|
|
521
|
+
var h = u.format;
|
|
522
|
+
u.format = function(t2) {
|
|
523
|
+
var i2 = t2 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
524
|
+
return h.call(this, i2);
|
|
525
|
+
}, u.valueOf = function() {
|
|
526
|
+
var t2 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
527
|
+
return this.$d.valueOf() - 6e4 * t2;
|
|
528
|
+
}, u.isUTC = function() {
|
|
529
|
+
return !!this.$u;
|
|
530
|
+
}, u.toISOString = function() {
|
|
531
|
+
return this.toDate().toISOString();
|
|
532
|
+
}, u.toString = function() {
|
|
533
|
+
return this.toDate().toUTCString();
|
|
534
|
+
};
|
|
535
|
+
var l = u.toDate;
|
|
536
|
+
u.toDate = function(t2) {
|
|
537
|
+
return "s" === t2 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
|
|
538
|
+
};
|
|
539
|
+
var c = u.diff;
|
|
540
|
+
u.diff = function(t2, i2, e2) {
|
|
541
|
+
if (t2 && this.$u === t2.$u) return c.call(this, t2, i2, e2);
|
|
542
|
+
var s2 = this.local(), f2 = n(t2).local();
|
|
543
|
+
return c.call(s2, f2, i2, e2);
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
}));
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
// node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js
|
|
551
|
+
var require_timezone = __commonJS({
|
|
552
|
+
"node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js"(exports, module) {
|
|
553
|
+
"use strict";
|
|
554
|
+
!(function(t, e) {
|
|
555
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_timezone = e();
|
|
556
|
+
})(exports, (function() {
|
|
557
|
+
"use strict";
|
|
558
|
+
var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
|
|
559
|
+
return function(n, i, o) {
|
|
560
|
+
var r, a = function(t2, n2, i2) {
|
|
561
|
+
void 0 === i2 && (i2 = {});
|
|
562
|
+
var o2 = new Date(t2), r2 = (function(t3, n3) {
|
|
563
|
+
void 0 === n3 && (n3 = {});
|
|
564
|
+
var i3 = n3.timeZoneName || "short", o3 = t3 + "|" + i3, r3 = e[o3];
|
|
565
|
+
return r3 || (r3 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t3, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o3] = r3), r3;
|
|
566
|
+
})(n2, i2);
|
|
567
|
+
return r2.formatToParts(o2);
|
|
568
|
+
}, u = function(e2, n2) {
|
|
569
|
+
for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
|
|
570
|
+
var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t[s2];
|
|
571
|
+
c >= 0 && (r2[c] = parseInt(m, 10));
|
|
572
|
+
}
|
|
573
|
+
var d = r2[3], l = 24 === d ? 0 : d, h = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", v = +e2;
|
|
574
|
+
return (o.utc(h).valueOf() - (v -= v % 1e3)) / 6e4;
|
|
575
|
+
}, f = i.prototype;
|
|
576
|
+
f.tz = function(t2, e2) {
|
|
577
|
+
void 0 === t2 && (t2 = r);
|
|
578
|
+
var n2, i2 = this.utcOffset(), a2 = this.toDate(), u2 = a2.toLocaleString("en-US", { timeZone: t2 }), f2 = Math.round((a2 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a2.getTimezoneOffset() / 15) - f2;
|
|
579
|
+
if (!Number(s2)) n2 = this.utcOffset(0, e2);
|
|
580
|
+
else if (n2 = o(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
|
|
581
|
+
var m = n2.utcOffset();
|
|
582
|
+
n2 = n2.add(i2 - m, "minute");
|
|
583
|
+
}
|
|
584
|
+
return n2.$x.$timezone = t2, n2;
|
|
585
|
+
}, f.offsetName = function(t2) {
|
|
586
|
+
var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t2 }).find((function(t3) {
|
|
587
|
+
return "timezonename" === t3.type.toLowerCase();
|
|
588
|
+
}));
|
|
589
|
+
return n2 && n2.value;
|
|
590
|
+
};
|
|
591
|
+
var s = f.startOf;
|
|
592
|
+
f.startOf = function(t2, e2) {
|
|
593
|
+
if (!this.$x || !this.$x.$timezone) return s.call(this, t2, e2);
|
|
594
|
+
var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
595
|
+
return s.call(n2, t2, e2).tz(this.$x.$timezone, true);
|
|
596
|
+
}, o.tz = function(t2, e2, n2) {
|
|
597
|
+
var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
|
|
598
|
+
if ("string" != typeof t2) return o(t2).tz(a2);
|
|
599
|
+
var s2 = (function(t3, e3, n3) {
|
|
600
|
+
var i3 = t3 - 60 * e3 * 1e3, o2 = u(i3, n3);
|
|
601
|
+
if (e3 === o2) return [i3, e3];
|
|
602
|
+
var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
|
|
603
|
+
return o2 === r2 ? [i3, o2] : [t3 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
|
|
604
|
+
})(o.utc(t2, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
|
|
605
|
+
return d.$x.$timezone = a2, d;
|
|
606
|
+
}, o.tz.guess = function() {
|
|
607
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
608
|
+
}, o.tz.setDefault = function(t2) {
|
|
609
|
+
r = t2;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
}));
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
// node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/relativeTime.js
|
|
617
|
+
var require_relativeTime = __commonJS({
|
|
618
|
+
"node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/relativeTime.js"(exports, module) {
|
|
619
|
+
"use strict";
|
|
620
|
+
!(function(r, e) {
|
|
621
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e();
|
|
622
|
+
})(exports, (function() {
|
|
623
|
+
"use strict";
|
|
624
|
+
return function(r, e, t) {
|
|
625
|
+
r = r || {};
|
|
626
|
+
var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
627
|
+
function i(r2, e2, t2, o2) {
|
|
628
|
+
return n.fromToBase(r2, e2, t2, o2);
|
|
629
|
+
}
|
|
630
|
+
t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
|
|
631
|
+
for (var f, a, s, l = i2.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) {
|
|
632
|
+
var y = h[c];
|
|
633
|
+
y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
|
|
634
|
+
var p = (r.rounding || Math.round)(Math.abs(f));
|
|
635
|
+
if (s = f > 0, p <= y.r || !y.r) {
|
|
636
|
+
p <= 1 && c > 0 && (y = h[c - 1]);
|
|
637
|
+
var v = l[y.l];
|
|
638
|
+
u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
if (n2) return a;
|
|
643
|
+
var M = s ? l.future : l.past;
|
|
644
|
+
return "function" == typeof M ? M(a) : M.replace("%s", a);
|
|
645
|
+
}, n.to = function(r2, e2) {
|
|
646
|
+
return i(r2, e2, this, true);
|
|
647
|
+
}, n.from = function(r2, e2) {
|
|
648
|
+
return i(r2, e2, this);
|
|
649
|
+
};
|
|
650
|
+
var d = function(r2) {
|
|
651
|
+
return r2.$u ? t.utc() : t();
|
|
652
|
+
};
|
|
653
|
+
n.toNow = function(r2) {
|
|
654
|
+
return this.to(d(this), r2);
|
|
655
|
+
}, n.fromNow = function(r2) {
|
|
656
|
+
return this.from(d(this), r2);
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
}));
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
// node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js
|
|
664
|
+
var require_advancedFormat = __commonJS({
|
|
665
|
+
"node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js"(exports, module) {
|
|
666
|
+
"use strict";
|
|
667
|
+
!(function(e, t) {
|
|
668
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_advancedFormat = t();
|
|
669
|
+
})(exports, (function() {
|
|
670
|
+
"use strict";
|
|
671
|
+
return function(e, t) {
|
|
672
|
+
var r = t.prototype, n = r.format;
|
|
673
|
+
r.format = function(e2) {
|
|
674
|
+
var t2 = this, r2 = this.$locale();
|
|
675
|
+
if (!this.isValid()) return n.bind(this)(e2);
|
|
676
|
+
var s = this.$utils(), a = (e2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e3) {
|
|
677
|
+
switch (e3) {
|
|
678
|
+
case "Q":
|
|
679
|
+
return Math.ceil((t2.$M + 1) / 3);
|
|
680
|
+
case "Do":
|
|
681
|
+
return r2.ordinal(t2.$D);
|
|
682
|
+
case "gggg":
|
|
683
|
+
return t2.weekYear();
|
|
684
|
+
case "GGGG":
|
|
685
|
+
return t2.isoWeekYear();
|
|
686
|
+
case "wo":
|
|
687
|
+
return r2.ordinal(t2.week(), "W");
|
|
688
|
+
case "w":
|
|
689
|
+
case "ww":
|
|
690
|
+
return s.s(t2.week(), "w" === e3 ? 1 : 2, "0");
|
|
691
|
+
case "W":
|
|
692
|
+
case "WW":
|
|
693
|
+
return s.s(t2.isoWeek(), "W" === e3 ? 1 : 2, "0");
|
|
694
|
+
case "k":
|
|
695
|
+
case "kk":
|
|
696
|
+
return s.s(String(0 === t2.$H ? 24 : t2.$H), "k" === e3 ? 1 : 2, "0");
|
|
697
|
+
case "X":
|
|
698
|
+
return Math.floor(t2.$d.getTime() / 1e3);
|
|
699
|
+
case "x":
|
|
700
|
+
return t2.$d.getTime();
|
|
701
|
+
case "z":
|
|
702
|
+
return "[" + t2.offsetName() + "]";
|
|
703
|
+
case "zzz":
|
|
704
|
+
return "[" + t2.offsetName("long") + "]";
|
|
705
|
+
default:
|
|
706
|
+
return e3;
|
|
707
|
+
}
|
|
708
|
+
}));
|
|
709
|
+
return n.bind(this)(a);
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
}));
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
// node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/locale/zh-cn.js
|
|
717
|
+
var require_zh_cn = __commonJS({
|
|
718
|
+
"node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/locale/zh-cn.js"(exports, module) {
|
|
719
|
+
"use strict";
|
|
720
|
+
!(function(e, _) {
|
|
721
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = _(require_dayjs_min()) : "function" == typeof define && define.amd ? define(["dayjs"], _) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_locale_zh_cn = _(e.dayjs);
|
|
722
|
+
})(exports, (function(e) {
|
|
723
|
+
"use strict";
|
|
724
|
+
function _(e2) {
|
|
725
|
+
return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
|
|
726
|
+
}
|
|
727
|
+
var t = _(e), d = { name: "zh-cn", weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), weekdaysShort: "\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"), weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(e2, _2) {
|
|
728
|
+
return "W" === _2 ? e2 + "\u5468" : e2 + "\u65E5";
|
|
729
|
+
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206", LLLL: "YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206", l: "YYYY/M/D", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm" }, relativeTime: { future: "%s\u5185", past: "%s\u524D", s: "\u51E0\u79D2", m: "1 \u5206\u949F", mm: "%d \u5206\u949F", h: "1 \u5C0F\u65F6", hh: "%d \u5C0F\u65F6", d: "1 \u5929", dd: "%d \u5929", M: "1 \u4E2A\u6708", MM: "%d \u4E2A\u6708", y: "1 \u5E74", yy: "%d \u5E74" }, meridiem: function(e2, _2) {
|
|
730
|
+
var t2 = 100 * e2 + _2;
|
|
731
|
+
return t2 < 600 ? "\u51CC\u6668" : t2 < 900 ? "\u65E9\u4E0A" : t2 < 1100 ? "\u4E0A\u5348" : t2 < 1300 ? "\u4E2D\u5348" : t2 < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A";
|
|
732
|
+
} };
|
|
733
|
+
return t.default.locale(d, null, true), d;
|
|
734
|
+
}));
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
|
|
40
738
|
// src/ts/array/index.ts
|
|
41
739
|
function arrayMove(list, fromIndex, toIndex) {
|
|
42
740
|
const newList = [...list];
|
|
@@ -57,11 +755,28 @@ function toAsync(p) {
|
|
|
57
755
|
});
|
|
58
756
|
}
|
|
59
757
|
|
|
758
|
+
// node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
|
|
759
|
+
function mitt_default(n) {
|
|
760
|
+
return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
|
|
761
|
+
var i = n.get(t);
|
|
762
|
+
i ? i.push(e) : n.set(t, [e]);
|
|
763
|
+
}, off: function(t, e) {
|
|
764
|
+
var i = n.get(t);
|
|
765
|
+
i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
|
|
766
|
+
}, emit: function(t, e) {
|
|
767
|
+
var i = n.get(t);
|
|
768
|
+
i && i.slice().map(function(n2) {
|
|
769
|
+
n2(e);
|
|
770
|
+
}), (i = n.get("*")) && i.slice().map(function(n2) {
|
|
771
|
+
n2(t, e);
|
|
772
|
+
});
|
|
773
|
+
} };
|
|
774
|
+
}
|
|
775
|
+
|
|
60
776
|
// src/ts/bean/EventBus.ts
|
|
61
|
-
import mitt from "mitt";
|
|
62
777
|
var EventBus = class {
|
|
63
778
|
constructor() {
|
|
64
|
-
__publicField(this, "_emitter",
|
|
779
|
+
__publicField(this, "_emitter", mitt_default());
|
|
65
780
|
}
|
|
66
781
|
/** 订阅 */
|
|
67
782
|
on(type, fn) {
|
|
@@ -2829,18 +3544,1361 @@ var SSEParser = class {
|
|
|
2829
3544
|
};
|
|
2830
3545
|
|
|
2831
3546
|
// src/ts/day/index.ts
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
3547
|
+
var import_dayjs = __toESM(require_dayjs_min(), 1);
|
|
3548
|
+
var import_customParseFormat = __toESM(require_customParseFormat(), 1);
|
|
3549
|
+
var import_utc = __toESM(require_utc(), 1);
|
|
3550
|
+
var import_timezone = __toESM(require_timezone(), 1);
|
|
3551
|
+
var import_relativeTime = __toESM(require_relativeTime(), 1);
|
|
3552
|
+
var import_advancedFormat = __toESM(require_advancedFormat(), 1);
|
|
3553
|
+
var import_zh_cn = __toESM(require_zh_cn(), 1);
|
|
3554
|
+
|
|
3555
|
+
// node_modules/.pnpm/bignumber.js@9.3.1/node_modules/bignumber.js/bignumber.mjs
|
|
3556
|
+
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
3557
|
+
var mathceil = Math.ceil;
|
|
3558
|
+
var mathfloor = Math.floor;
|
|
3559
|
+
var bignumberError = "[BigNumber Error] ";
|
|
3560
|
+
var tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ";
|
|
3561
|
+
var BASE = 1e14;
|
|
3562
|
+
var LOG_BASE = 14;
|
|
3563
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
3564
|
+
var POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13];
|
|
3565
|
+
var SQRT_BASE = 1e7;
|
|
3566
|
+
var MAX = 1e9;
|
|
3567
|
+
function clone2(configObject) {
|
|
3568
|
+
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 = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
3569
|
+
prefix: "",
|
|
3570
|
+
groupSize: 3,
|
|
3571
|
+
secondaryGroupSize: 0,
|
|
3572
|
+
groupSeparator: ",",
|
|
3573
|
+
decimalSeparator: ".",
|
|
3574
|
+
fractionGroupSize: 0,
|
|
3575
|
+
fractionGroupSeparator: "\xA0",
|
|
3576
|
+
// non-breaking space
|
|
3577
|
+
suffix: ""
|
|
3578
|
+
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
3579
|
+
function BigNumber2(v, b) {
|
|
3580
|
+
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
3581
|
+
if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
|
|
3582
|
+
if (b == null) {
|
|
3583
|
+
if (v && v._isBigNumber === true) {
|
|
3584
|
+
x.s = v.s;
|
|
3585
|
+
if (!v.c || v.e > MAX_EXP) {
|
|
3586
|
+
x.c = x.e = null;
|
|
3587
|
+
} else if (v.e < MIN_EXP) {
|
|
3588
|
+
x.c = [x.e = 0];
|
|
3589
|
+
} else {
|
|
3590
|
+
x.e = v.e;
|
|
3591
|
+
x.c = v.c.slice();
|
|
3592
|
+
}
|
|
3593
|
+
return;
|
|
3594
|
+
}
|
|
3595
|
+
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
3596
|
+
x.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
3597
|
+
if (v === ~~v) {
|
|
3598
|
+
for (e = 0, i = v; i >= 10; i /= 10, e++) ;
|
|
3599
|
+
if (e > MAX_EXP) {
|
|
3600
|
+
x.c = x.e = null;
|
|
3601
|
+
} else {
|
|
3602
|
+
x.e = e;
|
|
3603
|
+
x.c = [v];
|
|
3604
|
+
}
|
|
3605
|
+
return;
|
|
3606
|
+
}
|
|
3607
|
+
str = String(v);
|
|
3608
|
+
} else {
|
|
3609
|
+
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
3610
|
+
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
3611
|
+
}
|
|
3612
|
+
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
3613
|
+
if ((i = str.search(/e/i)) > 0) {
|
|
3614
|
+
if (e < 0) e = i;
|
|
3615
|
+
e += +str.slice(i + 1);
|
|
3616
|
+
str = str.substring(0, i);
|
|
3617
|
+
} else if (e < 0) {
|
|
3618
|
+
e = str.length;
|
|
3619
|
+
}
|
|
3620
|
+
} else {
|
|
3621
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
3622
|
+
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
3623
|
+
x = new BigNumber2(v);
|
|
3624
|
+
return round2(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
3625
|
+
}
|
|
3626
|
+
str = String(v);
|
|
3627
|
+
if (isNum = typeof v == "number") {
|
|
3628
|
+
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
3629
|
+
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
3630
|
+
if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
3631
|
+
throw Error(tooManyDigits + v);
|
|
3632
|
+
}
|
|
3633
|
+
} else {
|
|
3634
|
+
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
3635
|
+
}
|
|
3636
|
+
alphabet = ALPHABET.slice(0, b);
|
|
3637
|
+
e = i = 0;
|
|
3638
|
+
for (len = str.length; i < len; i++) {
|
|
3639
|
+
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
3640
|
+
if (c == ".") {
|
|
3641
|
+
if (i > e) {
|
|
3642
|
+
e = len;
|
|
3643
|
+
continue;
|
|
3644
|
+
}
|
|
3645
|
+
} else if (!caseChanged) {
|
|
3646
|
+
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
3647
|
+
caseChanged = true;
|
|
3648
|
+
i = -1;
|
|
3649
|
+
e = 0;
|
|
3650
|
+
continue;
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
return parseNumeric(x, String(v), isNum, b);
|
|
3654
|
+
}
|
|
3655
|
+
}
|
|
3656
|
+
isNum = false;
|
|
3657
|
+
str = convertBase(str, b, 10, x.s);
|
|
3658
|
+
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
3659
|
+
else e = str.length;
|
|
3660
|
+
}
|
|
3661
|
+
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
3662
|
+
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
3663
|
+
if (str = str.slice(i, ++len)) {
|
|
3664
|
+
len -= i;
|
|
3665
|
+
if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
3666
|
+
throw Error(tooManyDigits + x.s * v);
|
|
3667
|
+
}
|
|
3668
|
+
if ((e = e - i - 1) > MAX_EXP) {
|
|
3669
|
+
x.c = x.e = null;
|
|
3670
|
+
} else if (e < MIN_EXP) {
|
|
3671
|
+
x.c = [x.e = 0];
|
|
3672
|
+
} else {
|
|
3673
|
+
x.e = e;
|
|
3674
|
+
x.c = [];
|
|
3675
|
+
i = (e + 1) % LOG_BASE;
|
|
3676
|
+
if (e < 0) i += LOG_BASE;
|
|
3677
|
+
if (i < len) {
|
|
3678
|
+
if (i) x.c.push(+str.slice(0, i));
|
|
3679
|
+
for (len -= LOG_BASE; i < len; ) {
|
|
3680
|
+
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
3681
|
+
}
|
|
3682
|
+
i = LOG_BASE - (str = str.slice(i)).length;
|
|
3683
|
+
} else {
|
|
3684
|
+
i -= len;
|
|
3685
|
+
}
|
|
3686
|
+
for (; i--; str += "0") ;
|
|
3687
|
+
x.c.push(+str);
|
|
3688
|
+
}
|
|
3689
|
+
} else {
|
|
3690
|
+
x.c = [x.e = 0];
|
|
3691
|
+
}
|
|
3692
|
+
}
|
|
3693
|
+
BigNumber2.clone = clone2;
|
|
3694
|
+
BigNumber2.ROUND_UP = 0;
|
|
3695
|
+
BigNumber2.ROUND_DOWN = 1;
|
|
3696
|
+
BigNumber2.ROUND_CEIL = 2;
|
|
3697
|
+
BigNumber2.ROUND_FLOOR = 3;
|
|
3698
|
+
BigNumber2.ROUND_HALF_UP = 4;
|
|
3699
|
+
BigNumber2.ROUND_HALF_DOWN = 5;
|
|
3700
|
+
BigNumber2.ROUND_HALF_EVEN = 6;
|
|
3701
|
+
BigNumber2.ROUND_HALF_CEIL = 7;
|
|
3702
|
+
BigNumber2.ROUND_HALF_FLOOR = 8;
|
|
3703
|
+
BigNumber2.EUCLID = 9;
|
|
3704
|
+
BigNumber2.config = BigNumber2.set = function(obj) {
|
|
3705
|
+
var p, v;
|
|
3706
|
+
if (obj != null) {
|
|
3707
|
+
if (typeof obj == "object") {
|
|
3708
|
+
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
3709
|
+
v = obj[p];
|
|
3710
|
+
intCheck(v, 0, MAX, p);
|
|
3711
|
+
DECIMAL_PLACES = v;
|
|
3712
|
+
}
|
|
3713
|
+
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
3714
|
+
v = obj[p];
|
|
3715
|
+
intCheck(v, 0, 8, p);
|
|
3716
|
+
ROUNDING_MODE = v;
|
|
3717
|
+
}
|
|
3718
|
+
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
3719
|
+
v = obj[p];
|
|
3720
|
+
if (v && v.pop) {
|
|
3721
|
+
intCheck(v[0], -MAX, 0, p);
|
|
3722
|
+
intCheck(v[1], 0, MAX, p);
|
|
3723
|
+
TO_EXP_NEG = v[0];
|
|
3724
|
+
TO_EXP_POS = v[1];
|
|
3725
|
+
} else {
|
|
3726
|
+
intCheck(v, -MAX, MAX, p);
|
|
3727
|
+
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
3728
|
+
}
|
|
3729
|
+
}
|
|
3730
|
+
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
3731
|
+
v = obj[p];
|
|
3732
|
+
if (v && v.pop) {
|
|
3733
|
+
intCheck(v[0], -MAX, -1, p);
|
|
3734
|
+
intCheck(v[1], 1, MAX, p);
|
|
3735
|
+
MIN_EXP = v[0];
|
|
3736
|
+
MAX_EXP = v[1];
|
|
3737
|
+
} else {
|
|
3738
|
+
intCheck(v, -MAX, MAX, p);
|
|
3739
|
+
if (v) {
|
|
3740
|
+
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
3741
|
+
} else {
|
|
3742
|
+
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
}
|
|
3746
|
+
if (obj.hasOwnProperty(p = "CRYPTO")) {
|
|
3747
|
+
v = obj[p];
|
|
3748
|
+
if (v === !!v) {
|
|
3749
|
+
if (v) {
|
|
3750
|
+
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
3751
|
+
CRYPTO = v;
|
|
3752
|
+
} else {
|
|
3753
|
+
CRYPTO = !v;
|
|
3754
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
3755
|
+
}
|
|
3756
|
+
} else {
|
|
3757
|
+
CRYPTO = v;
|
|
3758
|
+
}
|
|
3759
|
+
} else {
|
|
3760
|
+
throw Error(bignumberError + p + " not true or false: " + v);
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
3764
|
+
v = obj[p];
|
|
3765
|
+
intCheck(v, 0, 9, p);
|
|
3766
|
+
MODULO_MODE = v;
|
|
3767
|
+
}
|
|
3768
|
+
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
3769
|
+
v = obj[p];
|
|
3770
|
+
intCheck(v, 0, MAX, p);
|
|
3771
|
+
POW_PRECISION = v;
|
|
3772
|
+
}
|
|
3773
|
+
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
3774
|
+
v = obj[p];
|
|
3775
|
+
if (typeof v == "object") FORMAT = v;
|
|
3776
|
+
else throw Error(bignumberError + p + " not an object: " + v);
|
|
3777
|
+
}
|
|
3778
|
+
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
3779
|
+
v = obj[p];
|
|
3780
|
+
if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
|
|
3781
|
+
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
3782
|
+
ALPHABET = v;
|
|
3783
|
+
} else {
|
|
3784
|
+
throw Error(bignumberError + p + " invalid: " + v);
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
} else {
|
|
3788
|
+
throw Error(bignumberError + "Object expected: " + obj);
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
return {
|
|
3792
|
+
DECIMAL_PLACES,
|
|
3793
|
+
ROUNDING_MODE,
|
|
3794
|
+
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
3795
|
+
RANGE: [MIN_EXP, MAX_EXP],
|
|
3796
|
+
CRYPTO,
|
|
3797
|
+
MODULO_MODE,
|
|
3798
|
+
POW_PRECISION,
|
|
3799
|
+
FORMAT,
|
|
3800
|
+
ALPHABET
|
|
3801
|
+
};
|
|
3802
|
+
};
|
|
3803
|
+
BigNumber2.isBigNumber = function(v) {
|
|
3804
|
+
if (!v || v._isBigNumber !== true) return false;
|
|
3805
|
+
if (!BigNumber2.DEBUG) return true;
|
|
3806
|
+
var i, n, c = v.c, e = v.e, s = v.s;
|
|
3807
|
+
out: if ({}.toString.call(c) == "[object Array]") {
|
|
3808
|
+
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
3809
|
+
if (c[0] === 0) {
|
|
3810
|
+
if (e === 0 && c.length === 1) return true;
|
|
3811
|
+
break out;
|
|
3812
|
+
}
|
|
3813
|
+
i = (e + 1) % LOG_BASE;
|
|
3814
|
+
if (i < 1) i += LOG_BASE;
|
|
3815
|
+
if (String(c[0]).length == i) {
|
|
3816
|
+
for (i = 0; i < c.length; i++) {
|
|
3817
|
+
n = c[i];
|
|
3818
|
+
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
3819
|
+
}
|
|
3820
|
+
if (n !== 0) return true;
|
|
3821
|
+
}
|
|
3822
|
+
}
|
|
3823
|
+
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
3824
|
+
return true;
|
|
3825
|
+
}
|
|
3826
|
+
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
3827
|
+
};
|
|
3828
|
+
BigNumber2.maximum = BigNumber2.max = function() {
|
|
3829
|
+
return maxOrMin(arguments, -1);
|
|
3830
|
+
};
|
|
3831
|
+
BigNumber2.minimum = BigNumber2.min = function() {
|
|
3832
|
+
return maxOrMin(arguments, 1);
|
|
3833
|
+
};
|
|
3834
|
+
BigNumber2.random = (function() {
|
|
3835
|
+
var pow2_53 = 9007199254740992;
|
|
3836
|
+
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
3837
|
+
return mathfloor(Math.random() * pow2_53);
|
|
3838
|
+
} : function() {
|
|
3839
|
+
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
3840
|
+
};
|
|
3841
|
+
return function(dp) {
|
|
3842
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
3843
|
+
if (dp == null) dp = DECIMAL_PLACES;
|
|
3844
|
+
else intCheck(dp, 0, MAX);
|
|
3845
|
+
k = mathceil(dp / LOG_BASE);
|
|
3846
|
+
if (CRYPTO) {
|
|
3847
|
+
if (crypto.getRandomValues) {
|
|
3848
|
+
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
3849
|
+
for (; i < k; ) {
|
|
3850
|
+
v = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
3851
|
+
if (v >= 9e15) {
|
|
3852
|
+
b = crypto.getRandomValues(new Uint32Array(2));
|
|
3853
|
+
a[i] = b[0];
|
|
3854
|
+
a[i + 1] = b[1];
|
|
3855
|
+
} else {
|
|
3856
|
+
c.push(v % 1e14);
|
|
3857
|
+
i += 2;
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
i = k / 2;
|
|
3861
|
+
} else if (crypto.randomBytes) {
|
|
3862
|
+
a = crypto.randomBytes(k *= 7);
|
|
3863
|
+
for (; i < k; ) {
|
|
3864
|
+
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];
|
|
3865
|
+
if (v >= 9e15) {
|
|
3866
|
+
crypto.randomBytes(7).copy(a, i);
|
|
3867
|
+
} else {
|
|
3868
|
+
c.push(v % 1e14);
|
|
3869
|
+
i += 7;
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
i = k / 7;
|
|
3873
|
+
} else {
|
|
3874
|
+
CRYPTO = false;
|
|
3875
|
+
throw Error(bignumberError + "crypto unavailable");
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
if (!CRYPTO) {
|
|
3879
|
+
for (; i < k; ) {
|
|
3880
|
+
v = random53bitInt();
|
|
3881
|
+
if (v < 9e15) c[i++] = v % 1e14;
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
k = c[--i];
|
|
3885
|
+
dp %= LOG_BASE;
|
|
3886
|
+
if (k && dp) {
|
|
3887
|
+
v = POWS_TEN[LOG_BASE - dp];
|
|
3888
|
+
c[i] = mathfloor(k / v) * v;
|
|
3889
|
+
}
|
|
3890
|
+
for (; c[i] === 0; c.pop(), i--) ;
|
|
3891
|
+
if (i < 0) {
|
|
3892
|
+
c = [e = 0];
|
|
3893
|
+
} else {
|
|
3894
|
+
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
3895
|
+
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
3896
|
+
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
3897
|
+
}
|
|
3898
|
+
rand.e = e;
|
|
3899
|
+
rand.c = c;
|
|
3900
|
+
return rand;
|
|
3901
|
+
};
|
|
3902
|
+
})();
|
|
3903
|
+
BigNumber2.sum = function() {
|
|
3904
|
+
var i = 1, args = arguments, sum2 = new BigNumber2(args[0]);
|
|
3905
|
+
for (; i < args.length; ) sum2 = sum2.plus(args[i++]);
|
|
3906
|
+
return sum2;
|
|
3907
|
+
};
|
|
3908
|
+
convertBase = /* @__PURE__ */ (function() {
|
|
3909
|
+
var decimal = "0123456789";
|
|
3910
|
+
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
3911
|
+
var j, arr = [0], arrL, i = 0, len = str.length;
|
|
3912
|
+
for (; i < len; ) {
|
|
3913
|
+
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
3914
|
+
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
3915
|
+
for (j = 0; j < arr.length; j++) {
|
|
3916
|
+
if (arr[j] > baseOut - 1) {
|
|
3917
|
+
if (arr[j + 1] == null) arr[j + 1] = 0;
|
|
3918
|
+
arr[j + 1] += arr[j] / baseOut | 0;
|
|
3919
|
+
arr[j] %= baseOut;
|
|
3920
|
+
}
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
return arr.reverse();
|
|
3924
|
+
}
|
|
3925
|
+
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
3926
|
+
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
3927
|
+
if (i >= 0) {
|
|
3928
|
+
k = POW_PRECISION;
|
|
3929
|
+
POW_PRECISION = 0;
|
|
3930
|
+
str = str.replace(".", "");
|
|
3931
|
+
y = new BigNumber2(baseIn);
|
|
3932
|
+
x = y.pow(str.length - i);
|
|
3933
|
+
POW_PRECISION = k;
|
|
3934
|
+
y.c = toBaseOut(
|
|
3935
|
+
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
3936
|
+
10,
|
|
3937
|
+
baseOut,
|
|
3938
|
+
decimal
|
|
3939
|
+
);
|
|
3940
|
+
y.e = y.c.length;
|
|
3941
|
+
}
|
|
3942
|
+
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
3943
|
+
e = k = xc.length;
|
|
3944
|
+
for (; xc[--k] == 0; xc.pop()) ;
|
|
3945
|
+
if (!xc[0]) return alphabet.charAt(0);
|
|
3946
|
+
if (i < 0) {
|
|
3947
|
+
--e;
|
|
3948
|
+
} else {
|
|
3949
|
+
x.c = xc;
|
|
3950
|
+
x.e = e;
|
|
3951
|
+
x.s = sign;
|
|
3952
|
+
x = div(x, y, dp, rm, baseOut);
|
|
3953
|
+
xc = x.c;
|
|
3954
|
+
r = x.r;
|
|
3955
|
+
e = x.e;
|
|
3956
|
+
}
|
|
3957
|
+
d = e + dp + 1;
|
|
3958
|
+
i = xc[d];
|
|
3959
|
+
k = baseOut / 2;
|
|
3960
|
+
r = r || d < 0 || xc[d + 1] != null;
|
|
3961
|
+
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));
|
|
3962
|
+
if (d < 1 || !xc[0]) {
|
|
3963
|
+
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
3964
|
+
} else {
|
|
3965
|
+
xc.length = d;
|
|
3966
|
+
if (r) {
|
|
3967
|
+
for (--baseOut; ++xc[--d] > baseOut; ) {
|
|
3968
|
+
xc[d] = 0;
|
|
3969
|
+
if (!d) {
|
|
3970
|
+
++e;
|
|
3971
|
+
xc = [1].concat(xc);
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
}
|
|
3975
|
+
for (k = xc.length; !xc[--k]; ) ;
|
|
3976
|
+
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
3977
|
+
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
3978
|
+
}
|
|
3979
|
+
return str;
|
|
3980
|
+
};
|
|
3981
|
+
})();
|
|
3982
|
+
div = /* @__PURE__ */ (function() {
|
|
3983
|
+
function multiply(x, k, base) {
|
|
3984
|
+
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
3985
|
+
for (x = x.slice(); i--; ) {
|
|
3986
|
+
xlo = x[i] % SQRT_BASE;
|
|
3987
|
+
xhi = x[i] / SQRT_BASE | 0;
|
|
3988
|
+
m = khi * xlo + xhi * klo;
|
|
3989
|
+
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
3990
|
+
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
3991
|
+
x[i] = temp % base;
|
|
3992
|
+
}
|
|
3993
|
+
if (carry) x = [carry].concat(x);
|
|
3994
|
+
return x;
|
|
3995
|
+
}
|
|
3996
|
+
function compare2(a, b, aL, bL) {
|
|
3997
|
+
var i, cmp;
|
|
3998
|
+
if (aL != bL) {
|
|
3999
|
+
cmp = aL > bL ? 1 : -1;
|
|
4000
|
+
} else {
|
|
4001
|
+
for (i = cmp = 0; i < aL; i++) {
|
|
4002
|
+
if (a[i] != b[i]) {
|
|
4003
|
+
cmp = a[i] > b[i] ? 1 : -1;
|
|
4004
|
+
break;
|
|
4005
|
+
}
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
4008
|
+
return cmp;
|
|
4009
|
+
}
|
|
4010
|
+
function subtract(a, b, aL, base) {
|
|
4011
|
+
var i = 0;
|
|
4012
|
+
for (; aL--; ) {
|
|
4013
|
+
a[aL] -= i;
|
|
4014
|
+
i = a[aL] < b[aL] ? 1 : 0;
|
|
4015
|
+
a[aL] = i * base + a[aL] - b[aL];
|
|
4016
|
+
}
|
|
4017
|
+
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
4018
|
+
}
|
|
4019
|
+
return function(x, y, dp, rm, base) {
|
|
4020
|
+
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;
|
|
4021
|
+
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
4022
|
+
return new BigNumber2(
|
|
4023
|
+
// Return NaN if either NaN, or both Infinity or 0.
|
|
4024
|
+
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
4025
|
+
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
4026
|
+
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
4027
|
+
)
|
|
4028
|
+
);
|
|
4029
|
+
}
|
|
4030
|
+
q = new BigNumber2(s);
|
|
4031
|
+
qc = q.c = [];
|
|
4032
|
+
e = x.e - y.e;
|
|
4033
|
+
s = dp + e + 1;
|
|
4034
|
+
if (!base) {
|
|
4035
|
+
base = BASE;
|
|
4036
|
+
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
4037
|
+
s = s / LOG_BASE | 0;
|
|
4038
|
+
}
|
|
4039
|
+
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
4040
|
+
if (yc[i] > (xc[i] || 0)) e--;
|
|
4041
|
+
if (s < 0) {
|
|
4042
|
+
qc.push(1);
|
|
4043
|
+
more = true;
|
|
4044
|
+
} else {
|
|
4045
|
+
xL = xc.length;
|
|
4046
|
+
yL = yc.length;
|
|
4047
|
+
i = 0;
|
|
4048
|
+
s += 2;
|
|
4049
|
+
n = mathfloor(base / (yc[0] + 1));
|
|
4050
|
+
if (n > 1) {
|
|
4051
|
+
yc = multiply(yc, n, base);
|
|
4052
|
+
xc = multiply(xc, n, base);
|
|
4053
|
+
yL = yc.length;
|
|
4054
|
+
xL = xc.length;
|
|
4055
|
+
}
|
|
4056
|
+
xi = yL;
|
|
4057
|
+
rem = xc.slice(0, yL);
|
|
4058
|
+
remL = rem.length;
|
|
4059
|
+
for (; remL < yL; rem[remL++] = 0) ;
|
|
4060
|
+
yz = yc.slice();
|
|
4061
|
+
yz = [0].concat(yz);
|
|
4062
|
+
yc0 = yc[0];
|
|
4063
|
+
if (yc[1] >= base / 2) yc0++;
|
|
4064
|
+
do {
|
|
4065
|
+
n = 0;
|
|
4066
|
+
cmp = compare2(yc, rem, yL, remL);
|
|
4067
|
+
if (cmp < 0) {
|
|
4068
|
+
rem0 = rem[0];
|
|
4069
|
+
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
4070
|
+
n = mathfloor(rem0 / yc0);
|
|
4071
|
+
if (n > 1) {
|
|
4072
|
+
if (n >= base) n = base - 1;
|
|
4073
|
+
prod = multiply(yc, n, base);
|
|
4074
|
+
prodL = prod.length;
|
|
4075
|
+
remL = rem.length;
|
|
4076
|
+
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
4077
|
+
n--;
|
|
4078
|
+
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
4079
|
+
prodL = prod.length;
|
|
4080
|
+
cmp = 1;
|
|
4081
|
+
}
|
|
4082
|
+
} else {
|
|
4083
|
+
if (n == 0) {
|
|
4084
|
+
cmp = n = 1;
|
|
4085
|
+
}
|
|
4086
|
+
prod = yc.slice();
|
|
4087
|
+
prodL = prod.length;
|
|
4088
|
+
}
|
|
4089
|
+
if (prodL < remL) prod = [0].concat(prod);
|
|
4090
|
+
subtract(rem, prod, remL, base);
|
|
4091
|
+
remL = rem.length;
|
|
4092
|
+
if (cmp == -1) {
|
|
4093
|
+
while (compare2(yc, rem, yL, remL) < 1) {
|
|
4094
|
+
n++;
|
|
4095
|
+
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
4096
|
+
remL = rem.length;
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
4099
|
+
} else if (cmp === 0) {
|
|
4100
|
+
n++;
|
|
4101
|
+
rem = [0];
|
|
4102
|
+
}
|
|
4103
|
+
qc[i++] = n;
|
|
4104
|
+
if (rem[0]) {
|
|
4105
|
+
rem[remL++] = xc[xi] || 0;
|
|
4106
|
+
} else {
|
|
4107
|
+
rem = [xc[xi]];
|
|
4108
|
+
remL = 1;
|
|
4109
|
+
}
|
|
4110
|
+
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
4111
|
+
more = rem[0] != null;
|
|
4112
|
+
if (!qc[0]) qc.splice(0, 1);
|
|
4113
|
+
}
|
|
4114
|
+
if (base == BASE) {
|
|
4115
|
+
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
4116
|
+
round2(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
4117
|
+
} else {
|
|
4118
|
+
q.e = e;
|
|
4119
|
+
q.r = +more;
|
|
4120
|
+
}
|
|
4121
|
+
return q;
|
|
4122
|
+
};
|
|
4123
|
+
})();
|
|
4124
|
+
function format(n, i, rm, id) {
|
|
4125
|
+
var c0, e, ne, len, str;
|
|
4126
|
+
if (rm == null) rm = ROUNDING_MODE;
|
|
4127
|
+
else intCheck(rm, 0, 8);
|
|
4128
|
+
if (!n.c) return n.toString();
|
|
4129
|
+
c0 = n.c[0];
|
|
4130
|
+
ne = n.e;
|
|
4131
|
+
if (i == null) {
|
|
4132
|
+
str = coeffToString(n.c);
|
|
4133
|
+
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
4134
|
+
} else {
|
|
4135
|
+
n = round2(new BigNumber2(n), i, rm);
|
|
4136
|
+
e = n.e;
|
|
4137
|
+
str = coeffToString(n.c);
|
|
4138
|
+
len = str.length;
|
|
4139
|
+
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
4140
|
+
for (; len < i; str += "0", len++) ;
|
|
4141
|
+
str = toExponential(str, e);
|
|
4142
|
+
} else {
|
|
4143
|
+
i -= ne + (id === 2 && e > ne);
|
|
4144
|
+
str = toFixedPoint(str, e, "0");
|
|
4145
|
+
if (e + 1 > len) {
|
|
4146
|
+
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
4147
|
+
} else {
|
|
4148
|
+
i += e - len;
|
|
4149
|
+
if (i > 0) {
|
|
4150
|
+
if (e + 1 == len) str += ".";
|
|
4151
|
+
for (; i--; str += "0") ;
|
|
4152
|
+
}
|
|
4153
|
+
}
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
return n.s < 0 && c0 ? "-" + str : str;
|
|
4157
|
+
}
|
|
4158
|
+
function maxOrMin(args, n) {
|
|
4159
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
4160
|
+
for (; i < args.length; i++) {
|
|
4161
|
+
y = new BigNumber2(args[i]);
|
|
4162
|
+
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
4163
|
+
x = y;
|
|
4164
|
+
}
|
|
4165
|
+
}
|
|
4166
|
+
return x;
|
|
4167
|
+
}
|
|
4168
|
+
function normalise(n, c, e) {
|
|
4169
|
+
var i = 1, j = c.length;
|
|
4170
|
+
for (; !c[--j]; c.pop()) ;
|
|
4171
|
+
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
4172
|
+
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
4173
|
+
n.c = n.e = null;
|
|
4174
|
+
} else if (e < MIN_EXP) {
|
|
4175
|
+
n.c = [n.e = 0];
|
|
4176
|
+
} else {
|
|
4177
|
+
n.e = e;
|
|
4178
|
+
n.c = c;
|
|
4179
|
+
}
|
|
4180
|
+
return n;
|
|
4181
|
+
}
|
|
4182
|
+
parseNumeric = /* @__PURE__ */ (function() {
|
|
4183
|
+
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
4184
|
+
return function(x, str, isNum, b) {
|
|
4185
|
+
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
4186
|
+
if (isInfinityOrNaN.test(s)) {
|
|
4187
|
+
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
4188
|
+
} else {
|
|
4189
|
+
if (!isNum) {
|
|
4190
|
+
s = s.replace(basePrefix, function(m, p1, p2) {
|
|
4191
|
+
base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
4192
|
+
return !b || b == base ? p1 : m;
|
|
4193
|
+
});
|
|
4194
|
+
if (b) {
|
|
4195
|
+
base = b;
|
|
4196
|
+
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
4197
|
+
}
|
|
4198
|
+
if (str != s) return new BigNumber2(s, base);
|
|
4199
|
+
}
|
|
4200
|
+
if (BigNumber2.DEBUG) {
|
|
4201
|
+
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
4202
|
+
}
|
|
4203
|
+
x.s = null;
|
|
4204
|
+
}
|
|
4205
|
+
x.c = x.e = null;
|
|
4206
|
+
};
|
|
4207
|
+
})();
|
|
4208
|
+
function round2(x, sd, rm, r) {
|
|
4209
|
+
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
4210
|
+
if (xc) {
|
|
4211
|
+
out: {
|
|
4212
|
+
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
4213
|
+
i = sd - d;
|
|
4214
|
+
if (i < 0) {
|
|
4215
|
+
i += LOG_BASE;
|
|
4216
|
+
j = sd;
|
|
4217
|
+
n = xc[ni = 0];
|
|
4218
|
+
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
4219
|
+
} else {
|
|
4220
|
+
ni = mathceil((i + 1) / LOG_BASE);
|
|
4221
|
+
if (ni >= xc.length) {
|
|
4222
|
+
if (r) {
|
|
4223
|
+
for (; xc.length <= ni; xc.push(0)) ;
|
|
4224
|
+
n = rd = 0;
|
|
4225
|
+
d = 1;
|
|
4226
|
+
i %= LOG_BASE;
|
|
4227
|
+
j = i - LOG_BASE + 1;
|
|
4228
|
+
} else {
|
|
4229
|
+
break out;
|
|
4230
|
+
}
|
|
4231
|
+
} else {
|
|
4232
|
+
n = k = xc[ni];
|
|
4233
|
+
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
4234
|
+
i %= LOG_BASE;
|
|
4235
|
+
j = i - LOG_BASE + d;
|
|
4236
|
+
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
4237
|
+
}
|
|
4238
|
+
}
|
|
4239
|
+
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
4240
|
+
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
4241
|
+
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
4242
|
+
xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
|
|
4243
|
+
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.
|
|
4244
|
+
(i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
4245
|
+
if (sd < 1 || !xc[0]) {
|
|
4246
|
+
xc.length = 0;
|
|
4247
|
+
if (r) {
|
|
4248
|
+
sd -= x.e + 1;
|
|
4249
|
+
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
4250
|
+
x.e = -sd || 0;
|
|
4251
|
+
} else {
|
|
4252
|
+
xc[0] = x.e = 0;
|
|
4253
|
+
}
|
|
4254
|
+
return x;
|
|
4255
|
+
}
|
|
4256
|
+
if (i == 0) {
|
|
4257
|
+
xc.length = ni;
|
|
4258
|
+
k = 1;
|
|
4259
|
+
ni--;
|
|
4260
|
+
} else {
|
|
4261
|
+
xc.length = ni + 1;
|
|
4262
|
+
k = pows10[LOG_BASE - i];
|
|
4263
|
+
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
4264
|
+
}
|
|
4265
|
+
if (r) {
|
|
4266
|
+
for (; ; ) {
|
|
4267
|
+
if (ni == 0) {
|
|
4268
|
+
for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
|
|
4269
|
+
j = xc[0] += k;
|
|
4270
|
+
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
4271
|
+
if (i != k) {
|
|
4272
|
+
x.e++;
|
|
4273
|
+
if (xc[0] == BASE) xc[0] = 1;
|
|
4274
|
+
}
|
|
4275
|
+
break;
|
|
4276
|
+
} else {
|
|
4277
|
+
xc[ni] += k;
|
|
4278
|
+
if (xc[ni] != BASE) break;
|
|
4279
|
+
xc[ni--] = 0;
|
|
4280
|
+
k = 1;
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
}
|
|
4284
|
+
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
4285
|
+
}
|
|
4286
|
+
if (x.e > MAX_EXP) {
|
|
4287
|
+
x.c = x.e = null;
|
|
4288
|
+
} else if (x.e < MIN_EXP) {
|
|
4289
|
+
x.c = [x.e = 0];
|
|
4290
|
+
}
|
|
4291
|
+
}
|
|
4292
|
+
return x;
|
|
4293
|
+
}
|
|
4294
|
+
function valueOf(n) {
|
|
4295
|
+
var str, e = n.e;
|
|
4296
|
+
if (e === null) return n.toString();
|
|
4297
|
+
str = coeffToString(n.c);
|
|
4298
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
4299
|
+
return n.s < 0 ? "-" + str : str;
|
|
4300
|
+
}
|
|
4301
|
+
P.absoluteValue = P.abs = function() {
|
|
4302
|
+
var x = new BigNumber2(this);
|
|
4303
|
+
if (x.s < 0) x.s = 1;
|
|
4304
|
+
return x;
|
|
4305
|
+
};
|
|
4306
|
+
P.comparedTo = function(y, b) {
|
|
4307
|
+
return compare(this, new BigNumber2(y, b));
|
|
4308
|
+
};
|
|
4309
|
+
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
4310
|
+
var c, n, v, x = this;
|
|
4311
|
+
if (dp != null) {
|
|
4312
|
+
intCheck(dp, 0, MAX);
|
|
4313
|
+
if (rm == null) rm = ROUNDING_MODE;
|
|
4314
|
+
else intCheck(rm, 0, 8);
|
|
4315
|
+
return round2(new BigNumber2(x), dp + x.e + 1, rm);
|
|
4316
|
+
}
|
|
4317
|
+
if (!(c = x.c)) return null;
|
|
4318
|
+
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
4319
|
+
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
4320
|
+
if (n < 0) n = 0;
|
|
4321
|
+
return n;
|
|
4322
|
+
};
|
|
4323
|
+
P.dividedBy = P.div = function(y, b) {
|
|
4324
|
+
return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
4325
|
+
};
|
|
4326
|
+
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
4327
|
+
return div(this, new BigNumber2(y, b), 0, 1);
|
|
4328
|
+
};
|
|
4329
|
+
P.exponentiatedBy = P.pow = function(n, m) {
|
|
4330
|
+
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
4331
|
+
n = new BigNumber2(n);
|
|
4332
|
+
if (n.c && !n.isInteger()) {
|
|
4333
|
+
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
4334
|
+
}
|
|
4335
|
+
if (m != null) m = new BigNumber2(m);
|
|
4336
|
+
nIsBig = n.e > 14;
|
|
4337
|
+
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
4338
|
+
y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
4339
|
+
return m ? y.mod(m) : y;
|
|
4340
|
+
}
|
|
4341
|
+
nIsNeg = n.s < 0;
|
|
4342
|
+
if (m) {
|
|
4343
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber2(NaN);
|
|
4344
|
+
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
4345
|
+
if (isModExp) x = x.mod(m);
|
|
4346
|
+
} else 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))) {
|
|
4347
|
+
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
4348
|
+
if (x.e > -1) k = 1 / k;
|
|
4349
|
+
return new BigNumber2(nIsNeg ? 1 / k : k);
|
|
4350
|
+
} else if (POW_PRECISION) {
|
|
4351
|
+
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
4352
|
+
}
|
|
4353
|
+
if (nIsBig) {
|
|
4354
|
+
half = new BigNumber2(0.5);
|
|
4355
|
+
if (nIsNeg) n.s = 1;
|
|
4356
|
+
nIsOdd = isOdd(n);
|
|
4357
|
+
} else {
|
|
4358
|
+
i = Math.abs(+valueOf(n));
|
|
4359
|
+
nIsOdd = i % 2;
|
|
4360
|
+
}
|
|
4361
|
+
y = new BigNumber2(ONE);
|
|
4362
|
+
for (; ; ) {
|
|
4363
|
+
if (nIsOdd) {
|
|
4364
|
+
y = y.times(x);
|
|
4365
|
+
if (!y.c) break;
|
|
4366
|
+
if (k) {
|
|
4367
|
+
if (y.c.length > k) y.c.length = k;
|
|
4368
|
+
} else if (isModExp) {
|
|
4369
|
+
y = y.mod(m);
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4372
|
+
if (i) {
|
|
4373
|
+
i = mathfloor(i / 2);
|
|
4374
|
+
if (i === 0) break;
|
|
4375
|
+
nIsOdd = i % 2;
|
|
4376
|
+
} else {
|
|
4377
|
+
n = n.times(half);
|
|
4378
|
+
round2(n, n.e + 1, 1);
|
|
4379
|
+
if (n.e > 14) {
|
|
4380
|
+
nIsOdd = isOdd(n);
|
|
4381
|
+
} else {
|
|
4382
|
+
i = +valueOf(n);
|
|
4383
|
+
if (i === 0) break;
|
|
4384
|
+
nIsOdd = i % 2;
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
x = x.times(x);
|
|
4388
|
+
if (k) {
|
|
4389
|
+
if (x.c && x.c.length > k) x.c.length = k;
|
|
4390
|
+
} else if (isModExp) {
|
|
4391
|
+
x = x.mod(m);
|
|
4392
|
+
}
|
|
4393
|
+
}
|
|
4394
|
+
if (isModExp) return y;
|
|
4395
|
+
if (nIsNeg) y = ONE.div(y);
|
|
4396
|
+
return m ? y.mod(m) : k ? round2(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
4397
|
+
};
|
|
4398
|
+
P.integerValue = function(rm) {
|
|
4399
|
+
var n = new BigNumber2(this);
|
|
4400
|
+
if (rm == null) rm = ROUNDING_MODE;
|
|
4401
|
+
else intCheck(rm, 0, 8);
|
|
4402
|
+
return round2(n, n.e + 1, rm);
|
|
4403
|
+
};
|
|
4404
|
+
P.isEqualTo = P.eq = function(y, b) {
|
|
4405
|
+
return compare(this, new BigNumber2(y, b)) === 0;
|
|
4406
|
+
};
|
|
4407
|
+
P.isFinite = function() {
|
|
4408
|
+
return !!this.c;
|
|
4409
|
+
};
|
|
4410
|
+
P.isGreaterThan = P.gt = function(y, b) {
|
|
4411
|
+
return compare(this, new BigNumber2(y, b)) > 0;
|
|
4412
|
+
};
|
|
4413
|
+
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
4414
|
+
return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
|
|
4415
|
+
};
|
|
4416
|
+
P.isInteger = function() {
|
|
4417
|
+
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
4418
|
+
};
|
|
4419
|
+
P.isLessThan = P.lt = function(y, b) {
|
|
4420
|
+
return compare(this, new BigNumber2(y, b)) < 0;
|
|
4421
|
+
};
|
|
4422
|
+
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
4423
|
+
return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
|
|
4424
|
+
};
|
|
4425
|
+
P.isNaN = function() {
|
|
4426
|
+
return !this.s;
|
|
4427
|
+
};
|
|
4428
|
+
P.isNegative = function() {
|
|
4429
|
+
return this.s < 0;
|
|
4430
|
+
};
|
|
4431
|
+
P.isPositive = function() {
|
|
4432
|
+
return this.s > 0;
|
|
4433
|
+
};
|
|
4434
|
+
P.isZero = function() {
|
|
4435
|
+
return !!this.c && this.c[0] == 0;
|
|
4436
|
+
};
|
|
4437
|
+
P.minus = function(y, b) {
|
|
4438
|
+
var i, j, t, xLTy, x = this, a = x.s;
|
|
4439
|
+
y = new BigNumber2(y, b);
|
|
4440
|
+
b = y.s;
|
|
4441
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
4442
|
+
if (a != b) {
|
|
4443
|
+
y.s = -b;
|
|
4444
|
+
return x.plus(y);
|
|
4445
|
+
}
|
|
4446
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
4447
|
+
if (!xe || !ye) {
|
|
4448
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
|
|
4449
|
+
if (!xc[0] || !yc[0]) {
|
|
4450
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : (
|
|
4451
|
+
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
4452
|
+
ROUNDING_MODE == 3 ? -0 : 0
|
|
4453
|
+
));
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
xe = bitFloor(xe);
|
|
4457
|
+
ye = bitFloor(ye);
|
|
4458
|
+
xc = xc.slice();
|
|
4459
|
+
if (a = xe - ye) {
|
|
4460
|
+
if (xLTy = a < 0) {
|
|
4461
|
+
a = -a;
|
|
4462
|
+
t = xc;
|
|
4463
|
+
} else {
|
|
4464
|
+
ye = xe;
|
|
4465
|
+
t = yc;
|
|
4466
|
+
}
|
|
4467
|
+
t.reverse();
|
|
4468
|
+
for (b = a; b--; t.push(0)) ;
|
|
4469
|
+
t.reverse();
|
|
4470
|
+
} else {
|
|
4471
|
+
j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
4472
|
+
for (a = b = 0; b < j; b++) {
|
|
4473
|
+
if (xc[b] != yc[b]) {
|
|
4474
|
+
xLTy = xc[b] < yc[b];
|
|
4475
|
+
break;
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
if (xLTy) {
|
|
4480
|
+
t = xc;
|
|
4481
|
+
xc = yc;
|
|
4482
|
+
yc = t;
|
|
4483
|
+
y.s = -y.s;
|
|
4484
|
+
}
|
|
4485
|
+
b = (j = yc.length) - (i = xc.length);
|
|
4486
|
+
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
4487
|
+
b = BASE - 1;
|
|
4488
|
+
for (; j > a; ) {
|
|
4489
|
+
if (xc[--j] < yc[j]) {
|
|
4490
|
+
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
4491
|
+
--xc[i];
|
|
4492
|
+
xc[j] += BASE;
|
|
4493
|
+
}
|
|
4494
|
+
xc[j] -= yc[j];
|
|
4495
|
+
}
|
|
4496
|
+
for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
|
|
4497
|
+
if (!xc[0]) {
|
|
4498
|
+
y.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
4499
|
+
y.c = [y.e = 0];
|
|
4500
|
+
return y;
|
|
4501
|
+
}
|
|
4502
|
+
return normalise(y, xc, ye);
|
|
4503
|
+
};
|
|
4504
|
+
P.modulo = P.mod = function(y, b) {
|
|
4505
|
+
var q, s, x = this;
|
|
4506
|
+
y = new BigNumber2(y, b);
|
|
4507
|
+
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
4508
|
+
return new BigNumber2(NaN);
|
|
4509
|
+
} else if (!y.c || x.c && !x.c[0]) {
|
|
4510
|
+
return new BigNumber2(x);
|
|
4511
|
+
}
|
|
4512
|
+
if (MODULO_MODE == 9) {
|
|
4513
|
+
s = y.s;
|
|
4514
|
+
y.s = 1;
|
|
4515
|
+
q = div(x, y, 0, 3);
|
|
4516
|
+
y.s = s;
|
|
4517
|
+
q.s *= s;
|
|
4518
|
+
} else {
|
|
4519
|
+
q = div(x, y, 0, MODULO_MODE);
|
|
4520
|
+
}
|
|
4521
|
+
y = x.minus(q.times(y));
|
|
4522
|
+
if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
|
|
4523
|
+
return y;
|
|
4524
|
+
};
|
|
4525
|
+
P.multipliedBy = P.times = function(y, b) {
|
|
4526
|
+
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;
|
|
4527
|
+
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
4528
|
+
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
4529
|
+
y.c = y.e = y.s = null;
|
|
4530
|
+
} else {
|
|
4531
|
+
y.s *= x.s;
|
|
4532
|
+
if (!xc || !yc) {
|
|
4533
|
+
y.c = y.e = null;
|
|
4534
|
+
} else {
|
|
4535
|
+
y.c = [0];
|
|
4536
|
+
y.e = 0;
|
|
4537
|
+
}
|
|
4538
|
+
}
|
|
4539
|
+
return y;
|
|
4540
|
+
}
|
|
4541
|
+
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
4542
|
+
y.s *= x.s;
|
|
4543
|
+
xcL = xc.length;
|
|
4544
|
+
ycL = yc.length;
|
|
4545
|
+
if (xcL < ycL) {
|
|
4546
|
+
zc = xc;
|
|
4547
|
+
xc = yc;
|
|
4548
|
+
yc = zc;
|
|
4549
|
+
i = xcL;
|
|
4550
|
+
xcL = ycL;
|
|
4551
|
+
ycL = i;
|
|
4552
|
+
}
|
|
4553
|
+
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
4554
|
+
base = BASE;
|
|
4555
|
+
sqrtBase = SQRT_BASE;
|
|
4556
|
+
for (i = ycL; --i >= 0; ) {
|
|
4557
|
+
c = 0;
|
|
4558
|
+
ylo = yc[i] % sqrtBase;
|
|
4559
|
+
yhi = yc[i] / sqrtBase | 0;
|
|
4560
|
+
for (k = xcL, j = i + k; j > i; ) {
|
|
4561
|
+
xlo = xc[--k] % sqrtBase;
|
|
4562
|
+
xhi = xc[k] / sqrtBase | 0;
|
|
4563
|
+
m = yhi * xlo + xhi * ylo;
|
|
4564
|
+
xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
|
|
4565
|
+
c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
|
|
4566
|
+
zc[j--] = xlo % base;
|
|
4567
|
+
}
|
|
4568
|
+
zc[j] = c;
|
|
4569
|
+
}
|
|
4570
|
+
if (c) {
|
|
4571
|
+
++e;
|
|
4572
|
+
} else {
|
|
4573
|
+
zc.splice(0, 1);
|
|
4574
|
+
}
|
|
4575
|
+
return normalise(y, zc, e);
|
|
4576
|
+
};
|
|
4577
|
+
P.negated = function() {
|
|
4578
|
+
var x = new BigNumber2(this);
|
|
4579
|
+
x.s = -x.s || null;
|
|
4580
|
+
return x;
|
|
4581
|
+
};
|
|
4582
|
+
P.plus = function(y, b) {
|
|
4583
|
+
var t, x = this, a = x.s;
|
|
4584
|
+
y = new BigNumber2(y, b);
|
|
4585
|
+
b = y.s;
|
|
4586
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
4587
|
+
if (a != b) {
|
|
4588
|
+
y.s = -b;
|
|
4589
|
+
return x.minus(y);
|
|
4590
|
+
}
|
|
4591
|
+
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
4592
|
+
if (!xe || !ye) {
|
|
4593
|
+
if (!xc || !yc) return new BigNumber2(a / 0);
|
|
4594
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
|
|
4595
|
+
}
|
|
4596
|
+
xe = bitFloor(xe);
|
|
4597
|
+
ye = bitFloor(ye);
|
|
4598
|
+
xc = xc.slice();
|
|
4599
|
+
if (a = xe - ye) {
|
|
4600
|
+
if (a > 0) {
|
|
4601
|
+
ye = xe;
|
|
4602
|
+
t = yc;
|
|
4603
|
+
} else {
|
|
4604
|
+
a = -a;
|
|
4605
|
+
t = xc;
|
|
4606
|
+
}
|
|
4607
|
+
t.reverse();
|
|
4608
|
+
for (; a--; t.push(0)) ;
|
|
4609
|
+
t.reverse();
|
|
4610
|
+
}
|
|
4611
|
+
a = xc.length;
|
|
4612
|
+
b = yc.length;
|
|
4613
|
+
if (a - b < 0) {
|
|
4614
|
+
t = yc;
|
|
4615
|
+
yc = xc;
|
|
4616
|
+
xc = t;
|
|
4617
|
+
b = a;
|
|
4618
|
+
}
|
|
4619
|
+
for (a = 0; b; ) {
|
|
4620
|
+
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
4621
|
+
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
4622
|
+
}
|
|
4623
|
+
if (a) {
|
|
4624
|
+
xc = [a].concat(xc);
|
|
4625
|
+
++ye;
|
|
4626
|
+
}
|
|
4627
|
+
return normalise(y, xc, ye);
|
|
4628
|
+
};
|
|
4629
|
+
P.precision = P.sd = function(sd, rm) {
|
|
4630
|
+
var c, n, v, x = this;
|
|
4631
|
+
if (sd != null && sd !== !!sd) {
|
|
4632
|
+
intCheck(sd, 1, MAX);
|
|
4633
|
+
if (rm == null) rm = ROUNDING_MODE;
|
|
4634
|
+
else intCheck(rm, 0, 8);
|
|
4635
|
+
return round2(new BigNumber2(x), sd, rm);
|
|
4636
|
+
}
|
|
4637
|
+
if (!(c = x.c)) return null;
|
|
4638
|
+
v = c.length - 1;
|
|
4639
|
+
n = v * LOG_BASE + 1;
|
|
4640
|
+
if (v = c[v]) {
|
|
4641
|
+
for (; v % 10 == 0; v /= 10, n--) ;
|
|
4642
|
+
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
4643
|
+
}
|
|
4644
|
+
if (sd && x.e + 1 > n) n = x.e + 1;
|
|
4645
|
+
return n;
|
|
4646
|
+
};
|
|
4647
|
+
P.shiftedBy = function(k) {
|
|
4648
|
+
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
4649
|
+
return this.times("1e" + k);
|
|
4650
|
+
};
|
|
4651
|
+
P.squareRoot = P.sqrt = function() {
|
|
4652
|
+
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");
|
|
4653
|
+
if (s !== 1 || !c || !c[0]) {
|
|
4654
|
+
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
4655
|
+
}
|
|
4656
|
+
s = Math.sqrt(+valueOf(x));
|
|
4657
|
+
if (s == 0 || s == 1 / 0) {
|
|
4658
|
+
n = coeffToString(c);
|
|
4659
|
+
if ((n.length + e) % 2 == 0) n += "0";
|
|
4660
|
+
s = Math.sqrt(+n);
|
|
4661
|
+
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
4662
|
+
if (s == 1 / 0) {
|
|
4663
|
+
n = "5e" + e;
|
|
4664
|
+
} else {
|
|
4665
|
+
n = s.toExponential();
|
|
4666
|
+
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
4667
|
+
}
|
|
4668
|
+
r = new BigNumber2(n);
|
|
4669
|
+
} else {
|
|
4670
|
+
r = new BigNumber2(s + "");
|
|
4671
|
+
}
|
|
4672
|
+
if (r.c[0]) {
|
|
4673
|
+
e = r.e;
|
|
4674
|
+
s = e + dp;
|
|
4675
|
+
if (s < 3) s = 0;
|
|
4676
|
+
for (; ; ) {
|
|
4677
|
+
t = r;
|
|
4678
|
+
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
4679
|
+
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
4680
|
+
if (r.e < e) --s;
|
|
4681
|
+
n = n.slice(s - 3, s + 1);
|
|
4682
|
+
if (n == "9999" || !rep && n == "4999") {
|
|
4683
|
+
if (!rep) {
|
|
4684
|
+
round2(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
4685
|
+
if (t.times(t).eq(x)) {
|
|
4686
|
+
r = t;
|
|
4687
|
+
break;
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
dp += 4;
|
|
4691
|
+
s += 4;
|
|
4692
|
+
rep = 1;
|
|
4693
|
+
} else {
|
|
4694
|
+
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
4695
|
+
round2(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
4696
|
+
m = !r.times(r).eq(x);
|
|
4697
|
+
}
|
|
4698
|
+
break;
|
|
4699
|
+
}
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4703
|
+
return round2(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
4704
|
+
};
|
|
4705
|
+
P.toExponential = function(dp, rm) {
|
|
4706
|
+
if (dp != null) {
|
|
4707
|
+
intCheck(dp, 0, MAX);
|
|
4708
|
+
dp++;
|
|
4709
|
+
}
|
|
4710
|
+
return format(this, dp, rm, 1);
|
|
4711
|
+
};
|
|
4712
|
+
P.toFixed = function(dp, rm) {
|
|
4713
|
+
if (dp != null) {
|
|
4714
|
+
intCheck(dp, 0, MAX);
|
|
4715
|
+
dp = dp + this.e + 1;
|
|
4716
|
+
}
|
|
4717
|
+
return format(this, dp, rm);
|
|
4718
|
+
};
|
|
4719
|
+
P.toFormat = function(dp, rm, format2) {
|
|
4720
|
+
var str, x = this;
|
|
4721
|
+
if (format2 == null) {
|
|
4722
|
+
if (dp != null && rm && typeof rm == "object") {
|
|
4723
|
+
format2 = rm;
|
|
4724
|
+
rm = null;
|
|
4725
|
+
} else if (dp && typeof dp == "object") {
|
|
4726
|
+
format2 = dp;
|
|
4727
|
+
dp = rm = null;
|
|
4728
|
+
} else {
|
|
4729
|
+
format2 = FORMAT;
|
|
4730
|
+
}
|
|
4731
|
+
} else if (typeof format2 != "object") {
|
|
4732
|
+
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
4733
|
+
}
|
|
4734
|
+
str = x.toFixed(dp, rm);
|
|
4735
|
+
if (x.c) {
|
|
4736
|
+
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;
|
|
4737
|
+
if (g2) {
|
|
4738
|
+
i = g1;
|
|
4739
|
+
g1 = g2;
|
|
4740
|
+
g2 = i;
|
|
4741
|
+
len -= i;
|
|
4742
|
+
}
|
|
4743
|
+
if (g1 > 0 && len > 0) {
|
|
4744
|
+
i = len % g1 || g1;
|
|
4745
|
+
intPart = intDigits.substr(0, i);
|
|
4746
|
+
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
4747
|
+
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
4748
|
+
if (isNeg) intPart = "-" + intPart;
|
|
4749
|
+
}
|
|
4750
|
+
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
4751
|
+
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
4752
|
+
"$&" + (format2.fractionGroupSeparator || "")
|
|
4753
|
+
) : fractionPart) : intPart;
|
|
4754
|
+
}
|
|
4755
|
+
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
4756
|
+
};
|
|
4757
|
+
P.toFraction = function(md) {
|
|
4758
|
+
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
4759
|
+
if (md != null) {
|
|
4760
|
+
n = new BigNumber2(md);
|
|
4761
|
+
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
4762
|
+
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
4763
|
+
}
|
|
4764
|
+
}
|
|
4765
|
+
if (!xc) return new BigNumber2(x);
|
|
4766
|
+
d = new BigNumber2(ONE);
|
|
4767
|
+
n1 = d0 = new BigNumber2(ONE);
|
|
4768
|
+
d1 = n0 = new BigNumber2(ONE);
|
|
4769
|
+
s = coeffToString(xc);
|
|
4770
|
+
e = d.e = s.length - x.e - 1;
|
|
4771
|
+
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
4772
|
+
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
4773
|
+
exp = MAX_EXP;
|
|
4774
|
+
MAX_EXP = 1 / 0;
|
|
4775
|
+
n = new BigNumber2(s);
|
|
4776
|
+
n0.c[0] = 0;
|
|
4777
|
+
for (; ; ) {
|
|
4778
|
+
q = div(n, d, 0, 1);
|
|
4779
|
+
d2 = d0.plus(q.times(d1));
|
|
4780
|
+
if (d2.comparedTo(md) == 1) break;
|
|
4781
|
+
d0 = d1;
|
|
4782
|
+
d1 = d2;
|
|
4783
|
+
n1 = n0.plus(q.times(d2 = n1));
|
|
4784
|
+
n0 = d2;
|
|
4785
|
+
d = n.minus(q.times(d2 = d));
|
|
4786
|
+
n = d2;
|
|
4787
|
+
}
|
|
4788
|
+
d2 = div(md.minus(d0), d1, 0, 1);
|
|
4789
|
+
n0 = n0.plus(d2.times(n1));
|
|
4790
|
+
d0 = d0.plus(d2.times(d1));
|
|
4791
|
+
n0.s = n1.s = x.s;
|
|
4792
|
+
e = e * 2;
|
|
4793
|
+
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
4794
|
+
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
4795
|
+
) < 1 ? [n1, d1] : [n0, d0];
|
|
4796
|
+
MAX_EXP = exp;
|
|
4797
|
+
return r;
|
|
4798
|
+
};
|
|
4799
|
+
P.toNumber = function() {
|
|
4800
|
+
return +valueOf(this);
|
|
4801
|
+
};
|
|
4802
|
+
P.toPrecision = function(sd, rm) {
|
|
4803
|
+
if (sd != null) intCheck(sd, 1, MAX);
|
|
4804
|
+
return format(this, sd, rm, 2);
|
|
4805
|
+
};
|
|
4806
|
+
P.toString = function(b) {
|
|
4807
|
+
var str, n = this, s = n.s, e = n.e;
|
|
4808
|
+
if (e === null) {
|
|
4809
|
+
if (s) {
|
|
4810
|
+
str = "Infinity";
|
|
4811
|
+
if (s < 0) str = "-" + str;
|
|
4812
|
+
} else {
|
|
4813
|
+
str = "NaN";
|
|
4814
|
+
}
|
|
4815
|
+
} else {
|
|
4816
|
+
if (b == null) {
|
|
4817
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
4818
|
+
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
4819
|
+
n = round2(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
4820
|
+
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
4821
|
+
} else {
|
|
4822
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
4823
|
+
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
4824
|
+
}
|
|
4825
|
+
if (s < 0 && n.c[0]) str = "-" + str;
|
|
4826
|
+
}
|
|
4827
|
+
return str;
|
|
4828
|
+
};
|
|
4829
|
+
P.valueOf = P.toJSON = function() {
|
|
4830
|
+
return valueOf(this);
|
|
4831
|
+
};
|
|
4832
|
+
P._isBigNumber = true;
|
|
4833
|
+
P[Symbol.toStringTag] = "BigNumber";
|
|
4834
|
+
P[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = P.valueOf;
|
|
4835
|
+
if (configObject != null) BigNumber2.set(configObject);
|
|
4836
|
+
return BigNumber2;
|
|
4837
|
+
}
|
|
4838
|
+
function bitFloor(n) {
|
|
4839
|
+
var i = n | 0;
|
|
4840
|
+
return n > 0 || n === i ? i : i - 1;
|
|
4841
|
+
}
|
|
4842
|
+
function coeffToString(a) {
|
|
4843
|
+
var s, z, i = 1, j = a.length, r = a[0] + "";
|
|
4844
|
+
for (; i < j; ) {
|
|
4845
|
+
s = a[i++] + "";
|
|
4846
|
+
z = LOG_BASE - s.length;
|
|
4847
|
+
for (; z--; s = "0" + s) ;
|
|
4848
|
+
r += s;
|
|
4849
|
+
}
|
|
4850
|
+
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
4851
|
+
return r.slice(0, j + 1 || 1);
|
|
4852
|
+
}
|
|
4853
|
+
function compare(x, y) {
|
|
4854
|
+
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
4855
|
+
if (!i || !j) return null;
|
|
4856
|
+
a = xc && !xc[0];
|
|
4857
|
+
b = yc && !yc[0];
|
|
4858
|
+
if (a || b) return a ? b ? 0 : -j : i;
|
|
4859
|
+
if (i != j) return i;
|
|
4860
|
+
a = i < 0;
|
|
4861
|
+
b = k == l;
|
|
4862
|
+
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
4863
|
+
if (!b) return k > l ^ a ? 1 : -1;
|
|
4864
|
+
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
4865
|
+
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
4866
|
+
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
4867
|
+
}
|
|
4868
|
+
function intCheck(n, min, max, name) {
|
|
4869
|
+
if (n < min || n > max || n !== mathfloor(n)) {
|
|
4870
|
+
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
4871
|
+
}
|
|
4872
|
+
}
|
|
4873
|
+
function isOdd(n) {
|
|
4874
|
+
var k = n.c.length - 1;
|
|
4875
|
+
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
4876
|
+
}
|
|
4877
|
+
function toExponential(str, e) {
|
|
4878
|
+
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
4879
|
+
}
|
|
4880
|
+
function toFixedPoint(str, e, z) {
|
|
4881
|
+
var len, zs;
|
|
4882
|
+
if (e < 0) {
|
|
4883
|
+
for (zs = z + "."; ++e; zs += z) ;
|
|
4884
|
+
str = zs + str;
|
|
4885
|
+
} else {
|
|
4886
|
+
len = str.length;
|
|
4887
|
+
if (++e > len) {
|
|
4888
|
+
for (zs = z, e -= len; --e; zs += z) ;
|
|
4889
|
+
str += zs;
|
|
4890
|
+
} else if (e < len) {
|
|
4891
|
+
str = str.slice(0, e) + "." + str.slice(e);
|
|
4892
|
+
}
|
|
4893
|
+
}
|
|
4894
|
+
return str;
|
|
4895
|
+
}
|
|
4896
|
+
var BigNumber = clone2();
|
|
4897
|
+
var bignumber_default = BigNumber;
|
|
2839
4898
|
|
|
2840
4899
|
// src/ts/number/big.ts
|
|
2841
|
-
import BigNumber from "bignumber.js";
|
|
2842
4900
|
function big(x) {
|
|
2843
|
-
return x instanceof
|
|
4901
|
+
return x instanceof bignumber_default ? x : new bignumber_default(x);
|
|
2844
4902
|
}
|
|
2845
4903
|
function mathPlus(...rest2) {
|
|
2846
4904
|
let acc = big(rest2[0]);
|
|
@@ -2865,10 +4923,10 @@ function mathDiv(...rest2) {
|
|
|
2865
4923
|
function mathPow(x, y) {
|
|
2866
4924
|
return big(x).pow(big(y)).toNumber();
|
|
2867
4925
|
}
|
|
2868
|
-
function mathRound(x, dp = 0, rm =
|
|
4926
|
+
function mathRound(x, dp = 0, rm = bignumber_default.ROUND_HALF_UP) {
|
|
2869
4927
|
return big(x).decimalPlaces(dp, rm).toNumber();
|
|
2870
4928
|
}
|
|
2871
|
-
function mathFixed(x, dp = 2, rm =
|
|
4929
|
+
function mathFixed(x, dp = 2, rm = bignumber_default.ROUND_HALF_UP) {
|
|
2872
4930
|
return big(x).toFixed(dp, rm);
|
|
2873
4931
|
}
|
|
2874
4932
|
function mathCompare(a, b) {
|
|
@@ -2963,10 +5021,10 @@ function toChineseNum(num) {
|
|
|
2963
5021
|
function toChineseCurrency(amount, opts = {}) {
|
|
2964
5022
|
var _a, _b, _c;
|
|
2965
5023
|
const dp = (_a = opts.precision) != null ? _a : 2;
|
|
2966
|
-
const rm = (_b = opts.rm) != null ? _b :
|
|
5024
|
+
const rm = (_b = opts.rm) != null ? _b : bignumber_default.ROUND_HALF_UP;
|
|
2967
5025
|
const yuan = (_c = opts.yuanChar) != null ? _c : "\u5143";
|
|
2968
5026
|
if (amount === null || amount === void 0) return "";
|
|
2969
|
-
const bn = new
|
|
5027
|
+
const bn = new bignumber_default(amount);
|
|
2970
5028
|
if (!bn.isFinite()) return "";
|
|
2971
5029
|
const s = bn.toFixed(dp, rm);
|
|
2972
5030
|
const sign = s.startsWith("-") ? "\u8D1F" : "";
|
|
@@ -2991,7 +5049,7 @@ function toChineseCurrency(amount, opts = {}) {
|
|
|
2991
5049
|
}
|
|
2992
5050
|
return str.replace(/零+$/g, "");
|
|
2993
5051
|
};
|
|
2994
|
-
const intNum = new
|
|
5052
|
+
const intNum = new bignumber_default(intStr);
|
|
2995
5053
|
let res = "";
|
|
2996
5054
|
if (intNum.isZero()) {
|
|
2997
5055
|
res = digit[0];
|
|
@@ -3028,31 +5086,31 @@ function randomBoolean() {
|
|
|
3028
5086
|
}
|
|
3029
5087
|
|
|
3030
5088
|
// src/ts/day/index.ts
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
5089
|
+
import_dayjs.default.extend(import_customParseFormat.default);
|
|
5090
|
+
import_dayjs.default.extend(import_utc.default);
|
|
5091
|
+
import_dayjs.default.extend(import_timezone.default);
|
|
5092
|
+
import_dayjs.default.extend(import_relativeTime.default);
|
|
5093
|
+
import_dayjs.default.extend(import_advancedFormat.default);
|
|
5094
|
+
import_dayjs.default.locale("zh-cn");
|
|
3037
5095
|
function toDayjs(t, fmt) {
|
|
3038
|
-
if (t === null || t === void 0) return
|
|
5096
|
+
if (t === null || t === void 0) return (0, import_dayjs.default)();
|
|
3039
5097
|
if (typeof t === "number") {
|
|
3040
5098
|
const s = String(Math.trunc(t));
|
|
3041
|
-
return
|
|
5099
|
+
return (0, import_dayjs.default)(s.length === 10 ? t * 1e3 : t, fmt);
|
|
3042
5100
|
}
|
|
3043
5101
|
if (typeof t === "string") {
|
|
3044
5102
|
const s = t.trim();
|
|
3045
|
-
if (/^\d{10}$/.test(s)) return
|
|
3046
|
-
if (/^\d{13}$/.test(s)) return
|
|
3047
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(s)) return
|
|
3048
|
-
if (/^\d{4}\/\d{2}\/\d{2}$/.test(s)) return
|
|
5103
|
+
if (/^\d{10}$/.test(s)) return (0, import_dayjs.default)(Number(s) * 1e3, fmt);
|
|
5104
|
+
if (/^\d{13}$/.test(s)) return (0, import_dayjs.default)(Number(s), fmt);
|
|
5105
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(s)) return (0, import_dayjs.default)(s, fmt || "YYYY-MM-DD");
|
|
5106
|
+
if (/^\d{4}\/\d{2}\/\d{2}$/.test(s)) return (0, import_dayjs.default)(s, fmt || "YYYY/MM/DD");
|
|
3049
5107
|
if (/^\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}$/.test(s))
|
|
3050
|
-
return
|
|
5108
|
+
return (0, import_dayjs.default)(s, fmt || "YYYY-MM-DD HH:mm:ss");
|
|
3051
5109
|
if (/^\d{4}\/\d{2}\/\d{2}\s+\d{2}:\d{2}:\d{2}$/.test(s))
|
|
3052
|
-
return
|
|
3053
|
-
return
|
|
5110
|
+
return (0, import_dayjs.default)(s, fmt || "YYYY/MM/DD HH:mm:ss");
|
|
5111
|
+
return (0, import_dayjs.default)(s, fmt);
|
|
3054
5112
|
}
|
|
3055
|
-
return
|
|
5113
|
+
return (0, import_dayjs.default)(t, fmt);
|
|
3056
5114
|
}
|
|
3057
5115
|
function dateFormat(t, fmt = "YYYY-MM-DD HH:mm:ss") {
|
|
3058
5116
|
if (!t) return "";
|
|
@@ -3710,7 +5768,7 @@ function isChinese(s) {
|
|
|
3710
5768
|
function isDigits(s) {
|
|
3711
5769
|
return /^[0-9]+$/.test(s);
|
|
3712
5770
|
}
|
|
3713
|
-
function
|
|
5771
|
+
function isNumeric2(value, options) {
|
|
3714
5772
|
const { negative = false, decimal = 2, thousands = false, leadZero = false } = options || {};
|
|
3715
5773
|
if (value === null || value === void 0 || value === "") return false;
|
|
3716
5774
|
const str = String(value).trim();
|
|
@@ -3935,9 +5993,10 @@ function isLongitude(s) {
|
|
|
3935
5993
|
const v = typeof s === "number" ? s : Number(String(s != null ? s : "").trim());
|
|
3936
5994
|
return Number.isFinite(v) && v >= -180 && v <= 180;
|
|
3937
5995
|
}
|
|
5996
|
+
var export_dayjs = import_dayjs.default;
|
|
3938
5997
|
export {
|
|
3939
5998
|
AbortError,
|
|
3940
|
-
BigNumber,
|
|
5999
|
+
bignumber_default as BigNumber,
|
|
3941
6000
|
EventBus,
|
|
3942
6001
|
Mutex,
|
|
3943
6002
|
SSEParser,
|
|
@@ -3970,7 +6029,7 @@ export {
|
|
|
3970
6029
|
curry,
|
|
3971
6030
|
curryRight,
|
|
3972
6031
|
dateFormat,
|
|
3973
|
-
dayjs,
|
|
6032
|
+
export_dayjs as dayjs,
|
|
3974
6033
|
debounce,
|
|
3975
6034
|
deburr,
|
|
3976
6035
|
delay,
|
|
@@ -4064,7 +6123,7 @@ export {
|
|
|
4064
6123
|
isNotNil,
|
|
4065
6124
|
isNull,
|
|
4066
6125
|
isNumber,
|
|
4067
|
-
isNumeric,
|
|
6126
|
+
isNumeric2 as isNumeric,
|
|
4068
6127
|
isOfficerId,
|
|
4069
6128
|
isPassport,
|
|
4070
6129
|
isPhone,
|