@dxtmisha/functional-basic 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/library.d.ts +764 -2
- package/dist/library.js +1667 -840
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (
|
|
4
|
-
import { geo as
|
|
5
|
-
function
|
|
6
|
-
return t ? Object.assign({},
|
|
1
|
+
var Vt = Object.defineProperty;
|
|
2
|
+
var Kt = (s, t, e) => t in s ? Vt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var c = (s, t, e) => Kt(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { geo as Yt } from "@dxtmisha/media";
|
|
5
|
+
function D(s, t) {
|
|
6
|
+
return t ? Object.assign({}, s, t) : Object.assign({}, s);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return !!(
|
|
8
|
+
function m(s) {
|
|
9
|
+
return !!(s && typeof s == "object");
|
|
10
10
|
}
|
|
11
|
-
function d(
|
|
12
|
-
if (
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
([r, o]) =>
|
|
16
|
-
), e ?
|
|
11
|
+
function d(s, t, e) {
|
|
12
|
+
if (m(s)) {
|
|
13
|
+
const i = [];
|
|
14
|
+
return s instanceof Map ? s.forEach((r, o) => i.push(t(r, o, s))) : Array.isArray(s) ? s.forEach((r, o) => i.push(t(r, o, s))) : Object.entries(s).forEach(
|
|
15
|
+
([r, o]) => i.push(t(o, r, s))
|
|
16
|
+
), e ? i : i.filter((r) => r !== void 0);
|
|
17
17
|
}
|
|
18
18
|
return [];
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Pt(s, t = "=", e = "&") {
|
|
21
21
|
return d(
|
|
22
|
-
|
|
23
|
-
(
|
|
22
|
+
s,
|
|
23
|
+
(i, r) => `${r}${t}${encodeURIComponent(String(i).trim())}`
|
|
24
24
|
).sort().join(e);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return Array.isArray(
|
|
26
|
+
function ht(s) {
|
|
27
|
+
return Array.isArray(s);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function X(s) {
|
|
30
|
+
return s == null;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
if (t &&
|
|
32
|
+
function y(s, t) {
|
|
33
|
+
if (s) {
|
|
34
|
+
if (t && s === "0")
|
|
35
35
|
return !0;
|
|
36
|
-
switch (typeof
|
|
36
|
+
switch (typeof s) {
|
|
37
37
|
case "bigint":
|
|
38
38
|
case "number":
|
|
39
|
-
return
|
|
39
|
+
return s !== 0;
|
|
40
40
|
case "boolean":
|
|
41
|
-
return
|
|
41
|
+
return s;
|
|
42
42
|
case "function":
|
|
43
43
|
case "symbol":
|
|
44
44
|
return !0;
|
|
45
45
|
case "object":
|
|
46
|
-
return Array.isArray(
|
|
46
|
+
return Array.isArray(s) ? s.length > 0 : Object.values(s).some((e) => !X(e));
|
|
47
47
|
case "string":
|
|
48
|
-
return !["", "undefined", "null", "0", "false", "[]"].includes(
|
|
48
|
+
return !["", "undefined", "null", "0", "false", "[]"].includes(s);
|
|
49
49
|
case "undefined":
|
|
50
50
|
return !1;
|
|
51
51
|
default:
|
|
52
|
-
return !!
|
|
52
|
+
return !!s;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
return !1;
|
|
56
56
|
}
|
|
57
|
-
function A(
|
|
58
|
-
return
|
|
57
|
+
function A(s) {
|
|
58
|
+
return m(s) && !Array.isArray(s);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return typeof
|
|
60
|
+
function j(s) {
|
|
61
|
+
return typeof s == "string";
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return JSON.parse(JSON.stringify(
|
|
63
|
+
function V(s) {
|
|
64
|
+
return JSON.parse(JSON.stringify(s));
|
|
65
65
|
}
|
|
66
66
|
function l() {
|
|
67
67
|
return typeof window != "undefined" && !!window.document;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
switch (typeof
|
|
69
|
+
function yt(s) {
|
|
70
|
+
switch (typeof s) {
|
|
71
71
|
case "number":
|
|
72
72
|
return !0;
|
|
73
73
|
case "string":
|
|
74
|
-
return !!
|
|
74
|
+
return !!s.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(s) {
|
|
80
|
+
if (typeof s == "number")
|
|
81
|
+
return s;
|
|
82
|
+
if (!s)
|
|
83
83
|
return 0;
|
|
84
|
-
let t =
|
|
84
|
+
let t = s.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
|
|
88
|
-
return
|
|
87
|
+
function at(s, t) {
|
|
88
|
+
return X(s) ? !1 : Array.isArray(t) ? t.includes(s) : yt(s) && yt(t) ? k(s) === k(t) : s === t;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
90
|
+
function lt(s) {
|
|
91
|
+
return s instanceof Function || typeof s == "function";
|
|
92
92
|
}
|
|
93
|
-
function B(
|
|
94
|
-
return
|
|
93
|
+
function B(s) {
|
|
94
|
+
return lt(s) ? s() : s;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function ct() {
|
|
97
97
|
return location.href.startsWith("data:");
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
let
|
|
101
|
-
class
|
|
99
|
+
const it = {};
|
|
100
|
+
let $t = "ui-storage";
|
|
101
|
+
class et {
|
|
102
102
|
/**
|
|
103
103
|
* Constructor
|
|
104
104
|
* @param name value name/ название значения
|
|
@@ -108,10 +108,10 @@ class T {
|
|
|
108
108
|
c(this, "value");
|
|
109
109
|
c(this, "age");
|
|
110
110
|
this.name = t, this.isSession = e;
|
|
111
|
-
const
|
|
112
|
-
if (
|
|
113
|
-
return
|
|
114
|
-
this.make(),
|
|
111
|
+
const i = `${e ? "session" : "storage"}#${t}`;
|
|
112
|
+
if (i in it)
|
|
113
|
+
return it[i];
|
|
114
|
+
this.make(), it[i] = 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 T {
|
|
|
120
120
|
* @param newPrefix new prefix/ новый префикс
|
|
121
121
|
*/
|
|
122
122
|
static setPrefix(t) {
|
|
123
|
-
|
|
123
|
+
$t = t;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* Getting data from local storage.
|
|
@@ -172,7 +172,7 @@ class T {
|
|
|
172
172
|
* @param cache cache time/ время кэширования
|
|
173
173
|
*/
|
|
174
174
|
isCache(t) {
|
|
175
|
-
return
|
|
175
|
+
return X(t) || this.age && this.age + t * 1e3 >= (/* @__PURE__ */ new Date()).getTime();
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
178
|
* Returns an object for working with storage.
|
|
@@ -180,7 +180,7 @@ class T {
|
|
|
180
180
|
* Возвращает объект для работы с хранилищем.
|
|
181
181
|
*/
|
|
182
182
|
getMethod() {
|
|
183
|
-
if (l() && !
|
|
183
|
+
if (l() && !ct()) {
|
|
184
184
|
const t = this.isSession ? window == null ? void 0 : window.sessionStorage : window == null ? void 0 : window.localStorage;
|
|
185
185
|
if (t)
|
|
186
186
|
return t;
|
|
@@ -192,7 +192,7 @@ class T {
|
|
|
192
192
|
* Получение имени ключа в хранилище.
|
|
193
193
|
*/
|
|
194
194
|
getIndex() {
|
|
195
|
-
return `${
|
|
195
|
+
return `${$t}__${this.name}`;
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* Getting data from storage.
|
|
@@ -205,8 +205,8 @@ class T {
|
|
|
205
205
|
if (t)
|
|
206
206
|
try {
|
|
207
207
|
return JSON.parse(t);
|
|
208
|
-
} catch (
|
|
209
|
-
console.error("DataStorage",
|
|
208
|
+
} catch (i) {
|
|
209
|
+
console.error("DataStorage", i);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
@@ -219,7 +219,7 @@ class T {
|
|
|
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 qt = "geo-code", w = class w {
|
|
223
223
|
/**
|
|
224
224
|
* Information about the current country.
|
|
225
225
|
*
|
|
@@ -274,7 +274,7 @@ const zt = "geo-code", b = class b {
|
|
|
274
274
|
* Получение обработанных данных.
|
|
275
275
|
*/
|
|
276
276
|
static getItem() {
|
|
277
|
-
return
|
|
277
|
+
return D(this.item, {
|
|
278
278
|
language: this.language
|
|
279
279
|
});
|
|
280
280
|
}
|
|
@@ -284,7 +284,7 @@ const zt = "geo-code", b = class b {
|
|
|
284
284
|
* Возвращает полный список стран.
|
|
285
285
|
*/
|
|
286
286
|
static getList() {
|
|
287
|
-
return
|
|
287
|
+
return Yt;
|
|
288
288
|
}
|
|
289
289
|
/**
|
|
290
290
|
* Returns the data about the country by its full code.
|
|
@@ -295,7 +295,7 @@ const zt = "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(V(e != null ? e : this.getList()[0]));
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
301
|
* Returns the full data by language and country.
|
|
@@ -305,7 +305,7 @@ const zt = "geo-code", b = class b {
|
|
|
305
305
|
*/
|
|
306
306
|
static getByCodeFull(t) {
|
|
307
307
|
return this.getList().find(
|
|
308
|
-
(e) =>
|
|
308
|
+
(e) => at(t, [
|
|
309
309
|
`${e.language}-${e.country}`,
|
|
310
310
|
`${e.country}-${e.language}`
|
|
311
311
|
])
|
|
@@ -319,8 +319,8 @@ const zt = "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 i;
|
|
323
|
+
return e.country === t || ((i = e == null ? void 0 : e.countryAlternative) == null ? void 0 : i.find((r) => r === t));
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
@@ -331,8 +331,8 @@ const zt = "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 i;
|
|
335
|
+
return e.language === t || ((i = e == null ? void 0 : e.languageAlternative) == null ? void 0 : i.find((r) => r === t));
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
/**
|
|
@@ -435,33 +435,33 @@ const zt = "geo-code", b = class b {
|
|
|
435
435
|
* объект с данными об текущей стране
|
|
436
436
|
*/
|
|
437
437
|
static toFull(t) {
|
|
438
|
-
return
|
|
438
|
+
return D(t, {
|
|
439
439
|
standard: this.toStandard(t),
|
|
440
440
|
firstDay: (t == null ? void 0 : t.firstDay) || "Mo"
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
443
|
};
|
|
444
|
-
c(
|
|
445
|
-
let
|
|
446
|
-
function
|
|
447
|
-
return l() &&
|
|
444
|
+
c(w, "storage", new et(qt)), c(w, "location"), c(w, "item"), c(w, "language"), c(w, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), w.location = w.findLocation(), w.language = w.findLanguage(w.location), w.item = w.getByCode(w.location);
|
|
445
|
+
let b = w;
|
|
446
|
+
function Wt(s) {
|
|
447
|
+
return l() && s === window;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function E(s) {
|
|
450
450
|
var t;
|
|
451
451
|
if (l())
|
|
452
|
-
return
|
|
452
|
+
return Wt(s) ? document.body : j(s) ? (t = document.querySelector(s)) != null ? t : void 0 : s;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
455
|
-
return
|
|
454
|
+
function pt(s) {
|
|
455
|
+
return Wt(s) ? s : E(s);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Jt(s) {
|
|
458
458
|
var t;
|
|
459
|
-
return !!((t =
|
|
459
|
+
return !!((t = E(s)) != null && t.closest("html"));
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
return Array.isArray(
|
|
461
|
+
function Y(s) {
|
|
462
|
+
return Array.isArray(s) ? s : [s];
|
|
463
463
|
}
|
|
464
|
-
class
|
|
464
|
+
class bt {
|
|
465
465
|
/**
|
|
466
466
|
* Classes Constructor
|
|
467
467
|
* @param elementSelector element/ элемент
|
|
@@ -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"], i, 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, i;
|
|
506
|
+
Jt(this.elementControl) ? ((e = this.listener) == null || e.call(this.element, t, this.detail), m(this.options) && ((i = this.options) != null && i.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 = i, this.options = r, this.detail = o, this.element = pt(t), this.elementControl = E(t), this.type = Y(e);
|
|
516
516
|
}
|
|
517
517
|
/**
|
|
518
518
|
* Checks whether event listening is currently enabled.
|
|
@@ -532,8 +532,8 @@ class mt {
|
|
|
532
532
|
* @param elementSelector element/ элемент
|
|
533
533
|
*/
|
|
534
534
|
setElement(t) {
|
|
535
|
-
const e =
|
|
536
|
-
return this.elementControlEdit || (this.elementControl =
|
|
535
|
+
const e = pt(t);
|
|
536
|
+
return this.elementControlEdit || (this.elementControl = E(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 = E(t), this.elementControlEdit = !X(this.elementControl), this.elementControlEdit || (this.elementControl = E(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 = Y(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 i;
|
|
596
|
+
return (i = this.element) == null ? void 0 : i.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: i,
|
|
623
623
|
observer: r
|
|
624
624
|
}) => {
|
|
625
|
-
r ? r.disconnect() :
|
|
625
|
+
r ? r.disconnect() : i ? t == null || t.removeEventListener(e, i) : 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 = (i) => {
|
|
680
680
|
t || (t = !0, requestAnimationFrame(() => {
|
|
681
|
-
this.listenerRecent(
|
|
681
|
+
this.listenerRecent(i), 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
|
|
700
|
+
const wt = "ui-loading", H = class H {
|
|
701
701
|
/**
|
|
702
702
|
* Check if the loader is active now.
|
|
703
703
|
*
|
|
@@ -706,6 +706,14 @@ const yt = "ui-loading", K = class K {
|
|
|
706
706
|
static is() {
|
|
707
707
|
return this.value > 0;
|
|
708
708
|
}
|
|
709
|
+
/**
|
|
710
|
+
* Get current loading value.
|
|
711
|
+
*
|
|
712
|
+
* Получить текущее значение загрузки.
|
|
713
|
+
*/
|
|
714
|
+
static get() {
|
|
715
|
+
return this.value;
|
|
716
|
+
}
|
|
709
717
|
/**
|
|
710
718
|
* Shows the loader.
|
|
711
719
|
*
|
|
@@ -732,7 +740,26 @@ const yt = "ui-loading", K = class K {
|
|
|
732
740
|
* @param element element/ элемент
|
|
733
741
|
*/
|
|
734
742
|
static registrationEvent(t, e) {
|
|
735
|
-
|
|
743
|
+
if (l()) {
|
|
744
|
+
const i = new bt(window, wt, t).setElementControl(e).start();
|
|
745
|
+
this.registrationList.push({
|
|
746
|
+
item: i,
|
|
747
|
+
listener: t,
|
|
748
|
+
element: e
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Unregistration of an event.
|
|
754
|
+
*
|
|
755
|
+
* Отмена регистрации события.
|
|
756
|
+
* @param listener the object that receives a notification (an object that implements the
|
|
757
|
+
* Event interface) when an event of the specified type occurs/ объект, который принимает
|
|
758
|
+
* уведомление, когда событие указанного типа произошло
|
|
759
|
+
* @param element element/ элемент
|
|
760
|
+
*/
|
|
761
|
+
static unregistrationEvent(t, e) {
|
|
762
|
+
this.registrationList = this.registrationList.filter((i) => i.listener === t && i.element === e ? (i.item.stop(), !1) : !0);
|
|
736
763
|
}
|
|
737
764
|
/**
|
|
738
765
|
* Calls the event listener.
|
|
@@ -744,9 +771,9 @@ const yt = "ui-loading", K = class K {
|
|
|
744
771
|
(t = this.event) == null || t.dispatch({ loading: this.is() });
|
|
745
772
|
}
|
|
746
773
|
};
|
|
747
|
-
c(
|
|
748
|
-
let
|
|
749
|
-
class
|
|
774
|
+
c(H, "value", 0), c(H, "event"), c(H, "registrationList", []), l() && (H.event = new bt(window, wt));
|
|
775
|
+
let R = H;
|
|
776
|
+
class Mt {
|
|
750
777
|
constructor() {
|
|
751
778
|
/** Default headers/ Заголовки по умолчанию */
|
|
752
779
|
c(this, "headers", {});
|
|
@@ -760,11 +787,11 @@ class Vt {
|
|
|
760
787
|
*/
|
|
761
788
|
get(t, e = "application/json;charset=UTF-8") {
|
|
762
789
|
if (t !== null) {
|
|
763
|
-
const
|
|
790
|
+
const i = D(
|
|
764
791
|
this.headers,
|
|
765
792
|
t
|
|
766
793
|
);
|
|
767
|
-
return
|
|
794
|
+
return y(e) && (i["Content-Type"] = e), i;
|
|
768
795
|
}
|
|
769
796
|
}
|
|
770
797
|
/**
|
|
@@ -776,8 +803,8 @@ class Vt {
|
|
|
776
803
|
return A(t) && (this.headers = t), this;
|
|
777
804
|
}
|
|
778
805
|
}
|
|
779
|
-
var
|
|
780
|
-
class
|
|
806
|
+
var C = /* @__PURE__ */ ((s) => (s.get = "GET", s.post = "POST", s.put = "PUT", s.delete = "DELETE", s))(C || {});
|
|
807
|
+
class Qt {
|
|
781
808
|
constructor() {
|
|
782
809
|
/** Default request data/ Данные запроса по умолчанию */
|
|
783
810
|
c(this, "value");
|
|
@@ -810,7 +837,7 @@ class Kt {
|
|
|
810
837
|
if (t instanceof FormData)
|
|
811
838
|
this.addByFormData(t, e);
|
|
812
839
|
else if (A(t))
|
|
813
|
-
return
|
|
840
|
+
return D(e, t);
|
|
814
841
|
}
|
|
815
842
|
return t;
|
|
816
843
|
}
|
|
@@ -830,11 +857,11 @@ class Kt {
|
|
|
830
857
|
* @param value default values/ значения по умолчанию
|
|
831
858
|
*/
|
|
832
859
|
addByFormData(t, e) {
|
|
833
|
-
for (const
|
|
834
|
-
t.has(
|
|
860
|
+
for (const i in e)
|
|
861
|
+
t.has(i) || t.set(i, e[i]);
|
|
835
862
|
}
|
|
836
863
|
}
|
|
837
|
-
class
|
|
864
|
+
class vt {
|
|
838
865
|
constructor() {
|
|
839
866
|
c(this, "value");
|
|
840
867
|
}
|
|
@@ -969,15 +996,15 @@ class $t {
|
|
|
969
996
|
this.value || (this.value = {}), this.value[t] = e;
|
|
970
997
|
}
|
|
971
998
|
}
|
|
972
|
-
async function
|
|
973
|
-
const t = B(
|
|
999
|
+
async function Xt(s) {
|
|
1000
|
+
const t = B(s);
|
|
974
1001
|
return t instanceof Promise ? await t : t;
|
|
975
1002
|
}
|
|
976
|
-
function
|
|
977
|
-
return Math.floor(Math.random() * (t -
|
|
1003
|
+
function Q(s, t) {
|
|
1004
|
+
return Math.floor(Math.random() * (t - s + 1) + s);
|
|
978
1005
|
}
|
|
979
|
-
const
|
|
980
|
-
class
|
|
1006
|
+
const St = "d-response-loading";
|
|
1007
|
+
class _t {
|
|
981
1008
|
/**
|
|
982
1009
|
* Constructor
|
|
983
1010
|
* @param requestDefault default request processor/ процессор запросов по умолчанию
|
|
@@ -1002,8 +1029,8 @@ class qt {
|
|
|
1002
1029
|
* @param request data for the request/ данные для запроса
|
|
1003
1030
|
* @param devMode is it developer mode/ является ли режим разработчика
|
|
1004
1031
|
*/
|
|
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,
|
|
1032
|
+
get(t = "", e, i, r) {
|
|
1033
|
+
return this.response.find((o) => !this.isDisable(o) && this.isPath(o, t) && e === o.method && this.isFirst(o, r) && this.isResponse(o, i) ? (this.isDevMode(r) && console.warn(`Response type: ${o.path}`), this.first.push(o), !0) : !1);
|
|
1007
1034
|
}
|
|
1008
1035
|
/**
|
|
1009
1036
|
* Returns a list of data about the emulator.
|
|
@@ -1020,7 +1047,7 @@ class qt {
|
|
|
1020
1047
|
* @param response data for caching/ данные для кеширования
|
|
1021
1048
|
*/
|
|
1022
1049
|
add(t) {
|
|
1023
|
-
return this.response.push(...
|
|
1050
|
+
return this.response.push(...Y(t)), this;
|
|
1024
1051
|
}
|
|
1025
1052
|
/**
|
|
1026
1053
|
* Sets developer mode.
|
|
@@ -1038,12 +1065,12 @@ class qt {
|
|
|
1038
1065
|
async emulator(t) {
|
|
1039
1066
|
const {
|
|
1040
1067
|
path: e = "",
|
|
1041
|
-
method:
|
|
1042
|
-
global: r =
|
|
1068
|
+
method: i = C.get,
|
|
1069
|
+
global: r = i === C.get,
|
|
1043
1070
|
devMode: o = !1
|
|
1044
1071
|
} = t;
|
|
1045
1072
|
if (r || this.isDevMode(o)) {
|
|
1046
|
-
const a = this.requestDefault.request(t.request), u = this.get(e,
|
|
1073
|
+
const a = this.requestDefault.request(t.request), u = this.get(e, i, a, o);
|
|
1047
1074
|
if (u) {
|
|
1048
1075
|
const h = await this.fetch(u, a);
|
|
1049
1076
|
return this.isDevMode(o) && console.warn("Response data:", e, a, h), h;
|
|
@@ -1096,8 +1123,8 @@ class qt {
|
|
|
1096
1123
|
* @param request request data/ данные запроса
|
|
1097
1124
|
*/
|
|
1098
1125
|
isResponse(t, e) {
|
|
1099
|
-
const
|
|
1100
|
-
return e ===
|
|
1126
|
+
const i = this.requestDefault.request(t == null ? void 0 : t.request);
|
|
1127
|
+
return e === i || i === "*any" || y(e) && y(i) && A(e) && A(i) && !(e instanceof FormData) && !(i instanceof FormData) && Object.values(e).length === Object.values(i).length && Object.entries(i).reduce(
|
|
1101
1128
|
(r, [o, a]) => r && (a === (e == null ? void 0 : e[o]) || a === "*any"),
|
|
1102
1129
|
!0
|
|
1103
1130
|
);
|
|
@@ -1110,13 +1137,13 @@ class qt {
|
|
|
1110
1137
|
* @param request data for the request/ данные для запроса
|
|
1111
1138
|
*/
|
|
1112
1139
|
fetch(t, e) {
|
|
1113
|
-
return this.startResponseLoading(), new Promise((
|
|
1114
|
-
|
|
1115
|
-
|
|
1140
|
+
return this.startResponseLoading(), new Promise((i) => {
|
|
1141
|
+
Xt(
|
|
1142
|
+
lt(t.response) ? t.response(e) : t.response
|
|
1116
1143
|
).then((r) => {
|
|
1117
|
-
t != null && t.lag ? (
|
|
1118
|
-
this.stopResponseLoading(),
|
|
1119
|
-
},
|
|
1144
|
+
t != null && t.lag ? (R.show(), setTimeout(() => {
|
|
1145
|
+
this.stopResponseLoading(), i(r), R.hide();
|
|
1146
|
+
}, Q(0, 2e3))) : (this.stopResponseLoading(), i(r));
|
|
1120
1147
|
});
|
|
1121
1148
|
});
|
|
1122
1149
|
}
|
|
@@ -1126,7 +1153,7 @@ class qt {
|
|
|
1126
1153
|
* Включить загрузку для эмуляции запроса.
|
|
1127
1154
|
*/
|
|
1128
1155
|
startResponseLoading() {
|
|
1129
|
-
this.loading && clearTimeout(this.loading), l() && document.body.classList.add(
|
|
1156
|
+
this.loading && clearTimeout(this.loading), l() && document.body.classList.add(St);
|
|
1130
1157
|
}
|
|
1131
1158
|
/**
|
|
1132
1159
|
* Disable loading for request emulation.
|
|
@@ -1135,11 +1162,11 @@ class qt {
|
|
|
1135
1162
|
*/
|
|
1136
1163
|
stopResponseLoading() {
|
|
1137
1164
|
this.loading = setTimeout(() => {
|
|
1138
|
-
this.loading = void 0, l() && document.body.classList.remove(
|
|
1165
|
+
this.loading = void 0, l() && document.body.classList.remove(St);
|
|
1139
1166
|
}, 1200);
|
|
1140
1167
|
}
|
|
1141
1168
|
}
|
|
1142
|
-
class
|
|
1169
|
+
class Ot {
|
|
1143
1170
|
constructor() {
|
|
1144
1171
|
/** Function for call before the request/ Функция для вызова перед запросом */
|
|
1145
1172
|
c(this, "callback");
|
|
@@ -1167,9 +1194,9 @@ class Jt {
|
|
|
1167
1194
|
* @param query data received in the request/ данные, полученные в запросе
|
|
1168
1195
|
* @param apiFetch request options/ опции запроса
|
|
1169
1196
|
*/
|
|
1170
|
-
async makeEnd(t, e,
|
|
1197
|
+
async makeEnd(t, e, i) {
|
|
1171
1198
|
let r = {};
|
|
1172
|
-
return t && this.callbackEnd && (r = await this.callbackEnd(e,
|
|
1199
|
+
return t && this.callbackEnd && (r = await this.callbackEnd(e, i)), r;
|
|
1173
1200
|
}
|
|
1174
1201
|
/**
|
|
1175
1202
|
* The function is modified for a call before the request.
|
|
@@ -1210,8 +1237,8 @@ class Jt {
|
|
|
1210
1237
|
* @param apiFetch request options/ опции запроса
|
|
1211
1238
|
*/
|
|
1212
1239
|
async end(t, e) {
|
|
1213
|
-
let
|
|
1214
|
-
return this.callbackEnd && (
|
|
1240
|
+
let i = {};
|
|
1241
|
+
return this.callbackEnd && (i = await this.callbackEnd(t, e)), i;
|
|
1215
1242
|
}
|
|
1216
1243
|
}
|
|
1217
1244
|
const v = class v {
|
|
@@ -1247,7 +1274,7 @@ const v = class v {
|
|
|
1247
1274
|
* @param api adding a path to the site’s API/ добавление пути к API сайта
|
|
1248
1275
|
*/
|
|
1249
1276
|
static getUrl(t, e = !0) {
|
|
1250
|
-
return `${e ? this.url : ""}${t}`.replace("{locale}",
|
|
1277
|
+
return `${e ? this.url : ""}${t}`.replace("{locale}", b.getLocation()).replace("{country}", b.getCountry()).replace("{language}", b.getLanguage());
|
|
1251
1278
|
}
|
|
1252
1279
|
/**
|
|
1253
1280
|
* Getting data for the body.
|
|
@@ -1256,11 +1283,11 @@ const v = class v {
|
|
|
1256
1283
|
* @param request this request/ данный запрос
|
|
1257
1284
|
* @param method method for request/ метод запрос
|
|
1258
1285
|
*/
|
|
1259
|
-
static getBody(t = {}, e =
|
|
1286
|
+
static getBody(t = {}, e = C.get) {
|
|
1260
1287
|
if (t instanceof FormData)
|
|
1261
1288
|
return t;
|
|
1262
|
-
if (e !==
|
|
1263
|
-
return
|
|
1289
|
+
if (e !== C.get && y(t))
|
|
1290
|
+
return j(t) ? t : JSON.stringify(t);
|
|
1264
1291
|
}
|
|
1265
1292
|
/**
|
|
1266
1293
|
* Getting data for the body of the get method.
|
|
@@ -1270,10 +1297,10 @@ const v = class v {
|
|
|
1270
1297
|
* @param path path to request/ путь к запрос
|
|
1271
1298
|
* @param method method for request/ метод запрос
|
|
1272
1299
|
*/
|
|
1273
|
-
static getBodyForGet(t, e = "",
|
|
1274
|
-
if (
|
|
1275
|
-
const r = e.match(/\?/) ? "&" : "?", o = typeof t == "object" ?
|
|
1276
|
-
if (
|
|
1300
|
+
static getBodyForGet(t, e = "", i = C.get) {
|
|
1301
|
+
if (i === C.get) {
|
|
1302
|
+
const r = e.match(/\?/) ? "&" : "?", o = typeof t == "object" ? Pt(t) : t;
|
|
1303
|
+
if (y(o))
|
|
1277
1304
|
return `${r}${o}`;
|
|
1278
1305
|
}
|
|
1279
1306
|
return "";
|
|
@@ -1328,7 +1355,7 @@ const v = class v {
|
|
|
1328
1355
|
* @param pathRequest query string or list of parameters/ строка запроса или список параметров
|
|
1329
1356
|
*/
|
|
1330
1357
|
static async request(t) {
|
|
1331
|
-
return
|
|
1358
|
+
return j(t) ? await this.fetch({
|
|
1332
1359
|
path: t
|
|
1333
1360
|
}) : await this.fetch(t);
|
|
1334
1361
|
}
|
|
@@ -1339,8 +1366,8 @@ const v = class v {
|
|
|
1339
1366
|
* @param request list of parameters/ список параметров
|
|
1340
1367
|
*/
|
|
1341
1368
|
static get(t) {
|
|
1342
|
-
return this.request(
|
|
1343
|
-
method:
|
|
1369
|
+
return this.request(D(t, {
|
|
1370
|
+
method: C.get
|
|
1344
1371
|
}));
|
|
1345
1372
|
}
|
|
1346
1373
|
/**
|
|
@@ -1350,8 +1377,8 @@ const v = class v {
|
|
|
1350
1377
|
* @param request list of parameters/ список параметров
|
|
1351
1378
|
*/
|
|
1352
1379
|
static post(t) {
|
|
1353
|
-
return this.request(
|
|
1354
|
-
method:
|
|
1380
|
+
return this.request(D(t, {
|
|
1381
|
+
method: C.post
|
|
1355
1382
|
}));
|
|
1356
1383
|
}
|
|
1357
1384
|
/**
|
|
@@ -1361,8 +1388,8 @@ const v = class v {
|
|
|
1361
1388
|
* @param request list of parameters/ список параметров
|
|
1362
1389
|
*/
|
|
1363
1390
|
static put(t) {
|
|
1364
|
-
return this.request(
|
|
1365
|
-
method:
|
|
1391
|
+
return this.request(D(t, {
|
|
1392
|
+
method: C.put
|
|
1366
1393
|
}));
|
|
1367
1394
|
}
|
|
1368
1395
|
/**
|
|
@@ -1372,8 +1399,8 @@ const v = class v {
|
|
|
1372
1399
|
* @param request list of parameters/ список параметров
|
|
1373
1400
|
*/
|
|
1374
1401
|
static delete(t) {
|
|
1375
|
-
return this.request(
|
|
1376
|
-
method:
|
|
1402
|
+
return this.request(D(t, {
|
|
1403
|
+
method: C.delete
|
|
1377
1404
|
}));
|
|
1378
1405
|
}
|
|
1379
1406
|
/**
|
|
@@ -1385,31 +1412,31 @@ const v = class v {
|
|
|
1385
1412
|
static async fetch(t) {
|
|
1386
1413
|
const {
|
|
1387
1414
|
toData: e = !0,
|
|
1388
|
-
hideError:
|
|
1415
|
+
hideError: i = !1,
|
|
1389
1416
|
queryReturn: r = void 0,
|
|
1390
1417
|
globalPreparation: o = !0,
|
|
1391
1418
|
globalEnd: a = !0
|
|
1392
1419
|
} = t, u = await this.response.emulator(t);
|
|
1393
1420
|
if (u)
|
|
1394
1421
|
return u;
|
|
1395
|
-
const h = new
|
|
1396
|
-
let
|
|
1397
|
-
|
|
1422
|
+
const h = new vt();
|
|
1423
|
+
let f;
|
|
1424
|
+
R.show();
|
|
1398
1425
|
try {
|
|
1399
1426
|
await this.preparation.make(o, t);
|
|
1400
1427
|
const g = await this.makeQuery(t), S = await this.preparation.makeEnd(a, g, t);
|
|
1401
1428
|
if (h.setStatus(g.status, g.statusText), this.status.setStatus(g.status, g.statusText), S != null && S.reset)
|
|
1402
|
-
return
|
|
1403
|
-
|
|
1429
|
+
return R.hide(), await this.fetch(t);
|
|
1430
|
+
f = await this.readData(
|
|
1404
1431
|
g,
|
|
1405
1432
|
r,
|
|
1406
1433
|
S
|
|
1407
1434
|
);
|
|
1408
1435
|
} catch (g) {
|
|
1409
|
-
throw
|
|
1436
|
+
throw i || console.error("Api: ", g), h.setError(String(g)), this.status.setError(String(g)), R.hide(), g;
|
|
1410
1437
|
}
|
|
1411
|
-
return
|
|
1412
|
-
this.makeData(
|
|
1438
|
+
return R.hide(), h.setLastResponse(f), this.status.setLastResponse(f), this.makeStatus(
|
|
1439
|
+
this.makeData(f, e),
|
|
1413
1440
|
h
|
|
1414
1441
|
);
|
|
1415
1442
|
}
|
|
@@ -1421,9 +1448,9 @@ const v = class v {
|
|
|
1421
1448
|
* @param queryReturn custom function for reading data/ кастомная функция для чтения данных
|
|
1422
1449
|
* @param end finalization data/ данные финализации
|
|
1423
1450
|
*/
|
|
1424
|
-
static async readData(t, e,
|
|
1451
|
+
static async readData(t, e, i) {
|
|
1425
1452
|
var r;
|
|
1426
|
-
return e ? await e(t) : "data" in
|
|
1453
|
+
return e ? await e(t) : "data" in i ? i.data : ((r = t.headers.get("Content-Type")) != null ? r : "").match("application/json") ? await t.json() : { data: await t.text() };
|
|
1427
1454
|
}
|
|
1428
1455
|
/**
|
|
1429
1456
|
* Executing the request.
|
|
@@ -1433,19 +1460,19 @@ const v = class v {
|
|
|
1433
1460
|
*/
|
|
1434
1461
|
static async makeQuery(t) {
|
|
1435
1462
|
const e = this.requestDefault.request(t.request), {
|
|
1436
|
-
api:
|
|
1463
|
+
api: i = !0,
|
|
1437
1464
|
path: r = "",
|
|
1438
1465
|
pathFull: o = void 0,
|
|
1439
|
-
method: a =
|
|
1466
|
+
method: a = C.get,
|
|
1440
1467
|
headers: u = {},
|
|
1441
1468
|
type: h = "application/json;charset=UTF-8",
|
|
1442
|
-
init:
|
|
1469
|
+
init: f = {},
|
|
1443
1470
|
controller: g = void 0
|
|
1444
|
-
} = t, S = o != null ? o : this.getUrl(r,
|
|
1471
|
+
} = t, S = o != null ? o : this.getUrl(r, i), st = `${S}${this.getBodyForGet(e, S, a)}`, _ = this.headers.get(u, h), q = D(f, {
|
|
1445
1472
|
method: a,
|
|
1446
1473
|
body: this.getBody(e, a)
|
|
1447
1474
|
});
|
|
1448
|
-
return
|
|
1475
|
+
return _ && (q.headers = _), g && (q.signal = g.signal), await fetch(st, q);
|
|
1449
1476
|
}
|
|
1450
1477
|
/**
|
|
1451
1478
|
* Transforms data if needed.
|
|
@@ -1457,10 +1484,10 @@ const v = class v {
|
|
|
1457
1484
|
static makeData(t, e) {
|
|
1458
1485
|
if (!e || !t || !A(t) || !("data" in t))
|
|
1459
1486
|
return t;
|
|
1460
|
-
if (t.data !== null && typeof t.data != "object" ||
|
|
1487
|
+
if (t.data !== null && typeof t.data != "object" || ht(t.data))
|
|
1461
1488
|
return t.data;
|
|
1462
|
-
const
|
|
1463
|
-
return "success" in t && !("success" in
|
|
1489
|
+
const i = D(t.data);
|
|
1490
|
+
return "success" in t && !("success" in i) && (i.success = t.success), "status" in t && !("status" in i) && (i.status = t.status), "message" in t && !("message" in i) && (i.message = t.message), i;
|
|
1464
1491
|
}
|
|
1465
1492
|
/**
|
|
1466
1493
|
* Appends the status object to the response data if possible.
|
|
@@ -1476,16 +1503,16 @@ const v = class v {
|
|
|
1476
1503
|
} : t;
|
|
1477
1504
|
}
|
|
1478
1505
|
};
|
|
1479
|
-
c(v, "url", "/api/"), c(v, "headers", new
|
|
1480
|
-
let
|
|
1481
|
-
class
|
|
1506
|
+
c(v, "url", "/api/"), c(v, "headers", new Mt()), c(v, "requestDefault", new Qt()), c(v, "status", new vt()), c(v, "response", new _t(v.requestDefault)), c(v, "preparation", new Ot());
|
|
1507
|
+
let K = v;
|
|
1508
|
+
class He {
|
|
1482
1509
|
/**
|
|
1483
1510
|
* Constructor
|
|
1484
1511
|
* @param name channel name/ название канала
|
|
1485
1512
|
* @param callback callback on message received/ колбэк на получение сообщения
|
|
1486
1513
|
* @param callbackError callback on message error/ колбэк на ошибку сообщения
|
|
1487
1514
|
*/
|
|
1488
|
-
constructor(t, e,
|
|
1515
|
+
constructor(t, e, i) {
|
|
1489
1516
|
c(this, "channel");
|
|
1490
1517
|
/**
|
|
1491
1518
|
* Update state on message received.
|
|
@@ -1507,9 +1534,9 @@ class Be {
|
|
|
1507
1534
|
var e;
|
|
1508
1535
|
return (e = this.callbackError) == null || e.call(this, t), this;
|
|
1509
1536
|
});
|
|
1510
|
-
if (this.callback = e, this.callbackError =
|
|
1537
|
+
if (this.callback = e, this.callbackError = i, l())
|
|
1511
1538
|
try {
|
|
1512
|
-
this.channel = new BroadcastChannel(`${
|
|
1539
|
+
this.channel = new BroadcastChannel(`${Tt()}__${t}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
|
|
1513
1540
|
} catch (r) {
|
|
1514
1541
|
console.error(`BroadcastMessage ${t}:`, r);
|
|
1515
1542
|
}
|
|
@@ -1552,8 +1579,8 @@ class Be {
|
|
|
1552
1579
|
return this.callbackError = t, this;
|
|
1553
1580
|
}
|
|
1554
1581
|
}
|
|
1555
|
-
const
|
|
1556
|
-
class
|
|
1582
|
+
const Tt = () => new et("__broadcast-name").get(() => `name_${Q(1e6, 9999999)}`);
|
|
1583
|
+
class Gt {
|
|
1557
1584
|
/**
|
|
1558
1585
|
* Constructor
|
|
1559
1586
|
* @param callback function for the cache/ функция для кэша
|
|
@@ -1613,10 +1640,10 @@ class Qt {
|
|
|
1613
1640
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1614
1641
|
*/
|
|
1615
1642
|
isUpdate(t) {
|
|
1616
|
-
return this.cache === void 0 || this.comparisons.length !== t.length || this.comparisons.findIndex((e,
|
|
1643
|
+
return this.cache === void 0 || this.comparisons.length !== t.length || this.comparisons.findIndex((e, i) => e !== t[i]) >= 0 ? (this.comparisons = [...t], !0) : !1;
|
|
1617
1644
|
}
|
|
1618
1645
|
}
|
|
1619
|
-
class
|
|
1646
|
+
class te {
|
|
1620
1647
|
constructor() {
|
|
1621
1648
|
c(this, "cache", {});
|
|
1622
1649
|
}
|
|
@@ -1628,8 +1655,8 @@ class Xt {
|
|
|
1628
1655
|
* @param callback function for the cache/ функция для кэша
|
|
1629
1656
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1630
1657
|
*/
|
|
1631
|
-
get(t, e,
|
|
1632
|
-
return this.getCacheItem(t, e).getCache(
|
|
1658
|
+
get(t, e, i) {
|
|
1659
|
+
return this.getCacheItem(t, e).getCache(i != null ? i : []);
|
|
1633
1660
|
}
|
|
1634
1661
|
/**
|
|
1635
1662
|
* Getting data for the cache, and if there is no cache, it performs a function to save the cache (Async).
|
|
@@ -1639,8 +1666,8 @@ class Xt {
|
|
|
1639
1666
|
* @param callback function for the cache/ функция для кэша
|
|
1640
1667
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1641
1668
|
*/
|
|
1642
|
-
async getAsync(t, e,
|
|
1643
|
-
return await this.getCacheItem(t, e).getCacheAsync(
|
|
1669
|
+
async getAsync(t, e, i) {
|
|
1670
|
+
return await this.getCacheItem(t, e).getCacheAsync(i != null ? i : []);
|
|
1644
1671
|
}
|
|
1645
1672
|
/**
|
|
1646
1673
|
* Returns an instance of the object for working with the cache element.
|
|
@@ -1650,10 +1677,10 @@ class Xt {
|
|
|
1650
1677
|
* @param callback function for the cache/ функция для кэша
|
|
1651
1678
|
*/
|
|
1652
1679
|
getCacheItem(t, e) {
|
|
1653
|
-
return t in this.cache || (this.cache[t] = new
|
|
1680
|
+
return t in this.cache || (this.cache[t] = new Gt(e)), this.cache[t];
|
|
1654
1681
|
}
|
|
1655
1682
|
}
|
|
1656
|
-
const
|
|
1683
|
+
const tt = class tt {
|
|
1657
1684
|
/**
|
|
1658
1685
|
* Getting data for the cache, and if there is no cache, it performs a function to save the cache.
|
|
1659
1686
|
*
|
|
@@ -1662,15 +1689,15 @@ const O = class O {
|
|
|
1662
1689
|
* @param callback function for the cache/ функция для кэша
|
|
1663
1690
|
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1664
1691
|
*/
|
|
1665
|
-
static get(t, e,
|
|
1666
|
-
return this.cache.get(t, e,
|
|
1692
|
+
static get(t, e, i) {
|
|
1693
|
+
return this.cache.get(t, e, i);
|
|
1667
1694
|
}
|
|
1668
1695
|
};
|
|
1669
|
-
c(
|
|
1670
|
-
let
|
|
1671
|
-
function
|
|
1672
|
-
if (typeof
|
|
1673
|
-
const e =
|
|
1696
|
+
c(tt, "cache"), tt.cache = new te();
|
|
1697
|
+
let Lt = tt;
|
|
1698
|
+
function jt(s, t = !1) {
|
|
1699
|
+
if (typeof s == "string") {
|
|
1700
|
+
const e = s.trim();
|
|
1674
1701
|
switch (e) {
|
|
1675
1702
|
case "undefined":
|
|
1676
1703
|
return;
|
|
@@ -1684,8 +1711,8 @@ function xt(i, t = !1) {
|
|
|
1684
1711
|
if (/^[{[]/.exec(e))
|
|
1685
1712
|
try {
|
|
1686
1713
|
return JSON.parse(e);
|
|
1687
|
-
} catch (
|
|
1688
|
-
console.error("transformation: JSON error",
|
|
1714
|
+
} catch (i) {
|
|
1715
|
+
console.error("transformation: JSON error", i);
|
|
1689
1716
|
}
|
|
1690
1717
|
else {
|
|
1691
1718
|
if (/^[0-9]+\.[0-9.]+$/.exec(e))
|
|
@@ -1697,10 +1724,10 @@ function xt(i, t = !1) {
|
|
|
1697
1724
|
}
|
|
1698
1725
|
}
|
|
1699
1726
|
}
|
|
1700
|
-
return
|
|
1727
|
+
return s;
|
|
1701
1728
|
}
|
|
1702
|
-
const
|
|
1703
|
-
class
|
|
1729
|
+
const ee = "cookie-block";
|
|
1730
|
+
class Ut {
|
|
1704
1731
|
/**
|
|
1705
1732
|
* Obtaining status.
|
|
1706
1733
|
*
|
|
@@ -1720,14 +1747,14 @@ class Rt {
|
|
|
1720
1747
|
this.storage.set(t);
|
|
1721
1748
|
}
|
|
1722
1749
|
}
|
|
1723
|
-
c(
|
|
1724
|
-
const
|
|
1750
|
+
c(Ut, "storage", new et(ee));
|
|
1751
|
+
const O = {}, mt = class mt {
|
|
1725
1752
|
constructor(t) {
|
|
1726
1753
|
c(this, "value");
|
|
1727
1754
|
c(this, "options", {});
|
|
1728
|
-
if (this.name = t, t in
|
|
1729
|
-
return
|
|
1730
|
-
this.value =
|
|
1755
|
+
if (this.name = t, t in rt)
|
|
1756
|
+
return rt[t];
|
|
1757
|
+
this.value = O == null ? void 0 : O[t], rt[t] = this;
|
|
1731
1758
|
}
|
|
1732
1759
|
/**
|
|
1733
1760
|
* Get data or update if none.
|
|
@@ -1772,13 +1799,13 @@ const X = {}, lt = class lt {
|
|
|
1772
1799
|
* Обновление данных cookie.
|
|
1773
1800
|
*/
|
|
1774
1801
|
update() {
|
|
1775
|
-
var t, e,
|
|
1776
|
-
if (l() && !
|
|
1802
|
+
var t, e, i, r, o;
|
|
1803
|
+
if (l() && !ct() && !Ut.get()) {
|
|
1777
1804
|
const a = String((t = this.value) != null ? t : "");
|
|
1778
1805
|
document.cookie = [
|
|
1779
1806
|
`${encodeURIComponent(this.name)}=${encodeURIComponent(a)}`,
|
|
1780
1807
|
`max-age=${a === "" ? "-1" : this.getAge()}`,
|
|
1781
|
-
`SameSite=${(
|
|
1808
|
+
`SameSite=${(i = (e = this.options) == null ? void 0 : e.sameSite) != null ? i : "strict"}`,
|
|
1782
1809
|
...(o = (r = this.options) == null ? void 0 : r.arguments) != null ? o : []
|
|
1783
1810
|
].join("; ");
|
|
1784
1811
|
}
|
|
@@ -1790,43 +1817,43 @@ const X = {}, lt = class lt {
|
|
|
1790
1817
|
*/
|
|
1791
1818
|
static updateData() {
|
|
1792
1819
|
for (const t of document.cookie.split(";")) {
|
|
1793
|
-
const [e,
|
|
1794
|
-
e &&
|
|
1820
|
+
const [e, i] = t.trim().split("=");
|
|
1821
|
+
e && y(i) && (O[e] = jt(i));
|
|
1795
1822
|
}
|
|
1796
1823
|
}
|
|
1797
1824
|
};
|
|
1798
|
-
l() && !
|
|
1799
|
-
let
|
|
1800
|
-
const
|
|
1801
|
-
function
|
|
1802
|
-
var r, o, a, u, h,
|
|
1803
|
-
if (
|
|
1804
|
-
return
|
|
1805
|
-
if (
|
|
1825
|
+
l() && !ct() && mt.updateData();
|
|
1826
|
+
let Ct = mt;
|
|
1827
|
+
const rt = {};
|
|
1828
|
+
function P(s) {
|
|
1829
|
+
var r, o, a, u, h, f, g, S;
|
|
1830
|
+
if (s instanceof Date)
|
|
1831
|
+
return s;
|
|
1832
|
+
if (X(s))
|
|
1806
1833
|
return /* @__PURE__ */ new Date();
|
|
1807
|
-
if (typeof
|
|
1808
|
-
return new Date(
|
|
1809
|
-
let t =
|
|
1810
|
-
|
|
1811
|
-
const
|
|
1812
|
-
return /* @__PURE__ */ new Date(`${
|
|
1834
|
+
if (typeof s == "number")
|
|
1835
|
+
return new Date(s);
|
|
1836
|
+
let t = s, e = b.getTimezoneFormat().trim();
|
|
1837
|
+
s.replace(/^([\s\S]+)([-+]\d{2}:?\d{2})$/, (st, _, q) => (t = _, e = q.trim(), st));
|
|
1838
|
+
const i = (S = (g = (f = (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 ? f : /^\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");
|
|
1839
|
+
return /* @__PURE__ */ new Date(`${i.trim()}${e}`);
|
|
1813
1840
|
}
|
|
1814
|
-
function
|
|
1815
|
-
return d(
|
|
1841
|
+
function se(s, t) {
|
|
1842
|
+
return d(s, (e) => e == null ? void 0 : e[t], !0);
|
|
1816
1843
|
}
|
|
1817
|
-
class
|
|
1844
|
+
class N {
|
|
1818
1845
|
/**
|
|
1819
1846
|
* Constructor
|
|
1820
1847
|
* @param code country code, full form language-country or one of them/
|
|
1821
1848
|
* код страны, полный вид язык-страна или один из них
|
|
1822
1849
|
*/
|
|
1823
|
-
constructor(t =
|
|
1850
|
+
constructor(t = b.getLocation()) {
|
|
1824
1851
|
c(this, "geo");
|
|
1825
|
-
this.geo =
|
|
1852
|
+
this.geo = b.find(t);
|
|
1826
1853
|
const e = this.getLocation();
|
|
1827
|
-
if (e in
|
|
1828
|
-
return
|
|
1829
|
-
|
|
1854
|
+
if (e in nt)
|
|
1855
|
+
return nt[e];
|
|
1856
|
+
nt[e] = this;
|
|
1830
1857
|
}
|
|
1831
1858
|
/**
|
|
1832
1859
|
* Returns an instance of the class according to the specified country code.
|
|
@@ -1835,8 +1862,8 @@ class M {
|
|
|
1835
1862
|
* @param code country code, full form language-country or one of them/
|
|
1836
1863
|
* код страны, полный вид язык-страна или один из них
|
|
1837
1864
|
*/
|
|
1838
|
-
static getInstance(t =
|
|
1839
|
-
return new
|
|
1865
|
+
static getInstance(t = b.getLocation()) {
|
|
1866
|
+
return new N(t);
|
|
1840
1867
|
}
|
|
1841
1868
|
/**
|
|
1842
1869
|
* Returns country code and language.
|
|
@@ -1864,13 +1891,13 @@ class M {
|
|
|
1864
1891
|
*/
|
|
1865
1892
|
display(t, e) {
|
|
1866
1893
|
var o;
|
|
1867
|
-
let
|
|
1868
|
-
e && (typeof e == "string" ?
|
|
1869
|
-
...
|
|
1894
|
+
let i = { type: "language" }, r;
|
|
1895
|
+
e && (typeof e == "string" ? i.type = e : i = {
|
|
1896
|
+
...i,
|
|
1870
1897
|
...e
|
|
1871
1898
|
});
|
|
1872
1899
|
try {
|
|
1873
|
-
l() && (t ? r = new Intl.DisplayNames(this.getLocation(),
|
|
1900
|
+
l() && (t ? r = new Intl.DisplayNames(this.getLocation(), i).of(t) : i.type === "language" ? r = new Intl.DisplayNames(this.getLocation(), i).of(this.geo.language) : i.type === "region" && (r = new Intl.DisplayNames(this.getLocation(), i).of(this.geo.country)));
|
|
1874
1901
|
} catch (a) {
|
|
1875
1902
|
console.error("display: ", a);
|
|
1876
1903
|
}
|
|
@@ -1884,11 +1911,11 @@ class M {
|
|
|
1884
1911
|
* @param style the formatting style to use/ используемый стиль форматирования
|
|
1885
1912
|
*/
|
|
1886
1913
|
languageName(t, e) {
|
|
1887
|
-
const
|
|
1914
|
+
const i = {
|
|
1888
1915
|
type: "language",
|
|
1889
1916
|
style: e
|
|
1890
1917
|
};
|
|
1891
|
-
return this.display(
|
|
1918
|
+
return this.display(b.getByCode(t).language, i);
|
|
1892
1919
|
}
|
|
1893
1920
|
/**
|
|
1894
1921
|
* Get display names of region.
|
|
@@ -1898,11 +1925,11 @@ class M {
|
|
|
1898
1925
|
* @param style the formatting style to use/ используемый стиль форматирования
|
|
1899
1926
|
*/
|
|
1900
1927
|
countryName(t, e) {
|
|
1901
|
-
const
|
|
1928
|
+
const i = {
|
|
1902
1929
|
type: "region",
|
|
1903
1930
|
style: e
|
|
1904
1931
|
};
|
|
1905
|
-
return this.display(t,
|
|
1932
|
+
return this.display(t, i);
|
|
1906
1933
|
}
|
|
1907
1934
|
/**
|
|
1908
1935
|
* The method returns a string containing the full name in a specific format.
|
|
@@ -1913,19 +1940,19 @@ class M {
|
|
|
1913
1940
|
* @param surname surname middle name (optional)/ отчество
|
|
1914
1941
|
* @param short shorten the names/ сократить названия
|
|
1915
1942
|
*/
|
|
1916
|
-
fullName(t, e,
|
|
1943
|
+
fullName(t, e, i, r) {
|
|
1917
1944
|
var u, h;
|
|
1918
1945
|
const o = (h = (u = this.geo) == null ? void 0 : u.nameFormat) != null ? h : "fl";
|
|
1919
1946
|
let a;
|
|
1920
1947
|
switch (o) {
|
|
1921
1948
|
case "fsl":
|
|
1922
|
-
a = `${e}${
|
|
1949
|
+
a = `${e}${i ? ` ${i}` : ""} ${t}`;
|
|
1923
1950
|
break;
|
|
1924
1951
|
case "lf":
|
|
1925
1952
|
a = `${t} ${e}`;
|
|
1926
1953
|
break;
|
|
1927
1954
|
case "lsf":
|
|
1928
|
-
a = `${t}${
|
|
1955
|
+
a = `${t}${i ? ` ${i}` : ""} ${e}`;
|
|
1929
1956
|
break;
|
|
1930
1957
|
default:
|
|
1931
1958
|
a = `${e} ${t}`;
|
|
@@ -1942,8 +1969,8 @@ class M {
|
|
|
1942
1969
|
* или всеми свойствами
|
|
1943
1970
|
*/
|
|
1944
1971
|
number(t, e) {
|
|
1945
|
-
var
|
|
1946
|
-
return ((r = (
|
|
1972
|
+
var i, r;
|
|
1973
|
+
return ((r = (i = this.numberObject(e)) == null ? void 0 : i.format) == null ? void 0 : r.call(i, k(t))) || t.toString();
|
|
1947
1974
|
}
|
|
1948
1975
|
/**
|
|
1949
1976
|
* Decimal point symbol.
|
|
@@ -1951,8 +1978,8 @@ class M {
|
|
|
1951
1978
|
* Символ десятичной точки.
|
|
1952
1979
|
*/
|
|
1953
1980
|
decimal() {
|
|
1954
|
-
var t, e,
|
|
1955
|
-
return ((o = (r = (
|
|
1981
|
+
var t, e, i, r, o;
|
|
1982
|
+
return ((o = (r = (i = (e = (t = this.numberObject()) == null ? void 0 : t.formatToParts) == null ? void 0 : e.call(t, 1.2)) == null ? void 0 : i.find) == null ? void 0 : r.call(i, (a) => a.type === "decimal")) == null ? void 0 : o.value) || ".";
|
|
1956
1983
|
}
|
|
1957
1984
|
/**
|
|
1958
1985
|
* Currency formatting.
|
|
@@ -1963,15 +1990,15 @@ class M {
|
|
|
1963
1990
|
* валюта для использования в форматировании валюты
|
|
1964
1991
|
* @param numberOnly do not display the currency symbol/ не выводить значок валюты
|
|
1965
1992
|
*/
|
|
1966
|
-
currency(t, e,
|
|
1993
|
+
currency(t, e, i = !1) {
|
|
1967
1994
|
const r = {
|
|
1968
1995
|
style: "currency",
|
|
1969
1996
|
currencyDisplay: "symbol",
|
|
1970
1997
|
...typeof e == "string" ? { currency: e } : e || {}
|
|
1971
1998
|
}, o = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]{3})$/i, (...a) => (r.currency = String(a[2]).toUpperCase(), String(a[1])));
|
|
1972
|
-
if (
|
|
1999
|
+
if (i) {
|
|
1973
2000
|
const a = this.numberObject(r);
|
|
1974
|
-
return a ?
|
|
2001
|
+
return a ? se(
|
|
1975
2002
|
a.formatToParts(k(t)).filter((u) => ["literal", "currency"].indexOf(u.type) === -1),
|
|
1976
2003
|
"value"
|
|
1977
2004
|
).join("") : t.toString();
|
|
@@ -1996,12 +2023,12 @@ class M {
|
|
|
1996
2023
|
* как отобразить валюту в формате валюты
|
|
1997
2024
|
*/
|
|
1998
2025
|
currencySymbol(t, e = "symbol") {
|
|
1999
|
-
var
|
|
2000
|
-
return ((u = (a = (o = (r = (
|
|
2026
|
+
var i, r, o, a, u;
|
|
2027
|
+
return ((u = (a = (o = (r = (i = this.numberObject({
|
|
2001
2028
|
style: "currency",
|
|
2002
2029
|
currencyDisplay: e,
|
|
2003
2030
|
currency: t
|
|
2004
|
-
})) == null ? void 0 :
|
|
2031
|
+
})) == null ? void 0 : i.formatToParts) == null ? void 0 : r.call(i, 100)) == null ? void 0 : o.find) == null ? void 0 : a.call(o, (h) => h.type === "currency")) == null ? void 0 : u.value) || t;
|
|
2005
2032
|
}
|
|
2006
2033
|
/**
|
|
2007
2034
|
* Unit formatting.
|
|
@@ -2013,11 +2040,11 @@ class M {
|
|
|
2013
2040
|
* в форматировании блока
|
|
2014
2041
|
*/
|
|
2015
2042
|
unit(t, e) {
|
|
2016
|
-
const
|
|
2043
|
+
const i = {
|
|
2017
2044
|
style: "unit",
|
|
2018
2045
|
...typeof e == "string" ? { unit: e } : e || {}
|
|
2019
|
-
}, r = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]+)$/i, (...o) => (
|
|
2020
|
-
return this.number(r,
|
|
2046
|
+
}, r = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]+)$/i, (...o) => (i.unit = String(o[2]).toLowerCase(), String(o[1])));
|
|
2047
|
+
return this.number(r, i);
|
|
2021
2048
|
}
|
|
2022
2049
|
/**
|
|
2023
2050
|
* Возвращает отформатированный размер файла
|
|
@@ -2026,19 +2053,19 @@ class M {
|
|
|
2026
2053
|
* в форматировании блока
|
|
2027
2054
|
*/
|
|
2028
2055
|
sizeFile(t, e = "byte") {
|
|
2029
|
-
const
|
|
2030
|
-
if (
|
|
2056
|
+
const i = k(t);
|
|
2057
|
+
if (i > 1024 && j(e))
|
|
2031
2058
|
switch (e) {
|
|
2032
2059
|
case "byte":
|
|
2033
|
-
return this.sizeFile(
|
|
2060
|
+
return this.sizeFile(i / 1024, "kilobyte");
|
|
2034
2061
|
case "kilobyte":
|
|
2035
|
-
return this.sizeFile(
|
|
2062
|
+
return this.sizeFile(i / 1024, "megabyte");
|
|
2036
2063
|
case "megabyte":
|
|
2037
|
-
return this.sizeFile(
|
|
2064
|
+
return this.sizeFile(i / 1024, "gigabyte");
|
|
2038
2065
|
case "gigabyte":
|
|
2039
|
-
return this.sizeFile(
|
|
2066
|
+
return this.sizeFile(i / 1024, "terabyte");
|
|
2040
2067
|
case "terabyte":
|
|
2041
|
-
return this.sizeFile(
|
|
2068
|
+
return this.sizeFile(i / 1024, "petabyte");
|
|
2042
2069
|
}
|
|
2043
2070
|
return this.unit(t, e);
|
|
2044
2071
|
}
|
|
@@ -2074,15 +2101,15 @@ class M {
|
|
|
2074
2101
|
* @param options Property for PluralRules/ свойство для PluralRules
|
|
2075
2102
|
* @param optionsNumber an object with some or all properties/ объект с некоторыми или всеми свойствами
|
|
2076
2103
|
*/
|
|
2077
|
-
plural(t, e,
|
|
2104
|
+
plural(t, e, i, r) {
|
|
2078
2105
|
var u;
|
|
2079
2106
|
const o = k(t), a = e.split("|");
|
|
2080
2107
|
if (a.length > 1)
|
|
2081
2108
|
try {
|
|
2082
2109
|
if (l()) {
|
|
2083
|
-
const
|
|
2110
|
+
const f = new Intl.PluralRules(this.getLocation(), i).select(o);
|
|
2084
2111
|
let g;
|
|
2085
|
-
switch (
|
|
2112
|
+
switch (f) {
|
|
2086
2113
|
case "zero":
|
|
2087
2114
|
g = a[a.length - 1];
|
|
2088
2115
|
break;
|
|
@@ -2118,9 +2145,9 @@ class M {
|
|
|
2118
2145
|
* @param styleOptions the representation of the month/ представление месяца
|
|
2119
2146
|
* @param hour24 whether to use 12-hour time/ использовать ли 12-часовое время
|
|
2120
2147
|
*/
|
|
2121
|
-
date(t, e,
|
|
2122
|
-
const o =
|
|
2123
|
-
return r && (u.hour12 = !1), a || Object.assign(u,
|
|
2148
|
+
date(t, e, i, r) {
|
|
2149
|
+
const o = P(t), a = typeof i == "string", u = this.dateOptions(e, a ? i : "short");
|
|
2150
|
+
return r && (u.hour12 = !1), a || Object.assign(u, i), o.toLocaleString(this.getLocation(), u);
|
|
2124
2151
|
}
|
|
2125
2152
|
/**
|
|
2126
2153
|
* Enables language-sensitive relative time formatting.
|
|
@@ -2131,8 +2158,8 @@ class M {
|
|
|
2131
2158
|
* длина интернационализированного сообщения
|
|
2132
2159
|
* @param todayValue current day/ текущий день
|
|
2133
2160
|
*/
|
|
2134
|
-
relative(t, e,
|
|
2135
|
-
const r =
|
|
2161
|
+
relative(t, e, i) {
|
|
2162
|
+
const r = P(t), o = i || /* @__PURE__ */ new Date(), a = {
|
|
2136
2163
|
numeric: "auto",
|
|
2137
2164
|
...typeof e == "string" ? { style: e } : e || {}
|
|
2138
2165
|
};
|
|
@@ -2157,12 +2184,12 @@ class M {
|
|
|
2157
2184
|
* @param type type of data format/ тип формата data
|
|
2158
2185
|
* @param hour24 whether to use 12-hour time/ использовать ли 12-часовое время
|
|
2159
2186
|
*/
|
|
2160
|
-
relativeLimit(t, e,
|
|
2161
|
-
const h =
|
|
2162
|
-
return g.setDate(
|
|
2187
|
+
relativeLimit(t, e, i, r, o, a, u) {
|
|
2188
|
+
const h = P(t), f = i || /* @__PURE__ */ new Date(), g = new Date(f), S = new Date(f);
|
|
2189
|
+
return g.setDate(f.getDate() - e), S.setDate(f.getDate() + e), h >= g && h <= S ? this.relative(
|
|
2163
2190
|
h,
|
|
2164
2191
|
r,
|
|
2165
|
-
|
|
2192
|
+
f
|
|
2166
2193
|
) : this.date(
|
|
2167
2194
|
h,
|
|
2168
2195
|
a,
|
|
@@ -2176,10 +2203,10 @@ class M {
|
|
|
2176
2203
|
* @param unit time unit/ единица времени
|
|
2177
2204
|
* @param styleOptions additional option or formatting style/ дополнительная опция или стиль форматирования
|
|
2178
2205
|
*/
|
|
2179
|
-
relativeByValue(t, e,
|
|
2206
|
+
relativeByValue(t, e, i) {
|
|
2180
2207
|
const r = {
|
|
2181
2208
|
numeric: "auto",
|
|
2182
|
-
...typeof
|
|
2209
|
+
...typeof i == "string" ? { style: i } : i || {}
|
|
2183
2210
|
};
|
|
2184
2211
|
try {
|
|
2185
2212
|
if (l())
|
|
@@ -2198,9 +2225,9 @@ class M {
|
|
|
2198
2225
|
month(t, e) {
|
|
2199
2226
|
try {
|
|
2200
2227
|
if (l())
|
|
2201
|
-
return Intl.DateTimeFormat(this.getLocation(), { month: e || "long" }).format(
|
|
2202
|
-
} catch (
|
|
2203
|
-
console.error("month: ",
|
|
2228
|
+
return Intl.DateTimeFormat(this.getLocation(), { month: e || "long" }).format(P(t));
|
|
2229
|
+
} catch (i) {
|
|
2230
|
+
console.error("month: ", i);
|
|
2204
2231
|
}
|
|
2205
2232
|
return "";
|
|
2206
2233
|
}
|
|
@@ -2217,15 +2244,15 @@ class M {
|
|
|
2217
2244
|
}];
|
|
2218
2245
|
try {
|
|
2219
2246
|
if (l()) {
|
|
2220
|
-
const
|
|
2247
|
+
const i = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { month: t || "long" });
|
|
2221
2248
|
for (let o = 0; o < 12; o++)
|
|
2222
|
-
|
|
2223
|
-
label: r.format(
|
|
2249
|
+
i.setMonth(o), e.push({
|
|
2250
|
+
label: r.format(i).replace(/^./, (a) => a.toUpperCase()),
|
|
2224
2251
|
value: o + 1
|
|
2225
2252
|
});
|
|
2226
2253
|
}
|
|
2227
|
-
} catch (
|
|
2228
|
-
console.error("months: ",
|
|
2254
|
+
} catch (i) {
|
|
2255
|
+
console.error("months: ", i);
|
|
2229
2256
|
}
|
|
2230
2257
|
return e;
|
|
2231
2258
|
}
|
|
@@ -2239,9 +2266,9 @@ class M {
|
|
|
2239
2266
|
weekday(t, e) {
|
|
2240
2267
|
try {
|
|
2241
2268
|
if (l())
|
|
2242
|
-
return Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }).format(
|
|
2243
|
-
} catch (
|
|
2244
|
-
console.error("weekday: ",
|
|
2269
|
+
return Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }).format(P(t));
|
|
2270
|
+
} catch (i) {
|
|
2271
|
+
console.error("weekday: ", i);
|
|
2245
2272
|
}
|
|
2246
2273
|
return "";
|
|
2247
2274
|
}
|
|
@@ -2258,16 +2285,16 @@ class M {
|
|
|
2258
2285
|
}];
|
|
2259
2286
|
try {
|
|
2260
2287
|
if (l()) {
|
|
2261
|
-
const
|
|
2262
|
-
|
|
2288
|
+
const i = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }), o = i.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
|
|
2289
|
+
i.setDate(i.getDate() - o);
|
|
2263
2290
|
for (let a = 0; a < 7; a++)
|
|
2264
2291
|
e.push({
|
|
2265
|
-
label: r.format(
|
|
2266
|
-
value:
|
|
2267
|
-
}),
|
|
2292
|
+
label: r.format(i).replace(/^./, (u) => u.toUpperCase()),
|
|
2293
|
+
value: i.getDay()
|
|
2294
|
+
}), i.setDate(i.getDate() + 1);
|
|
2268
2295
|
}
|
|
2269
|
-
} catch (
|
|
2270
|
-
console.error("weekdays: ",
|
|
2296
|
+
} catch (i) {
|
|
2297
|
+
console.error("weekdays: ", i);
|
|
2271
2298
|
}
|
|
2272
2299
|
return e;
|
|
2273
2300
|
}
|
|
@@ -2287,10 +2314,10 @@ class M {
|
|
|
2287
2314
|
* @param data an array with data/ массив с данными
|
|
2288
2315
|
* @param compareFn a function for sorting/ функция для сортировки
|
|
2289
2316
|
*/
|
|
2290
|
-
sort(t, e = (
|
|
2317
|
+
sort(t, e = (i, r) => [i, r]) {
|
|
2291
2318
|
if (l()) {
|
|
2292
|
-
const
|
|
2293
|
-
return t.sort((r, o) =>
|
|
2319
|
+
const i = new Intl.Collator(this.getLocation());
|
|
2320
|
+
return t.sort((r, o) => i.compare(...e(r, o)));
|
|
2294
2321
|
}
|
|
2295
2322
|
return t;
|
|
2296
2323
|
}
|
|
@@ -2317,23 +2344,23 @@ class M {
|
|
|
2317
2344
|
* @param display the representation of the month/ представление месяца
|
|
2318
2345
|
*/
|
|
2319
2346
|
dateOptions(t, e = "short") {
|
|
2320
|
-
const
|
|
2321
|
-
return ["full", "datetime", "date", void 0, "year-month", "year"].indexOf(t) !== -1 && (
|
|
2347
|
+
const i = {};
|
|
2348
|
+
return ["full", "datetime", "date", void 0, "year-month", "year"].indexOf(t) !== -1 && (i.year = "numeric"), ["full", "datetime", "date", void 0, "year-month", "month", "day-month"].indexOf(t) !== -1 && (i.month = e), ["full", "datetime", "date", void 0, "day", "day-month"].indexOf(t) !== -1 && (i.day = "2-digit"), t !== void 0 && (["full", "datetime", "time", "hour-minute", "hour"].indexOf(t) !== -1 && (i.hour = "2-digit"), ["full", "datetime", "time", "hour-minute", "minute"].indexOf(t) !== -1 && (i.minute = "2-digit"), ["full", "time", "second"].indexOf(t) !== -1 && (i.second = "2-digit")), i;
|
|
2322
2349
|
}
|
|
2323
2350
|
}
|
|
2324
|
-
const
|
|
2325
|
-
class
|
|
2351
|
+
const nt = {};
|
|
2352
|
+
class gt {
|
|
2326
2353
|
/**
|
|
2327
2354
|
* Constructor
|
|
2328
2355
|
* @param date date for processing/ дата для обработки
|
|
2329
2356
|
* @param type type of date format for output/ тип формата даты вывода
|
|
2330
2357
|
* @param code country and language code/ код страны и языка
|
|
2331
2358
|
*/
|
|
2332
|
-
constructor(t, e = "date",
|
|
2359
|
+
constructor(t, e = "date", i = b.getLocation()) {
|
|
2333
2360
|
c(this, "date");
|
|
2334
2361
|
c(this, "hour24", !1);
|
|
2335
2362
|
c(this, "watch");
|
|
2336
|
-
this.type = e, this.code =
|
|
2363
|
+
this.type = e, this.code = i, this.date = P(t);
|
|
2337
2364
|
}
|
|
2338
2365
|
/**
|
|
2339
2366
|
* Returns an object for working with formatting.
|
|
@@ -2341,7 +2368,7 @@ class ut {
|
|
|
2341
2368
|
* Возвращает объект для работы с форматированием.
|
|
2342
2369
|
*/
|
|
2343
2370
|
getIntl() {
|
|
2344
|
-
return new
|
|
2371
|
+
return new N(this.code);
|
|
2345
2372
|
}
|
|
2346
2373
|
/**
|
|
2347
2374
|
* Returns a Date object.
|
|
@@ -2397,10 +2424,10 @@ class ut {
|
|
|
2397
2424
|
const e = this.getTimeZoneOffset();
|
|
2398
2425
|
if (t === "minute")
|
|
2399
2426
|
return e.toString();
|
|
2400
|
-
const
|
|
2427
|
+
const i = e / 60 * -1;
|
|
2401
2428
|
if (t === "hour")
|
|
2402
|
-
return this.getIntl().number(Math.trunc(
|
|
2403
|
-
const r = this.toTimeZoneHourFormat(
|
|
2429
|
+
return this.getIntl().number(Math.trunc(i), { signDisplay: "always" });
|
|
2430
|
+
const r = this.toTimeZoneHourFormat(i), o = i.toString().match(/.\d+/) ? "30" : "00";
|
|
2404
2431
|
return t === "RFC" ? `${r}${o}` : `${r}:${o}`;
|
|
2405
2432
|
}
|
|
2406
2433
|
/**
|
|
@@ -2546,13 +2573,13 @@ class ut {
|
|
|
2546
2573
|
* @param timeZone add time zone/ добавить временную зону
|
|
2547
2574
|
*/
|
|
2548
2575
|
standard(t = !0) {
|
|
2549
|
-
const e = new
|
|
2576
|
+
const e = new gt(this.date, this.type, "en-GB"), i = [];
|
|
2550
2577
|
let r;
|
|
2551
2578
|
return e.setHour24(!0), this.type === "hour-minute" ? r = e.locale(this.type, {
|
|
2552
2579
|
year: "numeric",
|
|
2553
2580
|
month: "2-digit",
|
|
2554
2581
|
hour12: !1
|
|
2555
|
-
}) : (["full", "datetime", "date", "year-month", "year", "month", "day"].indexOf(this.type) !== -1 && (
|
|
2582
|
+
}) : (["full", "datetime", "date", "year-month", "year", "month", "day"].indexOf(this.type) !== -1 && (i.push(e.localeYear()), i.push(e.localeMonth("2-digit"))), ["full", "datetime", "date", "year", "month", "day"].indexOf(this.type) !== -1 && i.push(e.localeDay("2-digit")), ["full", "datetime", "time", "hour", "minute", "second"].indexOf(this.type) !== -1 && (r = e.locale("time"))), `${i.join("-")}${r ? `T${r}${t ? e.getTimeZone() : ""}` : ""}`;
|
|
2556
2583
|
}
|
|
2557
2584
|
/**
|
|
2558
2585
|
* Change the date completely.
|
|
@@ -2562,7 +2589,7 @@ class ut {
|
|
|
2562
2589
|
* целочисленное значение, представляющее число
|
|
2563
2590
|
*/
|
|
2564
2591
|
setDate(t) {
|
|
2565
|
-
return this.date =
|
|
2592
|
+
return this.date = P(t), this.update(), this;
|
|
2566
2593
|
}
|
|
2567
2594
|
/**
|
|
2568
2595
|
* Change the type of data output.
|
|
@@ -2985,12 +3012,250 @@ class ut {
|
|
|
2985
3012
|
), this;
|
|
2986
3013
|
}
|
|
2987
3014
|
}
|
|
2988
|
-
|
|
3015
|
+
function T(s) {
|
|
3016
|
+
var t;
|
|
3017
|
+
return j(s) ? s.trim() : ht(s) && s.findIndex((e) => m(e)) === -1 ? s.join(",") : m(s) ? JSON.stringify(s) : s === !0 ? "1" : s === !1 ? "0" : (t = s == null ? void 0 : s.toString()) != null ? t : "";
|
|
3018
|
+
}
|
|
3019
|
+
function ie(s, t, e) {
|
|
3020
|
+
const i = T(s);
|
|
3021
|
+
if (!e || e <= 0)
|
|
3022
|
+
return i.split(t);
|
|
3023
|
+
const r = i.split(t, e), o = i.split(t);
|
|
3024
|
+
return r.length === o.length ? r : (r.pop(), [
|
|
3025
|
+
...r,
|
|
3026
|
+
o.slice(e - 1).join(t)
|
|
3027
|
+
]);
|
|
3028
|
+
}
|
|
3029
|
+
function x(s, t) {
|
|
3030
|
+
var r;
|
|
3031
|
+
if (!y(t))
|
|
3032
|
+
return;
|
|
3033
|
+
const e = ie(t, ".", 2), i = e[0];
|
|
3034
|
+
return i && (s != null && s[i]) && m(s[i]) && (e != null && e[1]) ? x(s[i], e[1]) : (r = y(i) && (s == null ? void 0 : s[i])) != null ? r : void 0;
|
|
3035
|
+
}
|
|
3036
|
+
function Ht(s) {
|
|
3037
|
+
return s.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()}`);
|
|
3038
|
+
}
|
|
3039
|
+
var F = /* @__PURE__ */ ((s) => (s.currency = "currency", s.date = "date", s.name = "name", s.number = "number", s.plural = "plural", s.unit = "unit", s))(F || {});
|
|
3040
|
+
class ze {
|
|
3041
|
+
/**
|
|
3042
|
+
* Constructor
|
|
3043
|
+
*
|
|
3044
|
+
* Конструктор
|
|
3045
|
+
* @param options formatting options for each column/ property/
|
|
3046
|
+
* параметры форматирования для каждого столбца/свойства
|
|
3047
|
+
* @param list initial list of data to format/ начальный список данных для форматирования
|
|
3048
|
+
*/
|
|
3049
|
+
constructor(t, e) {
|
|
3050
|
+
this.options = t, this.list = e;
|
|
3051
|
+
}
|
|
3052
|
+
/**
|
|
3053
|
+
* Returns the current list of data.
|
|
3054
|
+
*
|
|
3055
|
+
* Возвращает текущий список данных.
|
|
3056
|
+
* @returns the list of data or undefined if not set/ список данных или undefined, если не задан
|
|
3057
|
+
*/
|
|
3058
|
+
getList() {
|
|
3059
|
+
return this.list;
|
|
3060
|
+
}
|
|
3061
|
+
/**
|
|
3062
|
+
* Returns the current formatting options.
|
|
3063
|
+
*
|
|
3064
|
+
* Возвращает текущие параметры форматирования.
|
|
3065
|
+
* @returns formatting options/ параметры форматирования
|
|
3066
|
+
*/
|
|
3067
|
+
getOptions() {
|
|
3068
|
+
return this.options;
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* Sets the list of data to be formatted.
|
|
3072
|
+
*
|
|
3073
|
+
* Устанавливает список данных для форматирования.
|
|
3074
|
+
* @param list list of data/ список данных
|
|
3075
|
+
* @returns the Formatters instance for chaining/ экземпляр Formatters для цепочки вызовов
|
|
3076
|
+
*/
|
|
3077
|
+
setList(t) {
|
|
3078
|
+
return this.list = t, this;
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* Formats the entire list based on the provided options.
|
|
3082
|
+
* Adds formatted values with the suffix 'Format' to each item.
|
|
3083
|
+
*
|
|
3084
|
+
* Форматирует весь список на основе предоставленных параметров.
|
|
3085
|
+
* Добавляет отформатированные значения с суффиксом 'Format' к каждому элементу.
|
|
3086
|
+
* @returns the list of items with additional formatted columns/
|
|
3087
|
+
* список элементов с дополнительными отформатированными столбцами
|
|
3088
|
+
*/
|
|
3089
|
+
to() {
|
|
3090
|
+
return this.list ? d(this.list, (t) => ({
|
|
3091
|
+
...t,
|
|
3092
|
+
...this.getFormatData(t)
|
|
3093
|
+
})) : [];
|
|
3094
|
+
}
|
|
3095
|
+
/**
|
|
3096
|
+
* Generates formatted data for a single item based on options.
|
|
3097
|
+
*
|
|
3098
|
+
* Генерирует отформатированные данные для одного элемента на основе параметров.
|
|
3099
|
+
* @param item item to format/ элемент для форматирования
|
|
3100
|
+
* @protected
|
|
3101
|
+
*/
|
|
3102
|
+
getFormatData(t) {
|
|
3103
|
+
const e = {};
|
|
3104
|
+
return d(
|
|
3105
|
+
this.options,
|
|
3106
|
+
(i, r) => {
|
|
3107
|
+
const o = `${Ht(r)}Format`, a = x(t, r);
|
|
3108
|
+
i != null && i.transformation ? y(a) ? e[o] = i.transformation(
|
|
3109
|
+
a,
|
|
3110
|
+
t,
|
|
3111
|
+
i.options
|
|
3112
|
+
) : e[o] = "" : e[o] = this.transformation(
|
|
3113
|
+
a,
|
|
3114
|
+
t,
|
|
3115
|
+
i.type,
|
|
3116
|
+
i.options
|
|
3117
|
+
);
|
|
3118
|
+
}
|
|
3119
|
+
), e;
|
|
3120
|
+
}
|
|
3121
|
+
/**
|
|
3122
|
+
* Router-like method to delegate formatting to specific type formatters.
|
|
3123
|
+
*
|
|
3124
|
+
* Метод-маршрутизатор для делегирования форматирования конкретным типам форматировщиков.
|
|
3125
|
+
* @param valueOriginal original value to format/ исходное значение для форматирования
|
|
3126
|
+
* @param item entire item context/ весь контекст элемента
|
|
3127
|
+
* @param type type of formatter to use/ тип используемого форматировщика
|
|
3128
|
+
* @param options additional options for the specific formatter/
|
|
3129
|
+
* дополнительные параметры для конкретного форматировщика
|
|
3130
|
+
* @protected
|
|
3131
|
+
* @returns Formatted string/ отформатированная строка
|
|
3132
|
+
*/
|
|
3133
|
+
transformation(t, e, i, r) {
|
|
3134
|
+
if (y(t) || i === F.name)
|
|
3135
|
+
switch (i) {
|
|
3136
|
+
case F.currency:
|
|
3137
|
+
return this.formatCurrency(t, e, r);
|
|
3138
|
+
case F.date:
|
|
3139
|
+
return this.formatDate(t, r);
|
|
3140
|
+
case F.name:
|
|
3141
|
+
return this.formatName(e, r);
|
|
3142
|
+
case F.number:
|
|
3143
|
+
return this.formatNumber(t, r);
|
|
3144
|
+
case F.plural:
|
|
3145
|
+
return this.formatPlural(t, r);
|
|
3146
|
+
case F.unit:
|
|
3147
|
+
return this.formatUnit(t, r);
|
|
3148
|
+
default:
|
|
3149
|
+
return String(t);
|
|
3150
|
+
}
|
|
3151
|
+
return "";
|
|
3152
|
+
}
|
|
3153
|
+
/**
|
|
3154
|
+
* Formats a value as currency.
|
|
3155
|
+
*
|
|
3156
|
+
* Форматирует значение как валюту.
|
|
3157
|
+
* @param value value to format/ значение для форматирования
|
|
3158
|
+
* @param item item context/ контекст элемента
|
|
3159
|
+
* @param options currency formatting options/ параметры форматирования валюты
|
|
3160
|
+
* @protected
|
|
3161
|
+
* @returns Formatted currency string/ отформатированная строка валюты
|
|
3162
|
+
*/
|
|
3163
|
+
formatCurrency(t, e, i) {
|
|
3164
|
+
var o;
|
|
3165
|
+
const r = i != null && i.currencyPropName ? x(e, i.currencyPropName) : e == null ? void 0 : e.currency;
|
|
3166
|
+
return N.getInstance().currency(
|
|
3167
|
+
t,
|
|
3168
|
+
(o = i == null ? void 0 : i.options) != null ? o : r,
|
|
3169
|
+
i == null ? void 0 : i.numberOnly
|
|
3170
|
+
);
|
|
3171
|
+
}
|
|
3172
|
+
/**
|
|
3173
|
+
* Formats a value as a date.
|
|
3174
|
+
*
|
|
3175
|
+
* Форматирует значение как дату.
|
|
3176
|
+
* @param value value to format/ значение для форматирования
|
|
3177
|
+
* @param options date formatting options/ параметры форматирования даты
|
|
3178
|
+
* @protected
|
|
3179
|
+
* @returns Formatted date string/ отформатированная строка даты
|
|
3180
|
+
*/
|
|
3181
|
+
formatDate(t, e) {
|
|
3182
|
+
return N.getInstance().date(
|
|
3183
|
+
t,
|
|
3184
|
+
e == null ? void 0 : e.type,
|
|
3185
|
+
e == null ? void 0 : e.options,
|
|
3186
|
+
e == null ? void 0 : e.hour24
|
|
3187
|
+
);
|
|
3188
|
+
}
|
|
3189
|
+
/**
|
|
3190
|
+
* Formats full name from multiple property names.
|
|
3191
|
+
*
|
|
3192
|
+
* Форматирует полное имя из нескольких имен свойств.
|
|
3193
|
+
* @param item item context containing name components/ контекст элемента, содержащий компоненты имени
|
|
3194
|
+
* @param options name formatting options (prop names for first, last, surname)/
|
|
3195
|
+
* параметры форматирования имени (имена свойств для имени, фамилии, отчества)
|
|
3196
|
+
* @protected
|
|
3197
|
+
* @returns Formatted name string or empty string if components are missing/
|
|
3198
|
+
* отформатированная строка имени или пустая строка, если компоненты отсутствуют
|
|
3199
|
+
*/
|
|
3200
|
+
formatName(t, e) {
|
|
3201
|
+
var a, u, h;
|
|
3202
|
+
const i = x(t, (a = e == null ? void 0 : e.lastPropName) != null ? a : "lastName"), r = x(t, (u = e == null ? void 0 : e.firstPropName) != null ? u : "firstName"), o = x(t, (h = e == null ? void 0 : e.surname) != null ? h : "surname");
|
|
3203
|
+
return i && r ? N.getInstance().fullName(
|
|
3204
|
+
i,
|
|
3205
|
+
r,
|
|
3206
|
+
o,
|
|
3207
|
+
e == null ? void 0 : e.short
|
|
3208
|
+
) : "";
|
|
3209
|
+
}
|
|
3210
|
+
/**
|
|
3211
|
+
* Formats a value as a number.
|
|
3212
|
+
*
|
|
3213
|
+
* Форматирует значение как число.
|
|
3214
|
+
* @param value value to format/ значение для форматирования
|
|
3215
|
+
* @param options number formatting options/ параметры форматирования числа
|
|
3216
|
+
* @protected
|
|
3217
|
+
* @returns Formatted number string/ отформатированная строка числа
|
|
3218
|
+
*/
|
|
3219
|
+
formatNumber(t, e) {
|
|
3220
|
+
return N.getInstance().number(t, e == null ? void 0 : e.options);
|
|
3221
|
+
}
|
|
3222
|
+
/**
|
|
3223
|
+
* Formats a value based on plural rules.
|
|
3224
|
+
*
|
|
3225
|
+
* Форматирует значение на основе правил множественного числа.
|
|
3226
|
+
* @param value numeric value for pluralization/ числовое значение для плюрализации
|
|
3227
|
+
* @param options plural formatting options (words and rules)/
|
|
3228
|
+
* параметры форматирования множественного числа (слова и правила)
|
|
3229
|
+
* @protected
|
|
3230
|
+
* @returns Formatted plural string/ отформатированная строка множественного числа
|
|
3231
|
+
*/
|
|
3232
|
+
formatPlural(t, e) {
|
|
3233
|
+
return e && e.words ? N.getInstance().plural(
|
|
3234
|
+
t,
|
|
3235
|
+
e == null ? void 0 : e.words,
|
|
3236
|
+
e == null ? void 0 : e.options,
|
|
3237
|
+
e == null ? void 0 : e.optionsNumber
|
|
3238
|
+
) : t;
|
|
3239
|
+
}
|
|
3240
|
+
/**
|
|
3241
|
+
* Formats a value with a specific unit.
|
|
3242
|
+
*
|
|
3243
|
+
* Форматирует значение с определенной единицей измерения.
|
|
3244
|
+
* @param value value to format/ значение для форматирования
|
|
3245
|
+
* @param options unit formatting options/ параметры форматирования единиц измерения
|
|
3246
|
+
* @protected
|
|
3247
|
+
* @returns Formatted unit string/ отформатированная строка единицы измерения
|
|
3248
|
+
*/
|
|
3249
|
+
formatUnit(t, e) {
|
|
3250
|
+
return e && e.unit ? N.getInstance().unit(t, e.unit) : t;
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
const n = "f", z = class z {
|
|
2989
3254
|
/**
|
|
2990
3255
|
* Constructor
|
|
2991
3256
|
* @param code country and language code/ код страны и языка
|
|
2992
3257
|
*/
|
|
2993
|
-
constructor(t =
|
|
3258
|
+
constructor(t = b.getLocation()) {
|
|
2994
3259
|
this.code = t;
|
|
2995
3260
|
}
|
|
2996
3261
|
/**
|
|
@@ -3000,15 +3265,15 @@ const n = "f", W = class W {
|
|
|
3000
3265
|
* @param code country code/ код страны
|
|
3001
3266
|
*/
|
|
3002
3267
|
get(t = this.code) {
|
|
3003
|
-
var
|
|
3004
|
-
const e =
|
|
3268
|
+
var i;
|
|
3269
|
+
const e = b.find(t);
|
|
3005
3270
|
if (e) {
|
|
3006
3271
|
const r = this.getCountry(e);
|
|
3007
3272
|
return {
|
|
3008
3273
|
language: this.getLanguage(e),
|
|
3009
3274
|
country: r,
|
|
3010
3275
|
standard: e.standard,
|
|
3011
|
-
icon: (
|
|
3276
|
+
icon: (i = z.flags) == null ? void 0 : i[e.country],
|
|
3012
3277
|
label: r,
|
|
3013
3278
|
value: e.country
|
|
3014
3279
|
};
|
|
@@ -3041,12 +3306,12 @@ const n = "f", W = class W {
|
|
|
3041
3306
|
*/
|
|
3042
3307
|
getNational(t) {
|
|
3043
3308
|
return d(this.getList(t), (e) => {
|
|
3044
|
-
const
|
|
3309
|
+
const i = new z(e.standard).get(e.standard);
|
|
3045
3310
|
return {
|
|
3046
3311
|
...e,
|
|
3047
|
-
description:
|
|
3048
|
-
nationalLanguage:
|
|
3049
|
-
nationalCountry:
|
|
3312
|
+
description: i == null ? void 0 : i.country,
|
|
3313
|
+
nationalLanguage: i == null ? void 0 : i.language,
|
|
3314
|
+
nationalCountry: i == null ? void 0 : i.country
|
|
3050
3315
|
};
|
|
3051
3316
|
});
|
|
3052
3317
|
}
|
|
@@ -3065,7 +3330,7 @@ const n = "f", W = class W {
|
|
|
3065
3330
|
* Возвращает специальный объект для работы с форматированием.
|
|
3066
3331
|
*/
|
|
3067
3332
|
getLocation() {
|
|
3068
|
-
return new
|
|
3333
|
+
return new N(this.code);
|
|
3069
3334
|
}
|
|
3070
3335
|
/**
|
|
3071
3336
|
* Returns a list of countries to retrieve data from.
|
|
@@ -3074,7 +3339,7 @@ const n = "f", W = class W {
|
|
|
3074
3339
|
* @param codes country code/ код страны
|
|
3075
3340
|
*/
|
|
3076
3341
|
getCodes(t) {
|
|
3077
|
-
return t != null ? t : Object.keys(
|
|
3342
|
+
return t != null ? t : Object.keys(z.flags);
|
|
3078
3343
|
}
|
|
3079
3344
|
/**
|
|
3080
3345
|
* Getting the name of the language.
|
|
@@ -3095,7 +3360,7 @@ const n = "f", W = class W {
|
|
|
3095
3360
|
return this.getLocation().countryName(t.country);
|
|
3096
3361
|
}
|
|
3097
3362
|
};
|
|
3098
|
-
c(
|
|
3363
|
+
c(z, "flags", {
|
|
3099
3364
|
AD: `${n}-ad`,
|
|
3100
3365
|
AE: `${n}-ae`,
|
|
3101
3366
|
AF: `${n}-af`,
|
|
@@ -3338,8 +3603,8 @@ c(W, "flags", {
|
|
|
3338
3603
|
ZM: `${n}-zm`,
|
|
3339
3604
|
ZW: `${n}-zw`
|
|
3340
3605
|
});
|
|
3341
|
-
let
|
|
3342
|
-
const
|
|
3606
|
+
let Dt = z;
|
|
3607
|
+
const Z = class Z {
|
|
3343
3608
|
/**
|
|
3344
3609
|
* Getting an object with information about the phone code and country.
|
|
3345
3610
|
*
|
|
@@ -3356,13 +3621,20 @@ const j = class j {
|
|
|
3356
3621
|
* @param phone phone number/ номер телефон
|
|
3357
3622
|
*/
|
|
3358
3623
|
static getByPhone(t) {
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3624
|
+
var a, u, h;
|
|
3625
|
+
const e = this.toNumber(t), i = [""];
|
|
3626
|
+
let r = this.map, o;
|
|
3627
|
+
for (const f of e)
|
|
3628
|
+
if (i[i.length - 1] += f, f in r)
|
|
3629
|
+
(a = r[f]) != null && a.value && (o = r[f], i.push("")), r = (h = (u = r[f]) == null ? void 0 : u.next) != null ? h : {};
|
|
3630
|
+
else
|
|
3631
|
+
break;
|
|
3632
|
+
return o ? (i.pop(), {
|
|
3633
|
+
item: o,
|
|
3634
|
+
phone: e.join("").slice(i.join("").length)
|
|
3635
|
+
}) : {
|
|
3636
|
+
item: void 0,
|
|
3637
|
+
phone: e.join("")
|
|
3366
3638
|
};
|
|
3367
3639
|
}
|
|
3368
3640
|
/**
|
|
@@ -3372,10 +3644,10 @@ const j = class j {
|
|
|
3372
3644
|
* @param code country and language code/ код страны и языка
|
|
3373
3645
|
*/
|
|
3374
3646
|
static getByCode(t) {
|
|
3375
|
-
var
|
|
3647
|
+
var i;
|
|
3376
3648
|
const e = this.get(t);
|
|
3377
3649
|
if (e)
|
|
3378
|
-
return (
|
|
3650
|
+
return (i = this.getByPhone(e.phone.toString())) == null ? void 0 : i.item;
|
|
3379
3651
|
}
|
|
3380
3652
|
/**
|
|
3381
3653
|
* We get an array from a list of all phone numbers.
|
|
@@ -3401,11 +3673,11 @@ const j = class j {
|
|
|
3401
3673
|
* @param masks a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3402
3674
|
*/
|
|
3403
3675
|
static toMask(t, e) {
|
|
3404
|
-
if (
|
|
3405
|
-
const
|
|
3676
|
+
if (y(t) && Array.isArray(e) && e.length > 0) {
|
|
3677
|
+
const i = this.removeZero(t), r = i.length;
|
|
3406
3678
|
for (const o of e)
|
|
3407
3679
|
if (this.getUnnecessaryLength(o) === r)
|
|
3408
|
-
return this.toStandard(
|
|
3680
|
+
return this.toStandard(i, o);
|
|
3409
3681
|
}
|
|
3410
3682
|
}
|
|
3411
3683
|
/**
|
|
@@ -3441,7 +3713,8 @@ const j = class j {
|
|
|
3441
3713
|
* @param mask A mask to transform a phone number/ маска для преобразования номер телефон
|
|
3442
3714
|
*/
|
|
3443
3715
|
static getUnnecessaryLength(t) {
|
|
3444
|
-
|
|
3716
|
+
var e, i;
|
|
3717
|
+
return (i = (e = t.match(/\*/g)) == null ? void 0 : e.length) != null ? i : 0;
|
|
3445
3718
|
}
|
|
3446
3719
|
/**
|
|
3447
3720
|
* Creating a list for the map.
|
|
@@ -3449,16 +3722,16 @@ const j = class j {
|
|
|
3449
3722
|
* Формирование списка для карты.
|
|
3450
3723
|
*/
|
|
3451
3724
|
static makeList() {
|
|
3452
|
-
const t = d(
|
|
3725
|
+
const t = d(b.getList(), (e) => {
|
|
3453
3726
|
if (e != null && e.phoneMask)
|
|
3454
3727
|
return {
|
|
3455
3728
|
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/, "")) || void 0,
|
|
3456
3729
|
within: (e == null ? void 0 : e.phoneWithin) || 0,
|
|
3457
|
-
mask:
|
|
3730
|
+
mask: Y(e.phoneMask),
|
|
3458
3731
|
value: e.country
|
|
3459
3732
|
};
|
|
3460
3733
|
});
|
|
3461
|
-
this.list = t.sort((e,
|
|
3734
|
+
this.list = t.sort((e, i) => e.phone - i.phone);
|
|
3462
3735
|
}
|
|
3463
3736
|
/**
|
|
3464
3737
|
* Creating a map for search.
|
|
@@ -3468,17 +3741,17 @@ const j = class j {
|
|
|
3468
3741
|
static makeMap() {
|
|
3469
3742
|
this.list.forEach((t) => {
|
|
3470
3743
|
t.mask.forEach((e) => {
|
|
3471
|
-
let
|
|
3744
|
+
let i = this.map, r;
|
|
3472
3745
|
if (this.toNumber(e).forEach((o) => {
|
|
3473
3746
|
var a;
|
|
3474
|
-
o in
|
|
3747
|
+
o in i || (i[o] = {
|
|
3475
3748
|
items: [],
|
|
3476
3749
|
info: void 0,
|
|
3477
3750
|
value: void 0,
|
|
3478
3751
|
mask: [],
|
|
3479
3752
|
maskFull: [],
|
|
3480
3753
|
next: {}
|
|
3481
|
-
}), r =
|
|
3754
|
+
}), r = i[o], i = (a = r == null ? void 0 : r.next) != null ? a : {};
|
|
3482
3755
|
}), r) {
|
|
3483
3756
|
r.value === void 0 && (r.info = t, r.value = t.value);
|
|
3484
3757
|
const o = this.toWithin(e, t.within);
|
|
@@ -3504,8 +3777,8 @@ const j = class j {
|
|
|
3504
3777
|
* @param mask a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3505
3778
|
*/
|
|
3506
3779
|
static toStandard(t, e) {
|
|
3507
|
-
let
|
|
3508
|
-
return e.replace(/\*/ig, () => String(t[
|
|
3780
|
+
let i = 0;
|
|
3781
|
+
return e.replace(/\*/ig, () => String(t[i++]));
|
|
3509
3782
|
}
|
|
3510
3783
|
/**
|
|
3511
3784
|
* Replaces the first character with the internal country code
|
|
@@ -3518,9 +3791,9 @@ const j = class j {
|
|
|
3518
3791
|
return t.replace(/\*/, this.getWithinSymbol(e));
|
|
3519
3792
|
}
|
|
3520
3793
|
};
|
|
3521
|
-
c(
|
|
3522
|
-
let
|
|
3523
|
-
class
|
|
3794
|
+
c(Z, "list", []), c(Z, "map", {}), Z.makeList(), Z.makeMap();
|
|
3795
|
+
let kt = Z, U;
|
|
3796
|
+
class Ze {
|
|
3524
3797
|
/**
|
|
3525
3798
|
* Returns the value by its name.
|
|
3526
3799
|
*
|
|
@@ -3528,7 +3801,7 @@ class Ie {
|
|
|
3528
3801
|
* @param name property name/ название свойства
|
|
3529
3802
|
*/
|
|
3530
3803
|
static get(t) {
|
|
3531
|
-
return
|
|
3804
|
+
return U && (U == null ? void 0 : U[t]);
|
|
3532
3805
|
}
|
|
3533
3806
|
/**
|
|
3534
3807
|
* Adds data, this method works only once.
|
|
@@ -3537,10 +3810,10 @@ class Ie {
|
|
|
3537
3810
|
* @param data global data/ глобальные данные
|
|
3538
3811
|
*/
|
|
3539
3812
|
static add(t) {
|
|
3540
|
-
|
|
3813
|
+
U === void 0 && (U = D(t));
|
|
3541
3814
|
}
|
|
3542
3815
|
}
|
|
3543
|
-
const
|
|
3816
|
+
const W = class W {
|
|
3544
3817
|
/**
|
|
3545
3818
|
* Get data from hash.
|
|
3546
3819
|
*
|
|
@@ -3560,8 +3833,8 @@ const x = class x {
|
|
|
3560
3833
|
*/
|
|
3561
3834
|
static set(t, e) {
|
|
3562
3835
|
var r;
|
|
3563
|
-
const
|
|
3564
|
-
|
|
3836
|
+
const i = B(e);
|
|
3837
|
+
i !== ((r = this.hash) == null ? void 0 : r[t]) && (this.hash[t] = i, this.update());
|
|
3565
3838
|
}
|
|
3566
3839
|
/**
|
|
3567
3840
|
* Adding an event when data is changed.
|
|
@@ -3571,8 +3844,20 @@ const x = class x {
|
|
|
3571
3844
|
* @param callback the function is called when the data is changed/ функция вызывается при изменении данных
|
|
3572
3845
|
*/
|
|
3573
3846
|
static addWatch(t, e) {
|
|
3574
|
-
var
|
|
3575
|
-
t in this.watch ? (
|
|
3847
|
+
var i;
|
|
3848
|
+
t in this.watch ? (i = this.watch[t]) == null || i.push(e) : this.watch[t] = [e];
|
|
3849
|
+
}
|
|
3850
|
+
/**
|
|
3851
|
+
* Removing an event when data is changed.
|
|
3852
|
+
*
|
|
3853
|
+
* Удаление события при изменении данных.
|
|
3854
|
+
* @param name variable names/ названия переменных
|
|
3855
|
+
* @param callback the function is called when the data is changed/ функция вызывается при изменении данных
|
|
3856
|
+
*/
|
|
3857
|
+
static removeWatch(t, e) {
|
|
3858
|
+
var r;
|
|
3859
|
+
const i = (r = this.watch) == null ? void 0 : r[t];
|
|
3860
|
+
i && (this.watch[t] = i.filter((o) => o !== e));
|
|
3576
3861
|
}
|
|
3577
3862
|
/**
|
|
3578
3863
|
* Update hash variable from URL string.
|
|
@@ -3594,7 +3879,7 @@ const x = class x {
|
|
|
3594
3879
|
const t = {};
|
|
3595
3880
|
return location.hash.replace(
|
|
3596
3881
|
/([\w-]+)[:=]([^;]+)/ig,
|
|
3597
|
-
(...e) => (t[String(e[1])] =
|
|
3882
|
+
(...e) => (t[String(e[1])] = jt(e[2]), "")
|
|
3598
3883
|
), t;
|
|
3599
3884
|
}
|
|
3600
3885
|
/**
|
|
@@ -3603,7 +3888,7 @@ const x = class x {
|
|
|
3603
3888
|
* Обновление строки хэша в URL.
|
|
3604
3889
|
*/
|
|
3605
3890
|
static update() {
|
|
3606
|
-
this.block = !0, history.replaceState(null, "", `#${
|
|
3891
|
+
this.block = !0, history.replaceState(null, "", `#${Pt(this.hash, "=", ";")}`), requestAnimationFrame(() => {
|
|
3607
3892
|
this.block = !1;
|
|
3608
3893
|
});
|
|
3609
3894
|
}
|
|
@@ -3614,15 +3899,15 @@ const x = class x {
|
|
|
3614
3899
|
* @param location fresh data/ свежий данные
|
|
3615
3900
|
*/
|
|
3616
3901
|
static makeWatch(t) {
|
|
3617
|
-
d(this.watch, (e,
|
|
3902
|
+
d(this.watch, (e, i) => {
|
|
3618
3903
|
var r;
|
|
3619
|
-
((r = this.hash) == null ? void 0 : r[
|
|
3904
|
+
((r = this.hash) == null ? void 0 : r[i]) !== (t == null ? void 0 : t[i]) && e.forEach((o) => o(t[i]));
|
|
3620
3905
|
});
|
|
3621
3906
|
}
|
|
3622
3907
|
};
|
|
3623
|
-
c(
|
|
3624
|
-
let
|
|
3625
|
-
const
|
|
3908
|
+
c(W, "hash", {}), c(W, "watch", {}), c(W, "block", !1), l() && (W.reload(), addEventListener("hashchange", () => W.reload()));
|
|
3909
|
+
let Nt = W;
|
|
3910
|
+
const ot = "__UI_ICON", Et = 320, At = "--LOAD--", M = class M {
|
|
3626
3911
|
/**
|
|
3627
3912
|
* Checks if the given icon is in the list of connected icons.
|
|
3628
3913
|
*
|
|
@@ -3642,10 +3927,10 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3642
3927
|
* @param wait waiting time for picture loading/
|
|
3643
3928
|
* время ожидания загрузки картинки
|
|
3644
3929
|
*/
|
|
3645
|
-
static async get(t, e = "",
|
|
3930
|
+
static async get(t, e = "", i = 1e3 * 60 * 3) {
|
|
3646
3931
|
var o, a, u, h;
|
|
3647
3932
|
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`;
|
|
3648
|
-
return typeof r == "string" ? r ===
|
|
3933
|
+
return typeof r == "string" ? r === At && i > 0 ? (await this.wait(), this.get(t, e, i - Et)) : r : lt(r) ? await r() : await r;
|
|
3649
3934
|
}
|
|
3650
3935
|
/**
|
|
3651
3936
|
* Returns a list of names of all registered icons.
|
|
@@ -3661,7 +3946,7 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3661
3946
|
* Возвращает глобальную ссылку.
|
|
3662
3947
|
*/
|
|
3663
3948
|
static getUrlGlobal() {
|
|
3664
|
-
return `${
|
|
3949
|
+
return `${K.isLocalhost(), ""}${this.url}`;
|
|
3665
3950
|
}
|
|
3666
3951
|
/**
|
|
3667
3952
|
* Adding custom icons.
|
|
@@ -3680,7 +3965,7 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3680
3965
|
* @param index icon name/ название иконки
|
|
3681
3966
|
*/
|
|
3682
3967
|
static addLoad(t) {
|
|
3683
|
-
this.icons[this.getName(t)] =
|
|
3968
|
+
this.icons[this.getName(t)] = At;
|
|
3684
3969
|
}
|
|
3685
3970
|
/**
|
|
3686
3971
|
* Adding custom global icons.
|
|
@@ -3699,7 +3984,7 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3699
3984
|
* @param list list of icons/ список иконки
|
|
3700
3985
|
*/
|
|
3701
3986
|
static addByList(t) {
|
|
3702
|
-
d(t, (e,
|
|
3987
|
+
d(t, (e, i) => this.add(i, e));
|
|
3703
3988
|
}
|
|
3704
3989
|
/**
|
|
3705
3990
|
* Changes the file path.
|
|
@@ -3725,42 +4010,42 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3725
4010
|
* Задержка выполнения скрипта.
|
|
3726
4011
|
*/
|
|
3727
4012
|
static wait() {
|
|
3728
|
-
return new Promise((t) => setTimeout(() => t(),
|
|
4013
|
+
return new Promise((t) => setTimeout(() => t(), Et));
|
|
3729
4014
|
}
|
|
3730
4015
|
};
|
|
3731
|
-
c(
|
|
3732
|
-
let
|
|
3733
|
-
function
|
|
3734
|
-
var
|
|
3735
|
-
return (r = (
|
|
4016
|
+
c(M, "icons", {}), c(M, "url", "/icons/"), l() && (ot in window || (window[ot] = {}), M.icons = window[ot]);
|
|
4017
|
+
let It = M;
|
|
4018
|
+
function re(s, t, e) {
|
|
4019
|
+
var i, r;
|
|
4020
|
+
return (r = (i = E(s)) == null ? void 0 : i[t]) != null ? r : e;
|
|
3736
4021
|
}
|
|
3737
|
-
function
|
|
3738
|
-
const
|
|
3739
|
-
if (
|
|
3740
|
-
const r =
|
|
3741
|
-
if (
|
|
4022
|
+
function ne(s, t, e) {
|
|
4023
|
+
const i = E(s);
|
|
4024
|
+
if (i) {
|
|
4025
|
+
const r = re(i, t);
|
|
4026
|
+
if (m(r) && m(e))
|
|
3742
4027
|
d(e, (o, a) => {
|
|
3743
4028
|
r[a] = B(o);
|
|
3744
4029
|
});
|
|
3745
4030
|
else {
|
|
3746
4031
|
const o = B(e);
|
|
3747
|
-
!(t in
|
|
4032
|
+
!(t in i) && typeof o == "string" ? i.setAttribute(t.toString(), o) : i[t] = B(e);
|
|
3748
4033
|
}
|
|
3749
4034
|
}
|
|
3750
|
-
return
|
|
4035
|
+
return i;
|
|
3751
4036
|
}
|
|
3752
|
-
function
|
|
4037
|
+
function G(s, t = "div", e, i) {
|
|
3753
4038
|
if (!l())
|
|
3754
4039
|
return;
|
|
3755
4040
|
const r = document.createElement(t);
|
|
3756
4041
|
return typeof e == "function" ? e(r) : A(e) && d(e, (o, a) => {
|
|
3757
|
-
|
|
3758
|
-
}),
|
|
4042
|
+
ne(r, a, o);
|
|
4043
|
+
}), s == null || s.insertBefore(r, i != null ? i : null), r;
|
|
3759
4044
|
}
|
|
3760
|
-
function
|
|
3761
|
-
return
|
|
4045
|
+
function oe(s) {
|
|
4046
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").trim();
|
|
3762
4047
|
}
|
|
3763
|
-
class
|
|
4048
|
+
class dt {
|
|
3764
4049
|
/**
|
|
3765
4050
|
* Creates an instance of MetaManager.
|
|
3766
4051
|
*
|
|
@@ -3828,7 +4113,7 @@ class ht {
|
|
|
3828
4113
|
setByList(t) {
|
|
3829
4114
|
return d(
|
|
3830
4115
|
t,
|
|
3831
|
-
(e,
|
|
4116
|
+
(e, i) => this.set(i, String(e))
|
|
3832
4117
|
), this;
|
|
3833
4118
|
}
|
|
3834
4119
|
/**
|
|
@@ -3869,12 +4154,12 @@ class ht {
|
|
|
3869
4154
|
*/
|
|
3870
4155
|
setMeta(t) {
|
|
3871
4156
|
var r;
|
|
3872
|
-
const e = this.findMetaElement(t),
|
|
4157
|
+
const e = this.findMetaElement(t), i = (r = this.items[t]) != null ? r : "";
|
|
3873
4158
|
if (e)
|
|
3874
|
-
e.content =
|
|
4159
|
+
e.content = i;
|
|
3875
4160
|
else if (l()) {
|
|
3876
|
-
const o = { content:
|
|
3877
|
-
this.isProperty ? o.property = t : o.name = t,
|
|
4161
|
+
const o = { content: i };
|
|
4162
|
+
this.isProperty ? o.property = t : o.name = t, G(document.head, "meta", o);
|
|
3878
4163
|
}
|
|
3879
4164
|
return this;
|
|
3880
4165
|
}
|
|
@@ -3885,8 +4170,8 @@ class ht {
|
|
|
3885
4170
|
* @param name meta tag name / имя мета-тега
|
|
3886
4171
|
*/
|
|
3887
4172
|
toHtmlString(t) {
|
|
3888
|
-
var
|
|
3889
|
-
const e =
|
|
4173
|
+
var i;
|
|
4174
|
+
const e = oe((i = this.items[t]) != null ? i : "");
|
|
3890
4175
|
return e ? `<meta ${this.getAttributeName()}="${t}" content="${e}">` : "";
|
|
3891
4176
|
}
|
|
3892
4177
|
/**
|
|
@@ -3896,15 +4181,15 @@ class ht {
|
|
|
3896
4181
|
*/
|
|
3897
4182
|
update() {
|
|
3898
4183
|
return this.listMeta.forEach((t) => {
|
|
3899
|
-
var e,
|
|
3900
|
-
this.items[t] = (
|
|
4184
|
+
var e, i;
|
|
4185
|
+
this.items[t] = (i = (e = this.findMetaElement(t)) == null ? void 0 : e.content) != null ? i : "";
|
|
3901
4186
|
}), this;
|
|
3902
4187
|
}
|
|
3903
4188
|
}
|
|
3904
|
-
var
|
|
3905
|
-
class
|
|
4189
|
+
var L = /* @__PURE__ */ ((s) => (s.description = "description", s.keywords = "keywords", s.canonical = "canonical", s.robots = "robots", s.author = "author", s))(L || {}), ae = /* @__PURE__ */ ((s) => (s.indexFollow = "index, follow", s.noIndexFollow = "noindex, follow", s.indexNoFollow = "index, nofollow", s.noIndexNoFollow = "noindex, nofollow", s.noArchive = "noarchive", s.noSnippet = "nosnippet", s.noImageIndex = "noimageindex", s.images = "images", s.noTranslate = "notranslate", s.noPreview = "nopreview", s.textOnly = "textonly", s.noIndexSubpages = "noindex, noarchive", s.none = "none", s))(ae || {}), $ = /* @__PURE__ */ ((s) => (s.title = "og:title", s.type = "og:type", s.url = "og:url", s.image = "og:image", s.description = "og:description", s.locale = "og:locale", s.siteName = "og:site_name", s.localeAlternate = "og:locale:alternate", s.imageUrl = "og:image:url", s.imageSecureUrl = "og:image:secure_url", s.imageType = "og:image:type", s.imageWidth = "og:image:width", s.imageHeight = "og:image:height", s.imageAlt = "og:image:alt", s.video = "og:video", s.videoUrl = "og:video:url", s.videoSecureUrl = "og:video:secure_url", s.videoType = "og:video:type", s.videoWidth = "og:video:width", s.videoHeight = "og:video:height", s.audio = "og:audio", s.audioSecureUrl = "og:audio:secure_url", s.audioType = "og:audio:type", s.articlePublishedTime = "article:published_time", s.articleModifiedTime = "article:modified_time", s.articleExpirationTime = "article:expiration_time", s.articleAuthor = "article:author", s.articleSection = "article:section", s.articleTag = "article:tag", s.bookAuthor = "book:author", s.bookIsbn = "book:isbn", s.bookReleaseDate = "book:release_date", s.bookTag = "book:tag", s.musicDuration = "music:duration", s.musicAlbum = "music:album", s.musicAlbumDisc = "music:album:disc", s.musicAlbumTrack = "music:album:track", s.musicMusician = "music:musician", s.musicSong = "music:song", s.musicSongDisc = "music:song:disc", s.musicSongTrack = "music:song:track", s.musicReleaseDate = "music:release_date", s.musicCreator = "music:creator", s.videoActor = "video:actor", s.videoActorRole = "video:actor:role", s.videoDirector = "video:director", s.videoWriter = "video:writer", s.videoDuration = "video:duration", s.videoReleaseDate = "video:release_date", s.videoTag = "video:tag", s.videoSeries = "video:series", s.profileFirstName = "profile:first_name", s.profileLastName = "profile:last_name", s.profileUsername = "profile:username", s.profileGender = "profile:gender", s.productBrand = "product:brand", s.productAvailability = "product:availability", s.productCondition = "product:condition", s.productPriceAmount = "product:price:amount", s.productPriceCurrency = "product:price:currency", s.productRetailerItemId = "product:retailer_item_id", s.productCategory = "product:category", s.productEan = "product:ean", s.productIsbn = "product:isbn", s.productMfrPartNo = "product:mfr_part_no", s.productUpc = "product:upc", s.productWeightValue = "product:weight:value", s.productWeightUnits = "product:weight:units", s.productColor = "product:color", s.productMaterial = "product:material", s.productPattern = "product:pattern", s.productAgeGroup = "product:age_group", s.productGender = "product:gender", s))($ || {}), ce = /* @__PURE__ */ ((s) => (s.website = "website", s.article = "article", s.video = "video.other", s.videoTvShow = "video.tv_show", s.videoEpisode = "video.episode", s.videoMovie = "video.movie", s.musicAlbum = "music.album", s.musicPlaylist = "music.playlist", s.musicSong = "music.song", s.musicRadioStation = "music.radio_station", s.app = "app", s.product = "product", s.business = "business.business", s.place = "place", s.event = "event", s.profile = "profile", s.book = "book", s))(ce || {}), ue = /* @__PURE__ */ ((s) => (s.inStock = "in stock", s.outOfStock = "out of stock", s.preorder = "preorder", s.backorder = "backorder", s.discontinued = "discontinued", s.pending = "pending", s))(ue || {}), he = /* @__PURE__ */ ((s) => (s.new = "new", s.used = "used", s.refurbished = "refurbished", s))(he || {}), le = /* @__PURE__ */ ((s) => (s.newborn = "newborn", s.infant = "infant", s.toddler = "toddler", s.kids = "kids", s.adult = "adult", s))(le || {}), ge = /* @__PURE__ */ ((s) => (s.female = "female", s.male = "male", s.unisex = "unisex", s))(ge || {}), p = /* @__PURE__ */ ((s) => (s.card = "twitter:card", s.site = "twitter:site", s.creator = "twitter:creator", s.url = "twitter:url", s.title = "twitter:title", s.description = "twitter:description", s.image = "twitter:image", s.imageAlt = "twitter:image:alt", s.imageSrc = "twitter:image:src", s.imageWidth = "twitter:image:width", s.imageHeight = "twitter:image:height", s.label1 = "twitter:label1", s.data1 = "twitter:data1", s.label2 = "twitter:label2", s.data2 = "twitter:data2", s.appNameIphone = "twitter:app:name:iphone", s.appIdIphone = "twitter:app:id:iphone", s.appUrlIphone = "twitter:app:url:iphone", s.appNameIpad = "twitter:app:name:ipad", s.appIdIpad = "twitter:app:id:ipad", s.appUrlIpad = "twitter:app:url:ipad", s.appNameGooglePlay = "twitter:app:name:googleplay", s.appIdGooglePlay = "twitter:app:id:googleplay", s.appUrlGooglePlay = "twitter:app:url:googleplay", s.player = "twitter:player", s.playerWidth = "twitter:player:width", s.playerHeight = "twitter:player:height", s.playerStream = "twitter:player:stream", s.playerStreamContentType = "twitter:player:stream:content_type", s))(p || {}), de = /* @__PURE__ */ ((s) => (s.summary = "summary", s.summaryLargeImage = "summary_large_image", s.app = "app", s.player = "player", s.product = "product", s.gallery = "gallery", s.photo = "photo", s.leadGeneration = "lead_generation", s.audio = "audio", s.poll = "poll", s))(de || {});
|
|
4190
|
+
class fe extends dt {
|
|
3906
4191
|
constructor() {
|
|
3907
|
-
super(Object.values(
|
|
4192
|
+
super(Object.values($), !0);
|
|
3908
4193
|
}
|
|
3909
4194
|
/**
|
|
3910
4195
|
* Gets the Open Graph title.
|
|
@@ -3912,7 +4197,7 @@ class ce extends ht {
|
|
|
3912
4197
|
* Получает заголовок Open Graph.
|
|
3913
4198
|
*/
|
|
3914
4199
|
getTitle() {
|
|
3915
|
-
return this.get(
|
|
4200
|
+
return this.get($.title);
|
|
3916
4201
|
}
|
|
3917
4202
|
/**
|
|
3918
4203
|
* Gets the Open Graph type.
|
|
@@ -3920,7 +4205,7 @@ class ce extends ht {
|
|
|
3920
4205
|
* Получает тип Open Graph.
|
|
3921
4206
|
*/
|
|
3922
4207
|
getType() {
|
|
3923
|
-
return this.get(
|
|
4208
|
+
return this.get($.type);
|
|
3924
4209
|
}
|
|
3925
4210
|
/**
|
|
3926
4211
|
* Gets the Open Graph URL.
|
|
@@ -3928,7 +4213,7 @@ class ce extends ht {
|
|
|
3928
4213
|
* Получает URL Open Graph.
|
|
3929
4214
|
*/
|
|
3930
4215
|
getUrl() {
|
|
3931
|
-
return this.get(
|
|
4216
|
+
return this.get($.url);
|
|
3932
4217
|
}
|
|
3933
4218
|
/**
|
|
3934
4219
|
* Gets the Open Graph image URL.
|
|
@@ -3936,7 +4221,7 @@ class ce extends ht {
|
|
|
3936
4221
|
* Получает URL изображения Open Graph.
|
|
3937
4222
|
*/
|
|
3938
4223
|
getImage() {
|
|
3939
|
-
return this.get(
|
|
4224
|
+
return this.get($.image);
|
|
3940
4225
|
}
|
|
3941
4226
|
/**
|
|
3942
4227
|
* Gets the Open Graph description.
|
|
@@ -3944,7 +4229,7 @@ class ce extends ht {
|
|
|
3944
4229
|
* Получает описание Open Graph.
|
|
3945
4230
|
*/
|
|
3946
4231
|
getDescription() {
|
|
3947
|
-
return this.get(
|
|
4232
|
+
return this.get($.description);
|
|
3948
4233
|
}
|
|
3949
4234
|
/**
|
|
3950
4235
|
* Gets the Open Graph locale.
|
|
@@ -3952,7 +4237,7 @@ class ce extends ht {
|
|
|
3952
4237
|
* Получает локаль Open Graph.
|
|
3953
4238
|
*/
|
|
3954
4239
|
getLocale() {
|
|
3955
|
-
return this.get(
|
|
4240
|
+
return this.get($.locale);
|
|
3956
4241
|
}
|
|
3957
4242
|
/**
|
|
3958
4243
|
* Gets the Open Graph site name.
|
|
@@ -3960,7 +4245,7 @@ class ce extends ht {
|
|
|
3960
4245
|
* Получает название сайта Open Graph.
|
|
3961
4246
|
*/
|
|
3962
4247
|
getSiteName() {
|
|
3963
|
-
return this.get(
|
|
4248
|
+
return this.get($.siteName);
|
|
3964
4249
|
}
|
|
3965
4250
|
/**
|
|
3966
4251
|
* Sets the Open Graph title.
|
|
@@ -3969,7 +4254,7 @@ class ce extends ht {
|
|
|
3969
4254
|
* @param title title / заголовок
|
|
3970
4255
|
*/
|
|
3971
4256
|
setTitle(t) {
|
|
3972
|
-
return this.set(
|
|
4257
|
+
return this.set($.title, t);
|
|
3973
4258
|
}
|
|
3974
4259
|
/**
|
|
3975
4260
|
* Sets the Open Graph type.
|
|
@@ -3978,7 +4263,7 @@ class ce extends ht {
|
|
|
3978
4263
|
* @param type type / тип
|
|
3979
4264
|
*/
|
|
3980
4265
|
setType(t) {
|
|
3981
|
-
return this.set(
|
|
4266
|
+
return this.set($.type, t);
|
|
3982
4267
|
}
|
|
3983
4268
|
/**
|
|
3984
4269
|
* Sets the Open Graph URL.
|
|
@@ -3987,7 +4272,7 @@ class ce extends ht {
|
|
|
3987
4272
|
* @param url URL / URL
|
|
3988
4273
|
*/
|
|
3989
4274
|
setUrl(t) {
|
|
3990
|
-
return this.set(
|
|
4275
|
+
return this.set($.url, t);
|
|
3991
4276
|
}
|
|
3992
4277
|
/**
|
|
3993
4278
|
* Sets the Open Graph image URL.
|
|
@@ -3996,7 +4281,7 @@ class ce extends ht {
|
|
|
3996
4281
|
* @param url image URL / URL изображения
|
|
3997
4282
|
*/
|
|
3998
4283
|
setImage(t) {
|
|
3999
|
-
return this.set(
|
|
4284
|
+
return this.set($.image, t);
|
|
4000
4285
|
}
|
|
4001
4286
|
/**
|
|
4002
4287
|
* Sets the Open Graph description.
|
|
@@ -4005,7 +4290,7 @@ class ce extends ht {
|
|
|
4005
4290
|
* @param description description / описание
|
|
4006
4291
|
*/
|
|
4007
4292
|
setDescription(t) {
|
|
4008
|
-
return this.set(
|
|
4293
|
+
return this.set($.description, t);
|
|
4009
4294
|
}
|
|
4010
4295
|
/**
|
|
4011
4296
|
* Sets the Open Graph locale.
|
|
@@ -4014,7 +4299,7 @@ class ce extends ht {
|
|
|
4014
4299
|
* @param locale locale (e.g. 'en_US', 'ru_RU') / локаль (например, 'en_US', 'ru_RU')
|
|
4015
4300
|
*/
|
|
4016
4301
|
setLocale(t) {
|
|
4017
|
-
return this.set(
|
|
4302
|
+
return this.set($.locale, t);
|
|
4018
4303
|
}
|
|
4019
4304
|
/**
|
|
4020
4305
|
* Sets the Open Graph site name.
|
|
@@ -4023,12 +4308,12 @@ class ce extends ht {
|
|
|
4023
4308
|
* @param siteName site name / название сайта
|
|
4024
4309
|
*/
|
|
4025
4310
|
setSiteName(t) {
|
|
4026
|
-
return this.set(
|
|
4311
|
+
return this.set($.siteName, t);
|
|
4027
4312
|
}
|
|
4028
4313
|
}
|
|
4029
|
-
class
|
|
4314
|
+
class me extends dt {
|
|
4030
4315
|
constructor() {
|
|
4031
|
-
super(Object.values(
|
|
4316
|
+
super(Object.values(p));
|
|
4032
4317
|
}
|
|
4033
4318
|
/**
|
|
4034
4319
|
* Gets the Twitter Card type.
|
|
@@ -4036,7 +4321,7 @@ class ue extends ht {
|
|
|
4036
4321
|
* Получает тип Twitter Card.
|
|
4037
4322
|
*/
|
|
4038
4323
|
getCard() {
|
|
4039
|
-
return this.get(
|
|
4324
|
+
return this.get(p.card);
|
|
4040
4325
|
}
|
|
4041
4326
|
/**
|
|
4042
4327
|
* Gets the website or brand @username.
|
|
@@ -4044,7 +4329,7 @@ class ue extends ht {
|
|
|
4044
4329
|
* Получает аккаунт сайта или бренда (@username).
|
|
4045
4330
|
*/
|
|
4046
4331
|
getSite() {
|
|
4047
|
-
return this.get(
|
|
4332
|
+
return this.get(p.site);
|
|
4048
4333
|
}
|
|
4049
4334
|
/**
|
|
4050
4335
|
* Gets the content creator @username.
|
|
@@ -4052,7 +4337,7 @@ class ue extends ht {
|
|
|
4052
4337
|
* Получает автора контента (@username).
|
|
4053
4338
|
*/
|
|
4054
4339
|
getCreator() {
|
|
4055
|
-
return this.get(
|
|
4340
|
+
return this.get(p.creator);
|
|
4056
4341
|
}
|
|
4057
4342
|
/**
|
|
4058
4343
|
* Gets the page URL.
|
|
@@ -4060,7 +4345,7 @@ class ue extends ht {
|
|
|
4060
4345
|
* Получает URL страницы.
|
|
4061
4346
|
*/
|
|
4062
4347
|
getUrl() {
|
|
4063
|
-
return this.get(
|
|
4348
|
+
return this.get(p.url);
|
|
4064
4349
|
}
|
|
4065
4350
|
/**
|
|
4066
4351
|
* Gets the card title.
|
|
@@ -4068,7 +4353,7 @@ class ue extends ht {
|
|
|
4068
4353
|
* Получает заголовок карточки.
|
|
4069
4354
|
*/
|
|
4070
4355
|
getTitle() {
|
|
4071
|
-
return this.get(
|
|
4356
|
+
return this.get(p.title);
|
|
4072
4357
|
}
|
|
4073
4358
|
/**
|
|
4074
4359
|
* Gets the card description.
|
|
@@ -4076,7 +4361,7 @@ class ue extends ht {
|
|
|
4076
4361
|
* Получает описание карточки.
|
|
4077
4362
|
*/
|
|
4078
4363
|
getDescription() {
|
|
4079
|
-
return this.get(
|
|
4364
|
+
return this.get(p.description);
|
|
4080
4365
|
}
|
|
4081
4366
|
/**
|
|
4082
4367
|
* Gets the card image URL.
|
|
@@ -4084,7 +4369,7 @@ class ue extends ht {
|
|
|
4084
4369
|
* Получает URL изображения карточки.
|
|
4085
4370
|
*/
|
|
4086
4371
|
getImage() {
|
|
4087
|
-
return this.get(
|
|
4372
|
+
return this.get(p.image);
|
|
4088
4373
|
}
|
|
4089
4374
|
/**
|
|
4090
4375
|
* Sets the Twitter Card type.
|
|
@@ -4093,7 +4378,7 @@ class ue extends ht {
|
|
|
4093
4378
|
* @param card card type / тип карточки
|
|
4094
4379
|
*/
|
|
4095
4380
|
setCard(t) {
|
|
4096
|
-
return this.set(
|
|
4381
|
+
return this.set(p.card, t), this;
|
|
4097
4382
|
}
|
|
4098
4383
|
/**
|
|
4099
4384
|
* Sets the website or brand @username.
|
|
@@ -4102,7 +4387,7 @@ class ue extends ht {
|
|
|
4102
4387
|
* @param site @username / аккаунт
|
|
4103
4388
|
*/
|
|
4104
4389
|
setSite(t) {
|
|
4105
|
-
return this.set(
|
|
4390
|
+
return this.set(p.site, t), this;
|
|
4106
4391
|
}
|
|
4107
4392
|
/**
|
|
4108
4393
|
* Sets the content creator @username.
|
|
@@ -4111,7 +4396,7 @@ class ue extends ht {
|
|
|
4111
4396
|
* @param creator @username / аккаунт автора
|
|
4112
4397
|
*/
|
|
4113
4398
|
setCreator(t) {
|
|
4114
|
-
return this.set(
|
|
4399
|
+
return this.set(p.creator, t), this;
|
|
4115
4400
|
}
|
|
4116
4401
|
/**
|
|
4117
4402
|
* Sets the page URL.
|
|
@@ -4120,7 +4405,7 @@ class ue extends ht {
|
|
|
4120
4405
|
* @param url URL / URL
|
|
4121
4406
|
*/
|
|
4122
4407
|
setUrl(t) {
|
|
4123
|
-
return this.set(
|
|
4408
|
+
return this.set(p.url, t), this;
|
|
4124
4409
|
}
|
|
4125
4410
|
/**
|
|
4126
4411
|
* Sets the card title.
|
|
@@ -4129,7 +4414,7 @@ class ue extends ht {
|
|
|
4129
4414
|
* @param title title / заголовок
|
|
4130
4415
|
*/
|
|
4131
4416
|
setTitle(t) {
|
|
4132
|
-
return this.set(
|
|
4417
|
+
return this.set(p.title, t), this;
|
|
4133
4418
|
}
|
|
4134
4419
|
/**
|
|
4135
4420
|
* Sets the card description.
|
|
@@ -4138,7 +4423,7 @@ class ue extends ht {
|
|
|
4138
4423
|
* @param description description / описание
|
|
4139
4424
|
*/
|
|
4140
4425
|
setDescription(t) {
|
|
4141
|
-
return this.set(
|
|
4426
|
+
return this.set(p.description, t), this;
|
|
4142
4427
|
}
|
|
4143
4428
|
/**
|
|
4144
4429
|
* Sets the card image URL.
|
|
@@ -4147,21 +4432,21 @@ class ue extends ht {
|
|
|
4147
4432
|
* @param image image URL / URL изображения
|
|
4148
4433
|
*/
|
|
4149
4434
|
setImage(t) {
|
|
4150
|
-
return this.set(
|
|
4435
|
+
return this.set(p.image, t), this;
|
|
4151
4436
|
}
|
|
4152
4437
|
}
|
|
4153
|
-
class
|
|
4438
|
+
class Ve extends dt {
|
|
4154
4439
|
/**
|
|
4155
4440
|
* Creates an instance of Meta with integrated Open Graph and Twitter Card support.
|
|
4156
4441
|
*
|
|
4157
4442
|
* Создает экземпляр Meta с интегрированной поддержкой Open Graph и Twitter Card.
|
|
4158
4443
|
*/
|
|
4159
4444
|
constructor() {
|
|
4160
|
-
super(Object.values(
|
|
4445
|
+
super(Object.values(L));
|
|
4161
4446
|
c(this, "suffix");
|
|
4162
4447
|
c(this, "og");
|
|
4163
4448
|
c(this, "twitter");
|
|
4164
|
-
this.og = new
|
|
4449
|
+
this.og = new fe(), this.twitter = new me();
|
|
4165
4450
|
}
|
|
4166
4451
|
/**
|
|
4167
4452
|
* Gets the MetaOg instance for advanced Open Graph operations.
|
|
@@ -4193,7 +4478,7 @@ class Fe extends ht {
|
|
|
4193
4478
|
* Получает мета-тег keywords.
|
|
4194
4479
|
*/
|
|
4195
4480
|
getKeywords() {
|
|
4196
|
-
return this.get(
|
|
4481
|
+
return this.get(L.keywords);
|
|
4197
4482
|
}
|
|
4198
4483
|
/**
|
|
4199
4484
|
* Gets the description meta tag.
|
|
@@ -4201,7 +4486,7 @@ class Fe extends ht {
|
|
|
4201
4486
|
* Получает мета-тег description.
|
|
4202
4487
|
*/
|
|
4203
4488
|
getDescription() {
|
|
4204
|
-
return this.get(
|
|
4489
|
+
return this.get(L.description);
|
|
4205
4490
|
}
|
|
4206
4491
|
/**
|
|
4207
4492
|
* Gets the Open Graph image URL.
|
|
@@ -4217,7 +4502,7 @@ class Fe extends ht {
|
|
|
4217
4502
|
* Получает канонический URL.
|
|
4218
4503
|
*/
|
|
4219
4504
|
getCanonical() {
|
|
4220
|
-
return this.get(
|
|
4505
|
+
return this.get(L.canonical);
|
|
4221
4506
|
}
|
|
4222
4507
|
/**
|
|
4223
4508
|
* Gets the robots meta tag value.
|
|
@@ -4225,7 +4510,7 @@ class Fe extends ht {
|
|
|
4225
4510
|
* Получает значение мета-тега robots.
|
|
4226
4511
|
*/
|
|
4227
4512
|
getRobots() {
|
|
4228
|
-
return this.get(
|
|
4513
|
+
return this.get(L.robots);
|
|
4229
4514
|
}
|
|
4230
4515
|
/**
|
|
4231
4516
|
* Gets the author meta tag.
|
|
@@ -4233,7 +4518,7 @@ class Fe extends ht {
|
|
|
4233
4518
|
* Получает мета-тег author.
|
|
4234
4519
|
*/
|
|
4235
4520
|
getAuthor() {
|
|
4236
|
-
return this.get(
|
|
4521
|
+
return this.get(L.author);
|
|
4237
4522
|
}
|
|
4238
4523
|
/**
|
|
4239
4524
|
* Gets the Open Graph site name.
|
|
@@ -4259,8 +4544,8 @@ class Fe extends ht {
|
|
|
4259
4544
|
*/
|
|
4260
4545
|
setTitle(e) {
|
|
4261
4546
|
if (l()) {
|
|
4262
|
-
const
|
|
4263
|
-
document.title =
|
|
4547
|
+
const i = y(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
|
|
4548
|
+
document.title = i, this.og.setTitle(i), this.twitter.setTitle(i);
|
|
4264
4549
|
}
|
|
4265
4550
|
return this;
|
|
4266
4551
|
}
|
|
@@ -4271,7 +4556,7 @@ class Fe extends ht {
|
|
|
4271
4556
|
* @param keywords keywords as string or array / ключевые слова в виде строки или массива
|
|
4272
4557
|
*/
|
|
4273
4558
|
setKeywords(e) {
|
|
4274
|
-
return this.set(
|
|
4559
|
+
return this.set(L.keywords, Y(e).join(", ")), this;
|
|
4275
4560
|
}
|
|
4276
4561
|
/**
|
|
4277
4562
|
* Sets the description meta tag.
|
|
@@ -4280,7 +4565,7 @@ class Fe extends ht {
|
|
|
4280
4565
|
* @param description page description / описание страницы
|
|
4281
4566
|
*/
|
|
4282
4567
|
setDescription(e) {
|
|
4283
|
-
return this.set(
|
|
4568
|
+
return this.set(L.description, e), this;
|
|
4284
4569
|
}
|
|
4285
4570
|
/**
|
|
4286
4571
|
* Sets the image for Open Graph and Twitter Card.
|
|
@@ -4298,7 +4583,7 @@ class Fe extends ht {
|
|
|
4298
4583
|
* @param canonical canonical URL / канонический URL
|
|
4299
4584
|
*/
|
|
4300
4585
|
setCanonical(e) {
|
|
4301
|
-
return this.set(
|
|
4586
|
+
return this.set(L.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
|
|
4302
4587
|
}
|
|
4303
4588
|
/**
|
|
4304
4589
|
* Sets the robots meta tag.
|
|
@@ -4307,7 +4592,7 @@ class Fe extends ht {
|
|
|
4307
4592
|
* @param robots robots directive / директива robots
|
|
4308
4593
|
*/
|
|
4309
4594
|
setRobots(e) {
|
|
4310
|
-
return this.set(
|
|
4595
|
+
return this.set(L.robots, e), this;
|
|
4311
4596
|
}
|
|
4312
4597
|
/**
|
|
4313
4598
|
* Sets the author meta tag.
|
|
@@ -4316,7 +4601,7 @@ class Fe extends ht {
|
|
|
4316
4601
|
* @param author author name / имя автора
|
|
4317
4602
|
*/
|
|
4318
4603
|
setAuthor(e) {
|
|
4319
|
-
return this.set(
|
|
4604
|
+
return this.set(L.author, e), this;
|
|
4320
4605
|
}
|
|
4321
4606
|
/**
|
|
4322
4607
|
* Sets the site name for Open Graph and Twitter Card.
|
|
@@ -4359,10 +4644,10 @@ class Fe extends ht {
|
|
|
4359
4644
|
* Получает отформатированный суффикс с разделителем.
|
|
4360
4645
|
*/
|
|
4361
4646
|
getSuffix() {
|
|
4362
|
-
return
|
|
4647
|
+
return y(this.suffix) ? ` - ${this.suffix}` : "";
|
|
4363
4648
|
}
|
|
4364
4649
|
}
|
|
4365
|
-
class
|
|
4650
|
+
class ut {
|
|
4366
4651
|
/**
|
|
4367
4652
|
* Checks whether to enable scroll hiding.
|
|
4368
4653
|
*
|
|
@@ -4381,19 +4666,35 @@ class ot {
|
|
|
4381
4666
|
var e;
|
|
4382
4667
|
const t = (e = this.storage.get()) != null ? e : -1;
|
|
4383
4668
|
if (!this.calculate && t === -1) {
|
|
4384
|
-
const
|
|
4385
|
-
return this.storage.set(
|
|
4669
|
+
const i = await this.init();
|
|
4670
|
+
return this.storage.set(i), i;
|
|
4386
4671
|
}
|
|
4387
4672
|
return t;
|
|
4388
4673
|
}
|
|
4674
|
+
/**
|
|
4675
|
+
* Returns the storage.
|
|
4676
|
+
*
|
|
4677
|
+
* Возвращает хранилище.
|
|
4678
|
+
*/
|
|
4679
|
+
static getStorage() {
|
|
4680
|
+
return this.storage;
|
|
4681
|
+
}
|
|
4682
|
+
/**
|
|
4683
|
+
* Returns the calculate flag.
|
|
4684
|
+
*
|
|
4685
|
+
* Возвращает флаг вычисления.
|
|
4686
|
+
*/
|
|
4687
|
+
static getCalculate() {
|
|
4688
|
+
return this.calculate;
|
|
4689
|
+
}
|
|
4389
4690
|
/**
|
|
4390
4691
|
* Creates elements to check the width of the scroll.
|
|
4391
4692
|
*
|
|
4392
4693
|
* Создает элементы для проверки ширины скролла.
|
|
4393
4694
|
*/
|
|
4394
4695
|
static createElement() {
|
|
4395
|
-
return
|
|
4396
|
-
t.style.height = "24px", t.style.overflowY = "scroll", t.style.position = "fixed", t.style.width = "100%",
|
|
4696
|
+
return G(document.body, "div", (t) => {
|
|
4697
|
+
t.style.height = "24px", t.style.overflowY = "scroll", t.style.position = "fixed", t.style.width = "100%", G(t, "div", (e) => {
|
|
4397
4698
|
e.style.height = "100px";
|
|
4398
4699
|
});
|
|
4399
4700
|
});
|
|
@@ -4413,8 +4714,562 @@ class ot {
|
|
|
4413
4714
|
});
|
|
4414
4715
|
}
|
|
4415
4716
|
}
|
|
4416
|
-
c(
|
|
4417
|
-
|
|
4717
|
+
c(ut, "storage", new et("scrollbar", !0)), c(ut, "calculate", !1);
|
|
4718
|
+
function ft(s) {
|
|
4719
|
+
return s.replace(/([[\]\\^$.?*+(){}/|])/g, "\\$1");
|
|
4720
|
+
}
|
|
4721
|
+
function ye(s) {
|
|
4722
|
+
const t = d(
|
|
4723
|
+
s.split(" "),
|
|
4724
|
+
(e) => ft(e)
|
|
4725
|
+
).join("|");
|
|
4726
|
+
return new RegExp(`(${t})`, "ig");
|
|
4727
|
+
}
|
|
4728
|
+
function $e(s, t, e = "sys-highlight-match") {
|
|
4729
|
+
return t ? String(s).replace(
|
|
4730
|
+
ye(t),
|
|
4731
|
+
`<span class="${e}">$1</span>`
|
|
4732
|
+
) : s;
|
|
4733
|
+
}
|
|
4734
|
+
class pe {
|
|
4735
|
+
/**
|
|
4736
|
+
* Constructor for SearchListData.
|
|
4737
|
+
*
|
|
4738
|
+
* Конструктор для SearchListData.
|
|
4739
|
+
* @param list original list of items/ исходный список элементов
|
|
4740
|
+
* @param columns columns to search in/ столбцы для поиска
|
|
4741
|
+
* @param item current search item state/ текущее состояние элемента поиска
|
|
4742
|
+
* @param options search options/ опции поиска
|
|
4743
|
+
*/
|
|
4744
|
+
constructor(t, e, i, r) {
|
|
4745
|
+
c(this, "listCache");
|
|
4746
|
+
this.list = t, this.columns = e, this.item = i, this.options = r;
|
|
4747
|
+
}
|
|
4748
|
+
/**
|
|
4749
|
+
* Checks if both list and columns are provided.
|
|
4750
|
+
*
|
|
4751
|
+
* Проверяет, предоставлены ли и список, и столбцы.
|
|
4752
|
+
* @returns boolean indicating if ready for column-based search/ логическое значение, указывающее на готовность к поиску по столбцам
|
|
4753
|
+
*/
|
|
4754
|
+
is() {
|
|
4755
|
+
return !!(this.list && this.columns);
|
|
4756
|
+
}
|
|
4757
|
+
/**
|
|
4758
|
+
* Checks if the list is provided.
|
|
4759
|
+
*
|
|
4760
|
+
* Проверяет, предоставлен ли список.
|
|
4761
|
+
* @returns boolean/ логическое значение
|
|
4762
|
+
*/
|
|
4763
|
+
isList() {
|
|
4764
|
+
return !!this.list;
|
|
4765
|
+
}
|
|
4766
|
+
/**
|
|
4767
|
+
* Returns the original list.
|
|
4768
|
+
*
|
|
4769
|
+
* Возвращает исходный список.
|
|
4770
|
+
* @returns list value/ значение списка
|
|
4771
|
+
*/
|
|
4772
|
+
getList() {
|
|
4773
|
+
return this.list;
|
|
4774
|
+
}
|
|
4775
|
+
/**
|
|
4776
|
+
* Returns the search columns.
|
|
4777
|
+
*
|
|
4778
|
+
* Возвращает столбцы поиска.
|
|
4779
|
+
* @returns columns or undefined/ столбцы или undefined
|
|
4780
|
+
*/
|
|
4781
|
+
getColumns() {
|
|
4782
|
+
return this.columns;
|
|
4783
|
+
}
|
|
4784
|
+
/**
|
|
4785
|
+
* Gets the search cache, initializing it if necessary.
|
|
4786
|
+
*
|
|
4787
|
+
* Получает кэш поиска, инициализируя его при необходимости.
|
|
4788
|
+
* @returns search cache/ кэш поиска
|
|
4789
|
+
*/
|
|
4790
|
+
getCache() {
|
|
4791
|
+
var t;
|
|
4792
|
+
return this.listCache || this.initCache(), (t = this.listCache) != null ? t : [];
|
|
4793
|
+
}
|
|
4794
|
+
/**
|
|
4795
|
+
* Sets a new list and regenerates the cache.
|
|
4796
|
+
*
|
|
4797
|
+
* Устанавливает новый список и регенерирует кэш.
|
|
4798
|
+
* @param list new list/ новый список
|
|
4799
|
+
* @returns this instance/ данный экземпляр
|
|
4800
|
+
*/
|
|
4801
|
+
setList(t) {
|
|
4802
|
+
return this.list = t, this.resetCache(), this;
|
|
4803
|
+
}
|
|
4804
|
+
/**
|
|
4805
|
+
* Sets new search columns and regenerates the cache.
|
|
4806
|
+
*
|
|
4807
|
+
* Устанавливает новые столбцы поиска и регенерирует кэш.
|
|
4808
|
+
* @param columns new columns/ новые столбцы
|
|
4809
|
+
* @returns this instance/ данный экземпляр
|
|
4810
|
+
*/
|
|
4811
|
+
setColumns(t) {
|
|
4812
|
+
return this.columns = t, this.resetCache(), this;
|
|
4813
|
+
}
|
|
4814
|
+
/**
|
|
4815
|
+
* Finds a cached item corresponding to the given original item.
|
|
4816
|
+
*
|
|
4817
|
+
* Находит кэшированный элемент, соответствующий данному исходному элементу.
|
|
4818
|
+
* @param item original item/ исходный элемент
|
|
4819
|
+
* @returns cache item or undefined/ кэшированный элемент или undefined
|
|
4820
|
+
*/
|
|
4821
|
+
findCacheItem(t) {
|
|
4822
|
+
return this.getCache().find((e) => e.item === t);
|
|
4823
|
+
}
|
|
4824
|
+
/**
|
|
4825
|
+
* Iterates over the cached list and executes a callback for each item.
|
|
4826
|
+
*
|
|
4827
|
+
* Перебирает кэшированный список и выполняет обратный вызов для каждого элемента.
|
|
4828
|
+
* @param callback function to execute for each item/ функция для выполнения для каждого элемента
|
|
4829
|
+
* @returns formatted list/ отформатированный список
|
|
4830
|
+
*/
|
|
4831
|
+
forEach(t) {
|
|
4832
|
+
const e = [];
|
|
4833
|
+
return this.isList() && this.getCache().forEach((i) => {
|
|
4834
|
+
const r = t(
|
|
4835
|
+
i.item,
|
|
4836
|
+
i.value
|
|
4837
|
+
);
|
|
4838
|
+
r && e.push(r);
|
|
4839
|
+
}), e;
|
|
4840
|
+
}
|
|
4841
|
+
/**
|
|
4842
|
+
* Converts a single item to a formatted item with highlighted matches if selected.
|
|
4843
|
+
*
|
|
4844
|
+
* Преобразует один элемент в отформатированный элемент с выделенными совпадениями, если он выбран.
|
|
4845
|
+
* @param item original item/ исходный элемент
|
|
4846
|
+
* @param selection whether the item matches the search and should be highlighted/ совпадает ли элемент с поиском и должен ли он быть выделен
|
|
4847
|
+
* @returns formatted item/ отформатированный элемент
|
|
4848
|
+
*/
|
|
4849
|
+
toFormatItem(t, e) {
|
|
4850
|
+
const i = {};
|
|
4851
|
+
return this.columns && this.columns.forEach((r) => {
|
|
4852
|
+
const o = this.getColumnName(r), a = x(t, r);
|
|
4853
|
+
i[o] = y(a) && e ? this.addTag(a) : T(a);
|
|
4854
|
+
}), {
|
|
4855
|
+
...t,
|
|
4856
|
+
...i,
|
|
4857
|
+
searchActive: e
|
|
4858
|
+
};
|
|
4859
|
+
}
|
|
4860
|
+
/**
|
|
4861
|
+
* Formats a column path to a camelCase property name with a 'Search' suffix.
|
|
4862
|
+
*
|
|
4863
|
+
* Форматирует путь к столбцу в имя свойства camelCase с суффиксом 'Search'.
|
|
4864
|
+
* @param column column path/ путь к столбцу
|
|
4865
|
+
* @returns property name/ имя свойства
|
|
4866
|
+
*/
|
|
4867
|
+
getColumnName(t) {
|
|
4868
|
+
return t.replace(
|
|
4869
|
+
/\.([a-z0-9])/ig,
|
|
4870
|
+
(e, i) => i.toUpperCase()
|
|
4871
|
+
) + "Search";
|
|
4872
|
+
}
|
|
4873
|
+
/**
|
|
4874
|
+
* Adds highlight tags to the given value based on the current search value.
|
|
4875
|
+
*
|
|
4876
|
+
* Добавляет теги выделения к данному значению на основе текущего значения поиска.
|
|
4877
|
+
* @param value value to highlight/ значение для выделения
|
|
4878
|
+
* @returns highlighted string/ выделенная строка
|
|
4879
|
+
*/
|
|
4880
|
+
addTag(t) {
|
|
4881
|
+
return $e(
|
|
4882
|
+
T(t),
|
|
4883
|
+
this.item.get(),
|
|
4884
|
+
this.options.getClassName()
|
|
4885
|
+
);
|
|
4886
|
+
}
|
|
4887
|
+
/**
|
|
4888
|
+
* Generates a search cache for the current list and columns.
|
|
4889
|
+
*
|
|
4890
|
+
* Генерирует кэш поиска для текущего списка и столбцов.
|
|
4891
|
+
* @returns search cache/ кэш поиска
|
|
4892
|
+
*/
|
|
4893
|
+
generateCache() {
|
|
4894
|
+
if (!this.isList())
|
|
4895
|
+
return [];
|
|
4896
|
+
const t = [];
|
|
4897
|
+
for (const e of this.list) {
|
|
4898
|
+
let i = "";
|
|
4899
|
+
if (this.columns)
|
|
4900
|
+
for (const r of this.columns) {
|
|
4901
|
+
const o = x(e, r);
|
|
4902
|
+
y(o) && (i += ` ${T(o)}`);
|
|
4903
|
+
}
|
|
4904
|
+
t.push({
|
|
4905
|
+
item: e,
|
|
4906
|
+
value: i
|
|
4907
|
+
});
|
|
4908
|
+
}
|
|
4909
|
+
return t;
|
|
4910
|
+
}
|
|
4911
|
+
/**
|
|
4912
|
+
* Initializes the search cache.
|
|
4913
|
+
*
|
|
4914
|
+
* Инициализирует кэш поиска.
|
|
4915
|
+
*/
|
|
4916
|
+
initCache() {
|
|
4917
|
+
this.listCache = this.generateCache();
|
|
4918
|
+
}
|
|
4919
|
+
/**
|
|
4920
|
+
* Resets the search cache.
|
|
4921
|
+
*
|
|
4922
|
+
* Сбрасывает кэш поиска.
|
|
4923
|
+
*/
|
|
4924
|
+
resetCache() {
|
|
4925
|
+
this.listCache = void 0;
|
|
4926
|
+
}
|
|
4927
|
+
}
|
|
4928
|
+
class be {
|
|
4929
|
+
/**
|
|
4930
|
+
* Constructor for SearchListItem.
|
|
4931
|
+
*
|
|
4932
|
+
* Конструктор для SearchListItem.
|
|
4933
|
+
* @param value current search value/ текущее значение поиска
|
|
4934
|
+
* @param options search options/ опции поиска
|
|
4935
|
+
*/
|
|
4936
|
+
constructor(t, e) {
|
|
4937
|
+
this.value = t, this.options = e;
|
|
4938
|
+
}
|
|
4939
|
+
/**
|
|
4940
|
+
* Checks if the value is filled.
|
|
4941
|
+
*
|
|
4942
|
+
* Проверяет, заполнено ли значение.
|
|
4943
|
+
* @returns boolean indicating if value exists/ логическое значение, указывающее на наличие значения
|
|
4944
|
+
*/
|
|
4945
|
+
is() {
|
|
4946
|
+
return !!this.value;
|
|
4947
|
+
}
|
|
4948
|
+
/**
|
|
4949
|
+
* Checks if a search should be performed based on the current value and options.
|
|
4950
|
+
*
|
|
4951
|
+
* Проверяет, следует ли выполнять поиск на основе текущего значения и опций.
|
|
4952
|
+
* @returns boolean/ логическое значение
|
|
4953
|
+
*/
|
|
4954
|
+
isSearch() {
|
|
4955
|
+
return this.is() && this.value.length >= this.options.getLimit();
|
|
4956
|
+
}
|
|
4957
|
+
/**
|
|
4958
|
+
* Returns the current search value as a string.
|
|
4959
|
+
*
|
|
4960
|
+
* Возвращает текущее значение поиска в виде строки.
|
|
4961
|
+
* @returns search value/ значение поиска
|
|
4962
|
+
*/
|
|
4963
|
+
get() {
|
|
4964
|
+
var t;
|
|
4965
|
+
return (t = this.value) != null ? t : "";
|
|
4966
|
+
}
|
|
4967
|
+
/**
|
|
4968
|
+
* Sets a new search value.
|
|
4969
|
+
*
|
|
4970
|
+
* Устанавливает новое значение поиска.
|
|
4971
|
+
* @param value new search value/ новое значение поиска
|
|
4972
|
+
* @returns this instance/ данный экземпляр
|
|
4973
|
+
*/
|
|
4974
|
+
set(t) {
|
|
4975
|
+
return this.value = t, this;
|
|
4976
|
+
}
|
|
4977
|
+
}
|
|
4978
|
+
function zt(s, t = "ig", e = ":value") {
|
|
4979
|
+
const i = ft(s);
|
|
4980
|
+
return new RegExp(e.replace(/:value/g, i), t);
|
|
4981
|
+
}
|
|
4982
|
+
function we(s) {
|
|
4983
|
+
return zt(s, "i", "(:value)");
|
|
4984
|
+
}
|
|
4985
|
+
function ve(s) {
|
|
4986
|
+
let t = "";
|
|
4987
|
+
return s.split(" ").forEach((e) => {
|
|
4988
|
+
const i = ft(e).trim();
|
|
4989
|
+
y(i) && (t += `(?=.*?${i})`);
|
|
4990
|
+
}), new RegExp(`^${t}`, "ig");
|
|
4991
|
+
}
|
|
4992
|
+
class Se {
|
|
4993
|
+
/**
|
|
4994
|
+
* Constructor for SearchListMatcher.
|
|
4995
|
+
*
|
|
4996
|
+
* Конструктор для SearchListMatcher.
|
|
4997
|
+
* @param item search item containing the current value/ элемент поиска, содержащий текущее значение
|
|
4998
|
+
* @param options search options/ опции поиска
|
|
4999
|
+
*/
|
|
5000
|
+
constructor(t, e) {
|
|
5001
|
+
c(this, "matcher");
|
|
5002
|
+
this.item = t, this.options = e, this.initMatcher();
|
|
5003
|
+
}
|
|
5004
|
+
/**
|
|
5005
|
+
* Checks if the matcher is initialized.
|
|
5006
|
+
*
|
|
5007
|
+
* Проверяет, инициализирован ли сопоставитель.
|
|
5008
|
+
* @returns boolean/ логическое значение
|
|
5009
|
+
*/
|
|
5010
|
+
is() {
|
|
5011
|
+
return !!this.matcher;
|
|
5012
|
+
}
|
|
5013
|
+
/**
|
|
5014
|
+
* Checks if the given value matches the current search expression.
|
|
5015
|
+
*
|
|
5016
|
+
* Проверяет, соответствует ли данное значение текущему поисковому выражению.
|
|
5017
|
+
* @param value value to check/ проверяемое значение
|
|
5018
|
+
* @returns boolean indicating a match/ логическое значение, указывающее на совпадение
|
|
5019
|
+
*/
|
|
5020
|
+
isSelection(t) {
|
|
5021
|
+
return this.matcher ? this.matcher.test(t) : !1;
|
|
5022
|
+
}
|
|
5023
|
+
/**
|
|
5024
|
+
* Returns the current regular expression matcher.
|
|
5025
|
+
*
|
|
5026
|
+
* Возвращает текущий сопоставитель регулярных выражений.
|
|
5027
|
+
* @returns RegExp or undefined/ RegExp или undefined
|
|
5028
|
+
*/
|
|
5029
|
+
get() {
|
|
5030
|
+
return this.matcher;
|
|
5031
|
+
}
|
|
5032
|
+
/**
|
|
5033
|
+
* Updates the matcher based on the current item value and options.
|
|
5034
|
+
*
|
|
5035
|
+
* Обновляет сопоставитель на основе текущего значения элемента и опций.
|
|
5036
|
+
*/
|
|
5037
|
+
update() {
|
|
5038
|
+
this.initMatcher();
|
|
5039
|
+
}
|
|
5040
|
+
/**
|
|
5041
|
+
* Initializes or resets the regular expression matcher.
|
|
5042
|
+
*
|
|
5043
|
+
* Инициализирует или сбрасывает сопоставитель регулярных выражений.
|
|
5044
|
+
*/
|
|
5045
|
+
initMatcher() {
|
|
5046
|
+
this.item.is() ? this.matcher = this.options.getFindExactMatch() ? we(this.item.get()) : ve(this.item.get()) : this.matcher = void 0;
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
class Le {
|
|
5050
|
+
/**
|
|
5051
|
+
* Constructor for SearchListOptions.
|
|
5052
|
+
*
|
|
5053
|
+
* Конструктор для SearchListOptions.
|
|
5054
|
+
* @param options search options/ опции поиска
|
|
5055
|
+
*/
|
|
5056
|
+
constructor(t) {
|
|
5057
|
+
this.options = t;
|
|
5058
|
+
}
|
|
5059
|
+
/**
|
|
5060
|
+
* Returns the current search options.
|
|
5061
|
+
*
|
|
5062
|
+
* Возвращает текущие опции поиска.
|
|
5063
|
+
* @returns search options/ опции поиска
|
|
5064
|
+
*/
|
|
5065
|
+
getOptions() {
|
|
5066
|
+
return this.options || {};
|
|
5067
|
+
}
|
|
5068
|
+
/**
|
|
5069
|
+
* Returns the minimum number of characters required to trigger a search.
|
|
5070
|
+
*
|
|
5071
|
+
* Возвращает минимальное количество символов, необходимых для запуска поиска.
|
|
5072
|
+
* @returns limit value/ значение лимита
|
|
5073
|
+
*/
|
|
5074
|
+
getLimit() {
|
|
5075
|
+
var t;
|
|
5076
|
+
return (t = this.getOptions().limit) != null ? t : 2;
|
|
5077
|
+
}
|
|
5078
|
+
/**
|
|
5079
|
+
* Returns whether to return all items even if they don't match the search query.
|
|
5080
|
+
*
|
|
5081
|
+
* Возвращает, следует ли возвращать все элементы, даже если они не соответствуют поисковому запросу.
|
|
5082
|
+
* @returns boolean value/ логическое значение
|
|
5083
|
+
*/
|
|
5084
|
+
getReturnEverything() {
|
|
5085
|
+
var t;
|
|
5086
|
+
return (t = this.getOptions().returnEverything) != null ? t : !1;
|
|
5087
|
+
}
|
|
5088
|
+
/**
|
|
5089
|
+
* Returns the search delay in milliseconds.
|
|
5090
|
+
*
|
|
5091
|
+
* Возвращает задержку поиска в миллисекундах.
|
|
5092
|
+
* @returns delay value/ значение задержки
|
|
5093
|
+
*/
|
|
5094
|
+
getDelay() {
|
|
5095
|
+
var t;
|
|
5096
|
+
return (t = this.getOptions().delay) != null ? t : 0;
|
|
5097
|
+
}
|
|
5098
|
+
/**
|
|
5099
|
+
* Returns whether to perform an exact match search.
|
|
5100
|
+
*
|
|
5101
|
+
* Возвращает, следует ли выполнять поиск с точным совпадением.
|
|
5102
|
+
* @returns boolean value/ логическое значение
|
|
5103
|
+
*/
|
|
5104
|
+
getFindExactMatch() {
|
|
5105
|
+
var t;
|
|
5106
|
+
return (t = this.getOptions().findExactMatch) != null ? t : !1;
|
|
5107
|
+
}
|
|
5108
|
+
/**
|
|
5109
|
+
* Returns the CSS class name used for highlighting matches.
|
|
5110
|
+
*
|
|
5111
|
+
* Возвращает имя класса CSS, используемое для выделения совпадений.
|
|
5112
|
+
* @returns class name/ имя класса
|
|
5113
|
+
*/
|
|
5114
|
+
getClassName() {
|
|
5115
|
+
var t;
|
|
5116
|
+
return (t = this.getOptions().classSearchName) != null ? t : "sys-search-selection";
|
|
5117
|
+
}
|
|
5118
|
+
/**
|
|
5119
|
+
* Sets new search options.
|
|
5120
|
+
*
|
|
5121
|
+
* Устанавливает новые опции поиска.
|
|
5122
|
+
* @param options search options/ опции поиска
|
|
5123
|
+
* @returns this instance/ данный экземпляр
|
|
5124
|
+
*/
|
|
5125
|
+
setOptions(t) {
|
|
5126
|
+
return this.options = t, this;
|
|
5127
|
+
}
|
|
5128
|
+
}
|
|
5129
|
+
class Ke {
|
|
5130
|
+
/**
|
|
5131
|
+
* Constructor for SearchList.
|
|
5132
|
+
*
|
|
5133
|
+
* Конструктор для SearchList.
|
|
5134
|
+
* @param list initial list of items/ исходный список элементов
|
|
5135
|
+
* @param columns columns to perform search on/ столбцы для выполнения поиска
|
|
5136
|
+
* @param value initial search value/ начальное значение поиска
|
|
5137
|
+
* @param options search options/ опции поиска
|
|
5138
|
+
*/
|
|
5139
|
+
constructor(t, e, i, r) {
|
|
5140
|
+
c(this, "options");
|
|
5141
|
+
c(this, "item");
|
|
5142
|
+
c(this, "matcher");
|
|
5143
|
+
c(this, "data");
|
|
5144
|
+
/**
|
|
5145
|
+
* Callback for processing items when a search is active.
|
|
5146
|
+
* Checks for selection and handles "return everything" option.
|
|
5147
|
+
*
|
|
5148
|
+
* Обратный вызов для обработки элементов при активном поиске.
|
|
5149
|
+
* Проверяет выбор и обрабатывает опцию "возвращать всё".
|
|
5150
|
+
*/
|
|
5151
|
+
c(this, "callbackToSelection", (t, e) => {
|
|
5152
|
+
if (this.matcher.isSelection(e))
|
|
5153
|
+
return this.data.toFormatItem(t, !0);
|
|
5154
|
+
if (this.options.getReturnEverything())
|
|
5155
|
+
return this.data.toFormatItem(t, !1);
|
|
5156
|
+
});
|
|
5157
|
+
/**
|
|
5158
|
+
* Callback for processing items when no search is active.
|
|
5159
|
+
*
|
|
5160
|
+
* Обратный вызов для обработки элементов, когда поиск не активен.
|
|
5161
|
+
*/
|
|
5162
|
+
c(this, "callbackToNone", (t) => this.data.toFormatItem(t, !1));
|
|
5163
|
+
this.options = new Le(r), this.item = new be(i, this.options), this.matcher = new Se(this.item, this.options), this.data = new pe(t, e, this.item, this.options);
|
|
5164
|
+
}
|
|
5165
|
+
/**
|
|
5166
|
+
* Returns the search data management instance.
|
|
5167
|
+
*
|
|
5168
|
+
* Возвращает экземпляр управления данными поиска.
|
|
5169
|
+
* @returns SearchListData instance/ экземпляр SearchListData
|
|
5170
|
+
*/
|
|
5171
|
+
getData() {
|
|
5172
|
+
return this.data;
|
|
5173
|
+
}
|
|
5174
|
+
/**
|
|
5175
|
+
* Returns the current list of items.
|
|
5176
|
+
*
|
|
5177
|
+
* Возвращает текущий список элементов.
|
|
5178
|
+
* @returns list of items/ список элементов
|
|
5179
|
+
*/
|
|
5180
|
+
getList() {
|
|
5181
|
+
return this.data.getList();
|
|
5182
|
+
}
|
|
5183
|
+
/**
|
|
5184
|
+
* Returns the current search columns.
|
|
5185
|
+
*
|
|
5186
|
+
* Возвращает текущие столбцы поиска.
|
|
5187
|
+
* @returns columns or undefined/ столбцы или undefined
|
|
5188
|
+
*/
|
|
5189
|
+
getColumns() {
|
|
5190
|
+
return this.data.getColumns();
|
|
5191
|
+
}
|
|
5192
|
+
/**
|
|
5193
|
+
* Returns the search item instance.
|
|
5194
|
+
*
|
|
5195
|
+
* Возвращает экземпляр элемента поиска.
|
|
5196
|
+
* @returns SearchListItem instance/ экземпляр SearchListItem
|
|
5197
|
+
*/
|
|
5198
|
+
getItem() {
|
|
5199
|
+
return this.item;
|
|
5200
|
+
}
|
|
5201
|
+
/**
|
|
5202
|
+
* Returns the current search value.
|
|
5203
|
+
*
|
|
5204
|
+
* Возвращает текущее значение поиска.
|
|
5205
|
+
* @returns search value string or undefined/ строка значения поиска или undefined
|
|
5206
|
+
*/
|
|
5207
|
+
getValue() {
|
|
5208
|
+
return this.item.get();
|
|
5209
|
+
}
|
|
5210
|
+
/**
|
|
5211
|
+
* Returns the search options instance.
|
|
5212
|
+
*
|
|
5213
|
+
* Возвращает экземпляр опций поиска.
|
|
5214
|
+
* @returns SearchListOptions instance/ экземпляр SearchListOptions
|
|
5215
|
+
*/
|
|
5216
|
+
getOptions() {
|
|
5217
|
+
return this.options;
|
|
5218
|
+
}
|
|
5219
|
+
/**
|
|
5220
|
+
* Sets a new list of items.
|
|
5221
|
+
*
|
|
5222
|
+
* Устанавливает новый список элементов.
|
|
5223
|
+
* @param list new list/ новый список
|
|
5224
|
+
* @returns this instance/ данный экземпляр
|
|
5225
|
+
*/
|
|
5226
|
+
setList(t) {
|
|
5227
|
+
return this.data.setList(t), this;
|
|
5228
|
+
}
|
|
5229
|
+
/**
|
|
5230
|
+
* Sets new search columns.
|
|
5231
|
+
*
|
|
5232
|
+
* Устанавливает новые столбцы поиска.
|
|
5233
|
+
* @param columns new columns/ новые столбцы
|
|
5234
|
+
* @returns this instance/ данный экземпляр
|
|
5235
|
+
*/
|
|
5236
|
+
setColumns(t) {
|
|
5237
|
+
return this.data.setColumns(t), this;
|
|
5238
|
+
}
|
|
5239
|
+
/**
|
|
5240
|
+
* Sets a new search value and updates the matcher.
|
|
5241
|
+
*
|
|
5242
|
+
* Устанавливает новое значение поиска и обновляет сопоставитель.
|
|
5243
|
+
* @param value new search value/ новое значение поиска
|
|
5244
|
+
* @returns this instance/ данный экземпляр
|
|
5245
|
+
*/
|
|
5246
|
+
setValue(t) {
|
|
5247
|
+
return this.item.get() === t ? this : (this.item.set(t), this.matcher.update(), this);
|
|
5248
|
+
}
|
|
5249
|
+
/**
|
|
5250
|
+
* Sets new search options and updates the matcher.
|
|
5251
|
+
*
|
|
5252
|
+
* Устанавливает новые опции поиска и обновляет сопоставитель.
|
|
5253
|
+
* @param options new options/ новые опции
|
|
5254
|
+
* @returns this instance/ данный экземпляр
|
|
5255
|
+
*/
|
|
5256
|
+
setOptions(t) {
|
|
5257
|
+
return this.options.setOptions(t), this.matcher.update(), this;
|
|
5258
|
+
}
|
|
5259
|
+
/**
|
|
5260
|
+
* Processes the list and returns a formatted list of items based on the current search state.
|
|
5261
|
+
*
|
|
5262
|
+
* Обрабатывает список и возвращает отформатированный список элементов на основе текущего состояния поиска.
|
|
5263
|
+
* @returns formatted list of items/ отформатированный список элементов
|
|
5264
|
+
*/
|
|
5265
|
+
to() {
|
|
5266
|
+
if (this.item.isSearch())
|
|
5267
|
+
return this.data.forEach(this.callbackToSelection);
|
|
5268
|
+
const t = this.data.getList();
|
|
5269
|
+
return t ? d(t, this.callbackToNone) : [];
|
|
5270
|
+
}
|
|
5271
|
+
}
|
|
5272
|
+
const Ce = [
|
|
4418
5273
|
"d",
|
|
4419
5274
|
"e",
|
|
4420
5275
|
"f",
|
|
@@ -4434,21 +5289,21 @@ const he = [
|
|
|
4434
5289
|
"t",
|
|
4435
5290
|
"u",
|
|
4436
5291
|
"v"
|
|
4437
|
-
],
|
|
4438
|
-
let e = String(
|
|
4439
|
-
if (
|
|
4440
|
-
let
|
|
5292
|
+
], De = (s, t = {}) => {
|
|
5293
|
+
let e = String(s);
|
|
5294
|
+
if (s.match(/%[a-z]/)) {
|
|
5295
|
+
let i = 0;
|
|
4441
5296
|
d(t, (r) => {
|
|
4442
|
-
e = e.replace(new RegExp(`%${
|
|
5297
|
+
e = e.replace(new RegExp(`%${Ce[i++]}`, "g"), String(r));
|
|
4443
5298
|
});
|
|
4444
5299
|
}
|
|
4445
|
-
return A(t) && d(t, (
|
|
5300
|
+
return A(t) && d(t, (i, r) => {
|
|
4446
5301
|
e = e.replace(
|
|
4447
5302
|
new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})(.*?)(?:\\[|\\{)\\/${r}(?:\\]|\\})`, "g"),
|
|
4448
|
-
(o, a) => String(
|
|
4449
|
-
).replace(new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})`, "g"), String(
|
|
5303
|
+
(o, a) => String(i).replace(/(?:\[|\{)content(?:\]|\})/g, a)
|
|
5304
|
+
).replace(new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})`, "g"), String(i));
|
|
4450
5305
|
}), e;
|
|
4451
|
-
},
|
|
5306
|
+
}, ke = "global", I = class I {
|
|
4452
5307
|
/**
|
|
4453
5308
|
* Getting the translation text by its code.
|
|
4454
5309
|
*
|
|
@@ -4458,8 +5313,8 @@ const he = [
|
|
|
4458
5313
|
*/
|
|
4459
5314
|
static async get(t, e) {
|
|
4460
5315
|
var r;
|
|
4461
|
-
const
|
|
4462
|
-
return
|
|
5316
|
+
const i = this.getText(t);
|
|
5317
|
+
return i ? this.replacement(i, e) : (K.isLocalhost() || await this.add(t), this.replacement((r = this.getText(t)) != null ? r : t));
|
|
4463
5318
|
}
|
|
4464
5319
|
/**
|
|
4465
5320
|
* Getting the translation text by its code (Sync).
|
|
@@ -4471,9 +5326,9 @@ const he = [
|
|
|
4471
5326
|
* @param replacement If set, replaces the text with the specified values/
|
|
4472
5327
|
* если установлено, заменяет текст на указанные значения
|
|
4473
5328
|
*/
|
|
4474
|
-
static getSync(t, e = !1,
|
|
5329
|
+
static getSync(t, e = !1, i) {
|
|
4475
5330
|
const r = this.getText(t);
|
|
4476
|
-
return r ? this.replacement(r,
|
|
5331
|
+
return r ? this.replacement(r, i) : e ? " " : t;
|
|
4477
5332
|
}
|
|
4478
5333
|
/**
|
|
4479
5334
|
* Getting a list of translations by an array of text codes.
|
|
@@ -4483,12 +5338,12 @@ const he = [
|
|
|
4483
5338
|
*/
|
|
4484
5339
|
static getList(t) {
|
|
4485
5340
|
return new Promise((e) => {
|
|
4486
|
-
const
|
|
5341
|
+
const i = {};
|
|
4487
5342
|
let r = 0;
|
|
4488
5343
|
for (const o of t) {
|
|
4489
5344
|
const a = Array.isArray(o) ? o[0] : o, u = Array.isArray(o) ? o.slice(1) : void 0;
|
|
4490
5345
|
this.get(a, u).then((h) => {
|
|
4491
|
-
|
|
5346
|
+
i[a] = h, ++r >= t.length && e(i);
|
|
4492
5347
|
});
|
|
4493
5348
|
}
|
|
4494
5349
|
});
|
|
@@ -4502,12 +5357,12 @@ const he = [
|
|
|
4502
5357
|
* если установлено false, возвращает пустую строку, если нет текста
|
|
4503
5358
|
*/
|
|
4504
5359
|
static getListSync(t, e = !1) {
|
|
4505
|
-
const
|
|
5360
|
+
const i = {};
|
|
4506
5361
|
for (const r of t) {
|
|
4507
5362
|
const o = Array.isArray(r) ? r[0] : r, a = Array.isArray(r) ? r.slice(1) : void 0;
|
|
4508
|
-
|
|
5363
|
+
i[o] = this.getSync(o, e, a);
|
|
4509
5364
|
}
|
|
4510
|
-
return
|
|
5365
|
+
return i;
|
|
4511
5366
|
}
|
|
4512
5367
|
/**
|
|
4513
5368
|
* Added a list of translated texts.
|
|
@@ -4531,8 +5386,8 @@ const he = [
|
|
|
4531
5386
|
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4532
5387
|
*/
|
|
4533
5388
|
static addSync(t) {
|
|
4534
|
-
d(t, (e,
|
|
4535
|
-
|
|
5389
|
+
d(t, (e, i) => {
|
|
5390
|
+
j(e) && y(e) && (this.data[this.getName(i)] = e);
|
|
4536
5391
|
});
|
|
4537
5392
|
}
|
|
4538
5393
|
/**
|
|
@@ -4542,8 +5397,8 @@ const he = [
|
|
|
4542
5397
|
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4543
5398
|
*/
|
|
4544
5399
|
static async addNormalOrSync(t) {
|
|
4545
|
-
if (
|
|
4546
|
-
if (
|
|
5400
|
+
if (y(t))
|
|
5401
|
+
if (K.isLocalhost())
|
|
4547
5402
|
this.addSync(t);
|
|
4548
5403
|
else {
|
|
4549
5404
|
const e = Object.keys(t);
|
|
@@ -4559,8 +5414,8 @@ const he = [
|
|
|
4559
5414
|
static addSyncByLocation(t) {
|
|
4560
5415
|
d(
|
|
4561
5416
|
t,
|
|
4562
|
-
(e,
|
|
4563
|
-
const a = `${
|
|
5417
|
+
(e, i) => d(e, (r, o) => {
|
|
5418
|
+
const a = `${i}-${o}`;
|
|
4564
5419
|
a in this.data || (this.data[a] = r);
|
|
4565
5420
|
})
|
|
4566
5421
|
);
|
|
@@ -4572,7 +5427,7 @@ const he = [
|
|
|
4572
5427
|
* @param url path to the script/ путь к скрипту
|
|
4573
5428
|
*/
|
|
4574
5429
|
static setUrl(t) {
|
|
4575
|
-
return this.url = t,
|
|
5430
|
+
return this.url = t, I;
|
|
4576
5431
|
}
|
|
4577
5432
|
static setPropsName(t) {
|
|
4578
5433
|
return this.propsName = t, this;
|
|
@@ -4596,9 +5451,9 @@ const he = [
|
|
|
4596
5451
|
const e = this.getName(t);
|
|
4597
5452
|
if (e in this.data)
|
|
4598
5453
|
return this.data[e];
|
|
4599
|
-
const
|
|
4600
|
-
if (
|
|
4601
|
-
return this.data[
|
|
5454
|
+
const i = this.getNameByLanguage(t);
|
|
5455
|
+
if (i in this.data)
|
|
5456
|
+
return this.data[i];
|
|
4602
5457
|
const r = this.getNameByGlobal(t);
|
|
4603
5458
|
if (r in this.data)
|
|
4604
5459
|
return this.data[r];
|
|
@@ -4610,7 +5465,7 @@ const he = [
|
|
|
4610
5465
|
* @param name code name/ название кода
|
|
4611
5466
|
*/
|
|
4612
5467
|
static getName(t) {
|
|
4613
|
-
return `${
|
|
5468
|
+
return `${b.getLocation()}-${t}`;
|
|
4614
5469
|
}
|
|
4615
5470
|
/**
|
|
4616
5471
|
* Getting the title for translation by language.
|
|
@@ -4619,7 +5474,7 @@ const he = [
|
|
|
4619
5474
|
* @param name code name/ название кода
|
|
4620
5475
|
*/
|
|
4621
5476
|
static getNameByLanguage(t) {
|
|
4622
|
-
return `${
|
|
5477
|
+
return `${b.getLanguage()}-${t}`;
|
|
4623
5478
|
}
|
|
4624
5479
|
/**
|
|
4625
5480
|
* Getting the title for translation globally.
|
|
@@ -4628,7 +5483,7 @@ const he = [
|
|
|
4628
5483
|
* @param name code name/ название кода
|
|
4629
5484
|
*/
|
|
4630
5485
|
static getNameByGlobal(t) {
|
|
4631
|
-
return `${
|
|
5486
|
+
return `${ke}-${t}`;
|
|
4632
5487
|
}
|
|
4633
5488
|
/**
|
|
4634
5489
|
* Returns a list of names that are not yet in the list.
|
|
@@ -4638,8 +5493,8 @@ const he = [
|
|
|
4638
5493
|
*/
|
|
4639
5494
|
static getNamesNone(t) {
|
|
4640
5495
|
const e = [];
|
|
4641
|
-
return
|
|
4642
|
-
|
|
5496
|
+
return Y(t).forEach((i) => {
|
|
5497
|
+
i !== "__TRANSLATE_START__" && i !== "__TRANSLATE_END__" && !(this.getName(i) in this.data) && e.push(i);
|
|
4643
5498
|
}), e;
|
|
4644
5499
|
}
|
|
4645
5500
|
/**
|
|
@@ -4648,7 +5503,7 @@ const he = [
|
|
|
4648
5503
|
* Получение списка переводов с сервера.
|
|
4649
5504
|
*/
|
|
4650
5505
|
static async getResponse() {
|
|
4651
|
-
const t = await
|
|
5506
|
+
const t = await K.get({
|
|
4652
5507
|
api: !1,
|
|
4653
5508
|
path: this.url,
|
|
4654
5509
|
request: {
|
|
@@ -4667,7 +5522,7 @@ const he = [
|
|
|
4667
5522
|
* @param replacement values for replacement/ значения для замены
|
|
4668
5523
|
*/
|
|
4669
5524
|
static replacement(t, e) {
|
|
4670
|
-
return e ?
|
|
5525
|
+
return e ? De(t, e) : t;
|
|
4671
5526
|
}
|
|
4672
5527
|
/**
|
|
4673
5528
|
* Adding translation data from the server.
|
|
@@ -4677,504 +5532,476 @@ const he = [
|
|
|
4677
5532
|
static async make() {
|
|
4678
5533
|
const t = await this.getResponse();
|
|
4679
5534
|
this.cache.forEach((e) => {
|
|
4680
|
-
var
|
|
4681
|
-
this.data[this.getName(e)] = (
|
|
5535
|
+
var i;
|
|
5536
|
+
this.data[this.getName(e)] = (i = t == null ? void 0 : t[e]) != null ? i : "";
|
|
4682
5537
|
}), this.cache = [];
|
|
4683
5538
|
}
|
|
4684
5539
|
};
|
|
4685
|
-
c(
|
|
4686
|
-
let
|
|
4687
|
-
function
|
|
4688
|
-
|
|
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 : "";
|
|
4690
|
-
}
|
|
4691
|
-
function fe(i, t) {
|
|
4692
|
-
return Array(t).fill(i);
|
|
5540
|
+
c(I, "url", "/api/translate"), c(I, "propsName", "list"), c(I, "data", {}), c(I, "cache", []), c(I, "resolveList", []), c(I, "timeout");
|
|
5541
|
+
let Bt = I;
|
|
5542
|
+
function Ne(s, t) {
|
|
5543
|
+
return Array(t).fill(s);
|
|
4693
5544
|
}
|
|
4694
|
-
function
|
|
5545
|
+
function Ye(s) {
|
|
4695
5546
|
return new Promise((t, e) => {
|
|
4696
|
-
const
|
|
4697
|
-
|
|
5547
|
+
const i = new FileReader();
|
|
5548
|
+
i.onloadend = () => t(i.result), i.onerror = e, i.readAsDataURL(s);
|
|
4698
5549
|
});
|
|
4699
5550
|
}
|
|
4700
|
-
function
|
|
5551
|
+
function qe(s) {
|
|
4701
5552
|
var t;
|
|
4702
5553
|
if (l())
|
|
4703
|
-
return (t = document.querySelector(
|
|
5554
|
+
return (t = document.querySelector(s)) != null ? t : void 0;
|
|
4704
5555
|
}
|
|
4705
|
-
function
|
|
5556
|
+
function Je(s) {
|
|
4706
5557
|
if (l())
|
|
4707
|
-
return document.querySelectorAll(
|
|
5558
|
+
return document.querySelectorAll(s);
|
|
4708
5559
|
}
|
|
4709
|
-
function
|
|
4710
|
-
|
|
5560
|
+
function Me(s) {
|
|
5561
|
+
s.preventDefault(), s.stopPropagation();
|
|
4711
5562
|
}
|
|
4712
|
-
function
|
|
4713
|
-
i
|
|
4714
|
-
|
|
4715
|
-
function me(i, t, e) {
|
|
4716
|
-
const s = () => {
|
|
4717
|
-
i(), t != null && t() ? me(i, t, e) : e == null || e();
|
|
5563
|
+
function Ee(s, t, e) {
|
|
5564
|
+
const i = () => {
|
|
5565
|
+
s(), t != null && t() ? Ee(s, t, e) : e == null || e();
|
|
4718
5566
|
};
|
|
4719
|
-
l() ? requestAnimationFrame(
|
|
5567
|
+
l() ? requestAnimationFrame(i) : i();
|
|
4720
5568
|
}
|
|
4721
|
-
function
|
|
4722
|
-
var
|
|
4723
|
-
const t = {}, e =
|
|
5569
|
+
function Qe(s) {
|
|
5570
|
+
var i;
|
|
5571
|
+
const t = {}, e = E(s);
|
|
4724
5572
|
if (e)
|
|
4725
5573
|
for (const r of e.attributes)
|
|
4726
|
-
t[r.name] = (
|
|
5574
|
+
t[r.name] = (i = (r == null ? void 0 : r.value) || (r == null ? void 0 : r.textContent)) != null ? i : void 0;
|
|
4727
5575
|
return t;
|
|
4728
5576
|
}
|
|
4729
|
-
async function
|
|
5577
|
+
async function Xe(s) {
|
|
4730
5578
|
var t, e;
|
|
4731
|
-
return (e = (t =
|
|
5579
|
+
return (e = (t = s == null ? void 0 : s.clipboardData) == null ? void 0 : t.getData("text")) != null ? e : await navigator.clipboard.readText() || "";
|
|
4732
5580
|
}
|
|
4733
|
-
function
|
|
4734
|
-
return new
|
|
5581
|
+
function _e(s = "datetime") {
|
|
5582
|
+
return new gt(void 0, s).standard();
|
|
4735
5583
|
}
|
|
4736
|
-
let
|
|
4737
|
-
function
|
|
4738
|
-
const e =
|
|
4739
|
-
return e ? (
|
|
5584
|
+
let Ft = Q(1e5, 9e5);
|
|
5585
|
+
function Oe(s, t) {
|
|
5586
|
+
const e = E(s);
|
|
5587
|
+
return e ? (y(e.id) || e.setAttribute("id", `id-${Ft++}`), t ? `#${e.id}${t}`.trim() : e.id) : `id-${Ft++}`;
|
|
4740
5588
|
}
|
|
4741
|
-
function
|
|
4742
|
-
return
|
|
5589
|
+
function Ae(s) {
|
|
5590
|
+
return j(s) ? G(
|
|
4743
5591
|
void 0,
|
|
4744
5592
|
"img",
|
|
4745
|
-
{ src:
|
|
4746
|
-
) :
|
|
4747
|
-
}
|
|
4748
|
-
function $e(i, t = "ig", e = ":value") {
|
|
4749
|
-
const s = Pt(i);
|
|
4750
|
-
return new RegExp(e.replace(/:value/g, s), t);
|
|
4751
|
-
}
|
|
4752
|
-
function pe(i, t, e) {
|
|
4753
|
-
const s = de(i);
|
|
4754
|
-
if (!e || e <= 0)
|
|
4755
|
-
return s.split(t);
|
|
4756
|
-
const r = s.split(t, e), o = s.split(t);
|
|
4757
|
-
return r.length === o.length ? r : (r.pop(), [
|
|
4758
|
-
...r,
|
|
4759
|
-
o.slice(e - 1).join(t)
|
|
4760
|
-
]);
|
|
4761
|
-
}
|
|
4762
|
-
function be(i, t) {
|
|
4763
|
-
var r;
|
|
4764
|
-
if (!w(t))
|
|
4765
|
-
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;
|
|
5593
|
+
{ src: s }
|
|
5594
|
+
) : s;
|
|
4768
5595
|
}
|
|
4769
|
-
function
|
|
4770
|
-
var t, e,
|
|
4771
|
-
return (
|
|
5596
|
+
function Te(s) {
|
|
5597
|
+
var t, e, i;
|
|
5598
|
+
return (i = (t = s == null ? void 0 : s.key) != null ? t : s == null ? void 0 : s.code) != null ? i : (e = s == null ? void 0 : s.keyCode) == null ? void 0 : e.toString();
|
|
4772
5599
|
}
|
|
4773
|
-
function
|
|
4774
|
-
return d(
|
|
5600
|
+
function Zt(s) {
|
|
5601
|
+
return d(s, (t) => t.length);
|
|
4775
5602
|
}
|
|
4776
|
-
function
|
|
4777
|
-
return Math.max(...
|
|
5603
|
+
function Ge(s) {
|
|
5604
|
+
return Math.max(...Zt(s));
|
|
4778
5605
|
}
|
|
4779
|
-
function
|
|
4780
|
-
return Math.min(...
|
|
5606
|
+
function ts(s) {
|
|
5607
|
+
return Math.min(...Zt(s));
|
|
4781
5608
|
}
|
|
4782
|
-
function
|
|
4783
|
-
var t, e,
|
|
4784
|
-
return (
|
|
5609
|
+
function Ie(s) {
|
|
5610
|
+
var t, e, i, r;
|
|
5611
|
+
return (s == null ? void 0 : s.clientX) || ((e = (t = s == null ? void 0 : s.targetTouches) == null ? void 0 : t[0]) == null ? void 0 : e.clientX) || ((r = (i = s == null ? void 0 : s.touches) == null ? void 0 : i[0]) == null ? void 0 : r.clientX) || 0;
|
|
4785
5612
|
}
|
|
4786
|
-
function
|
|
4787
|
-
var t, e,
|
|
4788
|
-
return (
|
|
5613
|
+
function Be(s) {
|
|
5614
|
+
var t, e, i, r;
|
|
5615
|
+
return (s == null ? void 0 : s.clientY) || ((e = (t = s == null ? void 0 : s.targetTouches) == null ? void 0 : t[0]) == null ? void 0 : e.clientY) || ((r = (i = s == null ? void 0 : s.touches) == null ? void 0 : i[0]) == null ? void 0 : r.clientY) || 0;
|
|
4789
5616
|
}
|
|
4790
|
-
function
|
|
5617
|
+
function es(s) {
|
|
4791
5618
|
return {
|
|
4792
|
-
x:
|
|
4793
|
-
y:
|
|
5619
|
+
x: Ie(s),
|
|
5620
|
+
y: Be(s)
|
|
4794
5621
|
};
|
|
4795
5622
|
}
|
|
4796
|
-
function
|
|
5623
|
+
function ss(s, t) {
|
|
4797
5624
|
const e = {};
|
|
4798
|
-
return t.forEach((
|
|
4799
|
-
|
|
5625
|
+
return t.forEach((i) => {
|
|
5626
|
+
i in s && s[i] !== void 0 && (e[i] = s[i]);
|
|
4800
5627
|
}), e;
|
|
4801
5628
|
}
|
|
4802
|
-
function
|
|
5629
|
+
function is(s, t = void 0) {
|
|
4803
5630
|
const e = {};
|
|
4804
|
-
return d(
|
|
4805
|
-
|
|
5631
|
+
return d(s, (i, r) => {
|
|
5632
|
+
i !== t && (e[r] = i);
|
|
4806
5633
|
}), e;
|
|
4807
5634
|
}
|
|
4808
|
-
function
|
|
4809
|
-
return A(
|
|
5635
|
+
function rs(s) {
|
|
5636
|
+
return A(s) ? s : {};
|
|
4810
5637
|
}
|
|
4811
|
-
function
|
|
4812
|
-
return
|
|
5638
|
+
function Fe(s, t) {
|
|
5639
|
+
return Ne(s, t).join("");
|
|
4813
5640
|
}
|
|
4814
|
-
function
|
|
4815
|
-
const o =
|
|
5641
|
+
function ns(s, t, e = "#", i = 2, r = 12) {
|
|
5642
|
+
const o = Q(s, t), a = [];
|
|
4816
5643
|
for (let u = 0; u < o; u++)
|
|
4817
|
-
a.push(
|
|
5644
|
+
a.push(Fe(e, Q(i, r)));
|
|
4818
5645
|
return a.join(" ");
|
|
4819
5646
|
}
|
|
4820
|
-
function
|
|
4821
|
-
|
|
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;
|
|
5647
|
+
function os(s, t) {
|
|
5648
|
+
const e = s != null ? s : 0;
|
|
4829
5649
|
return t > e ? 100 / (t - e) : 0;
|
|
4830
5650
|
}
|
|
4831
|
-
function
|
|
4832
|
-
const e =
|
|
5651
|
+
function as(s, t) {
|
|
5652
|
+
const e = s != null ? s : 0;
|
|
4833
5653
|
return t > e ? (t - e) / 100 : 0;
|
|
4834
5654
|
}
|
|
4835
|
-
const
|
|
4836
|
-
function
|
|
4837
|
-
const
|
|
4838
|
-
if (t &&
|
|
4839
|
-
const r =
|
|
5655
|
+
const xt = 0;
|
|
5656
|
+
function cs(s, t, e) {
|
|
5657
|
+
const i = t == null ? void 0 : t.closest(s);
|
|
5658
|
+
if (t && i && i.scrollHeight !== i.offsetHeight) {
|
|
5659
|
+
const r = i.getBoundingClientRect(), o = t.getBoundingClientRect();
|
|
4840
5660
|
if (e) {
|
|
4841
5661
|
const a = e.getBoundingClientRect();
|
|
4842
|
-
|
|
4843
|
-
} else
|
|
5662
|
+
i.scrollTop = t.offsetTop - (a.top - r.top) - (a.height / 2 - o.height / 2), i.scrollTop + i.offsetHeight < t.offsetTop + t.offsetHeight && (i.scrollTop = t.offsetTop + t.offsetHeight - i.offsetHeight);
|
|
5663
|
+
} else i.scrollTop > t.offsetTop ? i.scrollTop = o.top - r.top - xt : i.scrollTop + i.offsetHeight < t.offsetTop + t.offsetHeight && (i.scrollTop = o.top - r.top + o.height - r.height + xt);
|
|
4844
5664
|
}
|
|
4845
5665
|
}
|
|
4846
|
-
function
|
|
5666
|
+
function us(s, t, e = 0) {
|
|
4847
5667
|
if (!l())
|
|
4848
5668
|
return;
|
|
4849
|
-
const
|
|
4850
|
-
if ("scrollIntoView" in
|
|
4851
|
-
|
|
4852
|
-
behavior:
|
|
5669
|
+
const i = (t == null ? void 0 : t.behavior) || "smooth";
|
|
5670
|
+
if ("scrollIntoView" in s && !e) {
|
|
5671
|
+
s.scrollIntoView({
|
|
5672
|
+
behavior: i,
|
|
4853
5673
|
block: (t == null ? void 0 : t.block) || "start",
|
|
4854
5674
|
inline: (t == null ? void 0 : t.inline) || "start"
|
|
4855
5675
|
});
|
|
4856
5676
|
return;
|
|
4857
5677
|
}
|
|
4858
|
-
if ("getBoundingClientRect" in
|
|
4859
|
-
const r = ((window == null ? void 0 : window.scrollY) || window.pageYOffset) +
|
|
5678
|
+
if ("getBoundingClientRect" in s && "scrollTo" in window) {
|
|
5679
|
+
const r = ((window == null ? void 0 : window.scrollY) || window.pageYOffset) + s.getBoundingClientRect().top - e;
|
|
4860
5680
|
window.scrollTo({
|
|
4861
5681
|
top: r,
|
|
4862
|
-
behavior:
|
|
5682
|
+
behavior: i
|
|
4863
5683
|
});
|
|
4864
5684
|
}
|
|
4865
5685
|
}
|
|
4866
|
-
function
|
|
4867
|
-
if (!l() || !
|
|
5686
|
+
function hs(s, t, e = "smooth") {
|
|
5687
|
+
if (!l() || !s || !t)
|
|
4868
5688
|
return;
|
|
4869
|
-
const
|
|
4870
|
-
|
|
4871
|
-
top: r.top -
|
|
4872
|
-
left: r.left -
|
|
5689
|
+
const i = s.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
5690
|
+
s.scrollBy({
|
|
5691
|
+
top: r.top - i.top,
|
|
5692
|
+
left: r.left - i.left,
|
|
4873
5693
|
behavior: e
|
|
4874
5694
|
});
|
|
4875
5695
|
}
|
|
4876
|
-
function
|
|
4877
|
-
return
|
|
5696
|
+
function ls(s, t) {
|
|
5697
|
+
return s.indexOf(t) !== -1;
|
|
4878
5698
|
}
|
|
4879
|
-
async function
|
|
5699
|
+
async function gs() {
|
|
4880
5700
|
if (l()) {
|
|
4881
|
-
const
|
|
4882
|
-
document.body.style.setProperty("--sys-scrollbar-offset", `${
|
|
5701
|
+
const s = await ut.get();
|
|
5702
|
+
document.body.style.setProperty("--sys-scrollbar-offset", `${s}px`);
|
|
4883
5703
|
}
|
|
4884
5704
|
}
|
|
4885
|
-
function
|
|
5705
|
+
function ds(s, t) {
|
|
4886
5706
|
const e = {};
|
|
4887
|
-
return
|
|
4888
|
-
r in t && (e[r] =
|
|
5707
|
+
return m(s) && m(t) && d(s, (i, r) => {
|
|
5708
|
+
r in t && (e[r] = i);
|
|
4889
5709
|
}), e;
|
|
4890
5710
|
}
|
|
4891
|
-
function
|
|
4892
|
-
let e = Object.keys(
|
|
4893
|
-
return e || d(
|
|
4894
|
-
|
|
5711
|
+
function fs(s, t) {
|
|
5712
|
+
let e = Object.keys(s).length !== Object.keys(t).length;
|
|
5713
|
+
return e || d(s, (i, r) => {
|
|
5714
|
+
i !== (t == null ? void 0 : t[r]) && (e = !0);
|
|
4895
5715
|
}), e;
|
|
4896
5716
|
}
|
|
4897
|
-
const
|
|
4898
|
-
if (
|
|
4899
|
-
const t =
|
|
4900
|
-
return !!(t === "input" || t === "textarea" || t === "select" ||
|
|
5717
|
+
const xe = (s) => {
|
|
5718
|
+
if (s instanceof HTMLElement) {
|
|
5719
|
+
const t = s.tagName.toLowerCase();
|
|
5720
|
+
return !!(t === "input" || t === "textarea" || t === "select" || s.isContentEditable || s.getAttribute("contenteditable") === "true");
|
|
4901
5721
|
}
|
|
4902
5722
|
return !1;
|
|
4903
|
-
},
|
|
4904
|
-
function
|
|
4905
|
-
switch (typeof
|
|
5723
|
+
}, ms = (s, t) => s.code === "Space" || s.code === "Enter" || s.key === " " || s.key === "Spacebar" || s.key === "Enter" || s.keyCode === 13 || s.keyCode === 32 ? t !== void 0 ? !t : !xe(s.target) : !1;
|
|
5724
|
+
function ys(s) {
|
|
5725
|
+
switch (typeof s) {
|
|
4906
5726
|
case "number":
|
|
4907
5727
|
return !0;
|
|
4908
5728
|
case "string":
|
|
4909
|
-
return !!
|
|
5729
|
+
return !!s.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
|
|
4910
5730
|
default:
|
|
4911
5731
|
return !1;
|
|
4912
5732
|
}
|
|
4913
5733
|
}
|
|
4914
|
-
function
|
|
5734
|
+
function $s(s, t) {
|
|
4915
5735
|
const e = Math.floor(t);
|
|
4916
|
-
return
|
|
5736
|
+
return s >= e && s < e + 1;
|
|
4917
5737
|
}
|
|
4918
|
-
function
|
|
4919
|
-
return Array.isArray(
|
|
5738
|
+
function ps(s, t) {
|
|
5739
|
+
return Array.isArray(s) ? s.every((e) => at(e, t)) : at(s, t);
|
|
4920
5740
|
}
|
|
4921
|
-
function
|
|
4922
|
-
if (
|
|
4923
|
-
return
|
|
5741
|
+
function bs(s, t) {
|
|
5742
|
+
if (s.startsWith(t))
|
|
5743
|
+
return s.slice(t.length).trim();
|
|
4924
5744
|
let e = 0;
|
|
4925
|
-
for (;
|
|
5745
|
+
for (; s[e] === t[e] && e < s.length && e < t.length; )
|
|
4926
5746
|
e++;
|
|
4927
|
-
return
|
|
5747
|
+
return s.slice(e).trim();
|
|
4928
5748
|
}
|
|
4929
|
-
const
|
|
4930
|
-
var
|
|
4931
|
-
return (r = (
|
|
5749
|
+
const ws = (s, t, e) => {
|
|
5750
|
+
var i, r;
|
|
5751
|
+
return (r = (i = s == null ? void 0 : s.replace(new RegExp(`<${t}`, "ig"), `<${e}`)) == null ? void 0 : i.replace(new RegExp(`</${t}`, "ig"), `</${e}`)) == null ? void 0 : r.trim();
|
|
4932
5752
|
};
|
|
4933
|
-
function
|
|
4934
|
-
return [...new Set(
|
|
5753
|
+
function Re(s) {
|
|
5754
|
+
return [...new Set(s)];
|
|
4935
5755
|
}
|
|
4936
|
-
function
|
|
4937
|
-
const
|
|
4938
|
-
return
|
|
5756
|
+
function J(s, t, e = !0) {
|
|
5757
|
+
const i = V(s);
|
|
5758
|
+
return m(s) && m(t) && d(
|
|
4939
5759
|
t,
|
|
4940
5760
|
(r, o) => {
|
|
4941
|
-
const a =
|
|
4942
|
-
|
|
5761
|
+
const a = s == null ? void 0 : s[o];
|
|
5762
|
+
m(a) && m(r) ? e && Array.isArray(a) && Array.isArray(r) ? i[o] = V(Re([...a, ...r])) : i[o] = J(
|
|
4943
5763
|
Array.isArray(a) ? { ...a } : a,
|
|
4944
5764
|
r,
|
|
4945
5765
|
e
|
|
4946
|
-
) :
|
|
5766
|
+
) : i[o] = m(r) ? V(r) : r;
|
|
4947
5767
|
}
|
|
4948
|
-
),
|
|
5768
|
+
), i;
|
|
4949
5769
|
}
|
|
4950
|
-
function
|
|
4951
|
-
let e =
|
|
4952
|
-
return d(t, (
|
|
4953
|
-
e = e.replace(
|
|
5770
|
+
function vs(s, t) {
|
|
5771
|
+
let e = s;
|
|
5772
|
+
return d(t, (i, r) => {
|
|
5773
|
+
e = e.replace(zt(`[${r}]`), B(i));
|
|
4954
5774
|
}), e;
|
|
4955
5775
|
}
|
|
4956
|
-
function
|
|
5776
|
+
function Pe(s, t = "auto") {
|
|
4957
5777
|
switch (t) {
|
|
4958
5778
|
case "auto":
|
|
4959
|
-
return
|
|
5779
|
+
return s.naturalWidth >= s.naturalHeight;
|
|
4960
5780
|
case "width":
|
|
4961
5781
|
return !0;
|
|
4962
5782
|
case "height":
|
|
4963
5783
|
return !1;
|
|
4964
5784
|
}
|
|
4965
5785
|
}
|
|
4966
|
-
function
|
|
5786
|
+
function Ss(s, t, e = "auto", i) {
|
|
4967
5787
|
var o;
|
|
4968
|
-
const r =
|
|
5788
|
+
const r = Ae(s);
|
|
4969
5789
|
if (r && (r.naturalWidth > t && (e === "auto" || e === "width") || r.naturalHeight > t && (e === "auto" || e === "height"))) {
|
|
4970
|
-
const a =
|
|
5790
|
+
const a = Pe(r, e), u = (o = document.createElement("canvas")) == null ? void 0 : o.getContext("2d");
|
|
4971
5791
|
if (u)
|
|
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(
|
|
5792
|
+
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(i);
|
|
4973
5793
|
}
|
|
4974
5794
|
}
|
|
4975
|
-
function
|
|
4976
|
-
const t = k(
|
|
5795
|
+
function Ls(s) {
|
|
5796
|
+
const t = k(s);
|
|
4977
5797
|
if (t > 0) {
|
|
4978
|
-
const e = String(Math.floor(t / 60)).padStart(2, "0"),
|
|
4979
|
-
return `${e}:${
|
|
5798
|
+
const e = String(Math.floor(t / 60)).padStart(2, "0"), i = String(t % 60).padStart(2, "0");
|
|
5799
|
+
return `${e}:${i}`;
|
|
4980
5800
|
}
|
|
4981
5801
|
return "00:00";
|
|
4982
5802
|
}
|
|
4983
|
-
function
|
|
5803
|
+
function Cs(s, t, {
|
|
4984
5804
|
multiple: e = !1,
|
|
4985
|
-
maxlength:
|
|
5805
|
+
maxlength: i = 0,
|
|
4986
5806
|
alwaysChange: r = !0,
|
|
4987
5807
|
notEmpty: o = !1
|
|
4988
5808
|
}) {
|
|
4989
5809
|
if (e) {
|
|
4990
|
-
if (
|
|
4991
|
-
const a =
|
|
4992
|
-
return a !== -1 ? (!o || u.length > 1) && u.splice(a, 1) : (!
|
|
5810
|
+
if (ht(s)) {
|
|
5811
|
+
const a = s.indexOf(t), u = [...s];
|
|
5812
|
+
return a !== -1 ? (!o || u.length > 1) && u.splice(a, 1) : (!i || s.length < i) && u.push(t), u;
|
|
4993
5813
|
}
|
|
4994
|
-
return
|
|
5814
|
+
return s === t ? [] : s ? [s, t] : [t];
|
|
4995
5815
|
}
|
|
4996
|
-
return r ||
|
|
5816
|
+
return r || s !== t ? t : s;
|
|
4997
5817
|
}
|
|
4998
|
-
function
|
|
4999
|
-
if (
|
|
5818
|
+
function Ds(s, t, e) {
|
|
5819
|
+
if (m(s) && m(t)) {
|
|
5000
5820
|
if (e) {
|
|
5001
|
-
let
|
|
5002
|
-
return d(
|
|
5003
|
-
!r && (e === a || e === o) ? (r = !0,
|
|
5004
|
-
}), r ?
|
|
5821
|
+
let i = {}, r = !1;
|
|
5822
|
+
return d(s, (o, a) => {
|
|
5823
|
+
!r && (e === a || e === o) ? (r = !0, i = J(i, t)) : r ? i = J(i, { [a]: o }) : i[a] = m(o) ? V(o) : o;
|
|
5824
|
+
}), r ? i : J(s, t);
|
|
5005
5825
|
}
|
|
5006
|
-
if (
|
|
5007
|
-
return
|
|
5826
|
+
if (m(t))
|
|
5827
|
+
return J(s, t);
|
|
5008
5828
|
}
|
|
5009
|
-
return
|
|
5010
|
-
}
|
|
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()}`);
|
|
5829
|
+
return V(s);
|
|
5013
5830
|
}
|
|
5014
|
-
function
|
|
5015
|
-
return
|
|
5831
|
+
function ks(s) {
|
|
5832
|
+
return Ht(s).replace(/^([a-z])/, (t) => `${t.toUpperCase()}`);
|
|
5016
5833
|
}
|
|
5017
|
-
function
|
|
5018
|
-
return
|
|
5834
|
+
function Ns(s) {
|
|
5835
|
+
return s.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());
|
|
5019
5836
|
}
|
|
5020
|
-
function
|
|
5021
|
-
const r = k(
|
|
5022
|
-
return t && o < r ? `${
|
|
5837
|
+
function Es(s, t, e, i) {
|
|
5838
|
+
const r = k(s), o = k(t);
|
|
5839
|
+
return t && o < r ? `${Rt(o, e, i)}+` : Rt(r, e, i);
|
|
5023
5840
|
}
|
|
5024
|
-
const
|
|
5025
|
-
function
|
|
5026
|
-
return 1 /
|
|
5841
|
+
const Rt = (s, t, e) => t ? new N(e).number(s) : s;
|
|
5842
|
+
function We(s, t) {
|
|
5843
|
+
return 1 / s * t;
|
|
5027
5844
|
}
|
|
5028
|
-
function
|
|
5029
|
-
return
|
|
5845
|
+
function As(s, t) {
|
|
5846
|
+
return We(s, t) * 100;
|
|
5030
5847
|
}
|
|
5031
|
-
function
|
|
5848
|
+
function Is(s) {
|
|
5032
5849
|
let t = "";
|
|
5033
|
-
for (const e of
|
|
5850
|
+
for (const e of s)
|
|
5034
5851
|
t += String.fromCharCode(e);
|
|
5035
|
-
return l() ? window.btoa(t) : globalThis && globalThis.Buffer ? globalThis == null ? void 0 : globalThis.Buffer.from(
|
|
5852
|
+
return l() ? window.btoa(t) : globalThis && globalThis.Buffer ? globalThis == null ? void 0 : globalThis.Buffer.from(s).toString("base64") : "";
|
|
5036
5853
|
}
|
|
5037
|
-
async function
|
|
5854
|
+
async function Bs(s) {
|
|
5038
5855
|
if (l())
|
|
5039
5856
|
try {
|
|
5040
|
-
await navigator.clipboard.writeText(
|
|
5857
|
+
await navigator.clipboard.writeText(s);
|
|
5041
5858
|
} catch (t) {
|
|
5042
|
-
document == null || document.execCommand(
|
|
5859
|
+
document == null || document.execCommand(s);
|
|
5043
5860
|
}
|
|
5044
5861
|
}
|
|
5045
5862
|
export {
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5863
|
+
K as Api,
|
|
5864
|
+
Qt as ApiDefault,
|
|
5865
|
+
Mt as ApiHeaders,
|
|
5866
|
+
C as ApiMethodItem,
|
|
5867
|
+
Ot as ApiPreparation,
|
|
5868
|
+
_t as ApiResponse,
|
|
5869
|
+
vt as ApiStatus,
|
|
5870
|
+
He as BroadcastMessage,
|
|
5871
|
+
te as Cache,
|
|
5872
|
+
Gt as CacheItem,
|
|
5873
|
+
Lt as CacheStatic,
|
|
5874
|
+
Ct as Cookie,
|
|
5875
|
+
Ut as CookieBlock,
|
|
5876
|
+
et as DataStorage,
|
|
5877
|
+
gt as Datetime,
|
|
5878
|
+
bt as EventItem,
|
|
5879
|
+
ze as Formatters,
|
|
5880
|
+
F as FormattersType,
|
|
5062
5881
|
n as GEO_FLAG_ICON_NAME,
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5882
|
+
b as Geo,
|
|
5883
|
+
Dt as GeoFlag,
|
|
5884
|
+
N as GeoIntl,
|
|
5885
|
+
kt as GeoPhone,
|
|
5886
|
+
Ze as Global,
|
|
5887
|
+
Nt as Hash,
|
|
5888
|
+
It as Icons,
|
|
5889
|
+
R as Loading,
|
|
5890
|
+
Ve as Meta,
|
|
5891
|
+
dt as MetaManager,
|
|
5892
|
+
fe as MetaOg,
|
|
5893
|
+
le as MetaOpenGraphAge,
|
|
5894
|
+
ue as MetaOpenGraphAvailability,
|
|
5895
|
+
he as MetaOpenGraphCondition,
|
|
5896
|
+
ge as MetaOpenGraphGender,
|
|
5897
|
+
$ as MetaOpenGraphTag,
|
|
5898
|
+
ce as MetaOpenGraphType,
|
|
5899
|
+
ae as MetaRobots,
|
|
5900
|
+
L as MetaTag,
|
|
5901
|
+
me as MetaTwitter,
|
|
5902
|
+
de as MetaTwitterCard,
|
|
5903
|
+
p as MetaTwitterTag,
|
|
5904
|
+
ut as ScrollbarWidth,
|
|
5905
|
+
Ke as SearchList,
|
|
5906
|
+
pe as SearchListData,
|
|
5907
|
+
be as SearchListItem,
|
|
5908
|
+
Se as SearchListMatcher,
|
|
5909
|
+
Le as SearchListOptions,
|
|
5910
|
+
ke as TRANSLATE_GLOBAL_PREFIX,
|
|
5911
|
+
Bt as Translate,
|
|
5912
|
+
$e as addTagHighlightMatch,
|
|
5913
|
+
T as anyToString,
|
|
5914
|
+
De as applyTemplate,
|
|
5915
|
+
Ne as arrFill,
|
|
5916
|
+
Ye as blobToBase64,
|
|
5917
|
+
V as copyObject,
|
|
5918
|
+
D as copyObjectLite,
|
|
5919
|
+
G as createElement,
|
|
5920
|
+
qe as domQuerySelector,
|
|
5921
|
+
Je as domQuerySelectorAll,
|
|
5922
|
+
oe as encodeAttribute,
|
|
5923
|
+
ft as escapeExp,
|
|
5924
|
+
Me as eventStopPropagation,
|
|
5100
5925
|
B as executeFunction,
|
|
5101
|
-
|
|
5926
|
+
Xt as executePromise,
|
|
5102
5927
|
d as forEach,
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5928
|
+
Ee as frame,
|
|
5929
|
+
Qe as getAttributes,
|
|
5930
|
+
Xe as getClipboardData,
|
|
5931
|
+
se as getColumn,
|
|
5932
|
+
_e as getCurrentDate,
|
|
5933
|
+
E as getElement,
|
|
5934
|
+
Oe as getElementId,
|
|
5935
|
+
Ae as getElementImage,
|
|
5936
|
+
re as getElementItem,
|
|
5937
|
+
pt as getElementOrWindow,
|
|
5938
|
+
we as getExactSearchExp,
|
|
5939
|
+
zt as getExp,
|
|
5940
|
+
x as getItemByPath,
|
|
5941
|
+
Te as getKey,
|
|
5942
|
+
Zt as getLengthOfAllArray,
|
|
5943
|
+
Ge as getMaxLengthAllArray,
|
|
5944
|
+
ts as getMinLengthAllArray,
|
|
5945
|
+
es as getMouseClient,
|
|
5946
|
+
Ie as getMouseClientX,
|
|
5947
|
+
Be as getMouseClientY,
|
|
5948
|
+
ss as getObjectByKeys,
|
|
5949
|
+
is as getObjectNoUndefined,
|
|
5950
|
+
rs as getObjectOrNone,
|
|
5951
|
+
ns as getRandomText,
|
|
5952
|
+
Pt as getRequestString,
|
|
5953
|
+
ve as getSearchExp,
|
|
5954
|
+
ye as getSeparatingSearchExp,
|
|
5955
|
+
os as getStepPercent,
|
|
5956
|
+
as as getStepValue,
|
|
5957
|
+
cs as goScroll,
|
|
5958
|
+
us as goScrollSmooth,
|
|
5959
|
+
hs as goScrollTo,
|
|
5960
|
+
ls as inArray,
|
|
5961
|
+
gs as initScrollbarOffset,
|
|
5962
|
+
ds as intersectKey,
|
|
5963
|
+
ht as isArray,
|
|
5964
|
+
fs as isDifferent,
|
|
5965
|
+
ct as isDomData,
|
|
5139
5966
|
l as isDomRuntime,
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5967
|
+
ms as isEnter,
|
|
5968
|
+
y as isFilled,
|
|
5969
|
+
ys as isFloat,
|
|
5970
|
+
lt as isFunction,
|
|
5971
|
+
Jt as isInDom,
|
|
5972
|
+
xe as isInput,
|
|
5973
|
+
$s as isIntegerBetween,
|
|
5974
|
+
X as isNull,
|
|
5975
|
+
yt as isNumber,
|
|
5976
|
+
m as isObject,
|
|
5150
5977
|
A as isObjectNotArray,
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5978
|
+
at as isSelected,
|
|
5979
|
+
ps as isSelectedByList,
|
|
5980
|
+
j as isString,
|
|
5981
|
+
Wt as isWindow,
|
|
5982
|
+
Q as random,
|
|
5983
|
+
bs as removeCommonPrefix,
|
|
5984
|
+
ws as replaceComponentName,
|
|
5985
|
+
J as replaceRecursive,
|
|
5986
|
+
vs as replaceTemplate,
|
|
5987
|
+
Ss as resizeImageByMax,
|
|
5988
|
+
Ls as secondToTime,
|
|
5989
|
+
ne as setElementItem,
|
|
5990
|
+
Cs as setValues,
|
|
5991
|
+
Ds as splice,
|
|
5992
|
+
Fe as strFill,
|
|
5993
|
+
ie as strSplit,
|
|
5994
|
+
Y as toArray,
|
|
5995
|
+
Ht as toCamelCase,
|
|
5996
|
+
ks as toCamelCaseFirst,
|
|
5997
|
+
P as toDate,
|
|
5998
|
+
Ns as toKebabCase,
|
|
5172
5999
|
k as toNumber,
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
6000
|
+
Es as toNumberByMax,
|
|
6001
|
+
We as toPercent,
|
|
6002
|
+
As as toPercentBy100,
|
|
6003
|
+
jt as transformation,
|
|
6004
|
+
Is as uint8ArrayToBase64,
|
|
6005
|
+
Re as uniqueArray,
|
|
6006
|
+
Bs as writeClipboardData
|
|
5180
6007
|
};
|