szdl-utils-kit 0.2.18 → 0.2.20
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.js +467 -449
- package/dist/index.umd.cjs +2 -2
- package/dist/types/batch.d.ts +5 -0
- package/dist/types/bx-boot.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var C = (y, A, e) => (
|
|
1
|
+
var fe = Object.defineProperty;
|
|
2
|
+
var Ne = (y, A, e) => A in y ? fe(y, A, { enumerable: !0, configurable: !0, writable: !0, value: e }) : y[A] = e;
|
|
3
|
+
var C = (y, A, e) => (Ne(y, typeof A != "symbol" ? A + "" : A, e), e), xt = (y, A, e) => {
|
|
4
4
|
if (!A.has(y))
|
|
5
5
|
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var o = (y, A, e) => (
|
|
7
|
+
var o = (y, A, e) => (xt(y, A, "read from private field"), e ? e.call(y) : A.get(y)), f = (y, A, e) => {
|
|
8
8
|
if (A.has(y))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
A instanceof WeakSet ? A.add(y) : A.set(y, e);
|
|
11
|
-
}, E = (y, A, e, n) => (
|
|
12
|
-
var _ = (y, A, e) => (
|
|
13
|
-
var
|
|
14
|
-
function
|
|
11
|
+
}, E = (y, A, e, n) => (xt(y, A, "write to private field"), n ? n.call(y, e) : A.set(y, e), e);
|
|
12
|
+
var _ = (y, A, e) => (xt(y, A, "access private method"), e);
|
|
13
|
+
var _e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
14
|
+
function Oe(y) {
|
|
15
15
|
return y && y.__esModule && Object.prototype.hasOwnProperty.call(y, "default") ? y.default : y;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
17
|
+
var jt = { exports: {} };
|
|
18
18
|
(function(y, A) {
|
|
19
19
|
(function(e) {
|
|
20
20
|
Array.prototype.indexOf || (Array.prototype.indexOf = function(t, s) {
|
|
@@ -24,7 +24,7 @@ var xt = { exports: {} };
|
|
|
24
24
|
return a;
|
|
25
25
|
return -1;
|
|
26
26
|
});
|
|
27
|
-
var n = this,
|
|
27
|
+
var n = this, r = function(t, s) {
|
|
28
28
|
for (var a = t.toString(); a.length < s; )
|
|
29
29
|
a = "0" + a;
|
|
30
30
|
return a;
|
|
@@ -40,15 +40,15 @@ var xt = { exports: {} };
|
|
|
40
40
|
t.slice(s + 3, s + 4),
|
|
41
41
|
t.charAt(s + 5),
|
|
42
42
|
t.slice(s + 6, s + 9)
|
|
43
|
-
],
|
|
44
|
-
return !isNaN(Number(c[0])) && !isNaN(Number(c[2])) && !isNaN(Number(c[4])) ? (c[1] === "." && c[3] === "." ? a = "%d.%m.%Y" : c[1] === "-" && c[3] === "-" ? a = "%m-%d-%Y" : c[1] === "/" && c[3] === "/" && (a = "%m/%d/%Y"), a) : (
|
|
43
|
+
], L;
|
|
44
|
+
return !isNaN(Number(c[0])) && !isNaN(Number(c[2])) && !isNaN(Number(c[4])) ? (c[1] === "." && c[3] === "." ? a = "%d.%m.%Y" : c[1] === "-" && c[3] === "-" ? a = "%m-%d-%Y" : c[1] === "/" && c[3] === "/" && (a = "%m/%d/%Y"), a) : (L = [
|
|
45
45
|
t.slice(s, s + 3),
|
|
46
46
|
t.charAt(s + 4),
|
|
47
47
|
t.slice(s + 5, s + 6),
|
|
48
48
|
t.charAt(s + 7),
|
|
49
49
|
t.slice(s + 8, s + 9)
|
|
50
|
-
], !isNaN(Number(
|
|
51
|
-
}, u = n.tempus,
|
|
50
|
+
], !isNaN(Number(L[0])) && !isNaN(Number(L[2])) && !isNaN(Number(L[4])) ? (L[1] === "-" && L[3] === "-" && (a = "%Y-%m-%d"), a) : "");
|
|
51
|
+
}, u = n.tempus, i, T, g = n.navigator || {}, m = "en", N = {
|
|
52
52
|
en: {
|
|
53
53
|
JANUARY_SHORT: "Jan",
|
|
54
54
|
FEBRUARY_SHORT: "Feb",
|
|
@@ -211,64 +211,64 @@ var xt = { exports: {} };
|
|
|
211
211
|
}
|
|
212
212
|
}, G = function() {
|
|
213
213
|
return [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
214
|
+
N[m].JANUARY_LONG,
|
|
215
|
+
N[m].FEBRUARY_LONG,
|
|
216
|
+
N[m].MARCH_LONG,
|
|
217
|
+
N[m].APRIL_LONG,
|
|
218
|
+
N[m].MAY_LONG,
|
|
219
|
+
N[m].JUNE_LONG,
|
|
220
|
+
N[m].JULY_LONG,
|
|
221
|
+
N[m].AUGUST_LONG,
|
|
222
|
+
N[m].SEPTEMBER_LONG,
|
|
223
|
+
N[m].OCTOBER_LONG,
|
|
224
|
+
N[m].NOVEMBER_LONG,
|
|
225
|
+
N[m].DECEMBER_LONG
|
|
226
226
|
];
|
|
227
|
-
},
|
|
227
|
+
}, ht = function() {
|
|
228
228
|
return [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
229
|
+
N[m].JANUARY_SHORT,
|
|
230
|
+
N[m].FEBRUARY_SHORT,
|
|
231
|
+
N[m].MARCH_SHORT,
|
|
232
|
+
N[m].APRIL_SHORT,
|
|
233
|
+
N[m].MAY_SHORT,
|
|
234
|
+
N[m].JUNE_SHORT,
|
|
235
|
+
N[m].JULY_SHORT,
|
|
236
|
+
N[m].AUGUST_SHORT,
|
|
237
|
+
N[m].SEPTEMBER_SHORT,
|
|
238
|
+
N[m].OCTOBER_SHORT,
|
|
239
|
+
N[m].NOVEMBER_SHORT,
|
|
240
|
+
N[m].DECEMBER_SHORT
|
|
241
241
|
];
|
|
242
|
-
},
|
|
242
|
+
}, z = function() {
|
|
243
243
|
return [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
N[m].SUNDAY_LONG,
|
|
245
|
+
N[m].MONDAY_LONG,
|
|
246
|
+
N[m].TUESDAY_LONG,
|
|
247
|
+
N[m].WEDNESDAY_LONG,
|
|
248
|
+
N[m].THURSDAY_LONG,
|
|
249
|
+
N[m].FRIDAY_LONG,
|
|
250
|
+
N[m].SATURDAY_LONG
|
|
251
251
|
];
|
|
252
|
-
},
|
|
252
|
+
}, k = function() {
|
|
253
253
|
return [
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
N[m].SUNDAY_SHORT,
|
|
255
|
+
N[m].MONDAY_SHORT,
|
|
256
|
+
N[m].TUESDAY_SHORT,
|
|
257
|
+
N[m].WEDNESDAY_SHORT,
|
|
258
|
+
N[m].THURSDAY_SHORT,
|
|
259
|
+
N[m].FRIDAY_SHORT,
|
|
260
|
+
N[m].SATURDAY_SHORT
|
|
261
261
|
];
|
|
262
|
-
}, P, Mt,
|
|
262
|
+
}, P, Mt, ct, lt, me = function(t, s, a) {
|
|
263
263
|
var c;
|
|
264
264
|
n.XMLHttpRequest ? c = new XMLHttpRequest() : c = new ActiveXObject("Microsoft.XMLHTTP"), c.onreadystatechange = function() {
|
|
265
265
|
c.readyState === 4 && (c.status === 200 ? s && (n.JSON === e ? alert(`Please, include json2 into your project if you want use old browsers!
|
|
266
266
|
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.parse(c.responseText))) : a && a(c));
|
|
267
267
|
}, c.open("GET", t, !1), c.send();
|
|
268
|
-
},
|
|
268
|
+
}, U = {
|
|
269
269
|
"%d": {
|
|
270
270
|
format: function(t) {
|
|
271
|
-
return
|
|
271
|
+
return r(t.day() || i.MIN_DAY, 2);
|
|
272
272
|
},
|
|
273
273
|
parse: function(t) {
|
|
274
274
|
var s = Number(t);
|
|
@@ -280,7 +280,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
280
280
|
},
|
|
281
281
|
"%m": {
|
|
282
282
|
format: function(t) {
|
|
283
|
-
return
|
|
283
|
+
return r(t.month() || i.MIN_MONTH, 2);
|
|
284
284
|
},
|
|
285
285
|
parse: function(t) {
|
|
286
286
|
var s = Number(t);
|
|
@@ -292,7 +292,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
292
292
|
},
|
|
293
293
|
"%Y": {
|
|
294
294
|
format: function(t) {
|
|
295
|
-
return
|
|
295
|
+
return r(t.year() || i.MIN_YEAR, 4);
|
|
296
296
|
},
|
|
297
297
|
parse: function(t) {
|
|
298
298
|
var s = Number(t);
|
|
@@ -304,7 +304,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
304
304
|
},
|
|
305
305
|
"%w": {
|
|
306
306
|
format: function(t) {
|
|
307
|
-
return t.dayOfWeek() ||
|
|
307
|
+
return t.dayOfWeek() || i.MIN_DAY_OF_WEEK;
|
|
308
308
|
},
|
|
309
309
|
parse: function() {
|
|
310
310
|
return {};
|
|
@@ -316,7 +316,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
316
316
|
"%a": {
|
|
317
317
|
format: function(t) {
|
|
318
318
|
var s = t.dayOfWeek();
|
|
319
|
-
return
|
|
319
|
+
return lt[s !== e ? s : i.MIN_DAY_OF_WEEK];
|
|
320
320
|
},
|
|
321
321
|
parse: function() {
|
|
322
322
|
return {};
|
|
@@ -328,7 +328,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
328
328
|
"%A": {
|
|
329
329
|
format: function(t) {
|
|
330
330
|
var s = t.dayOfWeek();
|
|
331
|
-
return
|
|
331
|
+
return ct[s !== e ? s : i.MIN_DAY_OF_WEEK];
|
|
332
332
|
},
|
|
333
333
|
parse: function() {
|
|
334
334
|
return {};
|
|
@@ -339,11 +339,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
339
339
|
},
|
|
340
340
|
"%b": {
|
|
341
341
|
format: function(t) {
|
|
342
|
-
var s =
|
|
343
|
-
return Mt[s !== e ? s :
|
|
342
|
+
var s = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
343
|
+
return Mt[s !== e ? s : i.MIN_MONTH];
|
|
344
344
|
},
|
|
345
345
|
parse: function(t) {
|
|
346
|
-
var s =
|
|
346
|
+
var s = i.monthNames().indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
347
347
|
return { month: s !== -1 ? s : e };
|
|
348
348
|
},
|
|
349
349
|
minLength: 1,
|
|
@@ -352,11 +352,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
352
352
|
},
|
|
353
353
|
"%B": {
|
|
354
354
|
format: function(t) {
|
|
355
|
-
var s =
|
|
356
|
-
return P[s !== e ? s :
|
|
355
|
+
var s = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
356
|
+
return P[s !== e ? s : i.MIN_MONTH];
|
|
357
357
|
},
|
|
358
358
|
parse: function(t) {
|
|
359
|
-
var s =
|
|
359
|
+
var s = i.monthNames(!0).indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
360
360
|
return { month: s !== -1 ? s : e };
|
|
361
361
|
},
|
|
362
362
|
minLength: 1,
|
|
@@ -365,7 +365,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
365
365
|
},
|
|
366
366
|
"%H": {
|
|
367
367
|
format: function(t) {
|
|
368
|
-
return
|
|
368
|
+
return r(t.hours() || i.MIN_HOURS, 2);
|
|
369
369
|
},
|
|
370
370
|
parse: function(t) {
|
|
371
371
|
var s = Number(t);
|
|
@@ -377,7 +377,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
377
377
|
},
|
|
378
378
|
"%M": {
|
|
379
379
|
format: function(t) {
|
|
380
|
-
return
|
|
380
|
+
return r(t.minutes() || i.MIN_MINUTES, 2);
|
|
381
381
|
},
|
|
382
382
|
parse: function(t) {
|
|
383
383
|
var s = Number(t);
|
|
@@ -389,7 +389,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
389
389
|
},
|
|
390
390
|
"%S": {
|
|
391
391
|
format: function(t) {
|
|
392
|
-
return
|
|
392
|
+
return r(t.seconds() || i.MIN_SECONDS, 2);
|
|
393
393
|
},
|
|
394
394
|
parse: function(t) {
|
|
395
395
|
var s = Number(t);
|
|
@@ -404,7 +404,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
404
404
|
return t.timestamp();
|
|
405
405
|
},
|
|
406
406
|
parse: function(t) {
|
|
407
|
-
return isNaN(Number(t)) ? {} :
|
|
407
|
+
return isNaN(Number(t)) ? {} : i(Number(t)).get();
|
|
408
408
|
},
|
|
409
409
|
minLength: 1,
|
|
410
410
|
maxLength: 20,
|
|
@@ -412,7 +412,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
412
412
|
},
|
|
413
413
|
"%F": {
|
|
414
414
|
format: function(t) {
|
|
415
|
-
return
|
|
415
|
+
return r(t.year() || i.MIN_YEAR, 4) + "-" + r(t.month() || i.MIN_MONTH, 2) + "-" + r(t.day() || i.MIN_DAY, 2);
|
|
416
416
|
},
|
|
417
417
|
parse: function(t) {
|
|
418
418
|
var s = Number(t.slice(0, 4)), a = Number(t.slice(5, 7)), c = Number(t.slice(8, 10));
|
|
@@ -428,7 +428,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
428
428
|
},
|
|
429
429
|
"%D": {
|
|
430
430
|
format: function(t) {
|
|
431
|
-
return
|
|
431
|
+
return r(t.month() || i.MIN_MONTH, 2) + "/" + r(t.day() || i.MIN_DAY, 2) + "/" + r(t.year() || i.MIN_YEAR, 4);
|
|
432
432
|
},
|
|
433
433
|
parse: function(t) {
|
|
434
434
|
var s = Number(t.slice(0, 2)), a = Number(t.slice(3, 5)), c = Number(t.slice(6, 10));
|
|
@@ -442,11 +442,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
442
442
|
maxLength: 10,
|
|
443
443
|
type: "string"
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, pt = {
|
|
446
446
|
useMilliseconds: !1,
|
|
447
447
|
monthFromZero: !1
|
|
448
|
-
},
|
|
449
|
-
|
|
448
|
+
}, R;
|
|
449
|
+
R = function(t, s, a) {
|
|
450
450
|
return this._d = /* @__PURE__ */ new Date(), this._i = {
|
|
451
451
|
year: !1,
|
|
452
452
|
month: !1,
|
|
@@ -456,55 +456,55 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
456
456
|
seconds: !1,
|
|
457
457
|
milliseconds: !1
|
|
458
458
|
}, t !== e && this.set(t, s, a), this;
|
|
459
|
-
},
|
|
460
|
-
var t = this.month(), s =
|
|
461
|
-
return this.leapYear() && t === (
|
|
462
|
-
},
|
|
459
|
+
}, R.fn = R.prototype, R.fn.dayCount = function() {
|
|
460
|
+
var t = this.month(), s = i.MAX_DAY_IN_MONTHS[t - (i.options("monthFromZero") ? 0 : 1)];
|
|
461
|
+
return this.leapYear() && t === (i.options("monthFromZero") ? 1 : 2) && (s += 1), s;
|
|
462
|
+
}, R.fn.year = function(t) {
|
|
463
463
|
if (arguments.length !== 0)
|
|
464
|
-
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >=
|
|
464
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_YEAR && Number(t) <= i.MAX_YEAR ? (this._d.setFullYear(Number(t)), this._i.year = !1) : this._i.year = Number(t) : (this._d.setFullYear(i.MIN_YEAR), this._i.year = !1);
|
|
465
465
|
else
|
|
466
466
|
return this._i.year === !1 ? this._d.getFullYear() : this._i.year;
|
|
467
467
|
return this;
|
|
468
|
-
},
|
|
468
|
+
}, R.fn.month = function(t) {
|
|
469
469
|
if (arguments.length !== 0)
|
|
470
|
-
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >=
|
|
470
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MONTH && Number(t) <= i.MAX_MONTH ? (this._d.setMonth(i.options("monthFromZero") ? Number(t) : Number(t) - 1), this._i.month = !1) : this._i.month = Number(t) : (this._d.setMonth(i.options("monthFromZero") ? i.MIN_MONTH : i.MIN_MONTH - 1), this._i.month = !1);
|
|
471
471
|
else
|
|
472
|
-
return this._i.month === !1 ?
|
|
472
|
+
return this._i.month === !1 ? i.options("monthFromZero") ? this._d.getMonth() : this._d.getMonth() + 1 : this._i.month;
|
|
473
473
|
return this;
|
|
474
|
-
},
|
|
474
|
+
}, R.fn.day = function(t) {
|
|
475
475
|
if (arguments.length !== 0)
|
|
476
|
-
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >=
|
|
476
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_DAY && Number(t) <= this.dayCount() ? (this._d.setDate(Number(t)), this._i.day = !1) : this._i.day = Number(t) : (this._d.setDate(i.MIN_DAY), this._i.day = !1);
|
|
477
477
|
else
|
|
478
478
|
return this._i.day === !1 ? this._d.getDate() : this._i.day;
|
|
479
479
|
return this;
|
|
480
|
-
},
|
|
480
|
+
}, R.fn.hours = function(t) {
|
|
481
481
|
if (arguments.length !== 0)
|
|
482
|
-
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >=
|
|
482
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_HOURS && Number(t) <= i.MAX_HOURS ? (this._d.setHours(Number(t)), this._i.hours = !1) : this._i.hours = Number(t) : (this._d.setHours(i.MIN_HOURS), this._i.hours = !1);
|
|
483
483
|
else
|
|
484
484
|
return this._i.hours === !1 ? this._d.getHours() : this._i.hours;
|
|
485
485
|
return this;
|
|
486
|
-
},
|
|
486
|
+
}, R.fn.minutes = function(t) {
|
|
487
487
|
if (arguments.length !== 0)
|
|
488
|
-
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >=
|
|
488
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MINUTES && Number(t) <= i.MAX_MINUTES ? (this._d.setMinutes(Number(t)), this._i.minutes = !1) : this._i.minutes = Number(t) : (this._d.setMinutes(i.MIN_MINUTES), this._i.minutes = !1);
|
|
489
489
|
else
|
|
490
490
|
return this._i.minutes === !1 ? this._d.getMinutes() : this._i.minutes;
|
|
491
491
|
return this;
|
|
492
|
-
},
|
|
492
|
+
}, R.fn.seconds = function(t) {
|
|
493
493
|
if (arguments.length !== 0)
|
|
494
|
-
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >=
|
|
494
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_SECONDS && Number(t) <= i.MAX_SECONDS ? (this._d.setSeconds(Number(t)), this._i.seconds = !1) : this._i.seconds = Number(t) : (this._d.setSeconds(i.MIN_SECONDS), this._i.seconds = !1);
|
|
495
495
|
else
|
|
496
496
|
return this._i.seconds === !1 ? this._d.getSeconds() : this._i.seconds;
|
|
497
497
|
return this;
|
|
498
|
-
},
|
|
498
|
+
}, R.fn.milliseconds = function(t) {
|
|
499
499
|
if (arguments.length !== 0)
|
|
500
|
-
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >=
|
|
500
|
+
(typeof t == "number" || typeof t == "string") && !isNaN(Number(t)) ? Number(t) >= i.MIN_MILLISECONDS && Number(t) <= i.MAX_MILLISECONDS ? (this._d.setMilliseconds(Number(t)), this._i.milliseconds = !1) : this._i.milliseconds = Number(t) : (this._d.setMilliseconds(i.MIN_MILLISECONDS), this._i.milliseconds = !1);
|
|
501
501
|
else
|
|
502
502
|
return this._i.milliseconds === !1 ? this._d.getMilliseconds() : this._i.milliseconds;
|
|
503
503
|
return this;
|
|
504
|
-
},
|
|
505
|
-
var t = new Date(this.year(), 0, 1), s =
|
|
504
|
+
}, R.fn.week = function() {
|
|
505
|
+
var t = new Date(this.year(), 0, 1), s = i(this.utc()).hours(0).minutes(0).seconds(0).milliseconds(0).utc() * 1e3;
|
|
506
506
|
return Math.ceil(((s - t.getTime()) / 864e5 + t.getDay() + 1) / 7);
|
|
507
|
-
},
|
|
507
|
+
}, R.fn.set = function(t, s, a) {
|
|
508
508
|
if (this._i = {
|
|
509
509
|
year: !1,
|
|
510
510
|
month: !1,
|
|
@@ -518,9 +518,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
518
518
|
if (t instanceof Date)
|
|
519
519
|
return this._d = t, this;
|
|
520
520
|
if (typeof t == "number")
|
|
521
|
-
return this._d = new Date(t * (
|
|
522
|
-
if (typeof t == "object" && (t instanceof Array ? (this.day(
|
|
523
|
-
var c,
|
|
521
|
+
return this._d = new Date(t * (i.options("useMilliseconds") ? 1 : 1e3)), this;
|
|
522
|
+
if (typeof t == "object" && (t instanceof Array ? (this.day(i.MIN_DAY), this.year(t[0]), this.month(t[1]), this.day(t[2]), this.hours(t[3]), this.minutes(t[4]), this.seconds(t[5]), this.milliseconds(t[6])) : (this.day(i.MIN_DAY), this.year(t.year), this.month(t.month), this.day(t.day), this.hours(t.hours), this.minutes(t.minutes), this.seconds(t.seconds), this.milliseconds(t.milliseconds))), typeof t == "string") {
|
|
523
|
+
var c, L = [], d, S, X = [], H = 0, D = 0, M, w, p = {}, b;
|
|
524
524
|
if (t === e)
|
|
525
525
|
return d = h(this, a), d === e && (this._i = {
|
|
526
526
|
year: -1,
|
|
@@ -531,24 +531,24 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
531
531
|
seconds: -1,
|
|
532
532
|
milliseconds: -1
|
|
533
533
|
}), d;
|
|
534
|
-
for (s === e && (s =
|
|
534
|
+
for (s === e && (s = i.detectFormat(t)); H < s.length; ) {
|
|
535
535
|
if (s.charAt(H) === "%") {
|
|
536
|
-
if (
|
|
537
|
-
switch (
|
|
536
|
+
if (S = s.charAt(H) + s.charAt(H + 1), U[S] !== e) {
|
|
537
|
+
switch (M = 0, w = "", U[S].type) {
|
|
538
538
|
case "number":
|
|
539
|
-
for (;
|
|
540
|
-
w += t.charAt(D +
|
|
539
|
+
for (; M < U[S].maxLength && D + M < t.length && !isNaN(Number(t.charAt(D + M))); )
|
|
540
|
+
w += t.charAt(D + M), M += 1;
|
|
541
541
|
break;
|
|
542
542
|
case "word":
|
|
543
|
-
for (;
|
|
544
|
-
w += t.charAt(D +
|
|
543
|
+
for (; M < U[S].maxLength && D + M < t.length && /^[\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(t.charAt(D + M)); )
|
|
544
|
+
w += t.charAt(D + M), M += 1;
|
|
545
545
|
break;
|
|
546
546
|
case "string":
|
|
547
|
-
for (;
|
|
548
|
-
w += t.charAt(D +
|
|
547
|
+
for (; M < U[S].maxLength && D + M < t.length; )
|
|
548
|
+
w += t.charAt(D + M), M += 1;
|
|
549
549
|
break;
|
|
550
550
|
}
|
|
551
|
-
if (
|
|
551
|
+
if (M < U[S].minLength)
|
|
552
552
|
return d = h(this, a), d === e && (this._i = {
|
|
553
553
|
year: -1,
|
|
554
554
|
month: -1,
|
|
@@ -558,7 +558,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
558
558
|
seconds: -1,
|
|
559
559
|
milliseconds: -1
|
|
560
560
|
}), d;
|
|
561
|
-
|
|
561
|
+
L.push(S), X.push(w), M -= 1, D += M, H += 1;
|
|
562
562
|
}
|
|
563
563
|
} else if (t.charAt(D) !== s.charAt(H))
|
|
564
564
|
return d = h(this, a), d === e && (this._i = {
|
|
@@ -572,8 +572,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
572
572
|
}), d;
|
|
573
573
|
H += 1, D += 1;
|
|
574
574
|
}
|
|
575
|
-
for (c in
|
|
576
|
-
|
|
575
|
+
for (c in L)
|
|
576
|
+
L.hasOwnProperty(c) && U.hasOwnProperty(L[c]) && (b = U[L[c]].parse(X[c]), p = {
|
|
577
577
|
year: b.year !== e ? b.year : p.year,
|
|
578
578
|
month: b.month !== e ? b.month : p.month,
|
|
579
579
|
day: b.day !== e ? b.day : p.day,
|
|
@@ -581,21 +581,21 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
581
581
|
minutes: b.minutes !== e ? b.minutes : p.minutes,
|
|
582
582
|
seconds: b.seconds !== e ? b.seconds : p.seconds
|
|
583
583
|
});
|
|
584
|
-
this.day(
|
|
584
|
+
this.day(i.MIN_DAY), this.year(p.year), this.month(p.month), this.day(p.day), this.hours(p.hours), this.minutes(p.minutes), this.seconds(p.seconds), this.milliseconds(p.milliseconds);
|
|
585
585
|
}
|
|
586
586
|
return this;
|
|
587
|
-
},
|
|
587
|
+
}, R.fn.leapYear = function() {
|
|
588
588
|
var t = this.year();
|
|
589
589
|
return t % 4 === 0 ? t % 100 === 0 ? t % 400 === 0 : !0 : !1;
|
|
590
|
-
},
|
|
591
|
-
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (
|
|
592
|
-
},
|
|
593
|
-
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (
|
|
594
|
-
},
|
|
590
|
+
}, R.fn.timestamp = function(t) {
|
|
591
|
+
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3) + this._d.getTimezoneOffset() * 6e4), this) : i.options("useMilliseconds") ? this._d.getTime() - this._d.getTimezoneOffset() * 6e4 : Math.floor(this._d.getTime() / 1e3) - this._d.getTimezoneOffset() * 60;
|
|
592
|
+
}, R.fn.utc = function(t) {
|
|
593
|
+
return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3)), this) : i.options("useMilliseconds") ? this._d.getTime() : Math.floor(this._d.getTime() / 1e3);
|
|
594
|
+
}, R.fn.dayOfWeek = function(t) {
|
|
595
595
|
if (t === "long")
|
|
596
|
-
return ht[this._d.getDay()];
|
|
597
|
-
if (t === "short")
|
|
598
596
|
return ct[this._d.getDay()];
|
|
597
|
+
if (t === "short")
|
|
598
|
+
return lt[this._d.getDay()];
|
|
599
599
|
if (t === e)
|
|
600
600
|
return this._d.getDay();
|
|
601
601
|
if (t === 0 || t === "Sunday")
|
|
@@ -612,7 +612,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
612
612
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -2 : 5) - this.dayOfWeek() });
|
|
613
613
|
if (t === 6 || t === "Saturday")
|
|
614
614
|
return this.calc({ day: (this.dayOfWeek() === 0 ? -1 : 6) - this.dayOfWeek() });
|
|
615
|
-
},
|
|
615
|
+
}, R.fn.timezone = function(t) {
|
|
616
616
|
switch (t) {
|
|
617
617
|
case "hours":
|
|
618
618
|
return Math.floor(this._d.getTimezoneOffset() / 60);
|
|
@@ -621,12 +621,12 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
621
621
|
default:
|
|
622
622
|
return this._d.getTimezoneOffset() * 60;
|
|
623
623
|
}
|
|
624
|
-
},
|
|
624
|
+
}, R.fn.get = function(t) {
|
|
625
625
|
switch (t) {
|
|
626
626
|
case "Date":
|
|
627
627
|
return new Date(
|
|
628
628
|
this.year(),
|
|
629
|
-
this.month() - (
|
|
629
|
+
this.month() - (i.options("monthFromZero") ? 0 : 1),
|
|
630
630
|
this.day(),
|
|
631
631
|
this.hours(),
|
|
632
632
|
this.minutes(),
|
|
@@ -636,7 +636,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
636
636
|
case "DateUTC":
|
|
637
637
|
return new Date(Date.UTC(
|
|
638
638
|
this.year(),
|
|
639
|
-
this.month() - (
|
|
639
|
+
this.month() - (i.options("monthFromZero") ? 0 : 1),
|
|
640
640
|
this.day(),
|
|
641
641
|
this.hours(),
|
|
642
642
|
this.minutes(),
|
|
@@ -670,15 +670,15 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
670
670
|
timestamp: this.timestamp()
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
|
-
},
|
|
673
|
+
}, R.fn.format = function(t) {
|
|
674
674
|
for (var s = 0, a = "", c; s < t.length; )
|
|
675
|
-
t.charAt(s) === "%" ? (c = t.charAt(s) + t.charAt(s + 1),
|
|
675
|
+
t.charAt(s) === "%" ? (c = t.charAt(s) + t.charAt(s + 1), U[c] !== e ? (a += U[c].format(this), s += 1) : a += "%") : a += t.charAt(s), s += 1;
|
|
676
676
|
return a;
|
|
677
|
-
},
|
|
677
|
+
}, R.fn.valid = function() {
|
|
678
678
|
return this._i.year === !1 && this._i.month === !1 && this._i.day === !1 && this._i.hours === !1 && this._i.minutes === !1 && this._i.seconds === !1 && this._i.milliseconds === !1;
|
|
679
|
-
},
|
|
679
|
+
}, R.fn.errors = function() {
|
|
680
680
|
return this._i;
|
|
681
|
-
},
|
|
681
|
+
}, R.fn.between = function(t, s) {
|
|
682
682
|
var a = this.timestamp(), c = t.timestamp();
|
|
683
683
|
switch (s) {
|
|
684
684
|
case "year":
|
|
@@ -696,24 +696,24 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
696
696
|
default:
|
|
697
697
|
return e;
|
|
698
698
|
}
|
|
699
|
-
},
|
|
699
|
+
}, R.fn.calc = function(t) {
|
|
700
700
|
return t.year !== e && this._d.setFullYear(this._d.getFullYear() + t.year), t.month !== e && this._d.setMonth(this._d.getMonth() + t.month), t.day !== e && this._d.setDate(this._d.getDate() + t.day), t.hours !== e && this._d.setHours(this._d.getHours() + t.hours), t.minutes !== e && this._d.setMinutes(this._d.getMinutes() + t.minutes), t.seconds !== e && this._d.setSeconds(this._d.getSeconds() + t.seconds), t.milliseconds !== e && this._d.setMilliseconds(this._d.getMilliseconds() + t.milliseconds), this;
|
|
701
|
-
},
|
|
702
|
-
return new
|
|
703
|
-
},
|
|
701
|
+
}, i = function(t, s, a) {
|
|
702
|
+
return new R(t, s, a);
|
|
703
|
+
}, i.MIN_YEAR = 1e3, i.MAX_YEAR = 3e3, i.MIN_MONTH = 1, i.MAX_MONTH = 12, i.MIN_DAY = 1, i.MAX_DAY_IN_MONTHS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], i.MIN_DAY_OF_WEEK = 0, i.MAX_DAY_OF_WEEK = 6, i.MIN_HOURS = 0, i.MAX_HOURS = 23, i.MIN_MINUTES = 0, i.MAX_MINUTES = 59, i.MIN_SECONDS = 0, i.MAX_SECONDS = 59, i.MIN_MILLISECONDS = 0, i.MAX_MILLISECONDS = 999, i.VERSION = "0.2.18", i.options = function(t, s) {
|
|
704
704
|
if (t === e)
|
|
705
|
-
return
|
|
706
|
-
if (
|
|
705
|
+
return pt;
|
|
706
|
+
if (pt.hasOwnProperty(t)) {
|
|
707
707
|
if (s === e)
|
|
708
|
-
return
|
|
709
|
-
|
|
708
|
+
return pt[t];
|
|
709
|
+
pt[t] = s, t === "monthFromZero" && (i.MIN_MONTH = s ? 0 : 1, i.MAX_MONTH = s ? 11 : 12);
|
|
710
710
|
}
|
|
711
711
|
return e;
|
|
712
|
-
},
|
|
713
|
-
return n.tempus = u,
|
|
714
|
-
},
|
|
715
|
-
var s, a, c,
|
|
716
|
-
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof
|
|
712
|
+
}, i.noConflict = function() {
|
|
713
|
+
return n.tempus = u, i;
|
|
714
|
+
}, i.generate = function(t) {
|
|
715
|
+
var s, a, c, L, d, S, X, H;
|
|
716
|
+
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof R ? s = t.dateFrom.utc() : s = i(t.dateFrom, t.formatFrom).utc()), typeof t.dateTo != "number" && (t.dateTo instanceof R ? a = t.dateTo.utc() : a = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ? d = {
|
|
717
717
|
year: 0,
|
|
718
718
|
month: 0,
|
|
719
719
|
day: 0,
|
|
@@ -734,8 +734,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
734
734
|
hours: t.period.hours !== e ? t.period.hours : 0,
|
|
735
735
|
minutes: t.period.minutes !== e ? t.period.minutes : 0,
|
|
736
736
|
seconds: t.period.seconds !== e ? t.period.seconds : 0
|
|
737
|
-
}), t.groupBy === e ?
|
|
738
|
-
return t.asObject === !0 ? t.format !== e ? w[
|
|
737
|
+
}), t.groupBy === e ? S = t.asObject === !0 ? {} : [] : (S = [], S.push([]), X = i(s).get()[t.groupBy]), H = function(w, p, b) {
|
|
738
|
+
return t.asObject === !0 ? t.format !== e ? w[i(p).format(t.format)] = {} : w[i(p).format("%F %H:%M:%S")] = {} : t.format !== e ? w.push(b ? null : i(p).format(t.format)) : w.push(b ? null : i(p)), w;
|
|
739
739
|
}, t.groupBy !== e && t.fillNulls) {
|
|
740
740
|
var D = {
|
|
741
741
|
year: d.year ? -d.year : e,
|
|
@@ -746,305 +746,314 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
746
746
|
seconds: d.seconds ? -d.seconds : e,
|
|
747
747
|
milliseconds: d.milliseconds ? -d.milliseconds : e
|
|
748
748
|
};
|
|
749
|
-
for (c =
|
|
750
|
-
H(
|
|
749
|
+
for (c = i(s).calc(D).utc(); i(c).get()[t.groupBy] === X; )
|
|
750
|
+
H(S[S.length - 1], c, !0), c = i(c).calc(D).utc();
|
|
751
751
|
if (t.groupBy === "week") {
|
|
752
|
-
var
|
|
753
|
-
for (c =
|
|
754
|
-
H(
|
|
752
|
+
var M = i(s).dayOfWeek();
|
|
753
|
+
for (c = i(s).dayOfWeek(0).utc(); S[0].length < M && c < s; )
|
|
754
|
+
H(S[S.length - 1], c, !0), c = i(c).calc(d).utc();
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
for (; s <= a; )
|
|
758
|
-
t.groupBy === e ? H(
|
|
758
|
+
t.groupBy === e ? H(S, s) : i(s).get()[t.groupBy] === X ? H(S[S.length - 1], s) : (S.push([]), H(S[S.length - 1], s), X = i(s).get()[t.groupBy]), s = i(s).calc(d).utc();
|
|
759
759
|
if (t.groupBy !== e && t.fillNulls)
|
|
760
|
-
for (
|
|
761
|
-
H(
|
|
762
|
-
return
|
|
763
|
-
},
|
|
760
|
+
for (L = i(a).calc(d).utc(); i(L).get()[t.groupBy] === X; )
|
|
761
|
+
H(S[S.length - 1], L, !0), L = i(L).calc(d).utc();
|
|
762
|
+
return S;
|
|
763
|
+
}, i.monthNames = function(t) {
|
|
764
764
|
switch (t) {
|
|
765
765
|
case "long":
|
|
766
766
|
return P;
|
|
767
767
|
default:
|
|
768
768
|
return Mt;
|
|
769
769
|
}
|
|
770
|
-
},
|
|
770
|
+
}, i.dayNames = function(t) {
|
|
771
771
|
switch (t) {
|
|
772
772
|
case "long":
|
|
773
|
-
return ht;
|
|
774
|
-
default:
|
|
775
773
|
return ct;
|
|
774
|
+
default:
|
|
775
|
+
return lt;
|
|
776
776
|
}
|
|
777
|
-
},
|
|
777
|
+
}, i.lang = function(t) {
|
|
778
778
|
if (t !== e)
|
|
779
|
-
m = t,
|
|
779
|
+
m = t, N[m] === e && (m = "en"), P = G(), Mt = ht(), ct = z(), lt = k();
|
|
780
780
|
else
|
|
781
781
|
return m;
|
|
782
782
|
return e;
|
|
783
|
-
},
|
|
784
|
-
return Object.keys(
|
|
785
|
-
},
|
|
786
|
-
|
|
783
|
+
}, i.availableLangs = function() {
|
|
784
|
+
return Object.keys(N);
|
|
785
|
+
}, i.registerFormat = function(t, s, a, c, L, d) {
|
|
786
|
+
U[t] = {
|
|
787
787
|
format: s,
|
|
788
788
|
parse: a,
|
|
789
789
|
minLength: c,
|
|
790
|
-
maxLength:
|
|
790
|
+
maxLength: L,
|
|
791
791
|
type: d
|
|
792
792
|
};
|
|
793
|
-
},
|
|
794
|
-
delete
|
|
795
|
-
},
|
|
793
|
+
}, i.unregisterFormat = function(t) {
|
|
794
|
+
delete U[t];
|
|
795
|
+
}, i.detectFormat = function(t) {
|
|
796
796
|
var s, a, c;
|
|
797
797
|
return s = O(t, 0), s !== "" && (c = 10), a = t.charAt(c), (a === "T" || a === " ") && (s += a, c += 1), s += l(t, c), s;
|
|
798
|
-
},
|
|
799
|
-
TempusDate:
|
|
800
|
-
},
|
|
798
|
+
}, T = {
|
|
799
|
+
TempusDate: R
|
|
800
|
+
}, i.classes = function(t, s) {
|
|
801
801
|
if (s === e)
|
|
802
|
-
return
|
|
803
|
-
|
|
804
|
-
},
|
|
805
|
-
typeof t == "object" ?
|
|
806
|
-
|
|
802
|
+
return T[t];
|
|
803
|
+
T[t] = s;
|
|
804
|
+
}, i.loadTranslations = function(t) {
|
|
805
|
+
typeof t == "object" ? N = t : typeof t == "string" && me(t, function(s) {
|
|
806
|
+
N = s;
|
|
807
807
|
}, function(s) {
|
|
808
808
|
});
|
|
809
|
-
}, m = (
|
|
810
|
-
}).call(
|
|
811
|
-
})(
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
var
|
|
809
|
+
}, m = (g.language || g.systemLanguage || g.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), P = G(), Mt = ht(), ct = z(), lt = k(), y.exports && (A = y.exports = i), A.tempus = i;
|
|
810
|
+
}).call(_e);
|
|
811
|
+
})(jt, jt.exports);
|
|
812
|
+
var ye = jt.exports;
|
|
813
|
+
const Ht = /* @__PURE__ */ Oe(ye);
|
|
814
|
+
var K, mt, q, Y, W, j, v, $, I, Q, It, tt, F, et, At, nt, Dt, ft, Qt, Nt, Zt, _t, Vt, Ot, zt, yt, Kt, Ut, se, Gt, ie, dt, qt, Et, vt, gt, $t, ot, Yt, Tt, te, wt, re, st, ut, at, Bt, Rt, ee;
|
|
815
815
|
class x {
|
|
816
816
|
constructor(A, e = {}) {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
817
|
+
f(this, nt);
|
|
818
|
+
f(this, ft);
|
|
819
|
+
f(this, Nt);
|
|
820
|
+
f(this, _t);
|
|
821
|
+
f(this, Ot);
|
|
822
|
+
f(this, yt);
|
|
823
|
+
f(this, Ut);
|
|
824
|
+
f(this, Gt);
|
|
825
|
+
f(this, dt);
|
|
826
|
+
f(this, Et);
|
|
827
|
+
f(this, gt);
|
|
828
|
+
f(this, ot);
|
|
829
|
+
f(this, Tt);
|
|
830
|
+
f(this, wt);
|
|
831
|
+
f(this, st);
|
|
832
|
+
f(this, at);
|
|
833
|
+
f(this, Rt);
|
|
834
|
+
f(this, K, null);
|
|
835
|
+
f(this, mt, null);
|
|
836
|
+
f(this, q, []);
|
|
837
|
+
f(this, Y, {});
|
|
838
|
+
f(this, W, 50);
|
|
839
|
+
f(this, j, 500);
|
|
840
|
+
f(this, v, !0);
|
|
841
|
+
f(this, $, null);
|
|
842
|
+
f(this, I, null);
|
|
843
|
+
f(this, Q, null);
|
|
844
|
+
f(this, It, 100);
|
|
845
|
+
f(this, tt, "no");
|
|
846
|
+
f(this, F, !1);
|
|
847
|
+
f(this, et, !1);
|
|
848
|
+
f(this, At, !1);
|
|
848
849
|
C(this, "errors", {});
|
|
849
850
|
C(this, "answerData", {});
|
|
850
|
-
E(this,
|
|
851
|
+
E(this, K, A), E(this, mt, e);
|
|
851
852
|
}
|
|
852
853
|
get serial() {
|
|
853
854
|
return o(this, F);
|
|
854
855
|
}
|
|
856
|
+
get limitCommandSerial() {
|
|
857
|
+
return o(this, j);
|
|
858
|
+
}
|
|
859
|
+
set limitCommandSerial(A) {
|
|
860
|
+
if (A < 10)
|
|
861
|
+
throw new Error("limitCommandSerial не может быть меньше 10");
|
|
862
|
+
A >= 10 && A < 50 && (E(this, W, A), E(this, j, A)), E(this, j, A);
|
|
863
|
+
}
|
|
855
864
|
setSerial() {
|
|
856
|
-
E(this, F, !0), E(this,
|
|
865
|
+
E(this, F, !0), E(this, et, !0), E(this, At, !1);
|
|
857
866
|
}
|
|
858
867
|
setParallel() {
|
|
859
|
-
E(this, F, !1), E(this,
|
|
868
|
+
E(this, F, !1), E(this, et, !1), E(this, At, !0);
|
|
860
869
|
}
|
|
861
870
|
stop() {
|
|
862
|
-
E(this,
|
|
871
|
+
E(this, v, !1);
|
|
863
872
|
}
|
|
864
873
|
async batch(A, e) {
|
|
865
|
-
o(this,
|
|
866
|
-
const n = _(this,
|
|
867
|
-
if (Object.keys(A).length <
|
|
868
|
-
const
|
|
869
|
-
return Promise.allSettled(
|
|
874
|
+
o(this, Q) && _(this, ft, Qt).call(this), e && E(this, $, e), o(this, et) === !1 && E(this, F, !1), Object.keys(A).length > o(this, j) && E(this, F, !0), E(this, v, !0), E(this, q, []), E(this, Y, {}), this.errors = {}, this.answerData = {};
|
|
875
|
+
const n = _(this, _t, Vt).call(this, A);
|
|
876
|
+
if (Object.keys(A).length < o(this, j)) {
|
|
877
|
+
const r = n.map((h, l) => _(this, Ot, zt).call(this, h, n[l]));
|
|
878
|
+
return Promise.allSettled(r).then((h) => {
|
|
870
879
|
let l = {};
|
|
871
880
|
for (let O of h)
|
|
872
881
|
O.status === "fulfilled" && (l = { ...l, ...O.value });
|
|
873
882
|
return l;
|
|
874
883
|
});
|
|
875
884
|
} else {
|
|
876
|
-
let
|
|
877
|
-
h += Object.keys(
|
|
885
|
+
let r = {}, h = 0, l = 1, O = Object.keys(A).length || 1, u = (i) => {
|
|
886
|
+
h += Object.keys(i).length, l = Math.round(h / O * 100);
|
|
878
887
|
};
|
|
879
|
-
for (let [
|
|
880
|
-
let
|
|
881
|
-
u(
|
|
888
|
+
for (let [i, T] of Object.entries(n)) {
|
|
889
|
+
let g = await _(this, Ot, zt).call(this, T, n[i], !0);
|
|
890
|
+
u(T), e && e({ percent: l }), r = { ...r, ...g };
|
|
882
891
|
}
|
|
883
|
-
return
|
|
892
|
+
return r;
|
|
884
893
|
}
|
|
885
894
|
}
|
|
886
895
|
async batchTotalCount(A, e) {
|
|
887
896
|
E(this, Y, {}), this.errors = {};
|
|
888
|
-
let n = 1,
|
|
889
|
-
|
|
897
|
+
let n = 1, r = 0, h = Object.keys(A).length || 1, l = (u) => {
|
|
898
|
+
r += Object.keys(u).length, n = Math.round(r / h * 100);
|
|
890
899
|
};
|
|
891
900
|
e && e({ percent: n });
|
|
892
|
-
const O = _(this,
|
|
893
|
-
if (o(this,
|
|
894
|
-
const u = O.map((
|
|
895
|
-
return Promise.allSettled(u).then((
|
|
896
|
-
let
|
|
897
|
-
for (let
|
|
898
|
-
|
|
899
|
-
return
|
|
901
|
+
const O = _(this, _t, Vt).call(this, A);
|
|
902
|
+
if (o(this, At)) {
|
|
903
|
+
const u = O.map((i) => _(this, yt, Kt).call(this, i).then((T) => (l(i), e && e({ percent: n }), T)));
|
|
904
|
+
return Promise.allSettled(u).then((i) => {
|
|
905
|
+
let T = {};
|
|
906
|
+
for (let g of i)
|
|
907
|
+
g.status === "fulfilled" && (T = { ...T, ...g.value });
|
|
908
|
+
return T;
|
|
900
909
|
});
|
|
901
910
|
} else {
|
|
902
911
|
let u = {};
|
|
903
|
-
for (let
|
|
904
|
-
let
|
|
905
|
-
l(
|
|
912
|
+
for (let i of O) {
|
|
913
|
+
let T = await _(this, yt, Kt).call(this, i);
|
|
914
|
+
l(i), e && e({ percent: n }), u = { ...u, ...T };
|
|
906
915
|
}
|
|
907
916
|
return u;
|
|
908
917
|
}
|
|
909
918
|
}
|
|
910
919
|
}
|
|
911
|
-
|
|
920
|
+
K = new WeakMap(), mt = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), W = new WeakMap(), j = new WeakMap(), v = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), Q = new WeakMap(), It = new WeakMap(), tt = new WeakMap(), F = new WeakMap(), et = new WeakMap(), At = new WeakMap(), nt = new WeakSet(), Dt = function() {
|
|
912
921
|
let A = 0;
|
|
913
|
-
if (!o(this,
|
|
922
|
+
if (!o(this, I))
|
|
914
923
|
return Math.round(A);
|
|
915
924
|
let e = 0, n = 0;
|
|
916
|
-
return Object.values(o(this,
|
|
917
|
-
const { total: h, count: l } =
|
|
925
|
+
return Object.values(o(this, I)).forEach((r) => {
|
|
926
|
+
const { total: h, count: l } = r;
|
|
918
927
|
e += h ?? 0, n += l ?? 0;
|
|
919
928
|
}), e ? A = n / e * 100 : A = 100, { percent: Math.round(A), allCount: n, allTotal: e };
|
|
920
|
-
},
|
|
921
|
-
clearInterval(o(this,
|
|
922
|
-
},
|
|
923
|
-
const n = _(this,
|
|
929
|
+
}, ft = new WeakSet(), Qt = function() {
|
|
930
|
+
clearInterval(o(this, Q)), E(this, Q, ""), E(this, I, ""), E(this, $, ""), E(this, tt, "no");
|
|
931
|
+
}, Nt = new WeakSet(), Zt = function({ key: A, value: e }) {
|
|
932
|
+
const n = _(this, st, ut).call(this, e.data()), r = Array.isArray(n) ? n.length : 0, h = _(this, at, Bt).call(this, e.total(), r);
|
|
924
933
|
let l = 1;
|
|
925
|
-
n && (l =
|
|
926
|
-
const { percent: O, allCount: u, allTotal:
|
|
927
|
-
(o(this,
|
|
928
|
-
data: o(this,
|
|
934
|
+
n && (l = r), o(this, $) && (o(this, I) || E(this, I, {}), o(this, I)[A] && o(this, I)[A].count && (l += o(this, I)[A].count), o(this, I)[A] = { total: h, count: l }, o(this, Q) || E(this, Q, setInterval(() => {
|
|
935
|
+
const { percent: O, allCount: u, allTotal: i } = o(this, nt, Dt);
|
|
936
|
+
(o(this, tt) === "no" || o(this, tt) < o(this, nt, Dt).percent) && (o(this, $).call(this, {
|
|
937
|
+
data: o(this, I),
|
|
929
938
|
percent: O,
|
|
930
939
|
allCount: u,
|
|
931
|
-
allTotal:
|
|
932
|
-
}), E(this,
|
|
933
|
-
}, o(this,
|
|
934
|
-
},
|
|
940
|
+
allTotal: i
|
|
941
|
+
}), E(this, tt, o(this, nt, Dt).percent)), O === 100 && _(this, ft, Qt).call(this);
|
|
942
|
+
}, o(this, It))));
|
|
943
|
+
}, _t = new WeakSet(), Vt = function(A) {
|
|
935
944
|
const e = [], n = Object.entries(A);
|
|
936
|
-
for (let
|
|
937
|
-
const h = n.slice(
|
|
945
|
+
for (let r = 0; r < n.length; r += o(this, W)) {
|
|
946
|
+
const h = n.slice(r, r + o(this, W));
|
|
938
947
|
e.push(Object.fromEntries(h));
|
|
939
948
|
}
|
|
940
949
|
return e;
|
|
941
|
-
},
|
|
942
|
-
return new Promise((
|
|
943
|
-
const h = _(this,
|
|
950
|
+
}, Ot = new WeakSet(), zt = function(A, e, n) {
|
|
951
|
+
return new Promise((r) => {
|
|
952
|
+
const h = _(this, Tt, te).call(this, e), l = [];
|
|
944
953
|
let O = 0, u = 0;
|
|
945
|
-
o(this,
|
|
946
|
-
Object.entries(
|
|
954
|
+
o(this, K).call(this, A, (i) => {
|
|
955
|
+
Object.entries(i).forEach(([T, g]) => {
|
|
947
956
|
let m = {};
|
|
948
|
-
const
|
|
949
|
-
if (
|
|
950
|
-
let { query: { method:
|
|
951
|
-
this.errors[
|
|
957
|
+
const N = g.error();
|
|
958
|
+
if (N) {
|
|
959
|
+
let { query: { method: k }, answer: P } = g;
|
|
960
|
+
this.errors[T] = { error: N, method: k }, O += 1;
|
|
952
961
|
}
|
|
953
|
-
if (
|
|
954
|
-
for (let [
|
|
955
|
-
|
|
956
|
-
Object.keys(m).length && (this.answerData[
|
|
962
|
+
if (g != null && g.answer && Object.keys(g.answer).length) {
|
|
963
|
+
for (let [k, P] of Object.entries(g.answer))
|
|
964
|
+
k != "result" && P && (m[k] = P);
|
|
965
|
+
Object.keys(m).length && (this.answerData[T] = m);
|
|
957
966
|
}
|
|
958
|
-
const G = _(this,
|
|
959
|
-
if (Array.isArray(G) ? o(this, Y)[
|
|
960
|
-
const
|
|
961
|
-
l.push([
|
|
967
|
+
const G = _(this, st, ut).call(this, g.data()), ht = Array.isArray(G) ? G.length : 0, z = _(this, at, Bt).call(this, g.total(), ht);
|
|
968
|
+
if (Array.isArray(G) ? o(this, Y)[T] = G : typeof G == "object" && G !== null && Object.keys(G).length === 0 ? o(this, Y)[T] = [] : o(this, Y)[T] = G, u += z, n || _(this, Nt, Zt).call(this, { key: T, value: g }), z > o(this, W) && z > ht) {
|
|
969
|
+
const k = Math.ceil(z / o(this, W)) - 1, P = Array.from({ length: k });
|
|
970
|
+
l.push([T, h[T], P]);
|
|
962
971
|
}
|
|
963
|
-
}), u > 5e3 && o(this,
|
|
972
|
+
}), u > 5e3 && o(this, et) === !1 && o(this, At) === !1 && E(this, F, !0), O > 0 && _(this, Rt, ee).call(this), l.length ? (_(this, Ut, se).call(this, l), _(this, Gt, ie).call(this).then(() => r(_(this, ot, Yt).call(this)))) : r(_(this, ot, Yt).call(this));
|
|
964
973
|
});
|
|
965
974
|
});
|
|
966
|
-
},
|
|
975
|
+
}, yt = new WeakSet(), Kt = function(A) {
|
|
967
976
|
return new Promise((e) => {
|
|
968
|
-
const n = _(this,
|
|
969
|
-
let
|
|
970
|
-
o(this,
|
|
977
|
+
const n = _(this, Tt, te).call(this, A);
|
|
978
|
+
let r = 0;
|
|
979
|
+
o(this, K).call(this, n, (h) => {
|
|
971
980
|
Object.entries(h).forEach(([l, O]) => {
|
|
972
981
|
const u = O.error();
|
|
973
|
-
u && (this.errors[l] = u,
|
|
974
|
-
const
|
|
975
|
-
o(this, Y)[l] =
|
|
976
|
-
}),
|
|
982
|
+
u && (this.errors[l] = u, r += 1);
|
|
983
|
+
const i = _(this, st, ut).call(this, O.data()), T = Array.isArray(i) ? i.length : 0, g = _(this, at, Bt).call(this, O.total(), T);
|
|
984
|
+
o(this, Y)[l] = g;
|
|
985
|
+
}), r > 0 && _(this, Rt, ee).call(this), e(_(this, ot, Yt).call(this));
|
|
977
986
|
});
|
|
978
987
|
});
|
|
979
|
-
},
|
|
988
|
+
}, Ut = new WeakSet(), se = function(A) {
|
|
980
989
|
let e = [];
|
|
981
|
-
A.forEach(([n,
|
|
990
|
+
A.forEach(([n, r, h]) => {
|
|
982
991
|
h.forEach((l, O) => {
|
|
983
|
-
const u = O + 1,
|
|
984
|
-
e.length === o(this,
|
|
992
|
+
const u = O + 1, i = o(this, W) * u, g = [[n, u].join("_"), _(this, wt, re).call(this, r, i)];
|
|
993
|
+
e.length === o(this, W) ? (o(this, q).push(e), e = [g]) : e.push(g);
|
|
985
994
|
});
|
|
986
|
-
}), e.length && o(this,
|
|
987
|
-
},
|
|
988
|
-
const A = [], e = [], n = (
|
|
989
|
-
Object.entries(
|
|
990
|
-
const [O] = h.split("_"), u = _(this,
|
|
991
|
-
Array.isArray(u) && o(this, Y)[O].push(...u), _(this,
|
|
995
|
+
}), e.length && o(this, q).push(e);
|
|
996
|
+
}, Gt = new WeakSet(), ie = function() {
|
|
997
|
+
const A = [], e = [], n = (r) => {
|
|
998
|
+
Object.entries(r).forEach(([h, l]) => {
|
|
999
|
+
const [O] = h.split("_"), u = _(this, st, ut).call(this, l.data());
|
|
1000
|
+
Array.isArray(u) && o(this, Y)[O].push(...u), _(this, Nt, Zt).call(this, { key: O, value: l });
|
|
992
1001
|
});
|
|
993
1002
|
};
|
|
994
|
-
return o(this,
|
|
995
|
-
const l = Object.fromEntries(
|
|
996
|
-
o(this, F) ? n(
|
|
1003
|
+
return o(this, q).forEach((r, h) => {
|
|
1004
|
+
const l = Object.fromEntries(r), O = () => new Promise((u) => o(this, K).call(this, l, (i) => {
|
|
1005
|
+
o(this, F) ? n(i) : e[h] = i, u();
|
|
997
1006
|
}));
|
|
998
1007
|
A.push(O);
|
|
999
|
-
}), o(this, F) ? _(this,
|
|
1008
|
+
}), o(this, F) ? _(this, Et, vt).call(this, A) : _(this, gt, $t).call(this, A).then(() => {
|
|
1000
1009
|
e.forEach(n);
|
|
1001
1010
|
});
|
|
1002
|
-
},
|
|
1011
|
+
}, dt = new WeakSet(), qt = function() {
|
|
1003
1012
|
return new Promise((A) => setTimeout(A, 500));
|
|
1004
|
-
},
|
|
1013
|
+
}, Et = new WeakSet(), vt = function(A) {
|
|
1005
1014
|
if (!A.length)
|
|
1006
1015
|
return Promise.resolve();
|
|
1007
1016
|
const e = A.shift();
|
|
1008
1017
|
return Promise.allSettled([
|
|
1009
1018
|
e(),
|
|
1010
|
-
_(this,
|
|
1011
|
-
]).then(() => o(this,
|
|
1012
|
-
},
|
|
1019
|
+
_(this, dt, qt).call(this)
|
|
1020
|
+
]).then(() => o(this, v) ? _(this, Et, vt).call(this, A) : Promise.resolve());
|
|
1021
|
+
}, gt = new WeakSet(), $t = function(A) {
|
|
1013
1022
|
if (!A.length)
|
|
1014
1023
|
return Promise.resolve();
|
|
1015
1024
|
const e = A.shift();
|
|
1016
|
-
return _(this,
|
|
1017
|
-
},
|
|
1018
|
-
return Object.entries(o(this,
|
|
1025
|
+
return _(this, dt, qt).call(this).then(() => e()).then(() => o(this, v) ? _(this, gt, $t).call(this, A) : Promise.resolve());
|
|
1026
|
+
}, ot = new WeakSet(), Yt = function() {
|
|
1027
|
+
return Object.entries(o(this, mt)).forEach(([A, e]) => {
|
|
1019
1028
|
o(this, Y)[A] && (o(this, Y)[A] = e(o(this, Y)[A]));
|
|
1020
1029
|
}), o(this, Y);
|
|
1021
|
-
},
|
|
1022
|
-
return Object.entries(A).reduce((e, [n,
|
|
1023
|
-
if (Array.isArray(
|
|
1024
|
-
const [h, l = {}] =
|
|
1030
|
+
}, Tt = new WeakSet(), te = function(A) {
|
|
1031
|
+
return Object.entries(A).reduce((e, [n, r]) => {
|
|
1032
|
+
if (Array.isArray(r)) {
|
|
1033
|
+
const [h, l = {}] = r;
|
|
1025
1034
|
e[n] = [h, l];
|
|
1026
1035
|
} else {
|
|
1027
|
-
const { method: h, params: l = {} } =
|
|
1036
|
+
const { method: h, params: l = {} } = r;
|
|
1028
1037
|
e[n] = [h, l];
|
|
1029
1038
|
}
|
|
1030
1039
|
return e;
|
|
1031
1040
|
}, {});
|
|
1032
|
-
},
|
|
1033
|
-
const [n,
|
|
1034
|
-
return [n, { start: e, ...
|
|
1035
|
-
},
|
|
1041
|
+
}, wt = new WeakSet(), re = function(A, e) {
|
|
1042
|
+
const [n, r] = A;
|
|
1043
|
+
return [n, { start: e, ...r }];
|
|
1044
|
+
}, st = new WeakSet(), ut = function(A) {
|
|
1036
1045
|
return ((A == null ? void 0 : A.items) || (A == null ? void 0 : A.documents)) ?? A;
|
|
1037
|
-
},
|
|
1046
|
+
}, at = new WeakSet(), Bt = function(A, e) {
|
|
1038
1047
|
return A !== A && (A = 0), A === 0 && e === 0 ? 0 : A || e;
|
|
1039
|
-
},
|
|
1048
|
+
}, Rt = new WeakSet(), ee = function() {
|
|
1040
1049
|
console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(this.errors).forEach(([A, e]) => {
|
|
1041
|
-
console.info(`[${A}]`, e
|
|
1050
|
+
console.info(`[${A}]`, e);
|
|
1042
1051
|
}), console.groupEnd();
|
|
1043
1052
|
};
|
|
1044
|
-
var
|
|
1045
|
-
class
|
|
1053
|
+
var it;
|
|
1054
|
+
class ne {
|
|
1046
1055
|
constructor() {
|
|
1047
|
-
|
|
1056
|
+
f(this, it, {});
|
|
1048
1057
|
}
|
|
1049
1058
|
get hash() {
|
|
1050
1059
|
return this.createHash(8);
|
|
@@ -1053,13 +1062,13 @@ class ie {
|
|
|
1053
1062
|
createHash(A) {
|
|
1054
1063
|
let e = "abcdefghijklmnopqrstuvwxyz0123456789", n = "";
|
|
1055
1064
|
A = A || 6;
|
|
1056
|
-
for (let
|
|
1065
|
+
for (let r = 0; r < A; r++)
|
|
1057
1066
|
n += e.charAt(Math.floor(Math.random() * e.length));
|
|
1058
1067
|
return n;
|
|
1059
1068
|
}
|
|
1060
1069
|
/** Фильтр часто запускаемых действий */
|
|
1061
1070
|
actionFilter({ keyTimer: A, duration: e = 10, action: n }) {
|
|
1062
|
-
o(this,
|
|
1071
|
+
o(this, it)[A] && (clearTimeout(o(this, it)[A]), o(this, it)[A] = null), n && (o(this, it)[A] = setTimeout(() => {
|
|
1063
1072
|
n();
|
|
1064
1073
|
}, e));
|
|
1065
1074
|
}
|
|
@@ -1078,34 +1087,34 @@ class ie {
|
|
|
1078
1087
|
}
|
|
1079
1088
|
/** Скачать данные в JSON-файл */
|
|
1080
1089
|
downloadFileJson(A, e) {
|
|
1081
|
-
let n = new Blob([JSON.stringify(A)], { type: "application/json" }),
|
|
1082
|
-
h.style.display = "none", h.href =
|
|
1083
|
-
document.body.removeChild(h), URL.revokeObjectURL(
|
|
1090
|
+
let n = new Blob([JSON.stringify(A)], { type: "application/json" }), r = URL.createObjectURL(n), h = document.createElement("a");
|
|
1091
|
+
h.style.display = "none", h.href = r, h.download = `${e}.json`, document.body.appendChild(h), h.click(), setTimeout(() => {
|
|
1092
|
+
document.body.removeChild(h), URL.revokeObjectURL(r);
|
|
1084
1093
|
}, 200);
|
|
1085
1094
|
}
|
|
1086
1095
|
}
|
|
1087
|
-
|
|
1088
|
-
const
|
|
1089
|
-
var
|
|
1090
|
-
class
|
|
1096
|
+
it = new WeakMap();
|
|
1097
|
+
const bt = new ne();
|
|
1098
|
+
var J, Z, Ct, rt, St, V, Ft, oe, Lt, Ae, Pt, ae, Wt, he, Jt, ce;
|
|
1099
|
+
class de {
|
|
1091
1100
|
constructor() {
|
|
1092
|
-
|
|
1101
|
+
f(this, Ft);
|
|
1093
1102
|
/** Вывод ошибок логера
|
|
1094
1103
|
* @param {'entity'} type - тип ошибки
|
|
1095
1104
|
*/
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1105
|
+
f(this, Lt);
|
|
1106
|
+
f(this, Pt);
|
|
1107
|
+
f(this, Wt);
|
|
1108
|
+
f(this, Jt);
|
|
1109
|
+
f(this, J, "logger");
|
|
1110
|
+
f(this, Z, !1);
|
|
1111
|
+
f(this, Ct, 2e3);
|
|
1112
|
+
f(this, rt, /* @__PURE__ */ new Map());
|
|
1113
|
+
f(this, St, {});
|
|
1114
|
+
f(this, V, null);
|
|
1106
1115
|
/** Очистка хранилища элементов старше 'N' месяцев */
|
|
1107
1116
|
C(this, "periodClear", 3);
|
|
1108
|
-
_(this,
|
|
1117
|
+
_(this, Ft, oe).call(this);
|
|
1109
1118
|
}
|
|
1110
1119
|
/** Инициализация логера */
|
|
1111
1120
|
async init() {
|
|
@@ -1113,22 +1122,22 @@ class ye {
|
|
|
1113
1122
|
entityList: { method: "entity.get" }
|
|
1114
1123
|
});
|
|
1115
1124
|
if (e != null && e.length)
|
|
1116
|
-
if (e.find((
|
|
1117
|
-
E(this,
|
|
1125
|
+
if (e.find((r) => r.ENTITY == o(this, J)))
|
|
1126
|
+
E(this, Z, !0);
|
|
1118
1127
|
else {
|
|
1119
|
-
let { entityAdd:
|
|
1128
|
+
let { entityAdd: r } = await A.batch({
|
|
1120
1129
|
entityAdd: {
|
|
1121
1130
|
method: "entity.add",
|
|
1122
1131
|
params: {
|
|
1123
|
-
ENTITY: o(this,
|
|
1124
|
-
NAME: o(this,
|
|
1132
|
+
ENTITY: o(this, J),
|
|
1133
|
+
NAME: o(this, J),
|
|
1125
1134
|
ACCESS: { AU: "X" }
|
|
1126
1135
|
}
|
|
1127
1136
|
}
|
|
1128
1137
|
});
|
|
1129
|
-
|
|
1138
|
+
r && E(this, Z, !0);
|
|
1130
1139
|
}
|
|
1131
|
-
return _(this,
|
|
1140
|
+
return _(this, Wt, he).call(this), o(this, Z);
|
|
1132
1141
|
}
|
|
1133
1142
|
/**
|
|
1134
1143
|
* @param {{ type: 'call'|'batch'|'batch-total-count';
|
|
@@ -1140,15 +1149,15 @@ class ye {
|
|
|
1140
1149
|
* @returns {string}
|
|
1141
1150
|
*/
|
|
1142
1151
|
start({ type: A, data: e }) {
|
|
1143
|
-
if (!o(this,
|
|
1144
|
-
_(this,
|
|
1152
|
+
if (!o(this, Z)) {
|
|
1153
|
+
_(this, Lt, Ae).call(this, "entity");
|
|
1145
1154
|
return;
|
|
1146
1155
|
}
|
|
1147
|
-
const n =
|
|
1156
|
+
const n = bt.hash;
|
|
1148
1157
|
return o(this, rt).set(n, {
|
|
1149
1158
|
type: A,
|
|
1150
1159
|
data: e,
|
|
1151
|
-
userInfo: o(this,
|
|
1160
|
+
userInfo: o(this, St),
|
|
1152
1161
|
errorList: [],
|
|
1153
1162
|
status: "",
|
|
1154
1163
|
answer: null,
|
|
@@ -1162,17 +1171,17 @@ class ye {
|
|
|
1162
1171
|
* status: 'success'|'fail'|'fail-runtime',
|
|
1163
1172
|
* answer: { [key]: unknown } }}
|
|
1164
1173
|
*/
|
|
1165
|
-
stop({ key: A, errorList: e, status: n, answer:
|
|
1166
|
-
if (!o(this,
|
|
1167
|
-
_(this,
|
|
1174
|
+
stop({ key: A, errorList: e, status: n, answer: r }) {
|
|
1175
|
+
if (!o(this, Z)) {
|
|
1176
|
+
_(this, Lt, Ae).call(this, "entity");
|
|
1168
1177
|
return;
|
|
1169
1178
|
}
|
|
1170
1179
|
let h = o(this, rt).get(A);
|
|
1171
|
-
e && (h.errorList = e), n && (h.status = n),
|
|
1180
|
+
e && (h.errorList = e), n && (h.status = n), r && (h.answer = r), bt.actionFilter({
|
|
1172
1181
|
keyTimer: "add.entity.items",
|
|
1173
|
-
duration: o(this,
|
|
1182
|
+
duration: o(this, Ct),
|
|
1174
1183
|
action: () => {
|
|
1175
|
-
_(this,
|
|
1184
|
+
_(this, Pt, ae).call(this);
|
|
1176
1185
|
}
|
|
1177
1186
|
});
|
|
1178
1187
|
}
|
|
@@ -1180,14 +1189,14 @@ class ye {
|
|
|
1180
1189
|
* @param { ({percent}:{percent:number})=>{} } progressCall - коллбэк
|
|
1181
1190
|
*/
|
|
1182
1191
|
async getEntityList(A) {
|
|
1183
|
-
var
|
|
1184
|
-
if ((
|
|
1185
|
-
return o(this,
|
|
1192
|
+
var r;
|
|
1193
|
+
if ((r = o(this, V)) != null && r.length)
|
|
1194
|
+
return o(this, V);
|
|
1186
1195
|
let e = new x(BX24.callBatch), { entityList: n } = await e.batch({
|
|
1187
1196
|
entityList: {
|
|
1188
1197
|
method: "entity.item.get",
|
|
1189
1198
|
params: {
|
|
1190
|
-
ENTITY: o(this,
|
|
1199
|
+
ENTITY: o(this, J),
|
|
1191
1200
|
SORT: { ID: "DESC" }
|
|
1192
1201
|
}
|
|
1193
1202
|
}
|
|
@@ -1203,70 +1212,70 @@ class ye {
|
|
|
1203
1212
|
}
|
|
1204
1213
|
/** Выгрузка всех данных из хранилища в JSON-файл */
|
|
1205
1214
|
async downAllEntityJson() {
|
|
1206
|
-
let A = await this.getEntityList(), e =
|
|
1207
|
-
|
|
1215
|
+
let A = await this.getEntityList(), e = Ht().format("%Y-%m-%d");
|
|
1216
|
+
bt.downloadFileJson(A, `sdklogger-entity-data__${e}`);
|
|
1208
1217
|
}
|
|
1209
1218
|
}
|
|
1210
|
-
|
|
1219
|
+
J = new WeakMap(), Z = new WeakMap(), Ct = new WeakMap(), rt = new WeakMap(), St = new WeakMap(), V = new WeakMap(), Ft = new WeakSet(), oe = async function() {
|
|
1211
1220
|
const A = new x(BX24.callBatch), e = BX24.isAdmin(), { curUser: n } = await A.batch({
|
|
1212
1221
|
curUser: { method: "user.current" }
|
|
1213
1222
|
});
|
|
1214
|
-
E(this,
|
|
1215
|
-
},
|
|
1216
|
-
A == "entity" &&
|
|
1223
|
+
E(this, St, { isAdmin: e, curUser: n });
|
|
1224
|
+
}, Lt = new WeakSet(), Ae = function(A) {
|
|
1225
|
+
A == "entity" && bt.actionFilter({
|
|
1217
1226
|
keyTimer: "error.logger.entity",
|
|
1218
1227
|
duration: 500,
|
|
1219
1228
|
action: () => {
|
|
1220
1229
|
console.error("Хранилище для логгера не инициализировано");
|
|
1221
1230
|
}
|
|
1222
1231
|
});
|
|
1223
|
-
},
|
|
1232
|
+
}, Pt = new WeakSet(), ae = async function() {
|
|
1224
1233
|
let A = {}, e = new x(BX24.callBatch);
|
|
1225
|
-
for (let [n,
|
|
1226
|
-
|
|
1234
|
+
for (let [n, r] of o(this, rt).entries())
|
|
1235
|
+
r.status && (A[n] = {
|
|
1227
1236
|
method: "entity.item.add",
|
|
1228
1237
|
params: {
|
|
1229
|
-
ENTITY: o(this,
|
|
1230
|
-
NAME: o(this,
|
|
1231
|
-
DETAIL_TEXT: JSON.stringify(
|
|
1238
|
+
ENTITY: o(this, J),
|
|
1239
|
+
NAME: o(this, J),
|
|
1240
|
+
DETAIL_TEXT: JSON.stringify(r)
|
|
1232
1241
|
}
|
|
1233
1242
|
});
|
|
1234
1243
|
if (Object.keys(A).length) {
|
|
1235
|
-
let n = await e.batch(A), { errors:
|
|
1236
|
-
for (let [h, l] of Object.entries({ ...n, ...
|
|
1244
|
+
let n = await e.batch(A), { errors: r } = e;
|
|
1245
|
+
for (let [h, l] of Object.entries({ ...n, ...r }))
|
|
1237
1246
|
o(this, rt).delete(h);
|
|
1238
1247
|
}
|
|
1239
|
-
},
|
|
1248
|
+
}, Wt = new WeakSet(), he = async function() {
|
|
1240
1249
|
let A = new x(BX24.callBatch), { serverTime: e } = await A.batch({
|
|
1241
1250
|
serverTime: { method: "server.time" }
|
|
1242
1251
|
});
|
|
1243
|
-
o(this,
|
|
1244
|
-
let n = o(this,
|
|
1245
|
-
let { dateCreate: h } =
|
|
1246
|
-
return
|
|
1252
|
+
o(this, V) || E(this, V, await this.getEntityList());
|
|
1253
|
+
let n = o(this, V).filter((r) => {
|
|
1254
|
+
let { dateCreate: h } = r;
|
|
1255
|
+
return Ht(new Date(h)).between(Ht(new Date(e)), "month") >= this.periodClear;
|
|
1247
1256
|
});
|
|
1248
|
-
_(this,
|
|
1249
|
-
},
|
|
1250
|
-
let e = new x(BX24.callBatch), n = A.map((
|
|
1251
|
-
let { id: h } =
|
|
1257
|
+
_(this, Jt, ce).call(this, n);
|
|
1258
|
+
}, Jt = new WeakSet(), ce = async function(A) {
|
|
1259
|
+
let e = new x(BX24.callBatch), n = A.map((r) => {
|
|
1260
|
+
let { id: h } = r;
|
|
1252
1261
|
return {
|
|
1253
1262
|
method: "entity.item.delete",
|
|
1254
1263
|
params: {
|
|
1255
|
-
ENTITY: o(this,
|
|
1264
|
+
ENTITY: o(this, J),
|
|
1256
1265
|
ID: h
|
|
1257
1266
|
}
|
|
1258
1267
|
};
|
|
1259
1268
|
});
|
|
1260
1269
|
return await e.batch(n);
|
|
1261
1270
|
};
|
|
1262
|
-
const
|
|
1263
|
-
var
|
|
1264
|
-
class
|
|
1271
|
+
const B = new de();
|
|
1272
|
+
var kt, le, Xt, ue;
|
|
1273
|
+
class ge {
|
|
1265
1274
|
constructor(A) {
|
|
1266
1275
|
/** Запрос данных о приложении */
|
|
1267
|
-
|
|
1276
|
+
f(this, kt);
|
|
1268
1277
|
/** Запрос данных о текущем пользователе */
|
|
1269
|
-
|
|
1278
|
+
f(this, Xt);
|
|
1270
1279
|
C(this, "domain", "");
|
|
1271
1280
|
C(this, "isAdmin", !1);
|
|
1272
1281
|
C(this, "appInfo", null);
|
|
@@ -1280,12 +1289,12 @@ class Ee {
|
|
|
1280
1289
|
return new Promise((A) => {
|
|
1281
1290
|
let e = setInterval(() => {
|
|
1282
1291
|
window.BX24 && BX24.init(async () => {
|
|
1283
|
-
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await
|
|
1284
|
-
const [n,
|
|
1285
|
-
_(this,
|
|
1286
|
-
_(this,
|
|
1292
|
+
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await B.init();
|
|
1293
|
+
const [n, r] = await Promise.all([
|
|
1294
|
+
_(this, kt, le).call(this),
|
|
1295
|
+
_(this, Xt, ue).call(this)
|
|
1287
1296
|
]);
|
|
1288
|
-
this.appInfo = n, this.userInfo =
|
|
1297
|
+
this.appInfo = n, this.userInfo = r, new ne().noSleep(), A(!0);
|
|
1289
1298
|
});
|
|
1290
1299
|
}, 100);
|
|
1291
1300
|
});
|
|
@@ -1312,7 +1321,7 @@ class Ee {
|
|
|
1312
1321
|
* }[]
|
|
1313
1322
|
*/
|
|
1314
1323
|
call({ method: A, params: e, updateList: n }) {
|
|
1315
|
-
let
|
|
1324
|
+
let r = B.start({
|
|
1316
1325
|
type: "call",
|
|
1317
1326
|
data: { method: A, params: e, updateList: n }
|
|
1318
1327
|
});
|
|
@@ -1320,21 +1329,21 @@ class Ee {
|
|
|
1320
1329
|
e || (e = {}), BX24.callMethod(A, e, function(l) {
|
|
1321
1330
|
let O = {};
|
|
1322
1331
|
if (l != null && l.answer)
|
|
1323
|
-
for (let [u,
|
|
1324
|
-
u != "result" &&
|
|
1332
|
+
for (let [u, i] of Object.entries(l.answer))
|
|
1333
|
+
u != "result" && i && (O[u] = i);
|
|
1325
1334
|
if (l.error()) {
|
|
1326
1335
|
let u = l.error();
|
|
1327
|
-
console.error(u),
|
|
1336
|
+
console.error(u), B.stop({
|
|
1328
1337
|
answer: O,
|
|
1329
|
-
key:
|
|
1338
|
+
key: r,
|
|
1330
1339
|
status: "fail",
|
|
1331
1340
|
errorList: [u.toSting()]
|
|
1332
1341
|
}), h(!1);
|
|
1333
1342
|
} else {
|
|
1334
1343
|
let u = l.data();
|
|
1335
|
-
u != null && u.items && (u = u.items),
|
|
1344
|
+
u != null && u.items && (u = u.items), B.stop({
|
|
1336
1345
|
answer: O,
|
|
1337
|
-
key:
|
|
1346
|
+
key: r,
|
|
1338
1347
|
status: "success"
|
|
1339
1348
|
}), h(u);
|
|
1340
1349
|
}
|
|
@@ -1360,38 +1369,43 @@ class Ee {
|
|
|
1360
1369
|
* }[]
|
|
1361
1370
|
* }}
|
|
1362
1371
|
*/
|
|
1363
|
-
async batch(A, e, { updateList: n, errorCall:
|
|
1364
|
-
let
|
|
1372
|
+
async batch(A, e, { updateList: n, errorCall: r, limitCommandSerial: h } = {}) {
|
|
1373
|
+
let l = new x(BX24.callBatch), O = B.start({
|
|
1365
1374
|
type: "batch",
|
|
1366
1375
|
data: { commandList: A, updateList: n }
|
|
1367
1376
|
});
|
|
1377
|
+
h && (l.limitCommandSerial = h);
|
|
1368
1378
|
try {
|
|
1369
|
-
let
|
|
1370
|
-
if (Object.keys(
|
|
1371
|
-
let
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1379
|
+
let u = await l.batch(A, e);
|
|
1380
|
+
if (Object.keys(l.errors).length) {
|
|
1381
|
+
let i = Object.entries(l.errors).map(([T, g]) => {
|
|
1382
|
+
var m;
|
|
1383
|
+
return {
|
|
1384
|
+
key: T,
|
|
1385
|
+
error: `${g == null ? void 0 : g.method} ${(m = g == null ? void 0 : g.error) == null ? void 0 : m.toString()}`.trim()
|
|
1386
|
+
};
|
|
1387
|
+
});
|
|
1388
|
+
r && r(l.errors), B.stop({
|
|
1389
|
+
key: O,
|
|
1377
1390
|
status: "fail",
|
|
1378
|
-
errorList:
|
|
1379
|
-
answer:
|
|
1391
|
+
errorList: i,
|
|
1392
|
+
answer: l.answerData
|
|
1380
1393
|
});
|
|
1381
1394
|
} else
|
|
1382
|
-
|
|
1383
|
-
key:
|
|
1395
|
+
B.stop({
|
|
1396
|
+
key: O,
|
|
1384
1397
|
status: "success",
|
|
1385
|
-
answer:
|
|
1398
|
+
answer: l.answerData
|
|
1386
1399
|
});
|
|
1387
|
-
return
|
|
1388
|
-
} catch (
|
|
1389
|
-
|
|
1390
|
-
|
|
1400
|
+
return u;
|
|
1401
|
+
} catch (u) {
|
|
1402
|
+
let i = u == null ? void 0 : u.toString();
|
|
1403
|
+
return B.stop({
|
|
1404
|
+
key: O,
|
|
1391
1405
|
status: "fail-runtime",
|
|
1392
|
-
errorList: [
|
|
1393
|
-
answer:
|
|
1394
|
-
}), console.error(
|
|
1406
|
+
errorList: [i],
|
|
1407
|
+
answer: l.answerData
|
|
1408
|
+
}), console.error(u), !1;
|
|
1395
1409
|
}
|
|
1396
1410
|
}
|
|
1397
1411
|
/**
|
|
@@ -1399,7 +1413,7 @@ class Ee {
|
|
|
1399
1413
|
* @param progressCall - callback(data), в data приходят данные о загрузке данных
|
|
1400
1414
|
*/
|
|
1401
1415
|
async batchTotalCount(A, e) {
|
|
1402
|
-
let n = new x(BX24.callBatch),
|
|
1416
|
+
let n = new x(BX24.callBatch), r = B.start({
|
|
1403
1417
|
type: "batch",
|
|
1404
1418
|
data: { commandList: A }
|
|
1405
1419
|
});
|
|
@@ -1410,20 +1424,20 @@ class Ee {
|
|
|
1410
1424
|
key: O,
|
|
1411
1425
|
error: u.toSting()
|
|
1412
1426
|
}));
|
|
1413
|
-
|
|
1414
|
-
key:
|
|
1427
|
+
B.stop({
|
|
1428
|
+
key: r,
|
|
1415
1429
|
status: "fail",
|
|
1416
1430
|
errorList: l
|
|
1417
1431
|
});
|
|
1418
1432
|
} else
|
|
1419
|
-
|
|
1420
|
-
key:
|
|
1433
|
+
B.stop({
|
|
1434
|
+
key: r,
|
|
1421
1435
|
status: "success"
|
|
1422
1436
|
});
|
|
1423
1437
|
return h;
|
|
1424
1438
|
} catch (h) {
|
|
1425
|
-
return
|
|
1426
|
-
key:
|
|
1439
|
+
return B.stop({
|
|
1440
|
+
key: r,
|
|
1427
1441
|
status: "fail",
|
|
1428
1442
|
errorList: [h.toSting()]
|
|
1429
1443
|
}), console.error(h), !1;
|
|
@@ -1436,9 +1450,9 @@ class Ee {
|
|
|
1436
1450
|
/** Встройка приложения в place */
|
|
1437
1451
|
async placementBind(A) {
|
|
1438
1452
|
this.placeData || (this.placeData = await this.getPlacement());
|
|
1439
|
-
const { appName: e, pathApp: n } = this.appConst,
|
|
1453
|
+
const { appName: e, pathApp: n } = this.appConst, r = this.placeData.map((l) => l.placement);
|
|
1440
1454
|
let h = this.placeData.find((l) => l.placement == A);
|
|
1441
|
-
|
|
1455
|
+
r.includes(A) ? h.handler != n && (window.placementUnBind || (window.placementUnBind = {}), window.placementUnBind[A] || this.placementUnBind(h).then(() => {
|
|
1442
1456
|
window.placementUnBind[A] || (window.placementUnBind[A] = !0, this.placementBind(A));
|
|
1443
1457
|
})) : this.call({
|
|
1444
1458
|
method: "placement.bind",
|
|
@@ -1469,7 +1483,7 @@ class Ee {
|
|
|
1469
1483
|
}
|
|
1470
1484
|
}
|
|
1471
1485
|
}
|
|
1472
|
-
}).then((
|
|
1486
|
+
}).then((r) => (console.log("Встройка отвязана", A), r));
|
|
1473
1487
|
}
|
|
1474
1488
|
/** Чат-бот */
|
|
1475
1489
|
/* получение списка ботов */
|
|
@@ -1484,7 +1498,7 @@ class Ee {
|
|
|
1484
1498
|
}
|
|
1485
1499
|
/* регистрация бота */
|
|
1486
1500
|
regBot({ code: A, type: e, name: n }) {
|
|
1487
|
-
const { appName:
|
|
1501
|
+
const { appName: r, pathApp: h, chatBotLogo: l } = this.appConst, O = this.appInfo.ID;
|
|
1488
1502
|
return this.call({
|
|
1489
1503
|
method: "imbot.register",
|
|
1490
1504
|
params: {
|
|
@@ -1500,7 +1514,7 @@ class Ee {
|
|
|
1500
1514
|
// строковый идентификатор чат-бота, используется только в режиме Вебхуков
|
|
1501
1515
|
PROPERTIES: {
|
|
1502
1516
|
// Личные данные чат-бота (обяз.)
|
|
1503
|
-
NAME: `${n ??
|
|
1517
|
+
NAME: `${n ?? r} - бот #${O}`,
|
|
1504
1518
|
// Имя чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
1505
1519
|
LAST_NAME: "",
|
|
1506
1520
|
// Фамилия чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
@@ -1508,7 +1522,7 @@ class Ee {
|
|
|
1508
1522
|
// Цвет чат-бота для мобильного приложения RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE
|
|
1509
1523
|
EMAIL: "",
|
|
1510
1524
|
// E-mail для связи. НЕЛЬЗЯ использовать e-mail, дублирующий e-mail реальных пользователей
|
|
1511
|
-
PERSONAL_BIRTHDAY:
|
|
1525
|
+
PERSONAL_BIRTHDAY: Ht().format("%Y-%m-%d"),
|
|
1512
1526
|
// День рождения в формате YYYY-mm-dd
|
|
1513
1527
|
WORK_POSITION: "Почтальон",
|
|
1514
1528
|
// Занимаемая должность, используется как описание чат-бота
|
|
@@ -1531,16 +1545,20 @@ class Ee {
|
|
|
1531
1545
|
}
|
|
1532
1546
|
}).then((e) => (console.log("чат-бот удален", e), e));
|
|
1533
1547
|
}
|
|
1548
|
+
/* Получение данных логера */
|
|
1549
|
+
getLoggerList(A) {
|
|
1550
|
+
return B.getEntityList(A);
|
|
1551
|
+
}
|
|
1534
1552
|
}
|
|
1535
|
-
|
|
1553
|
+
kt = new WeakSet(), le = function() {
|
|
1536
1554
|
return this.call({ method: "app.info" });
|
|
1537
|
-
},
|
|
1555
|
+
}, Xt = new WeakSet(), ue = function() {
|
|
1538
1556
|
return this.call({ method: "user.current" });
|
|
1539
1557
|
};
|
|
1540
1558
|
export {
|
|
1541
1559
|
x as Batch,
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1560
|
+
ge as BxBoot,
|
|
1561
|
+
ne as BxHelper,
|
|
1562
|
+
de as BxLogger,
|
|
1563
|
+
Ht as tempus
|
|
1546
1564
|
};
|