szdl-utils-kit 0.2.8 → 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 CHANGED
@@ -1,54 +1,54 @@
1
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 C = (A, s, e) => (me(A, typeof s != "symbol" ? s + "" : s, e), e), Jt = (A, s, e) => {
4
- if (!s.has(A))
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
5
  throw TypeError("Cannot " + e);
6
6
  };
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))
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
- s instanceof WeakSet ? s.add(A) : s.set(A, e);
11
- }, E = (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);
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
13
  var fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
14
- function Ne(A) {
15
- return A && A.__esModule && Object.prototype.hasOwnProperty.call(A, "default") ? A.default : A;
14
+ function Ne(y) {
15
+ return y && y.__esModule && Object.prototype.hasOwnProperty.call(y, "default") ? y.default : y;
16
16
  }
17
- var Xt = { exports: {} };
18
- (function(A, s) {
17
+ var kt = { exports: {} };
18
+ (function(y, A) {
19
19
  (function(e) {
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;
20
+ Array.prototype.indexOf || (Array.prototype.indexOf = function(t, s) {
21
+ var o, a;
22
+ for (o = s || 0, a = this.length; o < a; o += 1)
23
+ if (this[o] === t)
24
+ return o;
25
25
  return -1;
26
26
  });
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
- }, l = 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
- }, u = 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)
27
+ var n = this, i = function(t, s) {
28
+ for (var o = t.toString(); o.length < s; )
29
+ o = "0" + o;
30
+ return o;
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
+ var o, a = "";
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
+ var o, a = [
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
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, S, d = o.navigator || {}, m = "en", N = {
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,70 +209,70 @@ var Xt = { exports: {} };
209
209
  FRIDAY_LONG: "Freitag",
210
210
  SATURDAY_LONG: "Samstag"
211
211
  }
212
- }, B = function() {
212
+ }, G = function() {
213
213
  return [
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
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
- }, ht = function() {
227
+ }, ot = function() {
228
228
  return [
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
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
- 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
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
- }, W = function() {
252
+ }, J = function() {
253
253
  return [
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
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
- }, 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
- }, U = {
262
+ }, P, St, ht, at, le = function(t, s, o) {
263
+ var a;
264
+ n.XMLHttpRequest ? a = new XMLHttpRequest() : a = new ActiveXObject("Microsoft.XMLHTTP"), a.onreadystatechange = function() {
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
+ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : s(JSON.parse(a.responseText))) : o && o(a));
267
+ }, a.open("GET", t, !1), a.send();
268
+ }, I = {
269
269
  "%d": {
270
270
  format: function(t) {
271
- return n(t.day() || i.MIN_DAY, 2);
271
+ return i(t.day() || r.MIN_DAY, 2);
272
272
  },
273
273
  parse: function(t) {
274
- var r = Number(t);
275
- return { day: isNaN(r) ? e : r };
274
+ var s = Number(t);
275
+ return { day: isNaN(s) ? e : s };
276
276
  },
277
277
  minLength: 2,
278
278
  maxLength: 2,
@@ -280,11 +280,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
280
280
  },
281
281
  "%m": {
282
282
  format: function(t) {
283
- return n(t.month() || i.MIN_MONTH, 2);
283
+ return i(t.month() || r.MIN_MONTH, 2);
284
284
  },
285
285
  parse: function(t) {
286
- var r = Number(t);
287
- return { month: isNaN(r) ? e : r };
286
+ var s = Number(t);
287
+ return { month: isNaN(s) ? e : s };
288
288
  },
289
289
  minLength: 2,
290
290
  maxLength: 2,
@@ -292,11 +292,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
292
292
  },
293
293
  "%Y": {
294
294
  format: function(t) {
295
- return n(t.year() || i.MIN_YEAR, 4);
295
+ return i(t.year() || r.MIN_YEAR, 4);
296
296
  },
297
297
  parse: function(t) {
298
- var r = Number(t);
299
- return { year: isNaN(r) ? e : r };
298
+ var s = Number(t);
299
+ return { year: isNaN(s) ? e : s };
300
300
  },
301
301
  minLength: 4,
302
302
  maxLength: 4,
@@ -304,7 +304,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
304
304
  },
305
305
  "%w": {
306
306
  format: function(t) {
307
- return t.dayOfWeek() || i.MIN_DAY_OF_WEEK;
307
+ return t.dayOfWeek() || r.MIN_DAY_OF_WEEK;
308
308
  },
309
309
  parse: function() {
310
310
  return {};
@@ -315,8 +315,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
315
315
  },
316
316
  "%a": {
317
317
  format: function(t) {
318
- var r = t.dayOfWeek();
319
- return ct[r !== e ? r : i.MIN_DAY_OF_WEEK];
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 {};
@@ -327,8 +327,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
327
327
  },
328
328
  "%A": {
329
329
  format: function(t) {
330
- var r = t.dayOfWeek();
331
- return at[r !== e ? r : i.MIN_DAY_OF_WEEK];
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 {};
@@ -339,12 +339,12 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
339
339
  },
340
340
  "%b": {
341
341
  format: function(t) {
342
- var r = i.options("monthFromZero") ? t.month() : t.month() - 1;
343
- return dt[r !== e ? r : i.MIN_MONTH];
342
+ var s = r.options("monthFromZero") ? t.month() : t.month() - 1;
343
+ return St[s !== e ? s : r.MIN_MONTH];
344
344
  },
345
345
  parse: function(t) {
346
- var r = i.monthNames().indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
347
- return { month: r !== -1 ? r : e };
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,
@@ -352,12 +352,12 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
352
352
  },
353
353
  "%B": {
354
354
  format: function(t) {
355
- var r = i.options("monthFromZero") ? t.month() : t.month() - 1;
356
- return F[r !== e ? r : i.MIN_MONTH];
355
+ var s = r.options("monthFromZero") ? t.month() : t.month() - 1;
356
+ return P[s !== e ? s : r.MIN_MONTH];
357
357
  },
358
358
  parse: function(t) {
359
- var r = i.monthNames(!0).indexOf(t) + (i.options("monthFromZero") ? 0 : 1);
360
- return { month: r !== -1 ? r : e };
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,
@@ -365,11 +365,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
365
365
  },
366
366
  "%H": {
367
367
  format: function(t) {
368
- return n(t.hours() || i.MIN_HOURS, 2);
368
+ return i(t.hours() || r.MIN_HOURS, 2);
369
369
  },
370
370
  parse: function(t) {
371
- var r = Number(t);
372
- return { hours: isNaN(r) ? e : r };
371
+ var s = Number(t);
372
+ return { hours: isNaN(s) ? e : s };
373
373
  },
374
374
  minLength: 2,
375
375
  maxLength: 2,
@@ -377,11 +377,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
377
377
  },
378
378
  "%M": {
379
379
  format: function(t) {
380
- return n(t.minutes() || i.MIN_MINUTES, 2);
380
+ return i(t.minutes() || r.MIN_MINUTES, 2);
381
381
  },
382
382
  parse: function(t) {
383
- var r = Number(t);
384
- return { minutes: isNaN(r) ? e : r };
383
+ var s = Number(t);
384
+ return { minutes: isNaN(s) ? e : s };
385
385
  },
386
386
  minLength: 2,
387
387
  maxLength: 2,
@@ -389,11 +389,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
389
389
  },
390
390
  "%S": {
391
391
  format: function(t) {
392
- return n(t.seconds() || i.MIN_SECONDS, 2);
392
+ return i(t.seconds() || r.MIN_SECONDS, 2);
393
393
  },
394
394
  parse: function(t) {
395
- var r = Number(t);
396
- return { seconds: isNaN(r) ? e : r };
395
+ var s = Number(t);
396
+ return { seconds: isNaN(s) ? e : s };
397
397
  },
398
398
  minLength: 2,
399
399
  maxLength: 2,
@@ -404,7 +404,7 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
404
404
  return t.timestamp();
405
405
  },
406
406
  parse: function(t) {
407
- return isNaN(Number(t)) ? {} : i(Number(t)).get();
407
+ return isNaN(Number(t)) ? {} : r(Number(t)).get();
408
408
  },
409
409
  minLength: 1,
410
410
  maxLength: 20,
@@ -412,14 +412,14 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
412
412
  },
413
413
  "%F": {
414
414
  format: function(t) {
415
- return n(t.year() || i.MIN_YEAR, 4) + "-" + n(t.month() || i.MIN_MONTH, 2) + "-" + n(t.day() || i.MIN_DAY, 2);
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
417
  parse: function(t) {
418
- var r = Number(t.slice(0, 4)), h = Number(t.slice(5, 7)), c = Number(t.slice(8, 10));
418
+ var s = Number(t.slice(0, 4)), o = Number(t.slice(5, 7)), a = Number(t.slice(8, 10));
419
419
  return {
420
- year: r,
421
- month: h,
422
- day: c
420
+ year: s,
421
+ month: o,
422
+ day: a
423
423
  };
424
424
  },
425
425
  minLength: 10,
@@ -428,14 +428,14 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
428
428
  },
429
429
  "%D": {
430
430
  format: function(t) {
431
- return n(t.month() || i.MIN_MONTH, 2) + "/" + n(t.day() || i.MIN_DAY, 2) + "/" + n(t.year() || i.MIN_YEAR, 4);
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
433
  parse: function(t) {
434
- var r = Number(t.slice(0, 2)), h = Number(t.slice(3, 5)), c = Number(t.slice(6, 10));
434
+ var s = Number(t.slice(0, 2)), o = Number(t.slice(3, 5)), a = Number(t.slice(6, 10));
435
435
  return {
436
- year: c,
437
- month: r,
438
- day: h
436
+ year: a,
437
+ month: s,
438
+ day: o
439
439
  };
440
440
  },
441
441
  minLength: 10,
@@ -445,8 +445,8 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
445
445
  }, Mt = {
446
446
  useMilliseconds: !1,
447
447
  monthFromZero: !1
448
- }, g;
449
- g = function(t, r, h) {
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`) : r(JSON.pars
455
455
  minutes: !1,
456
456
  seconds: !1,
457
457
  milliseconds: !1
458
- }, t !== e && this.set(t, r, h), this;
459
- }, g.fn = g.prototype, g.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
- }, g.fn.year = function(t) {
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 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);
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
- }, g.fn.month = function(t) {
468
+ }, T.fn.month = function(t) {
469
469
  if (arguments.length !== 0)
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);
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 ? i.options("monthFromZero") ? this._d.getMonth() : this._d.getMonth() + 1 : this._i.month;
472
+ return this._i.month === !1 ? r.options("monthFromZero") ? this._d.getMonth() : this._d.getMonth() + 1 : this._i.month;
473
473
  return this;
474
- }, g.fn.day = function(t) {
474
+ }, T.fn.day = function(t) {
475
475
  if (arguments.length !== 0)
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);
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
- }, g.fn.hours = function(t) {
480
+ }, T.fn.hours = function(t) {
481
481
  if (arguments.length !== 0)
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);
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
- }, g.fn.minutes = function(t) {
486
+ }, T.fn.minutes = function(t) {
487
487
  if (arguments.length !== 0)
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);
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
- }, g.fn.seconds = function(t) {
492
+ }, T.fn.seconds = function(t) {
493
493
  if (arguments.length !== 0)
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);
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
- }, g.fn.milliseconds = function(t) {
498
+ }, T.fn.milliseconds = function(t) {
499
499
  if (arguments.length !== 0)
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);
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
- }, g.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
- }, g.fn.set = function(t, r, h) {
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,
@@ -518,11 +518,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
518
518
  if (t instanceof Date)
519
519
  return this._d = t, this;
520
520
  if (typeof t == "number")
521
- return this._d = new Date(t * (i.options("useMilliseconds") ? 1 : 1e3)), this;
522
- if (typeof t == "object" && (t instanceof Array ? (this.day(i.MIN_DAY), this.year(t[0]), this.month(t[1]), this.day(t[2]), this.hours(t[3]), this.minutes(t[4]), this.seconds(t[5]), this.milliseconds(t[6])) : (this.day(i.MIN_DAY), this.year(t.year), this.month(t.month), this.day(t.day), this.hours(t.hours), this.minutes(t.minutes), this.seconds(t.seconds), this.milliseconds(t.milliseconds))), typeof t == "string") {
523
- var c, M = [], T, R, j = [], D = 0, H = 0, L, w, p = {}, b;
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
524
  if (t === e)
525
- return T = l(this, h), T === e && (this._i = {
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`) : r(JSON.pars
530
530
  minutes: -1,
531
531
  seconds: -1,
532
532
  milliseconds: -1
533
- }), T;
534
- for (r === e && (r = i.detectFormat(t)); D < r.length; ) {
535
- if (r.charAt(D) === "%") {
536
- if (R = r.charAt(D) + r.charAt(D + 1), U[R] !== e) {
537
- switch (L = 0, w = "", U[R].type) {
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 (; L < U[R].maxLength && H + L < t.length && !isNaN(Number(t.charAt(H + L))); )
540
- w += t.charAt(H + L), L += 1;
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 (; L < U[R].maxLength && H + L < t.length && /^[\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(t.charAt(H + L)); )
544
- w += t.charAt(H + L), L += 1;
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 (; L < U[R].maxLength && H + L < t.length; )
548
- w += t.charAt(H + L), L += 1;
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 (L < U[R].minLength)
552
- return T = l(this, h), T === e && (this._i = {
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`) : r(JSON.pars
557
557
  minutes: -1,
558
558
  seconds: -1,
559
559
  milliseconds: -1
560
- }), T;
561
- M.push(R), j.push(w), L -= 1, H += L, D += 1;
560
+ }), E;
561
+ M.push(R), X.push(w), L -= 1, D += L, H += 1;
562
562
  }
563
- } else if (t.charAt(H) !== r.charAt(D))
564
- return T = l(this, h), T === e && (this._i = {
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,11 +569,11 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
569
569
  minutes: -1,
570
570
  seconds: -1,
571
571
  milliseconds: -1
572
- }), T;
573
- D += 1, H += 1;
572
+ }), E;
573
+ H += 1, D += 1;
574
574
  }
575
- for (c in M)
576
- M.hasOwnProperty(c) && U.hasOwnProperty(M[c]) && (b = U[M[c]].parse(j[c]), p = {
575
+ for (a in M)
576
+ M.hasOwnProperty(a) && I.hasOwnProperty(M[a]) && (b = I[M[a]].parse(X[a]), p = {
577
577
  year: b.year !== e ? b.year : p.year,
578
578
  month: b.month !== e ? b.month : p.month,
579
579
  day: b.day !== e ? b.day : p.day,
@@ -581,21 +581,21 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
581
581
  minutes: b.minutes !== e ? b.minutes : p.minutes,
582
582
  seconds: b.seconds !== e ? b.seconds : p.seconds
583
583
  });
584
- this.day(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);
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
- }, g.fn.leapYear = function() {
587
+ }, T.fn.leapYear = function() {
588
588
  var t = this.year();
589
589
  return t % 4 === 0 ? t % 100 === 0 ? t % 400 === 0 : !0 : !1;
590
- }, g.fn.timestamp = function(t) {
591
- return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3) + this._d.getTimezoneOffset() * 6e4), this) : i.options("useMilliseconds") ? this._d.getTime() - this._d.getTimezoneOffset() * 6e4 : Math.floor(this._d.getTime() / 1e3) - this._d.getTimezoneOffset() * 60;
592
- }, g.fn.utc = function(t) {
593
- return arguments.length !== 0 ? (this._d = new Date(Number(t) * (i.options("useMilliseconds") ? 1 : 1e3)), this) : i.options("useMilliseconds") ? this._d.getTime() : Math.floor(this._d.getTime() / 1e3);
594
- }, g.fn.dayOfWeek = function(t) {
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
595
  if (t === "long")
596
- return at[this._d.getDay()];
596
+ return ht[this._d.getDay()];
597
597
  if (t === "short")
598
- return ct[this._d.getDay()];
598
+ return at[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`) : r(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
- }, g.fn.timezone = function(t) {
615
+ }, T.fn.timezone = function(t) {
616
616
  switch (t) {
617
617
  case "hours":
618
618
  return Math.floor(this._d.getTimezoneOffset() / 60);
@@ -621,12 +621,12 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
621
621
  default:
622
622
  return this._d.getTimezoneOffset() * 60;
623
623
  }
624
- }, g.fn.get = function(t) {
624
+ }, T.fn.get = function(t) {
625
625
  switch (t) {
626
626
  case "Date":
627
627
  return new Date(
628
628
  this.year(),
629
- this.month() - (i.options("monthFromZero") ? 0 : 1),
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`) : r(JSON.pars
636
636
  case "DateUTC":
637
637
  return new Date(Date.UTC(
638
638
  this.year(),
639
- this.month() - (i.options("monthFromZero") ? 0 : 1),
639
+ this.month() - (r.options("monthFromZero") ? 0 : 1),
640
640
  this.day(),
641
641
  this.hours(),
642
642
  this.minutes(),
@@ -670,444 +670,455 @@ https://github.com/douglascrockford/JSON-js/blob/master/json2.js`) : r(JSON.pars
670
670
  timestamp: this.timestamp()
671
671
  };
672
672
  }
673
- }, g.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), U[c] !== e ? (h += U[c].format(this), r += 1) : h += "%") : h += t.charAt(r), r += 1;
676
- return h;
677
- }, g.fn.valid = function() {
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
+ return o;
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
- }, g.fn.errors = function() {
679
+ }, T.fn.errors = function() {
680
680
  return this._i;
681
- }, g.fn.between = function(t, r) {
682
- var h = this.timestamp(), c = t.timestamp();
683
- switch (r) {
681
+ }, T.fn.between = function(t, s) {
682
+ var o = this.timestamp(), a = t.timestamp();
683
+ switch (s) {
684
684
  case "year":
685
- return Math.floor((c - h) / 31556952);
685
+ return Math.floor((a - o) / 31556952);
686
686
  case "month":
687
- return Math.floor((c - h) / 2629746);
687
+ return Math.floor((a - o) / 2629746);
688
688
  case "day":
689
- return Math.floor((c - h) / 86400);
689
+ return Math.floor((a - o) / 86400);
690
690
  case "hours":
691
- return Math.floor((c - h) / 3600);
691
+ return Math.floor((a - o) / 3600);
692
692
  case "minutes":
693
- return Math.floor((c - h) / 60);
693
+ return Math.floor((a - o) / 60);
694
694
  case "seconds":
695
- return c - h;
695
+ return a - o;
696
696
  default:
697
697
  return e;
698
698
  }
699
- }, g.fn.calc = function(t) {
699
+ }, T.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, r, h) {
702
- return new g(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) {
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
704
  if (t === e)
705
705
  return Mt;
706
706
  if (Mt.hasOwnProperty(t)) {
707
- if (r === e)
707
+ if (s === e)
708
708
  return Mt[t];
709
- Mt[t] = r, t === "monthFromZero" && (i.MIN_MONTH = r ? 0 : 1, i.MAX_MONTH = r ? 11 : 12);
709
+ Mt[t] = s, t === "monthFromZero" && (r.MIN_MONTH = s ? 0 : 1, r.MAX_MONTH = s ? 11 : 12);
710
710
  }
711
711
  return e;
712
- }, i.noConflict = function() {
713
- return o.tempus = f, i;
714
- }, i.generate = function(t) {
715
- var r, h, c, M, T, R, j, D;
716
- if (typeof t.dateFrom != "number" && (t.dateFrom instanceof g ? r = t.dateFrom.utc() : r = i(t.dateFrom, t.formatFrom).utc()), typeof t.dateTo != "number" && (t.dateTo instanceof g ? h = t.dateTo.utc() : h = i(t.dateTo, t.formatTo !== e ? t.formatTo : t.formatFrom).utc()), typeof t.period == "number" ? T = {
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
722
  seconds: t.period
723
- } : typeof t.period == "string" ? T = {
723
+ } : typeof t.period == "string" ? E = {
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" && (T = {
730
+ } : typeof t.period == "object" && (E = {
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 ? R = t.asObject === !0 ? {} : [] : (R = [], R.push([]), j = i(r).get()[t.groupBy]), D = function(w, p, b) {
738
- return t.asObject === !0 ? t.format !== e ? w[i(p).format(t.format)] = {} : w[i(p).format("%F %H:%M:%S")] = {} : t.format !== e ? w.push(b ? null : i(p).format(t.format)) : w.push(b ? null : i(p)), w;
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
739
  }, t.groupBy !== e && t.fillNulls) {
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
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 (c = i(r).calc(H).utc(); i(c).get()[t.groupBy] === j; )
750
- D(R[R.length - 1], c, !0), c = i(c).calc(H).utc();
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
751
  if (t.groupBy === "week") {
752
- var L = i(r).dayOfWeek();
753
- for (c = i(r).dayOfWeek(0).utc(); R[0].length < L && c < r; )
754
- D(R[R.length - 1], c, !0), c = i(c).calc(T).utc();
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
- for (; r <= h; )
758
- t.groupBy === e ? D(R, r) : i(r).get()[t.groupBy] === j ? D(R[R.length - 1], r) : (R.push([]), D(R[R.length - 1], r), j = i(r).get()[t.groupBy]), r = i(r).calc(T).utc();
757
+ for (; s <= o; )
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
759
  if (t.groupBy !== e && t.fillNulls)
760
- for (M = i(h).calc(T).utc(); i(M).get()[t.groupBy] === j; )
761
- D(R[R.length - 1], M, !0), M = i(M).calc(T).utc();
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
762
  return R;
763
- }, i.monthNames = function(t) {
763
+ }, r.monthNames = function(t) {
764
764
  switch (t) {
765
765
  case "long":
766
- return F;
766
+ return P;
767
767
  default:
768
- return dt;
768
+ return St;
769
769
  }
770
- }, i.dayNames = function(t) {
770
+ }, r.dayNames = function(t) {
771
771
  switch (t) {
772
772
  case "long":
773
- return at;
773
+ return ht;
774
774
  default:
775
- return ct;
775
+ return at;
776
776
  }
777
- }, i.lang = function(t) {
777
+ }, r.lang = function(t) {
778
778
  if (t !== e)
779
- m = t, N[m] === e && (m = "en"), F = B(), dt = ht(), at = Z(), ct = W();
779
+ u = t, f[u] === e && (u = "en"), P = G(), St = ot(), ht = Z(), at = J();
780
780
  else
781
- return m;
781
+ return u;
782
782
  return e;
783
- }, i.availableLangs = function() {
784
- return Object.keys(N);
785
- }, i.registerFormat = function(t, r, h, c, M, T) {
786
- U[t] = {
787
- format: r,
788
- parse: h,
789
- minLength: c,
783
+ }, r.availableLangs = function() {
784
+ return Object.keys(f);
785
+ }, r.registerFormat = function(t, s, o, a, M, E) {
786
+ I[t] = {
787
+ format: s,
788
+ parse: o,
789
+ minLength: a,
790
790
  maxLength: M,
791
- type: T
791
+ type: E
792
792
  };
793
- }, i.unregisterFormat = function(t) {
794
- delete U[t];
795
- }, i.detectFormat = function(t) {
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 += u(t, c), r;
798
- }, S = {
799
- TempusDate: g
800
- }, i.classes = function(t, r) {
801
- if (r === e)
802
- return S[t];
803
- S[t] = r;
804
- }, i.loadTranslations = function(t) {
805
- typeof t == "object" ? N = t : typeof t == "string" && le(t, function(r) {
806
- N = r;
807
- }, function(r) {
793
+ }, r.unregisterFormat = function(t) {
794
+ delete I[t];
795
+ }, r.detectFormat = function(t) {
796
+ var s, o, a;
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
+ }, function(s) {
808
808
  });
809
- }, m = (d.language || d.systemLanguage || d.userLanguage || "en").substr(0, 2).toLowerCase(), N[m] === e && (m = "en"), F = B(), dt = ht(), at = Z(), ct = W(), A.exports && (s = A.exports = i), s.tempus = i;
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
810
  }).call(fe);
811
- })(Xt, Xt.exports);
812
- var _e = Xt.exports;
813
- const jt = /* @__PURE__ */ Ne(_e);
814
- var z, ut, K, Y, X, q, Q, I, x, Dt, v, P, $, 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, It, re, et, lt, ot, bt, gt, $t;
815
- class k {
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);
828
- _(this, nt);
829
- _(this, St);
830
- _(this, It);
831
- _(this, et);
832
- _(this, ot);
833
- _(this, gt);
834
- _(this, z, null);
835
- _(this, ut, null);
836
- _(this, K, []);
837
- _(this, Y, {});
838
- _(this, X, 50);
839
- _(this, q, !0);
840
- _(this, Q, null);
841
- _(this, I, null);
842
- _(this, x, null);
843
- _(this, Dt, 100);
844
- _(this, v, "no");
845
- _(this, P, !1);
846
- _(this, $, !1);
847
- _(this, tt, !1);
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
848
  C(this, "errors", {});
849
849
  C(this, "answerData", {});
850
- E(this, z, s), E(this, ut, e);
850
+ g(this, V, A), g(this, lt, e);
851
851
  }
852
852
  get serial() {
853
- return a(this, P);
853
+ return h(this, F);
854
854
  }
855
855
  setSerial() {
856
- E(this, P, !0), E(this, $, !0), E(this, tt, !1);
856
+ g(this, F, !0), g(this, $, !0), g(this, tt, !1);
857
857
  }
858
858
  setParallel() {
859
- E(this, P, !1), E(this, $, !1), E(this, tt, !0);
859
+ g(this, F, !1), g(this, $, !1), g(this, tt, !0);
860
860
  }
861
861
  stop() {
862
- E(this, q, !1);
862
+ g(this, K, !1);
863
863
  }
864
- async batch(s, e) {
865
- a(this, x) && O(this, mt, kt).call(this), e && E(this, Q, e), a(this, $) === !1 && E(this, P, !1), Object.keys(s).length > 500 && E(this, P, !0), E(this, q, !0), E(this, K, []), E(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((l, u) => O(this, _t, Zt).call(this, l, o[u]));
869
- return Promise.allSettled(n).then((l) => {
870
- let u = {};
871
- for (let y of l)
872
- y.status === "fulfilled" && (u = { ...u, ...y.value });
873
- return u;
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
+ let l = {};
871
+ for (let O of c)
872
+ O.status === "fulfilled" && (l = { ...l, ...O.value });
873
+ return l;
874
874
  });
875
875
  } else {
876
- let n = {}, l = 0, u = 1, y = Object.keys(s).length || 1, f = (i) => {
877
- l += Object.keys(i).length, u = Math.round(l / y * 100);
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 [i, S] of Object.entries(o)) {
880
- let d = await O(this, _t, Zt).call(this, S, o[i], !0);
881
- f(S), e && e({ percent: u }), n = { ...n, ...d };
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 n;
883
+ return i;
884
884
  }
885
885
  }
886
- async batchTotalCount(s, e) {
887
- E(this, Y, {}), this.errors = {};
888
- let o = 1, n = 0, l = Object.keys(s).length || 1, u = (f) => {
889
- n += Object.keys(f).length, o = Math.round(n / l * 100);
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
- 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((S) => (u(i), e && e({ percent: o }), S)));
895
- return Promise.allSettled(f).then((i) => {
896
- let S = {};
897
- for (let d of i)
898
- d.status === "fulfilled" && (S = { ...S, ...d.value });
899
- return S;
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 f = {};
903
- for (let i of y) {
904
- let S = await O(this, Ot, zt).call(this, i);
905
- u(i), e && e({ percent: o }), f = { ...f, ...S };
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 f;
907
+ return m;
908
908
  }
909
909
  }
910
910
  }
911
- z = new WeakMap(), ut = new WeakMap(), K = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), q = new WeakMap(), Q = new WeakMap(), I = new WeakMap(), x = new WeakMap(), Dt = new WeakMap(), v = new WeakMap(), P = new WeakMap(), $ = new WeakMap(), tt = new WeakMap(), it = new WeakSet(), Lt = function() {
912
- let s = 0;
913
- if (!a(this, I))
914
- return Math.round(s);
915
- let e = 0, o = 0;
916
- return Object.values(a(this, I)).forEach((n) => {
917
- const { total: l, count: u } = n;
918
- e += l ?? 0, o += u ?? 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, x)), E(this, x, ""), E(this, I, ""), E(this, Q, ""), E(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, l = O(this, ot, bt).call(this, e.total(), n);
924
- let u = 1;
925
- o && (u = n), a(this, Q) && (a(this, I) || E(this, I, {}), a(this, I)[s] && a(this, I)[s].count && (u += a(this, I)[s].count), a(this, I)[s] = { total: l, count: u }, a(this, x) || E(this, x, 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, I),
929
- percent: y,
930
- allCount: f,
931
- allTotal: i
932
- }), E(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, X)) {
937
- const l = o.slice(n, n + a(this, X));
938
- e.push(Object.fromEntries(l));
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
+ let l = 1;
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
+ percent: O,
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
940
  return e;
941
- }, _t = new WeakSet(), Zt = function(s, e, o) {
942
- return new Promise((n) => {
943
- const l = O(this, St, vt).call(this, e), u = [];
944
- let y = 0, f = 0;
945
- a(this, z).call(this, s, (i) => {
946
- Object.entries(i).forEach(([S, d]) => {
947
- let m = {};
948
- const N = d.error();
949
- if (N) {
950
- let { query: { method: W }, answer: F } = d;
951
- this.errors[S] = { error: N, method: W }, y += 1;
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 (d != null && d.answer && Object.keys(d.answer).length) {
954
- for (let [W, F] of Object.entries(d.answer))
955
- W != "result" && F && (m[W] = F);
956
- Object.keys(m).length && (this.answerData[S] = m);
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 B = O(this, et, lt).call(this, d.data()), ht = Array.isArray(B) ? B.length : 0, Z = O(this, ot, bt).call(this, d.total(), ht);
959
- if (Array.isArray(B) ? a(this, Y)[S] = B : typeof B == "object" && B !== null && Object.keys(B).length === 0 ? a(this, Y)[S] = [] : a(this, Y)[S] = B, f += Z, o || O(this, ft, xt).call(this, { key: S, value: d }), Z > a(this, X) && Z > ht) {
960
- const W = Math.ceil(Z / a(this, X)) - 1, F = Array.from({ length: W });
961
- u.push([S, l[S], F]);
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
- }), f > 5e3 && a(this, $) === !1 && a(this, tt) === !1 && E(this, P, !0), y > 0 && O(this, gt, $t).call(this), u.length ? (O(this, Ht, ee).call(this, u), O(this, Yt, se).call(this).then(() => n(O(this, nt, pt).call(this)))) : n(O(this, nt, pt).call(this));
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
- }, Ot = new WeakSet(), zt = function(s) {
966
+ }, _t = new WeakSet(), Vt = function(A) {
967
967
  return new Promise((e) => {
968
- const o = O(this, St, vt).call(this, s);
969
- let n = 0;
970
- a(this, z).call(this, o, (l) => {
971
- Object.entries(l).forEach(([u, y]) => {
972
- const f = y.error();
973
- f && (this.errors[u] = f, n += 1);
974
- const i = O(this, et, lt).call(this, y.data()), S = Array.isArray(i) ? i.length : 0, d = O(this, ot, bt).call(this, y.total(), S);
975
- a(this, Y)[u] = d;
976
- }), n > 0 && O(this, gt, $t).call(this), e(O(this, nt, pt).call(this));
968
+ const n = _(this, dt, vt).call(this, A);
969
+ let i = 0;
970
+ h(this, V).call(this, n, (c) => {
971
+ Object.entries(c).forEach(([l, O]) => {
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
- }, Ht = new WeakSet(), ee = function(s) {
979
+ }, Dt = new WeakSet(), ee = function(A) {
980
980
  let e = [];
981
- s.forEach(([o, n, l]) => {
982
- l.forEach((u, y) => {
983
- const f = y + 1, i = a(this, X) * f, d = [[o, f].join("_"), O(this, It, re).call(this, n, i)];
984
- e.length === a(this, X) ? (a(this, K).push(e), e = [d]) : e.push(d);
981
+ A.forEach(([n, i, c]) => {
982
+ c.forEach((l, O) => {
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
- }), e.length && a(this, K).push(e);
987
- }, Yt = new WeakSet(), se = function() {
988
- const s = [], e = [], o = (n) => {
989
- Object.entries(n).forEach(([l, u]) => {
990
- const [y] = l.split("_"), f = O(this, et, lt).call(this, u.data());
991
- Array.isArray(f) && a(this, Y)[y].push(...f), O(this, ft, xt).call(this, { key: y, value: u });
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 a(this, K).forEach((n, l) => {
995
- const u = Object.fromEntries(n), y = () => new Promise((f) => a(this, z).call(this, u, (i) => {
996
- a(this, P) ? o(i) : e[l] = i, f();
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
- s.push(y);
999
- }), a(this, P) ? O(this, At, qt).call(this, s) : O(this, Tt, Qt).call(this, s).then(() => {
1000
- e.forEach(o);
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
- }, yt = new WeakSet(), Kt = function() {
1003
- return new Promise((s) => setTimeout(s, 500));
1004
- }, At = new WeakSet(), qt = function(s) {
1005
- if (!s.length)
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 e = s.shift();
1007
+ const e = A.shift();
1008
1008
  return Promise.allSettled([
1009
1009
  e(),
1010
- O(this, yt, Kt).call(this)
1011
- ]).then(() => a(this, q) ? O(this, At, qt).call(this, s) : Promise.resolve());
1012
- }, Tt = new WeakSet(), Qt = function(s) {
1013
- if (!s.length)
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 e = s.shift();
1016
- return O(this, yt, Kt).call(this).then(() => e()).then(() => a(this, q) ? O(this, Tt, Qt).call(this, s) : Promise.resolve());
1017
- }, nt = new WeakSet(), pt = function() {
1018
- return Object.entries(a(this, ut)).forEach(([s, e]) => {
1019
- a(this, Y)[s] && (a(this, Y)[s] = e(a(this, Y)[s]));
1020
- }), a(this, Y);
1021
- }, St = new WeakSet(), vt = function(s) {
1022
- return Object.entries(s).reduce((e, [o, n]) => {
1023
- if (Array.isArray(n)) {
1024
- const [l, u = {}] = n;
1025
- e[o] = [l, u];
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: l, params: u = {} } = n;
1028
- e[o] = [l, u];
1027
+ const { method: c, params: l = {} } = i;
1028
+ e[n] = [c, l];
1029
1029
  }
1030
1030
  return e;
1031
1031
  }, {});
1032
- }, It = new WeakSet(), re = function(s, e) {
1033
- const [o, n] = s;
1034
- return [o, { start: e, ...n }];
1035
- }, et = new WeakSet(), lt = function(s) {
1036
- return ((s == null ? void 0 : s.items) || (s == null ? void 0 : s.documents)) ?? s;
1037
- }, ot = new WeakSet(), bt = function(s, e) {
1038
- return s !== s && (s = 0), s === 0 && e === 0 ? 0 : s || e;
1039
- }, gt = new WeakSet(), $t = function() {
1040
- console.group(`${this.constructor.name}: Ошибки в методах!`), Object.entries(this.errors).forEach(([s, e]) => {
1041
- console.info(`[${s}]`, e.toString());
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 st;
1045
- class Oe {
1044
+ var At;
1045
+ class re {
1046
1046
  constructor() {
1047
- _(this, st, {});
1047
+ N(this, At, {});
1048
1048
  }
1049
1049
  get hash() {
1050
1050
  return this.createHash(8);
1051
1051
  }
1052
1052
  /** Генератор хеш-кода */
1053
- createHash(s) {
1054
- let e = "abcdefghijklmnopqrstuvwxyz0123456789", o = "";
1055
- s = s || 6;
1056
- for (let n = 0; n < s; n++)
1057
- o += e.charAt(Math.floor(Math.random() * e.length));
1058
- return o;
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));
1058
+ return n;
1059
1059
  }
1060
1060
  /** Фильтр часто запускаемых действий */
1061
- actionFilter({ keyTimer: s, duration: e = 10, action: o }) {
1062
- a(this, st)[s] && (clearTimeout(a(this, st)[s]), a(this, st)[s] = null), o && (a(this, st)[s] = setTimeout(() => {
1063
- o();
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(() => {
1063
+ n();
1064
1064
  }, e));
1065
1065
  }
1066
+ /** Включение режима NO-SLEEP */
1067
+ noSleep() {
1068
+ let A = document.createElement("video");
1069
+ A.classList.add("no-sleep"), A.src = "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAAP5tZGF0AAAAAQYAAADlZYiEE28FmH9jNWDBjI+Z/1tIBZsjfhbmcNNUpBFej0U3p+zhaJ3eemJRL2LUMa5tkidy6bp+eatLE3jBIY864TvaAmqEFCgLMTCwVbem1n3myAw9yDXQdR5HfU/8iYf+eneVnRf7Qx9M70XDUuPx1MJX671XJwAE0VAMpnhbcUDx0pTldvUX9KQPhkZNH3eyZHmObkAeyEJ2tl+BEBJIGc90BiqKL60+5EA6fXB6iG5UU/M5KsW8BNAAUw5CbRJIqohNk10fwKbUXwya03rqGkE8+wuYGtEbrVYXb+iOl1mHHVPLYQbIAAcGyAAHAAAFNG1vb3YAAABsbXZoZAAAAAAAAAAAAAAAAAAAA+gAAAAvAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAIldHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAFAAAAA8AAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAAAAAAAAAAAAQAAAAABnW1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAQAAAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAUhtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEIc3RibAAAAKRzdHNkAAAAAAAAAAEAAACUYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAFAAPAASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAC5hdmNDAU1AC//hABZnTUAL2wUH7ARAAAADAEAAAAQDxQq4AQAFaOrAZXIAAAAQcGFzcAAAAAEAAAABAAAAGHN0dHMAAAAAAAAAAQAAAAEAAAAAAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAABRzdHN6AAAAAAAAAO4AAAABAAAAFHN0Y28AAAAAAAAAAQAAADAAAAIadHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAgAAAAAAAAAvAAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAAALwAAAAAAAQAAAAABkm1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAArEQAAAgAVcQAAAAAAC1oZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU291bmRIYW5kbGVyAAAAAT1taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAQFzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAAC7gAAAAViBYCAgAISCAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAACAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAgAAAAEAAAAUc3RzegAAAAAAAAAEAAAAAgAAABRzdGNvAAAAAAAAAAEAAAEeAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAIAAAABAAAAgXVkdGEAAAB5bWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWR0YQAAAAAAAAAAAAAAAAAAAAAfa2V5cwAAAAAAAAABAAAAD21kdGFlbmNvZGVyAAAALWlsc3QAAAAlAAAAAQAAAB1kYXRhAAAAAQAAAABMYXZmNTguMTIuMTAw", 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();
1076
+ }
1066
1077
  }
1067
- st = new WeakMap();
1068
- const Wt = new Oe();
1069
- var J, V, Ut, rt, Et, Gt, ie, Rt, te, Bt, ne, wt, oe, Ct, he;
1070
- class ye {
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 {
1071
1082
  constructor() {
1072
- _(this, Gt);
1083
+ N(this, Ut);
1073
1084
  /** Вывод ошибок логера
1074
1085
  * @param {'entity'} type - тип ошибки
1075
1086
  */
1076
- _(this, Rt);
1077
- _(this, Bt);
1078
- _(this, wt);
1079
- _(this, Ct);
1080
- _(this, J, "logger");
1081
- _(this, V, !1);
1082
- _(this, Ut, 2e3);
1083
- _(this, rt, /* @__PURE__ */ new Map());
1084
- _(this, Et, {});
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, {});
1085
1096
  /** Очистка хранилища элементов старше 'N' месяцев */
1086
1097
  C(this, "periodClear", 3);
1087
- O(this, Gt, ie).call(this);
1098
+ _(this, Ut, ie).call(this);
1088
1099
  }
1089
1100
  /** Инициализация логера */
1090
1101
  async init() {
1091
- let s = new k(BX24.callBatch), { entityList: e } = await s.batch({
1102
+ let A = new x(BX24.callBatch), { entityList: e } = await A.batch({
1092
1103
  entityList: { method: "entity.get" }
1093
1104
  });
1094
1105
  if (e != null && e.length)
1095
- if (e.find((n) => n.ENTITY == a(this, J)))
1096
- E(this, V, !0);
1106
+ if (e.find((i) => i.ENTITY == h(this, W)))
1107
+ g(this, Q, !0);
1097
1108
  else {
1098
- let { entityAdd: n } = await s.batch({
1109
+ let { entityAdd: i } = await A.batch({
1099
1110
  entityAdd: {
1100
1111
  method: "entity.add",
1101
1112
  params: {
1102
- ENTITY: a(this, J),
1103
- NAME: a(this, J),
1113
+ ENTITY: h(this, W),
1114
+ NAME: h(this, W),
1104
1115
  ACCESS: { AU: "X" }
1105
1116
  }
1106
1117
  }
1107
1118
  });
1108
- n && E(this, V, !0);
1119
+ i && g(this, Q, !0);
1109
1120
  }
1110
- return O(this, wt, oe).call(this), a(this, V);
1121
+ return _(this, wt, oe).call(this), h(this, Q);
1111
1122
  }
1112
1123
  /**
1113
1124
  * @param {{ type: 'call'|'batch'|'batch-total-count';
@@ -1118,21 +1129,21 @@ class ye {
1118
1129
  * }; }}
1119
1130
  * @returns {string}
1120
1131
  */
1121
- start({ type: s, data: e }) {
1122
- if (!a(this, V)) {
1123
- O(this, Rt, te).call(this, "entity");
1132
+ start({ type: A, data: e }) {
1133
+ if (!h(this, Q)) {
1134
+ _(this, Rt, te).call(this, "entity");
1124
1135
  return;
1125
1136
  }
1126
- const o = Wt.hash;
1127
- return a(this, rt).set(o, {
1128
- type: s,
1137
+ const n = Jt.hash;
1138
+ return h(this, st).set(n, {
1139
+ type: A,
1129
1140
  data: e,
1130
- userInfo: a(this, Et),
1141
+ userInfo: h(this, gt),
1131
1142
  errorList: [],
1132
1143
  status: "",
1133
1144
  answer: null,
1134
1145
  date: (/* @__PURE__ */ new Date()).getTime()
1135
- }), o;
1146
+ }), n;
1136
1147
  }
1137
1148
  /**
1138
1149
  * @param {{
@@ -1141,98 +1152,98 @@ class ye {
1141
1152
  * status: 'success'|'fail'|'fail-runtime',
1142
1153
  * answer: { [key]: unknown } }}
1143
1154
  */
1144
- stop({ key: s, errorList: e, status: o, answer: n }) {
1145
- if (!a(this, V)) {
1146
- O(this, Rt, te).call(this, "entity");
1155
+ stop({ key: A, errorList: e, status: n, answer: i }) {
1156
+ if (!h(this, Q)) {
1157
+ _(this, Rt, te).call(this, "entity");
1147
1158
  return;
1148
1159
  }
1149
- let l = a(this, rt).get(s);
1150
- e && (l.errorList = e), o && (l.status = o), n && (l.answer = n), Wt.actionFilter({
1160
+ let c = h(this, st).get(A);
1161
+ e && (c.errorList = e), n && (c.status = n), i && (c.answer = i), Jt.actionFilter({
1151
1162
  keyTimer: "add.entity.items",
1152
- duration: a(this, Ut),
1163
+ duration: h(this, It),
1153
1164
  action: () => {
1154
- O(this, Bt, ne).call(this);
1165
+ _(this, Gt, ne).call(this);
1155
1166
  }
1156
1167
  });
1157
1168
  }
1158
1169
  async getEntityList() {
1159
- let s = new k(BX24.callBatch), { entityList: e } = await s.batch({
1170
+ let A = new x(BX24.callBatch), { entityList: e } = await A.batch({
1160
1171
  entityList: {
1161
1172
  method: "entity.item.get",
1162
1173
  params: {
1163
- ENTITY: a(this, J),
1174
+ ENTITY: h(this, W),
1164
1175
  SORT: { ID: "DESC" }
1165
1176
  }
1166
1177
  }
1167
1178
  });
1168
- return e = e.map((o) => {
1169
- const { ID: n, DATE_CREATE: l, DETAIL_TEXT: u } = o;
1179
+ return e = e.map((n) => {
1180
+ const { ID: i, DATE_CREATE: c, DETAIL_TEXT: l } = n;
1170
1181
  return {
1171
- ...JSON.parse(u),
1172
- id: n,
1173
- dateCreate: l
1182
+ ...JSON.parse(l),
1183
+ id: i,
1184
+ dateCreate: c
1174
1185
  };
1175
1186
  }), e;
1176
1187
  }
1177
1188
  }
1178
- J = new WeakMap(), V = new WeakMap(), Ut = new WeakMap(), rt = new WeakMap(), Et = new WeakMap(), Gt = new WeakSet(), ie = async function() {
1179
- const s = new k(BX24.callBatch), e = BX24.isAdmin(), { curUser: o } = await s.batch({
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({
1180
1191
  curUser: { method: "user.current" }
1181
1192
  });
1182
- E(this, Et, { isAdmin: e, curUser: o });
1183
- }, Rt = new WeakSet(), te = function(s) {
1184
- s == "entity" && Wt.actionFilter({
1193
+ g(this, gt, { isAdmin: e, curUser: n });
1194
+ }, Rt = new WeakSet(), te = function(A) {
1195
+ A == "entity" && Jt.actionFilter({
1185
1196
  keyTimer: "error.logger.entity",
1186
1197
  duration: 500,
1187
1198
  action: () => {
1188
1199
  console.error("Хранилище для логгера не инициализировано");
1189
1200
  }
1190
1201
  });
1191
- }, Bt = new WeakSet(), ne = async function() {
1192
- let s = {}, e = new k(BX24.callBatch);
1193
- for (let [o, n] of a(this, rt).entries())
1194
- n.status && (s[o] = {
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] = {
1195
1206
  method: "entity.item.add",
1196
1207
  params: {
1197
- ENTITY: a(this, J),
1198
- NAME: a(this, J),
1199
- DETAIL_TEXT: JSON.stringify(n)
1208
+ ENTITY: h(this, W),
1209
+ NAME: h(this, W),
1210
+ DETAIL_TEXT: JSON.stringify(i)
1200
1211
  }
1201
1212
  });
1202
- if (Object.keys(s).length) {
1203
- let o = await e.batch(s), { errors: n } = e;
1204
- for (let [l, u] of Object.entries({ ...o, ...n }))
1205
- a(this, rt).delete(l);
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);
1206
1217
  }
1207
1218
  }, wt = new WeakSet(), oe = async function() {
1208
- let s = new k(BX24.callBatch), e = await this.getEntityList(), { serverTime: o } = await s.batch({
1219
+ let A = new x(BX24.callBatch), e = await this.getEntityList(), { serverTime: n } = await A.batch({
1209
1220
  serverTime: { method: "server.time" }
1210
- }), n = e.filter((l) => {
1211
- let { dateCreate: u } = l;
1212
- return jt(new Date(u)).between(jt(new Date(o)), "month") >= this.periodClear;
1221
+ }), i = e.filter((c) => {
1222
+ let { dateCreate: l } = c;
1223
+ return Xt(new Date(l)).between(Xt(new Date(n)), "month") >= this.periodClear;
1213
1224
  });
1214
- O(this, Ct, he).call(this, n);
1215
- }, Ct = new WeakSet(), he = async function(s) {
1216
- let e = new k(BX24.callBatch), o = s.map((n) => {
1217
- let { id: l } = n;
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;
1218
1229
  return {
1219
1230
  method: "entity.item.delete",
1220
1231
  params: {
1221
- ENTITY: a(this, J),
1222
- ID: l
1232
+ ENTITY: h(this, W),
1233
+ ID: c
1223
1234
  }
1224
1235
  };
1225
1236
  });
1226
- return await e.batch(o);
1237
+ return await e.batch(n);
1227
1238
  };
1228
- const G = new ye();
1229
- var Pt, ae, Ft, ce;
1230
- class Te {
1231
- constructor(s) {
1239
+ const U = new Oe();
1240
+ var Ft, ae, Pt, ce;
1241
+ class Ee {
1242
+ constructor(A) {
1232
1243
  /** Запрос данных о приложении */
1233
- _(this, Pt);
1244
+ N(this, Ft);
1234
1245
  /** Запрос данных о текущем пользователе */
1235
- _(this, Ft);
1246
+ N(this, Pt);
1236
1247
  C(this, "domain", "");
1237
1248
  C(this, "isAdmin", !1);
1238
1249
  C(this, "appInfo", null);
@@ -1240,24 +1251,24 @@ class Te {
1240
1251
  C(this, "userInfo", null);
1241
1252
  C(this, "placeData", null);
1242
1253
  C(this, "placeInfo", null);
1243
- this.appConst = s;
1254
+ this.appConst = A;
1244
1255
  }
1245
1256
  init() {
1246
- return new Promise((s) => {
1257
+ return new Promise((A) => {
1247
1258
  let e = setInterval(() => {
1248
1259
  window.BX24 && BX24.init(async () => {
1249
- console.info("init BX24"), clearInterval(e), this.domain = BX24.getDomain(), this.isAdmin = BX24.isAdmin(), this.placeInfo = BX24.placement.info(), await G.init();
1250
- const [o, n] = await Promise.all([
1251
- O(this, Pt, ae).call(this),
1252
- O(this, Ft, ce).call(this)
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)
1253
1264
  ]);
1254
- this.appInfo = o, this.userInfo = n, s(!0);
1265
+ this.appInfo = n, this.userInfo = i, new re().noSleep(), A(!0);
1255
1266
  });
1256
1267
  }, 100);
1257
1268
  });
1258
1269
  }
1259
- userOption(s, e) {
1260
- return e ? BX24.userOption.set(s, e) : BX24.userOption.get(s);
1270
+ userOption(A, e) {
1271
+ return e ? BX24.userOption.set(A, e) : BX24.userOption.get(A);
1261
1272
  }
1262
1273
  /**
1263
1274
  * @param {{
@@ -1271,32 +1282,32 @@ class Te {
1271
1282
  * }[]
1272
1283
  * }[]
1273
1284
  */
1274
- call({ method: s, params: e, updateList: o }) {
1275
- let n = G.start({
1285
+ call({ method: A, params: e, updateList: n }) {
1286
+ let i = U.start({
1276
1287
  type: "call",
1277
- data: { method: s, params: e, updateList: o }
1288
+ data: { method: A, params: e, updateList: n }
1278
1289
  });
1279
- return new Promise((l) => {
1280
- e || (e = {}), BX24.callMethod(s, e, function(u) {
1281
- let y = {};
1282
- if (u != null && u.answer)
1283
- for (let [f, i] of Object.entries(u.answer))
1284
- f != "result" && i && (y[f] = i);
1285
- if (u.error()) {
1286
- let f = u.error();
1287
- console.error(f), G.stop({
1288
- answer: y,
1289
- key: n,
1290
+ return new Promise((c) => {
1291
+ e || (e = {}), BX24.callMethod(A, e, function(l) {
1292
+ let O = {};
1293
+ if (l != null && l.answer)
1294
+ for (let [m, r] of Object.entries(l.answer))
1295
+ m != "result" && r && (O[m] = r);
1296
+ if (l.error()) {
1297
+ let m = l.error();
1298
+ console.error(m), U.stop({
1299
+ answer: O,
1300
+ key: i,
1290
1301
  status: "fail",
1291
- errorList: [f.toSting()]
1292
- }), l(!1);
1302
+ errorList: [m.toSting()]
1303
+ }), c(!1);
1293
1304
  } else {
1294
- let f = u.data();
1295
- f != null && f.items && (f = f.items), G.stop({
1296
- answer: y,
1297
- key: n,
1305
+ let m = l.data();
1306
+ m != null && m.items && (m = m.items), U.stop({
1307
+ answer: O,
1308
+ key: i,
1298
1309
  status: "success"
1299
- }), l(f);
1310
+ }), c(m);
1300
1311
  }
1301
1312
  });
1302
1313
  });
@@ -1312,116 +1323,116 @@ class Te {
1312
1323
  * }[]
1313
1324
  * }[] }}
1314
1325
  */
1315
- async batch(s, e, { updateList: o, errorCall: n } = {}) {
1316
- let l = new k(BX24.callBatch), u = G.start({
1326
+ async batch(A, e, { updateList: n, errorCall: i } = {}) {
1327
+ let c = new x(BX24.callBatch), l = U.start({
1317
1328
  type: "batch",
1318
- data: { commandList: s, updateList: o }
1329
+ data: { commandList: A, updateList: n }
1319
1330
  });
1320
1331
  try {
1321
- let y = await l.batch(s, e);
1322
- if (Object.keys(l.errors).length) {
1323
- let f = Object.entries(l.errors).map(([i, S]) => ({
1324
- key: i,
1325
- error: S.toSting()
1332
+ let O = await c.batch(A, e);
1333
+ if (Object.keys(c.errors).length) {
1334
+ let m = Object.entries(c.errors).map(([r, d]) => ({
1335
+ key: r,
1336
+ error: d.toSting()
1326
1337
  }));
1327
- n && n(l.errors), G.stop({
1328
- key: u,
1338
+ i && i(c.errors), U.stop({
1339
+ key: l,
1329
1340
  status: "fail",
1330
- errorList: f,
1331
- answer: l.answerData
1341
+ errorList: m,
1342
+ answer: c.answerData
1332
1343
  });
1333
1344
  } else
1334
- G.stop({
1335
- key: u,
1345
+ U.stop({
1346
+ key: l,
1336
1347
  status: "success",
1337
- answer: l.answerData
1348
+ answer: c.answerData
1338
1349
  });
1339
- return y;
1340
- } catch (y) {
1341
- return G.stop({
1342
- key: u,
1350
+ return O;
1351
+ } catch (O) {
1352
+ return U.stop({
1353
+ key: l,
1343
1354
  status: "fail-runtime",
1344
- errorList: [y.toSting()],
1345
- answer: l.answerData
1346
- }), console.error(y), !1;
1355
+ errorList: [O.toSting()],
1356
+ answer: c.answerData
1357
+ }), console.error(O), !1;
1347
1358
  }
1348
1359
  }
1349
1360
  /**
1350
1361
  * @param commandList - объект/массив команд
1351
1362
  * @param progressCall - callback(data), в data приходят данные о загрузке данных
1352
1363
  */
1353
- async batchTotalCount(s, e) {
1354
- let o = new k(BX24.callBatch), n = G.start({
1364
+ async batchTotalCount(A, e) {
1365
+ let n = new x(BX24.callBatch), i = U.start({
1355
1366
  type: "batch",
1356
- data: { commandList: s }
1367
+ data: { commandList: A }
1357
1368
  });
1358
1369
  try {
1359
- let l = await o.batchTotalCount(s, e);
1360
- if (Object.keys(o.errors).length) {
1361
- let u = Object.entries(o.errors).map(([y, f]) => ({
1362
- key: y,
1363
- error: f.toSting()
1370
+ let c = await n.batchTotalCount(A, e);
1371
+ if (Object.keys(n.errors).length) {
1372
+ let l = Object.entries(n.errors).map(([O, m]) => ({
1373
+ key: O,
1374
+ error: m.toSting()
1364
1375
  }));
1365
- G.stop({
1366
- key: n,
1376
+ U.stop({
1377
+ key: i,
1367
1378
  status: "fail",
1368
- errorList: u
1379
+ errorList: l
1369
1380
  });
1370
1381
  } else
1371
- G.stop({
1372
- key: n,
1382
+ U.stop({
1383
+ key: i,
1373
1384
  status: "success"
1374
1385
  });
1375
- return l;
1376
- } catch (l) {
1377
- return G.stop({
1378
- key: n,
1386
+ return c;
1387
+ } catch (c) {
1388
+ return U.stop({
1389
+ key: i,
1379
1390
  status: "fail",
1380
- errorList: [l.toSting()]
1381
- }), console.error(l), !1;
1391
+ errorList: [c.toSting()]
1392
+ }), console.error(c), !1;
1382
1393
  }
1383
1394
  }
1384
1395
  /** Запрос данных о местах встройки приложения */
1385
1396
  getPlacement() {
1386
- return this.call({ method: "placement.get" }).then((s) => (this.placeData || (this.placeData = s), s));
1397
+ return this.call({ method: "placement.get" }).then((A) => (this.placeData || (this.placeData = A), A));
1387
1398
  }
1388
1399
  /** Встройка приложения в place */
1389
- async placementBind(s) {
1400
+ async placementBind(A) {
1390
1401
  this.placeData || (this.placeData = await this.getPlacement());
1391
- const { appName: e, pathApp: o } = this.appConst, n = this.placeData.map((u) => u.placement);
1392
- let l = this.placeData.find((u) => u.placement == s);
1393
- n.includes(s) ? l.handler != o && (window.placementUnBind || (window.placementUnBind = {}), window.placementUnBind[s] || this.placementUnBind(l).then(() => {
1394
- window.placementUnBind[s] || (window.placementUnBind[s] = !0, this.placementBind(s));
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));
1395
1406
  })) : this.call({
1396
1407
  method: "placement.bind",
1397
1408
  params: {
1398
- PLACEMENT: s,
1399
- HANDLER: o,
1409
+ PLACEMENT: A,
1410
+ HANDLER: n,
1400
1411
  LANG_ALL: {
1401
1412
  ru: {
1402
1413
  TITLE: e
1403
1414
  }
1404
1415
  }
1405
1416
  }
1406
- }).then((u) => {
1407
- u ? console.info("Приложение успешно встроено в", s) : console.warn("Приложение не может быть встроено в", s);
1417
+ }).then((l) => {
1418
+ l ? console.info("Приложение успешно встроено в", A) : console.warn("Приложение не может быть встроено в", A);
1408
1419
  });
1409
1420
  }
1410
1421
  /** Отвязка встройки из place */
1411
- placementUnBind(s) {
1412
- const { pathApp: e, appName: o } = this.appConst;
1422
+ placementUnBind(A) {
1423
+ const { pathApp: e, appName: n } = this.appConst;
1413
1424
  return this.call({
1414
1425
  method: "placement.unbind",
1415
1426
  params: {
1416
- PLACEMENT: s,
1427
+ PLACEMENT: A,
1417
1428
  HANDLER: e,
1418
1429
  LANG_ALL: {
1419
1430
  ru: {
1420
- TITLE: o
1431
+ TITLE: n
1421
1432
  }
1422
1433
  }
1423
1434
  }
1424
- }).then((n) => (console.log("Встройка отвязана", s), n));
1435
+ }).then((i) => (console.log("Встройка отвязана", A), i));
1425
1436
  }
1426
1437
  /** Чат-бот */
1427
1438
  /* получение списка ботов */
@@ -1429,22 +1440,22 @@ class Te {
1429
1440
  return this.call({
1430
1441
  method: "imbot.bot.list",
1431
1442
  params: {}
1432
- }).then((s) => {
1433
- let e = Object.values(s);
1443
+ }).then((A) => {
1444
+ let e = Object.values(A);
1434
1445
  return console.log("chat-bot list:", e), e;
1435
1446
  });
1436
1447
  }
1437
1448
  /* регистрация бота */
1438
- regBot({ code: s, type: e, name: o }) {
1439
- const { appName: n, pathApp: l, chatBotLogo: u } = this.appConst, y = this.appInfo.ID;
1449
+ regBot({ code: A, type: e, name: n }) {
1450
+ const { appName: i, pathApp: c, chatBotLogo: l } = this.appConst, O = this.appInfo.ID;
1440
1451
  return this.call({
1441
1452
  method: "imbot.register",
1442
1453
  params: {
1443
- CODE: s ?? this.appInfo.CODE,
1454
+ CODE: A ?? this.appInfo.CODE,
1444
1455
  // Строковой идентификатор бота, уникальный в рамках вашего приложения (обяз.)
1445
1456
  TYPE: e ?? "O",
1446
1457
  // Тип бота, B - чат-бот, ответы поступают сразу, H - человек, ответы поступают с задержкой от 2-х до 10 секунд, O - чат-бот для Открытых линий, S - чат-бот с повышенными привилегиями (supervisor)
1447
- EVENT_HANDLER: l,
1458
+ EVENT_HANDLER: c,
1448
1459
  // Ссылка на обработчик событий, поступивших от сервера - см. Обработчики событий ниже (обяз).
1449
1460
  OPENLINE: "Y",
1450
1461
  // Включение режима поддержки Открытых линий, можно не указывать, если TYPE = 'O'
@@ -1452,7 +1463,7 @@ class Te {
1452
1463
  // строковый идентификатор чат-бота, используется только в режиме Вебхуков
1453
1464
  PROPERTIES: {
1454
1465
  // Личные данные чат-бота (обяз.)
1455
- NAME: `${o ?? n} - бот #${y}`,
1466
+ NAME: `${n ?? i} - бот #${O}`,
1456
1467
  // Имя чат-бота (обязательное одно из полей NAME или LAST_NAME)
1457
1468
  LAST_NAME: "",
1458
1469
  // Фамилия чат-бота (обязательное одно из полей NAME или LAST_NAME)
@@ -1460,7 +1471,7 @@ class Te {
1460
1471
  // Цвет чат-бота для мобильного приложения RED, GREEN, MINT, LIGHT_BLUE, DARK_BLUE, PURPLE, AQUA, PINK, LIME, BROWN, AZURE, KHAKI, SAND, MARENGO, GRAY, GRAPHITE
1461
1472
  EMAIL: "",
1462
1473
  // E-mail для связи. НЕЛЬЗЯ использовать e-mail, дублирующий e-mail реальных пользователей
1463
- PERSONAL_BIRTHDAY: jt().format("%Y-%m-%d"),
1474
+ PERSONAL_BIRTHDAY: Xt().format("%Y-%m-%d"),
1464
1475
  // День рождения в формате YYYY-mm-dd
1465
1476
  WORK_POSITION: "Почтальон",
1466
1477
  // Занимаемая должность, используется как описание чат-бота
@@ -1468,31 +1479,31 @@ class Te {
1468
1479
  // Ссылка на сайт
1469
1480
  PERSONAL_GENDER: "M",
1470
1481
  // Пол чат-бота, допустимые значения M - мужской, F - женский, пусто, если не требуется указывать
1471
- PERSONAL_PHOTO: u ?? ""
1482
+ PERSONAL_PHOTO: l ?? ""
1472
1483
  // Аватар чат-бота - base64
1473
1484
  }
1474
1485
  }
1475
- }).then((f) => (console.log("Чат-бот добавлен", f), f));
1486
+ }).then((m) => (console.log("Чат-бот добавлен", m), m));
1476
1487
  }
1477
1488
  /* Убрать регистрацию бота */
1478
- unRegBot(s) {
1489
+ unRegBot(A) {
1479
1490
  return this.call({
1480
1491
  method: "imbot.unregister",
1481
1492
  params: {
1482
- BOT_ID: s
1493
+ BOT_ID: A
1483
1494
  }
1484
1495
  }).then((e) => (console.log("чат-бот удален", e), e));
1485
1496
  }
1486
1497
  }
1487
- Pt = new WeakSet(), ae = function() {
1498
+ Ft = new WeakSet(), ae = function() {
1488
1499
  return this.call({ method: "app.info" });
1489
- }, Ft = new WeakSet(), ce = function() {
1500
+ }, Pt = new WeakSet(), ce = function() {
1490
1501
  return this.call({ method: "user.current" });
1491
1502
  };
1492
1503
  export {
1493
- k as Batch,
1494
- Te as BxBoot,
1495
- Oe as BxHelper,
1496
- ye as BxLogger,
1497
- jt as tempus
1504
+ x as Batch,
1505
+ Ee as BxBoot,
1506
+ re as BxHelper,
1507
+ Oe as BxLogger,
1508
+ Xt as tempus
1498
1509
  };