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