@dxtmisha/functional-basic 0.8.4 → 0.9.0
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/README.md +44 -790
- package/dist/library.d.ts +44 -43
- package/dist/library.js +787 -822
- package/package.json +29 -12
package/dist/library.js
CHANGED
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ut = (
|
|
3
|
-
var c = (
|
|
4
|
-
import { geo as
|
|
5
|
-
function C(
|
|
6
|
-
return t ? Object.assign({},
|
|
1
|
+
var jt = Object.defineProperty;
|
|
2
|
+
var Ut = (i, t, e) => t in i ? jt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var c = (i, t, e) => Ut(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { geo as Ht } from "@dxtmisha/media";
|
|
5
|
+
function C(i, t) {
|
|
6
|
+
return t ? Object.assign({}, i, t) : Object.assign({}, i);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return !!(
|
|
8
|
+
function f(i) {
|
|
9
|
+
return !!(i && typeof i == "object");
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
([r, o]) =>
|
|
16
|
-
), e ?
|
|
11
|
+
function d(i, t, e) {
|
|
12
|
+
if (f(i)) {
|
|
13
|
+
const s = [];
|
|
14
|
+
return i instanceof Map ? i.forEach((r, o) => s.push(t(r, o, i))) : Array.isArray(i) ? i.forEach((r, o) => s.push(t(r, o, i))) : Object.entries(i).forEach(
|
|
15
|
+
([r, o]) => s.push(t(o, r, i))
|
|
16
|
+
), e ? s : s.filter((r) => r !== void 0);
|
|
17
17
|
}
|
|
18
18
|
return [];
|
|
19
19
|
}
|
|
20
|
-
function It(
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
(
|
|
20
|
+
function It(i, t = "=", e = "&") {
|
|
21
|
+
return d(
|
|
22
|
+
i,
|
|
23
|
+
(s, r) => `${r}${t}${encodeURIComponent(String(s).trim())}`
|
|
24
24
|
).sort().join(e);
|
|
25
25
|
}
|
|
26
|
-
function at(
|
|
27
|
-
return Array.isArray(
|
|
26
|
+
function at(i) {
|
|
27
|
+
return Array.isArray(i);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function J(i) {
|
|
30
|
+
return i == null;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
if (t &&
|
|
32
|
+
function w(i, t) {
|
|
33
|
+
if (i) {
|
|
34
|
+
if (t && i === "0")
|
|
35
35
|
return !0;
|
|
36
|
-
switch (typeof
|
|
36
|
+
switch (typeof i) {
|
|
37
37
|
case "bigint":
|
|
38
38
|
case "number":
|
|
39
|
-
return
|
|
39
|
+
return i !== 0;
|
|
40
40
|
case "boolean":
|
|
41
|
-
return
|
|
41
|
+
return i;
|
|
42
42
|
case "function":
|
|
43
43
|
case "symbol":
|
|
44
44
|
return !0;
|
|
45
45
|
case "object":
|
|
46
|
-
return Array.isArray(
|
|
46
|
+
return Array.isArray(i) ? i.length > 0 : Object.values(i).some((e) => !J(e));
|
|
47
47
|
case "string":
|
|
48
|
-
return !["", "undefined", "null", "0", "false", "[]"].includes(
|
|
48
|
+
return !["", "undefined", "null", "0", "false", "[]"].includes(i);
|
|
49
49
|
case "undefined":
|
|
50
50
|
return !1;
|
|
51
51
|
default:
|
|
52
|
-
return !!
|
|
52
|
+
return !!i;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
return !1;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
57
|
+
function A(i) {
|
|
58
|
+
return f(i) && !Array.isArray(i);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return typeof
|
|
60
|
+
function R(i) {
|
|
61
|
+
return typeof i == "string";
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return JSON.parse(JSON.stringify(
|
|
63
|
+
function U(i) {
|
|
64
|
+
return JSON.parse(JSON.stringify(i));
|
|
65
65
|
}
|
|
66
66
|
function l() {
|
|
67
67
|
return typeof window != "undefined" && !!window.document;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
switch (typeof
|
|
69
|
+
function gt(i) {
|
|
70
|
+
switch (typeof i) {
|
|
71
71
|
case "number":
|
|
72
72
|
return !0;
|
|
73
73
|
case "string":
|
|
74
|
-
return !!
|
|
74
|
+
return !!i.match(/^-?[0-9]+(\.[0-9]+)?$/);
|
|
75
75
|
default:
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function k(
|
|
80
|
-
if (typeof
|
|
81
|
-
return
|
|
82
|
-
if (!
|
|
79
|
+
function k(i) {
|
|
80
|
+
if (typeof i == "number")
|
|
81
|
+
return i;
|
|
82
|
+
if (!i)
|
|
83
83
|
return 0;
|
|
84
|
-
let t =
|
|
84
|
+
let t = i.replace(/[^\d., ]+/ig, "");
|
|
85
85
|
return t.match(/( [0-9]{3}[ ,.]|[0-9] [0-9])/ig) ? t = t.replace(/ /ig, "").replace(/,/ig, ".") : t.match(/,[0-9]{3}[,.]/ig) ? t = t.replace(/,/ig, "") : t.match(/[.][0-9]{3}[,.]/ig) ? t = t.replace(/[.]/ig, "").replace(/,/ig, ".") : t = t.replace(/,/ig, "."), parseFloat(t);
|
|
86
86
|
}
|
|
87
|
-
function rt(
|
|
88
|
-
return
|
|
87
|
+
function rt(i, t) {
|
|
88
|
+
return J(i) ? !1 : Array.isArray(t) ? t.includes(i) : gt(i) && gt(t) ? k(i) === k(t) : i === t;
|
|
89
89
|
}
|
|
90
|
-
function ct(
|
|
91
|
-
return
|
|
90
|
+
function ct(i) {
|
|
91
|
+
return i instanceof Function || typeof i == "function";
|
|
92
92
|
}
|
|
93
|
-
function B(
|
|
94
|
-
return ct(
|
|
93
|
+
function B(i) {
|
|
94
|
+
return ct(i) ? i() : i;
|
|
95
95
|
}
|
|
96
96
|
function nt() {
|
|
97
97
|
return location.href.startsWith("data:");
|
|
98
98
|
}
|
|
99
99
|
const tt = {};
|
|
100
|
-
let
|
|
101
|
-
class
|
|
100
|
+
let dt = "ui-storage";
|
|
101
|
+
class T {
|
|
102
102
|
/**
|
|
103
103
|
* Constructor
|
|
104
104
|
* @param name value name/ название значения
|
|
@@ -108,10 +108,10 @@ class G {
|
|
|
108
108
|
c(this, "value");
|
|
109
109
|
c(this, "age");
|
|
110
110
|
this.name = t, this.isSession = e;
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
return tt[
|
|
114
|
-
this.make(), tt[
|
|
111
|
+
const s = `${e ? "session" : "storage"}#${t}`;
|
|
112
|
+
if (s in tt)
|
|
113
|
+
return tt[s];
|
|
114
|
+
this.make(), tt[s] = this;
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Changing the prefix in key names. Should be called at the beginning of the code.
|
|
@@ -120,7 +120,7 @@ class G {
|
|
|
120
120
|
* @param newPrefix new prefix/ новый префикс
|
|
121
121
|
*/
|
|
122
122
|
static setPrefix(t) {
|
|
123
|
-
|
|
123
|
+
dt = t;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* Getting data from local storage.
|
|
@@ -155,7 +155,7 @@ class G {
|
|
|
155
155
|
*/
|
|
156
156
|
remove() {
|
|
157
157
|
var t;
|
|
158
|
-
return (t = this.getMethod()) == null || t.removeItem(this.getIndex()), this;
|
|
158
|
+
return this.value = void 0, this.age = void 0, (t = this.getMethod()) == null || t.removeItem(this.getIndex()), this;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Clearing all data from storage.
|
|
@@ -172,7 +172,7 @@ class G {
|
|
|
172
172
|
* @param cache cache time/ время кэширования
|
|
173
173
|
*/
|
|
174
174
|
isCache(t) {
|
|
175
|
-
return
|
|
175
|
+
return J(t) || this.age && this.age + t * 1e3 >= (/* @__PURE__ */ new Date()).getTime();
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* Returns an object for working with storage.
|
|
@@ -192,7 +192,7 @@ class G {
|
|
|
192
192
|
* Получение имени ключа в хранилище.
|
|
193
193
|
*/
|
|
194
194
|
getIndex() {
|
|
195
|
-
return `${
|
|
195
|
+
return `${dt}__${this.name}`;
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* Getting data from storage.
|
|
@@ -205,8 +205,8 @@ class G {
|
|
|
205
205
|
if (t)
|
|
206
206
|
try {
|
|
207
207
|
return JSON.parse(t);
|
|
208
|
-
} catch (
|
|
209
|
-
console.error("DataStorage",
|
|
208
|
+
} catch (s) {
|
|
209
|
+
console.error("DataStorage", s);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
@@ -219,7 +219,7 @@ class G {
|
|
|
219
219
|
return t ? (this.value = t.value, this.age = t.age) : (this.value = void 0, this.age = void 0), this;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
const
|
|
222
|
+
const zt = "geo-code", b = class b {
|
|
223
223
|
/**
|
|
224
224
|
* Information about the current country.
|
|
225
225
|
*
|
|
@@ -284,7 +284,7 @@ const Ht = "geo-code", b = class b {
|
|
|
284
284
|
* Возвращает полный список стран.
|
|
285
285
|
*/
|
|
286
286
|
static getList() {
|
|
287
|
-
return
|
|
287
|
+
return Ht;
|
|
288
288
|
}
|
|
289
289
|
/**
|
|
290
290
|
* Returns the data about the country by its full code.
|
|
@@ -295,7 +295,7 @@ const Ht = "geo-code", b = class b {
|
|
|
295
295
|
*/
|
|
296
296
|
static getByCode(t) {
|
|
297
297
|
let e;
|
|
298
|
-
return t && (t.match(/([A-Z]{2}-[a-z]{2})|([a-z]{2}-[A-Z]{2})/) && (e = this.getByCodeFull(t)), !e && t.match(/[A-Z]{2}/) && (e = this.getByCountry(this.toCountry(t))), !e && t.match(/[a-z]{2}/) && (e = this.getByLanguage(this.toLanguage(t)))), this.toFull(
|
|
298
|
+
return t && (t.match(/([A-Z]{2}-[a-z]{2})|([a-z]{2}-[A-Z]{2})/) && (e = this.getByCodeFull(t)), !e && t.match(/[A-Z]{2}/) && (e = this.getByCountry(this.toCountry(t))), !e && t.match(/[a-z]{2}/) && (e = this.getByLanguage(this.toLanguage(t)))), this.toFull(U(e != null ? e : this.getList()[0]));
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
301
|
* Returns the full data by language and country.
|
|
@@ -319,8 +319,8 @@ const Ht = "geo-code", b = class b {
|
|
|
319
319
|
*/
|
|
320
320
|
static getByCountry(t) {
|
|
321
321
|
return this.getList().find((e) => {
|
|
322
|
-
var
|
|
323
|
-
return e.country === t || ((
|
|
322
|
+
var s;
|
|
323
|
+
return e.country === t || ((s = e == null ? void 0 : e.countryAlternative) == null ? void 0 : s.find((r) => r === t));
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
@@ -331,8 +331,8 @@ const Ht = "geo-code", b = class b {
|
|
|
331
331
|
*/
|
|
332
332
|
static getByLanguage(t) {
|
|
333
333
|
return this.getList().find((e) => {
|
|
334
|
-
var
|
|
335
|
-
return e.language === t || ((
|
|
334
|
+
var s;
|
|
335
|
+
return e.language === t || ((s = e == null ? void 0 : e.languageAlternative) == null ? void 0 : s.find((r) => r === t));
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
/**
|
|
@@ -441,25 +441,25 @@ const Ht = "geo-code", b = class b {
|
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
443
|
};
|
|
444
|
-
c(b, "storage", new
|
|
445
|
-
let
|
|
446
|
-
function
|
|
447
|
-
return l() &&
|
|
444
|
+
c(b, "storage", new T(zt)), c(b, "location"), c(b, "item"), c(b, "language"), c(b, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), b.location = b.findLocation(), b.language = b.findLanguage(b.location), b.item = b.getByCode(b.location);
|
|
445
|
+
let p = b;
|
|
446
|
+
function Ft(i) {
|
|
447
|
+
return l() && i === window;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function N(i) {
|
|
450
450
|
var t;
|
|
451
451
|
if (l())
|
|
452
|
-
return
|
|
452
|
+
return Ft(i) ? document.body : R(i) ? (t = document.querySelector(i)) != null ? t : void 0 : i;
|
|
453
453
|
}
|
|
454
|
-
function ft(
|
|
455
|
-
return
|
|
454
|
+
function ft(i) {
|
|
455
|
+
return Ft(i) ? i : N(i);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Zt(i) {
|
|
458
458
|
var t;
|
|
459
|
-
return !!((t =
|
|
459
|
+
return !!((t = N(i)) != null && t.closest("html"));
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
return Array.isArray(
|
|
461
|
+
function z(i) {
|
|
462
|
+
return Array.isArray(i) ? i : [i];
|
|
463
463
|
}
|
|
464
464
|
class mt {
|
|
465
465
|
/**
|
|
@@ -473,7 +473,7 @@ class mt {
|
|
|
473
473
|
* @param detail an event-dependent value associated with the event/ зависимое от события
|
|
474
474
|
* значение, связанное с событием
|
|
475
475
|
*/
|
|
476
|
-
constructor(t, e = ["click"],
|
|
476
|
+
constructor(t, e = ["click"], s, r, o) {
|
|
477
477
|
/**
|
|
478
478
|
* Element.
|
|
479
479
|
*
|
|
@@ -502,8 +502,8 @@ class mt {
|
|
|
502
502
|
* Это должен быть объект, реализующий интерфейс EventListener или просто функция JavaScript.
|
|
503
503
|
*/
|
|
504
504
|
c(this, "listenerRecent", (t) => {
|
|
505
|
-
var e,
|
|
506
|
-
|
|
505
|
+
var e, s;
|
|
506
|
+
Zt(this.elementControl) ? ((e = this.listener) == null || e.call(this.element, t, this.detail), f(this.options) && ((s = this.options) != null && s.once) && this.stop()) : this.stop();
|
|
507
507
|
});
|
|
508
508
|
/**
|
|
509
509
|
* Event states.
|
|
@@ -512,7 +512,7 @@ class mt {
|
|
|
512
512
|
*/
|
|
513
513
|
c(this, "activity", !1);
|
|
514
514
|
c(this, "activityItems", []);
|
|
515
|
-
this.listener =
|
|
515
|
+
this.listener = s, this.options = r, this.detail = o, this.element = ft(t), this.elementControl = N(t), this.type = z(e);
|
|
516
516
|
}
|
|
517
517
|
/**
|
|
518
518
|
* Checks whether event listening is currently enabled.
|
|
@@ -533,7 +533,7 @@ class mt {
|
|
|
533
533
|
*/
|
|
534
534
|
setElement(t) {
|
|
535
535
|
const e = ft(t);
|
|
536
|
-
return this.elementControlEdit || (this.elementControl =
|
|
536
|
+
return this.elementControlEdit || (this.elementControl = N(t)), this.element = e, this.reset(), this;
|
|
537
537
|
}
|
|
538
538
|
/**
|
|
539
539
|
* Modifies the object that receives the notification.
|
|
@@ -542,7 +542,7 @@ class mt {
|
|
|
542
542
|
* @param elementSelector element/ элемент
|
|
543
543
|
*/
|
|
544
544
|
setElementControl(t) {
|
|
545
|
-
return this.elementControl =
|
|
545
|
+
return this.elementControl = N(t), this.elementControlEdit = !J(this.elementControl), this.elementControlEdit || (this.elementControl = N(this.element)), this;
|
|
546
546
|
}
|
|
547
547
|
/**
|
|
548
548
|
* Changes the type of the handled event.
|
|
@@ -551,7 +551,7 @@ class mt {
|
|
|
551
551
|
* @param type type/ тип
|
|
552
552
|
*/
|
|
553
553
|
setType(t) {
|
|
554
|
-
return this.type =
|
|
554
|
+
return this.type = z(t), this.reset(), this;
|
|
555
555
|
}
|
|
556
556
|
/**
|
|
557
557
|
* Modifies the object that receives the notification.
|
|
@@ -592,8 +592,8 @@ class mt {
|
|
|
592
592
|
dispatch(t = this.detail) {
|
|
593
593
|
return this.type.forEach(
|
|
594
594
|
(e) => {
|
|
595
|
-
var
|
|
596
|
-
return (
|
|
595
|
+
var s;
|
|
596
|
+
return (s = this.element) == null ? void 0 : s.dispatchEvent(new CustomEvent(e, { detail: t }));
|
|
597
597
|
}
|
|
598
598
|
), this;
|
|
599
599
|
}
|
|
@@ -619,10 +619,10 @@ class mt {
|
|
|
619
619
|
return this.activity && (this.activity = !1, this.activityItems.forEach(({
|
|
620
620
|
element: t,
|
|
621
621
|
type: e,
|
|
622
|
-
listener:
|
|
622
|
+
listener: s,
|
|
623
623
|
observer: r
|
|
624
624
|
}) => {
|
|
625
|
-
r ? r.disconnect() :
|
|
625
|
+
r ? r.disconnect() : s ? t == null || t.removeEventListener(e, s) : t == null || t.removeEventListener(e, this.listenerRecent);
|
|
626
626
|
})), this;
|
|
627
627
|
}
|
|
628
628
|
/**
|
|
@@ -676,9 +676,9 @@ class mt {
|
|
|
676
676
|
makeScroll() {
|
|
677
677
|
if (this.element) {
|
|
678
678
|
let t = !1;
|
|
679
|
-
const e = (
|
|
679
|
+
const e = (s) => {
|
|
680
680
|
t || (t = !0, requestAnimationFrame(() => {
|
|
681
|
-
this.listenerRecent(
|
|
681
|
+
this.listenerRecent(s), t = !1;
|
|
682
682
|
}));
|
|
683
683
|
};
|
|
684
684
|
return this.element.addEventListener("scroll", e, this.options), this.element.addEventListener("resize", e, this.options), this.activityItems.push(
|
|
@@ -697,7 +697,7 @@ class mt {
|
|
|
697
697
|
return !1;
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
const yt = "ui-loading",
|
|
700
|
+
const yt = "ui-loading", K = class K {
|
|
701
701
|
/**
|
|
702
702
|
* Check if the loader is active now.
|
|
703
703
|
*
|
|
@@ -744,9 +744,9 @@ const yt = "ui-loading", Y = class Y {
|
|
|
744
744
|
(t = this.event) == null || t.dispatch({ loading: this.is() });
|
|
745
745
|
}
|
|
746
746
|
};
|
|
747
|
-
c(
|
|
748
|
-
let I =
|
|
749
|
-
class
|
|
747
|
+
c(K, "value", 0), c(K, "event"), l() && (K.event = new mt(window, yt));
|
|
748
|
+
let I = K;
|
|
749
|
+
class Vt {
|
|
750
750
|
constructor() {
|
|
751
751
|
/** Default headers/ Заголовки по умолчанию */
|
|
752
752
|
c(this, "headers", {});
|
|
@@ -760,11 +760,11 @@ class Zt {
|
|
|
760
760
|
*/
|
|
761
761
|
get(t, e = "application/json;charset=UTF-8") {
|
|
762
762
|
if (t !== null) {
|
|
763
|
-
const
|
|
763
|
+
const s = C(
|
|
764
764
|
this.headers,
|
|
765
765
|
t
|
|
766
766
|
);
|
|
767
|
-
return
|
|
767
|
+
return w(e) && (s["Content-Type"] = e), s;
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
770
|
/**
|
|
@@ -773,11 +773,11 @@ class Zt {
|
|
|
773
773
|
* Изменяет данные заголовка по умолчанию.
|
|
774
774
|
*/
|
|
775
775
|
set(t) {
|
|
776
|
-
return
|
|
776
|
+
return A(t) && (this.headers = t), this;
|
|
777
777
|
}
|
|
778
778
|
}
|
|
779
|
-
var L = /* @__PURE__ */ ((
|
|
780
|
-
class
|
|
779
|
+
var L = /* @__PURE__ */ ((i) => (i.get = "GET", i.post = "POST", i.put = "PUT", i.delete = "DELETE", i))(L || {});
|
|
780
|
+
class Kt {
|
|
781
781
|
constructor() {
|
|
782
782
|
/** Default request data/ Данные запроса по умолчанию */
|
|
783
783
|
c(this, "value");
|
|
@@ -809,7 +809,7 @@ class Vt {
|
|
|
809
809
|
if (e) {
|
|
810
810
|
if (t instanceof FormData)
|
|
811
811
|
this.addByFormData(t, e);
|
|
812
|
-
else if (
|
|
812
|
+
else if (A(t))
|
|
813
813
|
return C(e, t);
|
|
814
814
|
}
|
|
815
815
|
return t;
|
|
@@ -830,8 +830,8 @@ class Vt {
|
|
|
830
830
|
* @param value default values/ значения по умолчанию
|
|
831
831
|
*/
|
|
832
832
|
addByFormData(t, e) {
|
|
833
|
-
for (const
|
|
834
|
-
t.has(
|
|
833
|
+
for (const s in e)
|
|
834
|
+
t.has(s) || t.set(s, e[s]);
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
class $t {
|
|
@@ -938,7 +938,7 @@ class $t {
|
|
|
938
938
|
* @param response response data/ данные ответа
|
|
939
939
|
*/
|
|
940
940
|
setLastResponse(t) {
|
|
941
|
-
return t &&
|
|
941
|
+
return t && A(t) && ("message" in t && this.setLastMessage(String(t.message)), "status" in t && this.setLastStatus(String(t.status))), this.set({ lastResponse: t }), this;
|
|
942
942
|
}
|
|
943
943
|
/**
|
|
944
944
|
* Sets the last status.
|
|
@@ -969,15 +969,15 @@ class $t {
|
|
|
969
969
|
this.value || (this.value = {}), this.value[t] = e;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
|
-
async function
|
|
973
|
-
const t = B(
|
|
972
|
+
async function Yt(i) {
|
|
973
|
+
const t = B(i);
|
|
974
974
|
return t instanceof Promise ? await t : t;
|
|
975
975
|
}
|
|
976
|
-
function
|
|
977
|
-
return Math.floor(Math.random() * (t -
|
|
976
|
+
function q(i, t) {
|
|
977
|
+
return Math.floor(Math.random() * (t - i + 1) + i);
|
|
978
978
|
}
|
|
979
979
|
const pt = "d-response-loading";
|
|
980
|
-
class
|
|
980
|
+
class qt {
|
|
981
981
|
/**
|
|
982
982
|
* Constructor
|
|
983
983
|
* @param requestDefault default request processor/ процессор запросов по умолчанию
|
|
@@ -1002,8 +1002,8 @@ class Yt {
|
|
|
1002
1002
|
* @param request data for the request/ данные для запроса
|
|
1003
1003
|
* @param devMode is it developer mode/ является ли режим разработчика
|
|
1004
1004
|
*/
|
|
1005
|
-
get(t = "", e,
|
|
1006
|
-
return this.response.find((o) => !this.isDisable(o) && this.isPath(o, t) && e === o.method && this.isFirst(o, r) && this.isResponse(o,
|
|
1005
|
+
get(t = "", e, s, r) {
|
|
1006
|
+
return this.response.find((o) => !this.isDisable(o) && this.isPath(o, t) && e === o.method && this.isFirst(o, r) && this.isResponse(o, s) ? (this.isDevMode(r) && console.warn(`Response type: ${o.path}`), this.first.push(o), !0) : !1);
|
|
1007
1007
|
}
|
|
1008
1008
|
/**
|
|
1009
1009
|
* Returns a list of data about the emulator.
|
|
@@ -1020,7 +1020,7 @@ class Yt {
|
|
|
1020
1020
|
* @param response data for caching/ данные для кеширования
|
|
1021
1021
|
*/
|
|
1022
1022
|
add(t) {
|
|
1023
|
-
return this.response.push(...
|
|
1023
|
+
return this.response.push(...z(t)), this;
|
|
1024
1024
|
}
|
|
1025
1025
|
/**
|
|
1026
1026
|
* Sets developer mode.
|
|
@@ -1038,12 +1038,12 @@ class Yt {
|
|
|
1038
1038
|
async emulator(t) {
|
|
1039
1039
|
const {
|
|
1040
1040
|
path: e = "",
|
|
1041
|
-
method:
|
|
1042
|
-
global: r =
|
|
1041
|
+
method: s = L.get,
|
|
1042
|
+
global: r = s === L.get,
|
|
1043
1043
|
devMode: o = !1
|
|
1044
1044
|
} = t;
|
|
1045
1045
|
if (r || this.isDevMode(o)) {
|
|
1046
|
-
const a = this.requestDefault.request(t.request), u = this.get(e,
|
|
1046
|
+
const a = this.requestDefault.request(t.request), u = this.get(e, s, a, o);
|
|
1047
1047
|
if (u) {
|
|
1048
1048
|
const h = await this.fetch(u, a);
|
|
1049
1049
|
return this.isDevMode(o) && console.warn("Response data:", e, a, h), h;
|
|
@@ -1096,8 +1096,8 @@ class Yt {
|
|
|
1096
1096
|
* @param request request data/ данные запроса
|
|
1097
1097
|
*/
|
|
1098
1098
|
isResponse(t, e) {
|
|
1099
|
-
const
|
|
1100
|
-
return e ===
|
|
1099
|
+
const s = this.requestDefault.request(t == null ? void 0 : t.request);
|
|
1100
|
+
return e === s || s === "*any" || w(e) && w(s) && A(e) && A(s) && !(e instanceof FormData) && !(s instanceof FormData) && Object.values(e).length === Object.values(s).length && Object.entries(s).reduce(
|
|
1101
1101
|
(r, [o, a]) => r && (a === (e == null ? void 0 : e[o]) || a === "*any"),
|
|
1102
1102
|
!0
|
|
1103
1103
|
);
|
|
@@ -1110,13 +1110,13 @@ class Yt {
|
|
|
1110
1110
|
* @param request data for the request/ данные для запроса
|
|
1111
1111
|
*/
|
|
1112
1112
|
fetch(t, e) {
|
|
1113
|
-
return this.startResponseLoading(), new Promise((
|
|
1114
|
-
|
|
1113
|
+
return this.startResponseLoading(), new Promise((s) => {
|
|
1114
|
+
Yt(
|
|
1115
1115
|
ct(t.response) ? t.response(e) : t.response
|
|
1116
1116
|
).then((r) => {
|
|
1117
1117
|
t != null && t.lag ? (I.show(), setTimeout(() => {
|
|
1118
|
-
this.stopResponseLoading(),
|
|
1119
|
-
},
|
|
1118
|
+
this.stopResponseLoading(), s(r), I.hide();
|
|
1119
|
+
}, q(0, 2e3))) : (this.stopResponseLoading(), s(r));
|
|
1120
1120
|
});
|
|
1121
1121
|
});
|
|
1122
1122
|
}
|
|
@@ -1139,7 +1139,7 @@ class Yt {
|
|
|
1139
1139
|
}, 1200);
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
class
|
|
1142
|
+
class Jt {
|
|
1143
1143
|
constructor() {
|
|
1144
1144
|
/** Function for call before the request/ Функция для вызова перед запросом */
|
|
1145
1145
|
c(this, "callback");
|
|
@@ -1167,9 +1167,9 @@ class qt {
|
|
|
1167
1167
|
* @param query data received in the request/ данные, полученные в запросе
|
|
1168
1168
|
* @param apiFetch request options/ опции запроса
|
|
1169
1169
|
*/
|
|
1170
|
-
async makeEnd(t, e,
|
|
1170
|
+
async makeEnd(t, e, s) {
|
|
1171
1171
|
let r = {};
|
|
1172
|
-
return t && this.callbackEnd && (r = await this.callbackEnd(e,
|
|
1172
|
+
return t && this.callbackEnd && (r = await this.callbackEnd(e, s)), r;
|
|
1173
1173
|
}
|
|
1174
1174
|
/**
|
|
1175
1175
|
* The function is modified for a call before the request.
|
|
@@ -1210,8 +1210,8 @@ class qt {
|
|
|
1210
1210
|
* @param apiFetch request options/ опции запроса
|
|
1211
1211
|
*/
|
|
1212
1212
|
async end(t, e) {
|
|
1213
|
-
let
|
|
1214
|
-
return this.callbackEnd && (
|
|
1213
|
+
let s = {};
|
|
1214
|
+
return this.callbackEnd && (s = await this.callbackEnd(t, e)), s;
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
1217
|
const v = class v {
|
|
@@ -1247,7 +1247,7 @@ const v = class v {
|
|
|
1247
1247
|
* @param api adding a path to the site’s API/ добавление пути к API сайта
|
|
1248
1248
|
*/
|
|
1249
1249
|
static getUrl(t, e = !0) {
|
|
1250
|
-
return `${e ? this.url : ""}${t}`.replace("{locale}",
|
|
1250
|
+
return `${e ? this.url : ""}${t}`.replace("{locale}", p.getLocation()).replace("{country}", p.getCountry()).replace("{language}", p.getLanguage());
|
|
1251
1251
|
}
|
|
1252
1252
|
/**
|
|
1253
1253
|
* Getting data for the body.
|
|
@@ -1259,8 +1259,8 @@ const v = class v {
|
|
|
1259
1259
|
static getBody(t = {}, e = L.get) {
|
|
1260
1260
|
if (t instanceof FormData)
|
|
1261
1261
|
return t;
|
|
1262
|
-
if (e !== L.get &&
|
|
1263
|
-
return
|
|
1262
|
+
if (e !== L.get && w(t))
|
|
1263
|
+
return R(t) ? t : JSON.stringify(t);
|
|
1264
1264
|
}
|
|
1265
1265
|
/**
|
|
1266
1266
|
* Getting data for the body of the get method.
|
|
@@ -1270,10 +1270,10 @@ const v = class v {
|
|
|
1270
1270
|
* @param path path to request/ путь к запрос
|
|
1271
1271
|
* @param method method for request/ метод запрос
|
|
1272
1272
|
*/
|
|
1273
|
-
static getBodyForGet(t, e = "",
|
|
1274
|
-
if (
|
|
1273
|
+
static getBodyForGet(t, e = "", s = L.get) {
|
|
1274
|
+
if (s === L.get) {
|
|
1275
1275
|
const r = e.match(/\?/) ? "&" : "?", o = typeof t == "object" ? It(t) : t;
|
|
1276
|
-
if (
|
|
1276
|
+
if (w(o))
|
|
1277
1277
|
return `${r}${o}`;
|
|
1278
1278
|
}
|
|
1279
1279
|
return "";
|
|
@@ -1328,7 +1328,7 @@ const v = class v {
|
|
|
1328
1328
|
* @param pathRequest query string or list of parameters/ строка запроса или список параметров
|
|
1329
1329
|
*/
|
|
1330
1330
|
static async request(t) {
|
|
1331
|
-
return
|
|
1331
|
+
return R(t) ? await this.fetch({
|
|
1332
1332
|
path: t
|
|
1333
1333
|
}) : await this.fetch(t);
|
|
1334
1334
|
}
|
|
@@ -1385,7 +1385,7 @@ const v = class v {
|
|
|
1385
1385
|
static async fetch(t) {
|
|
1386
1386
|
const {
|
|
1387
1387
|
toData: e = !0,
|
|
1388
|
-
hideError:
|
|
1388
|
+
hideError: s = !1,
|
|
1389
1389
|
queryReturn: r = void 0,
|
|
1390
1390
|
globalPreparation: o = !0,
|
|
1391
1391
|
globalEnd: a = !0
|
|
@@ -1393,23 +1393,23 @@ const v = class v {
|
|
|
1393
1393
|
if (u)
|
|
1394
1394
|
return u;
|
|
1395
1395
|
const h = new $t();
|
|
1396
|
-
let
|
|
1396
|
+
let m;
|
|
1397
1397
|
I.show();
|
|
1398
1398
|
try {
|
|
1399
1399
|
await this.preparation.make(o, t);
|
|
1400
|
-
const
|
|
1401
|
-
if (h.setStatus(
|
|
1400
|
+
const g = await this.makeQuery(t), S = await this.preparation.makeEnd(a, g, t);
|
|
1401
|
+
if (h.setStatus(g.status, g.statusText), this.status.setStatus(g.status, g.statusText), S != null && S.reset)
|
|
1402
1402
|
return I.hide(), await this.fetch(t);
|
|
1403
|
-
|
|
1404
|
-
|
|
1403
|
+
m = await this.readData(
|
|
1404
|
+
g,
|
|
1405
1405
|
r,
|
|
1406
|
-
|
|
1406
|
+
S
|
|
1407
1407
|
);
|
|
1408
|
-
} catch (
|
|
1409
|
-
throw
|
|
1408
|
+
} catch (g) {
|
|
1409
|
+
throw s || console.error("Api: ", g), h.setError(String(g)), this.status.setError(String(g)), I.hide(), g;
|
|
1410
1410
|
}
|
|
1411
|
-
return I.hide(), h.setLastResponse(
|
|
1412
|
-
this.makeData(
|
|
1411
|
+
return I.hide(), h.setLastResponse(m), this.status.setLastResponse(m), this.makeStatus(
|
|
1412
|
+
this.makeData(m, e),
|
|
1413
1413
|
h
|
|
1414
1414
|
);
|
|
1415
1415
|
}
|
|
@@ -1421,9 +1421,9 @@ const v = class v {
|
|
|
1421
1421
|
* @param queryReturn custom function for reading data/ кастомная функция для чтения данных
|
|
1422
1422
|
* @param end finalization data/ данные финализации
|
|
1423
1423
|
*/
|
|
1424
|
-
static async readData(t, e,
|
|
1424
|
+
static async readData(t, e, s) {
|
|
1425
1425
|
var r;
|
|
1426
|
-
return e ? await e(t) : "data" in
|
|
1426
|
+
return e ? await e(t) : "data" in s ? s.data : ((r = t.headers.get("Content-Type")) != null ? r : "").match("application/json") ? await t.json() : { data: await t.text() };
|
|
1427
1427
|
}
|
|
1428
1428
|
/**
|
|
1429
1429
|
* Executing the request.
|
|
@@ -1433,19 +1433,19 @@ const v = class v {
|
|
|
1433
1433
|
*/
|
|
1434
1434
|
static async makeQuery(t) {
|
|
1435
1435
|
const e = this.requestDefault.request(t.request), {
|
|
1436
|
-
api:
|
|
1436
|
+
api: s = !0,
|
|
1437
1437
|
path: r = "",
|
|
1438
1438
|
pathFull: o = void 0,
|
|
1439
1439
|
method: a = L.get,
|
|
1440
1440
|
headers: u = {},
|
|
1441
1441
|
type: h = "application/json;charset=UTF-8",
|
|
1442
|
-
init:
|
|
1443
|
-
controller:
|
|
1444
|
-
} = t,
|
|
1442
|
+
init: m = {},
|
|
1443
|
+
controller: g = void 0
|
|
1444
|
+
} = t, S = o != null ? o : this.getUrl(r, s), G = `${S}${this.getBodyForGet(e, S, a)}`, Q = this.headers.get(u, h), Z = C(m, {
|
|
1445
1445
|
method: a,
|
|
1446
1446
|
body: this.getBody(e, a)
|
|
1447
1447
|
});
|
|
1448
|
-
return
|
|
1448
|
+
return Q && (Z.headers = Q), g && (Z.signal = g.signal), await fetch(G, Z);
|
|
1449
1449
|
}
|
|
1450
1450
|
/**
|
|
1451
1451
|
* Transforms data if needed.
|
|
@@ -1455,12 +1455,12 @@ const v = class v {
|
|
|
1455
1455
|
* @param toData is it necessary to process the data/ нужно ли обрабатывать данные
|
|
1456
1456
|
*/
|
|
1457
1457
|
static makeData(t, e) {
|
|
1458
|
-
if (!e || !t || !
|
|
1458
|
+
if (!e || !t || !A(t) || !("data" in t))
|
|
1459
1459
|
return t;
|
|
1460
1460
|
if (t.data !== null && typeof t.data != "object" || at(t.data))
|
|
1461
1461
|
return t.data;
|
|
1462
|
-
const
|
|
1463
|
-
return "success" in t && !("success" in
|
|
1462
|
+
const s = C(t.data);
|
|
1463
|
+
return "success" in t && !("success" in s) && (s.success = t.success), "status" in t && !("status" in s) && (s.status = t.status), "message" in t && !("message" in s) && (s.message = t.message), s;
|
|
1464
1464
|
}
|
|
1465
1465
|
/**
|
|
1466
1466
|
* Appends the status object to the response data if possible.
|
|
@@ -1470,21 +1470,22 @@ const v = class v {
|
|
|
1470
1470
|
* @param status status object/ объект статуса
|
|
1471
1471
|
*/
|
|
1472
1472
|
static makeStatus(t, e) {
|
|
1473
|
-
return t &&
|
|
1473
|
+
return t && A(t) ? {
|
|
1474
1474
|
...t,
|
|
1475
1475
|
statusObject: e.get()
|
|
1476
1476
|
} : t;
|
|
1477
1477
|
}
|
|
1478
1478
|
};
|
|
1479
|
-
c(v, "url", "/api/"), c(v, "headers", new
|
|
1480
|
-
let
|
|
1481
|
-
class
|
|
1479
|
+
c(v, "url", "/api/"), c(v, "headers", new Vt()), c(v, "requestDefault", new Kt()), c(v, "status", new $t()), c(v, "response", new qt(v.requestDefault)), c(v, "preparation", new Jt());
|
|
1480
|
+
let H = v;
|
|
1481
|
+
class Be {
|
|
1482
1482
|
/**
|
|
1483
1483
|
* Constructor
|
|
1484
1484
|
* @param name channel name/ название канала
|
|
1485
1485
|
* @param callback callback on message received/ колбэк на получение сообщения
|
|
1486
|
+
* @param callbackError callback on message error/ колбэк на ошибку сообщения
|
|
1486
1487
|
*/
|
|
1487
|
-
constructor(t, e) {
|
|
1488
|
+
constructor(t, e, s) {
|
|
1488
1489
|
c(this, "channel");
|
|
1489
1490
|
/**
|
|
1490
1491
|
* Update state on message received.
|
|
@@ -1496,13 +1497,32 @@ class Ee {
|
|
|
1496
1497
|
var e;
|
|
1497
1498
|
return (e = this.callback) == null || e.call(this, t), this;
|
|
1498
1499
|
});
|
|
1499
|
-
|
|
1500
|
+
/**
|
|
1501
|
+
* Update error state on message error.
|
|
1502
|
+
*
|
|
1503
|
+
* Обновление состояния ошибки при получении ошибки сообщения.
|
|
1504
|
+
* @param event message error event/ событие ошибки сообщения
|
|
1505
|
+
*/
|
|
1506
|
+
c(this, "updateError", (t) => {
|
|
1507
|
+
var e;
|
|
1508
|
+
return (e = this.callbackError) == null || e.call(this, t), this;
|
|
1509
|
+
});
|
|
1510
|
+
if (this.callback = e, this.callbackError = s, l())
|
|
1500
1511
|
try {
|
|
1501
|
-
this.channel = new BroadcastChannel(`${
|
|
1502
|
-
} catch (
|
|
1503
|
-
console.error(`BroadcastMessage ${t}:`,
|
|
1512
|
+
this.channel = new BroadcastChannel(`${Mt()}__${t}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
|
|
1513
|
+
} catch (r) {
|
|
1514
|
+
console.error(`BroadcastMessage ${t}:`, r);
|
|
1504
1515
|
}
|
|
1505
1516
|
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Get the channel.
|
|
1519
|
+
*
|
|
1520
|
+
* Получить канал.
|
|
1521
|
+
* @returns channel/ канал
|
|
1522
|
+
*/
|
|
1523
|
+
getChannel() {
|
|
1524
|
+
return this.channel;
|
|
1525
|
+
}
|
|
1506
1526
|
/**
|
|
1507
1527
|
* Send a message to the channel.
|
|
1508
1528
|
*
|
|
@@ -1522,9 +1542,18 @@ class Ee {
|
|
|
1522
1542
|
setCallback(t) {
|
|
1523
1543
|
return this.callback = t, this;
|
|
1524
1544
|
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Set the callback function to be called when a message error occurs.
|
|
1547
|
+
*
|
|
1548
|
+
* Установить функцию колбэка, которая будет вызвана при возникновении ошибки сообщения.
|
|
1549
|
+
* @param callbackError callback function/ функция колбэка
|
|
1550
|
+
*/
|
|
1551
|
+
setCallbackError(t) {
|
|
1552
|
+
return this.callbackError = t, this;
|
|
1553
|
+
}
|
|
1525
1554
|
}
|
|
1526
|
-
const
|
|
1527
|
-
class
|
|
1555
|
+
const Mt = () => new T("__broadcast-name").get(() => `name_${q(1e6, 9999999)}`);
|
|
1556
|
+
class Qt {
|
|
1528
1557
|
/**
|
|
1529
1558
|
* Constructor
|
|
1530
1559
|
* @param callback function for the cache/ функция для кэша
|
|
@@ -1584,10 +1613,10 @@ class Mt {
|
|
|
1584
1613
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1585
1614
|
*/
|
|
1586
1615
|
isUpdate(t) {
|
|
1587
|
-
return this.cache === void 0 || this.comparisons.length !== t.length || this.comparisons.findIndex((e,
|
|
1616
|
+
return this.cache === void 0 || this.comparisons.length !== t.length || this.comparisons.findIndex((e, s) => e !== t[s]) >= 0 ? (this.comparisons = [...t], !0) : !1;
|
|
1588
1617
|
}
|
|
1589
1618
|
}
|
|
1590
|
-
class
|
|
1619
|
+
class Xt {
|
|
1591
1620
|
constructor() {
|
|
1592
1621
|
c(this, "cache", {});
|
|
1593
1622
|
}
|
|
@@ -1599,8 +1628,8 @@ class Qt {
|
|
|
1599
1628
|
* @param callback function for the cache/ функция для кэша
|
|
1600
1629
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1601
1630
|
*/
|
|
1602
|
-
get(t, e,
|
|
1603
|
-
return this.getCacheItem(t, e).getCache(
|
|
1631
|
+
get(t, e, s) {
|
|
1632
|
+
return this.getCacheItem(t, e).getCache(s != null ? s : []);
|
|
1604
1633
|
}
|
|
1605
1634
|
/**
|
|
1606
1635
|
* Getting data for the cache, and if there is no cache, it performs a function to save the cache (Async).
|
|
@@ -1610,8 +1639,8 @@ class Qt {
|
|
|
1610
1639
|
* @param callback function for the cache/ функция для кэша
|
|
1611
1640
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1612
1641
|
*/
|
|
1613
|
-
async getAsync(t, e,
|
|
1614
|
-
return await this.getCacheItem(t, e).getCacheAsync(
|
|
1642
|
+
async getAsync(t, e, s) {
|
|
1643
|
+
return await this.getCacheItem(t, e).getCacheAsync(s != null ? s : []);
|
|
1615
1644
|
}
|
|
1616
1645
|
/**
|
|
1617
1646
|
* Returns an instance of the object for working with the cache element.
|
|
@@ -1621,10 +1650,10 @@ class Qt {
|
|
|
1621
1650
|
* @param callback function for the cache/ функция для кэша
|
|
1622
1651
|
*/
|
|
1623
1652
|
getCacheItem(t, e) {
|
|
1624
|
-
return t in this.cache || (this.cache[t] = new
|
|
1653
|
+
return t in this.cache || (this.cache[t] = new Qt(e)), this.cache[t];
|
|
1625
1654
|
}
|
|
1626
1655
|
}
|
|
1627
|
-
const
|
|
1656
|
+
const O = class O {
|
|
1628
1657
|
/**
|
|
1629
1658
|
* Getting data for the cache, and if there is no cache, it performs a function to save the cache.
|
|
1630
1659
|
*
|
|
@@ -1633,15 +1662,15 @@ const T = class T {
|
|
|
1633
1662
|
* @param callback function for the cache/ функция для кэша
|
|
1634
1663
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1635
1664
|
*/
|
|
1636
|
-
static get(t, e,
|
|
1637
|
-
return this.cache.get(t, e,
|
|
1665
|
+
static get(t, e, s) {
|
|
1666
|
+
return this.cache.get(t, e, s);
|
|
1638
1667
|
}
|
|
1639
1668
|
};
|
|
1640
|
-
c(
|
|
1641
|
-
let
|
|
1642
|
-
function
|
|
1643
|
-
if (typeof
|
|
1644
|
-
const e =
|
|
1669
|
+
c(O, "cache"), O.cache = new Xt();
|
|
1670
|
+
let bt = O;
|
|
1671
|
+
function xt(i, t = !1) {
|
|
1672
|
+
if (typeof i == "string") {
|
|
1673
|
+
const e = i.trim();
|
|
1645
1674
|
switch (e) {
|
|
1646
1675
|
case "undefined":
|
|
1647
1676
|
return;
|
|
@@ -1655,8 +1684,8 @@ function Ft(s, t = !1) {
|
|
|
1655
1684
|
if (/^[{[]/.exec(e))
|
|
1656
1685
|
try {
|
|
1657
1686
|
return JSON.parse(e);
|
|
1658
|
-
} catch (
|
|
1659
|
-
console.error("transformation: JSON error",
|
|
1687
|
+
} catch (s) {
|
|
1688
|
+
console.error("transformation: JSON error", s);
|
|
1660
1689
|
}
|
|
1661
1690
|
else {
|
|
1662
1691
|
if (/^[0-9]+\.[0-9.]+$/.exec(e))
|
|
@@ -1668,9 +1697,9 @@ function Ft(s, t = !1) {
|
|
|
1668
1697
|
}
|
|
1669
1698
|
}
|
|
1670
1699
|
}
|
|
1671
|
-
return
|
|
1700
|
+
return i;
|
|
1672
1701
|
}
|
|
1673
|
-
const
|
|
1702
|
+
const _t = "cookie-block";
|
|
1674
1703
|
class Rt {
|
|
1675
1704
|
/**
|
|
1676
1705
|
* Obtaining status.
|
|
@@ -1691,14 +1720,14 @@ class Rt {
|
|
|
1691
1720
|
this.storage.set(t);
|
|
1692
1721
|
}
|
|
1693
1722
|
}
|
|
1694
|
-
c(Rt, "storage", new
|
|
1695
|
-
const
|
|
1723
|
+
c(Rt, "storage", new T(_t));
|
|
1724
|
+
const X = {}, lt = class lt {
|
|
1696
1725
|
constructor(t) {
|
|
1697
1726
|
c(this, "value");
|
|
1698
1727
|
c(this, "options", {});
|
|
1699
1728
|
if (this.name = t, t in et)
|
|
1700
1729
|
return et[t];
|
|
1701
|
-
this.value =
|
|
1730
|
+
this.value = X == null ? void 0 : X[t], et[t] = this;
|
|
1702
1731
|
}
|
|
1703
1732
|
/**
|
|
1704
1733
|
* Get data or update if none.
|
|
@@ -1743,13 +1772,13 @@ const _ = {}, lt = class lt {
|
|
|
1743
1772
|
* Обновление данных cookie.
|
|
1744
1773
|
*/
|
|
1745
1774
|
update() {
|
|
1746
|
-
var t, e,
|
|
1775
|
+
var t, e, s, r, o;
|
|
1747
1776
|
if (l() && !nt() && !Rt.get()) {
|
|
1748
1777
|
const a = String((t = this.value) != null ? t : "");
|
|
1749
1778
|
document.cookie = [
|
|
1750
1779
|
`${encodeURIComponent(this.name)}=${encodeURIComponent(a)}`,
|
|
1751
1780
|
`max-age=${a === "" ? "-1" : this.getAge()}`,
|
|
1752
|
-
`SameSite=${(
|
|
1781
|
+
`SameSite=${(s = (e = this.options) == null ? void 0 : e.sameSite) != null ? s : "strict"}`,
|
|
1753
1782
|
...(o = (r = this.options) == null ? void 0 : r.arguments) != null ? o : []
|
|
1754
1783
|
].join("; ");
|
|
1755
1784
|
}
|
|
@@ -1761,43 +1790,43 @@ const _ = {}, lt = class lt {
|
|
|
1761
1790
|
*/
|
|
1762
1791
|
static updateData() {
|
|
1763
1792
|
for (const t of document.cookie.split(";")) {
|
|
1764
|
-
const [e,
|
|
1765
|
-
e &&
|
|
1793
|
+
const [e, s] = t.trim().split("=");
|
|
1794
|
+
e && w(s) && (X[e] = xt(s));
|
|
1766
1795
|
}
|
|
1767
1796
|
}
|
|
1768
1797
|
};
|
|
1769
1798
|
l() && !nt() && lt.updateData();
|
|
1770
|
-
let
|
|
1799
|
+
let wt = lt;
|
|
1771
1800
|
const et = {};
|
|
1772
|
-
function F(
|
|
1773
|
-
var r, o, a, u, h,
|
|
1774
|
-
if (
|
|
1775
|
-
return
|
|
1776
|
-
if (
|
|
1801
|
+
function F(i) {
|
|
1802
|
+
var r, o, a, u, h, m, g, S;
|
|
1803
|
+
if (i instanceof Date)
|
|
1804
|
+
return i;
|
|
1805
|
+
if (J(i))
|
|
1777
1806
|
return /* @__PURE__ */ new Date();
|
|
1778
|
-
if (typeof
|
|
1779
|
-
return new Date(
|
|
1780
|
-
let t =
|
|
1781
|
-
|
|
1782
|
-
const
|
|
1783
|
-
return /* @__PURE__ */ new Date(`${
|
|
1807
|
+
if (typeof i == "number")
|
|
1808
|
+
return new Date(i);
|
|
1809
|
+
let t = i, e = p.getTimezoneFormat().trim();
|
|
1810
|
+
i.replace(/^([\s\S]+)([-+]\d{2}:?\d{2})$/, (G, Q, Z) => (t = Q, e = Z.trim(), G));
|
|
1811
|
+
const s = (S = (g = (m = (h = (u = (a = (o = (r = /^\d{4}\d{2}\d{2}$/.exec(t) && `${t.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3")}T00:00:00`) != null ? r : /^\d{4}\d{2}$/.exec(t) && `${t.replace(/^(\d{4})(\d{2})$/, "$1-$2")}-01T00:00:00`) != null ? o : /^\d{4}\d{2}\d{2} \d{2}:\d{2}:\d{2}$/.exec(t) && t.replace(/^(\d{4})(\d{2})(\d{2}) (\d{2}):(\d{2}):(\d{2})$/, "$1-$2-$3T$4:$5:$6")) != null ? a : /^\d{4}-\d{2}-\d{2}$/.exec(t) && `${t}T00:00:00`) != null ? u : /^\d{4}-\d{2}$/.exec(t) && `${t}-01T00:00:00`) != null ? h : /^\d{4}$/.exec(t) && `${t}-01-01T00:00:00`) != null ? m : /^\d{2}:\d{2}$/.exec(t) && `2000-01-01T${t}:00`) != null ? g : /^\d{2}:\d{2}:\d{2}$/.exec(t) && `2000-01-01T${t}`) != null ? S : t.replace(" ", "T");
|
|
1812
|
+
return /* @__PURE__ */ new Date(`${s.trim()}${e}`);
|
|
1784
1813
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return
|
|
1814
|
+
function Ot(i, t) {
|
|
1815
|
+
return d(i, (e) => e == null ? void 0 : e[t], !0);
|
|
1787
1816
|
}
|
|
1788
|
-
class
|
|
1817
|
+
class M {
|
|
1789
1818
|
/**
|
|
1790
1819
|
* Constructor
|
|
1791
1820
|
* @param code country code, full form language-country or one of them/
|
|
1792
1821
|
* код страны, полный вид язык-страна или один из них
|
|
1793
1822
|
*/
|
|
1794
|
-
constructor(t =
|
|
1823
|
+
constructor(t = p.getLocation()) {
|
|
1795
1824
|
c(this, "geo");
|
|
1796
|
-
this.geo =
|
|
1825
|
+
this.geo = p.find(t);
|
|
1797
1826
|
const e = this.getLocation();
|
|
1798
|
-
if (e in
|
|
1799
|
-
return
|
|
1800
|
-
|
|
1827
|
+
if (e in it)
|
|
1828
|
+
return it[e];
|
|
1829
|
+
it[e] = this;
|
|
1801
1830
|
}
|
|
1802
1831
|
/**
|
|
1803
1832
|
* Returns an instance of the class according to the specified country code.
|
|
@@ -1806,8 +1835,8 @@ class Q {
|
|
|
1806
1835
|
* @param code country code, full form language-country or one of them/
|
|
1807
1836
|
* код страны, полный вид язык-страна или один из них
|
|
1808
1837
|
*/
|
|
1809
|
-
static getInstance(t =
|
|
1810
|
-
return new
|
|
1838
|
+
static getInstance(t = p.getLocation()) {
|
|
1839
|
+
return new M(t);
|
|
1811
1840
|
}
|
|
1812
1841
|
/**
|
|
1813
1842
|
* Returns country code and language.
|
|
@@ -1835,13 +1864,13 @@ class Q {
|
|
|
1835
1864
|
*/
|
|
1836
1865
|
display(t, e) {
|
|
1837
1866
|
var o;
|
|
1838
|
-
let
|
|
1839
|
-
e && (typeof e == "string" ?
|
|
1840
|
-
...
|
|
1867
|
+
let s = { type: "language" }, r;
|
|
1868
|
+
e && (typeof e == "string" ? s.type = e : s = {
|
|
1869
|
+
...s,
|
|
1841
1870
|
...e
|
|
1842
1871
|
});
|
|
1843
1872
|
try {
|
|
1844
|
-
l() && (t ? r = new Intl.DisplayNames(this.getLocation(),
|
|
1873
|
+
l() && (t ? r = new Intl.DisplayNames(this.getLocation(), s).of(t) : s.type === "language" ? r = new Intl.DisplayNames(this.getLocation(), s).of(this.geo.language) : s.type === "region" && (r = new Intl.DisplayNames(this.getLocation(), s).of(this.geo.country)));
|
|
1845
1874
|
} catch (a) {
|
|
1846
1875
|
console.error("display: ", a);
|
|
1847
1876
|
}
|
|
@@ -1855,11 +1884,11 @@ class Q {
|
|
|
1855
1884
|
* @param style the formatting style to use/ используемый стиль форматирования
|
|
1856
1885
|
*/
|
|
1857
1886
|
languageName(t, e) {
|
|
1858
|
-
const
|
|
1887
|
+
const s = {
|
|
1859
1888
|
type: "language",
|
|
1860
1889
|
style: e
|
|
1861
1890
|
};
|
|
1862
|
-
return this.display(
|
|
1891
|
+
return this.display(p.getByCode(t).language, s);
|
|
1863
1892
|
}
|
|
1864
1893
|
/**
|
|
1865
1894
|
* Get display names of region.
|
|
@@ -1869,11 +1898,11 @@ class Q {
|
|
|
1869
1898
|
* @param style the formatting style to use/ используемый стиль форматирования
|
|
1870
1899
|
*/
|
|
1871
1900
|
countryName(t, e) {
|
|
1872
|
-
const
|
|
1901
|
+
const s = {
|
|
1873
1902
|
type: "region",
|
|
1874
1903
|
style: e
|
|
1875
1904
|
};
|
|
1876
|
-
return this.display(t,
|
|
1905
|
+
return this.display(t, s);
|
|
1877
1906
|
}
|
|
1878
1907
|
/**
|
|
1879
1908
|
* The method returns a string containing the full name in a specific format.
|
|
@@ -1884,19 +1913,19 @@ class Q {
|
|
|
1884
1913
|
* @param surname surname middle name (optional)/ отчество
|
|
1885
1914
|
* @param short shorten the names/ сократить названия
|
|
1886
1915
|
*/
|
|
1887
|
-
fullName(t, e,
|
|
1916
|
+
fullName(t, e, s, r) {
|
|
1888
1917
|
var u, h;
|
|
1889
1918
|
const o = (h = (u = this.geo) == null ? void 0 : u.nameFormat) != null ? h : "fl";
|
|
1890
1919
|
let a;
|
|
1891
1920
|
switch (o) {
|
|
1892
1921
|
case "fsl":
|
|
1893
|
-
a = `${e}${
|
|
1922
|
+
a = `${e}${s ? ` ${s}` : ""} ${t}`;
|
|
1894
1923
|
break;
|
|
1895
1924
|
case "lf":
|
|
1896
1925
|
a = `${t} ${e}`;
|
|
1897
1926
|
break;
|
|
1898
1927
|
case "lsf":
|
|
1899
|
-
a = `${t}${
|
|
1928
|
+
a = `${t}${s ? ` ${s}` : ""} ${e}`;
|
|
1900
1929
|
break;
|
|
1901
1930
|
default:
|
|
1902
1931
|
a = `${e} ${t}`;
|
|
@@ -1913,8 +1942,8 @@ class Q {
|
|
|
1913
1942
|
* или всеми свойствами
|
|
1914
1943
|
*/
|
|
1915
1944
|
number(t, e) {
|
|
1916
|
-
var
|
|
1917
|
-
return ((r = (
|
|
1945
|
+
var s, r;
|
|
1946
|
+
return ((r = (s = this.numberObject(e)) == null ? void 0 : s.format) == null ? void 0 : r.call(s, k(t))) || t.toString();
|
|
1918
1947
|
}
|
|
1919
1948
|
/**
|
|
1920
1949
|
* Decimal point symbol.
|
|
@@ -1922,8 +1951,8 @@ class Q {
|
|
|
1922
1951
|
* Символ десятичной точки.
|
|
1923
1952
|
*/
|
|
1924
1953
|
decimal() {
|
|
1925
|
-
var t, e,
|
|
1926
|
-
return ((o = (r = (
|
|
1954
|
+
var t, e, s, r, o;
|
|
1955
|
+
return ((o = (r = (s = (e = (t = this.numberObject()) == null ? void 0 : t.formatToParts) == null ? void 0 : e.call(t, 1.2)) == null ? void 0 : s.find) == null ? void 0 : r.call(s, (a) => a.type === "decimal")) == null ? void 0 : o.value) || ".";
|
|
1927
1956
|
}
|
|
1928
1957
|
/**
|
|
1929
1958
|
* Currency formatting.
|
|
@@ -1934,15 +1963,15 @@ class Q {
|
|
|
1934
1963
|
* валюта для использования в форматировании валюты
|
|
1935
1964
|
* @param numberOnly do not display the currency symbol/ не выводить значок валюты
|
|
1936
1965
|
*/
|
|
1937
|
-
currency(t, e,
|
|
1966
|
+
currency(t, e, s = !1) {
|
|
1938
1967
|
const r = {
|
|
1939
1968
|
style: "currency",
|
|
1940
1969
|
currencyDisplay: "symbol",
|
|
1941
1970
|
...typeof e == "string" ? { currency: e } : e || {}
|
|
1942
1971
|
}, o = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]{3})$/i, (...a) => (r.currency = String(a[2]).toUpperCase(), String(a[1])));
|
|
1943
|
-
if (
|
|
1972
|
+
if (s) {
|
|
1944
1973
|
const a = this.numberObject(r);
|
|
1945
|
-
return a ?
|
|
1974
|
+
return a ? Ot(
|
|
1946
1975
|
a.formatToParts(k(t)).filter((u) => ["literal", "currency"].indexOf(u.type) === -1),
|
|
1947
1976
|
"value"
|
|
1948
1977
|
).join("") : t.toString();
|
|
@@ -1967,12 +1996,12 @@ class Q {
|
|
|
1967
1996
|
* как отобразить валюту в формате валюты
|
|
1968
1997
|
*/
|
|
1969
1998
|
currencySymbol(t, e = "symbol") {
|
|
1970
|
-
var
|
|
1971
|
-
return ((u = (a = (o = (r = (
|
|
1999
|
+
var s, r, o, a, u;
|
|
2000
|
+
return ((u = (a = (o = (r = (s = this.numberObject({
|
|
1972
2001
|
style: "currency",
|
|
1973
2002
|
currencyDisplay: e,
|
|
1974
2003
|
currency: t
|
|
1975
|
-
})) == null ? void 0 :
|
|
2004
|
+
})) == null ? void 0 : s.formatToParts) == null ? void 0 : r.call(s, 100)) == null ? void 0 : o.find) == null ? void 0 : a.call(o, (h) => h.type === "currency")) == null ? void 0 : u.value) || t;
|
|
1976
2005
|
}
|
|
1977
2006
|
/**
|
|
1978
2007
|
* Unit formatting.
|
|
@@ -1984,11 +2013,11 @@ class Q {
|
|
|
1984
2013
|
* в форматировании блока
|
|
1985
2014
|
*/
|
|
1986
2015
|
unit(t, e) {
|
|
1987
|
-
const
|
|
2016
|
+
const s = {
|
|
1988
2017
|
style: "unit",
|
|
1989
2018
|
...typeof e == "string" ? { unit: e } : e || {}
|
|
1990
|
-
}, r = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]+)$/i, (...o) => (
|
|
1991
|
-
return this.number(r,
|
|
2019
|
+
}, r = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]+)$/i, (...o) => (s.unit = String(o[2]).toLowerCase(), String(o[1])));
|
|
2020
|
+
return this.number(r, s);
|
|
1992
2021
|
}
|
|
1993
2022
|
/**
|
|
1994
2023
|
* Возвращает отформатированный размер файла
|
|
@@ -1997,19 +2026,19 @@ class Q {
|
|
|
1997
2026
|
* в форматировании блока
|
|
1998
2027
|
*/
|
|
1999
2028
|
sizeFile(t, e = "byte") {
|
|
2000
|
-
const
|
|
2001
|
-
if (
|
|
2029
|
+
const s = k(t);
|
|
2030
|
+
if (s > 1024 && R(e))
|
|
2002
2031
|
switch (e) {
|
|
2003
2032
|
case "byte":
|
|
2004
|
-
return this.sizeFile(
|
|
2033
|
+
return this.sizeFile(s / 1024, "kilobyte");
|
|
2005
2034
|
case "kilobyte":
|
|
2006
|
-
return this.sizeFile(
|
|
2035
|
+
return this.sizeFile(s / 1024, "megabyte");
|
|
2007
2036
|
case "megabyte":
|
|
2008
|
-
return this.sizeFile(
|
|
2037
|
+
return this.sizeFile(s / 1024, "gigabyte");
|
|
2009
2038
|
case "gigabyte":
|
|
2010
|
-
return this.sizeFile(
|
|
2039
|
+
return this.sizeFile(s / 1024, "terabyte");
|
|
2011
2040
|
case "terabyte":
|
|
2012
|
-
return this.sizeFile(
|
|
2041
|
+
return this.sizeFile(s / 1024, "petabyte");
|
|
2013
2042
|
}
|
|
2014
2043
|
return this.unit(t, e);
|
|
2015
2044
|
}
|
|
@@ -2045,35 +2074,35 @@ class Q {
|
|
|
2045
2074
|
* @param options Property for PluralRules/ свойство для PluralRules
|
|
2046
2075
|
* @param optionsNumber an object with some or all properties/ объект с некоторыми или всеми свойствами
|
|
2047
2076
|
*/
|
|
2048
|
-
plural(t, e,
|
|
2077
|
+
plural(t, e, s, r) {
|
|
2049
2078
|
var u;
|
|
2050
2079
|
const o = k(t), a = e.split("|");
|
|
2051
2080
|
if (a.length > 1)
|
|
2052
2081
|
try {
|
|
2053
2082
|
if (l()) {
|
|
2054
|
-
const
|
|
2055
|
-
let
|
|
2056
|
-
switch (
|
|
2083
|
+
const m = new Intl.PluralRules(this.getLocation(), s).select(o);
|
|
2084
|
+
let g;
|
|
2085
|
+
switch (m) {
|
|
2057
2086
|
case "zero":
|
|
2058
|
-
|
|
2087
|
+
g = a[a.length - 1];
|
|
2059
2088
|
break;
|
|
2060
2089
|
case "one":
|
|
2061
|
-
|
|
2090
|
+
g = a == null ? void 0 : a[0];
|
|
2062
2091
|
break;
|
|
2063
2092
|
case "two":
|
|
2064
|
-
|
|
2093
|
+
g = a == null ? void 0 : a[1];
|
|
2065
2094
|
break;
|
|
2066
2095
|
case "few":
|
|
2067
|
-
|
|
2096
|
+
g = a != null && a[3] ? a == null ? void 0 : a[2] : a == null ? void 0 : a[1];
|
|
2068
2097
|
break;
|
|
2069
2098
|
case "many":
|
|
2070
|
-
|
|
2099
|
+
g = (a == null ? void 0 : a[3]) || (a == null ? void 0 : a[2]) || (a == null ? void 0 : a[1]);
|
|
2071
2100
|
break;
|
|
2072
2101
|
case "other":
|
|
2073
|
-
a.length === 6 ?
|
|
2102
|
+
a.length === 6 ? g = a[a.length - 2] : g = a[a.length - 1];
|
|
2074
2103
|
break;
|
|
2075
2104
|
}
|
|
2076
|
-
return `${this.number(o, r)} ${
|
|
2105
|
+
return `${this.number(o, r)} ${g != null ? g : ""}`.trim();
|
|
2077
2106
|
}
|
|
2078
2107
|
} catch (h) {
|
|
2079
2108
|
console.error("plural: ", h);
|
|
@@ -2089,9 +2118,9 @@ class Q {
|
|
|
2089
2118
|
* @param styleOptions the representation of the month/ представление месяца
|
|
2090
2119
|
* @param hour24 whether to use 12-hour time/ использовать ли 12-часовое время
|
|
2091
2120
|
*/
|
|
2092
|
-
date(t, e,
|
|
2093
|
-
const o = F(t), a = typeof
|
|
2094
|
-
return r && (u.hour12 = !1), a || Object.assign(u,
|
|
2121
|
+
date(t, e, s, r) {
|
|
2122
|
+
const o = F(t), a = typeof s == "string", u = this.dateOptions(e, a ? s : "short");
|
|
2123
|
+
return r && (u.hour12 = !1), a || Object.assign(u, s), o.toLocaleString(this.getLocation(), u);
|
|
2095
2124
|
}
|
|
2096
2125
|
/**
|
|
2097
2126
|
* Enables language-sensitive relative time formatting.
|
|
@@ -2102,8 +2131,8 @@ class Q {
|
|
|
2102
2131
|
* длина интернационализированного сообщения
|
|
2103
2132
|
* @param todayValue current day/ текущий день
|
|
2104
2133
|
*/
|
|
2105
|
-
relative(t, e,
|
|
2106
|
-
const r = F(t), o =
|
|
2134
|
+
relative(t, e, s) {
|
|
2135
|
+
const r = F(t), o = s || /* @__PURE__ */ new Date(), a = {
|
|
2107
2136
|
numeric: "auto",
|
|
2108
2137
|
...typeof e == "string" ? { style: e } : e || {}
|
|
2109
2138
|
};
|
|
@@ -2128,12 +2157,12 @@ class Q {
|
|
|
2128
2157
|
* @param type type of data format/ тип формата data
|
|
2129
2158
|
* @param hour24 whether to use 12-hour time/ использовать ли 12-часовое время
|
|
2130
2159
|
*/
|
|
2131
|
-
relativeLimit(t, e,
|
|
2132
|
-
const h = F(t),
|
|
2133
|
-
return
|
|
2160
|
+
relativeLimit(t, e, s, r, o, a, u) {
|
|
2161
|
+
const h = F(t), m = s || /* @__PURE__ */ new Date(), g = new Date(m), S = new Date(m);
|
|
2162
|
+
return g.setDate(m.getDate() - e), S.setDate(m.getDate() + e), h >= g && h <= S ? this.relative(
|
|
2134
2163
|
h,
|
|
2135
2164
|
r,
|
|
2136
|
-
|
|
2165
|
+
m
|
|
2137
2166
|
) : this.date(
|
|
2138
2167
|
h,
|
|
2139
2168
|
a,
|
|
@@ -2147,10 +2176,10 @@ class Q {
|
|
|
2147
2176
|
* @param unit time unit/ единица времени
|
|
2148
2177
|
* @param styleOptions additional option or formatting style/ дополнительная опция или стиль форматирования
|
|
2149
2178
|
*/
|
|
2150
|
-
relativeByValue(t, e,
|
|
2179
|
+
relativeByValue(t, e, s) {
|
|
2151
2180
|
const r = {
|
|
2152
2181
|
numeric: "auto",
|
|
2153
|
-
...typeof
|
|
2182
|
+
...typeof s == "string" ? { style: s } : s || {}
|
|
2154
2183
|
};
|
|
2155
2184
|
try {
|
|
2156
2185
|
if (l())
|
|
@@ -2170,8 +2199,8 @@ class Q {
|
|
|
2170
2199
|
try {
|
|
2171
2200
|
if (l())
|
|
2172
2201
|
return Intl.DateTimeFormat(this.getLocation(), { month: e || "long" }).format(F(t));
|
|
2173
|
-
} catch (
|
|
2174
|
-
console.error("month: ",
|
|
2202
|
+
} catch (s) {
|
|
2203
|
+
console.error("month: ", s);
|
|
2175
2204
|
}
|
|
2176
2205
|
return "";
|
|
2177
2206
|
}
|
|
@@ -2188,15 +2217,15 @@ class Q {
|
|
|
2188
2217
|
}];
|
|
2189
2218
|
try {
|
|
2190
2219
|
if (l()) {
|
|
2191
|
-
const
|
|
2220
|
+
const s = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { month: t || "long" });
|
|
2192
2221
|
for (let o = 0; o < 12; o++)
|
|
2193
|
-
|
|
2194
|
-
label: r.format(
|
|
2222
|
+
s.setMonth(o), e.push({
|
|
2223
|
+
label: r.format(s).replace(/^./, (a) => a.toUpperCase()),
|
|
2195
2224
|
value: o + 1
|
|
2196
2225
|
});
|
|
2197
2226
|
}
|
|
2198
|
-
} catch (
|
|
2199
|
-
console.error("months: ",
|
|
2227
|
+
} catch (s) {
|
|
2228
|
+
console.error("months: ", s);
|
|
2200
2229
|
}
|
|
2201
2230
|
return e;
|
|
2202
2231
|
}
|
|
@@ -2211,8 +2240,8 @@ class Q {
|
|
|
2211
2240
|
try {
|
|
2212
2241
|
if (l())
|
|
2213
2242
|
return Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }).format(F(t));
|
|
2214
|
-
} catch (
|
|
2215
|
-
console.error("weekday: ",
|
|
2243
|
+
} catch (s) {
|
|
2244
|
+
console.error("weekday: ", s);
|
|
2216
2245
|
}
|
|
2217
2246
|
return "";
|
|
2218
2247
|
}
|
|
@@ -2229,16 +2258,16 @@ class Q {
|
|
|
2229
2258
|
}];
|
|
2230
2259
|
try {
|
|
2231
2260
|
if (l()) {
|
|
2232
|
-
const
|
|
2233
|
-
|
|
2261
|
+
const s = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }), o = s.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
|
|
2262
|
+
s.setDate(s.getDate() - o);
|
|
2234
2263
|
for (let a = 0; a < 7; a++)
|
|
2235
2264
|
e.push({
|
|
2236
|
-
label: r.format(
|
|
2237
|
-
value:
|
|
2238
|
-
}),
|
|
2265
|
+
label: r.format(s).replace(/^./, (u) => u.toUpperCase()),
|
|
2266
|
+
value: s.getDay()
|
|
2267
|
+
}), s.setDate(s.getDate() + 1);
|
|
2239
2268
|
}
|
|
2240
|
-
} catch (
|
|
2241
|
-
console.error("weekdays: ",
|
|
2269
|
+
} catch (s) {
|
|
2270
|
+
console.error("weekdays: ", s);
|
|
2242
2271
|
}
|
|
2243
2272
|
return e;
|
|
2244
2273
|
}
|
|
@@ -2258,10 +2287,10 @@ class Q {
|
|
|
2258
2287
|
* @param data an array with data/ массив с данными
|
|
2259
2288
|
* @param compareFn a function for sorting/ функция для сортировки
|
|
2260
2289
|
*/
|
|
2261
|
-
sort(t, e = (
|
|
2290
|
+
sort(t, e = (s, r) => [s, r]) {
|
|
2262
2291
|
if (l()) {
|
|
2263
|
-
const
|
|
2264
|
-
return t.sort((r, o) =>
|
|
2292
|
+
const s = new Intl.Collator(this.getLocation());
|
|
2293
|
+
return t.sort((r, o) => s.compare(...e(r, o)));
|
|
2265
2294
|
}
|
|
2266
2295
|
return t;
|
|
2267
2296
|
}
|
|
@@ -2288,11 +2317,11 @@ class Q {
|
|
|
2288
2317
|
* @param display the representation of the month/ представление месяца
|
|
2289
2318
|
*/
|
|
2290
2319
|
dateOptions(t, e = "short") {
|
|
2291
|
-
const
|
|
2292
|
-
return ["full", "datetime", "date", void 0, "year-month", "year"].indexOf(t) !== -1 && (
|
|
2320
|
+
const s = {};
|
|
2321
|
+
return ["full", "datetime", "date", void 0, "year-month", "year"].indexOf(t) !== -1 && (s.year = "numeric"), ["full", "datetime", "date", void 0, "year-month", "month", "day-month"].indexOf(t) !== -1 && (s.month = e), ["full", "datetime", "date", void 0, "day", "day-month"].indexOf(t) !== -1 && (s.day = "2-digit"), t !== void 0 && (["full", "datetime", "time", "hour-minute", "hour"].indexOf(t) !== -1 && (s.hour = "2-digit"), ["full", "datetime", "time", "hour-minute", "minute"].indexOf(t) !== -1 && (s.minute = "2-digit"), ["full", "time", "second"].indexOf(t) !== -1 && (s.second = "2-digit")), s;
|
|
2293
2322
|
}
|
|
2294
2323
|
}
|
|
2295
|
-
const
|
|
2324
|
+
const it = {};
|
|
2296
2325
|
class ut {
|
|
2297
2326
|
/**
|
|
2298
2327
|
* Constructor
|
|
@@ -2300,11 +2329,11 @@ class ut {
|
|
|
2300
2329
|
* @param type type of date format for output/ тип формата даты вывода
|
|
2301
2330
|
* @param code country and language code/ код страны и языка
|
|
2302
2331
|
*/
|
|
2303
|
-
constructor(t, e = "date",
|
|
2332
|
+
constructor(t, e = "date", s = p.getLocation()) {
|
|
2304
2333
|
c(this, "date");
|
|
2305
2334
|
c(this, "hour24", !1);
|
|
2306
2335
|
c(this, "watch");
|
|
2307
|
-
this.type = e, this.code =
|
|
2336
|
+
this.type = e, this.code = s, this.date = F(t);
|
|
2308
2337
|
}
|
|
2309
2338
|
/**
|
|
2310
2339
|
* Returns an object for working with formatting.
|
|
@@ -2312,7 +2341,7 @@ class ut {
|
|
|
2312
2341
|
* Возвращает объект для работы с форматированием.
|
|
2313
2342
|
*/
|
|
2314
2343
|
getIntl() {
|
|
2315
|
-
return new
|
|
2344
|
+
return new M(this.code);
|
|
2316
2345
|
}
|
|
2317
2346
|
/**
|
|
2318
2347
|
* Returns a Date object.
|
|
@@ -2368,10 +2397,10 @@ class ut {
|
|
|
2368
2397
|
const e = this.getTimeZoneOffset();
|
|
2369
2398
|
if (t === "minute")
|
|
2370
2399
|
return e.toString();
|
|
2371
|
-
const
|
|
2400
|
+
const s = e / 60 * -1;
|
|
2372
2401
|
if (t === "hour")
|
|
2373
|
-
return this.getIntl().number(Math.trunc(
|
|
2374
|
-
const r = this.toTimeZoneHourFormat(
|
|
2402
|
+
return this.getIntl().number(Math.trunc(s), { signDisplay: "always" });
|
|
2403
|
+
const r = this.toTimeZoneHourFormat(s), o = s.toString().match(/.\d+/) ? "30" : "00";
|
|
2375
2404
|
return t === "RFC" ? `${r}${o}` : `${r}:${o}`;
|
|
2376
2405
|
}
|
|
2377
2406
|
/**
|
|
@@ -2517,13 +2546,13 @@ class ut {
|
|
|
2517
2546
|
* @param timeZone add time zone/ добавить временную зону
|
|
2518
2547
|
*/
|
|
2519
2548
|
standard(t = !0) {
|
|
2520
|
-
const e = new ut(this.date, this.type, "en-GB"),
|
|
2549
|
+
const e = new ut(this.date, this.type, "en-GB"), s = [];
|
|
2521
2550
|
let r;
|
|
2522
2551
|
return e.setHour24(!0), this.type === "hour-minute" ? r = e.locale(this.type, {
|
|
2523
2552
|
year: "numeric",
|
|
2524
2553
|
month: "2-digit",
|
|
2525
2554
|
hour12: !1
|
|
2526
|
-
}) : (["full", "datetime", "date", "year-month", "year", "month", "day"].indexOf(this.type) !== -1 && (
|
|
2555
|
+
}) : (["full", "datetime", "date", "year-month", "year", "month", "day"].indexOf(this.type) !== -1 && (s.push(e.localeYear()), s.push(e.localeMonth("2-digit"))), ["full", "datetime", "date", "year", "month", "day"].indexOf(this.type) !== -1 && s.push(e.localeDay("2-digit")), ["full", "datetime", "time", "hour", "minute", "second"].indexOf(this.type) !== -1 && (r = e.locale("time"))), `${s.join("-")}${r ? `T${r}${t ? e.getTimeZone() : ""}` : ""}`;
|
|
2527
2556
|
}
|
|
2528
2557
|
/**
|
|
2529
2558
|
* Change the date completely.
|
|
@@ -2956,87 +2985,12 @@ class ut {
|
|
|
2956
2985
|
), this;
|
|
2957
2986
|
}
|
|
2958
2987
|
}
|
|
2959
|
-
class
|
|
2960
|
-
/**
|
|
2961
|
-
* Constructor
|
|
2962
|
-
* @param element HTML element to capture/ HTML элемент для захвата
|
|
2963
|
-
*/
|
|
2964
|
-
constructor(t) {
|
|
2965
|
-
this.element = t;
|
|
2966
|
-
}
|
|
2967
|
-
/**
|
|
2968
|
-
* Takes a screenshot of the element.
|
|
2969
|
-
*
|
|
2970
|
-
* Делает скриншот элемента.
|
|
2971
|
-
*/
|
|
2972
|
-
take() {
|
|
2973
|
-
return new Promise((t, e) => {
|
|
2974
|
-
const {
|
|
2975
|
-
width: i,
|
|
2976
|
-
height: r
|
|
2977
|
-
} = this.element.getBoundingClientRect();
|
|
2978
|
-
if (i === 0 || r === 0)
|
|
2979
|
-
return e(new Error("Element has no dimensions"));
|
|
2980
|
-
const o = document.createElement("canvas"), a = o.getContext("2d");
|
|
2981
|
-
if (!a)
|
|
2982
|
-
return e(new Error("Could not get canvas context"));
|
|
2983
|
-
const u = window.devicePixelRatio || 1;
|
|
2984
|
-
o.width = i * u, o.height = r * u, o.style.width = `${i}px`, o.style.height = `${r}px`, a.scale(u, u);
|
|
2985
|
-
const h = this.getStyles(), f = this.element.outerHTML, d = `
|
|
2986
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${r}">
|
|
2987
|
-
<foreignObject x="0" y="0" width="100%" height="100%">
|
|
2988
|
-
<style>${h}</style>
|
|
2989
|
-
<div xmlns="http://www.w3.org/1999/xhtml">${f}</div>
|
|
2990
|
-
</foreignObject>
|
|
2991
|
-
</svg>
|
|
2992
|
-
`, y = new Image(), W = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(d)));
|
|
2993
|
-
y.onload = () => {
|
|
2994
|
-
a.drawImage(y, 0, 0, i, r), t(o.toDataURL("image/png"));
|
|
2995
|
-
}, y.onerror = (x) => {
|
|
2996
|
-
console.error("Screenshot failed", {
|
|
2997
|
-
error: x,
|
|
2998
|
-
svg: d
|
|
2999
|
-
}), e(new Error("Failed to load SVG image for screenshot. See console for details."));
|
|
3000
|
-
}, y.src = W;
|
|
3001
|
-
});
|
|
3002
|
-
}
|
|
3003
|
-
/**
|
|
3004
|
-
* Takes a screenshot and downloads it.
|
|
3005
|
-
*
|
|
3006
|
-
* Делает скриншот и скачивает его.
|
|
3007
|
-
* @param filename name of the file to download/ имя файла для скачивания
|
|
3008
|
-
*/
|
|
3009
|
-
async download(t = "screenshot.png") {
|
|
3010
|
-
const e = await this.take(), i = document.createElement("a");
|
|
3011
|
-
i.href = e, i.download = t, document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
3012
|
-
}
|
|
3013
|
-
/**
|
|
3014
|
-
* Gathers all CSS styles from the document's stylesheets.
|
|
3015
|
-
*
|
|
3016
|
-
* Собирает все стили CSS из таблиц стилей документа.
|
|
3017
|
-
*/
|
|
3018
|
-
getStyles() {
|
|
3019
|
-
let t = "";
|
|
3020
|
-
try {
|
|
3021
|
-
for (const e of Array.from(document.styleSheets))
|
|
3022
|
-
try {
|
|
3023
|
-
for (const i of Array.from(e.cssRules))
|
|
3024
|
-
t += i.cssText;
|
|
3025
|
-
} catch (i) {
|
|
3026
|
-
console.warn("Could not read CSS rules from a stylesheet due to CORS.", i);
|
|
3027
|
-
}
|
|
3028
|
-
} catch (e) {
|
|
3029
|
-
console.error("Could not access stylesheets.", e);
|
|
3030
|
-
}
|
|
3031
|
-
return t;
|
|
3032
|
-
}
|
|
3033
|
-
}
|
|
3034
|
-
const n = "f", j = class j {
|
|
2988
|
+
const n = "f", W = class W {
|
|
3035
2989
|
/**
|
|
3036
2990
|
* Constructor
|
|
3037
2991
|
* @param code country and language code/ код страны и языка
|
|
3038
2992
|
*/
|
|
3039
|
-
constructor(t =
|
|
2993
|
+
constructor(t = p.getLocation()) {
|
|
3040
2994
|
this.code = t;
|
|
3041
2995
|
}
|
|
3042
2996
|
/**
|
|
@@ -3046,15 +3000,15 @@ const n = "f", j = class j {
|
|
|
3046
3000
|
* @param code country code/ код страны
|
|
3047
3001
|
*/
|
|
3048
3002
|
get(t = this.code) {
|
|
3049
|
-
var
|
|
3050
|
-
const e =
|
|
3003
|
+
var s;
|
|
3004
|
+
const e = p.find(t);
|
|
3051
3005
|
if (e) {
|
|
3052
3006
|
const r = this.getCountry(e);
|
|
3053
3007
|
return {
|
|
3054
3008
|
language: this.getLanguage(e),
|
|
3055
3009
|
country: r,
|
|
3056
3010
|
standard: e.standard,
|
|
3057
|
-
icon: (
|
|
3011
|
+
icon: (s = W.flags) == null ? void 0 : s[e.country],
|
|
3058
3012
|
label: r,
|
|
3059
3013
|
value: e.country
|
|
3060
3014
|
};
|
|
@@ -3077,7 +3031,7 @@ const n = "f", j = class j {
|
|
|
3077
3031
|
* @param codes country code/ код страны
|
|
3078
3032
|
*/
|
|
3079
3033
|
getList(t) {
|
|
3080
|
-
return
|
|
3034
|
+
return d(this.getCodes(t), (e) => this.get(e));
|
|
3081
3035
|
}
|
|
3082
3036
|
/**
|
|
3083
3037
|
* Getting a list of countries by an array of codes in national language.
|
|
@@ -3086,13 +3040,13 @@ const n = "f", j = class j {
|
|
|
3086
3040
|
* @param codes country code/ код страны.
|
|
3087
3041
|
*/
|
|
3088
3042
|
getNational(t) {
|
|
3089
|
-
return
|
|
3090
|
-
const
|
|
3043
|
+
return d(this.getList(t), (e) => {
|
|
3044
|
+
const s = new W(e.standard).get(e.standard);
|
|
3091
3045
|
return {
|
|
3092
3046
|
...e,
|
|
3093
|
-
description:
|
|
3094
|
-
nationalLanguage:
|
|
3095
|
-
nationalCountry:
|
|
3047
|
+
description: s == null ? void 0 : s.country,
|
|
3048
|
+
nationalLanguage: s == null ? void 0 : s.language,
|
|
3049
|
+
nationalCountry: s == null ? void 0 : s.country
|
|
3096
3050
|
};
|
|
3097
3051
|
});
|
|
3098
3052
|
}
|
|
@@ -3111,7 +3065,7 @@ const n = "f", j = class j {
|
|
|
3111
3065
|
* Возвращает специальный объект для работы с форматированием.
|
|
3112
3066
|
*/
|
|
3113
3067
|
getLocation() {
|
|
3114
|
-
return new
|
|
3068
|
+
return new M(this.code);
|
|
3115
3069
|
}
|
|
3116
3070
|
/**
|
|
3117
3071
|
* Returns a list of countries to retrieve data from.
|
|
@@ -3120,7 +3074,7 @@ const n = "f", j = class j {
|
|
|
3120
3074
|
* @param codes country code/ код страны
|
|
3121
3075
|
*/
|
|
3122
3076
|
getCodes(t) {
|
|
3123
|
-
return t != null ? t : Object.keys(
|
|
3077
|
+
return t != null ? t : Object.keys(W.flags);
|
|
3124
3078
|
}
|
|
3125
3079
|
/**
|
|
3126
3080
|
* Getting the name of the language.
|
|
@@ -3141,7 +3095,7 @@ const n = "f", j = class j {
|
|
|
3141
3095
|
return this.getLocation().countryName(t.country);
|
|
3142
3096
|
}
|
|
3143
3097
|
};
|
|
3144
|
-
c(
|
|
3098
|
+
c(W, "flags", {
|
|
3145
3099
|
AD: `${n}-ad`,
|
|
3146
3100
|
AE: `${n}-ae`,
|
|
3147
3101
|
AF: `${n}-af`,
|
|
@@ -3384,8 +3338,8 @@ c(j, "flags", {
|
|
|
3384
3338
|
ZM: `${n}-zm`,
|
|
3385
3339
|
ZW: `${n}-zw`
|
|
3386
3340
|
});
|
|
3387
|
-
let vt =
|
|
3388
|
-
const
|
|
3341
|
+
let vt = W;
|
|
3342
|
+
const j = class j {
|
|
3389
3343
|
/**
|
|
3390
3344
|
* Getting an object with information about the phone code and country.
|
|
3391
3345
|
*
|
|
@@ -3402,12 +3356,12 @@ const H = class H {
|
|
|
3402
3356
|
* @param phone phone number/ номер телефон
|
|
3403
3357
|
*/
|
|
3404
3358
|
static getByPhone(t) {
|
|
3405
|
-
let e = this.map,
|
|
3359
|
+
let e = this.map, s, r = "";
|
|
3406
3360
|
return this.toNumber(t).forEach((o) => {
|
|
3407
3361
|
var a;
|
|
3408
|
-
r === "" && o in e ? (
|
|
3362
|
+
r === "" && o in e ? (s = e[o], e = (a = s == null ? void 0 : s.next) != null ? a : {}) : r += o;
|
|
3409
3363
|
}), {
|
|
3410
|
-
item:
|
|
3364
|
+
item: s,
|
|
3411
3365
|
phone: r
|
|
3412
3366
|
};
|
|
3413
3367
|
}
|
|
@@ -3418,10 +3372,10 @@ const H = class H {
|
|
|
3418
3372
|
* @param code country and language code/ код страны и языка
|
|
3419
3373
|
*/
|
|
3420
3374
|
static getByCode(t) {
|
|
3421
|
-
var
|
|
3375
|
+
var s;
|
|
3422
3376
|
const e = this.get(t);
|
|
3423
3377
|
if (e)
|
|
3424
|
-
return (
|
|
3378
|
+
return (s = this.getByPhone(e.phone.toString())) == null ? void 0 : s.item;
|
|
3425
3379
|
}
|
|
3426
3380
|
/**
|
|
3427
3381
|
* We get an array from a list of all phone numbers.
|
|
@@ -3447,11 +3401,11 @@ const H = class H {
|
|
|
3447
3401
|
* @param masks a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3448
3402
|
*/
|
|
3449
3403
|
static toMask(t, e) {
|
|
3450
|
-
if (
|
|
3451
|
-
const
|
|
3404
|
+
if (w(t) && Array.isArray(e) && e.length > 0) {
|
|
3405
|
+
const s = this.removeZero(t), r = s.length;
|
|
3452
3406
|
for (const o of e)
|
|
3453
3407
|
if (this.getUnnecessaryLength(o) === r)
|
|
3454
|
-
return this.toStandard(
|
|
3408
|
+
return this.toStandard(s, o);
|
|
3455
3409
|
}
|
|
3456
3410
|
}
|
|
3457
3411
|
/**
|
|
@@ -3495,16 +3449,16 @@ const H = class H {
|
|
|
3495
3449
|
* Формирование списка для карты.
|
|
3496
3450
|
*/
|
|
3497
3451
|
static makeList() {
|
|
3498
|
-
const t =
|
|
3452
|
+
const t = d(p.getList(), (e) => {
|
|
3499
3453
|
if (e != null && e.phoneMask)
|
|
3500
3454
|
return {
|
|
3501
3455
|
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/, "")) || void 0,
|
|
3502
3456
|
within: (e == null ? void 0 : e.phoneWithin) || 0,
|
|
3503
|
-
mask:
|
|
3457
|
+
mask: z(e.phoneMask),
|
|
3504
3458
|
value: e.country
|
|
3505
3459
|
};
|
|
3506
3460
|
});
|
|
3507
|
-
this.list = t.sort((e,
|
|
3461
|
+
this.list = t.sort((e, s) => e.phone - s.phone);
|
|
3508
3462
|
}
|
|
3509
3463
|
/**
|
|
3510
3464
|
* Creating a map for search.
|
|
@@ -3514,17 +3468,17 @@ const H = class H {
|
|
|
3514
3468
|
static makeMap() {
|
|
3515
3469
|
this.list.forEach((t) => {
|
|
3516
3470
|
t.mask.forEach((e) => {
|
|
3517
|
-
let
|
|
3471
|
+
let s = this.map, r;
|
|
3518
3472
|
if (this.toNumber(e).forEach((o) => {
|
|
3519
3473
|
var a;
|
|
3520
|
-
o in
|
|
3474
|
+
o in s || (s[o] = {
|
|
3521
3475
|
items: [],
|
|
3522
3476
|
info: void 0,
|
|
3523
3477
|
value: void 0,
|
|
3524
3478
|
mask: [],
|
|
3525
3479
|
maskFull: [],
|
|
3526
3480
|
next: {}
|
|
3527
|
-
}), r =
|
|
3481
|
+
}), r = s[o], s = (a = r == null ? void 0 : r.next) != null ? a : {};
|
|
3528
3482
|
}), r) {
|
|
3529
3483
|
r.value === void 0 && (r.info = t, r.value = t.value);
|
|
3530
3484
|
const o = this.toWithin(e, t.within);
|
|
@@ -3550,8 +3504,8 @@ const H = class H {
|
|
|
3550
3504
|
* @param mask a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3551
3505
|
*/
|
|
3552
3506
|
static toStandard(t, e) {
|
|
3553
|
-
let
|
|
3554
|
-
return e.replace(/\*/ig, () => String(t[
|
|
3507
|
+
let s = 0;
|
|
3508
|
+
return e.replace(/\*/ig, () => String(t[s++]));
|
|
3555
3509
|
}
|
|
3556
3510
|
/**
|
|
3557
3511
|
* Replaces the first character with the internal country code
|
|
@@ -3564,8 +3518,8 @@ const H = class H {
|
|
|
3564
3518
|
return t.replace(/\*/, this.getWithinSymbol(e));
|
|
3565
3519
|
}
|
|
3566
3520
|
};
|
|
3567
|
-
c(
|
|
3568
|
-
let St =
|
|
3521
|
+
c(j, "list", []), c(j, "map", {}), j.makeList(), j.makeMap();
|
|
3522
|
+
let St = j, P;
|
|
3569
3523
|
class Ie {
|
|
3570
3524
|
/**
|
|
3571
3525
|
* Returns the value by its name.
|
|
@@ -3574,7 +3528,7 @@ class Ie {
|
|
|
3574
3528
|
* @param name property name/ название свойства
|
|
3575
3529
|
*/
|
|
3576
3530
|
static get(t) {
|
|
3577
|
-
return
|
|
3531
|
+
return P && (P == null ? void 0 : P[t]);
|
|
3578
3532
|
}
|
|
3579
3533
|
/**
|
|
3580
3534
|
* Adds data, this method works only once.
|
|
@@ -3583,10 +3537,10 @@ class Ie {
|
|
|
3583
3537
|
* @param data global data/ глобальные данные
|
|
3584
3538
|
*/
|
|
3585
3539
|
static add(t) {
|
|
3586
|
-
|
|
3540
|
+
P === void 0 && (P = C(t));
|
|
3587
3541
|
}
|
|
3588
3542
|
}
|
|
3589
|
-
const
|
|
3543
|
+
const x = class x {
|
|
3590
3544
|
/**
|
|
3591
3545
|
* Get data from hash.
|
|
3592
3546
|
*
|
|
@@ -3606,8 +3560,8 @@ const R = class R {
|
|
|
3606
3560
|
*/
|
|
3607
3561
|
static set(t, e) {
|
|
3608
3562
|
var r;
|
|
3609
|
-
const
|
|
3610
|
-
|
|
3563
|
+
const s = B(e);
|
|
3564
|
+
s !== ((r = this.hash) == null ? void 0 : r[t]) && (this.hash[t] = s, this.update());
|
|
3611
3565
|
}
|
|
3612
3566
|
/**
|
|
3613
3567
|
* Adding an event when data is changed.
|
|
@@ -3617,8 +3571,8 @@ const R = class R {
|
|
|
3617
3571
|
* @param callback the function is called when the data is changed/ функция вызывается при изменении данных
|
|
3618
3572
|
*/
|
|
3619
3573
|
static addWatch(t, e) {
|
|
3620
|
-
var
|
|
3621
|
-
t in this.watch ? (
|
|
3574
|
+
var s;
|
|
3575
|
+
t in this.watch ? (s = this.watch[t]) == null || s.push(e) : this.watch[t] = [e];
|
|
3622
3576
|
}
|
|
3623
3577
|
/**
|
|
3624
3578
|
* Update hash variable from URL string.
|
|
@@ -3640,7 +3594,7 @@ const R = class R {
|
|
|
3640
3594
|
const t = {};
|
|
3641
3595
|
return location.hash.replace(
|
|
3642
3596
|
/([\w-]+)[:=]([^;]+)/ig,
|
|
3643
|
-
(...e) => (t[String(e[1])] =
|
|
3597
|
+
(...e) => (t[String(e[1])] = xt(e[2]), "")
|
|
3644
3598
|
), t;
|
|
3645
3599
|
}
|
|
3646
3600
|
/**
|
|
@@ -3660,15 +3614,15 @@ const R = class R {
|
|
|
3660
3614
|
* @param location fresh data/ свежий данные
|
|
3661
3615
|
*/
|
|
3662
3616
|
static makeWatch(t) {
|
|
3663
|
-
|
|
3617
|
+
d(this.watch, (e, s) => {
|
|
3664
3618
|
var r;
|
|
3665
|
-
((r = this.hash) == null ? void 0 : r[
|
|
3619
|
+
((r = this.hash) == null ? void 0 : r[s]) !== (t == null ? void 0 : t[s]) && e.forEach((o) => o(t[s]));
|
|
3666
3620
|
});
|
|
3667
3621
|
}
|
|
3668
3622
|
};
|
|
3669
|
-
c(
|
|
3670
|
-
let Dt =
|
|
3671
|
-
const
|
|
3623
|
+
c(x, "hash", {}), c(x, "watch", {}), c(x, "block", !1), l() && (x.reload(), addEventListener("hashchange", () => x.reload()));
|
|
3624
|
+
let Dt = x;
|
|
3625
|
+
const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
3672
3626
|
/**
|
|
3673
3627
|
* Checks if the given icon is in the list of connected icons.
|
|
3674
3628
|
*
|
|
@@ -3688,10 +3642,10 @@ const it = "__UI_ICON", Lt = 320, Ct = "--LOAD--", q = class q {
|
|
|
3688
3642
|
* @param wait waiting time for picture loading/
|
|
3689
3643
|
* время ожидания загрузки картинки
|
|
3690
3644
|
*/
|
|
3691
|
-
static async get(t, e = "",
|
|
3645
|
+
static async get(t, e = "", s = 1e3 * 60 * 3) {
|
|
3692
3646
|
var o, a, u, h;
|
|
3693
3647
|
const r = (h = (u = (o = this.icons) == null ? void 0 : o[this.getName(t)]) != null ? u : (a = this.icons) == null ? void 0 : a[t]) != null ? h : `${t.replace(/^@/, e != null ? e : this.url)}.svg`;
|
|
3694
|
-
return typeof r == "string" ? r === Ct &&
|
|
3648
|
+
return typeof r == "string" ? r === Ct && s > 0 ? (await this.wait(), this.get(t, e, s - Lt)) : r : ct(r) ? await r() : await r;
|
|
3695
3649
|
}
|
|
3696
3650
|
/**
|
|
3697
3651
|
* Returns a list of names of all registered icons.
|
|
@@ -3699,7 +3653,7 @@ const it = "__UI_ICON", Lt = 320, Ct = "--LOAD--", q = class q {
|
|
|
3699
3653
|
* Возвращает список названий всех зарегистрированных иконок.
|
|
3700
3654
|
*/
|
|
3701
3655
|
static getNameList() {
|
|
3702
|
-
return
|
|
3656
|
+
return d(this.icons, (t, e) => e.replace(/^@/, ""));
|
|
3703
3657
|
}
|
|
3704
3658
|
/**
|
|
3705
3659
|
* Returns a global link.
|
|
@@ -3707,7 +3661,7 @@ const it = "__UI_ICON", Lt = 320, Ct = "--LOAD--", q = class q {
|
|
|
3707
3661
|
* Возвращает глобальную ссылку.
|
|
3708
3662
|
*/
|
|
3709
3663
|
static getUrlGlobal() {
|
|
3710
|
-
return `${
|
|
3664
|
+
return `${H.isLocalhost(), ""}${this.url}`;
|
|
3711
3665
|
}
|
|
3712
3666
|
/**
|
|
3713
3667
|
* Adding custom icons.
|
|
@@ -3745,7 +3699,7 @@ const it = "__UI_ICON", Lt = 320, Ct = "--LOAD--", q = class q {
|
|
|
3745
3699
|
* @param list list of icons/ список иконки
|
|
3746
3700
|
*/
|
|
3747
3701
|
static addByList(t) {
|
|
3748
|
-
|
|
3702
|
+
d(t, (e, s) => this.add(s, e));
|
|
3749
3703
|
}
|
|
3750
3704
|
/**
|
|
3751
3705
|
* Changes the file path.
|
|
@@ -3774,37 +3728,37 @@ const it = "__UI_ICON", Lt = 320, Ct = "--LOAD--", q = class q {
|
|
|
3774
3728
|
return new Promise((t) => setTimeout(() => t(), Lt));
|
|
3775
3729
|
}
|
|
3776
3730
|
};
|
|
3777
|
-
c(
|
|
3778
|
-
let kt =
|
|
3779
|
-
function
|
|
3780
|
-
var
|
|
3781
|
-
return (r = (
|
|
3731
|
+
c(Y, "icons", {}), c(Y, "url", "/icons/"), l() && (st in window || (window[st] = {}), Y.icons = window[st]);
|
|
3732
|
+
let kt = Y;
|
|
3733
|
+
function Tt(i, t, e) {
|
|
3734
|
+
var s, r;
|
|
3735
|
+
return (r = (s = N(i)) == null ? void 0 : s[t]) != null ? r : e;
|
|
3782
3736
|
}
|
|
3783
|
-
function
|
|
3784
|
-
const
|
|
3785
|
-
if (
|
|
3786
|
-
const r =
|
|
3787
|
-
if (
|
|
3788
|
-
|
|
3737
|
+
function Gt(i, t, e) {
|
|
3738
|
+
const s = N(i);
|
|
3739
|
+
if (s) {
|
|
3740
|
+
const r = Tt(s, t);
|
|
3741
|
+
if (f(r) && f(e))
|
|
3742
|
+
d(e, (o, a) => {
|
|
3789
3743
|
r[a] = B(o);
|
|
3790
3744
|
});
|
|
3791
3745
|
else {
|
|
3792
3746
|
const o = B(e);
|
|
3793
|
-
!(t in
|
|
3747
|
+
!(t in s) && typeof o == "string" ? s.setAttribute(t.toString(), o) : s[t] = B(e);
|
|
3794
3748
|
}
|
|
3795
3749
|
}
|
|
3796
|
-
return
|
|
3750
|
+
return s;
|
|
3797
3751
|
}
|
|
3798
|
-
function
|
|
3752
|
+
function _(i, t = "div", e, s) {
|
|
3799
3753
|
if (!l())
|
|
3800
3754
|
return;
|
|
3801
3755
|
const r = document.createElement(t);
|
|
3802
|
-
return typeof e == "function" ? e(r) :
|
|
3803
|
-
|
|
3804
|
-
}),
|
|
3756
|
+
return typeof e == "function" ? e(r) : A(e) && d(e, (o, a) => {
|
|
3757
|
+
Gt(r, a, o);
|
|
3758
|
+
}), i == null || i.insertBefore(r, s != null ? s : null), r;
|
|
3805
3759
|
}
|
|
3806
|
-
function
|
|
3807
|
-
return
|
|
3760
|
+
function te(i) {
|
|
3761
|
+
return i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").trim();
|
|
3808
3762
|
}
|
|
3809
3763
|
class ht {
|
|
3810
3764
|
/**
|
|
@@ -3850,7 +3804,7 @@ class ht {
|
|
|
3850
3804
|
* Возвращает все мета-теги в виде HTML-строки.
|
|
3851
3805
|
*/
|
|
3852
3806
|
html() {
|
|
3853
|
-
return
|
|
3807
|
+
return d(
|
|
3854
3808
|
this.listMeta,
|
|
3855
3809
|
(e) => this.toHtmlString(e)
|
|
3856
3810
|
).join("");
|
|
@@ -3872,9 +3826,9 @@ class ht {
|
|
|
3872
3826
|
* @param metaList object with meta tag names and content / объект с именами и содержимым мета-тегов
|
|
3873
3827
|
*/
|
|
3874
3828
|
setByList(t) {
|
|
3875
|
-
return
|
|
3829
|
+
return d(
|
|
3876
3830
|
t,
|
|
3877
|
-
(e,
|
|
3831
|
+
(e, s) => this.set(s, String(e))
|
|
3878
3832
|
), this;
|
|
3879
3833
|
}
|
|
3880
3834
|
/**
|
|
@@ -3915,12 +3869,12 @@ class ht {
|
|
|
3915
3869
|
*/
|
|
3916
3870
|
setMeta(t) {
|
|
3917
3871
|
var r;
|
|
3918
|
-
const e = this.findMetaElement(t),
|
|
3872
|
+
const e = this.findMetaElement(t), s = (r = this.items[t]) != null ? r : "";
|
|
3919
3873
|
if (e)
|
|
3920
|
-
e.content =
|
|
3874
|
+
e.content = s;
|
|
3921
3875
|
else if (l()) {
|
|
3922
|
-
const o = { content:
|
|
3923
|
-
this.isProperty ? o.property = t : o.name = t,
|
|
3876
|
+
const o = { content: s };
|
|
3877
|
+
this.isProperty ? o.property = t : o.name = t, _(document.head, "meta", o);
|
|
3924
3878
|
}
|
|
3925
3879
|
return this;
|
|
3926
3880
|
}
|
|
@@ -3931,8 +3885,8 @@ class ht {
|
|
|
3931
3885
|
* @param name meta tag name / имя мета-тега
|
|
3932
3886
|
*/
|
|
3933
3887
|
toHtmlString(t) {
|
|
3934
|
-
var
|
|
3935
|
-
const e =
|
|
3888
|
+
var s;
|
|
3889
|
+
const e = te((s = this.items[t]) != null ? s : "");
|
|
3936
3890
|
return e ? `<meta ${this.getAttributeName()}="${t}" content="${e}">` : "";
|
|
3937
3891
|
}
|
|
3938
3892
|
/**
|
|
@@ -3942,15 +3896,15 @@ class ht {
|
|
|
3942
3896
|
*/
|
|
3943
3897
|
update() {
|
|
3944
3898
|
return this.listMeta.forEach((t) => {
|
|
3945
|
-
var e,
|
|
3946
|
-
this.items[t] = (
|
|
3899
|
+
var e, s;
|
|
3900
|
+
this.items[t] = (s = (e = this.findMetaElement(t)) == null ? void 0 : e.content) != null ? s : "";
|
|
3947
3901
|
}), this;
|
|
3948
3902
|
}
|
|
3949
3903
|
}
|
|
3950
|
-
var D = /* @__PURE__ */ ((
|
|
3951
|
-
class
|
|
3904
|
+
var D = /* @__PURE__ */ ((i) => (i.description = "description", i.keywords = "keywords", i.canonical = "canonical", i.robots = "robots", i.author = "author", i))(D || {}), ee = /* @__PURE__ */ ((i) => (i.indexFollow = "index, follow", i.noIndexFollow = "noindex, follow", i.indexNoFollow = "index, nofollow", i.noIndexNoFollow = "noindex, nofollow", i.noArchive = "noarchive", i.noSnippet = "nosnippet", i.noImageIndex = "noimageindex", i.images = "images", i.noTranslate = "notranslate", i.noPreview = "nopreview", i.textOnly = "textonly", i.noIndexSubpages = "noindex, noarchive", i.none = "none", i))(ee || {}), y = /* @__PURE__ */ ((i) => (i.title = "og:title", i.type = "og:type", i.url = "og:url", i.image = "og:image", i.description = "og:description", i.locale = "og:locale", i.siteName = "og:site_name", i.localeAlternate = "og:locale:alternate", i.imageUrl = "og:image:url", i.imageSecureUrl = "og:image:secure_url", i.imageType = "og:image:type", i.imageWidth = "og:image:width", i.imageHeight = "og:image:height", i.imageAlt = "og:image:alt", i.video = "og:video", i.videoUrl = "og:video:url", i.videoSecureUrl = "og:video:secure_url", i.videoType = "og:video:type", i.videoWidth = "og:video:width", i.videoHeight = "og:video:height", i.audio = "og:audio", i.audioSecureUrl = "og:audio:secure_url", i.audioType = "og:audio:type", i.articlePublishedTime = "article:published_time", i.articleModifiedTime = "article:modified_time", i.articleExpirationTime = "article:expiration_time", i.articleAuthor = "article:author", i.articleSection = "article:section", i.articleTag = "article:tag", i.bookAuthor = "book:author", i.bookIsbn = "book:isbn", i.bookReleaseDate = "book:release_date", i.bookTag = "book:tag", i.musicDuration = "music:duration", i.musicAlbum = "music:album", i.musicAlbumDisc = "music:album:disc", i.musicAlbumTrack = "music:album:track", i.musicMusician = "music:musician", i.musicSong = "music:song", i.musicSongDisc = "music:song:disc", i.musicSongTrack = "music:song:track", i.musicReleaseDate = "music:release_date", i.musicCreator = "music:creator", i.videoActor = "video:actor", i.videoActorRole = "video:actor:role", i.videoDirector = "video:director", i.videoWriter = "video:writer", i.videoDuration = "video:duration", i.videoReleaseDate = "video:release_date", i.videoTag = "video:tag", i.videoSeries = "video:series", i.profileFirstName = "profile:first_name", i.profileLastName = "profile:last_name", i.profileUsername = "profile:username", i.profileGender = "profile:gender", i.productBrand = "product:brand", i.productAvailability = "product:availability", i.productCondition = "product:condition", i.productPriceAmount = "product:price:amount", i.productPriceCurrency = "product:price:currency", i.productRetailerItemId = "product:retailer_item_id", i.productCategory = "product:category", i.productEan = "product:ean", i.productIsbn = "product:isbn", i.productMfrPartNo = "product:mfr_part_no", i.productUpc = "product:upc", i.productWeightValue = "product:weight:value", i.productWeightUnits = "product:weight:units", i.productColor = "product:color", i.productMaterial = "product:material", i.productPattern = "product:pattern", i.productAgeGroup = "product:age_group", i.productGender = "product:gender", i))(y || {}), ie = /* @__PURE__ */ ((i) => (i.website = "website", i.article = "article", i.video = "video.other", i.videoTvShow = "video.tv_show", i.videoEpisode = "video.episode", i.videoMovie = "video.movie", i.musicAlbum = "music.album", i.musicPlaylist = "music.playlist", i.musicSong = "music.song", i.musicRadioStation = "music.radio_station", i.app = "app", i.product = "product", i.business = "business.business", i.place = "place", i.event = "event", i.profile = "profile", i.book = "book", i))(ie || {}), se = /* @__PURE__ */ ((i) => (i.inStock = "in stock", i.outOfStock = "out of stock", i.preorder = "preorder", i.backorder = "backorder", i.discontinued = "discontinued", i.pending = "pending", i))(se || {}), re = /* @__PURE__ */ ((i) => (i.new = "new", i.used = "used", i.refurbished = "refurbished", i))(re || {}), ne = /* @__PURE__ */ ((i) => (i.newborn = "newborn", i.infant = "infant", i.toddler = "toddler", i.kids = "kids", i.adult = "adult", i))(ne || {}), oe = /* @__PURE__ */ ((i) => (i.female = "female", i.male = "male", i.unisex = "unisex", i))(oe || {}), $ = /* @__PURE__ */ ((i) => (i.card = "twitter:card", i.site = "twitter:site", i.creator = "twitter:creator", i.url = "twitter:url", i.title = "twitter:title", i.description = "twitter:description", i.image = "twitter:image", i.imageAlt = "twitter:image:alt", i.imageSrc = "twitter:image:src", i.imageWidth = "twitter:image:width", i.imageHeight = "twitter:image:height", i.label1 = "twitter:label1", i.data1 = "twitter:data1", i.label2 = "twitter:label2", i.data2 = "twitter:data2", i.appNameIphone = "twitter:app:name:iphone", i.appIdIphone = "twitter:app:id:iphone", i.appUrlIphone = "twitter:app:url:iphone", i.appNameIpad = "twitter:app:name:ipad", i.appIdIpad = "twitter:app:id:ipad", i.appUrlIpad = "twitter:app:url:ipad", i.appNameGooglePlay = "twitter:app:name:googleplay", i.appIdGooglePlay = "twitter:app:id:googleplay", i.appUrlGooglePlay = "twitter:app:url:googleplay", i.player = "twitter:player", i.playerWidth = "twitter:player:width", i.playerHeight = "twitter:player:height", i.playerStream = "twitter:player:stream", i.playerStreamContentType = "twitter:player:stream:content_type", i))($ || {}), ae = /* @__PURE__ */ ((i) => (i.summary = "summary", i.summaryLargeImage = "summary_large_image", i.app = "app", i.player = "player", i.product = "product", i.gallery = "gallery", i.photo = "photo", i.leadGeneration = "lead_generation", i.audio = "audio", i.poll = "poll", i))(ae || {});
|
|
3905
|
+
class ce extends ht {
|
|
3952
3906
|
constructor() {
|
|
3953
|
-
super(Object.values(
|
|
3907
|
+
super(Object.values(y), !0);
|
|
3954
3908
|
}
|
|
3955
3909
|
/**
|
|
3956
3910
|
* Gets the Open Graph title.
|
|
@@ -3958,7 +3912,7 @@ class ae extends ht {
|
|
|
3958
3912
|
* Получает заголовок Open Graph.
|
|
3959
3913
|
*/
|
|
3960
3914
|
getTitle() {
|
|
3961
|
-
return this.get(
|
|
3915
|
+
return this.get(y.title);
|
|
3962
3916
|
}
|
|
3963
3917
|
/**
|
|
3964
3918
|
* Gets the Open Graph type.
|
|
@@ -3966,7 +3920,7 @@ class ae extends ht {
|
|
|
3966
3920
|
* Получает тип Open Graph.
|
|
3967
3921
|
*/
|
|
3968
3922
|
getType() {
|
|
3969
|
-
return this.get(
|
|
3923
|
+
return this.get(y.type);
|
|
3970
3924
|
}
|
|
3971
3925
|
/**
|
|
3972
3926
|
* Gets the Open Graph URL.
|
|
@@ -3974,7 +3928,7 @@ class ae extends ht {
|
|
|
3974
3928
|
* Получает URL Open Graph.
|
|
3975
3929
|
*/
|
|
3976
3930
|
getUrl() {
|
|
3977
|
-
return this.get(
|
|
3931
|
+
return this.get(y.url);
|
|
3978
3932
|
}
|
|
3979
3933
|
/**
|
|
3980
3934
|
* Gets the Open Graph image URL.
|
|
@@ -3982,7 +3936,7 @@ class ae extends ht {
|
|
|
3982
3936
|
* Получает URL изображения Open Graph.
|
|
3983
3937
|
*/
|
|
3984
3938
|
getImage() {
|
|
3985
|
-
return this.get(
|
|
3939
|
+
return this.get(y.image);
|
|
3986
3940
|
}
|
|
3987
3941
|
/**
|
|
3988
3942
|
* Gets the Open Graph description.
|
|
@@ -3990,7 +3944,7 @@ class ae extends ht {
|
|
|
3990
3944
|
* Получает описание Open Graph.
|
|
3991
3945
|
*/
|
|
3992
3946
|
getDescription() {
|
|
3993
|
-
return this.get(
|
|
3947
|
+
return this.get(y.description);
|
|
3994
3948
|
}
|
|
3995
3949
|
/**
|
|
3996
3950
|
* Gets the Open Graph locale.
|
|
@@ -3998,7 +3952,7 @@ class ae extends ht {
|
|
|
3998
3952
|
* Получает локаль Open Graph.
|
|
3999
3953
|
*/
|
|
4000
3954
|
getLocale() {
|
|
4001
|
-
return this.get(
|
|
3955
|
+
return this.get(y.locale);
|
|
4002
3956
|
}
|
|
4003
3957
|
/**
|
|
4004
3958
|
* Gets the Open Graph site name.
|
|
@@ -4006,7 +3960,7 @@ class ae extends ht {
|
|
|
4006
3960
|
* Получает название сайта Open Graph.
|
|
4007
3961
|
*/
|
|
4008
3962
|
getSiteName() {
|
|
4009
|
-
return this.get(
|
|
3963
|
+
return this.get(y.siteName);
|
|
4010
3964
|
}
|
|
4011
3965
|
/**
|
|
4012
3966
|
* Sets the Open Graph title.
|
|
@@ -4015,7 +3969,7 @@ class ae extends ht {
|
|
|
4015
3969
|
* @param title title / заголовок
|
|
4016
3970
|
*/
|
|
4017
3971
|
setTitle(t) {
|
|
4018
|
-
return this.set(
|
|
3972
|
+
return this.set(y.title, t);
|
|
4019
3973
|
}
|
|
4020
3974
|
/**
|
|
4021
3975
|
* Sets the Open Graph type.
|
|
@@ -4024,7 +3978,7 @@ class ae extends ht {
|
|
|
4024
3978
|
* @param type type / тип
|
|
4025
3979
|
*/
|
|
4026
3980
|
setType(t) {
|
|
4027
|
-
return this.set(
|
|
3981
|
+
return this.set(y.type, t);
|
|
4028
3982
|
}
|
|
4029
3983
|
/**
|
|
4030
3984
|
* Sets the Open Graph URL.
|
|
@@ -4033,7 +3987,7 @@ class ae extends ht {
|
|
|
4033
3987
|
* @param url URL / URL
|
|
4034
3988
|
*/
|
|
4035
3989
|
setUrl(t) {
|
|
4036
|
-
return this.set(
|
|
3990
|
+
return this.set(y.url, t);
|
|
4037
3991
|
}
|
|
4038
3992
|
/**
|
|
4039
3993
|
* Sets the Open Graph image URL.
|
|
@@ -4042,7 +3996,7 @@ class ae extends ht {
|
|
|
4042
3996
|
* @param url image URL / URL изображения
|
|
4043
3997
|
*/
|
|
4044
3998
|
setImage(t) {
|
|
4045
|
-
return this.set(
|
|
3999
|
+
return this.set(y.image, t);
|
|
4046
4000
|
}
|
|
4047
4001
|
/**
|
|
4048
4002
|
* Sets the Open Graph description.
|
|
@@ -4051,7 +4005,7 @@ class ae extends ht {
|
|
|
4051
4005
|
* @param description description / описание
|
|
4052
4006
|
*/
|
|
4053
4007
|
setDescription(t) {
|
|
4054
|
-
return this.set(
|
|
4008
|
+
return this.set(y.description, t);
|
|
4055
4009
|
}
|
|
4056
4010
|
/**
|
|
4057
4011
|
* Sets the Open Graph locale.
|
|
@@ -4060,7 +4014,7 @@ class ae extends ht {
|
|
|
4060
4014
|
* @param locale locale (e.g. 'en_US', 'ru_RU') / локаль (например, 'en_US', 'ru_RU')
|
|
4061
4015
|
*/
|
|
4062
4016
|
setLocale(t) {
|
|
4063
|
-
return this.set(
|
|
4017
|
+
return this.set(y.locale, t);
|
|
4064
4018
|
}
|
|
4065
4019
|
/**
|
|
4066
4020
|
* Sets the Open Graph site name.
|
|
@@ -4069,12 +4023,12 @@ class ae extends ht {
|
|
|
4069
4023
|
* @param siteName site name / название сайта
|
|
4070
4024
|
*/
|
|
4071
4025
|
setSiteName(t) {
|
|
4072
|
-
return this.set(
|
|
4026
|
+
return this.set(y.siteName, t);
|
|
4073
4027
|
}
|
|
4074
4028
|
}
|
|
4075
|
-
class
|
|
4029
|
+
class ue extends ht {
|
|
4076
4030
|
constructor() {
|
|
4077
|
-
super(Object.values(
|
|
4031
|
+
super(Object.values($));
|
|
4078
4032
|
}
|
|
4079
4033
|
/**
|
|
4080
4034
|
* Gets the Twitter Card type.
|
|
@@ -4082,7 +4036,7 @@ class ce extends ht {
|
|
|
4082
4036
|
* Получает тип Twitter Card.
|
|
4083
4037
|
*/
|
|
4084
4038
|
getCard() {
|
|
4085
|
-
return this.get(
|
|
4039
|
+
return this.get($.card);
|
|
4086
4040
|
}
|
|
4087
4041
|
/**
|
|
4088
4042
|
* Gets the website or brand @username.
|
|
@@ -4090,7 +4044,7 @@ class ce extends ht {
|
|
|
4090
4044
|
* Получает аккаунт сайта или бренда (@username).
|
|
4091
4045
|
*/
|
|
4092
4046
|
getSite() {
|
|
4093
|
-
return this.get(
|
|
4047
|
+
return this.get($.site);
|
|
4094
4048
|
}
|
|
4095
4049
|
/**
|
|
4096
4050
|
* Gets the content creator @username.
|
|
@@ -4098,7 +4052,7 @@ class ce extends ht {
|
|
|
4098
4052
|
* Получает автора контента (@username).
|
|
4099
4053
|
*/
|
|
4100
4054
|
getCreator() {
|
|
4101
|
-
return this.get(
|
|
4055
|
+
return this.get($.creator);
|
|
4102
4056
|
}
|
|
4103
4057
|
/**
|
|
4104
4058
|
* Gets the page URL.
|
|
@@ -4106,7 +4060,7 @@ class ce extends ht {
|
|
|
4106
4060
|
* Получает URL страницы.
|
|
4107
4061
|
*/
|
|
4108
4062
|
getUrl() {
|
|
4109
|
-
return this.get(
|
|
4063
|
+
return this.get($.url);
|
|
4110
4064
|
}
|
|
4111
4065
|
/**
|
|
4112
4066
|
* Gets the card title.
|
|
@@ -4114,7 +4068,7 @@ class ce extends ht {
|
|
|
4114
4068
|
* Получает заголовок карточки.
|
|
4115
4069
|
*/
|
|
4116
4070
|
getTitle() {
|
|
4117
|
-
return this.get(
|
|
4071
|
+
return this.get($.title);
|
|
4118
4072
|
}
|
|
4119
4073
|
/**
|
|
4120
4074
|
* Gets the card description.
|
|
@@ -4122,7 +4076,7 @@ class ce extends ht {
|
|
|
4122
4076
|
* Получает описание карточки.
|
|
4123
4077
|
*/
|
|
4124
4078
|
getDescription() {
|
|
4125
|
-
return this.get(
|
|
4079
|
+
return this.get($.description);
|
|
4126
4080
|
}
|
|
4127
4081
|
/**
|
|
4128
4082
|
* Gets the card image URL.
|
|
@@ -4130,7 +4084,7 @@ class ce extends ht {
|
|
|
4130
4084
|
* Получает URL изображения карточки.
|
|
4131
4085
|
*/
|
|
4132
4086
|
getImage() {
|
|
4133
|
-
return this.get(
|
|
4087
|
+
return this.get($.image);
|
|
4134
4088
|
}
|
|
4135
4089
|
/**
|
|
4136
4090
|
* Sets the Twitter Card type.
|
|
@@ -4139,7 +4093,7 @@ class ce extends ht {
|
|
|
4139
4093
|
* @param card card type / тип карточки
|
|
4140
4094
|
*/
|
|
4141
4095
|
setCard(t) {
|
|
4142
|
-
return this.set(
|
|
4096
|
+
return this.set($.card, t), this;
|
|
4143
4097
|
}
|
|
4144
4098
|
/**
|
|
4145
4099
|
* Sets the website or brand @username.
|
|
@@ -4148,7 +4102,7 @@ class ce extends ht {
|
|
|
4148
4102
|
* @param site @username / аккаунт
|
|
4149
4103
|
*/
|
|
4150
4104
|
setSite(t) {
|
|
4151
|
-
return this.set(
|
|
4105
|
+
return this.set($.site, t), this;
|
|
4152
4106
|
}
|
|
4153
4107
|
/**
|
|
4154
4108
|
* Sets the content creator @username.
|
|
@@ -4157,7 +4111,7 @@ class ce extends ht {
|
|
|
4157
4111
|
* @param creator @username / аккаунт автора
|
|
4158
4112
|
*/
|
|
4159
4113
|
setCreator(t) {
|
|
4160
|
-
return this.set(
|
|
4114
|
+
return this.set($.creator, t), this;
|
|
4161
4115
|
}
|
|
4162
4116
|
/**
|
|
4163
4117
|
* Sets the page URL.
|
|
@@ -4166,7 +4120,7 @@ class ce extends ht {
|
|
|
4166
4120
|
* @param url URL / URL
|
|
4167
4121
|
*/
|
|
4168
4122
|
setUrl(t) {
|
|
4169
|
-
return this.set(
|
|
4123
|
+
return this.set($.url, t), this;
|
|
4170
4124
|
}
|
|
4171
4125
|
/**
|
|
4172
4126
|
* Sets the card title.
|
|
@@ -4175,7 +4129,7 @@ class ce extends ht {
|
|
|
4175
4129
|
* @param title title / заголовок
|
|
4176
4130
|
*/
|
|
4177
4131
|
setTitle(t) {
|
|
4178
|
-
return this.set(
|
|
4132
|
+
return this.set($.title, t), this;
|
|
4179
4133
|
}
|
|
4180
4134
|
/**
|
|
4181
4135
|
* Sets the card description.
|
|
@@ -4184,7 +4138,7 @@ class ce extends ht {
|
|
|
4184
4138
|
* @param description description / описание
|
|
4185
4139
|
*/
|
|
4186
4140
|
setDescription(t) {
|
|
4187
|
-
return this.set(
|
|
4141
|
+
return this.set($.description, t), this;
|
|
4188
4142
|
}
|
|
4189
4143
|
/**
|
|
4190
4144
|
* Sets the card image URL.
|
|
@@ -4193,10 +4147,10 @@ class ce extends ht {
|
|
|
4193
4147
|
* @param image image URL / URL изображения
|
|
4194
4148
|
*/
|
|
4195
4149
|
setImage(t) {
|
|
4196
|
-
return this.set(
|
|
4150
|
+
return this.set($.image, t), this;
|
|
4197
4151
|
}
|
|
4198
4152
|
}
|
|
4199
|
-
class
|
|
4153
|
+
class Fe extends ht {
|
|
4200
4154
|
/**
|
|
4201
4155
|
* Creates an instance of Meta with integrated Open Graph and Twitter Card support.
|
|
4202
4156
|
*
|
|
@@ -4207,7 +4161,7 @@ class xe extends ht {
|
|
|
4207
4161
|
c(this, "suffix");
|
|
4208
4162
|
c(this, "og");
|
|
4209
4163
|
c(this, "twitter");
|
|
4210
|
-
this.og = new
|
|
4164
|
+
this.og = new ce(), this.twitter = new ue();
|
|
4211
4165
|
}
|
|
4212
4166
|
/**
|
|
4213
4167
|
* Gets the MetaOg instance for advanced Open Graph operations.
|
|
@@ -4305,8 +4259,8 @@ class xe extends ht {
|
|
|
4305
4259
|
*/
|
|
4306
4260
|
setTitle(e) {
|
|
4307
4261
|
if (l()) {
|
|
4308
|
-
const
|
|
4309
|
-
document.title =
|
|
4262
|
+
const s = w(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
|
|
4263
|
+
document.title = s, this.og.setTitle(s), this.twitter.setTitle(s);
|
|
4310
4264
|
}
|
|
4311
4265
|
return this;
|
|
4312
4266
|
}
|
|
@@ -4317,7 +4271,7 @@ class xe extends ht {
|
|
|
4317
4271
|
* @param keywords keywords as string or array / ключевые слова в виде строки или массива
|
|
4318
4272
|
*/
|
|
4319
4273
|
setKeywords(e) {
|
|
4320
|
-
return this.set(D.keywords,
|
|
4274
|
+
return this.set(D.keywords, z(e).join(", ")), this;
|
|
4321
4275
|
}
|
|
4322
4276
|
/**
|
|
4323
4277
|
* Sets the description meta tag.
|
|
@@ -4405,7 +4359,7 @@ class xe extends ht {
|
|
|
4405
4359
|
* Получает отформатированный суффикс с разделителем.
|
|
4406
4360
|
*/
|
|
4407
4361
|
getSuffix() {
|
|
4408
|
-
return
|
|
4362
|
+
return w(this.suffix) ? ` - ${this.suffix}` : "";
|
|
4409
4363
|
}
|
|
4410
4364
|
}
|
|
4411
4365
|
class ot {
|
|
@@ -4427,8 +4381,8 @@ class ot {
|
|
|
4427
4381
|
var e;
|
|
4428
4382
|
const t = (e = this.storage.get()) != null ? e : -1;
|
|
4429
4383
|
if (!this.calculate && t === -1) {
|
|
4430
|
-
const
|
|
4431
|
-
return this.storage.set(
|
|
4384
|
+
const s = await this.init();
|
|
4385
|
+
return this.storage.set(s), s;
|
|
4432
4386
|
}
|
|
4433
4387
|
return t;
|
|
4434
4388
|
}
|
|
@@ -4438,8 +4392,8 @@ class ot {
|
|
|
4438
4392
|
* Создает элементы для проверки ширины скролла.
|
|
4439
4393
|
*/
|
|
4440
4394
|
static createElement() {
|
|
4441
|
-
return
|
|
4442
|
-
t.style.height = "24px", t.style.overflowY = "scroll", t.style.position = "fixed", t.style.width = "100%",
|
|
4395
|
+
return _(document.body, "div", (t) => {
|
|
4396
|
+
t.style.height = "24px", t.style.overflowY = "scroll", t.style.position = "fixed", t.style.width = "100%", _(t, "div", (e) => {
|
|
4443
4397
|
e.style.height = "100px";
|
|
4444
4398
|
});
|
|
4445
4399
|
});
|
|
@@ -4459,8 +4413,8 @@ class ot {
|
|
|
4459
4413
|
});
|
|
4460
4414
|
}
|
|
4461
4415
|
}
|
|
4462
|
-
c(ot, "storage", new
|
|
4463
|
-
const
|
|
4416
|
+
c(ot, "storage", new T("scrollbar", !0)), c(ot, "calculate", !1);
|
|
4417
|
+
const he = [
|
|
4464
4418
|
"d",
|
|
4465
4419
|
"e",
|
|
4466
4420
|
"f",
|
|
@@ -4480,21 +4434,21 @@ const ue = [
|
|
|
4480
4434
|
"t",
|
|
4481
4435
|
"u",
|
|
4482
4436
|
"v"
|
|
4483
|
-
],
|
|
4484
|
-
let e = String(
|
|
4485
|
-
if (
|
|
4486
|
-
let
|
|
4487
|
-
|
|
4488
|
-
e = e.replace(new RegExp(`%${
|
|
4437
|
+
], le = (i, t = {}) => {
|
|
4438
|
+
let e = String(i);
|
|
4439
|
+
if (i.match(/%[a-z]/)) {
|
|
4440
|
+
let s = 0;
|
|
4441
|
+
d(t, (r) => {
|
|
4442
|
+
e = e.replace(new RegExp(`%${he[s++]}`, "g"), String(r));
|
|
4489
4443
|
});
|
|
4490
4444
|
}
|
|
4491
|
-
return
|
|
4445
|
+
return A(t) && d(t, (s, r) => {
|
|
4492
4446
|
e = e.replace(
|
|
4493
4447
|
new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})(.*?)(?:\\[|\\{)\\/${r}(?:\\]|\\})`, "g"),
|
|
4494
|
-
(o, a) => String(
|
|
4495
|
-
).replace(new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})`, "g"), String(
|
|
4448
|
+
(o, a) => String(s).replace(/(?:\[|\{)content(?:\]|\})/g, a)
|
|
4449
|
+
).replace(new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})`, "g"), String(s));
|
|
4496
4450
|
}), e;
|
|
4497
|
-
},
|
|
4451
|
+
}, ge = "global", E = class E {
|
|
4498
4452
|
/**
|
|
4499
4453
|
* Getting the translation text by its code.
|
|
4500
4454
|
*
|
|
@@ -4504,8 +4458,8 @@ const ue = [
|
|
|
4504
4458
|
*/
|
|
4505
4459
|
static async get(t, e) {
|
|
4506
4460
|
var r;
|
|
4507
|
-
const
|
|
4508
|
-
return
|
|
4461
|
+
const s = this.getText(t);
|
|
4462
|
+
return s ? this.replacement(s, e) : (H.isLocalhost() || await this.add(t), this.replacement((r = this.getText(t)) != null ? r : t));
|
|
4509
4463
|
}
|
|
4510
4464
|
/**
|
|
4511
4465
|
* Getting the translation text by its code (Sync).
|
|
@@ -4517,9 +4471,9 @@ const ue = [
|
|
|
4517
4471
|
* @param replacement If set, replaces the text with the specified values/
|
|
4518
4472
|
* если установлено, заменяет текст на указанные значения
|
|
4519
4473
|
*/
|
|
4520
|
-
static getSync(t, e = !1,
|
|
4474
|
+
static getSync(t, e = !1, s) {
|
|
4521
4475
|
const r = this.getText(t);
|
|
4522
|
-
return r ? this.replacement(r,
|
|
4476
|
+
return r ? this.replacement(r, s) : e ? " " : t;
|
|
4523
4477
|
}
|
|
4524
4478
|
/**
|
|
4525
4479
|
* Getting a list of translations by an array of text codes.
|
|
@@ -4529,12 +4483,12 @@ const ue = [
|
|
|
4529
4483
|
*/
|
|
4530
4484
|
static getList(t) {
|
|
4531
4485
|
return new Promise((e) => {
|
|
4532
|
-
const
|
|
4486
|
+
const s = {};
|
|
4533
4487
|
let r = 0;
|
|
4534
4488
|
for (const o of t) {
|
|
4535
4489
|
const a = Array.isArray(o) ? o[0] : o, u = Array.isArray(o) ? o.slice(1) : void 0;
|
|
4536
4490
|
this.get(a, u).then((h) => {
|
|
4537
|
-
|
|
4491
|
+
s[a] = h, ++r >= t.length && e(s);
|
|
4538
4492
|
});
|
|
4539
4493
|
}
|
|
4540
4494
|
});
|
|
@@ -4548,12 +4502,12 @@ const ue = [
|
|
|
4548
4502
|
* если установлено false, возвращает пустую строку, если нет текста
|
|
4549
4503
|
*/
|
|
4550
4504
|
static getListSync(t, e = !1) {
|
|
4551
|
-
const
|
|
4505
|
+
const s = {};
|
|
4552
4506
|
for (const r of t) {
|
|
4553
4507
|
const o = Array.isArray(r) ? r[0] : r, a = Array.isArray(r) ? r.slice(1) : void 0;
|
|
4554
|
-
|
|
4508
|
+
s[o] = this.getSync(o, e, a);
|
|
4555
4509
|
}
|
|
4556
|
-
return
|
|
4510
|
+
return s;
|
|
4557
4511
|
}
|
|
4558
4512
|
/**
|
|
4559
4513
|
* Added a list of translated texts.
|
|
@@ -4577,8 +4531,8 @@ const ue = [
|
|
|
4577
4531
|
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4578
4532
|
*/
|
|
4579
4533
|
static addSync(t) {
|
|
4580
|
-
|
|
4581
|
-
|
|
4534
|
+
d(t, (e, s) => {
|
|
4535
|
+
R(e) && w(e) && (this.data[this.getName(s)] = e);
|
|
4582
4536
|
});
|
|
4583
4537
|
}
|
|
4584
4538
|
/**
|
|
@@ -4588,8 +4542,8 @@ const ue = [
|
|
|
4588
4542
|
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4589
4543
|
*/
|
|
4590
4544
|
static async addNormalOrSync(t) {
|
|
4591
|
-
if (
|
|
4592
|
-
if (
|
|
4545
|
+
if (w(t))
|
|
4546
|
+
if (H.isLocalhost())
|
|
4593
4547
|
this.addSync(t);
|
|
4594
4548
|
else {
|
|
4595
4549
|
const e = Object.keys(t);
|
|
@@ -4603,10 +4557,10 @@ const ue = [
|
|
|
4603
4557
|
* @param data list of texts by location/ список текстов по местоположению
|
|
4604
4558
|
*/
|
|
4605
4559
|
static addSyncByLocation(t) {
|
|
4606
|
-
|
|
4560
|
+
d(
|
|
4607
4561
|
t,
|
|
4608
|
-
(e,
|
|
4609
|
-
const a = `${
|
|
4562
|
+
(e, s) => d(e, (r, o) => {
|
|
4563
|
+
const a = `${s}-${o}`;
|
|
4610
4564
|
a in this.data || (this.data[a] = r);
|
|
4611
4565
|
})
|
|
4612
4566
|
);
|
|
@@ -4642,9 +4596,9 @@ const ue = [
|
|
|
4642
4596
|
const e = this.getName(t);
|
|
4643
4597
|
if (e in this.data)
|
|
4644
4598
|
return this.data[e];
|
|
4645
|
-
const
|
|
4646
|
-
if (
|
|
4647
|
-
return this.data[
|
|
4599
|
+
const s = this.getNameByLanguage(t);
|
|
4600
|
+
if (s in this.data)
|
|
4601
|
+
return this.data[s];
|
|
4648
4602
|
const r = this.getNameByGlobal(t);
|
|
4649
4603
|
if (r in this.data)
|
|
4650
4604
|
return this.data[r];
|
|
@@ -4656,7 +4610,7 @@ const ue = [
|
|
|
4656
4610
|
* @param name code name/ название кода
|
|
4657
4611
|
*/
|
|
4658
4612
|
static getName(t) {
|
|
4659
|
-
return `${
|
|
4613
|
+
return `${p.getLocation()}-${t}`;
|
|
4660
4614
|
}
|
|
4661
4615
|
/**
|
|
4662
4616
|
* Getting the title for translation by language.
|
|
@@ -4665,7 +4619,7 @@ const ue = [
|
|
|
4665
4619
|
* @param name code name/ название кода
|
|
4666
4620
|
*/
|
|
4667
4621
|
static getNameByLanguage(t) {
|
|
4668
|
-
return `${
|
|
4622
|
+
return `${p.getLanguage()}-${t}`;
|
|
4669
4623
|
}
|
|
4670
4624
|
/**
|
|
4671
4625
|
* Getting the title for translation globally.
|
|
@@ -4674,7 +4628,7 @@ const ue = [
|
|
|
4674
4628
|
* @param name code name/ название кода
|
|
4675
4629
|
*/
|
|
4676
4630
|
static getNameByGlobal(t) {
|
|
4677
|
-
return `${
|
|
4631
|
+
return `${ge}-${t}`;
|
|
4678
4632
|
}
|
|
4679
4633
|
/**
|
|
4680
4634
|
* Returns a list of names that are not yet in the list.
|
|
@@ -4684,8 +4638,8 @@ const ue = [
|
|
|
4684
4638
|
*/
|
|
4685
4639
|
static getNamesNone(t) {
|
|
4686
4640
|
const e = [];
|
|
4687
|
-
return
|
|
4688
|
-
|
|
4641
|
+
return z(t).forEach((s) => {
|
|
4642
|
+
s !== "__TRANSLATE_START__" && s !== "__TRANSLATE_END__" && !(this.getName(s) in this.data) && e.push(s);
|
|
4689
4643
|
}), e;
|
|
4690
4644
|
}
|
|
4691
4645
|
/**
|
|
@@ -4694,7 +4648,7 @@ const ue = [
|
|
|
4694
4648
|
* Получение списка переводов с сервера.
|
|
4695
4649
|
*/
|
|
4696
4650
|
static async getResponse() {
|
|
4697
|
-
const t = await
|
|
4651
|
+
const t = await H.get({
|
|
4698
4652
|
api: !1,
|
|
4699
4653
|
path: this.url,
|
|
4700
4654
|
request: {
|
|
@@ -4713,7 +4667,7 @@ const ue = [
|
|
|
4713
4667
|
* @param replacement values for replacement/ значения для замены
|
|
4714
4668
|
*/
|
|
4715
4669
|
static replacement(t, e) {
|
|
4716
|
-
return e ?
|
|
4670
|
+
return e ? le(t, e) : t;
|
|
4717
4671
|
}
|
|
4718
4672
|
/**
|
|
4719
4673
|
* Adding translation data from the server.
|
|
@@ -4723,493 +4677,504 @@ const ue = [
|
|
|
4723
4677
|
static async make() {
|
|
4724
4678
|
const t = await this.getResponse();
|
|
4725
4679
|
this.cache.forEach((e) => {
|
|
4726
|
-
var
|
|
4727
|
-
this.data[this.getName(e)] = (
|
|
4680
|
+
var s;
|
|
4681
|
+
this.data[this.getName(e)] = (s = t == null ? void 0 : t[e]) != null ? s : "";
|
|
4728
4682
|
}), this.cache = [];
|
|
4729
4683
|
}
|
|
4730
4684
|
};
|
|
4731
4685
|
c(E, "url", "/api/translate"), c(E, "propsName", "list"), c(E, "data", {}), c(E, "cache", []), c(E, "resolveList", []), c(E, "timeout");
|
|
4732
|
-
let
|
|
4733
|
-
function de(
|
|
4686
|
+
let Nt = E;
|
|
4687
|
+
function de(i) {
|
|
4734
4688
|
var t;
|
|
4735
|
-
return
|
|
4689
|
+
return R(i) ? i.trim() : at(i) && i.findIndex((e) => f(e)) === -1 ? i.join(",") : f(i) ? JSON.stringify(i) : i === !0 ? "1" : i === !1 ? "0" : (t = i == null ? void 0 : i.toString()) != null ? t : "";
|
|
4736
4690
|
}
|
|
4737
|
-
function
|
|
4738
|
-
return Array(t).fill(
|
|
4691
|
+
function fe(i, t) {
|
|
4692
|
+
return Array(t).fill(i);
|
|
4739
4693
|
}
|
|
4740
|
-
function
|
|
4694
|
+
function xe(i) {
|
|
4741
4695
|
return new Promise((t, e) => {
|
|
4742
|
-
const
|
|
4743
|
-
|
|
4696
|
+
const s = new FileReader();
|
|
4697
|
+
s.onloadend = () => t(s.result), s.onerror = e, s.readAsDataURL(i);
|
|
4744
4698
|
});
|
|
4745
4699
|
}
|
|
4746
|
-
function Re(
|
|
4700
|
+
function Re(i) {
|
|
4747
4701
|
var t;
|
|
4748
4702
|
if (l())
|
|
4749
|
-
return (t = document.querySelector(
|
|
4703
|
+
return (t = document.querySelector(i)) != null ? t : void 0;
|
|
4750
4704
|
}
|
|
4751
|
-
function Pe(
|
|
4705
|
+
function Pe(i) {
|
|
4752
4706
|
if (l())
|
|
4753
|
-
return document.querySelectorAll(
|
|
4707
|
+
return document.querySelectorAll(i);
|
|
4708
|
+
}
|
|
4709
|
+
function Pt(i) {
|
|
4710
|
+
return i.replace(/([[\]\\^$.?*+(){}/|])/g, "\\$1");
|
|
4754
4711
|
}
|
|
4755
|
-
function We(
|
|
4756
|
-
|
|
4712
|
+
function We(i) {
|
|
4713
|
+
i.preventDefault(), i.stopPropagation();
|
|
4757
4714
|
}
|
|
4758
|
-
function
|
|
4759
|
-
const
|
|
4760
|
-
|
|
4715
|
+
function me(i, t, e) {
|
|
4716
|
+
const s = () => {
|
|
4717
|
+
i(), t != null && t() ? me(i, t, e) : e == null || e();
|
|
4761
4718
|
};
|
|
4762
|
-
l() ? requestAnimationFrame(
|
|
4719
|
+
l() ? requestAnimationFrame(s) : s();
|
|
4763
4720
|
}
|
|
4764
|
-
function
|
|
4765
|
-
var
|
|
4766
|
-
const t = {}, e =
|
|
4721
|
+
function je(i) {
|
|
4722
|
+
var s;
|
|
4723
|
+
const t = {}, e = N(i);
|
|
4767
4724
|
if (e)
|
|
4768
4725
|
for (const r of e.attributes)
|
|
4769
|
-
t[r.name] = (
|
|
4726
|
+
t[r.name] = (s = (r == null ? void 0 : r.value) || (r == null ? void 0 : r.textContent)) != null ? s : void 0;
|
|
4770
4727
|
return t;
|
|
4771
4728
|
}
|
|
4772
|
-
async function
|
|
4729
|
+
async function Ue(i) {
|
|
4773
4730
|
var t, e;
|
|
4774
|
-
return (e = (t =
|
|
4731
|
+
return (e = (t = i == null ? void 0 : i.clipboardData) == null ? void 0 : t.getData("text")) != null ? e : await navigator.clipboard.readText() || "";
|
|
4775
4732
|
}
|
|
4776
|
-
function He(
|
|
4777
|
-
return new ut(void 0,
|
|
4733
|
+
function He(i = "datetime") {
|
|
4734
|
+
return new ut(void 0, i).standard();
|
|
4778
4735
|
}
|
|
4779
|
-
let
|
|
4780
|
-
function ze(
|
|
4781
|
-
const e =
|
|
4782
|
-
return e ? (
|
|
4736
|
+
let At = q(1e5, 9e5);
|
|
4737
|
+
function ze(i, t) {
|
|
4738
|
+
const e = N(i);
|
|
4739
|
+
return e ? (w(e.id) || e.setAttribute("id", `id-${At++}`), t ? `#${e.id}${t}`.trim() : e.id) : `id-${At++}`;
|
|
4783
4740
|
}
|
|
4784
|
-
function
|
|
4785
|
-
return
|
|
4741
|
+
function ye(i) {
|
|
4742
|
+
return R(i) ? _(
|
|
4786
4743
|
void 0,
|
|
4787
4744
|
"img",
|
|
4788
|
-
{ src:
|
|
4789
|
-
) :
|
|
4745
|
+
{ src: i }
|
|
4746
|
+
) : i;
|
|
4790
4747
|
}
|
|
4791
|
-
function
|
|
4792
|
-
const
|
|
4793
|
-
return new RegExp(e.replace(/:value/g,
|
|
4748
|
+
function $e(i, t = "ig", e = ":value") {
|
|
4749
|
+
const s = Pt(i);
|
|
4750
|
+
return new RegExp(e.replace(/:value/g, s), t);
|
|
4794
4751
|
}
|
|
4795
|
-
function
|
|
4796
|
-
const
|
|
4752
|
+
function pe(i, t, e) {
|
|
4753
|
+
const s = de(i);
|
|
4797
4754
|
if (!e || e <= 0)
|
|
4798
|
-
return
|
|
4799
|
-
const r =
|
|
4755
|
+
return s.split(t);
|
|
4756
|
+
const r = s.split(t, e), o = s.split(t);
|
|
4800
4757
|
return r.length === o.length ? r : (r.pop(), [
|
|
4801
4758
|
...r,
|
|
4802
4759
|
o.slice(e - 1).join(t)
|
|
4803
4760
|
]);
|
|
4804
4761
|
}
|
|
4805
|
-
function
|
|
4762
|
+
function be(i, t) {
|
|
4806
4763
|
var r;
|
|
4807
|
-
if (!
|
|
4764
|
+
if (!w(t))
|
|
4808
4765
|
return;
|
|
4809
|
-
const e =
|
|
4810
|
-
return
|
|
4766
|
+
const e = pe(t, ".", 2), s = e[0];
|
|
4767
|
+
return s && (i != null && i[s]) && f(i[s]) && (e != null && e[1]) ? be(i[s], e[1]) : (r = w(s) && (i == null ? void 0 : i[s])) != null ? r : void 0;
|
|
4811
4768
|
}
|
|
4812
|
-
function Ze(
|
|
4813
|
-
var t, e,
|
|
4814
|
-
return (
|
|
4769
|
+
function Ze(i) {
|
|
4770
|
+
var t, e, s;
|
|
4771
|
+
return (s = (t = i == null ? void 0 : i.key) != null ? t : i == null ? void 0 : i.code) != null ? s : (e = i == null ? void 0 : i.keyCode) == null ? void 0 : e.toString();
|
|
4815
4772
|
}
|
|
4816
|
-
function
|
|
4817
|
-
return
|
|
4773
|
+
function Wt(i) {
|
|
4774
|
+
return d(i, (t) => t.length);
|
|
4818
4775
|
}
|
|
4819
|
-
function Ve(
|
|
4820
|
-
return Math.max(...
|
|
4776
|
+
function Ve(i) {
|
|
4777
|
+
return Math.max(...Wt(i));
|
|
4821
4778
|
}
|
|
4822
|
-
function Ke(
|
|
4823
|
-
return Math.min(...
|
|
4779
|
+
function Ke(i) {
|
|
4780
|
+
return Math.min(...Wt(i));
|
|
4824
4781
|
}
|
|
4825
|
-
function we(
|
|
4826
|
-
var t, e,
|
|
4827
|
-
return (
|
|
4782
|
+
function we(i) {
|
|
4783
|
+
var t, e, s, r;
|
|
4784
|
+
return (i == null ? void 0 : i.clientX) || ((e = (t = i == null ? void 0 : i.targetTouches) == null ? void 0 : t[0]) == null ? void 0 : e.clientX) || ((r = (s = i == null ? void 0 : i.touches) == null ? void 0 : s[0]) == null ? void 0 : r.clientX) || 0;
|
|
4828
4785
|
}
|
|
4829
|
-
function
|
|
4830
|
-
var t, e,
|
|
4831
|
-
return (
|
|
4786
|
+
function ve(i) {
|
|
4787
|
+
var t, e, s, r;
|
|
4788
|
+
return (i == null ? void 0 : i.clientY) || ((e = (t = i == null ? void 0 : i.targetTouches) == null ? void 0 : t[0]) == null ? void 0 : e.clientY) || ((r = (s = i == null ? void 0 : i.touches) == null ? void 0 : s[0]) == null ? void 0 : r.clientY) || 0;
|
|
4832
4789
|
}
|
|
4833
|
-
function Ye(
|
|
4790
|
+
function Ye(i) {
|
|
4834
4791
|
return {
|
|
4835
|
-
x: we(
|
|
4836
|
-
y:
|
|
4792
|
+
x: we(i),
|
|
4793
|
+
y: ve(i)
|
|
4837
4794
|
};
|
|
4838
4795
|
}
|
|
4839
|
-
function qe(
|
|
4796
|
+
function qe(i, t) {
|
|
4840
4797
|
const e = {};
|
|
4841
|
-
return t.forEach((
|
|
4842
|
-
|
|
4798
|
+
return t.forEach((s) => {
|
|
4799
|
+
s in i && i[s] !== void 0 && (e[s] = i[s]);
|
|
4843
4800
|
}), e;
|
|
4844
4801
|
}
|
|
4845
|
-
function Je(
|
|
4802
|
+
function Je(i, t = void 0) {
|
|
4846
4803
|
const e = {};
|
|
4847
|
-
return
|
|
4848
|
-
|
|
4804
|
+
return d(i, (s, r) => {
|
|
4805
|
+
s !== t && (e[r] = s);
|
|
4849
4806
|
}), e;
|
|
4850
4807
|
}
|
|
4851
|
-
function Me(
|
|
4852
|
-
return
|
|
4808
|
+
function Me(i) {
|
|
4809
|
+
return A(i) ? i : {};
|
|
4853
4810
|
}
|
|
4854
|
-
function
|
|
4855
|
-
return
|
|
4811
|
+
function Se(i, t) {
|
|
4812
|
+
return fe(i, t).join("");
|
|
4856
4813
|
}
|
|
4857
|
-
function Qe(
|
|
4858
|
-
const o =
|
|
4814
|
+
function Qe(i, t, e = "#", s = 2, r = 12) {
|
|
4815
|
+
const o = q(i, t), a = [];
|
|
4859
4816
|
for (let u = 0; u < o; u++)
|
|
4860
|
-
a.push(
|
|
4817
|
+
a.push(Se(e, q(s, r)));
|
|
4861
4818
|
return a.join(" ");
|
|
4862
4819
|
}
|
|
4863
|
-
function Xe(
|
|
4864
|
-
|
|
4820
|
+
function Xe(i) {
|
|
4821
|
+
let t = "";
|
|
4822
|
+
return i.split(" ").forEach((e) => {
|
|
4823
|
+
const s = Pt(e).trim();
|
|
4824
|
+
w(s) && (t += `(?=.*?${s})`);
|
|
4825
|
+
}), new RegExp(`^${t}`, "ig");
|
|
4826
|
+
}
|
|
4827
|
+
function _e(i, t) {
|
|
4828
|
+
const e = i != null ? i : 0;
|
|
4865
4829
|
return t > e ? 100 / (t - e) : 0;
|
|
4866
4830
|
}
|
|
4867
|
-
function
|
|
4868
|
-
const e =
|
|
4831
|
+
function Oe(i, t) {
|
|
4832
|
+
const e = i != null ? i : 0;
|
|
4869
4833
|
return t > e ? (t - e) / 100 : 0;
|
|
4870
4834
|
}
|
|
4871
4835
|
const Et = 0;
|
|
4872
|
-
function
|
|
4873
|
-
const
|
|
4874
|
-
if (t &&
|
|
4875
|
-
const r =
|
|
4836
|
+
function Te(i, t, e) {
|
|
4837
|
+
const s = t == null ? void 0 : t.closest(i);
|
|
4838
|
+
if (t && s && s.scrollHeight !== s.offsetHeight) {
|
|
4839
|
+
const r = s.getBoundingClientRect(), o = t.getBoundingClientRect();
|
|
4876
4840
|
if (e) {
|
|
4877
4841
|
const a = e.getBoundingClientRect();
|
|
4878
|
-
|
|
4879
|
-
} else
|
|
4842
|
+
s.scrollTop = t.offsetTop - (a.top - r.top) - (a.height / 2 - o.height / 2), s.scrollTop + s.offsetHeight < t.offsetTop + t.offsetHeight && (s.scrollTop = t.offsetTop + t.offsetHeight - s.offsetHeight);
|
|
4843
|
+
} else s.scrollTop > t.offsetTop ? s.scrollTop = o.top - r.top - Et : s.scrollTop + s.offsetHeight < t.offsetTop + t.offsetHeight && (s.scrollTop = o.top - r.top + o.height - r.height + Et);
|
|
4880
4844
|
}
|
|
4881
4845
|
}
|
|
4882
|
-
function
|
|
4846
|
+
function Ge(i, t, e = 0) {
|
|
4883
4847
|
if (!l())
|
|
4884
4848
|
return;
|
|
4885
|
-
const
|
|
4886
|
-
if ("scrollIntoView" in
|
|
4887
|
-
|
|
4888
|
-
behavior:
|
|
4849
|
+
const s = (t == null ? void 0 : t.behavior) || "smooth";
|
|
4850
|
+
if ("scrollIntoView" in i && !e) {
|
|
4851
|
+
i.scrollIntoView({
|
|
4852
|
+
behavior: s,
|
|
4889
4853
|
block: (t == null ? void 0 : t.block) || "start",
|
|
4890
4854
|
inline: (t == null ? void 0 : t.inline) || "start"
|
|
4891
4855
|
});
|
|
4892
4856
|
return;
|
|
4893
4857
|
}
|
|
4894
|
-
if ("getBoundingClientRect" in
|
|
4895
|
-
const r = ((window == null ? void 0 : window.scrollY) || window.pageYOffset) +
|
|
4858
|
+
if ("getBoundingClientRect" in i && "scrollTo" in window) {
|
|
4859
|
+
const r = ((window == null ? void 0 : window.scrollY) || window.pageYOffset) + i.getBoundingClientRect().top - e;
|
|
4896
4860
|
window.scrollTo({
|
|
4897
4861
|
top: r,
|
|
4898
|
-
behavior:
|
|
4862
|
+
behavior: s
|
|
4899
4863
|
});
|
|
4900
4864
|
}
|
|
4901
4865
|
}
|
|
4902
|
-
function
|
|
4903
|
-
if (!l() || !
|
|
4866
|
+
function ti(i, t, e = "smooth") {
|
|
4867
|
+
if (!l() || !i || !t)
|
|
4904
4868
|
return;
|
|
4905
|
-
const
|
|
4906
|
-
|
|
4907
|
-
top: r.top -
|
|
4908
|
-
left: r.left -
|
|
4869
|
+
const s = i.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
4870
|
+
i.scrollBy({
|
|
4871
|
+
top: r.top - s.top,
|
|
4872
|
+
left: r.left - s.left,
|
|
4909
4873
|
behavior: e
|
|
4910
4874
|
});
|
|
4911
4875
|
}
|
|
4912
|
-
function
|
|
4913
|
-
return
|
|
4876
|
+
function ei(i, t) {
|
|
4877
|
+
return i.indexOf(t) !== -1;
|
|
4914
4878
|
}
|
|
4915
|
-
async function
|
|
4879
|
+
async function ii() {
|
|
4916
4880
|
if (l()) {
|
|
4917
|
-
const
|
|
4918
|
-
document.body.style.setProperty("--sys-scrollbar-offset", `${
|
|
4881
|
+
const i = await ot.get();
|
|
4882
|
+
document.body.style.setProperty("--sys-scrollbar-offset", `${i}px`);
|
|
4919
4883
|
}
|
|
4920
4884
|
}
|
|
4921
|
-
function
|
|
4885
|
+
function si(i, t) {
|
|
4922
4886
|
const e = {};
|
|
4923
|
-
return
|
|
4924
|
-
r in t && (e[r] =
|
|
4887
|
+
return f(i) && f(t) && d(i, (s, r) => {
|
|
4888
|
+
r in t && (e[r] = s);
|
|
4925
4889
|
}), e;
|
|
4926
4890
|
}
|
|
4927
|
-
function
|
|
4928
|
-
let e = Object.keys(
|
|
4929
|
-
return e ||
|
|
4930
|
-
|
|
4891
|
+
function ri(i, t) {
|
|
4892
|
+
let e = Object.keys(i).length !== Object.keys(t).length;
|
|
4893
|
+
return e || d(i, (s, r) => {
|
|
4894
|
+
s !== (t == null ? void 0 : t[r]) && (e = !0);
|
|
4931
4895
|
}), e;
|
|
4932
4896
|
}
|
|
4933
|
-
const
|
|
4934
|
-
if (
|
|
4935
|
-
const t =
|
|
4936
|
-
return !!(t === "input" || t === "textarea" || t === "select" ||
|
|
4897
|
+
const De = (i) => {
|
|
4898
|
+
if (i instanceof HTMLElement) {
|
|
4899
|
+
const t = i.tagName.toLowerCase();
|
|
4900
|
+
return !!(t === "input" || t === "textarea" || t === "select" || i.isContentEditable || i.getAttribute("contenteditable") === "true");
|
|
4937
4901
|
}
|
|
4938
4902
|
return !1;
|
|
4939
|
-
},
|
|
4940
|
-
function
|
|
4941
|
-
switch (typeof
|
|
4903
|
+
}, ni = (i, t) => i.code === "Space" || i.code === "Enter" || i.key === " " || i.key === "Spacebar" || i.key === "Enter" || i.keyCode === 13 || i.keyCode === 32 ? t !== void 0 ? !t : !De(i.target) : !1;
|
|
4904
|
+
function oi(i) {
|
|
4905
|
+
switch (typeof i) {
|
|
4942
4906
|
case "number":
|
|
4943
4907
|
return !0;
|
|
4944
4908
|
case "string":
|
|
4945
|
-
return !!
|
|
4909
|
+
return !!i.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
|
|
4946
4910
|
default:
|
|
4947
4911
|
return !1;
|
|
4948
4912
|
}
|
|
4949
4913
|
}
|
|
4950
|
-
function
|
|
4914
|
+
function ai(i, t) {
|
|
4951
4915
|
const e = Math.floor(t);
|
|
4952
|
-
return
|
|
4916
|
+
return i >= e && i < e + 1;
|
|
4953
4917
|
}
|
|
4954
|
-
function
|
|
4955
|
-
return Array.isArray(
|
|
4918
|
+
function ci(i, t) {
|
|
4919
|
+
return Array.isArray(i) ? i.every((e) => rt(e, t)) : rt(i, t);
|
|
4956
4920
|
}
|
|
4957
|
-
function
|
|
4958
|
-
if (
|
|
4959
|
-
return
|
|
4921
|
+
function ui(i, t) {
|
|
4922
|
+
if (i.startsWith(t))
|
|
4923
|
+
return i.slice(t.length).trim();
|
|
4960
4924
|
let e = 0;
|
|
4961
|
-
for (;
|
|
4925
|
+
for (; i[e] === t[e] && e < i.length && e < t.length; )
|
|
4962
4926
|
e++;
|
|
4963
|
-
return
|
|
4927
|
+
return i.slice(e).trim();
|
|
4964
4928
|
}
|
|
4965
|
-
const
|
|
4966
|
-
var
|
|
4967
|
-
return (r = (
|
|
4929
|
+
const hi = (i, t, e) => {
|
|
4930
|
+
var s, r;
|
|
4931
|
+
return (r = (s = i == null ? void 0 : i.replace(new RegExp(`<${t}`, "ig"), `<${e}`)) == null ? void 0 : s.replace(new RegExp(`</${t}`, "ig"), `</${e}`)) == null ? void 0 : r.trim();
|
|
4968
4932
|
};
|
|
4969
|
-
function
|
|
4970
|
-
return [...new Set(
|
|
4933
|
+
function Le(i) {
|
|
4934
|
+
return [...new Set(i)];
|
|
4971
4935
|
}
|
|
4972
|
-
function
|
|
4973
|
-
const
|
|
4974
|
-
return
|
|
4936
|
+
function V(i, t, e = !0) {
|
|
4937
|
+
const s = U(i);
|
|
4938
|
+
return f(i) && f(t) && d(
|
|
4975
4939
|
t,
|
|
4976
4940
|
(r, o) => {
|
|
4977
|
-
const a =
|
|
4978
|
-
|
|
4941
|
+
const a = i == null ? void 0 : i[o];
|
|
4942
|
+
f(a) && f(r) ? e && Array.isArray(a) && Array.isArray(r) ? s[o] = U(Le([...a, ...r])) : s[o] = V(
|
|
4979
4943
|
Array.isArray(a) ? { ...a } : a,
|
|
4980
4944
|
r,
|
|
4981
4945
|
e
|
|
4982
|
-
) :
|
|
4946
|
+
) : s[o] = f(r) ? U(r) : r;
|
|
4983
4947
|
}
|
|
4984
|
-
),
|
|
4948
|
+
), s;
|
|
4985
4949
|
}
|
|
4986
|
-
function
|
|
4987
|
-
let e =
|
|
4988
|
-
return
|
|
4989
|
-
e = e.replace(
|
|
4950
|
+
function li(i, t) {
|
|
4951
|
+
let e = i;
|
|
4952
|
+
return d(t, (s, r) => {
|
|
4953
|
+
e = e.replace($e(`[${r}]`), B(s));
|
|
4990
4954
|
}), e;
|
|
4991
4955
|
}
|
|
4992
|
-
function
|
|
4956
|
+
function Ce(i, t = "auto") {
|
|
4993
4957
|
switch (t) {
|
|
4994
4958
|
case "auto":
|
|
4995
|
-
return
|
|
4959
|
+
return i.naturalWidth >= i.naturalHeight;
|
|
4996
4960
|
case "width":
|
|
4997
4961
|
return !0;
|
|
4998
4962
|
case "height":
|
|
4999
4963
|
return !1;
|
|
5000
4964
|
}
|
|
5001
4965
|
}
|
|
5002
|
-
function
|
|
4966
|
+
function gi(i, t, e = "auto", s) {
|
|
5003
4967
|
var o;
|
|
5004
|
-
const r =
|
|
4968
|
+
const r = ye(i);
|
|
5005
4969
|
if (r && (r.naturalWidth > t && (e === "auto" || e === "width") || r.naturalHeight > t && (e === "auto" || e === "height"))) {
|
|
5006
|
-
const a =
|
|
4970
|
+
const a = Ce(r, e), u = (o = document.createElement("canvas")) == null ? void 0 : o.getContext("2d");
|
|
5007
4971
|
if (u)
|
|
5008
|
-
return u.canvas.width = a ? t : r.naturalWidth / r.naturalHeight * t, u.canvas.height = a ? r.naturalHeight / r.naturalWidth * t : t, u.drawImage(r, 0, 0, u.canvas.width, u.canvas.height), u.canvas.toDataURL(
|
|
4972
|
+
return u.canvas.width = a ? t : r.naturalWidth / r.naturalHeight * t, u.canvas.height = a ? r.naturalHeight / r.naturalWidth * t : t, u.drawImage(r, 0, 0, u.canvas.width, u.canvas.height), u.canvas.toDataURL(s);
|
|
5009
4973
|
}
|
|
5010
4974
|
}
|
|
5011
|
-
function
|
|
5012
|
-
const t = k(
|
|
4975
|
+
function di(i) {
|
|
4976
|
+
const t = k(i);
|
|
5013
4977
|
if (t > 0) {
|
|
5014
|
-
const e = String(Math.floor(t / 60)).padStart(2, "0"),
|
|
5015
|
-
return `${e}:${
|
|
4978
|
+
const e = String(Math.floor(t / 60)).padStart(2, "0"), s = String(t % 60).padStart(2, "0");
|
|
4979
|
+
return `${e}:${s}`;
|
|
5016
4980
|
}
|
|
5017
4981
|
return "00:00";
|
|
5018
4982
|
}
|
|
5019
|
-
function
|
|
4983
|
+
function fi(i, t, {
|
|
5020
4984
|
multiple: e = !1,
|
|
5021
|
-
maxlength:
|
|
4985
|
+
maxlength: s = 0,
|
|
5022
4986
|
alwaysChange: r = !0,
|
|
5023
4987
|
notEmpty: o = !1
|
|
5024
4988
|
}) {
|
|
5025
4989
|
if (e) {
|
|
5026
|
-
if (at(
|
|
5027
|
-
const a =
|
|
5028
|
-
return a !== -1 ? (!o || u.length > 1) && u.splice(a, 1) : (!
|
|
4990
|
+
if (at(i)) {
|
|
4991
|
+
const a = i.indexOf(t), u = [...i];
|
|
4992
|
+
return a !== -1 ? (!o || u.length > 1) && u.splice(a, 1) : (!s || i.length < s) && u.push(t), u;
|
|
5029
4993
|
}
|
|
5030
|
-
return
|
|
4994
|
+
return i === t ? [] : i ? [i, t] : [t];
|
|
5031
4995
|
}
|
|
5032
|
-
return r ||
|
|
4996
|
+
return r || i !== t ? t : i;
|
|
5033
4997
|
}
|
|
5034
|
-
function
|
|
5035
|
-
if (
|
|
4998
|
+
function mi(i, t, e) {
|
|
4999
|
+
if (f(i) && f(t)) {
|
|
5036
5000
|
if (e) {
|
|
5037
|
-
let
|
|
5038
|
-
return
|
|
5039
|
-
!r && (e === a || e === o) ? (r = !0,
|
|
5040
|
-
}), r ?
|
|
5001
|
+
let s = {}, r = !1;
|
|
5002
|
+
return d(i, (o, a) => {
|
|
5003
|
+
!r && (e === a || e === o) ? (r = !0, s = V(s, t)) : r ? s = V(s, { [a]: o }) : s[a] = f(o) ? U(o) : o;
|
|
5004
|
+
}), r ? s : V(i, t);
|
|
5041
5005
|
}
|
|
5042
|
-
if (
|
|
5043
|
-
return
|
|
5006
|
+
if (f(t))
|
|
5007
|
+
return V(i, t);
|
|
5044
5008
|
}
|
|
5045
|
-
return
|
|
5009
|
+
return U(i);
|
|
5046
5010
|
}
|
|
5047
|
-
function
|
|
5048
|
-
return
|
|
5011
|
+
function ke(i) {
|
|
5012
|
+
return i.toString().trim().replace(/[^\w- ]+/g, "").replace(/ +/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (t) => `${t.toLowerCase()}`).replace(/-+([a-zA-Z0-9])/g, (...t) => `${String(t[1]).toUpperCase()}`).replace(/^([A-Z])/, (t) => `${t.toLowerCase()}`);
|
|
5049
5013
|
}
|
|
5050
|
-
function
|
|
5051
|
-
return
|
|
5014
|
+
function yi(i) {
|
|
5015
|
+
return ke(i).replace(/^([a-z])/, (t) => `${t.toUpperCase()}`);
|
|
5052
5016
|
}
|
|
5053
|
-
function
|
|
5054
|
-
return
|
|
5017
|
+
function $i(i) {
|
|
5018
|
+
return i.toString().trim().replace(/[^\w- ]+/g, "").replace(/ +/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (t) => `${t.toLowerCase()}`).replace(/^[A-Z]/, (t) => t.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (t) => `-${t.toLowerCase()}`).replace(/[A-Z]/g, (t) => t.toLowerCase());
|
|
5055
5019
|
}
|
|
5056
|
-
function
|
|
5057
|
-
const r = k(
|
|
5058
|
-
return t && o < r ? `${Bt(o, e,
|
|
5020
|
+
function pi(i, t, e, s) {
|
|
5021
|
+
const r = k(i), o = k(t);
|
|
5022
|
+
return t && o < r ? `${Bt(o, e, s)}+` : Bt(r, e, s);
|
|
5059
5023
|
}
|
|
5060
|
-
const Bt = (
|
|
5061
|
-
function
|
|
5062
|
-
return 1 /
|
|
5024
|
+
const Bt = (i, t, e) => t ? new M(e).number(i) : i;
|
|
5025
|
+
function Ne(i, t) {
|
|
5026
|
+
return 1 / i * t;
|
|
5063
5027
|
}
|
|
5064
|
-
function
|
|
5065
|
-
return
|
|
5028
|
+
function bi(i, t) {
|
|
5029
|
+
return Ne(i, t) * 100;
|
|
5066
5030
|
}
|
|
5067
|
-
function
|
|
5031
|
+
function wi(i) {
|
|
5068
5032
|
let t = "";
|
|
5069
|
-
for (const e of
|
|
5033
|
+
for (const e of i)
|
|
5070
5034
|
t += String.fromCharCode(e);
|
|
5071
|
-
return l() ? window.btoa(t) : globalThis && globalThis.Buffer ? globalThis == null ? void 0 : globalThis.Buffer.from(
|
|
5035
|
+
return l() ? window.btoa(t) : globalThis && globalThis.Buffer ? globalThis == null ? void 0 : globalThis.Buffer.from(i).toString("base64") : "";
|
|
5072
5036
|
}
|
|
5073
|
-
async function
|
|
5037
|
+
async function vi(i) {
|
|
5074
5038
|
if (l())
|
|
5075
5039
|
try {
|
|
5076
|
-
await navigator.clipboard.writeText(
|
|
5040
|
+
await navigator.clipboard.writeText(i);
|
|
5077
5041
|
} catch (t) {
|
|
5078
|
-
document == null || document.execCommand(
|
|
5042
|
+
document == null || document.execCommand(i);
|
|
5079
5043
|
}
|
|
5080
5044
|
}
|
|
5081
5045
|
export {
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5046
|
+
H as Api,
|
|
5047
|
+
Kt as ApiDefault,
|
|
5048
|
+
Vt as ApiHeaders,
|
|
5085
5049
|
L as ApiMethodItem,
|
|
5086
|
-
|
|
5087
|
-
|
|
5050
|
+
Jt as ApiPreparation,
|
|
5051
|
+
qt as ApiResponse,
|
|
5088
5052
|
$t as ApiStatus,
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5053
|
+
Be as BroadcastMessage,
|
|
5054
|
+
Xt as Cache,
|
|
5055
|
+
Qt as CacheItem,
|
|
5056
|
+
bt as CacheStatic,
|
|
5057
|
+
wt as Cookie,
|
|
5094
5058
|
Rt as CookieBlock,
|
|
5095
|
-
|
|
5059
|
+
T as DataStorage,
|
|
5096
5060
|
ut as Datetime,
|
|
5097
|
-
Be as ElementScreenshot,
|
|
5098
5061
|
mt as EventItem,
|
|
5099
5062
|
n as GEO_FLAG_ICON_NAME,
|
|
5100
|
-
|
|
5063
|
+
p as Geo,
|
|
5101
5064
|
vt as GeoFlag,
|
|
5102
|
-
|
|
5065
|
+
M as GeoIntl,
|
|
5103
5066
|
St as GeoPhone,
|
|
5104
5067
|
Ie as Global,
|
|
5105
5068
|
Dt as Hash,
|
|
5106
5069
|
kt as Icons,
|
|
5107
5070
|
I as Loading,
|
|
5108
|
-
|
|
5071
|
+
Fe as Meta,
|
|
5109
5072
|
ht as MetaManager,
|
|
5110
|
-
|
|
5111
|
-
|
|
5073
|
+
ce as MetaOg,
|
|
5074
|
+
ne as MetaOpenGraphAge,
|
|
5112
5075
|
se as MetaOpenGraphAvailability,
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5076
|
+
re as MetaOpenGraphCondition,
|
|
5077
|
+
oe as MetaOpenGraphGender,
|
|
5078
|
+
y as MetaOpenGraphTag,
|
|
5079
|
+
ie as MetaOpenGraphType,
|
|
5080
|
+
ee as MetaRobots,
|
|
5118
5081
|
D as MetaTag,
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5082
|
+
ue as MetaTwitter,
|
|
5083
|
+
ae as MetaTwitterCard,
|
|
5084
|
+
$ as MetaTwitterTag,
|
|
5122
5085
|
ot as ScrollbarWidth,
|
|
5123
|
-
|
|
5124
|
-
|
|
5086
|
+
ge as TRANSLATE_GLOBAL_PREFIX,
|
|
5087
|
+
Nt as Translate,
|
|
5125
5088
|
de as anyToString,
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5089
|
+
le as applyTemplate,
|
|
5090
|
+
fe as arrFill,
|
|
5091
|
+
xe as blobToBase64,
|
|
5092
|
+
U as copyObject,
|
|
5130
5093
|
C as copyObjectLite,
|
|
5131
|
-
|
|
5094
|
+
_ as createElement,
|
|
5132
5095
|
Re as domQuerySelector,
|
|
5133
5096
|
Pe as domQuerySelectorAll,
|
|
5134
|
-
|
|
5097
|
+
te as encodeAttribute,
|
|
5098
|
+
Pt as escapeExp,
|
|
5135
5099
|
We as eventStopPropagation,
|
|
5136
5100
|
B as executeFunction,
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5101
|
+
Yt as executePromise,
|
|
5102
|
+
d as forEach,
|
|
5103
|
+
me as frame,
|
|
5104
|
+
je as getAttributes,
|
|
5105
|
+
Ue as getClipboardData,
|
|
5106
|
+
Ot as getColumn,
|
|
5143
5107
|
He as getCurrentDate,
|
|
5144
|
-
|
|
5108
|
+
N as getElement,
|
|
5145
5109
|
ze as getElementId,
|
|
5146
|
-
|
|
5147
|
-
|
|
5110
|
+
ye as getElementImage,
|
|
5111
|
+
Tt as getElementItem,
|
|
5148
5112
|
ft as getElementOrWindow,
|
|
5149
|
-
|
|
5150
|
-
|
|
5113
|
+
$e as getExp,
|
|
5114
|
+
be as getItemByPath,
|
|
5151
5115
|
Ze as getKey,
|
|
5152
|
-
|
|
5116
|
+
Wt as getLengthOfAllArray,
|
|
5153
5117
|
Ve as getMaxLengthAllArray,
|
|
5154
5118
|
Ke as getMinLengthAllArray,
|
|
5155
5119
|
Ye as getMouseClient,
|
|
5156
5120
|
we as getMouseClientX,
|
|
5157
|
-
|
|
5121
|
+
ve as getMouseClientY,
|
|
5158
5122
|
qe as getObjectByKeys,
|
|
5159
5123
|
Je as getObjectNoUndefined,
|
|
5160
5124
|
Me as getObjectOrNone,
|
|
5161
5125
|
Qe as getRandomText,
|
|
5162
5126
|
It as getRequestString,
|
|
5163
|
-
Xe as
|
|
5164
|
-
_e as
|
|
5165
|
-
Oe as
|
|
5166
|
-
Te as
|
|
5167
|
-
Ge as
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5127
|
+
Xe as getSearchExp,
|
|
5128
|
+
_e as getStepPercent,
|
|
5129
|
+
Oe as getStepValue,
|
|
5130
|
+
Te as goScroll,
|
|
5131
|
+
Ge as goScrollSmooth,
|
|
5132
|
+
ti as goScrollTo,
|
|
5133
|
+
ei as inArray,
|
|
5134
|
+
ii as initScrollbarOffset,
|
|
5135
|
+
si as intersectKey,
|
|
5171
5136
|
at as isArray,
|
|
5172
|
-
|
|
5137
|
+
ri as isDifferent,
|
|
5173
5138
|
nt as isDomData,
|
|
5174
5139
|
l as isDomRuntime,
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5140
|
+
ni as isEnter,
|
|
5141
|
+
w as isFilled,
|
|
5142
|
+
oi as isFloat,
|
|
5178
5143
|
ct as isFunction,
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5144
|
+
Zt as isInDom,
|
|
5145
|
+
De as isInput,
|
|
5146
|
+
ai as isIntegerBetween,
|
|
5147
|
+
J as isNull,
|
|
5148
|
+
gt as isNumber,
|
|
5149
|
+
f as isObject,
|
|
5150
|
+
A as isObjectNotArray,
|
|
5186
5151
|
rt as isSelected,
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5152
|
+
ci as isSelectedByList,
|
|
5153
|
+
R as isString,
|
|
5154
|
+
Ft as isWindow,
|
|
5155
|
+
q as random,
|
|
5156
|
+
ui as removeCommonPrefix,
|
|
5157
|
+
hi as replaceComponentName,
|
|
5158
|
+
V as replaceRecursive,
|
|
5159
|
+
li as replaceTemplate,
|
|
5160
|
+
gi as resizeImageByMax,
|
|
5161
|
+
di as secondToTime,
|
|
5162
|
+
Gt as setElementItem,
|
|
5163
|
+
fi as setValues,
|
|
5164
|
+
mi as splice,
|
|
5165
|
+
Se as strFill,
|
|
5166
|
+
pe as strSplit,
|
|
5167
|
+
z as toArray,
|
|
5168
|
+
ke as toCamelCase,
|
|
5169
|
+
yi as toCamelCaseFirst,
|
|
5205
5170
|
F as toDate,
|
|
5206
|
-
|
|
5171
|
+
$i as toKebabCase,
|
|
5207
5172
|
k as toNumber,
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5173
|
+
pi as toNumberByMax,
|
|
5174
|
+
Ne as toPercent,
|
|
5175
|
+
bi as toPercentBy100,
|
|
5176
|
+
xt as transformation,
|
|
5177
|
+
wi as uint8ArrayToBase64,
|
|
5178
|
+
Le as uniqueArray,
|
|
5179
|
+
vi as writeClipboardData
|
|
5215
5180
|
};
|