szdl-utils-kit 0.1.4 → 0.2.2
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 +788 -501
- package/dist/index.umd.cjs +2 -2
- package/dist/types/batch.d.ts +7 -1
- package/dist/types/bx-boot.d.ts +27 -10
- package/dist/types/bx-helper.d.ts +22 -0
- package/dist/types/bx-logger.d.ts +38 -0
- package/dist/types/index.d.ts +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
if (!
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var me = (A, s, e) => s in A ? ue(A, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : A[s] = e;
|
|
3
|
+
var w = (A, s, e) => (me(A, typeof s != "symbol" ? s + "" : s, e), e), Jt = (A, s, e) => {
|
|
4
|
+
if (!s.has(A))
|
|
5
5
|
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
8
|
-
if (
|
|
7
|
+
var a = (A, s, e) => (Jt(A, s, "read from private field"), e ? e.call(A) : s.get(A)), _ = (A, s, e) => {
|
|
8
|
+
if (s.has(A))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
function
|
|
10
|
+
s instanceof WeakSet ? s.add(A) : s.set(A, e);
|
|
11
|
+
}, g = (A, s, e, o) => (Jt(A, s, "write to private field"), o ? o.call(A, e) : s.set(A, e), e);
|
|
12
|
+
var O = (A, s, e) => (Jt(A, s, "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(A) {
|
|
15
15
|
return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
18
|
-
(function(A,
|
|
17
|
+
var Xt = { exports: {} };
|
|
18
|
+
(function(A, s) {
|
|
19
19
|
(function(e) {
|
|
20
|
-
Array.prototype.indexOf || (Array.prototype.indexOf = function(t,
|
|
21
|
-
var
|
|
22
|
-
for (
|
|
23
|
-
if (this[
|
|
24
|
-
return
|
|
20
|
+
Array.prototype.indexOf || (Array.prototype.indexOf = function(t, r) {
|
|
21
|
+
var h, c;
|
|
22
|
+
for (h = r || 0, c = this.length; h < c; h += 1)
|
|
23
|
+
if (this[h] === t)
|
|
24
|
+
return h;
|
|
25
25
|
return -1;
|
|
26
26
|
});
|
|
27
|
-
var
|
|
28
|
-
for (var
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
var
|
|
35
|
-
return
|
|
36
|
-
},
|
|
37
|
-
var
|
|
38
|
-
t.slice(
|
|
39
|
-
t.charAt(
|
|
40
|
-
t.slice(
|
|
41
|
-
t.charAt(
|
|
42
|
-
t.slice(
|
|
43
|
-
],
|
|
44
|
-
return !isNaN(Number(
|
|
45
|
-
t.slice(
|
|
46
|
-
t.charAt(
|
|
47
|
-
t.slice(
|
|
48
|
-
t.charAt(
|
|
49
|
-
t.slice(
|
|
50
|
-
], !isNaN(Number(
|
|
51
|
-
},
|
|
27
|
+
var o = this, n = function(t, r) {
|
|
28
|
+
for (var h = t.toString(); h.length < r; )
|
|
29
|
+
h = "0" + h;
|
|
30
|
+
return h;
|
|
31
|
+
}, u = function(t, r) {
|
|
32
|
+
return r !== e ? (t.year(r.year() || r.year), t.month(r.month() || r.month), t.day(r.day() || r.day), t.hours(r.hours() || r.hours), t.minutes(r.minutes() || r.minutes), t.seconds(r.seconds() || r.seconds), t.milliseconds(r.milliseconds() || r.milliseconds), t) : e;
|
|
33
|
+
}, l = function(t, r) {
|
|
34
|
+
var h, c = "";
|
|
35
|
+
return h = t.slice(r, r + 1), h !== "" && !isNaN(Number(h)) && (c += "%H"), h = t.charAt(r + 2), h !== "" && h === ":" && (c += h), h = t.slice(r + 3, r + 4), h !== "" && !isNaN(Number(h)) && (c += "%M"), h = t.charAt(r + 5), h !== "" && h === ":" && (c += h), h = t.slice(r + 6, r + 7), h !== "" && !isNaN(Number(h)) && (c += "%S"), c;
|
|
36
|
+
}, y = function(t, r) {
|
|
37
|
+
var h, c = [
|
|
38
|
+
t.slice(r, r + 1),
|
|
39
|
+
t.charAt(r + 2),
|
|
40
|
+
t.slice(r + 3, r + 4),
|
|
41
|
+
t.charAt(r + 5),
|
|
42
|
+
t.slice(r + 6, r + 9)
|
|
43
|
+
], M;
|
|
44
|
+
return !isNaN(Number(c[0])) && !isNaN(Number(c[2])) && !isNaN(Number(c[4])) ? (c[1] === "." && c[3] === "." ? h = "%d.%m.%Y" : c[1] === "-" && c[3] === "-" ? h = "%m-%d-%Y" : c[1] === "/" && c[3] === "/" && (h = "%m/%d/%Y"), h) : (M = [
|
|
45
|
+
t.slice(r, r + 3),
|
|
46
|
+
t.charAt(r + 4),
|
|
47
|
+
t.slice(r + 5, r + 6),
|
|
48
|
+
t.charAt(r + 7),
|
|
49
|
+
t.slice(r + 8, r + 9)
|
|
50
|
+
], !isNaN(Number(M[0])) && !isNaN(Number(M[2])) && !isNaN(Number(M[4])) ? (M[1] === "-" && M[3] === "-" && (h = "%Y-%m-%d"), h) : "");
|
|
51
|
+
}, f = o.tempus, i, R, d = o.navigator || {}, m = "en", N = {
|
|
52
52
|
en: {
|
|
53
53
|
JANUARY_SHORT: "Jan",
|
|
54
54
|
FEBRUARY_SHORT: "Feb",
|
|
@@ -209,70 +209,70 @@ var bt = { exports: {} };
|
|
|
209
209
|
FRIDAY_LONG: "Freitag",
|
|
210
210
|
SATURDAY_LONG: "Samstag"
|
|
211
211
|
}
|
|
212
|
-
},
|
|
212
|
+
}, W = function() {
|
|
213
213
|
return [
|
|
214
|
-
m
|
|
215
|
-
m
|
|
216
|
-
m
|
|
217
|
-
m
|
|
218
|
-
m
|
|
219
|
-
m
|
|
220
|
-
m
|
|
221
|
-
m
|
|
222
|
-
m
|
|
223
|
-
m
|
|
224
|
-
m
|
|
225
|
-
m
|
|
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
|
-
m
|
|
230
|
-
m
|
|
231
|
-
m
|
|
232
|
-
m
|
|
233
|
-
m
|
|
234
|
-
m
|
|
235
|
-
m
|
|
236
|
-
m
|
|
237
|
-
m
|
|
238
|
-
m
|
|
239
|
-
m
|
|
240
|
-
m
|
|
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
|
+
}, V = function() {
|
|
243
243
|
return [
|
|
244
|
-
m
|
|
245
|
-
m
|
|
246
|
-
m
|
|
247
|
-
m
|
|
248
|
-
m
|
|
249
|
-
m
|
|
250
|
-
m
|
|
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
|
+
}, Z = function() {
|
|
253
253
|
return [
|
|
254
|
-
m
|
|
255
|
-
m
|
|
256
|
-
m
|
|
257
|
-
m
|
|
258
|
-
m
|
|
259
|
-
m
|
|
260
|
-
m
|
|
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
|
-
},
|
|
263
|
-
var
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) :
|
|
267
|
-
},
|
|
268
|
-
},
|
|
262
|
+
}, F, dt, at, ct, le = function(t, r, h) {
|
|
263
|
+
var c;
|
|
264
|
+
o.XMLHttpRequest ? c = new XMLHttpRequest() : c = new ActiveXObject("Microsoft.XMLHTTP"), c.onreadystatechange = function() {
|
|
265
|
+
c.readyState === 4 && (c.status === 200 ? r && (o.JSON === e ? alert(`Please, include json2 into your project if you want use old browsers!
|
|
266
|
+
https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.parse(c.responseText))) : h && h(c));
|
|
267
|
+
}, c.open("GET", t, !1), c.send();
|
|
268
|
+
}, I = {
|
|
269
269
|
"%d": {
|
|
270
270
|
format: function(t) {
|
|
271
|
-
return
|
|
271
|
+
return n(t.day() || i.MIN_DAY, 2);
|
|
272
272
|
},
|
|
273
273
|
parse: function(t) {
|
|
274
|
-
var
|
|
275
|
-
return { day: isNaN(
|
|
274
|
+
var r = Number(t);
|
|
275
|
+
return { day: isNaN(r) ? e : r };
|
|
276
276
|
},
|
|
277
277
|
minLength: 2,
|
|
278
278
|
maxLength: 2,
|
|
@@ -280,11 +280,11 @@ 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 n(t.month() || i.MIN_MONTH, 2);
|
|
284
284
|
},
|
|
285
285
|
parse: function(t) {
|
|
286
|
-
var
|
|
287
|
-
return { month: isNaN(
|
|
286
|
+
var r = Number(t);
|
|
287
|
+
return { month: isNaN(r) ? e : r };
|
|
288
288
|
},
|
|
289
289
|
minLength: 2,
|
|
290
290
|
maxLength: 2,
|
|
@@ -292,11 +292,11 @@ 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 n(t.year() || i.MIN_YEAR, 4);
|
|
296
296
|
},
|
|
297
297
|
parse: function(t) {
|
|
298
|
-
var
|
|
299
|
-
return { year: isNaN(
|
|
298
|
+
var r = Number(t);
|
|
299
|
+
return { year: isNaN(r) ? e : r };
|
|
300
300
|
},
|
|
301
301
|
minLength: 4,
|
|
302
302
|
maxLength: 4,
|
|
@@ -315,8 +315,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
315
315
|
},
|
|
316
316
|
"%a": {
|
|
317
317
|
format: function(t) {
|
|
318
|
-
var
|
|
319
|
-
return
|
|
318
|
+
var r = t.dayOfWeek();
|
|
319
|
+
return ct[r !== e ? r : i.MIN_DAY_OF_WEEK];
|
|
320
320
|
},
|
|
321
321
|
parse: function() {
|
|
322
322
|
return {};
|
|
@@ -327,8 +327,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
327
327
|
},
|
|
328
328
|
"%A": {
|
|
329
329
|
format: function(t) {
|
|
330
|
-
var
|
|
331
|
-
return
|
|
330
|
+
var r = t.dayOfWeek();
|
|
331
|
+
return at[r !== e ? r : i.MIN_DAY_OF_WEEK];
|
|
332
332
|
},
|
|
333
333
|
parse: function() {
|
|
334
334
|
return {};
|
|
@@ -339,12 +339,12 @@ 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
|
|
343
|
-
return
|
|
342
|
+
var r = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
343
|
+
return dt[r !== e ? r : i.MIN_MONTH];
|
|
344
344
|
},
|
|
345
345
|
parse: function(t) {
|
|
346
|
-
var
|
|
347
|
-
return { month:
|
|
346
|
+
var r = i.monthNames().indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
347
|
+
return { month: r !== -1 ? r : e };
|
|
348
348
|
},
|
|
349
349
|
minLength: 1,
|
|
350
350
|
maxLength: 999,
|
|
@@ -352,12 +352,12 @@ 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
|
|
356
|
-
return
|
|
355
|
+
var r = i.options("monthFromZero") ? t.month() : t.month() - 1;
|
|
356
|
+
return F[r !== e ? r : i.MIN_MONTH];
|
|
357
357
|
},
|
|
358
358
|
parse: function(t) {
|
|
359
|
-
var
|
|
360
|
-
return { month:
|
|
359
|
+
var r = i.monthNames(!0).indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
|
|
360
|
+
return { month: r !== -1 ? r : e };
|
|
361
361
|
},
|
|
362
362
|
minLength: 1,
|
|
363
363
|
maxLength: 999,
|
|
@@ -365,11 +365,11 @@ 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 n(t.hours() || i.MIN_HOURS, 2);
|
|
369
369
|
},
|
|
370
370
|
parse: function(t) {
|
|
371
|
-
var
|
|
372
|
-
return { hours: isNaN(
|
|
371
|
+
var r = Number(t);
|
|
372
|
+
return { hours: isNaN(r) ? e : r };
|
|
373
373
|
},
|
|
374
374
|
minLength: 2,
|
|
375
375
|
maxLength: 2,
|
|
@@ -377,11 +377,11 @@ 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 n(t.minutes() || i.MIN_MINUTES, 2);
|
|
381
381
|
},
|
|
382
382
|
parse: function(t) {
|
|
383
|
-
var
|
|
384
|
-
return { minutes: isNaN(
|
|
383
|
+
var r = Number(t);
|
|
384
|
+
return { minutes: isNaN(r) ? e : r };
|
|
385
385
|
},
|
|
386
386
|
minLength: 2,
|
|
387
387
|
maxLength: 2,
|
|
@@ -389,11 +389,11 @@ 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 n(t.seconds() || i.MIN_SECONDS, 2);
|
|
393
393
|
},
|
|
394
394
|
parse: function(t) {
|
|
395
|
-
var
|
|
396
|
-
return { seconds: isNaN(
|
|
395
|
+
var r = Number(t);
|
|
396
|
+
return { seconds: isNaN(r) ? e : r };
|
|
397
397
|
},
|
|
398
398
|
minLength: 2,
|
|
399
399
|
maxLength: 2,
|
|
@@ -412,14 +412,14 @@ 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 n(t.year() || i.MIN_YEAR, 4) + "-" + n(t.month() || i.MIN_MONTH, 2) + "-" + n(t.day() || i.MIN_DAY, 2);
|
|
416
416
|
},
|
|
417
417
|
parse: function(t) {
|
|
418
|
-
var
|
|
418
|
+
var r = Number(t.slice(0, 4)), h = Number(t.slice(5, 7)), c = Number(t.slice(8, 10));
|
|
419
419
|
return {
|
|
420
|
-
year:
|
|
421
|
-
month:
|
|
422
|
-
day:
|
|
420
|
+
year: r,
|
|
421
|
+
month: h,
|
|
422
|
+
day: c
|
|
423
423
|
};
|
|
424
424
|
},
|
|
425
425
|
minLength: 10,
|
|
@@ -428,25 +428,25 @@ 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 n(t.month() || i.MIN_MONTH, 2) + "/" + n(t.day() || i.MIN_DAY, 2) + "/" + n(t.year() || i.MIN_YEAR, 4);
|
|
432
432
|
},
|
|
433
433
|
parse: function(t) {
|
|
434
|
-
var
|
|
434
|
+
var r = Number(t.slice(0, 2)), h = Number(t.slice(3, 5)), c = Number(t.slice(6, 10));
|
|
435
435
|
return {
|
|
436
|
-
year:
|
|
437
|
-
month:
|
|
438
|
-
day:
|
|
436
|
+
year: c,
|
|
437
|
+
month: r,
|
|
438
|
+
day: h
|
|
439
439
|
};
|
|
440
440
|
},
|
|
441
441
|
minLength: 10,
|
|
442
442
|
maxLength: 10,
|
|
443
443
|
type: "string"
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, Mt = {
|
|
446
446
|
useMilliseconds: !1,
|
|
447
447
|
monthFromZero: !1
|
|
448
|
-
},
|
|
449
|
-
|
|
448
|
+
}, S;
|
|
449
|
+
S = function(t, r, h) {
|
|
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
|
-
}, t !== e && this.set(t,
|
|
459
|
-
},
|
|
460
|
-
var t = this.month(),
|
|
461
|
-
return this.leapYear() && t === (i.options("monthFromZero") ? 1 : 2) && (
|
|
462
|
-
},
|
|
458
|
+
}, t !== e && this.set(t, r, h), this;
|
|
459
|
+
}, S.fn = S.prototype, S.fn.dayCount = function() {
|
|
460
|
+
var t = this.month(), r = i.MAX_DAY_IN_MONTHS[t - (i.options("monthFromZero") ? 0 : 1)];
|
|
461
|
+
return this.leapYear() && t === (i.options("monthFromZero") ? 1 : 2) && (r += 1), r;
|
|
462
|
+
}, S.fn.year = function(t) {
|
|
463
463
|
if (arguments.length !== 0)
|
|
464
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
|
+
}, S.fn.month = function(t) {
|
|
469
469
|
if (arguments.length !== 0)
|
|
470
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
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
|
+
}, S.fn.day = function(t) {
|
|
475
475
|
if (arguments.length !== 0)
|
|
476
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
|
+
}, S.fn.hours = function(t) {
|
|
481
481
|
if (arguments.length !== 0)
|
|
482
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
|
+
}, S.fn.minutes = function(t) {
|
|
487
487
|
if (arguments.length !== 0)
|
|
488
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
|
+
}, S.fn.seconds = function(t) {
|
|
493
493
|
if (arguments.length !== 0)
|
|
494
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
|
+
}, S.fn.milliseconds = function(t) {
|
|
499
499
|
if (arguments.length !== 0)
|
|
500
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),
|
|
506
|
-
return Math.ceil(((
|
|
507
|
-
},
|
|
504
|
+
}, S.fn.week = function() {
|
|
505
|
+
var t = new Date(this.year(), 0, 1), r = i(this.utc()).hours(0).minutes(0).seconds(0).milliseconds(0).utc() * 1e3;
|
|
506
|
+
return Math.ceil(((r - t.getTime()) / 864e5 + t.getDay() + 1) / 7);
|
|
507
|
+
}, S.fn.set = function(t, r, h) {
|
|
508
508
|
if (this._i = {
|
|
509
509
|
year: !1,
|
|
510
510
|
month: !1,
|
|
@@ -520,9 +520,9 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.pars
|
|
|
520
520
|
if (typeof t == "number")
|
|
521
521
|
return this._d = new Date(t * (i.options("useMilliseconds") ? 1 : 1e3)), this;
|
|
522
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
|
|
523
|
+
var c, M = [], T, E, X = [], D = 0, H = 0, L, B, p = {}, b;
|
|
524
524
|
if (t === e)
|
|
525
|
-
return
|
|
525
|
+
return T = u(this, h), T === 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 (
|
|
535
|
-
if (
|
|
536
|
-
if (E =
|
|
537
|
-
switch (L = 0,
|
|
533
|
+
}), T;
|
|
534
|
+
for (r === e && (r = i.detectFormat(t)); D < r.length; ) {
|
|
535
|
+
if (r.charAt(D) === "%") {
|
|
536
|
+
if (E = r.charAt(D) + r.charAt(D + 1), I[E] !== e) {
|
|
537
|
+
switch (L = 0, B = "", I[E].type) {
|
|
538
538
|
case "number":
|
|
539
|
-
for (; L <
|
|
540
|
-
|
|
539
|
+
for (; L < I[E].maxLength && H + L < t.length && !isNaN(Number(t.charAt(H + L))); )
|
|
540
|
+
B += t.charAt(H + L), L += 1;
|
|
541
541
|
break;
|
|
542
542
|
case "word":
|
|
543
|
-
for (; L <
|
|
544
|
-
|
|
543
|
+
for (; L < I[E].maxLength && H + L < t.length && /^[\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(t.charAt(H + L)); )
|
|
544
|
+
B += t.charAt(H + L), L += 1;
|
|
545
545
|
break;
|
|
546
546
|
case "string":
|
|
547
|
-
for (; L <
|
|
548
|
-
|
|
547
|
+
for (; L < I[E].maxLength && H + L < t.length; )
|
|
548
|
+
B += t.charAt(H + L), L += 1;
|
|
549
549
|
break;
|
|
550
550
|
}
|
|
551
|
-
if (L <
|
|
552
|
-
return
|
|
551
|
+
if (L < I[E].minLength)
|
|
552
|
+
return T = u(this, h), T === 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
|
+
}), T;
|
|
561
|
+
M.push(E), X.push(B), L -= 1, H += L, D += 1;
|
|
562
562
|
}
|
|
563
|
-
} else if (t.charAt(
|
|
564
|
-
return
|
|
563
|
+
} else if (t.charAt(H) !== r.charAt(D))
|
|
564
|
+
return T = u(this, h), T === e && (this._i = {
|
|
565
565
|
year: -1,
|
|
566
566
|
month: -1,
|
|
567
567
|
day: -1,
|
|
@@ -569,33 +569,33 @@ 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
|
+
}), T;
|
|
573
|
+
D += 1, H += 1;
|
|
574
574
|
}
|
|
575
|
-
for (
|
|
576
|
-
|
|
577
|
-
year:
|
|
578
|
-
month:
|
|
579
|
-
day:
|
|
580
|
-
hours:
|
|
581
|
-
minutes:
|
|
582
|
-
seconds:
|
|
575
|
+
for (c in M)
|
|
576
|
+
M.hasOwnProperty(c) && I.hasOwnProperty(M[c]) && (b = I[M[c]].parse(X[c]), 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(i.MIN_DAY), this.year(
|
|
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
|
+
}, S.fn.leapYear = function() {
|
|
588
588
|
var t = this.year();
|
|
589
589
|
return t % 4 === 0 ? t % 100 === 0 ? t % 400 === 0 : !0 : !1;
|
|
590
|
-
},
|
|
590
|
+
}, S.fn.timestamp = function(t) {
|
|
591
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
|
-
},
|
|
592
|
+
}, S.fn.utc = function(t) {
|
|
593
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
|
-
},
|
|
594
|
+
}, S.fn.dayOfWeek = function(t) {
|
|
595
595
|
if (t === "long")
|
|
596
|
-
return
|
|
596
|
+
return at[this._d.getDay()];
|
|
597
597
|
if (t === "short")
|
|
598
|
-
return
|
|
598
|
+
return ct[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
|
+
}, S.fn.timezone = function(t) {
|
|
616
616
|
switch (t) {
|
|
617
617
|
case "hours":
|
|
618
618
|
return Math.floor(this._d.getTimezoneOffset() / 60);
|
|
@@ -621,7 +621,7 @@ 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
|
+
}, S.fn.get = function(t) {
|
|
625
625
|
switch (t) {
|
|
626
626
|
case "Date":
|
|
627
627
|
return new Date(
|
|
@@ -670,409 +670,628 @@ 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
|
|
675
|
-
t.charAt(
|
|
676
|
-
return
|
|
677
|
-
},
|
|
673
|
+
}, S.fn.format = function(t) {
|
|
674
|
+
for (var r = 0, h = "", c; r < t.length; )
|
|
675
|
+
t.charAt(r) === "%" ? (c = t.charAt(r) + t.charAt(r + 1), I[c] !== e ? (h += I[c].format(this), r += 1) : h += "%") : h += t.charAt(r), r += 1;
|
|
676
|
+
return h;
|
|
677
|
+
}, S.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
|
+
}, S.fn.errors = function() {
|
|
680
680
|
return this._i;
|
|
681
|
-
},
|
|
682
|
-
var
|
|
683
|
-
switch (
|
|
681
|
+
}, S.fn.between = function(t, r) {
|
|
682
|
+
var h = this.timestamp(), c = t.timestamp();
|
|
683
|
+
switch (r) {
|
|
684
684
|
case "year":
|
|
685
|
-
return Math.floor((
|
|
685
|
+
return Math.floor((c - h) / 31556952);
|
|
686
686
|
case "month":
|
|
687
|
-
return Math.floor((
|
|
687
|
+
return Math.floor((c - h) / 2629746);
|
|
688
688
|
case "day":
|
|
689
|
-
return Math.floor((
|
|
689
|
+
return Math.floor((c - h) / 86400);
|
|
690
690
|
case "hours":
|
|
691
|
-
return Math.floor((
|
|
691
|
+
return Math.floor((c - h) / 3600);
|
|
692
692
|
case "minutes":
|
|
693
|
-
return Math.floor((
|
|
693
|
+
return Math.floor((c - h) / 60);
|
|
694
694
|
case "seconds":
|
|
695
|
-
return
|
|
695
|
+
return c - h;
|
|
696
696
|
default:
|
|
697
697
|
return e;
|
|
698
698
|
}
|
|
699
|
-
},
|
|
699
|
+
}, S.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
|
-
}, i = function(t,
|
|
702
|
-
return new
|
|
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,
|
|
701
|
+
}, i = function(t, r, h) {
|
|
702
|
+
return new S(t, r, h);
|
|
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, r) {
|
|
704
704
|
if (t === e)
|
|
705
|
-
return
|
|
706
|
-
if (
|
|
707
|
-
if (
|
|
708
|
-
return
|
|
709
|
-
|
|
705
|
+
return Mt;
|
|
706
|
+
if (Mt.hasOwnProperty(t)) {
|
|
707
|
+
if (r === e)
|
|
708
|
+
return Mt[t];
|
|
709
|
+
Mt[t] = r, t === "monthFromZero" && (i.MIN_MONTH = r ? 0 : 1, i.MAX_MONTH = r ? 11 : 12);
|
|
710
710
|
}
|
|
711
711
|
return e;
|
|
712
712
|
}, i.noConflict = function() {
|
|
713
|
-
return
|
|
713
|
+
return o.tempus = f, i;
|
|
714
714
|
}, i.generate = function(t) {
|
|
715
|
-
var
|
|
716
|
-
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof
|
|
715
|
+
var r, h, c, M, T, E, X, D;
|
|
716
|
+
if (typeof t.dateFrom != "number" && (t.dateFrom instanceof S ? r = t.dateFrom.utc() : r = i(t.dateFrom, t.formatFrom).utc()), typeof t.dateTo != "number" && (t.dateTo instanceof S ? h = t.dateTo.utc() : h = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ? T = {
|
|
717
717
|
year: 0,
|
|
718
718
|
month: 0,
|
|
719
719
|
day: 0,
|
|
720
720
|
hours: 0,
|
|
721
721
|
minutes: 0,
|
|
722
722
|
seconds: t.period
|
|
723
|
-
} : typeof t.period == "string" ?
|
|
723
|
+
} : typeof t.period == "string" ? T = {
|
|
724
724
|
year: t.period === "year" ? 1 : 0,
|
|
725
725
|
month: t.period === "month" ? 1 : 0,
|
|
726
726
|
day: t.period === "day" ? 1 : 0,
|
|
727
727
|
hours: t.period === "hours" ? 1 : 0,
|
|
728
728
|
minutes: t.period === "minutes" ? 1 : 0,
|
|
729
729
|
seconds: t.period === "seconds" ? 1 : 0
|
|
730
|
-
} : typeof t.period == "object" && (
|
|
730
|
+
} : typeof t.period == "object" && (T = {
|
|
731
731
|
year: t.period.year !== e ? t.period.year : 0,
|
|
732
732
|
month: t.period.month !== e ? t.period.month : 0,
|
|
733
733
|
day: t.period.day !== e ? t.period.day : 0,
|
|
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 ? E = t.asObject === !0 ? {} : [] : (E = [], E.push([]),
|
|
738
|
-
return t.asObject === !0 ? t.format !== e ?
|
|
737
|
+
}), t.groupBy === e ? E = t.asObject === !0 ? {} : [] : (E = [], E.push([]), X = i(r).get()[t.groupBy]), D = function(B, p, b) {
|
|
738
|
+
return t.asObject === !0 ? t.format !== e ? B[i(p).format(t.format)] = {} : B[i(p).format("%F %H:%M:%S")] = {} : t.format !== e ? B.push(b ? null : i(p).format(t.format)) : B.push(b ? null : i(p)), B;
|
|
739
739
|
}, t.groupBy !== e && t.fillNulls) {
|
|
740
|
-
var
|
|
741
|
-
year:
|
|
742
|
-
month:
|
|
743
|
-
day:
|
|
744
|
-
hours:
|
|
745
|
-
minutes:
|
|
746
|
-
seconds:
|
|
747
|
-
milliseconds:
|
|
740
|
+
var H = {
|
|
741
|
+
year: T.year ? -T.year : e,
|
|
742
|
+
month: T.month ? -T.month : e,
|
|
743
|
+
day: T.day ? -T.day : e,
|
|
744
|
+
hours: T.hours ? -T.hours : e,
|
|
745
|
+
minutes: T.minutes ? -T.minutes : e,
|
|
746
|
+
seconds: T.seconds ? -T.seconds : e,
|
|
747
|
+
milliseconds: T.milliseconds ? -T.milliseconds : e
|
|
748
748
|
};
|
|
749
|
-
for (
|
|
750
|
-
|
|
749
|
+
for (c = i(r).calc(H).utc(); i(c).get()[t.groupBy] === X; )
|
|
750
|
+
D(E[E.length - 1], c, !0), c = i(c).calc(H).utc();
|
|
751
751
|
if (t.groupBy === "week") {
|
|
752
|
-
var L = i(
|
|
753
|
-
for (
|
|
754
|
-
|
|
752
|
+
var L = i(r).dayOfWeek();
|
|
753
|
+
for (c = i(r).dayOfWeek(0).utc(); E[0].length < L && c < r; )
|
|
754
|
+
D(E[E.length - 1], c, !0), c = i(c).calc(T).utc();
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
for (;
|
|
758
|
-
t.groupBy === e ?
|
|
757
|
+
for (; r <= h; )
|
|
758
|
+
t.groupBy === e ? D(E, r) : i(r).get()[t.groupBy] === X ? D(E[E.length - 1], r) : (E.push([]), D(E[E.length - 1], r), X = i(r).get()[t.groupBy]), r = i(r).calc(T).utc();
|
|
759
759
|
if (t.groupBy !== e && t.fillNulls)
|
|
760
|
-
for (
|
|
761
|
-
|
|
760
|
+
for (M = i(h).calc(T).utc(); i(M).get()[t.groupBy] === X; )
|
|
761
|
+
D(E[E.length - 1], M, !0), M = i(M).calc(T).utc();
|
|
762
762
|
return E;
|
|
763
763
|
}, i.monthNames = function(t) {
|
|
764
764
|
switch (t) {
|
|
765
765
|
case "long":
|
|
766
|
-
return
|
|
766
|
+
return F;
|
|
767
767
|
default:
|
|
768
|
-
return
|
|
768
|
+
return dt;
|
|
769
769
|
}
|
|
770
770
|
}, i.dayNames = function(t) {
|
|
771
771
|
switch (t) {
|
|
772
772
|
case "long":
|
|
773
|
-
return
|
|
773
|
+
return at;
|
|
774
774
|
default:
|
|
775
|
-
return
|
|
775
|
+
return ct;
|
|
776
776
|
}
|
|
777
777
|
}, i.lang = function(t) {
|
|
778
778
|
if (t !== e)
|
|
779
|
-
|
|
779
|
+
m = t, N[m] === e && (m = "en"), F = W(), dt = ht(), at = V(), ct = Z();
|
|
780
780
|
else
|
|
781
|
-
return
|
|
781
|
+
return m;
|
|
782
782
|
return e;
|
|
783
783
|
}, i.availableLangs = function() {
|
|
784
|
-
return Object.keys(
|
|
785
|
-
}, i.registerFormat = function(t,
|
|
786
|
-
|
|
787
|
-
format:
|
|
788
|
-
parse:
|
|
789
|
-
minLength:
|
|
790
|
-
maxLength:
|
|
791
|
-
type:
|
|
784
|
+
return Object.keys(N);
|
|
785
|
+
}, i.registerFormat = function(t, r, h, c, M, T) {
|
|
786
|
+
I[t] = {
|
|
787
|
+
format: r,
|
|
788
|
+
parse: h,
|
|
789
|
+
minLength: c,
|
|
790
|
+
maxLength: M,
|
|
791
|
+
type: T
|
|
792
792
|
};
|
|
793
793
|
}, i.unregisterFormat = function(t) {
|
|
794
|
-
delete
|
|
794
|
+
delete I[t];
|
|
795
795
|
}, i.detectFormat = function(t) {
|
|
796
|
-
var
|
|
797
|
-
return
|
|
798
|
-
},
|
|
799
|
-
TempusDate:
|
|
800
|
-
}, i.classes = function(t,
|
|
801
|
-
if (
|
|
802
|
-
return
|
|
803
|
-
|
|
796
|
+
var r, h, c;
|
|
797
|
+
return r = y(t, 0), r !== "" && (c = 10), h = t.charAt(c), (h === "T" || h === " ") && (r += h, c += 1), r += l(t, c), r;
|
|
798
|
+
}, R = {
|
|
799
|
+
TempusDate: S
|
|
800
|
+
}, i.classes = function(t, r) {
|
|
801
|
+
if (r === e)
|
|
802
|
+
return R[t];
|
|
803
|
+
R[t] = r;
|
|
804
804
|
}, i.loadTranslations = function(t) {
|
|
805
|
-
typeof t == "object" ?
|
|
806
|
-
|
|
807
|
-
}, function(
|
|
805
|
+
typeof t == "object" ? N = t : typeof t == "string" && le(t, function(r) {
|
|
806
|
+
N = r;
|
|
807
|
+
}, function(r) {
|
|
808
808
|
});
|
|
809
|
-
},
|
|
810
|
-
}).call(
|
|
811
|
-
})(
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
var
|
|
815
|
-
class
|
|
816
|
-
constructor(
|
|
817
|
-
_(this,
|
|
818
|
-
_(this,
|
|
809
|
+
}, m = (d.language || d.systemLanguage || d.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), F = W(), dt = ht(), at = V(), ct = Z(), A.exports && (s = A.exports = i), s.tempus = i;
|
|
810
|
+
}).call(fe);
|
|
811
|
+
})(Xt, Xt.exports);
|
|
812
|
+
var _e = Xt.exports;
|
|
813
|
+
const jt = /* @__PURE__ */ Ne(_e);
|
|
814
|
+
var z, ut, K, Y, J, q, Q, U, k, Dt, v, C, $, tt, it, Lt, mt, kt, ft, xt, Nt, Vt, _t, Zt, Ot, zt, Ht, ee, Yt, se, yt, Kt, At, qt, Tt, Qt, nt, pt, St, vt, Ut, re, et, lt, ot, bt, gt, $t;
|
|
815
|
+
class j {
|
|
816
|
+
constructor(s, e = {}) {
|
|
817
|
+
_(this, it);
|
|
818
|
+
_(this, mt);
|
|
819
|
+
_(this, ft);
|
|
820
|
+
_(this, Nt);
|
|
821
|
+
_(this, _t);
|
|
822
|
+
_(this, Ot);
|
|
823
|
+
_(this, Ht);
|
|
824
|
+
_(this, Yt);
|
|
825
|
+
_(this, yt);
|
|
826
|
+
_(this, At);
|
|
827
|
+
_(this, Tt);
|
|
819
828
|
_(this, nt);
|
|
829
|
+
_(this, St);
|
|
830
|
+
_(this, Ut);
|
|
831
|
+
_(this, et);
|
|
820
832
|
_(this, ot);
|
|
821
|
-
_(this, ht);
|
|
822
|
-
_(this, at);
|
|
823
|
-
_(this, Mt);
|
|
824
833
|
_(this, gt);
|
|
825
|
-
_(this,
|
|
826
|
-
_(this,
|
|
827
|
-
_(this,
|
|
828
|
-
_(this,
|
|
829
|
-
_(this,
|
|
830
|
-
_(this,
|
|
831
|
-
_(this,
|
|
832
|
-
_(this,
|
|
833
|
-
_(this, ft);
|
|
834
|
-
_(this, x, null);
|
|
835
|
-
_(this, it, null);
|
|
836
|
-
_(this, X, []);
|
|
837
|
-
_(this, I, {});
|
|
838
|
-
_(this, W, {});
|
|
839
|
-
_(this, C, 50);
|
|
840
|
-
_(this, j, !0);
|
|
834
|
+
_(this, z, null);
|
|
835
|
+
_(this, ut, null);
|
|
836
|
+
_(this, K, []);
|
|
837
|
+
_(this, Y, {});
|
|
838
|
+
_(this, J, 50);
|
|
839
|
+
_(this, q, !0);
|
|
840
|
+
_(this, Q, null);
|
|
841
|
+
_(this, U, null);
|
|
841
842
|
_(this, k, null);
|
|
842
|
-
_(this,
|
|
843
|
-
_(this,
|
|
844
|
-
_(this,
|
|
845
|
-
_(this,
|
|
846
|
-
_(this,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
843
|
+
_(this, Dt, 100);
|
|
844
|
+
_(this, v, "no");
|
|
845
|
+
_(this, C, !1);
|
|
846
|
+
_(this, $, !1);
|
|
847
|
+
_(this, tt, !1);
|
|
848
|
+
w(this, "errors", {});
|
|
849
|
+
w(this, "answerData", {});
|
|
850
|
+
g(this, z, s), g(this, ut, e);
|
|
850
851
|
}
|
|
851
852
|
get serial() {
|
|
852
|
-
return
|
|
853
|
+
return a(this, C);
|
|
853
854
|
}
|
|
854
855
|
setSerial() {
|
|
855
|
-
|
|
856
|
+
g(this, C, !0), g(this, $, !0), g(this, tt, !1);
|
|
856
857
|
}
|
|
857
858
|
setParallel() {
|
|
858
|
-
|
|
859
|
+
g(this, C, !1), g(this, $, !1), g(this, tt, !0);
|
|
859
860
|
}
|
|
860
861
|
stop() {
|
|
861
|
-
|
|
862
|
+
g(this, q, !1);
|
|
862
863
|
}
|
|
863
|
-
async batch(
|
|
864
|
-
|
|
865
|
-
const
|
|
866
|
-
if (Object.keys(
|
|
867
|
-
const
|
|
868
|
-
return Promise.allSettled(
|
|
869
|
-
let
|
|
870
|
-
for (let
|
|
871
|
-
|
|
872
|
-
return
|
|
864
|
+
async batch(s, e) {
|
|
865
|
+
a(this, k) && O(this, mt, kt).call(this), e && g(this, Q, e), a(this, $) === !1 && g(this, C, !1), Object.keys(s).length > 500 && g(this, C, !0), g(this, q, !0), g(this, K, []), g(this, Y, {}), this.errors = {}, this.answerData = {};
|
|
866
|
+
const o = O(this, Nt, Vt).call(this, s);
|
|
867
|
+
if (Object.keys(s).length < 500) {
|
|
868
|
+
const n = o.map((u, l) => O(this, _t, Zt).call(this, u, o[l]));
|
|
869
|
+
return Promise.allSettled(n).then((u) => {
|
|
870
|
+
let l = {};
|
|
871
|
+
for (let y of u)
|
|
872
|
+
y.status === "fulfilled" && (l = { ...l, ...y.value });
|
|
873
|
+
return l;
|
|
873
874
|
});
|
|
874
875
|
} else {
|
|
875
|
-
let
|
|
876
|
-
|
|
876
|
+
let n = {}, u = 0, l = 1, y = Object.keys(s).length || 1, f = (i) => {
|
|
877
|
+
u += Object.keys(i).length, l = Math.round(u / y * 100);
|
|
877
878
|
};
|
|
878
|
-
for (let [i,
|
|
879
|
-
let
|
|
880
|
-
|
|
879
|
+
for (let [i, R] of Object.entries(o)) {
|
|
880
|
+
let d = await O(this, _t, Zt).call(this, R, o[i], !0);
|
|
881
|
+
f(R), e && e({ percent: l }), n = { ...n, ...d };
|
|
881
882
|
}
|
|
882
|
-
return
|
|
883
|
+
return n;
|
|
883
884
|
}
|
|
884
885
|
}
|
|
885
|
-
async batchTotalCount(
|
|
886
|
-
|
|
887
|
-
let
|
|
888
|
-
|
|
886
|
+
async batchTotalCount(s, e) {
|
|
887
|
+
g(this, Y, {}), this.errors = {};
|
|
888
|
+
let o = 1, n = 0, u = Object.keys(s).length || 1, l = (f) => {
|
|
889
|
+
n += Object.keys(f).length, o = Math.round(n / u * 100);
|
|
889
890
|
};
|
|
890
|
-
e && e({ percent:
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
894
|
-
return Promise.allSettled(
|
|
895
|
-
let
|
|
896
|
-
for (let
|
|
897
|
-
|
|
898
|
-
return
|
|
891
|
+
e && e({ percent: o });
|
|
892
|
+
const y = O(this, Nt, Vt).call(this, s);
|
|
893
|
+
if (a(this, tt)) {
|
|
894
|
+
const f = y.map((i) => O(this, Ot, zt).call(this, i).then((R) => (l(i), e && e({ percent: o }), R)));
|
|
895
|
+
return Promise.allSettled(f).then((i) => {
|
|
896
|
+
let R = {};
|
|
897
|
+
for (let d of i)
|
|
898
|
+
d.status === "fulfilled" && (R = { ...R, ...d.value });
|
|
899
|
+
return R;
|
|
899
900
|
});
|
|
900
901
|
} else {
|
|
901
|
-
let
|
|
902
|
-
for (let i of
|
|
903
|
-
let
|
|
904
|
-
|
|
902
|
+
let f = {};
|
|
903
|
+
for (let i of y) {
|
|
904
|
+
let R = await O(this, Ot, zt).call(this, i);
|
|
905
|
+
l(i), e && e({ percent: o }), f = { ...f, ...R };
|
|
905
906
|
}
|
|
906
|
-
return
|
|
907
|
+
return f;
|
|
907
908
|
}
|
|
908
909
|
}
|
|
909
910
|
}
|
|
910
|
-
|
|
911
|
-
let
|
|
912
|
-
if (!
|
|
913
|
-
return Math.round(
|
|
914
|
-
let e = 0,
|
|
915
|
-
return Object.values(
|
|
916
|
-
const { total:
|
|
917
|
-
e +=
|
|
918
|
-
}), e ?
|
|
919
|
-
},
|
|
920
|
-
clearInterval(
|
|
921
|
-
},
|
|
922
|
-
const
|
|
923
|
-
let
|
|
924
|
-
|
|
925
|
-
const { percent:
|
|
926
|
-
(
|
|
927
|
-
data:
|
|
928
|
-
percent:
|
|
929
|
-
allCount:
|
|
911
|
+
z = new WeakMap(), ut = new WeakMap(), K = new WeakMap(), Y = new WeakMap(), J = new WeakMap(), q = new WeakMap(), Q = new WeakMap(), U = new WeakMap(), k = new WeakMap(), Dt = new WeakMap(), v = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), tt = new WeakMap(), it = new WeakSet(), Lt = function() {
|
|
912
|
+
let s = 0;
|
|
913
|
+
if (!a(this, U))
|
|
914
|
+
return Math.round(s);
|
|
915
|
+
let e = 0, o = 0;
|
|
916
|
+
return Object.values(a(this, U)).forEach((n) => {
|
|
917
|
+
const { total: u, count: l } = n;
|
|
918
|
+
e += u ?? 0, o += l ?? 0;
|
|
919
|
+
}), e ? s = o / e * 100 : s = 100, { percent: Math.round(s), allCount: o, allTotal: e };
|
|
920
|
+
}, mt = new WeakSet(), kt = function() {
|
|
921
|
+
clearInterval(a(this, k)), g(this, k, ""), g(this, U, ""), g(this, Q, ""), g(this, v, "no");
|
|
922
|
+
}, ft = new WeakSet(), xt = function({ key: s, value: e }) {
|
|
923
|
+
const o = O(this, et, lt).call(this, e.data()), n = Array.isArray(o) ? o.length : 0, u = O(this, ot, bt).call(this, e.total(), n);
|
|
924
|
+
let l = 1;
|
|
925
|
+
o && (l = n), a(this, Q) && (a(this, U) || g(this, U, {}), a(this, U)[s] && a(this, U)[s].count && (l += a(this, U)[s].count), a(this, U)[s] = { total: u, count: l }, a(this, k) || g(this, k, setInterval(() => {
|
|
926
|
+
const { percent: y, allCount: f, allTotal: i } = a(this, it, Lt);
|
|
927
|
+
(a(this, v) === "no" || a(this, v) < a(this, it, Lt).percent) && (a(this, Q).call(this, {
|
|
928
|
+
data: a(this, U),
|
|
929
|
+
percent: y,
|
|
930
|
+
allCount: f,
|
|
930
931
|
allTotal: i
|
|
931
|
-
}),
|
|
932
|
-
},
|
|
933
|
-
},
|
|
934
|
-
const e = [],
|
|
935
|
-
for (let
|
|
936
|
-
const
|
|
937
|
-
e.push(Object.fromEntries(
|
|
932
|
+
}), g(this, v, a(this, it, Lt).percent)), y === 100 && O(this, mt, kt).call(this);
|
|
933
|
+
}, a(this, Dt))));
|
|
934
|
+
}, Nt = new WeakSet(), Vt = function(s) {
|
|
935
|
+
const e = [], o = Object.entries(s);
|
|
936
|
+
for (let n = 0; n < o.length; n += a(this, J)) {
|
|
937
|
+
const u = o.slice(n, n + a(this, J));
|
|
938
|
+
e.push(Object.fromEntries(u));
|
|
938
939
|
}
|
|
939
940
|
return e;
|
|
940
|
-
},
|
|
941
|
-
return new Promise((
|
|
942
|
-
const
|
|
943
|
-
let
|
|
944
|
-
|
|
945
|
-
Object.entries(i).forEach(([
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
941
|
+
}, _t = new WeakSet(), Zt = function(s, e, o) {
|
|
942
|
+
return new Promise((n) => {
|
|
943
|
+
const u = O(this, St, vt).call(this, e), l = [];
|
|
944
|
+
let y = 0, f = 0;
|
|
945
|
+
a(this, z).call(this, s, (i) => {
|
|
946
|
+
Object.entries(i).forEach(([R, d]) => {
|
|
947
|
+
let m = {};
|
|
948
|
+
const N = d.error();
|
|
949
|
+
if (N && (this.errors[R] = N, y += 1), d != null && d.answer && Object.keys(d.answer).length) {
|
|
950
|
+
for (let [Z, F] of Object.entries(d.answer))
|
|
951
|
+
Z != "result" && F && (m[Z] = F);
|
|
952
|
+
Object.keys(m).length && (this.answerData[R] = m);
|
|
952
953
|
}
|
|
953
|
-
|
|
954
|
+
const W = O(this, et, lt).call(this, d.data()), ht = Array.isArray(W) ? W.length : 0, V = O(this, ot, bt).call(this, d.total(), ht);
|
|
955
|
+
if (Array.isArray(W) ? a(this, Y)[R] = W : a(this, Y)[R] = Object.values(W), f += V, o || O(this, ft, xt).call(this, { key: R, value: d }), V > a(this, J) && V > ht) {
|
|
956
|
+
const Z = Math.ceil(V / a(this, J)) - 1, F = Array.from({ length: Z });
|
|
957
|
+
l.push([R, u[R], F]);
|
|
958
|
+
}
|
|
959
|
+
}), f > 5e3 && a(this, $) === !1 && a(this, tt) === !1 && g(this, C, !0), y > 0 && O(this, gt, $t).call(this), l.length ? (O(this, Ht, ee).call(this, l), O(this, Yt, se).call(this).then(() => n(O(this, nt, pt).call(this)))) : n(O(this, nt, pt).call(this));
|
|
954
960
|
});
|
|
955
961
|
});
|
|
956
|
-
},
|
|
962
|
+
}, Ot = new WeakSet(), zt = function(s) {
|
|
957
963
|
return new Promise((e) => {
|
|
958
|
-
const
|
|
959
|
-
let
|
|
960
|
-
|
|
961
|
-
Object.entries(
|
|
962
|
-
const
|
|
963
|
-
|
|
964
|
-
const i =
|
|
965
|
-
|
|
966
|
-
}),
|
|
964
|
+
const o = O(this, St, vt).call(this, s);
|
|
965
|
+
let n = 0;
|
|
966
|
+
a(this, z).call(this, o, (u) => {
|
|
967
|
+
Object.entries(u).forEach(([l, y]) => {
|
|
968
|
+
const f = y.error();
|
|
969
|
+
f && (this.errors[l] = f, n += 1);
|
|
970
|
+
const i = O(this, et, lt).call(this, y.data()), R = Array.isArray(i) ? i.length : 0, d = O(this, ot, bt).call(this, y.total(), R);
|
|
971
|
+
a(this, Y)[l] = d;
|
|
972
|
+
}), n > 0 && O(this, gt, $t).call(this), e(O(this, nt, pt).call(this));
|
|
967
973
|
});
|
|
968
974
|
});
|
|
969
|
-
},
|
|
975
|
+
}, Ht = new WeakSet(), ee = function(s) {
|
|
970
976
|
let e = [];
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
const
|
|
974
|
-
e.length ===
|
|
977
|
+
s.forEach(([o, n, u]) => {
|
|
978
|
+
u.forEach((l, y) => {
|
|
979
|
+
const f = y + 1, i = a(this, J) * f, d = [[o, f].join("_"), O(this, Ut, re).call(this, n, i)];
|
|
980
|
+
e.length === a(this, J) ? (a(this, K).push(e), e = [d]) : e.push(d);
|
|
975
981
|
});
|
|
976
|
-
}), e.length &&
|
|
977
|
-
},
|
|
978
|
-
const
|
|
979
|
-
Object.entries(
|
|
980
|
-
const [
|
|
981
|
-
Array.isArray(
|
|
982
|
+
}), e.length && a(this, K).push(e);
|
|
983
|
+
}, Yt = new WeakSet(), se = function() {
|
|
984
|
+
const s = [], e = [], o = (n) => {
|
|
985
|
+
Object.entries(n).forEach(([u, l]) => {
|
|
986
|
+
const [y] = u.split("_"), f = O(this, et, lt).call(this, l.data());
|
|
987
|
+
Array.isArray(f) && a(this, Y)[y].push(...f), O(this, ft, xt).call(this, { key: y, value: l });
|
|
982
988
|
});
|
|
983
989
|
};
|
|
984
|
-
return
|
|
985
|
-
const
|
|
986
|
-
|
|
990
|
+
return a(this, K).forEach((n, u) => {
|
|
991
|
+
const l = Object.fromEntries(n), y = () => new Promise((f) => a(this, z).call(this, l, (i) => {
|
|
992
|
+
a(this, C) ? o(i) : e[u] = i, f();
|
|
987
993
|
}));
|
|
988
|
-
|
|
989
|
-
}),
|
|
990
|
-
e.forEach(
|
|
994
|
+
s.push(y);
|
|
995
|
+
}), a(this, C) ? O(this, At, qt).call(this, s) : O(this, Tt, Qt).call(this, s).then(() => {
|
|
996
|
+
e.forEach(o);
|
|
991
997
|
});
|
|
992
|
-
},
|
|
993
|
-
return new Promise((
|
|
994
|
-
},
|
|
995
|
-
if (!
|
|
998
|
+
}, yt = new WeakSet(), Kt = function() {
|
|
999
|
+
return new Promise((s) => setTimeout(s, 500));
|
|
1000
|
+
}, At = new WeakSet(), qt = function(s) {
|
|
1001
|
+
if (!s.length)
|
|
996
1002
|
return Promise.resolve();
|
|
997
|
-
const e =
|
|
1003
|
+
const e = s.shift();
|
|
998
1004
|
return Promise.allSettled([
|
|
999
1005
|
e(),
|
|
1000
|
-
|
|
1001
|
-
]).then(() =>
|
|
1002
|
-
},
|
|
1003
|
-
if (!
|
|
1006
|
+
O(this, yt, Kt).call(this)
|
|
1007
|
+
]).then(() => a(this, q) ? O(this, At, qt).call(this, s) : Promise.resolve());
|
|
1008
|
+
}, Tt = new WeakSet(), Qt = function(s) {
|
|
1009
|
+
if (!s.length)
|
|
1004
1010
|
return Promise.resolve();
|
|
1005
|
-
const e =
|
|
1006
|
-
return
|
|
1007
|
-
},
|
|
1008
|
-
return Object.entries(
|
|
1009
|
-
|
|
1010
|
-
}),
|
|
1011
|
-
},
|
|
1012
|
-
return Object.entries(
|
|
1013
|
-
if (Array.isArray(
|
|
1014
|
-
const [
|
|
1015
|
-
e[
|
|
1011
|
+
const e = s.shift();
|
|
1012
|
+
return O(this, yt, Kt).call(this).then(() => e()).then(() => a(this, q) ? O(this, Tt, Qt).call(this, s) : Promise.resolve());
|
|
1013
|
+
}, nt = new WeakSet(), pt = function() {
|
|
1014
|
+
return Object.entries(a(this, ut)).forEach(([s, e]) => {
|
|
1015
|
+
a(this, Y)[s] && (a(this, Y)[s] = e(a(this, Y)[s]));
|
|
1016
|
+
}), a(this, Y);
|
|
1017
|
+
}, St = new WeakSet(), vt = function(s) {
|
|
1018
|
+
return Object.entries(s).reduce((e, [o, n]) => {
|
|
1019
|
+
if (Array.isArray(n)) {
|
|
1020
|
+
const [u, l = {}] = n;
|
|
1021
|
+
e[o] = [u, l];
|
|
1016
1022
|
} else {
|
|
1017
|
-
const { method:
|
|
1018
|
-
e[
|
|
1023
|
+
const { method: u, params: l = {} } = n;
|
|
1024
|
+
e[o] = [u, l];
|
|
1019
1025
|
}
|
|
1020
1026
|
return e;
|
|
1021
1027
|
}, {});
|
|
1022
|
-
},
|
|
1023
|
-
const [
|
|
1024
|
-
return [
|
|
1025
|
-
},
|
|
1026
|
-
return ((
|
|
1027
|
-
},
|
|
1028
|
-
return
|
|
1029
|
-
},
|
|
1030
|
-
console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(
|
|
1031
|
-
console.info(`[${
|
|
1028
|
+
}, Ut = new WeakSet(), re = function(s, e) {
|
|
1029
|
+
const [o, n] = s;
|
|
1030
|
+
return [o, { start: e, ...n }];
|
|
1031
|
+
}, et = new WeakSet(), lt = function(s) {
|
|
1032
|
+
return ((s == null ? void 0 : s.items) || (s == null ? void 0 : s.documents)) ?? s;
|
|
1033
|
+
}, ot = new WeakSet(), bt = function(s, e) {
|
|
1034
|
+
return s !== s && (s = 0), s === 0 && e === 0 ? 0 : s || e;
|
|
1035
|
+
}, gt = new WeakSet(), $t = function() {
|
|
1036
|
+
console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(this.errors).forEach(([s, e]) => {
|
|
1037
|
+
console.info(`[${s}]`, e.toString());
|
|
1032
1038
|
}), console.groupEnd();
|
|
1033
1039
|
};
|
|
1034
|
-
var
|
|
1035
|
-
class
|
|
1036
|
-
constructor(
|
|
1040
|
+
var st;
|
|
1041
|
+
class Oe {
|
|
1042
|
+
constructor() {
|
|
1043
|
+
_(this, st, {});
|
|
1044
|
+
}
|
|
1045
|
+
get hash() {
|
|
1046
|
+
return this.createHash(8);
|
|
1047
|
+
}
|
|
1048
|
+
/** Генератор хеш-кода */
|
|
1049
|
+
createHash(s) {
|
|
1050
|
+
let e = "abcdefghijklmnopqrstuvwxyz0123456789", o = "";
|
|
1051
|
+
s = s || 6;
|
|
1052
|
+
for (let n = 0; n < s; n++)
|
|
1053
|
+
o += e.charAt(Math.floor(Math.random() * e.length));
|
|
1054
|
+
return o;
|
|
1055
|
+
}
|
|
1056
|
+
/** Фильтр часто запускаемых действий */
|
|
1057
|
+
actionFilter({ keyTimer: s, duration: e = 10, action: o }) {
|
|
1058
|
+
a(this, st)[s] && (clearTimeout(a(this, st)[s]), a(this, st)[s] = null), o && (a(this, st)[s] = setTimeout(() => {
|
|
1059
|
+
o();
|
|
1060
|
+
}, e));
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
st = new WeakMap();
|
|
1064
|
+
const Wt = new Oe();
|
|
1065
|
+
var P, x, It, rt, Et, Gt, ie, Rt, te, Bt, ne, wt, oe, Ct, he;
|
|
1066
|
+
class ye {
|
|
1067
|
+
constructor() {
|
|
1068
|
+
_(this, Gt);
|
|
1069
|
+
/** Вывод ошибок логера
|
|
1070
|
+
* @param {'entity'} type - тип ошибки
|
|
1071
|
+
*/
|
|
1072
|
+
_(this, Rt);
|
|
1073
|
+
_(this, Bt);
|
|
1074
|
+
_(this, wt);
|
|
1075
|
+
_(this, Ct);
|
|
1076
|
+
_(this, P, "logger");
|
|
1077
|
+
_(this, x, !1);
|
|
1078
|
+
_(this, It, 2e3);
|
|
1079
|
+
_(this, rt, /* @__PURE__ */ new Map());
|
|
1080
|
+
_(this, Et, {});
|
|
1081
|
+
/** Очистка хранилища элементов старше 'N' месяцев */
|
|
1082
|
+
w(this, "periodClear", 3);
|
|
1083
|
+
O(this, Gt, ie).call(this);
|
|
1084
|
+
}
|
|
1085
|
+
/** Инициализация логера */
|
|
1086
|
+
async init() {
|
|
1087
|
+
let s = new j(BX24.callBatch), { entityList: e } = await s.batch({
|
|
1088
|
+
entityList: { method: "entity.get" }
|
|
1089
|
+
});
|
|
1090
|
+
if (e != null && e.length)
|
|
1091
|
+
if (e.find((n) => n.ENTITY == a(this, P)))
|
|
1092
|
+
g(this, x, !0);
|
|
1093
|
+
else {
|
|
1094
|
+
let { entityAdd: n } = await s.batch({
|
|
1095
|
+
entityAdd: {
|
|
1096
|
+
method: "entity.add",
|
|
1097
|
+
params: {
|
|
1098
|
+
ENTITY: a(this, P),
|
|
1099
|
+
NAME: a(this, P),
|
|
1100
|
+
ACCESS: { AU: "X" }
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
});
|
|
1104
|
+
n && g(this, x, !0);
|
|
1105
|
+
}
|
|
1106
|
+
return O(this, wt, oe).call(this), a(this, x);
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* @param {{ type: 'call'|'batch'|'batch-total-count';
|
|
1110
|
+
* data: {
|
|
1111
|
+
* method: string,
|
|
1112
|
+
* params: { [key]: any }
|
|
1113
|
+
* }|{ commandList: { [key]: any }
|
|
1114
|
+
* }; }}
|
|
1115
|
+
* @returns {string}
|
|
1116
|
+
*/
|
|
1117
|
+
start({ type: s, data: e }) {
|
|
1118
|
+
if (!a(this, x)) {
|
|
1119
|
+
O(this, Rt, te).call(this, "entity");
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
const o = Wt.hash;
|
|
1123
|
+
return a(this, rt).set(o, {
|
|
1124
|
+
type: s,
|
|
1125
|
+
data: e,
|
|
1126
|
+
userInfo: a(this, Et),
|
|
1127
|
+
errorList: [],
|
|
1128
|
+
status: "",
|
|
1129
|
+
answer: null,
|
|
1130
|
+
date: (/* @__PURE__ */ new Date()).getTime()
|
|
1131
|
+
}), o;
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* @param {{
|
|
1135
|
+
* key: string;
|
|
1136
|
+
* errorList: any[];
|
|
1137
|
+
* status: 'success'|'fail'|'fail-runtime',
|
|
1138
|
+
* answer: { [key]: unknown } }}
|
|
1139
|
+
*/
|
|
1140
|
+
stop({ key: s, errorList: e, status: o, answer: n }) {
|
|
1141
|
+
if (!a(this, x)) {
|
|
1142
|
+
O(this, Rt, te).call(this, "entity");
|
|
1143
|
+
return;
|
|
1144
|
+
}
|
|
1145
|
+
let u = a(this, rt).get(s);
|
|
1146
|
+
e && (u.errorList = e), o && (u.status = o), n && (u.answer = n), Wt.actionFilter({
|
|
1147
|
+
keyTimer: "add.entity.items",
|
|
1148
|
+
duration: a(this, It),
|
|
1149
|
+
action: () => {
|
|
1150
|
+
O(this, Bt, ne).call(this);
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
async getEntityList() {
|
|
1155
|
+
let s = new j(BX24.callBatch), { entityList: e } = await s.batch({
|
|
1156
|
+
entityList: {
|
|
1157
|
+
method: "entity.item.get",
|
|
1158
|
+
params: {
|
|
1159
|
+
ENTITY: a(this, P)
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
return e = e.map((o) => {
|
|
1164
|
+
const { ID: n, DATE_CREATE: u, DETAIL_TEXT: l } = o;
|
|
1165
|
+
return {
|
|
1166
|
+
...JSON.parse(l),
|
|
1167
|
+
id: n,
|
|
1168
|
+
dateCreate: u
|
|
1169
|
+
};
|
|
1170
|
+
}), e;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
P = new WeakMap(), x = new WeakMap(), It = new WeakMap(), rt = new WeakMap(), Et = new WeakMap(), Gt = new WeakSet(), ie = async function() {
|
|
1174
|
+
const s = new j(BX24.callBatch), e = BX24.isAdmin(), { curUser: o } = await s.batch({
|
|
1175
|
+
curUser: { method: "user.current" }
|
|
1176
|
+
});
|
|
1177
|
+
g(this, Et, { isAdmin: e, curUser: o });
|
|
1178
|
+
}, Rt = new WeakSet(), te = function(s) {
|
|
1179
|
+
s == "entity" && Wt.actionFilter({
|
|
1180
|
+
keyTimer: "error.logger.entity",
|
|
1181
|
+
duration: 500,
|
|
1182
|
+
action: () => {
|
|
1183
|
+
console.error("Хранилище для логгера не инициализировано");
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
}, Bt = new WeakSet(), ne = async function() {
|
|
1187
|
+
let s = {}, e = new j(BX24.callBatch);
|
|
1188
|
+
for (let [o, n] of a(this, rt).entries())
|
|
1189
|
+
n.status && (s[o] = {
|
|
1190
|
+
method: "entity.item.add",
|
|
1191
|
+
params: {
|
|
1192
|
+
ENTITY: a(this, P),
|
|
1193
|
+
NAME: a(this, P),
|
|
1194
|
+
DETAIL_TEXT: JSON.stringify(n)
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
if (Object.keys(s).length) {
|
|
1198
|
+
let o = await e.batch(s), { errors: n } = e;
|
|
1199
|
+
for (let [u, l] of Object.entries({ ...o, ...n }))
|
|
1200
|
+
a(this, rt).delete(u);
|
|
1201
|
+
}
|
|
1202
|
+
}, wt = new WeakSet(), oe = async function() {
|
|
1203
|
+
let s = new j(BX24.callBatch), e = await this.getEntityList(), { serverTime: o } = await s.batch({
|
|
1204
|
+
serverTime: { method: "server.time" }
|
|
1205
|
+
}), n = e.filter((u) => {
|
|
1206
|
+
let { dateCreate: l } = u;
|
|
1207
|
+
return jt(new Date(l)).between(jt(new Date(o)), "month") >= this.periodClear;
|
|
1208
|
+
});
|
|
1209
|
+
O(this, Ct, he).call(this, n);
|
|
1210
|
+
}, Ct = new WeakSet(), he = async function(s) {
|
|
1211
|
+
let e = new j(BX24.callBatch), o = s.map((n) => {
|
|
1212
|
+
let { id: u } = n;
|
|
1213
|
+
return {
|
|
1214
|
+
method: "entity.item.delete",
|
|
1215
|
+
params: {
|
|
1216
|
+
ENTITY: a(this, P),
|
|
1217
|
+
ID: u
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
});
|
|
1221
|
+
return await e.batch(o);
|
|
1222
|
+
};
|
|
1223
|
+
const G = new ye();
|
|
1224
|
+
var Pt, ae, Ft, ce;
|
|
1225
|
+
class Te {
|
|
1226
|
+
constructor(s) {
|
|
1037
1227
|
/** Запрос данных о приложении */
|
|
1038
|
-
_(this,
|
|
1228
|
+
_(this, Pt);
|
|
1039
1229
|
/** Запрос данных о текущем пользователе */
|
|
1040
|
-
_(this,
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
this.appConst =
|
|
1230
|
+
_(this, Ft);
|
|
1231
|
+
w(this, "domain", "");
|
|
1232
|
+
w(this, "isAdmin", !1);
|
|
1233
|
+
w(this, "appInfo", null);
|
|
1234
|
+
w(this, "appConst", null);
|
|
1235
|
+
w(this, "userInfo", null);
|
|
1236
|
+
w(this, "placeData", null);
|
|
1237
|
+
w(this, "placeInfo", null);
|
|
1238
|
+
this.appConst = s;
|
|
1049
1239
|
}
|
|
1050
1240
|
init() {
|
|
1051
|
-
return new Promise((
|
|
1241
|
+
return new Promise((s) => {
|
|
1052
1242
|
let e = setInterval(() => {
|
|
1053
1243
|
window.BX24 && BX24.init(async () => {
|
|
1054
|
-
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info();
|
|
1055
|
-
const [
|
|
1056
|
-
|
|
1057
|
-
|
|
1244
|
+
console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await G.init();
|
|
1245
|
+
const [o, n] = await Promise.all([
|
|
1246
|
+
O(this, Pt, ae).call(this),
|
|
1247
|
+
O(this, Ft, ce).call(this)
|
|
1058
1248
|
]);
|
|
1059
|
-
this.appInfo =
|
|
1249
|
+
this.appInfo = o, this.userInfo = n, s(!0);
|
|
1060
1250
|
});
|
|
1061
1251
|
}, 100);
|
|
1062
1252
|
});
|
|
1063
1253
|
}
|
|
1064
|
-
userOption(
|
|
1065
|
-
return e ? BX24.userOption.set(
|
|
1254
|
+
userOption(s, e) {
|
|
1255
|
+
return e ? BX24.userOption.set(s, e) : BX24.userOption.get(s);
|
|
1066
1256
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1257
|
+
/**
|
|
1258
|
+
* @param {{
|
|
1259
|
+
* method: string;
|
|
1260
|
+
* params: any;
|
|
1261
|
+
* updateList: {
|
|
1262
|
+
* method: string,
|
|
1263
|
+
* list: {
|
|
1264
|
+
* id: string | number,
|
|
1265
|
+
* fields: { [key: string]: string | number | string[] | number[] }
|
|
1266
|
+
* }[]
|
|
1267
|
+
* }[]
|
|
1268
|
+
*/
|
|
1269
|
+
call({ method: s, params: e, updateList: o }) {
|
|
1270
|
+
let n = G.start({
|
|
1271
|
+
type: "call",
|
|
1272
|
+
data: { method: s, params: e, updateList: o }
|
|
1273
|
+
});
|
|
1274
|
+
return new Promise((u) => {
|
|
1275
|
+
e || (e = {}), BX24.callMethod(s, e, function(l) {
|
|
1276
|
+
let y = {};
|
|
1277
|
+
if (l != null && l.answer)
|
|
1278
|
+
for (let [f, i] of Object.entries(l.answer))
|
|
1279
|
+
f != "result" && i && (y[f] = i);
|
|
1280
|
+
if (l.error()) {
|
|
1281
|
+
let f = l.error();
|
|
1282
|
+
console.error(f), G.stop({
|
|
1283
|
+
answer: y,
|
|
1284
|
+
key: n,
|
|
1285
|
+
status: "fail",
|
|
1286
|
+
errorList: [f.toSting()]
|
|
1287
|
+
}), u(!1);
|
|
1073
1288
|
} else {
|
|
1074
|
-
let
|
|
1075
|
-
|
|
1289
|
+
let f = l.data();
|
|
1290
|
+
f != null && f.items && (f = f.items), G.stop({
|
|
1291
|
+
answer: y,
|
|
1292
|
+
key: n,
|
|
1293
|
+
status: "success"
|
|
1294
|
+
}), u(f);
|
|
1076
1295
|
}
|
|
1077
1296
|
});
|
|
1078
1297
|
});
|
|
@@ -1080,58 +1299,124 @@ class te {
|
|
|
1080
1299
|
/**
|
|
1081
1300
|
* @param commandList - объект/массив команд
|
|
1082
1301
|
* @param progressCall - callback(data), в data приходят данные о загрузке данных
|
|
1302
|
+
* @param {{ updateList: {
|
|
1303
|
+
* method: string,
|
|
1304
|
+
* list: {
|
|
1305
|
+
* id: string | number,
|
|
1306
|
+
* fields: { [key: string]: string | number | string[] | number[] }
|
|
1307
|
+
* }[]
|
|
1308
|
+
* }[] }}
|
|
1083
1309
|
*/
|
|
1084
|
-
batch(
|
|
1085
|
-
|
|
1310
|
+
async batch(s, e, { updateList: o } = {}) {
|
|
1311
|
+
let n = new j(BX24.callBatch), u = G.start({
|
|
1312
|
+
type: "batch",
|
|
1313
|
+
data: { commandList: s, updateList: o }
|
|
1314
|
+
});
|
|
1315
|
+
try {
|
|
1316
|
+
let l = await n.batch(s, e);
|
|
1317
|
+
if (Object.keys(n.errors).length) {
|
|
1318
|
+
let y = Object.entries(n.errors).map(([f, i]) => ({
|
|
1319
|
+
key: f,
|
|
1320
|
+
error: i.toSting()
|
|
1321
|
+
}));
|
|
1322
|
+
G.stop({
|
|
1323
|
+
key: u,
|
|
1324
|
+
status: "fail",
|
|
1325
|
+
errorList: y,
|
|
1326
|
+
answer: n.answerData
|
|
1327
|
+
});
|
|
1328
|
+
} else
|
|
1329
|
+
G.stop({
|
|
1330
|
+
key: u,
|
|
1331
|
+
status: "success",
|
|
1332
|
+
answer: n.answerData
|
|
1333
|
+
});
|
|
1334
|
+
return l;
|
|
1335
|
+
} catch (l) {
|
|
1336
|
+
return G.stop({
|
|
1337
|
+
key: u,
|
|
1338
|
+
status: "fail-runtime",
|
|
1339
|
+
errorList: [l.toSting()],
|
|
1340
|
+
answer: n.answerData
|
|
1341
|
+
}), console.error(l), !1;
|
|
1342
|
+
}
|
|
1086
1343
|
}
|
|
1087
1344
|
/**
|
|
1088
1345
|
* @param commandList - объект/массив команд
|
|
1089
1346
|
* @param progressCall - callback(data), в data приходят данные о загрузке данных
|
|
1090
1347
|
*/
|
|
1091
|
-
batchTotalCount(
|
|
1092
|
-
|
|
1348
|
+
async batchTotalCount(s, e) {
|
|
1349
|
+
let o = new j(BX24.callBatch), n = G.start({
|
|
1350
|
+
type: "batch",
|
|
1351
|
+
data: { commandList: s }
|
|
1352
|
+
});
|
|
1353
|
+
try {
|
|
1354
|
+
let u = await o.batchTotalCount(s, e);
|
|
1355
|
+
if (Object.keys(o.errors).length) {
|
|
1356
|
+
let l = Object.entries(o.errors).map(([y, f]) => ({
|
|
1357
|
+
key: y,
|
|
1358
|
+
error: f.toSting()
|
|
1359
|
+
}));
|
|
1360
|
+
G.stop({
|
|
1361
|
+
key: n,
|
|
1362
|
+
status: "fail",
|
|
1363
|
+
errorList: l
|
|
1364
|
+
});
|
|
1365
|
+
} else
|
|
1366
|
+
G.stop({
|
|
1367
|
+
key: n,
|
|
1368
|
+
status: "success"
|
|
1369
|
+
});
|
|
1370
|
+
return u;
|
|
1371
|
+
} catch (u) {
|
|
1372
|
+
return G.stop({
|
|
1373
|
+
key: n,
|
|
1374
|
+
status: "fail",
|
|
1375
|
+
errorList: [u.toSting()]
|
|
1376
|
+
}), console.error(u), !1;
|
|
1377
|
+
}
|
|
1093
1378
|
}
|
|
1094
1379
|
/** Запрос данных о местах встройки приложения */
|
|
1095
1380
|
getPlacement() {
|
|
1096
|
-
return this.call({ method: "placement.get" }).then((
|
|
1381
|
+
return this.call({ method: "placement.get" }).then((s) => (this.placeData || (this.placeData = s), s));
|
|
1097
1382
|
}
|
|
1098
1383
|
/** Встройка приложения в place */
|
|
1099
|
-
async placementBind(
|
|
1384
|
+
async placementBind(s) {
|
|
1100
1385
|
this.placeData || (this.placeData = await this.getPlacement());
|
|
1101
|
-
const { appName: e, pathApp:
|
|
1102
|
-
let
|
|
1103
|
-
|
|
1104
|
-
window.placementUnBind[
|
|
1386
|
+
const { appName: e, pathApp: o } = this.appConst, n = this.placeData.map((l) => l.placement);
|
|
1387
|
+
let u = this.placeData.find((l) => l.placement == s);
|
|
1388
|
+
n.includes(s) ? u.handler != o && (window.placementUnBind || (window.placementUnBind = {}), window.placementUnBind[s] || this.placementUnBind(u).then(() => {
|
|
1389
|
+
window.placementUnBind[s] || (window.placementUnBind[s] = !0, this.placementBind(s));
|
|
1105
1390
|
})) : this.call({
|
|
1106
1391
|
method: "placement.bind",
|
|
1107
1392
|
params: {
|
|
1108
|
-
PLACEMENT:
|
|
1109
|
-
HANDLER:
|
|
1393
|
+
PLACEMENT: s,
|
|
1394
|
+
HANDLER: o,
|
|
1110
1395
|
LANG_ALL: {
|
|
1111
1396
|
ru: {
|
|
1112
1397
|
TITLE: e
|
|
1113
1398
|
}
|
|
1114
1399
|
}
|
|
1115
1400
|
}
|
|
1116
|
-
}).then((
|
|
1117
|
-
|
|
1401
|
+
}).then((l) => {
|
|
1402
|
+
l ? console.info("Приложение успешно встроено в", s) : console.warn("Приложение не может быть встроено в", s);
|
|
1118
1403
|
});
|
|
1119
1404
|
}
|
|
1120
1405
|
/** Отвязка встройки из place */
|
|
1121
|
-
placementUnBind(
|
|
1122
|
-
const { pathApp: e, appName:
|
|
1406
|
+
placementUnBind(s) {
|
|
1407
|
+
const { pathApp: e, appName: o } = this.appConst;
|
|
1123
1408
|
return this.call({
|
|
1124
1409
|
method: "placement.unbind",
|
|
1125
1410
|
params: {
|
|
1126
|
-
PLACEMENT:
|
|
1411
|
+
PLACEMENT: s,
|
|
1127
1412
|
HANDLER: e,
|
|
1128
1413
|
LANG_ALL: {
|
|
1129
1414
|
ru: {
|
|
1130
|
-
TITLE:
|
|
1415
|
+
TITLE: o
|
|
1131
1416
|
}
|
|
1132
1417
|
}
|
|
1133
1418
|
}
|
|
1134
|
-
}).then((
|
|
1419
|
+
}).then((n) => (console.log("Встройка отвязана", s), n));
|
|
1135
1420
|
}
|
|
1136
1421
|
/** Чат-бот */
|
|
1137
1422
|
/* получение списка ботов */
|
|
@@ -1139,22 +1424,22 @@ class te {
|
|
|
1139
1424
|
return this.call({
|
|
1140
1425
|
method: "imbot.bot.list",
|
|
1141
1426
|
params: {}
|
|
1142
|
-
}).then((
|
|
1143
|
-
let e = Object.values(
|
|
1427
|
+
}).then((s) => {
|
|
1428
|
+
let e = Object.values(s);
|
|
1144
1429
|
return console.log("chat-bot list:", e), e;
|
|
1145
1430
|
});
|
|
1146
1431
|
}
|
|
1147
1432
|
/* регистрация бота */
|
|
1148
|
-
regBot({ code:
|
|
1149
|
-
const { appName:
|
|
1433
|
+
regBot({ code: s, type: e, name: o }) {
|
|
1434
|
+
const { appName: n, pathApp: u, chatBotLogo: l } = this.appConst, y = this.appInfo.ID;
|
|
1150
1435
|
return this.call({
|
|
1151
1436
|
method: "imbot.register",
|
|
1152
1437
|
params: {
|
|
1153
|
-
CODE:
|
|
1438
|
+
CODE: s ?? this.appInfo.CODE,
|
|
1154
1439
|
// Строковой идентификатор бота, уникальный в рамках вашего приложения (обяз.)
|
|
1155
1440
|
TYPE: e ?? "O",
|
|
1156
1441
|
// Тип бота, B - чат-бот, ответы поступают сразу, H - человек, ответы поступают с задержкой от 2-х до 10 секунд, O - чат-бот для Открытых линий, S - чат-бот с повышенными привилегиями (supervisor)
|
|
1157
|
-
EVENT_HANDLER:
|
|
1442
|
+
EVENT_HANDLER: u,
|
|
1158
1443
|
// Ссылка на обработчик событий, поступивших от сервера - см. Обработчики событий ниже (обяз).
|
|
1159
1444
|
OPENLINE: "Y",
|
|
1160
1445
|
// Включение режима поддержки Открытых линий, можно не указывать, если TYPE = 'O'
|
|
@@ -1162,7 +1447,7 @@ class te {
|
|
|
1162
1447
|
// строковый идентификатор чат-бота, используется только в режиме Вебхуков
|
|
1163
1448
|
PROPERTIES: {
|
|
1164
1449
|
// Личные данные чат-бота (обяз.)
|
|
1165
|
-
NAME: `${
|
|
1450
|
+
NAME: `${o ?? n} - бот #${y}`,
|
|
1166
1451
|
// Имя чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
1167
1452
|
LAST_NAME: "",
|
|
1168
1453
|
// Фамилия чат-бота (обязательное одно из полей NAME или LAST_NAME)
|
|
@@ -1170,7 +1455,7 @@ class te {
|
|
|
1170
1455
|
// Цвет чат-бота для мобильного приложения RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE
|
|
1171
1456
|
EMAIL: "",
|
|
1172
1457
|
// E-mail для связи. НЕЛЬЗЯ использовать e-mail, дублирующий e-mail реальных пользователей
|
|
1173
|
-
PERSONAL_BIRTHDAY:
|
|
1458
|
+
PERSONAL_BIRTHDAY: jt().format("%Y-%m-%d"),
|
|
1174
1459
|
// День рождения в формате YYYY-mm-dd
|
|
1175
1460
|
WORK_POSITION: "Почтальон",
|
|
1176
1461
|
// Занимаемая должность, используется как описание чат-бота
|
|
@@ -1178,29 +1463,31 @@ class te {
|
|
|
1178
1463
|
// Ссылка на сайт
|
|
1179
1464
|
PERSONAL_GENDER: "M",
|
|
1180
1465
|
// Пол чат-бота, допустимые значения M - мужской, F - женский, пусто, если не требуется указывать
|
|
1181
|
-
PERSONAL_PHOTO:
|
|
1466
|
+
PERSONAL_PHOTO: l ?? ""
|
|
1182
1467
|
// Аватар чат-бота - base64
|
|
1183
1468
|
}
|
|
1184
1469
|
}
|
|
1185
|
-
}).then((
|
|
1470
|
+
}).then((f) => (console.log("Чат-бот добавлен", f), f));
|
|
1186
1471
|
}
|
|
1187
1472
|
/* Убрать регистрацию бота */
|
|
1188
|
-
unRegBot(
|
|
1473
|
+
unRegBot(s) {
|
|
1189
1474
|
return this.call({
|
|
1190
1475
|
method: "imbot.unregister",
|
|
1191
1476
|
params: {
|
|
1192
|
-
BOT_ID:
|
|
1477
|
+
BOT_ID: s
|
|
1193
1478
|
}
|
|
1194
1479
|
}).then((e) => (console.log("чат-бот удален", e), e));
|
|
1195
1480
|
}
|
|
1196
1481
|
}
|
|
1197
|
-
|
|
1482
|
+
Pt = new WeakSet(), ae = function() {
|
|
1198
1483
|
return this.call({ method: "app.info" });
|
|
1199
|
-
},
|
|
1484
|
+
}, Ft = new WeakSet(), ce = function() {
|
|
1200
1485
|
return this.call({ method: "user.current" });
|
|
1201
1486
|
};
|
|
1202
1487
|
export {
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1488
|
+
j as Batch,
|
|
1489
|
+
Te as BxBoot,
|
|
1490
|
+
Oe as BxHelper,
|
|
1491
|
+
ye as BxLogger,
|
|
1492
|
+
jt as tempus
|
|
1206
1493
|
};
|