@dxtmisha/functional-basic 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/library.d.ts +764 -2
- package/dist/library.js +1728 -909
- 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 f(
|
|
9
|
-
return !!(
|
|
8
|
+
function f(s) {
|
|
9
|
+
return !!(s && typeof s == "object");
|
|
10
10
|
}
|
|
11
|
-
function d(
|
|
12
|
-
if (f(
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
([r,
|
|
16
|
-
), e ?
|
|
11
|
+
function d(s, t, e) {
|
|
12
|
+
if (f(s)) {
|
|
13
|
+
const i = [];
|
|
14
|
+
return s instanceof Map ? s.forEach((r, a) => i.push(t(r, a, s))) : Array.isArray(s) ? s.forEach((r, a) => i.push(t(r, a, s))) : Object.entries(s).forEach(
|
|
15
|
+
([r, a]) => i.push(t(a, 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 m(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 f(
|
|
57
|
+
function A(s) {
|
|
58
|
+
return f(s) && !Array.isArray(s);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return typeof
|
|
60
|
+
function U(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 ot(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) => ot(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 : U(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, a) {
|
|
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), f(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 = a, 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 m(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((
|
|
1032
|
+
get(t = "", e, i, r) {
|
|
1033
|
+
return this.response.find((a) => !this.isDisable(a) && this.isPath(a, t) && e === a.method && this.isFirst(a, r) && this.isResponse(a, i) ? (this.isDevMode(r) && console.warn(`Response type: ${a.path}`), this.first.push(a), !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,15 +1065,15 @@ class qt {
|
|
|
1038
1065
|
async emulator(t) {
|
|
1039
1066
|
const {
|
|
1040
1067
|
path: e = "",
|
|
1041
|
-
method:
|
|
1042
|
-
global: r =
|
|
1043
|
-
devMode:
|
|
1068
|
+
method: i = C.get,
|
|
1069
|
+
global: r = i === C.get,
|
|
1070
|
+
devMode: a = !1
|
|
1044
1071
|
} = t;
|
|
1045
|
-
if (r || this.isDevMode(
|
|
1046
|
-
const
|
|
1072
|
+
if (r || this.isDevMode(a)) {
|
|
1073
|
+
const o = this.requestDefault.request(t.request), u = this.get(e, i, o, a);
|
|
1047
1074
|
if (u) {
|
|
1048
|
-
const h = await this.fetch(u,
|
|
1049
|
-
return this.isDevMode(
|
|
1075
|
+
const h = await this.fetch(u, o);
|
|
1076
|
+
return this.isDevMode(a) && console.warn("Response data:", e, o, h), h;
|
|
1050
1077
|
}
|
|
1051
1078
|
}
|
|
1052
1079
|
}
|
|
@@ -1096,9 +1123,9 @@ class qt {
|
|
|
1096
1123
|
* @param request request data/ данные запроса
|
|
1097
1124
|
*/
|
|
1098
1125
|
isResponse(t, e) {
|
|
1099
|
-
const
|
|
1100
|
-
return e ===
|
|
1101
|
-
(r, [
|
|
1126
|
+
const i = this.requestDefault.request(t == null ? void 0 : t.request);
|
|
1127
|
+
return e === i || i === "*any" || m(e) && m(i) && A(e) && A(i) && !(e instanceof FormData) && !(i instanceof FormData) && Object.values(e).length === Object.values(i).length && Object.entries(i).reduce(
|
|
1128
|
+
(r, [a, o]) => r && (o === (e == null ? void 0 : e[a]) || o === "*any"),
|
|
1102
1129
|
!0
|
|
1103
1130
|
);
|
|
1104
1131
|
}
|
|
@@ -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 && m(t))
|
|
1290
|
+
return U(t) ? t : JSON.stringify(t);
|
|
1264
1291
|
}
|
|
1265
1292
|
/**
|
|
1266
1293
|
* Getting data for the body of the get method.
|
|
@@ -1270,11 +1297,11 @@ 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(/\?/) ? "&" : "?",
|
|
1276
|
-
if (
|
|
1277
|
-
return `${r}${
|
|
1300
|
+
static getBodyForGet(t, e = "", i = C.get) {
|
|
1301
|
+
if (i === C.get) {
|
|
1302
|
+
const r = e.match(/\?/) ? "&" : "?", a = typeof t == "object" ? Pt(t) : t;
|
|
1303
|
+
if (m(a))
|
|
1304
|
+
return `${r}${a}`;
|
|
1278
1305
|
}
|
|
1279
1306
|
return "";
|
|
1280
1307
|
}
|
|
@@ -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 U(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
|
-
globalPreparation:
|
|
1391
|
-
globalEnd:
|
|
1417
|
+
globalPreparation: a = !0,
|
|
1418
|
+
globalEnd: o = !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 y;
|
|
1424
|
+
R.show();
|
|
1398
1425
|
try {
|
|
1399
|
-
await this.preparation.make(
|
|
1400
|
-
const g = await this.makeQuery(t), S = await this.preparation.makeEnd(
|
|
1426
|
+
await this.preparation.make(a, t);
|
|
1427
|
+
const g = await this.makeQuery(t), S = await this.preparation.makeEnd(o, 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
|
+
y = 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(y), this.status.setLastResponse(y), this.makeStatus(
|
|
1439
|
+
this.makeData(y, 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
|
-
pathFull:
|
|
1439
|
-
method:
|
|
1465
|
+
pathFull: a = void 0,
|
|
1466
|
+
method: o = C.get,
|
|
1440
1467
|
headers: u = {},
|
|
1441
1468
|
type: h = "application/json;charset=UTF-8",
|
|
1442
|
-
init:
|
|
1469
|
+
init: y = {},
|
|
1443
1470
|
controller: g = void 0
|
|
1444
|
-
} = t, S =
|
|
1445
|
-
method:
|
|
1446
|
-
body: this.getBody(e,
|
|
1471
|
+
} = t, S = a != null ? a : this.getUrl(r, i), st = `${S}${this.getBodyForGet(e, S, o)}`, _ = this.headers.get(u, h), q = D(y, {
|
|
1472
|
+
method: o,
|
|
1473
|
+
body: this.getBody(e, o)
|
|
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 Ut(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 jt {
|
|
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(jt, "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,14 +1799,14 @@ const X = {}, lt = class lt {
|
|
|
1772
1799
|
* Обновление данных cookie.
|
|
1773
1800
|
*/
|
|
1774
1801
|
update() {
|
|
1775
|
-
var t, e,
|
|
1776
|
-
if (l() && !
|
|
1777
|
-
const
|
|
1802
|
+
var t, e, i, r, a;
|
|
1803
|
+
if (l() && !ct() && !jt.get()) {
|
|
1804
|
+
const o = String((t = this.value) != null ? t : "");
|
|
1778
1805
|
document.cookie = [
|
|
1779
|
-
`${encodeURIComponent(this.name)}=${encodeURIComponent(
|
|
1780
|
-
`max-age=${
|
|
1781
|
-
`SameSite=${(
|
|
1782
|
-
...(
|
|
1806
|
+
`${encodeURIComponent(this.name)}=${encodeURIComponent(o)}`,
|
|
1807
|
+
`max-age=${o === "" ? "-1" : this.getAge()}`,
|
|
1808
|
+
`SameSite=${(i = (e = this.options) == null ? void 0 : e.sameSite) != null ? i : "strict"}`,
|
|
1809
|
+
...(a = (r = this.options) == null ? void 0 : r.arguments) != null ? a : []
|
|
1783
1810
|
].join("; ");
|
|
1784
1811
|
}
|
|
1785
1812
|
}
|
|
@@ -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 && m(i) && (O[e] = Ut(i));
|
|
1795
1822
|
}
|
|
1796
1823
|
}
|
|
1797
1824
|
};
|
|
1798
|
-
l() && !
|
|
1799
|
-
let
|
|
1800
|
-
const
|
|
1801
|
-
function
|
|
1802
|
-
var r,
|
|
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, a, o, u, h, y, 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 = (y = (h = (u = (o = (a = (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 ? a : /^\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 ? o : /^\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 ? y : /^\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.
|
|
@@ -1863,18 +1890,18 @@ class M {
|
|
|
1863
1890
|
* объект с некоторыми или всеми из следующих свойств
|
|
1864
1891
|
*/
|
|
1865
1892
|
display(t, e) {
|
|
1866
|
-
var
|
|
1867
|
-
let
|
|
1868
|
-
e && (typeof e == "string" ?
|
|
1869
|
-
...
|
|
1893
|
+
var a;
|
|
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(),
|
|
1874
|
-
} catch (
|
|
1875
|
-
console.error("display: ",
|
|
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)));
|
|
1901
|
+
} catch (o) {
|
|
1902
|
+
console.error("display: ", o);
|
|
1876
1903
|
}
|
|
1877
|
-
return (
|
|
1904
|
+
return (a = r != null ? r : t) != null ? a : "";
|
|
1878
1905
|
}
|
|
1879
1906
|
/**
|
|
1880
1907
|
* Get display names of language.
|
|
@@ -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,25 +1940,25 @@ 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
|
-
const
|
|
1919
|
-
let
|
|
1920
|
-
switch (
|
|
1945
|
+
const a = (h = (u = this.geo) == null ? void 0 : u.nameFormat) != null ? h : "fl";
|
|
1946
|
+
let o;
|
|
1947
|
+
switch (a) {
|
|
1921
1948
|
case "fsl":
|
|
1922
|
-
|
|
1949
|
+
o = `${e}${i ? ` ${i}` : ""} ${t}`;
|
|
1923
1950
|
break;
|
|
1924
1951
|
case "lf":
|
|
1925
|
-
|
|
1952
|
+
o = `${t} ${e}`;
|
|
1926
1953
|
break;
|
|
1927
1954
|
case "lsf":
|
|
1928
|
-
|
|
1955
|
+
o = `${t}${i ? ` ${i}` : ""} ${e}`;
|
|
1929
1956
|
break;
|
|
1930
1957
|
default:
|
|
1931
|
-
|
|
1958
|
+
o = `${e} ${t}`;
|
|
1932
1959
|
break;
|
|
1933
1960
|
}
|
|
1934
|
-
return r ?
|
|
1961
|
+
return r ? o.replace(/ (.)[^ ]+/ig, " $1.") : o;
|
|
1935
1962
|
}
|
|
1936
1963
|
/**
|
|
1937
1964
|
* In basic use without specifying a locale, a formatted string.
|
|
@@ -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 ((
|
|
1981
|
+
var t, e, i, r, a;
|
|
1982
|
+
return ((a = (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, (o) => o.type === "decimal")) == null ? void 0 : a.value) || ".";
|
|
1956
1983
|
}
|
|
1957
1984
|
/**
|
|
1958
1985
|
* Currency formatting.
|
|
@@ -1963,23 +1990,23 @@ 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
|
-
},
|
|
1972
|
-
if (
|
|
1973
|
-
const
|
|
1974
|
-
return
|
|
1975
|
-
|
|
1998
|
+
}, a = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]{3})$/i, (...o) => (r.currency = String(o[2]).toUpperCase(), String(o[1])));
|
|
1999
|
+
if (i) {
|
|
2000
|
+
const o = this.numberObject(r);
|
|
2001
|
+
return o ? se(
|
|
2002
|
+
o.formatToParts(k(t)).filter((u) => ["literal", "currency"].indexOf(u.type) === -1),
|
|
1976
2003
|
"value"
|
|
1977
2004
|
).join("") : t.toString();
|
|
1978
2005
|
} else return "currency" in r ? this.number(
|
|
1979
|
-
typeof t == "number" ? t :
|
|
2006
|
+
typeof t == "number" ? t : a,
|
|
1980
2007
|
r
|
|
1981
2008
|
) : this.number(
|
|
1982
|
-
typeof t == "number" ? t :
|
|
2009
|
+
typeof t == "number" ? t : a,
|
|
1983
2010
|
{
|
|
1984
2011
|
...r,
|
|
1985
2012
|
style: "decimal"
|
|
@@ -1996,12 +2023,12 @@ class M {
|
|
|
1996
2023
|
* как отобразить валюту в формате валюты
|
|
1997
2024
|
*/
|
|
1998
2025
|
currencySymbol(t, e = "symbol") {
|
|
1999
|
-
var
|
|
2000
|
-
return ((u = (
|
|
2026
|
+
var i, r, a, o, u;
|
|
2027
|
+
return ((u = (o = (a = (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 : a.find) == null ? void 0 : o.call(a, (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, (...
|
|
2020
|
-
return this.number(r,
|
|
2046
|
+
}, r = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]+)$/i, (...a) => (i.unit = String(a[2]).toLowerCase(), String(a[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 && U(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,40 +2101,40 @@ 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
|
-
const
|
|
2080
|
-
if (
|
|
2106
|
+
const a = k(t), o = e.split("|");
|
|
2107
|
+
if (o.length > 1)
|
|
2081
2108
|
try {
|
|
2082
2109
|
if (l()) {
|
|
2083
|
-
const
|
|
2110
|
+
const y = new Intl.PluralRules(this.getLocation(), i).select(a);
|
|
2084
2111
|
let g;
|
|
2085
|
-
switch (
|
|
2112
|
+
switch (y) {
|
|
2086
2113
|
case "zero":
|
|
2087
|
-
g =
|
|
2114
|
+
g = o[o.length - 1];
|
|
2088
2115
|
break;
|
|
2089
2116
|
case "one":
|
|
2090
|
-
g =
|
|
2117
|
+
g = o == null ? void 0 : o[0];
|
|
2091
2118
|
break;
|
|
2092
2119
|
case "two":
|
|
2093
|
-
g =
|
|
2120
|
+
g = o == null ? void 0 : o[1];
|
|
2094
2121
|
break;
|
|
2095
2122
|
case "few":
|
|
2096
|
-
g =
|
|
2123
|
+
g = o != null && o[3] ? o == null ? void 0 : o[2] : o == null ? void 0 : o[1];
|
|
2097
2124
|
break;
|
|
2098
2125
|
case "many":
|
|
2099
|
-
g = (
|
|
2126
|
+
g = (o == null ? void 0 : o[3]) || (o == null ? void 0 : o[2]) || (o == null ? void 0 : o[1]);
|
|
2100
2127
|
break;
|
|
2101
2128
|
case "other":
|
|
2102
|
-
|
|
2129
|
+
o.length === 6 ? g = o[o.length - 2] : g = o[o.length - 1];
|
|
2103
2130
|
break;
|
|
2104
2131
|
}
|
|
2105
|
-
return `${this.number(
|
|
2132
|
+
return `${this.number(a, r)} ${g != null ? g : ""}`.trim();
|
|
2106
2133
|
}
|
|
2107
2134
|
} catch (h) {
|
|
2108
2135
|
console.error("plural: ", h);
|
|
2109
2136
|
}
|
|
2110
|
-
return `${this.number(
|
|
2137
|
+
return `${this.number(a, r)} ${(u = o == null ? void 0 : o[0]) != null ? u : ""}`.trim();
|
|
2111
2138
|
}
|
|
2112
2139
|
/**
|
|
2113
2140
|
* Enables language-sensitive date and time formatting.
|
|
@@ -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
|
|
2123
|
-
return r && (u.hour12 = !1),
|
|
2148
|
+
date(t, e, i, r) {
|
|
2149
|
+
const a = P(t), o = typeof i == "string", u = this.dateOptions(e, o ? i : "short");
|
|
2150
|
+
return r && (u.hour12 = !1), o || Object.assign(u, i), a.toLocaleString(this.getLocation(), u);
|
|
2124
2151
|
}
|
|
2125
2152
|
/**
|
|
2126
2153
|
* Enables language-sensitive relative time formatting.
|
|
@@ -2131,13 +2158,13 @@ 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), a = i || /* @__PURE__ */ new Date(), o = {
|
|
2136
2163
|
numeric: "auto",
|
|
2137
2164
|
...typeof e == "string" ? { style: e } : e || {}
|
|
2138
2165
|
};
|
|
2139
|
-
let u = "second", h = (r.getTime() -
|
|
2140
|
-
return Math.abs(h) >= 60 && (u = "minute", h /= 60, Math.abs(h) >= 60 && (u = "hour", h /= 60, Math.abs(h) >= 24 && (u = "day", h /= 24, Math.abs(h) >= 30 && (u = "month", h /= 30, Math.abs(h) >= 12 && (u = "year", h /= 12))))), this.relativeByValue(h, u,
|
|
2166
|
+
let u = "second", h = (r.getTime() - a.getTime()) / 1e3;
|
|
2167
|
+
return Math.abs(h) >= 60 && (u = "minute", h /= 60, Math.abs(h) >= 60 && (u = "hour", h /= 60, Math.abs(h) >= 24 && (u = "day", h /= 24, Math.abs(h) >= 30 && (u = "month", h /= 30, Math.abs(h) >= 12 && (u = "year", h /= 12))))), this.relativeByValue(h, u, o);
|
|
2141
2168
|
}
|
|
2142
2169
|
/**
|
|
2143
2170
|
* Enables language-sensitive relative time formatting
|
|
@@ -2157,16 +2184,16 @@ 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, a, o, u) {
|
|
2188
|
+
const h = P(t), y = i || /* @__PURE__ */ new Date(), g = new Date(y), S = new Date(y);
|
|
2189
|
+
return g.setDate(y.getDate() - e), S.setDate(y.getDate() + e), h >= g && h <= S ? this.relative(
|
|
2163
2190
|
h,
|
|
2164
2191
|
r,
|
|
2165
|
-
|
|
2192
|
+
y
|
|
2166
2193
|
) : this.date(
|
|
2167
2194
|
h,
|
|
2168
|
-
a,
|
|
2169
2195
|
o,
|
|
2196
|
+
a,
|
|
2170
2197
|
u
|
|
2171
2198
|
);
|
|
2172
2199
|
}
|
|
@@ -2176,16 +2203,16 @@ 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())
|
|
2186
2213
|
return new Intl.RelativeTimeFormat(this.getLocation(), r).format(Math.round(k(t)), e);
|
|
2187
|
-
} catch (
|
|
2188
|
-
console.error("relative: ",
|
|
2214
|
+
} catch (a) {
|
|
2215
|
+
console.error("relative: ", a);
|
|
2189
2216
|
}
|
|
2190
2217
|
return "";
|
|
2191
2218
|
}
|
|
@@ -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
|
|
2221
|
-
for (let
|
|
2222
|
-
|
|
2223
|
-
label: r.format(
|
|
2224
|
-
value:
|
|
2247
|
+
const i = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { month: t || "long" });
|
|
2248
|
+
for (let a = 0; a < 12; a++)
|
|
2249
|
+
i.setMonth(a), e.push({
|
|
2250
|
+
label: r.format(i).replace(/^./, (o) => o.toUpperCase()),
|
|
2251
|
+
value: a + 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
|
-
|
|
2263
|
-
for (let
|
|
2288
|
+
const i = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }), a = i.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
|
|
2289
|
+
i.setDate(i.getDate() - a);
|
|
2290
|
+
for (let o = 0; o < 7; o++)
|
|
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,
|
|
2319
|
+
const i = new Intl.Collator(this.getLocation());
|
|
2320
|
+
return t.sort((r, a) => i.compare(...e(r, a)));
|
|
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,11 +2424,11 @@ 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(
|
|
2404
|
-
return t === "RFC" ? `${r}${
|
|
2429
|
+
return this.getIntl().number(Math.trunc(i), { signDisplay: "always" });
|
|
2430
|
+
const r = this.toTimeZoneHourFormat(i), a = i.toString().match(/.\d+/) ? "30" : "00";
|
|
2431
|
+
return t === "RFC" ? `${r}${a}` : `${r}:${a}`;
|
|
2405
2432
|
}
|
|
2406
2433
|
/**
|
|
2407
2434
|
* Returns the code of the first day of the week.
|
|
@@ -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 U(s) ? s.trim() : ht(s) && s.findIndex((e) => f(e)) === -1 ? s.join(",") : f(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), a = i.split(t);
|
|
3024
|
+
return r.length === a.length ? r : (r.pop(), [
|
|
3025
|
+
...r,
|
|
3026
|
+
a.slice(e - 1).join(t)
|
|
3027
|
+
]);
|
|
3028
|
+
}
|
|
3029
|
+
function x(s, t) {
|
|
3030
|
+
var r;
|
|
3031
|
+
if (!m(t))
|
|
3032
|
+
return;
|
|
3033
|
+
const e = ie(t, ".", 2), i = e[0];
|
|
3034
|
+
return i && (s != null && s[i]) && f(s[i]) && (e != null && e[1]) ? x(s[i], e[1]) : (r = m(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 a = `${Ht(r)}Format`, o = x(t, r);
|
|
3108
|
+
i != null && i.transformation ? m(o) ? e[a] = i.transformation(
|
|
3109
|
+
o,
|
|
3110
|
+
t,
|
|
3111
|
+
i.options
|
|
3112
|
+
) : e[a] = "" : e[a] = this.transformation(
|
|
3113
|
+
o,
|
|
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 (m(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 a;
|
|
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
|
+
(a = i == null ? void 0 : i.options) != null ? a : 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 o, u, h;
|
|
3202
|
+
const i = x(t, (o = e == null ? void 0 : e.lastPropName) != null ? o : "lastName"), r = x(t, (u = e == null ? void 0 : e.firstPropName) != null ? u : "firstName"), a = x(t, (h = e == null ? void 0 : e.surname) != null ? h : "surname");
|
|
3203
|
+
return i && r ? N.getInstance().fullName(
|
|
3204
|
+
i,
|
|
3205
|
+
r,
|
|
3206
|
+
a,
|
|
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,12 +3621,12 @@ const j = class j {
|
|
|
3356
3621
|
* @param phone phone number/ номер телефон
|
|
3357
3622
|
*/
|
|
3358
3623
|
static getByPhone(t) {
|
|
3359
|
-
let e = this.map,
|
|
3360
|
-
return this.toNumber(t).forEach((
|
|
3361
|
-
var
|
|
3362
|
-
r === "" &&
|
|
3624
|
+
let e = this.map, i, r = "";
|
|
3625
|
+
return this.toNumber(t).forEach((a) => {
|
|
3626
|
+
var o;
|
|
3627
|
+
r === "" && a in e ? (i = e[a], e = (o = i == null ? void 0 : i.next) != null ? o : {}) : r += a;
|
|
3363
3628
|
}), {
|
|
3364
|
-
item:
|
|
3629
|
+
item: i,
|
|
3365
3630
|
phone: r
|
|
3366
3631
|
};
|
|
3367
3632
|
}
|
|
@@ -3372,10 +3637,10 @@ const j = class j {
|
|
|
3372
3637
|
* @param code country and language code/ код страны и языка
|
|
3373
3638
|
*/
|
|
3374
3639
|
static getByCode(t) {
|
|
3375
|
-
var
|
|
3640
|
+
var i;
|
|
3376
3641
|
const e = this.get(t);
|
|
3377
3642
|
if (e)
|
|
3378
|
-
return (
|
|
3643
|
+
return (i = this.getByPhone(e.phone.toString())) == null ? void 0 : i.item;
|
|
3379
3644
|
}
|
|
3380
3645
|
/**
|
|
3381
3646
|
* We get an array from a list of all phone numbers.
|
|
@@ -3401,11 +3666,11 @@ const j = class j {
|
|
|
3401
3666
|
* @param masks a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3402
3667
|
*/
|
|
3403
3668
|
static toMask(t, e) {
|
|
3404
|
-
if (
|
|
3405
|
-
const
|
|
3406
|
-
for (const
|
|
3407
|
-
if (this.getUnnecessaryLength(
|
|
3408
|
-
return this.toStandard(
|
|
3669
|
+
if (m(t) && Array.isArray(e) && e.length > 0) {
|
|
3670
|
+
const i = this.removeZero(t), r = i.length;
|
|
3671
|
+
for (const a of e)
|
|
3672
|
+
if (this.getUnnecessaryLength(a) === r)
|
|
3673
|
+
return this.toStandard(i, a);
|
|
3409
3674
|
}
|
|
3410
3675
|
}
|
|
3411
3676
|
/**
|
|
@@ -3449,16 +3714,16 @@ const j = class j {
|
|
|
3449
3714
|
* Формирование списка для карты.
|
|
3450
3715
|
*/
|
|
3451
3716
|
static makeList() {
|
|
3452
|
-
const t = d(
|
|
3717
|
+
const t = d(b.getList(), (e) => {
|
|
3453
3718
|
if (e != null && e.phoneMask)
|
|
3454
3719
|
return {
|
|
3455
3720
|
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/, "")) || void 0,
|
|
3456
3721
|
within: (e == null ? void 0 : e.phoneWithin) || 0,
|
|
3457
|
-
mask:
|
|
3722
|
+
mask: Y(e.phoneMask),
|
|
3458
3723
|
value: e.country
|
|
3459
3724
|
};
|
|
3460
3725
|
});
|
|
3461
|
-
this.list = t.sort((e,
|
|
3726
|
+
this.list = t.sort((e, i) => e.phone - i.phone);
|
|
3462
3727
|
}
|
|
3463
3728
|
/**
|
|
3464
3729
|
* Creating a map for search.
|
|
@@ -3468,21 +3733,21 @@ const j = class j {
|
|
|
3468
3733
|
static makeMap() {
|
|
3469
3734
|
this.list.forEach((t) => {
|
|
3470
3735
|
t.mask.forEach((e) => {
|
|
3471
|
-
let
|
|
3472
|
-
if (this.toNumber(e).forEach((
|
|
3473
|
-
var
|
|
3474
|
-
|
|
3736
|
+
let i = this.map, r;
|
|
3737
|
+
if (this.toNumber(e).forEach((a) => {
|
|
3738
|
+
var o;
|
|
3739
|
+
a in i || (i[a] = {
|
|
3475
3740
|
items: [],
|
|
3476
3741
|
info: void 0,
|
|
3477
3742
|
value: void 0,
|
|
3478
3743
|
mask: [],
|
|
3479
3744
|
maskFull: [],
|
|
3480
3745
|
next: {}
|
|
3481
|
-
}), r =
|
|
3746
|
+
}), r = i[a], i = (o = r == null ? void 0 : r.next) != null ? o : {};
|
|
3482
3747
|
}), r) {
|
|
3483
3748
|
r.value === void 0 && (r.info = t, r.value = t.value);
|
|
3484
|
-
const
|
|
3485
|
-
r.mask.push(
|
|
3749
|
+
const a = this.toWithin(e, t.within);
|
|
3750
|
+
r.mask.push(a), r.maskFull.push(a.replace(/\d/ig, "*")), r.items.push(t);
|
|
3486
3751
|
}
|
|
3487
3752
|
});
|
|
3488
3753
|
});
|
|
@@ -3504,8 +3769,8 @@ const j = class j {
|
|
|
3504
3769
|
* @param mask a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3505
3770
|
*/
|
|
3506
3771
|
static toStandard(t, e) {
|
|
3507
|
-
let
|
|
3508
|
-
return e.replace(/\*/ig, () => String(t[
|
|
3772
|
+
let i = 0;
|
|
3773
|
+
return e.replace(/\*/ig, () => String(t[i++]));
|
|
3509
3774
|
}
|
|
3510
3775
|
/**
|
|
3511
3776
|
* Replaces the first character with the internal country code
|
|
@@ -3518,9 +3783,9 @@ const j = class j {
|
|
|
3518
3783
|
return t.replace(/\*/, this.getWithinSymbol(e));
|
|
3519
3784
|
}
|
|
3520
3785
|
};
|
|
3521
|
-
c(
|
|
3522
|
-
let
|
|
3523
|
-
class
|
|
3786
|
+
c(Z, "list", []), c(Z, "map", {}), Z.makeList(), Z.makeMap();
|
|
3787
|
+
let kt = Z, j;
|
|
3788
|
+
class Ze {
|
|
3524
3789
|
/**
|
|
3525
3790
|
* Returns the value by its name.
|
|
3526
3791
|
*
|
|
@@ -3528,7 +3793,7 @@ class Ie {
|
|
|
3528
3793
|
* @param name property name/ название свойства
|
|
3529
3794
|
*/
|
|
3530
3795
|
static get(t) {
|
|
3531
|
-
return
|
|
3796
|
+
return j && (j == null ? void 0 : j[t]);
|
|
3532
3797
|
}
|
|
3533
3798
|
/**
|
|
3534
3799
|
* Adds data, this method works only once.
|
|
@@ -3537,10 +3802,10 @@ class Ie {
|
|
|
3537
3802
|
* @param data global data/ глобальные данные
|
|
3538
3803
|
*/
|
|
3539
3804
|
static add(t) {
|
|
3540
|
-
|
|
3805
|
+
j === void 0 && (j = D(t));
|
|
3541
3806
|
}
|
|
3542
3807
|
}
|
|
3543
|
-
const
|
|
3808
|
+
const W = class W {
|
|
3544
3809
|
/**
|
|
3545
3810
|
* Get data from hash.
|
|
3546
3811
|
*
|
|
@@ -3560,8 +3825,8 @@ const x = class x {
|
|
|
3560
3825
|
*/
|
|
3561
3826
|
static set(t, e) {
|
|
3562
3827
|
var r;
|
|
3563
|
-
const
|
|
3564
|
-
|
|
3828
|
+
const i = B(e);
|
|
3829
|
+
i !== ((r = this.hash) == null ? void 0 : r[t]) && (this.hash[t] = i, this.update());
|
|
3565
3830
|
}
|
|
3566
3831
|
/**
|
|
3567
3832
|
* Adding an event when data is changed.
|
|
@@ -3571,8 +3836,20 @@ const x = class x {
|
|
|
3571
3836
|
* @param callback the function is called when the data is changed/ функция вызывается при изменении данных
|
|
3572
3837
|
*/
|
|
3573
3838
|
static addWatch(t, e) {
|
|
3574
|
-
var
|
|
3575
|
-
t in this.watch ? (
|
|
3839
|
+
var i;
|
|
3840
|
+
t in this.watch ? (i = this.watch[t]) == null || i.push(e) : this.watch[t] = [e];
|
|
3841
|
+
}
|
|
3842
|
+
/**
|
|
3843
|
+
* Removing an event when data is changed.
|
|
3844
|
+
*
|
|
3845
|
+
* Удаление события при изменении данных.
|
|
3846
|
+
* @param name variable names/ названия переменных
|
|
3847
|
+
* @param callback the function is called when the data is changed/ функция вызывается при изменении данных
|
|
3848
|
+
*/
|
|
3849
|
+
static removeWatch(t, e) {
|
|
3850
|
+
var r;
|
|
3851
|
+
const i = (r = this.watch) == null ? void 0 : r[t];
|
|
3852
|
+
i && (this.watch[t] = i.filter((a) => a !== e));
|
|
3576
3853
|
}
|
|
3577
3854
|
/**
|
|
3578
3855
|
* Update hash variable from URL string.
|
|
@@ -3594,7 +3871,7 @@ const x = class x {
|
|
|
3594
3871
|
const t = {};
|
|
3595
3872
|
return location.hash.replace(
|
|
3596
3873
|
/([\w-]+)[:=]([^;]+)/ig,
|
|
3597
|
-
(...e) => (t[String(e[1])] =
|
|
3874
|
+
(...e) => (t[String(e[1])] = Ut(e[2]), "")
|
|
3598
3875
|
), t;
|
|
3599
3876
|
}
|
|
3600
3877
|
/**
|
|
@@ -3603,7 +3880,7 @@ const x = class x {
|
|
|
3603
3880
|
* Обновление строки хэша в URL.
|
|
3604
3881
|
*/
|
|
3605
3882
|
static update() {
|
|
3606
|
-
this.block = !0, history.replaceState(null, "", `#${
|
|
3883
|
+
this.block = !0, history.replaceState(null, "", `#${Pt(this.hash, "=", ";")}`), requestAnimationFrame(() => {
|
|
3607
3884
|
this.block = !1;
|
|
3608
3885
|
});
|
|
3609
3886
|
}
|
|
@@ -3614,15 +3891,15 @@ const x = class x {
|
|
|
3614
3891
|
* @param location fresh data/ свежий данные
|
|
3615
3892
|
*/
|
|
3616
3893
|
static makeWatch(t) {
|
|
3617
|
-
d(this.watch, (e,
|
|
3894
|
+
d(this.watch, (e, i) => {
|
|
3618
3895
|
var r;
|
|
3619
|
-
((r = this.hash) == null ? void 0 : r[
|
|
3896
|
+
((r = this.hash) == null ? void 0 : r[i]) !== (t == null ? void 0 : t[i]) && e.forEach((a) => a(t[i]));
|
|
3620
3897
|
});
|
|
3621
3898
|
}
|
|
3622
3899
|
};
|
|
3623
|
-
c(
|
|
3624
|
-
let
|
|
3625
|
-
const
|
|
3900
|
+
c(W, "hash", {}), c(W, "watch", {}), c(W, "block", !1), l() && (W.reload(), addEventListener("hashchange", () => W.reload()));
|
|
3901
|
+
let Nt = W;
|
|
3902
|
+
const at = "__UI_ICON", Et = 320, At = "--LOAD--", M = class M {
|
|
3626
3903
|
/**
|
|
3627
3904
|
* Checks if the given icon is in the list of connected icons.
|
|
3628
3905
|
*
|
|
@@ -3642,10 +3919,10 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3642
3919
|
* @param wait waiting time for picture loading/
|
|
3643
3920
|
* время ожидания загрузки картинки
|
|
3644
3921
|
*/
|
|
3645
|
-
static async get(t, e = "",
|
|
3646
|
-
var
|
|
3647
|
-
const r = (h = (u = (
|
|
3648
|
-
return typeof r == "string" ? r ===
|
|
3922
|
+
static async get(t, e = "", i = 1e3 * 60 * 3) {
|
|
3923
|
+
var a, o, u, h;
|
|
3924
|
+
const r = (h = (u = (a = this.icons) == null ? void 0 : a[this.getName(t)]) != null ? u : (o = this.icons) == null ? void 0 : o[t]) != null ? h : `${t.replace(/^@/, e != null ? e : this.url)}.svg`;
|
|
3925
|
+
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
3926
|
}
|
|
3650
3927
|
/**
|
|
3651
3928
|
* Returns a list of names of all registered icons.
|
|
@@ -3661,7 +3938,7 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3661
3938
|
* Возвращает глобальную ссылку.
|
|
3662
3939
|
*/
|
|
3663
3940
|
static getUrlGlobal() {
|
|
3664
|
-
return `${
|
|
3941
|
+
return `${K.isLocalhost(), ""}${this.url}`;
|
|
3665
3942
|
}
|
|
3666
3943
|
/**
|
|
3667
3944
|
* Adding custom icons.
|
|
@@ -3680,7 +3957,7 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3680
3957
|
* @param index icon name/ название иконки
|
|
3681
3958
|
*/
|
|
3682
3959
|
static addLoad(t) {
|
|
3683
|
-
this.icons[this.getName(t)] =
|
|
3960
|
+
this.icons[this.getName(t)] = At;
|
|
3684
3961
|
}
|
|
3685
3962
|
/**
|
|
3686
3963
|
* Adding custom global icons.
|
|
@@ -3699,7 +3976,7 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3699
3976
|
* @param list list of icons/ список иконки
|
|
3700
3977
|
*/
|
|
3701
3978
|
static addByList(t) {
|
|
3702
|
-
d(t, (e,
|
|
3979
|
+
d(t, (e, i) => this.add(i, e));
|
|
3703
3980
|
}
|
|
3704
3981
|
/**
|
|
3705
3982
|
* Changes the file path.
|
|
@@ -3725,42 +4002,42 @@ const st = "__UI_ICON", Lt = 320, Ct = "--LOAD--", Y = class Y {
|
|
|
3725
4002
|
* Задержка выполнения скрипта.
|
|
3726
4003
|
*/
|
|
3727
4004
|
static wait() {
|
|
3728
|
-
return new Promise((t) => setTimeout(() => t(),
|
|
4005
|
+
return new Promise((t) => setTimeout(() => t(), Et));
|
|
3729
4006
|
}
|
|
3730
4007
|
};
|
|
3731
|
-
c(
|
|
3732
|
-
let
|
|
3733
|
-
function
|
|
3734
|
-
var
|
|
3735
|
-
return (r = (
|
|
4008
|
+
c(M, "icons", {}), c(M, "url", "/icons/"), l() && (at in window || (window[at] = {}), M.icons = window[at]);
|
|
4009
|
+
let It = M;
|
|
4010
|
+
function re(s, t, e) {
|
|
4011
|
+
var i, r;
|
|
4012
|
+
return (r = (i = E(s)) == null ? void 0 : i[t]) != null ? r : e;
|
|
3736
4013
|
}
|
|
3737
|
-
function
|
|
3738
|
-
const
|
|
3739
|
-
if (
|
|
3740
|
-
const r =
|
|
4014
|
+
function ne(s, t, e) {
|
|
4015
|
+
const i = E(s);
|
|
4016
|
+
if (i) {
|
|
4017
|
+
const r = re(i, t);
|
|
3741
4018
|
if (f(r) && f(e))
|
|
3742
|
-
d(e, (
|
|
3743
|
-
r[
|
|
4019
|
+
d(e, (a, o) => {
|
|
4020
|
+
r[o] = B(a);
|
|
3744
4021
|
});
|
|
3745
4022
|
else {
|
|
3746
|
-
const
|
|
3747
|
-
!(t in
|
|
4023
|
+
const a = B(e);
|
|
4024
|
+
!(t in i) && typeof a == "string" ? i.setAttribute(t.toString(), a) : i[t] = B(e);
|
|
3748
4025
|
}
|
|
3749
4026
|
}
|
|
3750
|
-
return
|
|
4027
|
+
return i;
|
|
3751
4028
|
}
|
|
3752
|
-
function
|
|
4029
|
+
function G(s, t = "div", e, i) {
|
|
3753
4030
|
if (!l())
|
|
3754
4031
|
return;
|
|
3755
4032
|
const r = document.createElement(t);
|
|
3756
|
-
return typeof e == "function" ? e(r) : A(e) && d(e, (
|
|
3757
|
-
|
|
3758
|
-
}),
|
|
4033
|
+
return typeof e == "function" ? e(r) : A(e) && d(e, (a, o) => {
|
|
4034
|
+
ne(r, o, a);
|
|
4035
|
+
}), s == null || s.insertBefore(r, i != null ? i : null), r;
|
|
3759
4036
|
}
|
|
3760
|
-
function
|
|
3761
|
-
return
|
|
4037
|
+
function ae(s) {
|
|
4038
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").trim();
|
|
3762
4039
|
}
|
|
3763
|
-
class
|
|
4040
|
+
class dt {
|
|
3764
4041
|
/**
|
|
3765
4042
|
* Creates an instance of MetaManager.
|
|
3766
4043
|
*
|
|
@@ -3828,7 +4105,7 @@ class ht {
|
|
|
3828
4105
|
setByList(t) {
|
|
3829
4106
|
return d(
|
|
3830
4107
|
t,
|
|
3831
|
-
(e,
|
|
4108
|
+
(e, i) => this.set(i, String(e))
|
|
3832
4109
|
), this;
|
|
3833
4110
|
}
|
|
3834
4111
|
/**
|
|
@@ -3869,12 +4146,12 @@ class ht {
|
|
|
3869
4146
|
*/
|
|
3870
4147
|
setMeta(t) {
|
|
3871
4148
|
var r;
|
|
3872
|
-
const e = this.findMetaElement(t),
|
|
4149
|
+
const e = this.findMetaElement(t), i = (r = this.items[t]) != null ? r : "";
|
|
3873
4150
|
if (e)
|
|
3874
|
-
e.content =
|
|
4151
|
+
e.content = i;
|
|
3875
4152
|
else if (l()) {
|
|
3876
|
-
const
|
|
3877
|
-
this.isProperty ?
|
|
4153
|
+
const a = { content: i };
|
|
4154
|
+
this.isProperty ? a.property = t : a.name = t, G(document.head, "meta", a);
|
|
3878
4155
|
}
|
|
3879
4156
|
return this;
|
|
3880
4157
|
}
|
|
@@ -3885,8 +4162,8 @@ class ht {
|
|
|
3885
4162
|
* @param name meta tag name / имя мета-тега
|
|
3886
4163
|
*/
|
|
3887
4164
|
toHtmlString(t) {
|
|
3888
|
-
var
|
|
3889
|
-
const e =
|
|
4165
|
+
var i;
|
|
4166
|
+
const e = ae((i = this.items[t]) != null ? i : "");
|
|
3890
4167
|
return e ? `<meta ${this.getAttributeName()}="${t}" content="${e}">` : "";
|
|
3891
4168
|
}
|
|
3892
4169
|
/**
|
|
@@ -3896,15 +4173,15 @@ class ht {
|
|
|
3896
4173
|
*/
|
|
3897
4174
|
update() {
|
|
3898
4175
|
return this.listMeta.forEach((t) => {
|
|
3899
|
-
var e,
|
|
3900
|
-
this.items[t] = (
|
|
4176
|
+
var e, i;
|
|
4177
|
+
this.items[t] = (i = (e = this.findMetaElement(t)) == null ? void 0 : e.content) != null ? i : "";
|
|
3901
4178
|
}), this;
|
|
3902
4179
|
}
|
|
3903
4180
|
}
|
|
3904
|
-
var
|
|
3905
|
-
class
|
|
4181
|
+
var L = /* @__PURE__ */ ((s) => (s.description = "description", s.keywords = "keywords", s.canonical = "canonical", s.robots = "robots", s.author = "author", s))(L || {}), oe = /* @__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))(oe || {}), $ = /* @__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 || {});
|
|
4182
|
+
class fe extends dt {
|
|
3906
4183
|
constructor() {
|
|
3907
|
-
super(Object.values(
|
|
4184
|
+
super(Object.values($), !0);
|
|
3908
4185
|
}
|
|
3909
4186
|
/**
|
|
3910
4187
|
* Gets the Open Graph title.
|
|
@@ -3912,7 +4189,7 @@ class ce extends ht {
|
|
|
3912
4189
|
* Получает заголовок Open Graph.
|
|
3913
4190
|
*/
|
|
3914
4191
|
getTitle() {
|
|
3915
|
-
return this.get(
|
|
4192
|
+
return this.get($.title);
|
|
3916
4193
|
}
|
|
3917
4194
|
/**
|
|
3918
4195
|
* Gets the Open Graph type.
|
|
@@ -3920,7 +4197,7 @@ class ce extends ht {
|
|
|
3920
4197
|
* Получает тип Open Graph.
|
|
3921
4198
|
*/
|
|
3922
4199
|
getType() {
|
|
3923
|
-
return this.get(
|
|
4200
|
+
return this.get($.type);
|
|
3924
4201
|
}
|
|
3925
4202
|
/**
|
|
3926
4203
|
* Gets the Open Graph URL.
|
|
@@ -3928,7 +4205,7 @@ class ce extends ht {
|
|
|
3928
4205
|
* Получает URL Open Graph.
|
|
3929
4206
|
*/
|
|
3930
4207
|
getUrl() {
|
|
3931
|
-
return this.get(
|
|
4208
|
+
return this.get($.url);
|
|
3932
4209
|
}
|
|
3933
4210
|
/**
|
|
3934
4211
|
* Gets the Open Graph image URL.
|
|
@@ -3936,7 +4213,7 @@ class ce extends ht {
|
|
|
3936
4213
|
* Получает URL изображения Open Graph.
|
|
3937
4214
|
*/
|
|
3938
4215
|
getImage() {
|
|
3939
|
-
return this.get(
|
|
4216
|
+
return this.get($.image);
|
|
3940
4217
|
}
|
|
3941
4218
|
/**
|
|
3942
4219
|
* Gets the Open Graph description.
|
|
@@ -3944,7 +4221,7 @@ class ce extends ht {
|
|
|
3944
4221
|
* Получает описание Open Graph.
|
|
3945
4222
|
*/
|
|
3946
4223
|
getDescription() {
|
|
3947
|
-
return this.get(
|
|
4224
|
+
return this.get($.description);
|
|
3948
4225
|
}
|
|
3949
4226
|
/**
|
|
3950
4227
|
* Gets the Open Graph locale.
|
|
@@ -3952,7 +4229,7 @@ class ce extends ht {
|
|
|
3952
4229
|
* Получает локаль Open Graph.
|
|
3953
4230
|
*/
|
|
3954
4231
|
getLocale() {
|
|
3955
|
-
return this.get(
|
|
4232
|
+
return this.get($.locale);
|
|
3956
4233
|
}
|
|
3957
4234
|
/**
|
|
3958
4235
|
* Gets the Open Graph site name.
|
|
@@ -3960,7 +4237,7 @@ class ce extends ht {
|
|
|
3960
4237
|
* Получает название сайта Open Graph.
|
|
3961
4238
|
*/
|
|
3962
4239
|
getSiteName() {
|
|
3963
|
-
return this.get(
|
|
4240
|
+
return this.get($.siteName);
|
|
3964
4241
|
}
|
|
3965
4242
|
/**
|
|
3966
4243
|
* Sets the Open Graph title.
|
|
@@ -3969,7 +4246,7 @@ class ce extends ht {
|
|
|
3969
4246
|
* @param title title / заголовок
|
|
3970
4247
|
*/
|
|
3971
4248
|
setTitle(t) {
|
|
3972
|
-
return this.set(
|
|
4249
|
+
return this.set($.title, t);
|
|
3973
4250
|
}
|
|
3974
4251
|
/**
|
|
3975
4252
|
* Sets the Open Graph type.
|
|
@@ -3978,7 +4255,7 @@ class ce extends ht {
|
|
|
3978
4255
|
* @param type type / тип
|
|
3979
4256
|
*/
|
|
3980
4257
|
setType(t) {
|
|
3981
|
-
return this.set(
|
|
4258
|
+
return this.set($.type, t);
|
|
3982
4259
|
}
|
|
3983
4260
|
/**
|
|
3984
4261
|
* Sets the Open Graph URL.
|
|
@@ -3987,7 +4264,7 @@ class ce extends ht {
|
|
|
3987
4264
|
* @param url URL / URL
|
|
3988
4265
|
*/
|
|
3989
4266
|
setUrl(t) {
|
|
3990
|
-
return this.set(
|
|
4267
|
+
return this.set($.url, t);
|
|
3991
4268
|
}
|
|
3992
4269
|
/**
|
|
3993
4270
|
* Sets the Open Graph image URL.
|
|
@@ -3996,7 +4273,7 @@ class ce extends ht {
|
|
|
3996
4273
|
* @param url image URL / URL изображения
|
|
3997
4274
|
*/
|
|
3998
4275
|
setImage(t) {
|
|
3999
|
-
return this.set(
|
|
4276
|
+
return this.set($.image, t);
|
|
4000
4277
|
}
|
|
4001
4278
|
/**
|
|
4002
4279
|
* Sets the Open Graph description.
|
|
@@ -4005,7 +4282,7 @@ class ce extends ht {
|
|
|
4005
4282
|
* @param description description / описание
|
|
4006
4283
|
*/
|
|
4007
4284
|
setDescription(t) {
|
|
4008
|
-
return this.set(
|
|
4285
|
+
return this.set($.description, t);
|
|
4009
4286
|
}
|
|
4010
4287
|
/**
|
|
4011
4288
|
* Sets the Open Graph locale.
|
|
@@ -4014,7 +4291,7 @@ class ce extends ht {
|
|
|
4014
4291
|
* @param locale locale (e.g. 'en_US', 'ru_RU') / локаль (например, 'en_US', 'ru_RU')
|
|
4015
4292
|
*/
|
|
4016
4293
|
setLocale(t) {
|
|
4017
|
-
return this.set(
|
|
4294
|
+
return this.set($.locale, t);
|
|
4018
4295
|
}
|
|
4019
4296
|
/**
|
|
4020
4297
|
* Sets the Open Graph site name.
|
|
@@ -4023,12 +4300,12 @@ class ce extends ht {
|
|
|
4023
4300
|
* @param siteName site name / название сайта
|
|
4024
4301
|
*/
|
|
4025
4302
|
setSiteName(t) {
|
|
4026
|
-
return this.set(
|
|
4303
|
+
return this.set($.siteName, t);
|
|
4027
4304
|
}
|
|
4028
4305
|
}
|
|
4029
|
-
class
|
|
4306
|
+
class me extends dt {
|
|
4030
4307
|
constructor() {
|
|
4031
|
-
super(Object.values(
|
|
4308
|
+
super(Object.values(p));
|
|
4032
4309
|
}
|
|
4033
4310
|
/**
|
|
4034
4311
|
* Gets the Twitter Card type.
|
|
@@ -4036,7 +4313,7 @@ class ue extends ht {
|
|
|
4036
4313
|
* Получает тип Twitter Card.
|
|
4037
4314
|
*/
|
|
4038
4315
|
getCard() {
|
|
4039
|
-
return this.get(
|
|
4316
|
+
return this.get(p.card);
|
|
4040
4317
|
}
|
|
4041
4318
|
/**
|
|
4042
4319
|
* Gets the website or brand @username.
|
|
@@ -4044,7 +4321,7 @@ class ue extends ht {
|
|
|
4044
4321
|
* Получает аккаунт сайта или бренда (@username).
|
|
4045
4322
|
*/
|
|
4046
4323
|
getSite() {
|
|
4047
|
-
return this.get(
|
|
4324
|
+
return this.get(p.site);
|
|
4048
4325
|
}
|
|
4049
4326
|
/**
|
|
4050
4327
|
* Gets the content creator @username.
|
|
@@ -4052,7 +4329,7 @@ class ue extends ht {
|
|
|
4052
4329
|
* Получает автора контента (@username).
|
|
4053
4330
|
*/
|
|
4054
4331
|
getCreator() {
|
|
4055
|
-
return this.get(
|
|
4332
|
+
return this.get(p.creator);
|
|
4056
4333
|
}
|
|
4057
4334
|
/**
|
|
4058
4335
|
* Gets the page URL.
|
|
@@ -4060,7 +4337,7 @@ class ue extends ht {
|
|
|
4060
4337
|
* Получает URL страницы.
|
|
4061
4338
|
*/
|
|
4062
4339
|
getUrl() {
|
|
4063
|
-
return this.get(
|
|
4340
|
+
return this.get(p.url);
|
|
4064
4341
|
}
|
|
4065
4342
|
/**
|
|
4066
4343
|
* Gets the card title.
|
|
@@ -4068,7 +4345,7 @@ class ue extends ht {
|
|
|
4068
4345
|
* Получает заголовок карточки.
|
|
4069
4346
|
*/
|
|
4070
4347
|
getTitle() {
|
|
4071
|
-
return this.get(
|
|
4348
|
+
return this.get(p.title);
|
|
4072
4349
|
}
|
|
4073
4350
|
/**
|
|
4074
4351
|
* Gets the card description.
|
|
@@ -4076,7 +4353,7 @@ class ue extends ht {
|
|
|
4076
4353
|
* Получает описание карточки.
|
|
4077
4354
|
*/
|
|
4078
4355
|
getDescription() {
|
|
4079
|
-
return this.get(
|
|
4356
|
+
return this.get(p.description);
|
|
4080
4357
|
}
|
|
4081
4358
|
/**
|
|
4082
4359
|
* Gets the card image URL.
|
|
@@ -4084,7 +4361,7 @@ class ue extends ht {
|
|
|
4084
4361
|
* Получает URL изображения карточки.
|
|
4085
4362
|
*/
|
|
4086
4363
|
getImage() {
|
|
4087
|
-
return this.get(
|
|
4364
|
+
return this.get(p.image);
|
|
4088
4365
|
}
|
|
4089
4366
|
/**
|
|
4090
4367
|
* Sets the Twitter Card type.
|
|
@@ -4093,7 +4370,7 @@ class ue extends ht {
|
|
|
4093
4370
|
* @param card card type / тип карточки
|
|
4094
4371
|
*/
|
|
4095
4372
|
setCard(t) {
|
|
4096
|
-
return this.set(
|
|
4373
|
+
return this.set(p.card, t), this;
|
|
4097
4374
|
}
|
|
4098
4375
|
/**
|
|
4099
4376
|
* Sets the website or brand @username.
|
|
@@ -4102,7 +4379,7 @@ class ue extends ht {
|
|
|
4102
4379
|
* @param site @username / аккаунт
|
|
4103
4380
|
*/
|
|
4104
4381
|
setSite(t) {
|
|
4105
|
-
return this.set(
|
|
4382
|
+
return this.set(p.site, t), this;
|
|
4106
4383
|
}
|
|
4107
4384
|
/**
|
|
4108
4385
|
* Sets the content creator @username.
|
|
@@ -4111,7 +4388,7 @@ class ue extends ht {
|
|
|
4111
4388
|
* @param creator @username / аккаунт автора
|
|
4112
4389
|
*/
|
|
4113
4390
|
setCreator(t) {
|
|
4114
|
-
return this.set(
|
|
4391
|
+
return this.set(p.creator, t), this;
|
|
4115
4392
|
}
|
|
4116
4393
|
/**
|
|
4117
4394
|
* Sets the page URL.
|
|
@@ -4120,7 +4397,7 @@ class ue extends ht {
|
|
|
4120
4397
|
* @param url URL / URL
|
|
4121
4398
|
*/
|
|
4122
4399
|
setUrl(t) {
|
|
4123
|
-
return this.set(
|
|
4400
|
+
return this.set(p.url, t), this;
|
|
4124
4401
|
}
|
|
4125
4402
|
/**
|
|
4126
4403
|
* Sets the card title.
|
|
@@ -4129,7 +4406,7 @@ class ue extends ht {
|
|
|
4129
4406
|
* @param title title / заголовок
|
|
4130
4407
|
*/
|
|
4131
4408
|
setTitle(t) {
|
|
4132
|
-
return this.set(
|
|
4409
|
+
return this.set(p.title, t), this;
|
|
4133
4410
|
}
|
|
4134
4411
|
/**
|
|
4135
4412
|
* Sets the card description.
|
|
@@ -4138,7 +4415,7 @@ class ue extends ht {
|
|
|
4138
4415
|
* @param description description / описание
|
|
4139
4416
|
*/
|
|
4140
4417
|
setDescription(t) {
|
|
4141
|
-
return this.set(
|
|
4418
|
+
return this.set(p.description, t), this;
|
|
4142
4419
|
}
|
|
4143
4420
|
/**
|
|
4144
4421
|
* Sets the card image URL.
|
|
@@ -4147,21 +4424,21 @@ class ue extends ht {
|
|
|
4147
4424
|
* @param image image URL / URL изображения
|
|
4148
4425
|
*/
|
|
4149
4426
|
setImage(t) {
|
|
4150
|
-
return this.set(
|
|
4427
|
+
return this.set(p.image, t), this;
|
|
4151
4428
|
}
|
|
4152
4429
|
}
|
|
4153
|
-
class
|
|
4430
|
+
class Ve extends dt {
|
|
4154
4431
|
/**
|
|
4155
4432
|
* Creates an instance of Meta with integrated Open Graph and Twitter Card support.
|
|
4156
4433
|
*
|
|
4157
4434
|
* Создает экземпляр Meta с интегрированной поддержкой Open Graph и Twitter Card.
|
|
4158
4435
|
*/
|
|
4159
4436
|
constructor() {
|
|
4160
|
-
super(Object.values(
|
|
4437
|
+
super(Object.values(L));
|
|
4161
4438
|
c(this, "suffix");
|
|
4162
4439
|
c(this, "og");
|
|
4163
4440
|
c(this, "twitter");
|
|
4164
|
-
this.og = new
|
|
4441
|
+
this.og = new fe(), this.twitter = new me();
|
|
4165
4442
|
}
|
|
4166
4443
|
/**
|
|
4167
4444
|
* Gets the MetaOg instance for advanced Open Graph operations.
|
|
@@ -4193,7 +4470,7 @@ class Fe extends ht {
|
|
|
4193
4470
|
* Получает мета-тег keywords.
|
|
4194
4471
|
*/
|
|
4195
4472
|
getKeywords() {
|
|
4196
|
-
return this.get(
|
|
4473
|
+
return this.get(L.keywords);
|
|
4197
4474
|
}
|
|
4198
4475
|
/**
|
|
4199
4476
|
* Gets the description meta tag.
|
|
@@ -4201,7 +4478,7 @@ class Fe extends ht {
|
|
|
4201
4478
|
* Получает мета-тег description.
|
|
4202
4479
|
*/
|
|
4203
4480
|
getDescription() {
|
|
4204
|
-
return this.get(
|
|
4481
|
+
return this.get(L.description);
|
|
4205
4482
|
}
|
|
4206
4483
|
/**
|
|
4207
4484
|
* Gets the Open Graph image URL.
|
|
@@ -4217,7 +4494,7 @@ class Fe extends ht {
|
|
|
4217
4494
|
* Получает канонический URL.
|
|
4218
4495
|
*/
|
|
4219
4496
|
getCanonical() {
|
|
4220
|
-
return this.get(
|
|
4497
|
+
return this.get(L.canonical);
|
|
4221
4498
|
}
|
|
4222
4499
|
/**
|
|
4223
4500
|
* Gets the robots meta tag value.
|
|
@@ -4225,7 +4502,7 @@ class Fe extends ht {
|
|
|
4225
4502
|
* Получает значение мета-тега robots.
|
|
4226
4503
|
*/
|
|
4227
4504
|
getRobots() {
|
|
4228
|
-
return this.get(
|
|
4505
|
+
return this.get(L.robots);
|
|
4229
4506
|
}
|
|
4230
4507
|
/**
|
|
4231
4508
|
* Gets the author meta tag.
|
|
@@ -4233,7 +4510,7 @@ class Fe extends ht {
|
|
|
4233
4510
|
* Получает мета-тег author.
|
|
4234
4511
|
*/
|
|
4235
4512
|
getAuthor() {
|
|
4236
|
-
return this.get(
|
|
4513
|
+
return this.get(L.author);
|
|
4237
4514
|
}
|
|
4238
4515
|
/**
|
|
4239
4516
|
* Gets the Open Graph site name.
|
|
@@ -4259,8 +4536,8 @@ class Fe extends ht {
|
|
|
4259
4536
|
*/
|
|
4260
4537
|
setTitle(e) {
|
|
4261
4538
|
if (l()) {
|
|
4262
|
-
const
|
|
4263
|
-
document.title =
|
|
4539
|
+
const i = m(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
|
|
4540
|
+
document.title = i, this.og.setTitle(i), this.twitter.setTitle(i);
|
|
4264
4541
|
}
|
|
4265
4542
|
return this;
|
|
4266
4543
|
}
|
|
@@ -4271,7 +4548,7 @@ class Fe extends ht {
|
|
|
4271
4548
|
* @param keywords keywords as string or array / ключевые слова в виде строки или массива
|
|
4272
4549
|
*/
|
|
4273
4550
|
setKeywords(e) {
|
|
4274
|
-
return this.set(
|
|
4551
|
+
return this.set(L.keywords, Y(e).join(", ")), this;
|
|
4275
4552
|
}
|
|
4276
4553
|
/**
|
|
4277
4554
|
* Sets the description meta tag.
|
|
@@ -4280,7 +4557,7 @@ class Fe extends ht {
|
|
|
4280
4557
|
* @param description page description / описание страницы
|
|
4281
4558
|
*/
|
|
4282
4559
|
setDescription(e) {
|
|
4283
|
-
return this.set(
|
|
4560
|
+
return this.set(L.description, e), this;
|
|
4284
4561
|
}
|
|
4285
4562
|
/**
|
|
4286
4563
|
* Sets the image for Open Graph and Twitter Card.
|
|
@@ -4298,7 +4575,7 @@ class Fe extends ht {
|
|
|
4298
4575
|
* @param canonical canonical URL / канонический URL
|
|
4299
4576
|
*/
|
|
4300
4577
|
setCanonical(e) {
|
|
4301
|
-
return this.set(
|
|
4578
|
+
return this.set(L.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
|
|
4302
4579
|
}
|
|
4303
4580
|
/**
|
|
4304
4581
|
* Sets the robots meta tag.
|
|
@@ -4307,7 +4584,7 @@ class Fe extends ht {
|
|
|
4307
4584
|
* @param robots robots directive / директива robots
|
|
4308
4585
|
*/
|
|
4309
4586
|
setRobots(e) {
|
|
4310
|
-
return this.set(
|
|
4587
|
+
return this.set(L.robots, e), this;
|
|
4311
4588
|
}
|
|
4312
4589
|
/**
|
|
4313
4590
|
* Sets the author meta tag.
|
|
@@ -4316,7 +4593,7 @@ class Fe extends ht {
|
|
|
4316
4593
|
* @param author author name / имя автора
|
|
4317
4594
|
*/
|
|
4318
4595
|
setAuthor(e) {
|
|
4319
|
-
return this.set(
|
|
4596
|
+
return this.set(L.author, e), this;
|
|
4320
4597
|
}
|
|
4321
4598
|
/**
|
|
4322
4599
|
* Sets the site name for Open Graph and Twitter Card.
|
|
@@ -4359,10 +4636,10 @@ class Fe extends ht {
|
|
|
4359
4636
|
* Получает отформатированный суффикс с разделителем.
|
|
4360
4637
|
*/
|
|
4361
4638
|
getSuffix() {
|
|
4362
|
-
return
|
|
4639
|
+
return m(this.suffix) ? ` - ${this.suffix}` : "";
|
|
4363
4640
|
}
|
|
4364
4641
|
}
|
|
4365
|
-
class
|
|
4642
|
+
class ut {
|
|
4366
4643
|
/**
|
|
4367
4644
|
* Checks whether to enable scroll hiding.
|
|
4368
4645
|
*
|
|
@@ -4381,19 +4658,35 @@ class ot {
|
|
|
4381
4658
|
var e;
|
|
4382
4659
|
const t = (e = this.storage.get()) != null ? e : -1;
|
|
4383
4660
|
if (!this.calculate && t === -1) {
|
|
4384
|
-
const
|
|
4385
|
-
return this.storage.set(
|
|
4661
|
+
const i = await this.init();
|
|
4662
|
+
return this.storage.set(i), i;
|
|
4386
4663
|
}
|
|
4387
4664
|
return t;
|
|
4388
4665
|
}
|
|
4666
|
+
/**
|
|
4667
|
+
* Returns the storage.
|
|
4668
|
+
*
|
|
4669
|
+
* Возвращает хранилище.
|
|
4670
|
+
*/
|
|
4671
|
+
static getStorage() {
|
|
4672
|
+
return this.storage;
|
|
4673
|
+
}
|
|
4674
|
+
/**
|
|
4675
|
+
* Returns the calculate flag.
|
|
4676
|
+
*
|
|
4677
|
+
* Возвращает флаг вычисления.
|
|
4678
|
+
*/
|
|
4679
|
+
static getCalculate() {
|
|
4680
|
+
return this.calculate;
|
|
4681
|
+
}
|
|
4389
4682
|
/**
|
|
4390
4683
|
* Creates elements to check the width of the scroll.
|
|
4391
4684
|
*
|
|
4392
4685
|
* Создает элементы для проверки ширины скролла.
|
|
4393
4686
|
*/
|
|
4394
4687
|
static createElement() {
|
|
4395
|
-
return
|
|
4396
|
-
t.style.height = "24px", t.style.overflowY = "scroll", t.style.position = "fixed", t.style.width = "100%",
|
|
4688
|
+
return G(document.body, "div", (t) => {
|
|
4689
|
+
t.style.height = "24px", t.style.overflowY = "scroll", t.style.position = "fixed", t.style.width = "100%", G(t, "div", (e) => {
|
|
4397
4690
|
e.style.height = "100px";
|
|
4398
4691
|
});
|
|
4399
4692
|
});
|
|
@@ -4413,8 +4706,562 @@ class ot {
|
|
|
4413
4706
|
});
|
|
4414
4707
|
}
|
|
4415
4708
|
}
|
|
4416
|
-
c(
|
|
4417
|
-
|
|
4709
|
+
c(ut, "storage", new et("scrollbar", !0)), c(ut, "calculate", !1);
|
|
4710
|
+
function ft(s) {
|
|
4711
|
+
return s.replace(/([[\]\\^$.?*+(){}/|])/g, "\\$1");
|
|
4712
|
+
}
|
|
4713
|
+
function ye(s) {
|
|
4714
|
+
const t = d(
|
|
4715
|
+
s.split(" "),
|
|
4716
|
+
(e) => ft(e)
|
|
4717
|
+
).join("|");
|
|
4718
|
+
return new RegExp(`(${t})`, "ig");
|
|
4719
|
+
}
|
|
4720
|
+
function $e(s, t, e = "sys-highlight-match") {
|
|
4721
|
+
return t ? String(s).replace(
|
|
4722
|
+
ye(t),
|
|
4723
|
+
`<span class="${e}">$1</span>`
|
|
4724
|
+
) : s;
|
|
4725
|
+
}
|
|
4726
|
+
class pe {
|
|
4727
|
+
/**
|
|
4728
|
+
* Constructor for SearchListData.
|
|
4729
|
+
*
|
|
4730
|
+
* Конструктор для SearchListData.
|
|
4731
|
+
* @param list original list of items/ исходный список элементов
|
|
4732
|
+
* @param columns columns to search in/ столбцы для поиска
|
|
4733
|
+
* @param item current search item state/ текущее состояние элемента поиска
|
|
4734
|
+
* @param options search options/ опции поиска
|
|
4735
|
+
*/
|
|
4736
|
+
constructor(t, e, i, r) {
|
|
4737
|
+
c(this, "listCache");
|
|
4738
|
+
this.list = t, this.columns = e, this.item = i, this.options = r;
|
|
4739
|
+
}
|
|
4740
|
+
/**
|
|
4741
|
+
* Checks if both list and columns are provided.
|
|
4742
|
+
*
|
|
4743
|
+
* Проверяет, предоставлены ли и список, и столбцы.
|
|
4744
|
+
* @returns boolean indicating if ready for column-based search/ логическое значение, указывающее на готовность к поиску по столбцам
|
|
4745
|
+
*/
|
|
4746
|
+
is() {
|
|
4747
|
+
return !!(this.list && this.columns);
|
|
4748
|
+
}
|
|
4749
|
+
/**
|
|
4750
|
+
* Checks if the list is provided.
|
|
4751
|
+
*
|
|
4752
|
+
* Проверяет, предоставлен ли список.
|
|
4753
|
+
* @returns boolean/ логическое значение
|
|
4754
|
+
*/
|
|
4755
|
+
isList() {
|
|
4756
|
+
return !!this.list;
|
|
4757
|
+
}
|
|
4758
|
+
/**
|
|
4759
|
+
* Returns the original list.
|
|
4760
|
+
*
|
|
4761
|
+
* Возвращает исходный список.
|
|
4762
|
+
* @returns list value/ значение списка
|
|
4763
|
+
*/
|
|
4764
|
+
getList() {
|
|
4765
|
+
return this.list;
|
|
4766
|
+
}
|
|
4767
|
+
/**
|
|
4768
|
+
* Returns the search columns.
|
|
4769
|
+
*
|
|
4770
|
+
* Возвращает столбцы поиска.
|
|
4771
|
+
* @returns columns or undefined/ столбцы или undefined
|
|
4772
|
+
*/
|
|
4773
|
+
getColumns() {
|
|
4774
|
+
return this.columns;
|
|
4775
|
+
}
|
|
4776
|
+
/**
|
|
4777
|
+
* Gets the search cache, initializing it if necessary.
|
|
4778
|
+
*
|
|
4779
|
+
* Получает кэш поиска, инициализируя его при необходимости.
|
|
4780
|
+
* @returns search cache/ кэш поиска
|
|
4781
|
+
*/
|
|
4782
|
+
getCache() {
|
|
4783
|
+
var t;
|
|
4784
|
+
return this.listCache || this.initCache(), (t = this.listCache) != null ? t : [];
|
|
4785
|
+
}
|
|
4786
|
+
/**
|
|
4787
|
+
* Sets a new list and regenerates the cache.
|
|
4788
|
+
*
|
|
4789
|
+
* Устанавливает новый список и регенерирует кэш.
|
|
4790
|
+
* @param list new list/ новый список
|
|
4791
|
+
* @returns this instance/ данный экземпляр
|
|
4792
|
+
*/
|
|
4793
|
+
setList(t) {
|
|
4794
|
+
return this.list = t, this.resetCache(), this;
|
|
4795
|
+
}
|
|
4796
|
+
/**
|
|
4797
|
+
* Sets new search columns and regenerates the cache.
|
|
4798
|
+
*
|
|
4799
|
+
* Устанавливает новые столбцы поиска и регенерирует кэш.
|
|
4800
|
+
* @param columns new columns/ новые столбцы
|
|
4801
|
+
* @returns this instance/ данный экземпляр
|
|
4802
|
+
*/
|
|
4803
|
+
setColumns(t) {
|
|
4804
|
+
return this.columns = t, this.resetCache(), this;
|
|
4805
|
+
}
|
|
4806
|
+
/**
|
|
4807
|
+
* Finds a cached item corresponding to the given original item.
|
|
4808
|
+
*
|
|
4809
|
+
* Находит кэшированный элемент, соответствующий данному исходному элементу.
|
|
4810
|
+
* @param item original item/ исходный элемент
|
|
4811
|
+
* @returns cache item or undefined/ кэшированный элемент или undefined
|
|
4812
|
+
*/
|
|
4813
|
+
findCacheItem(t) {
|
|
4814
|
+
return this.getCache().find((e) => e.item === t);
|
|
4815
|
+
}
|
|
4816
|
+
/**
|
|
4817
|
+
* Iterates over the cached list and executes a callback for each item.
|
|
4818
|
+
*
|
|
4819
|
+
* Перебирает кэшированный список и выполняет обратный вызов для каждого элемента.
|
|
4820
|
+
* @param callback function to execute for each item/ функция для выполнения для каждого элемента
|
|
4821
|
+
* @returns formatted list/ отформатированный список
|
|
4822
|
+
*/
|
|
4823
|
+
forEach(t) {
|
|
4824
|
+
const e = [];
|
|
4825
|
+
return this.isList() && this.getCache().forEach((i) => {
|
|
4826
|
+
const r = t(
|
|
4827
|
+
i.item,
|
|
4828
|
+
i.value
|
|
4829
|
+
);
|
|
4830
|
+
r && e.push(r);
|
|
4831
|
+
}), e;
|
|
4832
|
+
}
|
|
4833
|
+
/**
|
|
4834
|
+
* Converts a single item to a formatted item with highlighted matches if selected.
|
|
4835
|
+
*
|
|
4836
|
+
* Преобразует один элемент в отформатированный элемент с выделенными совпадениями, если он выбран.
|
|
4837
|
+
* @param item original item/ исходный элемент
|
|
4838
|
+
* @param selection whether the item matches the search and should be highlighted/ совпадает ли элемент с поиском и должен ли он быть выделен
|
|
4839
|
+
* @returns formatted item/ отформатированный элемент
|
|
4840
|
+
*/
|
|
4841
|
+
toFormatItem(t, e) {
|
|
4842
|
+
const i = {};
|
|
4843
|
+
return this.columns && this.columns.forEach((r) => {
|
|
4844
|
+
const a = this.getColumnName(r), o = x(t, r);
|
|
4845
|
+
i[a] = m(o) && e ? this.addTag(o) : T(o);
|
|
4846
|
+
}), {
|
|
4847
|
+
...t,
|
|
4848
|
+
...i,
|
|
4849
|
+
searchActive: e
|
|
4850
|
+
};
|
|
4851
|
+
}
|
|
4852
|
+
/**
|
|
4853
|
+
* Formats a column path to a camelCase property name with a 'Search' suffix.
|
|
4854
|
+
*
|
|
4855
|
+
* Форматирует путь к столбцу в имя свойства camelCase с суффиксом 'Search'.
|
|
4856
|
+
* @param column column path/ путь к столбцу
|
|
4857
|
+
* @returns property name/ имя свойства
|
|
4858
|
+
*/
|
|
4859
|
+
getColumnName(t) {
|
|
4860
|
+
return t.replace(
|
|
4861
|
+
/\.([a-z0-9])/ig,
|
|
4862
|
+
(e, i) => i.toUpperCase()
|
|
4863
|
+
) + "Search";
|
|
4864
|
+
}
|
|
4865
|
+
/**
|
|
4866
|
+
* Adds highlight tags to the given value based on the current search value.
|
|
4867
|
+
*
|
|
4868
|
+
* Добавляет теги выделения к данному значению на основе текущего значения поиска.
|
|
4869
|
+
* @param value value to highlight/ значение для выделения
|
|
4870
|
+
* @returns highlighted string/ выделенная строка
|
|
4871
|
+
*/
|
|
4872
|
+
addTag(t) {
|
|
4873
|
+
return $e(
|
|
4874
|
+
T(t),
|
|
4875
|
+
this.item.get(),
|
|
4876
|
+
this.options.getClassName()
|
|
4877
|
+
);
|
|
4878
|
+
}
|
|
4879
|
+
/**
|
|
4880
|
+
* Generates a search cache for the current list and columns.
|
|
4881
|
+
*
|
|
4882
|
+
* Генерирует кэш поиска для текущего списка и столбцов.
|
|
4883
|
+
* @returns search cache/ кэш поиска
|
|
4884
|
+
*/
|
|
4885
|
+
generateCache() {
|
|
4886
|
+
if (!this.isList())
|
|
4887
|
+
return [];
|
|
4888
|
+
const t = [];
|
|
4889
|
+
for (const e of this.list) {
|
|
4890
|
+
let i = "";
|
|
4891
|
+
if (this.columns)
|
|
4892
|
+
for (const r of this.columns) {
|
|
4893
|
+
const a = x(e, r);
|
|
4894
|
+
m(a) && (i += ` ${T(a)}`);
|
|
4895
|
+
}
|
|
4896
|
+
t.push({
|
|
4897
|
+
item: e,
|
|
4898
|
+
value: i
|
|
4899
|
+
});
|
|
4900
|
+
}
|
|
4901
|
+
return t;
|
|
4902
|
+
}
|
|
4903
|
+
/**
|
|
4904
|
+
* Initializes the search cache.
|
|
4905
|
+
*
|
|
4906
|
+
* Инициализирует кэш поиска.
|
|
4907
|
+
*/
|
|
4908
|
+
initCache() {
|
|
4909
|
+
this.listCache = this.generateCache();
|
|
4910
|
+
}
|
|
4911
|
+
/**
|
|
4912
|
+
* Resets the search cache.
|
|
4913
|
+
*
|
|
4914
|
+
* Сбрасывает кэш поиска.
|
|
4915
|
+
*/
|
|
4916
|
+
resetCache() {
|
|
4917
|
+
this.listCache = void 0;
|
|
4918
|
+
}
|
|
4919
|
+
}
|
|
4920
|
+
class be {
|
|
4921
|
+
/**
|
|
4922
|
+
* Constructor for SearchListItem.
|
|
4923
|
+
*
|
|
4924
|
+
* Конструктор для SearchListItem.
|
|
4925
|
+
* @param value current search value/ текущее значение поиска
|
|
4926
|
+
* @param options search options/ опции поиска
|
|
4927
|
+
*/
|
|
4928
|
+
constructor(t, e) {
|
|
4929
|
+
this.value = t, this.options = e;
|
|
4930
|
+
}
|
|
4931
|
+
/**
|
|
4932
|
+
* Checks if the value is filled.
|
|
4933
|
+
*
|
|
4934
|
+
* Проверяет, заполнено ли значение.
|
|
4935
|
+
* @returns boolean indicating if value exists/ логическое значение, указывающее на наличие значения
|
|
4936
|
+
*/
|
|
4937
|
+
is() {
|
|
4938
|
+
return !!this.value;
|
|
4939
|
+
}
|
|
4940
|
+
/**
|
|
4941
|
+
* Checks if a search should be performed based on the current value and options.
|
|
4942
|
+
*
|
|
4943
|
+
* Проверяет, следует ли выполнять поиск на основе текущего значения и опций.
|
|
4944
|
+
* @returns boolean/ логическое значение
|
|
4945
|
+
*/
|
|
4946
|
+
isSearch() {
|
|
4947
|
+
return this.is() && this.value.length >= this.options.getLimit();
|
|
4948
|
+
}
|
|
4949
|
+
/**
|
|
4950
|
+
* Returns the current search value as a string.
|
|
4951
|
+
*
|
|
4952
|
+
* Возвращает текущее значение поиска в виде строки.
|
|
4953
|
+
* @returns search value/ значение поиска
|
|
4954
|
+
*/
|
|
4955
|
+
get() {
|
|
4956
|
+
var t;
|
|
4957
|
+
return (t = this.value) != null ? t : "";
|
|
4958
|
+
}
|
|
4959
|
+
/**
|
|
4960
|
+
* Sets a new search value.
|
|
4961
|
+
*
|
|
4962
|
+
* Устанавливает новое значение поиска.
|
|
4963
|
+
* @param value new search value/ новое значение поиска
|
|
4964
|
+
* @returns this instance/ данный экземпляр
|
|
4965
|
+
*/
|
|
4966
|
+
set(t) {
|
|
4967
|
+
return this.value = t, this;
|
|
4968
|
+
}
|
|
4969
|
+
}
|
|
4970
|
+
function zt(s, t = "ig", e = ":value") {
|
|
4971
|
+
const i = ft(s);
|
|
4972
|
+
return new RegExp(e.replace(/:value/g, i), t);
|
|
4973
|
+
}
|
|
4974
|
+
function we(s) {
|
|
4975
|
+
return zt(s, "i", "(:value)");
|
|
4976
|
+
}
|
|
4977
|
+
function ve(s) {
|
|
4978
|
+
let t = "";
|
|
4979
|
+
return s.split(" ").forEach((e) => {
|
|
4980
|
+
const i = ft(e).trim();
|
|
4981
|
+
m(i) && (t += `(?=.*?${i})`);
|
|
4982
|
+
}), new RegExp(`^${t}`, "ig");
|
|
4983
|
+
}
|
|
4984
|
+
class Se {
|
|
4985
|
+
/**
|
|
4986
|
+
* Constructor for SearchListMatcher.
|
|
4987
|
+
*
|
|
4988
|
+
* Конструктор для SearchListMatcher.
|
|
4989
|
+
* @param item search item containing the current value/ элемент поиска, содержащий текущее значение
|
|
4990
|
+
* @param options search options/ опции поиска
|
|
4991
|
+
*/
|
|
4992
|
+
constructor(t, e) {
|
|
4993
|
+
c(this, "matcher");
|
|
4994
|
+
this.item = t, this.options = e, this.initMatcher();
|
|
4995
|
+
}
|
|
4996
|
+
/**
|
|
4997
|
+
* Checks if the matcher is initialized.
|
|
4998
|
+
*
|
|
4999
|
+
* Проверяет, инициализирован ли сопоставитель.
|
|
5000
|
+
* @returns boolean/ логическое значение
|
|
5001
|
+
*/
|
|
5002
|
+
is() {
|
|
5003
|
+
return !!this.matcher;
|
|
5004
|
+
}
|
|
5005
|
+
/**
|
|
5006
|
+
* Checks if the given value matches the current search expression.
|
|
5007
|
+
*
|
|
5008
|
+
* Проверяет, соответствует ли данное значение текущему поисковому выражению.
|
|
5009
|
+
* @param value value to check/ проверяемое значение
|
|
5010
|
+
* @returns boolean indicating a match/ логическое значение, указывающее на совпадение
|
|
5011
|
+
*/
|
|
5012
|
+
isSelection(t) {
|
|
5013
|
+
return this.matcher ? this.matcher.test(t) : !1;
|
|
5014
|
+
}
|
|
5015
|
+
/**
|
|
5016
|
+
* Returns the current regular expression matcher.
|
|
5017
|
+
*
|
|
5018
|
+
* Возвращает текущий сопоставитель регулярных выражений.
|
|
5019
|
+
* @returns RegExp or undefined/ RegExp или undefined
|
|
5020
|
+
*/
|
|
5021
|
+
get() {
|
|
5022
|
+
return this.matcher;
|
|
5023
|
+
}
|
|
5024
|
+
/**
|
|
5025
|
+
* Updates the matcher based on the current item value and options.
|
|
5026
|
+
*
|
|
5027
|
+
* Обновляет сопоставитель на основе текущего значения элемента и опций.
|
|
5028
|
+
*/
|
|
5029
|
+
update() {
|
|
5030
|
+
this.initMatcher();
|
|
5031
|
+
}
|
|
5032
|
+
/**
|
|
5033
|
+
* Initializes or resets the regular expression matcher.
|
|
5034
|
+
*
|
|
5035
|
+
* Инициализирует или сбрасывает сопоставитель регулярных выражений.
|
|
5036
|
+
*/
|
|
5037
|
+
initMatcher() {
|
|
5038
|
+
this.item.is() ? this.matcher = this.options.getFindExactMatch() ? we(this.item.get()) : ve(this.item.get()) : this.matcher = void 0;
|
|
5039
|
+
}
|
|
5040
|
+
}
|
|
5041
|
+
class Le {
|
|
5042
|
+
/**
|
|
5043
|
+
* Constructor for SearchListOptions.
|
|
5044
|
+
*
|
|
5045
|
+
* Конструктор для SearchListOptions.
|
|
5046
|
+
* @param options search options/ опции поиска
|
|
5047
|
+
*/
|
|
5048
|
+
constructor(t) {
|
|
5049
|
+
this.options = t;
|
|
5050
|
+
}
|
|
5051
|
+
/**
|
|
5052
|
+
* Returns the current search options.
|
|
5053
|
+
*
|
|
5054
|
+
* Возвращает текущие опции поиска.
|
|
5055
|
+
* @returns search options/ опции поиска
|
|
5056
|
+
*/
|
|
5057
|
+
getOptions() {
|
|
5058
|
+
return this.options || {};
|
|
5059
|
+
}
|
|
5060
|
+
/**
|
|
5061
|
+
* Returns the minimum number of characters required to trigger a search.
|
|
5062
|
+
*
|
|
5063
|
+
* Возвращает минимальное количество символов, необходимых для запуска поиска.
|
|
5064
|
+
* @returns limit value/ значение лимита
|
|
5065
|
+
*/
|
|
5066
|
+
getLimit() {
|
|
5067
|
+
var t;
|
|
5068
|
+
return (t = this.getOptions().limit) != null ? t : 2;
|
|
5069
|
+
}
|
|
5070
|
+
/**
|
|
5071
|
+
* Returns whether to return all items even if they don't match the search query.
|
|
5072
|
+
*
|
|
5073
|
+
* Возвращает, следует ли возвращать все элементы, даже если они не соответствуют поисковому запросу.
|
|
5074
|
+
* @returns boolean value/ логическое значение
|
|
5075
|
+
*/
|
|
5076
|
+
getReturnEverything() {
|
|
5077
|
+
var t;
|
|
5078
|
+
return (t = this.getOptions().returnEverything) != null ? t : !1;
|
|
5079
|
+
}
|
|
5080
|
+
/**
|
|
5081
|
+
* Returns the search delay in milliseconds.
|
|
5082
|
+
*
|
|
5083
|
+
* Возвращает задержку поиска в миллисекундах.
|
|
5084
|
+
* @returns delay value/ значение задержки
|
|
5085
|
+
*/
|
|
5086
|
+
getDelay() {
|
|
5087
|
+
var t;
|
|
5088
|
+
return (t = this.getOptions().delay) != null ? t : 0;
|
|
5089
|
+
}
|
|
5090
|
+
/**
|
|
5091
|
+
* Returns whether to perform an exact match search.
|
|
5092
|
+
*
|
|
5093
|
+
* Возвращает, следует ли выполнять поиск с точным совпадением.
|
|
5094
|
+
* @returns boolean value/ логическое значение
|
|
5095
|
+
*/
|
|
5096
|
+
getFindExactMatch() {
|
|
5097
|
+
var t;
|
|
5098
|
+
return (t = this.getOptions().findExactMatch) != null ? t : !1;
|
|
5099
|
+
}
|
|
5100
|
+
/**
|
|
5101
|
+
* Returns the CSS class name used for highlighting matches.
|
|
5102
|
+
*
|
|
5103
|
+
* Возвращает имя класса CSS, используемое для выделения совпадений.
|
|
5104
|
+
* @returns class name/ имя класса
|
|
5105
|
+
*/
|
|
5106
|
+
getClassName() {
|
|
5107
|
+
var t;
|
|
5108
|
+
return (t = this.getOptions().classSearchName) != null ? t : "sys-search-selection";
|
|
5109
|
+
}
|
|
5110
|
+
/**
|
|
5111
|
+
* Sets new search options.
|
|
5112
|
+
*
|
|
5113
|
+
* Устанавливает новые опции поиска.
|
|
5114
|
+
* @param options search options/ опции поиска
|
|
5115
|
+
* @returns this instance/ данный экземпляр
|
|
5116
|
+
*/
|
|
5117
|
+
setOptions(t) {
|
|
5118
|
+
return this.options = t, this;
|
|
5119
|
+
}
|
|
5120
|
+
}
|
|
5121
|
+
class Ke {
|
|
5122
|
+
/**
|
|
5123
|
+
* Constructor for SearchList.
|
|
5124
|
+
*
|
|
5125
|
+
* Конструктор для SearchList.
|
|
5126
|
+
* @param list initial list of items/ исходный список элементов
|
|
5127
|
+
* @param columns columns to perform search on/ столбцы для выполнения поиска
|
|
5128
|
+
* @param value initial search value/ начальное значение поиска
|
|
5129
|
+
* @param options search options/ опции поиска
|
|
5130
|
+
*/
|
|
5131
|
+
constructor(t, e, i, r) {
|
|
5132
|
+
c(this, "options");
|
|
5133
|
+
c(this, "item");
|
|
5134
|
+
c(this, "matcher");
|
|
5135
|
+
c(this, "data");
|
|
5136
|
+
/**
|
|
5137
|
+
* Callback for processing items when a search is active.
|
|
5138
|
+
* Checks for selection and handles "return everything" option.
|
|
5139
|
+
*
|
|
5140
|
+
* Обратный вызов для обработки элементов при активном поиске.
|
|
5141
|
+
* Проверяет выбор и обрабатывает опцию "возвращать всё".
|
|
5142
|
+
*/
|
|
5143
|
+
c(this, "callbackToSelection", (t, e) => {
|
|
5144
|
+
if (this.matcher.isSelection(e))
|
|
5145
|
+
return this.data.toFormatItem(t, !0);
|
|
5146
|
+
if (this.options.getReturnEverything())
|
|
5147
|
+
return this.data.toFormatItem(t, !1);
|
|
5148
|
+
});
|
|
5149
|
+
/**
|
|
5150
|
+
* Callback for processing items when no search is active.
|
|
5151
|
+
*
|
|
5152
|
+
* Обратный вызов для обработки элементов, когда поиск не активен.
|
|
5153
|
+
*/
|
|
5154
|
+
c(this, "callbackToNone", (t) => this.data.toFormatItem(t, !1));
|
|
5155
|
+
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);
|
|
5156
|
+
}
|
|
5157
|
+
/**
|
|
5158
|
+
* Returns the search data management instance.
|
|
5159
|
+
*
|
|
5160
|
+
* Возвращает экземпляр управления данными поиска.
|
|
5161
|
+
* @returns SearchListData instance/ экземпляр SearchListData
|
|
5162
|
+
*/
|
|
5163
|
+
getData() {
|
|
5164
|
+
return this.data;
|
|
5165
|
+
}
|
|
5166
|
+
/**
|
|
5167
|
+
* Returns the current list of items.
|
|
5168
|
+
*
|
|
5169
|
+
* Возвращает текущий список элементов.
|
|
5170
|
+
* @returns list of items/ список элементов
|
|
5171
|
+
*/
|
|
5172
|
+
getList() {
|
|
5173
|
+
return this.data.getList();
|
|
5174
|
+
}
|
|
5175
|
+
/**
|
|
5176
|
+
* Returns the current search columns.
|
|
5177
|
+
*
|
|
5178
|
+
* Возвращает текущие столбцы поиска.
|
|
5179
|
+
* @returns columns or undefined/ столбцы или undefined
|
|
5180
|
+
*/
|
|
5181
|
+
getColumns() {
|
|
5182
|
+
return this.data.getColumns();
|
|
5183
|
+
}
|
|
5184
|
+
/**
|
|
5185
|
+
* Returns the search item instance.
|
|
5186
|
+
*
|
|
5187
|
+
* Возвращает экземпляр элемента поиска.
|
|
5188
|
+
* @returns SearchListItem instance/ экземпляр SearchListItem
|
|
5189
|
+
*/
|
|
5190
|
+
getItem() {
|
|
5191
|
+
return this.item;
|
|
5192
|
+
}
|
|
5193
|
+
/**
|
|
5194
|
+
* Returns the current search value.
|
|
5195
|
+
*
|
|
5196
|
+
* Возвращает текущее значение поиска.
|
|
5197
|
+
* @returns search value string or undefined/ строка значения поиска или undefined
|
|
5198
|
+
*/
|
|
5199
|
+
getValue() {
|
|
5200
|
+
return this.item.get();
|
|
5201
|
+
}
|
|
5202
|
+
/**
|
|
5203
|
+
* Returns the search options instance.
|
|
5204
|
+
*
|
|
5205
|
+
* Возвращает экземпляр опций поиска.
|
|
5206
|
+
* @returns SearchListOptions instance/ экземпляр SearchListOptions
|
|
5207
|
+
*/
|
|
5208
|
+
getOptions() {
|
|
5209
|
+
return this.options;
|
|
5210
|
+
}
|
|
5211
|
+
/**
|
|
5212
|
+
* Sets a new list of items.
|
|
5213
|
+
*
|
|
5214
|
+
* Устанавливает новый список элементов.
|
|
5215
|
+
* @param list new list/ новый список
|
|
5216
|
+
* @returns this instance/ данный экземпляр
|
|
5217
|
+
*/
|
|
5218
|
+
setList(t) {
|
|
5219
|
+
return this.data.setList(t), this;
|
|
5220
|
+
}
|
|
5221
|
+
/**
|
|
5222
|
+
* Sets new search columns.
|
|
5223
|
+
*
|
|
5224
|
+
* Устанавливает новые столбцы поиска.
|
|
5225
|
+
* @param columns new columns/ новые столбцы
|
|
5226
|
+
* @returns this instance/ данный экземпляр
|
|
5227
|
+
*/
|
|
5228
|
+
setColumns(t) {
|
|
5229
|
+
return this.data.setColumns(t), this;
|
|
5230
|
+
}
|
|
5231
|
+
/**
|
|
5232
|
+
* Sets a new search value and updates the matcher.
|
|
5233
|
+
*
|
|
5234
|
+
* Устанавливает новое значение поиска и обновляет сопоставитель.
|
|
5235
|
+
* @param value new search value/ новое значение поиска
|
|
5236
|
+
* @returns this instance/ данный экземпляр
|
|
5237
|
+
*/
|
|
5238
|
+
setValue(t) {
|
|
5239
|
+
return this.item.set(t), this.matcher.update(), this;
|
|
5240
|
+
}
|
|
5241
|
+
/**
|
|
5242
|
+
* Sets new search options and updates the matcher.
|
|
5243
|
+
*
|
|
5244
|
+
* Устанавливает новые опции поиска и обновляет сопоставитель.
|
|
5245
|
+
* @param options new options/ новые опции
|
|
5246
|
+
* @returns this instance/ данный экземпляр
|
|
5247
|
+
*/
|
|
5248
|
+
setOptions(t) {
|
|
5249
|
+
return this.options.setOptions(t), this.matcher.update(), this;
|
|
5250
|
+
}
|
|
5251
|
+
/**
|
|
5252
|
+
* Processes the list and returns a formatted list of items based on the current search state.
|
|
5253
|
+
*
|
|
5254
|
+
* Обрабатывает список и возвращает отформатированный список элементов на основе текущего состояния поиска.
|
|
5255
|
+
* @returns formatted list of items/ отформатированный список элементов
|
|
5256
|
+
*/
|
|
5257
|
+
to() {
|
|
5258
|
+
if (this.item.isSearch())
|
|
5259
|
+
return this.data.forEach(this.callbackToSelection);
|
|
5260
|
+
const t = this.data.getList();
|
|
5261
|
+
return t ? d(t, this.callbackToNone) : [];
|
|
5262
|
+
}
|
|
5263
|
+
}
|
|
5264
|
+
const Ce = [
|
|
4418
5265
|
"d",
|
|
4419
5266
|
"e",
|
|
4420
5267
|
"f",
|
|
@@ -4434,21 +5281,21 @@ const he = [
|
|
|
4434
5281
|
"t",
|
|
4435
5282
|
"u",
|
|
4436
5283
|
"v"
|
|
4437
|
-
],
|
|
4438
|
-
let e = String(
|
|
4439
|
-
if (
|
|
4440
|
-
let
|
|
5284
|
+
], De = (s, t = {}) => {
|
|
5285
|
+
let e = String(s);
|
|
5286
|
+
if (s.match(/%[a-z]/)) {
|
|
5287
|
+
let i = 0;
|
|
4441
5288
|
d(t, (r) => {
|
|
4442
|
-
e = e.replace(new RegExp(`%${
|
|
5289
|
+
e = e.replace(new RegExp(`%${Ce[i++]}`, "g"), String(r));
|
|
4443
5290
|
});
|
|
4444
5291
|
}
|
|
4445
|
-
return A(t) && d(t, (
|
|
5292
|
+
return A(t) && d(t, (i, r) => {
|
|
4446
5293
|
e = e.replace(
|
|
4447
5294
|
new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})(.*?)(?:\\[|\\{)\\/${r}(?:\\]|\\})`, "g"),
|
|
4448
|
-
(
|
|
4449
|
-
).replace(new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})`, "g"), String(
|
|
5295
|
+
(a, o) => String(i).replace(/(?:\[|\{)content(?:\]|\})/g, o)
|
|
5296
|
+
).replace(new RegExp(`(?:\\[|\\{)${r}(?:\\]|\\})`, "g"), String(i));
|
|
4450
5297
|
}), e;
|
|
4451
|
-
},
|
|
5298
|
+
}, ke = "global", I = class I {
|
|
4452
5299
|
/**
|
|
4453
5300
|
* Getting the translation text by its code.
|
|
4454
5301
|
*
|
|
@@ -4458,8 +5305,8 @@ const he = [
|
|
|
4458
5305
|
*/
|
|
4459
5306
|
static async get(t, e) {
|
|
4460
5307
|
var r;
|
|
4461
|
-
const
|
|
4462
|
-
return
|
|
5308
|
+
const i = this.getText(t);
|
|
5309
|
+
return i ? this.replacement(i, e) : (K.isLocalhost() || await this.add(t), this.replacement((r = this.getText(t)) != null ? r : t));
|
|
4463
5310
|
}
|
|
4464
5311
|
/**
|
|
4465
5312
|
* Getting the translation text by its code (Sync).
|
|
@@ -4471,9 +5318,9 @@ const he = [
|
|
|
4471
5318
|
* @param replacement If set, replaces the text with the specified values/
|
|
4472
5319
|
* если установлено, заменяет текст на указанные значения
|
|
4473
5320
|
*/
|
|
4474
|
-
static getSync(t, e = !1,
|
|
5321
|
+
static getSync(t, e = !1, i) {
|
|
4475
5322
|
const r = this.getText(t);
|
|
4476
|
-
return r ? this.replacement(r,
|
|
5323
|
+
return r ? this.replacement(r, i) : e ? " " : t;
|
|
4477
5324
|
}
|
|
4478
5325
|
/**
|
|
4479
5326
|
* Getting a list of translations by an array of text codes.
|
|
@@ -4483,12 +5330,12 @@ const he = [
|
|
|
4483
5330
|
*/
|
|
4484
5331
|
static getList(t) {
|
|
4485
5332
|
return new Promise((e) => {
|
|
4486
|
-
const
|
|
5333
|
+
const i = {};
|
|
4487
5334
|
let r = 0;
|
|
4488
|
-
for (const
|
|
4489
|
-
const
|
|
4490
|
-
this.get(
|
|
4491
|
-
|
|
5335
|
+
for (const a of t) {
|
|
5336
|
+
const o = Array.isArray(a) ? a[0] : a, u = Array.isArray(a) ? a.slice(1) : void 0;
|
|
5337
|
+
this.get(o, u).then((h) => {
|
|
5338
|
+
i[o] = h, ++r >= t.length && e(i);
|
|
4492
5339
|
});
|
|
4493
5340
|
}
|
|
4494
5341
|
});
|
|
@@ -4502,12 +5349,12 @@ const he = [
|
|
|
4502
5349
|
* если установлено false, возвращает пустую строку, если нет текста
|
|
4503
5350
|
*/
|
|
4504
5351
|
static getListSync(t, e = !1) {
|
|
4505
|
-
const
|
|
5352
|
+
const i = {};
|
|
4506
5353
|
for (const r of t) {
|
|
4507
|
-
const
|
|
4508
|
-
|
|
5354
|
+
const a = Array.isArray(r) ? r[0] : r, o = Array.isArray(r) ? r.slice(1) : void 0;
|
|
5355
|
+
i[a] = this.getSync(a, e, o);
|
|
4509
5356
|
}
|
|
4510
|
-
return
|
|
5357
|
+
return i;
|
|
4511
5358
|
}
|
|
4512
5359
|
/**
|
|
4513
5360
|
* Added a list of translated texts.
|
|
@@ -4531,8 +5378,8 @@ const he = [
|
|
|
4531
5378
|
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4532
5379
|
*/
|
|
4533
5380
|
static addSync(t) {
|
|
4534
|
-
d(t, (e,
|
|
4535
|
-
|
|
5381
|
+
d(t, (e, i) => {
|
|
5382
|
+
U(e) && m(e) && (this.data[this.getName(i)] = e);
|
|
4536
5383
|
});
|
|
4537
5384
|
}
|
|
4538
5385
|
/**
|
|
@@ -4542,8 +5389,8 @@ const he = [
|
|
|
4542
5389
|
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4543
5390
|
*/
|
|
4544
5391
|
static async addNormalOrSync(t) {
|
|
4545
|
-
if (
|
|
4546
|
-
if (
|
|
5392
|
+
if (m(t))
|
|
5393
|
+
if (K.isLocalhost())
|
|
4547
5394
|
this.addSync(t);
|
|
4548
5395
|
else {
|
|
4549
5396
|
const e = Object.keys(t);
|
|
@@ -4559,9 +5406,9 @@ const he = [
|
|
|
4559
5406
|
static addSyncByLocation(t) {
|
|
4560
5407
|
d(
|
|
4561
5408
|
t,
|
|
4562
|
-
(e,
|
|
4563
|
-
const
|
|
4564
|
-
|
|
5409
|
+
(e, i) => d(e, (r, a) => {
|
|
5410
|
+
const o = `${i}-${a}`;
|
|
5411
|
+
o in this.data || (this.data[o] = r);
|
|
4565
5412
|
})
|
|
4566
5413
|
);
|
|
4567
5414
|
}
|
|
@@ -4572,7 +5419,7 @@ const he = [
|
|
|
4572
5419
|
* @param url path to the script/ путь к скрипту
|
|
4573
5420
|
*/
|
|
4574
5421
|
static setUrl(t) {
|
|
4575
|
-
return this.url = t,
|
|
5422
|
+
return this.url = t, I;
|
|
4576
5423
|
}
|
|
4577
5424
|
static setPropsName(t) {
|
|
4578
5425
|
return this.propsName = t, this;
|
|
@@ -4596,9 +5443,9 @@ const he = [
|
|
|
4596
5443
|
const e = this.getName(t);
|
|
4597
5444
|
if (e in this.data)
|
|
4598
5445
|
return this.data[e];
|
|
4599
|
-
const
|
|
4600
|
-
if (
|
|
4601
|
-
return this.data[
|
|
5446
|
+
const i = this.getNameByLanguage(t);
|
|
5447
|
+
if (i in this.data)
|
|
5448
|
+
return this.data[i];
|
|
4602
5449
|
const r = this.getNameByGlobal(t);
|
|
4603
5450
|
if (r in this.data)
|
|
4604
5451
|
return this.data[r];
|
|
@@ -4610,7 +5457,7 @@ const he = [
|
|
|
4610
5457
|
* @param name code name/ название кода
|
|
4611
5458
|
*/
|
|
4612
5459
|
static getName(t) {
|
|
4613
|
-
return `${
|
|
5460
|
+
return `${b.getLocation()}-${t}`;
|
|
4614
5461
|
}
|
|
4615
5462
|
/**
|
|
4616
5463
|
* Getting the title for translation by language.
|
|
@@ -4619,7 +5466,7 @@ const he = [
|
|
|
4619
5466
|
* @param name code name/ название кода
|
|
4620
5467
|
*/
|
|
4621
5468
|
static getNameByLanguage(t) {
|
|
4622
|
-
return `${
|
|
5469
|
+
return `${b.getLanguage()}-${t}`;
|
|
4623
5470
|
}
|
|
4624
5471
|
/**
|
|
4625
5472
|
* Getting the title for translation globally.
|
|
@@ -4628,7 +5475,7 @@ const he = [
|
|
|
4628
5475
|
* @param name code name/ название кода
|
|
4629
5476
|
*/
|
|
4630
5477
|
static getNameByGlobal(t) {
|
|
4631
|
-
return `${
|
|
5478
|
+
return `${ke}-${t}`;
|
|
4632
5479
|
}
|
|
4633
5480
|
/**
|
|
4634
5481
|
* Returns a list of names that are not yet in the list.
|
|
@@ -4638,8 +5485,8 @@ const he = [
|
|
|
4638
5485
|
*/
|
|
4639
5486
|
static getNamesNone(t) {
|
|
4640
5487
|
const e = [];
|
|
4641
|
-
return
|
|
4642
|
-
|
|
5488
|
+
return Y(t).forEach((i) => {
|
|
5489
|
+
i !== "__TRANSLATE_START__" && i !== "__TRANSLATE_END__" && !(this.getName(i) in this.data) && e.push(i);
|
|
4643
5490
|
}), e;
|
|
4644
5491
|
}
|
|
4645
5492
|
/**
|
|
@@ -4648,7 +5495,7 @@ const he = [
|
|
|
4648
5495
|
* Получение списка переводов с сервера.
|
|
4649
5496
|
*/
|
|
4650
5497
|
static async getResponse() {
|
|
4651
|
-
const t = await
|
|
5498
|
+
const t = await K.get({
|
|
4652
5499
|
api: !1,
|
|
4653
5500
|
path: this.url,
|
|
4654
5501
|
request: {
|
|
@@ -4667,7 +5514,7 @@ const he = [
|
|
|
4667
5514
|
* @param replacement values for replacement/ значения для замены
|
|
4668
5515
|
*/
|
|
4669
5516
|
static replacement(t, e) {
|
|
4670
|
-
return e ?
|
|
5517
|
+
return e ? De(t, e) : t;
|
|
4671
5518
|
}
|
|
4672
5519
|
/**
|
|
4673
5520
|
* Adding translation data from the server.
|
|
@@ -4677,504 +5524,476 @@ const he = [
|
|
|
4677
5524
|
static async make() {
|
|
4678
5525
|
const t = await this.getResponse();
|
|
4679
5526
|
this.cache.forEach((e) => {
|
|
4680
|
-
var
|
|
4681
|
-
this.data[this.getName(e)] = (
|
|
5527
|
+
var i;
|
|
5528
|
+
this.data[this.getName(e)] = (i = t == null ? void 0 : t[e]) != null ? i : "";
|
|
4682
5529
|
}), this.cache = [];
|
|
4683
5530
|
}
|
|
4684
5531
|
};
|
|
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);
|
|
5532
|
+
c(I, "url", "/api/translate"), c(I, "propsName", "list"), c(I, "data", {}), c(I, "cache", []), c(I, "resolveList", []), c(I, "timeout");
|
|
5533
|
+
let Bt = I;
|
|
5534
|
+
function Ne(s, t) {
|
|
5535
|
+
return Array(t).fill(s);
|
|
4693
5536
|
}
|
|
4694
|
-
function
|
|
5537
|
+
function Ye(s) {
|
|
4695
5538
|
return new Promise((t, e) => {
|
|
4696
|
-
const
|
|
4697
|
-
|
|
5539
|
+
const i = new FileReader();
|
|
5540
|
+
i.onloadend = () => t(i.result), i.onerror = e, i.readAsDataURL(s);
|
|
4698
5541
|
});
|
|
4699
5542
|
}
|
|
4700
|
-
function
|
|
5543
|
+
function qe(s) {
|
|
4701
5544
|
var t;
|
|
4702
5545
|
if (l())
|
|
4703
|
-
return (t = document.querySelector(
|
|
5546
|
+
return (t = document.querySelector(s)) != null ? t : void 0;
|
|
4704
5547
|
}
|
|
4705
|
-
function
|
|
5548
|
+
function Je(s) {
|
|
4706
5549
|
if (l())
|
|
4707
|
-
return document.querySelectorAll(
|
|
4708
|
-
}
|
|
4709
|
-
function Pt(i) {
|
|
4710
|
-
return i.replace(/([[\]\\^$.?*+(){}/|])/g, "\\$1");
|
|
5550
|
+
return document.querySelectorAll(s);
|
|
4711
5551
|
}
|
|
4712
|
-
function
|
|
4713
|
-
|
|
5552
|
+
function Me(s) {
|
|
5553
|
+
s.preventDefault(), s.stopPropagation();
|
|
4714
5554
|
}
|
|
4715
|
-
function
|
|
4716
|
-
const
|
|
4717
|
-
|
|
5555
|
+
function Ee(s, t, e) {
|
|
5556
|
+
const i = () => {
|
|
5557
|
+
s(), t != null && t() ? Ee(s, t, e) : e == null || e();
|
|
4718
5558
|
};
|
|
4719
|
-
l() ? requestAnimationFrame(
|
|
5559
|
+
l() ? requestAnimationFrame(i) : i();
|
|
4720
5560
|
}
|
|
4721
|
-
function
|
|
4722
|
-
var
|
|
4723
|
-
const t = {}, e =
|
|
5561
|
+
function Qe(s) {
|
|
5562
|
+
var i;
|
|
5563
|
+
const t = {}, e = E(s);
|
|
4724
5564
|
if (e)
|
|
4725
5565
|
for (const r of e.attributes)
|
|
4726
|
-
t[r.name] = (
|
|
5566
|
+
t[r.name] = (i = (r == null ? void 0 : r.value) || (r == null ? void 0 : r.textContent)) != null ? i : void 0;
|
|
4727
5567
|
return t;
|
|
4728
5568
|
}
|
|
4729
|
-
async function
|
|
5569
|
+
async function Xe(s) {
|
|
4730
5570
|
var t, e;
|
|
4731
|
-
return (e = (t =
|
|
5571
|
+
return (e = (t = s == null ? void 0 : s.clipboardData) == null ? void 0 : t.getData("text")) != null ? e : await navigator.clipboard.readText() || "";
|
|
4732
5572
|
}
|
|
4733
|
-
function
|
|
4734
|
-
return new
|
|
5573
|
+
function _e(s = "datetime") {
|
|
5574
|
+
return new gt(void 0, s).standard();
|
|
4735
5575
|
}
|
|
4736
|
-
let
|
|
4737
|
-
function
|
|
4738
|
-
const e =
|
|
4739
|
-
return e ? (
|
|
5576
|
+
let Ft = Q(1e5, 9e5);
|
|
5577
|
+
function Oe(s, t) {
|
|
5578
|
+
const e = E(s);
|
|
5579
|
+
return e ? (m(e.id) || e.setAttribute("id", `id-${Ft++}`), t ? `#${e.id}${t}`.trim() : e.id) : `id-${Ft++}`;
|
|
4740
5580
|
}
|
|
4741
|
-
function
|
|
4742
|
-
return
|
|
5581
|
+
function Ae(s) {
|
|
5582
|
+
return U(s) ? G(
|
|
4743
5583
|
void 0,
|
|
4744
5584
|
"img",
|
|
4745
|
-
{ src:
|
|
4746
|
-
) :
|
|
5585
|
+
{ src: s }
|
|
5586
|
+
) : s;
|
|
4747
5587
|
}
|
|
4748
|
-
function
|
|
4749
|
-
|
|
4750
|
-
return
|
|
5588
|
+
function Te(s) {
|
|
5589
|
+
var t, e, i;
|
|
5590
|
+
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();
|
|
4751
5591
|
}
|
|
4752
|
-
function
|
|
4753
|
-
|
|
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;
|
|
5592
|
+
function Zt(s) {
|
|
5593
|
+
return d(s, (t) => t.length);
|
|
4768
5594
|
}
|
|
4769
|
-
function
|
|
4770
|
-
|
|
4771
|
-
return (s = (t = i == null ? void 0 : i.key) != null ? t : i == null ? void 0 : i.code) != null ? s : (e = i == null ? void 0 : i.keyCode) == null ? void 0 : e.toString();
|
|
5595
|
+
function Ge(s) {
|
|
5596
|
+
return Math.max(...Zt(s));
|
|
4772
5597
|
}
|
|
4773
|
-
function
|
|
4774
|
-
return
|
|
5598
|
+
function ts(s) {
|
|
5599
|
+
return Math.min(...Zt(s));
|
|
4775
5600
|
}
|
|
4776
|
-
function
|
|
4777
|
-
|
|
5601
|
+
function Ie(s) {
|
|
5602
|
+
var t, e, i, r;
|
|
5603
|
+
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;
|
|
4778
5604
|
}
|
|
4779
|
-
function
|
|
4780
|
-
|
|
5605
|
+
function Be(s) {
|
|
5606
|
+
var t, e, i, r;
|
|
5607
|
+
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;
|
|
4781
5608
|
}
|
|
4782
|
-
function
|
|
4783
|
-
var t, e, s, r;
|
|
4784
|
-
return (i == null ? void 0 : i.clientX) || ((e = (t = i == null ? void 0 : i.targetTouches) == null ? void 0 : t[0]) == null ? void 0 : e.clientX) || ((r = (s = i == null ? void 0 : i.touches) == null ? void 0 : s[0]) == null ? void 0 : r.clientX) || 0;
|
|
4785
|
-
}
|
|
4786
|
-
function ve(i) {
|
|
4787
|
-
var t, e, s, r;
|
|
4788
|
-
return (i == null ? void 0 : i.clientY) || ((e = (t = i == null ? void 0 : i.targetTouches) == null ? void 0 : t[0]) == null ? void 0 : e.clientY) || ((r = (s = i == null ? void 0 : i.touches) == null ? void 0 : s[0]) == null ? void 0 : r.clientY) || 0;
|
|
4789
|
-
}
|
|
4790
|
-
function Ye(i) {
|
|
5609
|
+
function es(s) {
|
|
4791
5610
|
return {
|
|
4792
|
-
x:
|
|
4793
|
-
y:
|
|
5611
|
+
x: Ie(s),
|
|
5612
|
+
y: Be(s)
|
|
4794
5613
|
};
|
|
4795
5614
|
}
|
|
4796
|
-
function
|
|
5615
|
+
function ss(s, t) {
|
|
4797
5616
|
const e = {};
|
|
4798
|
-
return t.forEach((
|
|
4799
|
-
|
|
5617
|
+
return t.forEach((i) => {
|
|
5618
|
+
i in s && s[i] !== void 0 && (e[i] = s[i]);
|
|
4800
5619
|
}), e;
|
|
4801
5620
|
}
|
|
4802
|
-
function
|
|
5621
|
+
function is(s, t = void 0) {
|
|
4803
5622
|
const e = {};
|
|
4804
|
-
return d(
|
|
4805
|
-
|
|
5623
|
+
return d(s, (i, r) => {
|
|
5624
|
+
i !== t && (e[r] = i);
|
|
4806
5625
|
}), e;
|
|
4807
5626
|
}
|
|
4808
|
-
function
|
|
4809
|
-
return A(
|
|
4810
|
-
}
|
|
4811
|
-
function Se(i, t) {
|
|
4812
|
-
return fe(i, t).join("");
|
|
5627
|
+
function rs(s) {
|
|
5628
|
+
return A(s) ? s : {};
|
|
4813
5629
|
}
|
|
4814
|
-
function
|
|
4815
|
-
|
|
4816
|
-
for (let u = 0; u < o; u++)
|
|
4817
|
-
a.push(Se(e, q(s, r)));
|
|
4818
|
-
return a.join(" ");
|
|
5630
|
+
function Fe(s, t) {
|
|
5631
|
+
return Ne(s, t).join("");
|
|
4819
5632
|
}
|
|
4820
|
-
function
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
}), new RegExp(`^${t}`, "ig");
|
|
5633
|
+
function ns(s, t, e = "#", i = 2, r = 12) {
|
|
5634
|
+
const a = Q(s, t), o = [];
|
|
5635
|
+
for (let u = 0; u < a; u++)
|
|
5636
|
+
o.push(Fe(e, Q(i, r)));
|
|
5637
|
+
return o.join(" ");
|
|
4826
5638
|
}
|
|
4827
|
-
function
|
|
4828
|
-
const e =
|
|
5639
|
+
function as(s, t) {
|
|
5640
|
+
const e = s != null ? s : 0;
|
|
4829
5641
|
return t > e ? 100 / (t - e) : 0;
|
|
4830
5642
|
}
|
|
4831
|
-
function
|
|
4832
|
-
const e =
|
|
5643
|
+
function os(s, t) {
|
|
5644
|
+
const e = s != null ? s : 0;
|
|
4833
5645
|
return t > e ? (t - e) / 100 : 0;
|
|
4834
5646
|
}
|
|
4835
|
-
const
|
|
4836
|
-
function
|
|
4837
|
-
const
|
|
4838
|
-
if (t &&
|
|
4839
|
-
const r =
|
|
5647
|
+
const xt = 0;
|
|
5648
|
+
function cs(s, t, e) {
|
|
5649
|
+
const i = t == null ? void 0 : t.closest(s);
|
|
5650
|
+
if (t && i && i.scrollHeight !== i.offsetHeight) {
|
|
5651
|
+
const r = i.getBoundingClientRect(), a = t.getBoundingClientRect();
|
|
4840
5652
|
if (e) {
|
|
4841
|
-
const
|
|
4842
|
-
|
|
4843
|
-
} else
|
|
5653
|
+
const o = e.getBoundingClientRect();
|
|
5654
|
+
i.scrollTop = t.offsetTop - (o.top - r.top) - (o.height / 2 - a.height / 2), i.scrollTop + i.offsetHeight < t.offsetTop + t.offsetHeight && (i.scrollTop = t.offsetTop + t.offsetHeight - i.offsetHeight);
|
|
5655
|
+
} else i.scrollTop > t.offsetTop ? i.scrollTop = a.top - r.top - xt : i.scrollTop + i.offsetHeight < t.offsetTop + t.offsetHeight && (i.scrollTop = a.top - r.top + a.height - r.height + xt);
|
|
4844
5656
|
}
|
|
4845
5657
|
}
|
|
4846
|
-
function
|
|
5658
|
+
function us(s, t, e = 0) {
|
|
4847
5659
|
if (!l())
|
|
4848
5660
|
return;
|
|
4849
|
-
const
|
|
4850
|
-
if ("scrollIntoView" in
|
|
4851
|
-
|
|
4852
|
-
behavior:
|
|
5661
|
+
const i = (t == null ? void 0 : t.behavior) || "smooth";
|
|
5662
|
+
if ("scrollIntoView" in s && !e) {
|
|
5663
|
+
s.scrollIntoView({
|
|
5664
|
+
behavior: i,
|
|
4853
5665
|
block: (t == null ? void 0 : t.block) || "start",
|
|
4854
5666
|
inline: (t == null ? void 0 : t.inline) || "start"
|
|
4855
5667
|
});
|
|
4856
5668
|
return;
|
|
4857
5669
|
}
|
|
4858
|
-
if ("getBoundingClientRect" in
|
|
4859
|
-
const r = ((window == null ? void 0 : window.scrollY) || window.pageYOffset) +
|
|
5670
|
+
if ("getBoundingClientRect" in s && "scrollTo" in window) {
|
|
5671
|
+
const r = ((window == null ? void 0 : window.scrollY) || window.pageYOffset) + s.getBoundingClientRect().top - e;
|
|
4860
5672
|
window.scrollTo({
|
|
4861
5673
|
top: r,
|
|
4862
|
-
behavior:
|
|
5674
|
+
behavior: i
|
|
4863
5675
|
});
|
|
4864
5676
|
}
|
|
4865
5677
|
}
|
|
4866
|
-
function
|
|
4867
|
-
if (!l() || !
|
|
5678
|
+
function hs(s, t, e = "smooth") {
|
|
5679
|
+
if (!l() || !s || !t)
|
|
4868
5680
|
return;
|
|
4869
|
-
const
|
|
4870
|
-
|
|
4871
|
-
top: r.top -
|
|
4872
|
-
left: r.left -
|
|
5681
|
+
const i = s.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
5682
|
+
s.scrollBy({
|
|
5683
|
+
top: r.top - i.top,
|
|
5684
|
+
left: r.left - i.left,
|
|
4873
5685
|
behavior: e
|
|
4874
5686
|
});
|
|
4875
5687
|
}
|
|
4876
|
-
function
|
|
4877
|
-
return
|
|
5688
|
+
function ls(s, t) {
|
|
5689
|
+
return s.indexOf(t) !== -1;
|
|
4878
5690
|
}
|
|
4879
|
-
async function
|
|
5691
|
+
async function gs() {
|
|
4880
5692
|
if (l()) {
|
|
4881
|
-
const
|
|
4882
|
-
document.body.style.setProperty("--sys-scrollbar-offset", `${
|
|
5693
|
+
const s = await ut.get();
|
|
5694
|
+
document.body.style.setProperty("--sys-scrollbar-offset", `${s}px`);
|
|
4883
5695
|
}
|
|
4884
5696
|
}
|
|
4885
|
-
function
|
|
5697
|
+
function ds(s, t) {
|
|
4886
5698
|
const e = {};
|
|
4887
|
-
return f(
|
|
4888
|
-
r in t && (e[r] =
|
|
5699
|
+
return f(s) && f(t) && d(s, (i, r) => {
|
|
5700
|
+
r in t && (e[r] = i);
|
|
4889
5701
|
}), e;
|
|
4890
5702
|
}
|
|
4891
|
-
function
|
|
4892
|
-
let e = Object.keys(
|
|
4893
|
-
return e || d(
|
|
4894
|
-
|
|
5703
|
+
function fs(s, t) {
|
|
5704
|
+
let e = Object.keys(s).length !== Object.keys(t).length;
|
|
5705
|
+
return e || d(s, (i, r) => {
|
|
5706
|
+
i !== (t == null ? void 0 : t[r]) && (e = !0);
|
|
4895
5707
|
}), e;
|
|
4896
5708
|
}
|
|
4897
|
-
const
|
|
4898
|
-
if (
|
|
4899
|
-
const t =
|
|
4900
|
-
return !!(t === "input" || t === "textarea" || t === "select" ||
|
|
5709
|
+
const xe = (s) => {
|
|
5710
|
+
if (s instanceof HTMLElement) {
|
|
5711
|
+
const t = s.tagName.toLowerCase();
|
|
5712
|
+
return !!(t === "input" || t === "textarea" || t === "select" || s.isContentEditable || s.getAttribute("contenteditable") === "true");
|
|
4901
5713
|
}
|
|
4902
5714
|
return !1;
|
|
4903
|
-
},
|
|
4904
|
-
function
|
|
4905
|
-
switch (typeof
|
|
5715
|
+
}, 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;
|
|
5716
|
+
function ys(s) {
|
|
5717
|
+
switch (typeof s) {
|
|
4906
5718
|
case "number":
|
|
4907
5719
|
return !0;
|
|
4908
5720
|
case "string":
|
|
4909
|
-
return !!
|
|
5721
|
+
return !!s.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
|
|
4910
5722
|
default:
|
|
4911
5723
|
return !1;
|
|
4912
5724
|
}
|
|
4913
5725
|
}
|
|
4914
|
-
function
|
|
5726
|
+
function $s(s, t) {
|
|
4915
5727
|
const e = Math.floor(t);
|
|
4916
|
-
return
|
|
5728
|
+
return s >= e && s < e + 1;
|
|
4917
5729
|
}
|
|
4918
|
-
function
|
|
4919
|
-
return Array.isArray(
|
|
5730
|
+
function ps(s, t) {
|
|
5731
|
+
return Array.isArray(s) ? s.every((e) => ot(e, t)) : ot(s, t);
|
|
4920
5732
|
}
|
|
4921
|
-
function
|
|
4922
|
-
if (
|
|
4923
|
-
return
|
|
5733
|
+
function bs(s, t) {
|
|
5734
|
+
if (s.startsWith(t))
|
|
5735
|
+
return s.slice(t.length).trim();
|
|
4924
5736
|
let e = 0;
|
|
4925
|
-
for (;
|
|
5737
|
+
for (; s[e] === t[e] && e < s.length && e < t.length; )
|
|
4926
5738
|
e++;
|
|
4927
|
-
return
|
|
5739
|
+
return s.slice(e).trim();
|
|
4928
5740
|
}
|
|
4929
|
-
const
|
|
4930
|
-
var
|
|
4931
|
-
return (r = (
|
|
5741
|
+
const ws = (s, t, e) => {
|
|
5742
|
+
var i, r;
|
|
5743
|
+
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
5744
|
};
|
|
4933
|
-
function
|
|
4934
|
-
return [...new Set(
|
|
5745
|
+
function Re(s) {
|
|
5746
|
+
return [...new Set(s)];
|
|
4935
5747
|
}
|
|
4936
|
-
function
|
|
4937
|
-
const
|
|
4938
|
-
return f(
|
|
5748
|
+
function J(s, t, e = !0) {
|
|
5749
|
+
const i = V(s);
|
|
5750
|
+
return f(s) && f(t) && d(
|
|
4939
5751
|
t,
|
|
4940
|
-
(r,
|
|
4941
|
-
const
|
|
4942
|
-
f(
|
|
4943
|
-
Array.isArray(
|
|
5752
|
+
(r, a) => {
|
|
5753
|
+
const o = s == null ? void 0 : s[a];
|
|
5754
|
+
f(o) && f(r) ? e && Array.isArray(o) && Array.isArray(r) ? i[a] = V(Re([...o, ...r])) : i[a] = J(
|
|
5755
|
+
Array.isArray(o) ? { ...o } : o,
|
|
4944
5756
|
r,
|
|
4945
5757
|
e
|
|
4946
|
-
) :
|
|
5758
|
+
) : i[a] = f(r) ? V(r) : r;
|
|
4947
5759
|
}
|
|
4948
|
-
),
|
|
5760
|
+
), i;
|
|
4949
5761
|
}
|
|
4950
|
-
function
|
|
4951
|
-
let e =
|
|
4952
|
-
return d(t, (
|
|
4953
|
-
e = e.replace(
|
|
5762
|
+
function vs(s, t) {
|
|
5763
|
+
let e = s;
|
|
5764
|
+
return d(t, (i, r) => {
|
|
5765
|
+
e = e.replace(zt(`[${r}]`), B(i));
|
|
4954
5766
|
}), e;
|
|
4955
5767
|
}
|
|
4956
|
-
function
|
|
5768
|
+
function Pe(s, t = "auto") {
|
|
4957
5769
|
switch (t) {
|
|
4958
5770
|
case "auto":
|
|
4959
|
-
return
|
|
5771
|
+
return s.naturalWidth >= s.naturalHeight;
|
|
4960
5772
|
case "width":
|
|
4961
5773
|
return !0;
|
|
4962
5774
|
case "height":
|
|
4963
5775
|
return !1;
|
|
4964
5776
|
}
|
|
4965
5777
|
}
|
|
4966
|
-
function
|
|
4967
|
-
var
|
|
4968
|
-
const r =
|
|
5778
|
+
function Ss(s, t, e = "auto", i) {
|
|
5779
|
+
var a;
|
|
5780
|
+
const r = Ae(s);
|
|
4969
5781
|
if (r && (r.naturalWidth > t && (e === "auto" || e === "width") || r.naturalHeight > t && (e === "auto" || e === "height"))) {
|
|
4970
|
-
const
|
|
5782
|
+
const o = Pe(r, e), u = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
|
|
4971
5783
|
if (u)
|
|
4972
|
-
return u.canvas.width =
|
|
5784
|
+
return u.canvas.width = o ? t : r.naturalWidth / r.naturalHeight * t, u.canvas.height = o ? r.naturalHeight / r.naturalWidth * t : t, u.drawImage(r, 0, 0, u.canvas.width, u.canvas.height), u.canvas.toDataURL(i);
|
|
4973
5785
|
}
|
|
4974
5786
|
}
|
|
4975
|
-
function
|
|
4976
|
-
const t = k(
|
|
5787
|
+
function Ls(s) {
|
|
5788
|
+
const t = k(s);
|
|
4977
5789
|
if (t > 0) {
|
|
4978
|
-
const e = String(Math.floor(t / 60)).padStart(2, "0"),
|
|
4979
|
-
return `${e}:${
|
|
5790
|
+
const e = String(Math.floor(t / 60)).padStart(2, "0"), i = String(t % 60).padStart(2, "0");
|
|
5791
|
+
return `${e}:${i}`;
|
|
4980
5792
|
}
|
|
4981
5793
|
return "00:00";
|
|
4982
5794
|
}
|
|
4983
|
-
function
|
|
5795
|
+
function Cs(s, t, {
|
|
4984
5796
|
multiple: e = !1,
|
|
4985
|
-
maxlength:
|
|
5797
|
+
maxlength: i = 0,
|
|
4986
5798
|
alwaysChange: r = !0,
|
|
4987
|
-
notEmpty:
|
|
5799
|
+
notEmpty: a = !1
|
|
4988
5800
|
}) {
|
|
4989
5801
|
if (e) {
|
|
4990
|
-
if (
|
|
4991
|
-
const
|
|
4992
|
-
return
|
|
5802
|
+
if (ht(s)) {
|
|
5803
|
+
const o = s.indexOf(t), u = [...s];
|
|
5804
|
+
return o !== -1 ? (!a || u.length > 1) && u.splice(o, 1) : (!i || s.length < i) && u.push(t), u;
|
|
4993
5805
|
}
|
|
4994
|
-
return
|
|
5806
|
+
return s === t ? [] : s ? [s, t] : [t];
|
|
4995
5807
|
}
|
|
4996
|
-
return r ||
|
|
5808
|
+
return r || s !== t ? t : s;
|
|
4997
5809
|
}
|
|
4998
|
-
function
|
|
4999
|
-
if (f(
|
|
5810
|
+
function Ds(s, t, e) {
|
|
5811
|
+
if (f(s) && f(t)) {
|
|
5000
5812
|
if (e) {
|
|
5001
|
-
let
|
|
5002
|
-
return d(
|
|
5003
|
-
!r && (e ===
|
|
5004
|
-
}), r ?
|
|
5813
|
+
let i = {}, r = !1;
|
|
5814
|
+
return d(s, (a, o) => {
|
|
5815
|
+
!r && (e === o || e === a) ? (r = !0, i = J(i, t)) : r ? i = J(i, { [o]: a }) : i[o] = f(a) ? V(a) : a;
|
|
5816
|
+
}), r ? i : J(s, t);
|
|
5005
5817
|
}
|
|
5006
5818
|
if (f(t))
|
|
5007
|
-
return
|
|
5819
|
+
return J(s, t);
|
|
5008
5820
|
}
|
|
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()}`);
|
|
5821
|
+
return V(s);
|
|
5013
5822
|
}
|
|
5014
|
-
function
|
|
5015
|
-
return
|
|
5823
|
+
function ks(s) {
|
|
5824
|
+
return Ht(s).replace(/^([a-z])/, (t) => `${t.toUpperCase()}`);
|
|
5016
5825
|
}
|
|
5017
|
-
function
|
|
5018
|
-
return
|
|
5826
|
+
function Ns(s) {
|
|
5827
|
+
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
5828
|
}
|
|
5020
|
-
function
|
|
5021
|
-
const r = k(
|
|
5022
|
-
return t &&
|
|
5829
|
+
function Es(s, t, e, i) {
|
|
5830
|
+
const r = k(s), a = k(t);
|
|
5831
|
+
return t && a < r ? `${Rt(a, e, i)}+` : Rt(r, e, i);
|
|
5023
5832
|
}
|
|
5024
|
-
const
|
|
5025
|
-
function
|
|
5026
|
-
return 1 /
|
|
5833
|
+
const Rt = (s, t, e) => t ? new N(e).number(s) : s;
|
|
5834
|
+
function We(s, t) {
|
|
5835
|
+
return 1 / s * t;
|
|
5027
5836
|
}
|
|
5028
|
-
function
|
|
5029
|
-
return
|
|
5837
|
+
function As(s, t) {
|
|
5838
|
+
return We(s, t) * 100;
|
|
5030
5839
|
}
|
|
5031
|
-
function
|
|
5840
|
+
function Is(s) {
|
|
5032
5841
|
let t = "";
|
|
5033
|
-
for (const e of
|
|
5842
|
+
for (const e of s)
|
|
5034
5843
|
t += String.fromCharCode(e);
|
|
5035
|
-
return l() ? window.btoa(t) : globalThis && globalThis.Buffer ? globalThis == null ? void 0 : globalThis.Buffer.from(
|
|
5844
|
+
return l() ? window.btoa(t) : globalThis && globalThis.Buffer ? globalThis == null ? void 0 : globalThis.Buffer.from(s).toString("base64") : "";
|
|
5036
5845
|
}
|
|
5037
|
-
async function
|
|
5846
|
+
async function Bs(s) {
|
|
5038
5847
|
if (l())
|
|
5039
5848
|
try {
|
|
5040
|
-
await navigator.clipboard.writeText(
|
|
5849
|
+
await navigator.clipboard.writeText(s);
|
|
5041
5850
|
} catch (t) {
|
|
5042
|
-
document == null || document.execCommand(
|
|
5851
|
+
document == null || document.execCommand(s);
|
|
5043
5852
|
}
|
|
5044
5853
|
}
|
|
5045
5854
|
export {
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5855
|
+
K as Api,
|
|
5856
|
+
Qt as ApiDefault,
|
|
5857
|
+
Mt as ApiHeaders,
|
|
5858
|
+
C as ApiMethodItem,
|
|
5859
|
+
Ot as ApiPreparation,
|
|
5860
|
+
_t as ApiResponse,
|
|
5861
|
+
vt as ApiStatus,
|
|
5862
|
+
He as BroadcastMessage,
|
|
5863
|
+
te as Cache,
|
|
5864
|
+
Gt as CacheItem,
|
|
5865
|
+
Lt as CacheStatic,
|
|
5866
|
+
Ct as Cookie,
|
|
5867
|
+
jt as CookieBlock,
|
|
5868
|
+
et as DataStorage,
|
|
5869
|
+
gt as Datetime,
|
|
5870
|
+
bt as EventItem,
|
|
5871
|
+
ze as Formatters,
|
|
5872
|
+
F as FormattersType,
|
|
5062
5873
|
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
|
-
|
|
5874
|
+
b as Geo,
|
|
5875
|
+
Dt as GeoFlag,
|
|
5876
|
+
N as GeoIntl,
|
|
5877
|
+
kt as GeoPhone,
|
|
5878
|
+
Ze as Global,
|
|
5879
|
+
Nt as Hash,
|
|
5880
|
+
It as Icons,
|
|
5881
|
+
R as Loading,
|
|
5882
|
+
Ve as Meta,
|
|
5883
|
+
dt as MetaManager,
|
|
5884
|
+
fe as MetaOg,
|
|
5885
|
+
le as MetaOpenGraphAge,
|
|
5886
|
+
ue as MetaOpenGraphAvailability,
|
|
5887
|
+
he as MetaOpenGraphCondition,
|
|
5888
|
+
ge as MetaOpenGraphGender,
|
|
5889
|
+
$ as MetaOpenGraphTag,
|
|
5890
|
+
ce as MetaOpenGraphType,
|
|
5891
|
+
oe as MetaRobots,
|
|
5892
|
+
L as MetaTag,
|
|
5893
|
+
me as MetaTwitter,
|
|
5894
|
+
de as MetaTwitterCard,
|
|
5895
|
+
p as MetaTwitterTag,
|
|
5896
|
+
ut as ScrollbarWidth,
|
|
5897
|
+
Ke as SearchList,
|
|
5898
|
+
pe as SearchListData,
|
|
5899
|
+
be as SearchListItem,
|
|
5900
|
+
Se as SearchListMatcher,
|
|
5901
|
+
Le as SearchListOptions,
|
|
5902
|
+
ke as TRANSLATE_GLOBAL_PREFIX,
|
|
5903
|
+
Bt as Translate,
|
|
5904
|
+
$e as addTagHighlightMatch,
|
|
5905
|
+
T as anyToString,
|
|
5906
|
+
De as applyTemplate,
|
|
5907
|
+
Ne as arrFill,
|
|
5908
|
+
Ye as blobToBase64,
|
|
5909
|
+
V as copyObject,
|
|
5910
|
+
D as copyObjectLite,
|
|
5911
|
+
G as createElement,
|
|
5912
|
+
qe as domQuerySelector,
|
|
5913
|
+
Je as domQuerySelectorAll,
|
|
5914
|
+
ae as encodeAttribute,
|
|
5915
|
+
ft as escapeExp,
|
|
5916
|
+
Me as eventStopPropagation,
|
|
5100
5917
|
B as executeFunction,
|
|
5101
|
-
|
|
5918
|
+
Xt as executePromise,
|
|
5102
5919
|
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
|
-
|
|
5920
|
+
Ee as frame,
|
|
5921
|
+
Qe as getAttributes,
|
|
5922
|
+
Xe as getClipboardData,
|
|
5923
|
+
se as getColumn,
|
|
5924
|
+
_e as getCurrentDate,
|
|
5925
|
+
E as getElement,
|
|
5926
|
+
Oe as getElementId,
|
|
5927
|
+
Ae as getElementImage,
|
|
5928
|
+
re as getElementItem,
|
|
5929
|
+
pt as getElementOrWindow,
|
|
5930
|
+
we as getExactSearchExp,
|
|
5931
|
+
zt as getExp,
|
|
5932
|
+
x as getItemByPath,
|
|
5933
|
+
Te as getKey,
|
|
5934
|
+
Zt as getLengthOfAllArray,
|
|
5935
|
+
Ge as getMaxLengthAllArray,
|
|
5936
|
+
ts as getMinLengthAllArray,
|
|
5937
|
+
es as getMouseClient,
|
|
5938
|
+
Ie as getMouseClientX,
|
|
5939
|
+
Be as getMouseClientY,
|
|
5940
|
+
ss as getObjectByKeys,
|
|
5941
|
+
is as getObjectNoUndefined,
|
|
5942
|
+
rs as getObjectOrNone,
|
|
5943
|
+
ns as getRandomText,
|
|
5944
|
+
Pt as getRequestString,
|
|
5945
|
+
ve as getSearchExp,
|
|
5946
|
+
ye as getSeparatingSearchExp,
|
|
5947
|
+
as as getStepPercent,
|
|
5948
|
+
os as getStepValue,
|
|
5949
|
+
cs as goScroll,
|
|
5950
|
+
us as goScrollSmooth,
|
|
5951
|
+
hs as goScrollTo,
|
|
5952
|
+
ls as inArray,
|
|
5953
|
+
gs as initScrollbarOffset,
|
|
5954
|
+
ds as intersectKey,
|
|
5955
|
+
ht as isArray,
|
|
5956
|
+
fs as isDifferent,
|
|
5957
|
+
ct as isDomData,
|
|
5139
5958
|
l as isDomRuntime,
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5959
|
+
ms as isEnter,
|
|
5960
|
+
m as isFilled,
|
|
5961
|
+
ys as isFloat,
|
|
5962
|
+
lt as isFunction,
|
|
5963
|
+
Jt as isInDom,
|
|
5964
|
+
xe as isInput,
|
|
5965
|
+
$s as isIntegerBetween,
|
|
5966
|
+
X as isNull,
|
|
5967
|
+
yt as isNumber,
|
|
5149
5968
|
f as isObject,
|
|
5150
5969
|
A as isObjectNotArray,
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5970
|
+
ot as isSelected,
|
|
5971
|
+
ps as isSelectedByList,
|
|
5972
|
+
U as isString,
|
|
5973
|
+
Wt as isWindow,
|
|
5974
|
+
Q as random,
|
|
5975
|
+
bs as removeCommonPrefix,
|
|
5976
|
+
ws as replaceComponentName,
|
|
5977
|
+
J as replaceRecursive,
|
|
5978
|
+
vs as replaceTemplate,
|
|
5979
|
+
Ss as resizeImageByMax,
|
|
5980
|
+
Ls as secondToTime,
|
|
5981
|
+
ne as setElementItem,
|
|
5982
|
+
Cs as setValues,
|
|
5983
|
+
Ds as splice,
|
|
5984
|
+
Fe as strFill,
|
|
5985
|
+
ie as strSplit,
|
|
5986
|
+
Y as toArray,
|
|
5987
|
+
Ht as toCamelCase,
|
|
5988
|
+
ks as toCamelCaseFirst,
|
|
5989
|
+
P as toDate,
|
|
5990
|
+
Ns as toKebabCase,
|
|
5172
5991
|
k as toNumber,
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5992
|
+
Es as toNumberByMax,
|
|
5993
|
+
We as toPercent,
|
|
5994
|
+
As as toPercentBy100,
|
|
5995
|
+
Ut as transformation,
|
|
5996
|
+
Is as uint8ArrayToBase64,
|
|
5997
|
+
Re as uniqueArray,
|
|
5998
|
+
Bs as writeClipboardData
|
|
5180
5999
|
};
|