@dxtmisha/functional-basic 0.1.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/LICENSE +21 -0
- package/README.md +829 -0
- package/dist/classes/Api.d.ts +161 -0
- package/dist/classes/ApiDefault.d.ts +43 -0
- package/dist/classes/ApiHeaders.d.ts +23 -0
- package/dist/classes/ApiPreparation.d.ts +56 -0
- package/dist/classes/ApiResponse.d.ts +111 -0
- package/dist/classes/ApiStatus.d.ts +89 -0
- package/dist/classes/BroadcastMessage.d.ts +36 -0
- package/dist/classes/Cache.d.ts +34 -0
- package/dist/classes/CacheItem.d.ts +55 -0
- package/dist/classes/CacheStatic.d.ts +17 -0
- package/dist/classes/Cookie.d.ts +58 -0
- package/dist/classes/CookieBlock.d.ts +22 -0
- package/dist/classes/DataStorage.d.ts +82 -0
- package/dist/classes/Datetime.d.ts +482 -0
- package/dist/classes/EventItem.d.ts +160 -0
- package/dist/classes/Geo.d.ts +168 -0
- package/dist/classes/GeoFlag.d.ts +79 -0
- package/dist/classes/GeoIntl.d.ts +262 -0
- package/dist/classes/GeoPhone.d.ts +107 -0
- package/dist/classes/Global.d.ts +21 -0
- package/dist/classes/Hash.d.ts +59 -0
- package/dist/classes/Icons.d.ts +90 -0
- package/dist/classes/Loading.d.ts +49 -0
- package/dist/classes/Meta.d.ts +168 -0
- package/dist/classes/MetaManager.d.ts +103 -0
- package/dist/classes/MetaOg.d.ts +101 -0
- package/dist/classes/MetaTwitter.d.ts +101 -0
- package/dist/classes/ScrollbarWidth.d.ts +33 -0
- package/dist/classes/Translate.d.ts +116 -0
- package/dist/classes/__tests__/Api.test.d.ts +4 -0
- package/dist/classes/__tests__/ApiDefault.test.d.ts +1 -0
- package/dist/classes/__tests__/ApiHeaders.test.d.ts +1 -0
- package/dist/classes/__tests__/ApiPreparation.test.d.ts +1 -0
- package/dist/classes/__tests__/ApiResponse.test.d.ts +4 -0
- package/dist/classes/__tests__/ApiStatus.test.d.ts +1 -0
- package/dist/classes/__tests__/Meta.test.d.ts +4 -0
- package/dist/classes/__tests__/MetaManager.test.d.ts +4 -0
- package/dist/classes/__tests__/MetaOg.test.d.ts +4 -0
- package/dist/classes/__tests__/MetaTwitter.test.d.ts +4 -0
- package/dist/functions/anyToString.d.ts +7 -0
- package/dist/functions/applyTemplate.d.ts +10 -0
- package/dist/functions/arrFill.d.ts +8 -0
- package/dist/functions/copyObject.d.ts +8 -0
- package/dist/functions/createElement.d.ts +13 -0
- package/dist/functions/domQuerySelector.d.ts +7 -0
- package/dist/functions/domQuerySelectorAll.d.ts +7 -0
- package/dist/functions/encodeAttribute.d.ts +7 -0
- package/dist/functions/eventStopPropagation.d.ts +7 -0
- package/dist/functions/executeFunction.d.ts +8 -0
- package/dist/functions/executePromise.d.ts +7 -0
- package/dist/functions/forEach.d.ts +11 -0
- package/dist/functions/frame.d.ts +16 -0
- package/dist/functions/getAttributes.d.ts +8 -0
- package/dist/functions/getClipboardData.d.ts +11 -0
- package/dist/functions/getColumn.d.ts +10 -0
- package/dist/functions/getElement.d.ts +8 -0
- package/dist/functions/getElementId.d.ts +9 -0
- package/dist/functions/getElementItem.d.ts +11 -0
- package/dist/functions/getElementOrWindow.d.ts +8 -0
- package/dist/functions/getExp.d.ts +13 -0
- package/dist/functions/getItemByPath.d.ts +8 -0
- package/dist/functions/getKey.d.ts +7 -0
- package/dist/functions/getLengthOfAllArray.d.ts +8 -0
- package/dist/functions/getMaxLengthAllArray.d.ts +8 -0
- package/dist/functions/getMinLengthAllArray.d.ts +8 -0
- package/dist/functions/getMouseClient.d.ts +8 -0
- package/dist/functions/getMouseClientX.d.ts +7 -0
- package/dist/functions/getMouseClientY.d.ts +7 -0
- package/dist/functions/getObjectByKeys.d.ts +8 -0
- package/dist/functions/getObjectNoUndefined.d.ts +8 -0
- package/dist/functions/getObjectOrNone.d.ts +7 -0
- package/dist/functions/getRandomText.d.ts +11 -0
- package/dist/functions/getRequestString.d.ts +9 -0
- package/dist/functions/getStepPercent.d.ts +8 -0
- package/dist/functions/getStepValue.d.ts +8 -0
- package/dist/functions/goScroll.d.ts +10 -0
- package/dist/functions/inArray.d.ts +8 -0
- package/dist/functions/initScrollbarOffset.d.ts +6 -0
- package/dist/functions/intersectKey.d.ts +8 -0
- package/dist/functions/isArray.d.ts +7 -0
- package/dist/functions/isDifferent.d.ts +9 -0
- package/dist/functions/isDomRuntime.d.ts +10 -0
- package/dist/functions/isFilled.d.ts +9 -0
- package/dist/functions/isFloat.d.ts +7 -0
- package/dist/functions/isFunction.d.ts +8 -0
- package/dist/functions/isInDom.d.ts +8 -0
- package/dist/functions/isIntegerBetween.d.ts +8 -0
- package/dist/functions/isNull.d.ts +8 -0
- package/dist/functions/isNumber.d.ts +7 -0
- package/dist/functions/isObject.d.ts +7 -0
- package/dist/functions/isObjectNotArray.d.ts +7 -0
- package/dist/functions/isSelected.d.ts +8 -0
- package/dist/functions/isSelectedByList.d.ts +8 -0
- package/dist/functions/isString.d.ts +7 -0
- package/dist/functions/isWindow.d.ts +7 -0
- package/dist/functions/random.d.ts +8 -0
- package/dist/functions/replaceRecursive.d.ts +10 -0
- package/dist/functions/replaceTemplate.d.ts +9 -0
- package/dist/functions/secondToTime.d.ts +7 -0
- package/dist/functions/setElementItem.d.ts +10 -0
- package/dist/functions/setValues.d.ts +17 -0
- package/dist/functions/splice.d.ts +12 -0
- package/dist/functions/strFill.d.ts +8 -0
- package/dist/functions/toArray.d.ts +17 -0
- package/dist/functions/toCamelCase.d.ts +7 -0
- package/dist/functions/toCamelCaseFirst.d.ts +7 -0
- package/dist/functions/toDate.d.ts +7 -0
- package/dist/functions/toKebabCase.d.ts +15 -0
- package/dist/functions/toNumber.d.ts +8 -0
- package/dist/functions/toNumberByMax.d.ts +9 -0
- package/dist/functions/toPercent.d.ts +8 -0
- package/dist/functions/toPercentBy100.d.ts +8 -0
- package/dist/functions/transformation.d.ts +21 -0
- package/dist/functions/uniqueArray.d.ts +7 -0
- package/dist/functions/writeClipboardData.d.ts +7 -0
- package/dist/library.d.ts +109 -0
- package/dist/library.js +4916 -0
- package/dist/types/apiTypes.d.ts +116 -0
- package/dist/types/basicTypes.d.ts +126 -0
- package/dist/types/geoTypes.d.ts +86 -0
- package/dist/types/metaTypes.d.ts +584 -0
- package/package.json +68 -0
package/dist/library.js
ADDED
|
@@ -0,0 +1,4916 @@
|
|
|
1
|
+
var xt = Object.defineProperty;
|
|
2
|
+
var Rt = (i, t, e) => t in i ? xt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var c = (i, t, e) => Rt(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { geo as Pt } from "@dxtmisha/media";
|
|
5
|
+
function m(i) {
|
|
6
|
+
return !!(i && typeof i == "object");
|
|
7
|
+
}
|
|
8
|
+
function g(i, t) {
|
|
9
|
+
if (m(i)) {
|
|
10
|
+
const e = [];
|
|
11
|
+
return i instanceof Map ? i.forEach((s, n) => e.push(t(s, n, i))) : Array.isArray(i) ? i.forEach((s, n) => e.push(t(s, n, i))) : Object.entries(i).forEach(
|
|
12
|
+
([s, n]) => e.push(t(n, s, i))
|
|
13
|
+
), e.filter((s) => s !== void 0);
|
|
14
|
+
}
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
function Lt(i, t = "=", e = "&") {
|
|
18
|
+
return g(
|
|
19
|
+
i,
|
|
20
|
+
(s, n) => `${n}${t}${encodeURIComponent(String(s).trim())}`
|
|
21
|
+
).sort().join(e);
|
|
22
|
+
}
|
|
23
|
+
function Y(i) {
|
|
24
|
+
return i == null;
|
|
25
|
+
}
|
|
26
|
+
function D(i, t) {
|
|
27
|
+
if (i) {
|
|
28
|
+
if (t && i === "0")
|
|
29
|
+
return !0;
|
|
30
|
+
switch (typeof i) {
|
|
31
|
+
case "bigint":
|
|
32
|
+
case "number":
|
|
33
|
+
return i !== 0;
|
|
34
|
+
case "boolean":
|
|
35
|
+
return i;
|
|
36
|
+
case "function":
|
|
37
|
+
case "symbol":
|
|
38
|
+
return !0;
|
|
39
|
+
case "object":
|
|
40
|
+
return Array.isArray(i) ? i.length > 0 : Object.values(i).some((e) => !Y(e));
|
|
41
|
+
case "string":
|
|
42
|
+
return !["", "undefined", "null", "0", "false", "[]"].includes(i);
|
|
43
|
+
case "undefined":
|
|
44
|
+
return !1;
|
|
45
|
+
default:
|
|
46
|
+
return !!i;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return !1;
|
|
50
|
+
}
|
|
51
|
+
function k(i) {
|
|
52
|
+
return m(i) && !Array.isArray(i);
|
|
53
|
+
}
|
|
54
|
+
function j(i) {
|
|
55
|
+
return typeof i == "string";
|
|
56
|
+
}
|
|
57
|
+
function W(i) {
|
|
58
|
+
return JSON.parse(JSON.stringify(i));
|
|
59
|
+
}
|
|
60
|
+
function l() {
|
|
61
|
+
return typeof window != "undefined" && !!window.document;
|
|
62
|
+
}
|
|
63
|
+
function ot(i) {
|
|
64
|
+
switch (typeof i) {
|
|
65
|
+
case "number":
|
|
66
|
+
return !0;
|
|
67
|
+
case "string":
|
|
68
|
+
return !!i.match(/^[0-9]+$/);
|
|
69
|
+
default:
|
|
70
|
+
return !1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function L(i) {
|
|
74
|
+
if (typeof i == "number")
|
|
75
|
+
return i;
|
|
76
|
+
if (!i)
|
|
77
|
+
return 0;
|
|
78
|
+
let t = i.replace(/[^\d., ]+/ig, "");
|
|
79
|
+
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);
|
|
80
|
+
}
|
|
81
|
+
function et(i, t) {
|
|
82
|
+
return Y(i) ? !1 : Array.isArray(t) ? t.includes(i) : ot(i) && ot(t) ? L(i) === L(t) : i === t;
|
|
83
|
+
}
|
|
84
|
+
function kt(i) {
|
|
85
|
+
return i instanceof Function || typeof i == "function";
|
|
86
|
+
}
|
|
87
|
+
function N(i) {
|
|
88
|
+
return kt(i) ? i() : i;
|
|
89
|
+
}
|
|
90
|
+
const O = {};
|
|
91
|
+
let at = "ui-storage";
|
|
92
|
+
class _ {
|
|
93
|
+
/**
|
|
94
|
+
* Constructor
|
|
95
|
+
* @param name value name/ название значения
|
|
96
|
+
* @param isSession should we use a session/ использовать ли сессию
|
|
97
|
+
*/
|
|
98
|
+
constructor(t, e = !1) {
|
|
99
|
+
c(this, "value");
|
|
100
|
+
c(this, "age");
|
|
101
|
+
this.name = t, this.isSession = e;
|
|
102
|
+
const s = `${e ? "session" : "storage"}#${t}`;
|
|
103
|
+
if (s in O)
|
|
104
|
+
return O[s];
|
|
105
|
+
this.make(), O[s] = this;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Changing the prefix in key names. Should be called at the beginning of the code.
|
|
109
|
+
*
|
|
110
|
+
* Изменение префикса в названиях ключей. Вызывать нужно в начале кода.
|
|
111
|
+
* @param newPrefix new prefix/ новый префикс
|
|
112
|
+
*/
|
|
113
|
+
static setPrefix(t) {
|
|
114
|
+
at = t;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Getting data from local storage.
|
|
118
|
+
*
|
|
119
|
+
* Получение данных из локального хранилища.
|
|
120
|
+
* @param defaultValue default value/ значение по умолчанию
|
|
121
|
+
* @param cache cache time/ время кэширования
|
|
122
|
+
*/
|
|
123
|
+
get(t, e) {
|
|
124
|
+
if (this.value !== null && this.value !== void 0 && this.isCache(e))
|
|
125
|
+
return this.value;
|
|
126
|
+
if (t !== void 0)
|
|
127
|
+
return this.set(t);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Changing data in storage.
|
|
131
|
+
*
|
|
132
|
+
* Изменение данных в хранилище.
|
|
133
|
+
* @param value new values/ новые значения
|
|
134
|
+
*/
|
|
135
|
+
set(t) {
|
|
136
|
+
var e;
|
|
137
|
+
return this.value = N(t), this.age = (/* @__PURE__ */ new Date()).getTime(), this.value === void 0 ? this.remove() : (e = this.getMethod()) == null || e.setItem(this.getIndex(), JSON.stringify({
|
|
138
|
+
value: this.value,
|
|
139
|
+
age: this.age
|
|
140
|
+
})), this.value;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Removing data from storage.
|
|
144
|
+
*
|
|
145
|
+
* Удаление данных из хранилища.
|
|
146
|
+
*/
|
|
147
|
+
remove() {
|
|
148
|
+
var t;
|
|
149
|
+
return (t = this.getMethod()) == null || t.removeItem(this.getIndex()), this;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Clearing all data from storage.
|
|
153
|
+
*
|
|
154
|
+
* Очистка всех данных из хранилища.
|
|
155
|
+
*/
|
|
156
|
+
update() {
|
|
157
|
+
return this.make(), this;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Checks for storage time limit.
|
|
161
|
+
*
|
|
162
|
+
* Проверяет на лимит времени хранения.
|
|
163
|
+
* @param cache cache time/ время кэширования
|
|
164
|
+
*/
|
|
165
|
+
isCache(t) {
|
|
166
|
+
return Y(t) || this.age && this.age + t * 1e3 >= (/* @__PURE__ */ new Date()).getTime();
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Returns an object for working with storage.
|
|
170
|
+
*
|
|
171
|
+
* Возвращает объект для работы с хранилищем.
|
|
172
|
+
*/
|
|
173
|
+
getMethod() {
|
|
174
|
+
if (l())
|
|
175
|
+
return this.isSession ? window == null ? void 0 : window.sessionStorage : window == null ? void 0 : window.localStorage;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Getting the storage key name.
|
|
179
|
+
*
|
|
180
|
+
* Получение имени ключа в хранилище.
|
|
181
|
+
*/
|
|
182
|
+
getIndex() {
|
|
183
|
+
return `${at}__${this.name}`;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Getting data from storage.
|
|
187
|
+
*
|
|
188
|
+
* Получение данных из хранилища.
|
|
189
|
+
*/
|
|
190
|
+
getValue() {
|
|
191
|
+
var e;
|
|
192
|
+
const t = (e = this.getMethod()) == null ? void 0 : e.getItem(this.getIndex());
|
|
193
|
+
if (t)
|
|
194
|
+
try {
|
|
195
|
+
return JSON.parse(t);
|
|
196
|
+
} catch (s) {
|
|
197
|
+
console.error("DataStorage", s);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Filling in the data from storage.
|
|
202
|
+
*
|
|
203
|
+
* Заполнение данными из хранилища.
|
|
204
|
+
*/
|
|
205
|
+
make() {
|
|
206
|
+
const t = this.getValue();
|
|
207
|
+
return t ? (this.value = t.value, this.age = t.age) : (this.value = void 0, this.age = void 0), this;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const Wt = "geo-code", p = class p {
|
|
211
|
+
/**
|
|
212
|
+
* Information about the current country.
|
|
213
|
+
*
|
|
214
|
+
* Информация об текущей стране.
|
|
215
|
+
*/
|
|
216
|
+
static get() {
|
|
217
|
+
return this.item;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Current country.
|
|
221
|
+
*
|
|
222
|
+
* Текущая страна.
|
|
223
|
+
*/
|
|
224
|
+
static getCountry() {
|
|
225
|
+
return this.item.country;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Current language.
|
|
229
|
+
*
|
|
230
|
+
* Текущий язык.
|
|
231
|
+
*/
|
|
232
|
+
static getLanguage() {
|
|
233
|
+
return this.language;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Full format according to the standard.
|
|
237
|
+
*
|
|
238
|
+
* Полный формат согласно стандарту.
|
|
239
|
+
*/
|
|
240
|
+
static getStandard() {
|
|
241
|
+
return this.item.standard;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Returns the first day of the week.
|
|
245
|
+
*
|
|
246
|
+
* Возвращает первый день недели.
|
|
247
|
+
*/
|
|
248
|
+
static getFirstDay() {
|
|
249
|
+
return this.item.firstDay;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Full format.
|
|
253
|
+
*
|
|
254
|
+
* Полный формат.
|
|
255
|
+
*/
|
|
256
|
+
static getLocation() {
|
|
257
|
+
return this.location;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Obtaining processed data.
|
|
261
|
+
*
|
|
262
|
+
* Получение обработанных данных.
|
|
263
|
+
*/
|
|
264
|
+
static getItem() {
|
|
265
|
+
return {
|
|
266
|
+
...this.item,
|
|
267
|
+
language: this.language
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Returns the full list of countries.
|
|
272
|
+
*
|
|
273
|
+
* Возвращает полный список стран.
|
|
274
|
+
*/
|
|
275
|
+
static getList() {
|
|
276
|
+
return Pt;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Returns the data about the country by its full code.
|
|
280
|
+
*
|
|
281
|
+
* Возвращает данные о стране по ее полному коду.
|
|
282
|
+
* @param code country code, full form language-country or one of them/
|
|
283
|
+
* код страны, полный вид язык-страна или один из них
|
|
284
|
+
*/
|
|
285
|
+
static getByCode(t) {
|
|
286
|
+
let e;
|
|
287
|
+
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(W(e != null ? e : this.getList()[0]));
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Returns the full data by language and country.
|
|
291
|
+
*
|
|
292
|
+
* Возвращает полные данные по языку и стране.
|
|
293
|
+
* @param code string in the form of language-country/ строка в виде язык-страна
|
|
294
|
+
*/
|
|
295
|
+
static getByCodeFull(t) {
|
|
296
|
+
return this.getList().find(
|
|
297
|
+
(e) => et(t, [
|
|
298
|
+
`${e.language}-${e.country}`,
|
|
299
|
+
`${e.country}-${e.language}`
|
|
300
|
+
])
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Returns the full data by country.
|
|
305
|
+
*
|
|
306
|
+
* Возвращает полные данные по стране.
|
|
307
|
+
* @param country country/ страна
|
|
308
|
+
*/
|
|
309
|
+
static getByCountry(t) {
|
|
310
|
+
return this.getList().find((e) => {
|
|
311
|
+
var s;
|
|
312
|
+
return e.country === t || ((s = e == null ? void 0 : e.countryAlternative) == null ? void 0 : s.find((n) => n === t));
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Returns the full data by language.
|
|
317
|
+
*
|
|
318
|
+
* Возвращает полные данные по языку.
|
|
319
|
+
* @param language language/ язык
|
|
320
|
+
*/
|
|
321
|
+
static getByLanguage(t) {
|
|
322
|
+
return this.getList().find((e) => {
|
|
323
|
+
var s;
|
|
324
|
+
return e.language === t || ((s = e == null ? void 0 : e.languageAlternative) == null ? void 0 : s.find((n) => n === t));
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Retrieving the default timezone.
|
|
329
|
+
*
|
|
330
|
+
* Получение временной зоны по умолчанию
|
|
331
|
+
*/
|
|
332
|
+
static getTimezone() {
|
|
333
|
+
return this.timezone;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Retrieving the default timezone (formatted view).
|
|
337
|
+
*
|
|
338
|
+
* Получение временной зоны по умолчанию (отформатированный вид).
|
|
339
|
+
*/
|
|
340
|
+
static getTimezoneFormat() {
|
|
341
|
+
const t = Math.abs(Math.trunc(this.timezone / 60)).toString().padStart(2, "0"), e = Math.abs(this.timezone % 60).toString().padStart(2, "0");
|
|
342
|
+
return this.timezone >= 0 ? `-${t}:${e}` : `+${t}:${e}`;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Determines the current country by its full name.
|
|
346
|
+
*
|
|
347
|
+
* Определяет текущую страну по ее полному названию.
|
|
348
|
+
* @param code country code, full form language-country or one of them/
|
|
349
|
+
* код страны, полный вид язык-страна или один из них
|
|
350
|
+
*/
|
|
351
|
+
static find(t) {
|
|
352
|
+
return this.getByCode(t);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Returns a complete string with the country code and language.
|
|
356
|
+
*
|
|
357
|
+
* Возвращает полную строку с кодом страны и языка.
|
|
358
|
+
* @param item object with data about the current country/
|
|
359
|
+
* объект с данными об текущей стране
|
|
360
|
+
*/
|
|
361
|
+
static toStandard(t) {
|
|
362
|
+
return `${t.language}-${t.country}`;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Changes the data by the full code.
|
|
366
|
+
*
|
|
367
|
+
* Изменяет данные по полному коду.
|
|
368
|
+
* @param code country code, full form language-country or one of them/
|
|
369
|
+
* код страны, полный вид язык-страна или один из них
|
|
370
|
+
* @param save save the result/ сохранить результат
|
|
371
|
+
*/
|
|
372
|
+
static set(t, e) {
|
|
373
|
+
this.location = t, this.item = this.getByCode(this.location), this.language = this.findLanguage(this.location), e && this.storage.set(this.location);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Changing the default timezone for transmitted dates.
|
|
377
|
+
*
|
|
378
|
+
* Изменение временной зоны по умолчанию для отправляемых дат
|
|
379
|
+
* @param timezone new time zone/ новая временная зона
|
|
380
|
+
*/
|
|
381
|
+
static setTimezone(t) {
|
|
382
|
+
this.timezone = t;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Determines the current location.
|
|
386
|
+
*
|
|
387
|
+
* Определяет текущую локацию.
|
|
388
|
+
*/
|
|
389
|
+
static findLocation() {
|
|
390
|
+
var t;
|
|
391
|
+
return l() && (this.storage.get() || ((t = document.querySelector("html")) == null ? void 0 : t.lang) || navigator.language || navigator.languages[0] || "en-GB") || "en-GB";
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Determines the current language.
|
|
395
|
+
*
|
|
396
|
+
* Определяет текущий язык.
|
|
397
|
+
* @param code country code, full form language-country or one of them/
|
|
398
|
+
* код страны, полный вид язык-страна или один из них
|
|
399
|
+
*/
|
|
400
|
+
static findLanguage(t) {
|
|
401
|
+
return t && t.match(/[a-z]{2}/) ? this.toLanguage(t) : this.item.language;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Returns the country code by its full language-country.
|
|
405
|
+
*
|
|
406
|
+
* Возвращает код страны по ее полному язык-страна.
|
|
407
|
+
* @param code country code/ код страна
|
|
408
|
+
*/
|
|
409
|
+
static toCountry(t) {
|
|
410
|
+
return t.replace(/[^A-Z]+/g, "");
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Returns the language code by its full language-country.<br>
|
|
414
|
+
* Возвращает код языка по его полному язык-страна.
|
|
415
|
+
* @param code country code/ код страна
|
|
416
|
+
*/
|
|
417
|
+
static toLanguage(t) {
|
|
418
|
+
return t.replace(/[^a-z]+/g, "");
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Adding missing data.<br>
|
|
422
|
+
* Добавление недостающих данных.
|
|
423
|
+
* @param item object with data about the current country/
|
|
424
|
+
* объект с данными об текущей стране
|
|
425
|
+
*/
|
|
426
|
+
static toFull(t) {
|
|
427
|
+
return {
|
|
428
|
+
...t,
|
|
429
|
+
standard: this.toStandard(t),
|
|
430
|
+
firstDay: (t == null ? void 0 : t.firstDay) || "Mo"
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
c(p, "storage", new _(Wt)), c(p, "location"), c(p, "item"), c(p, "language"), c(p, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), p.location = p.findLocation(), p.language = p.findLanguage(p.location), p.item = p.getByCode(p.location);
|
|
435
|
+
let b = p;
|
|
436
|
+
function Ct(i) {
|
|
437
|
+
return l() && i === window;
|
|
438
|
+
}
|
|
439
|
+
function C(i) {
|
|
440
|
+
var t;
|
|
441
|
+
if (l())
|
|
442
|
+
return Ct(i) ? document.body : j(i) ? (t = document.querySelector(i)) != null ? t : void 0 : i;
|
|
443
|
+
}
|
|
444
|
+
function ct(i) {
|
|
445
|
+
return Ct(i) ? i : C(i);
|
|
446
|
+
}
|
|
447
|
+
function Ut(i) {
|
|
448
|
+
var t;
|
|
449
|
+
return !!((t = C(i)) != null && t.closest("html"));
|
|
450
|
+
}
|
|
451
|
+
function z(i) {
|
|
452
|
+
return Array.isArray(i) ? i : [i];
|
|
453
|
+
}
|
|
454
|
+
class ut {
|
|
455
|
+
/**
|
|
456
|
+
* Classes Constructor
|
|
457
|
+
* @param elementSelector element/ элемент
|
|
458
|
+
* @param type type/ тип
|
|
459
|
+
* @param listener the object that receives a notification (an object that implements the
|
|
460
|
+
* Event interface) when an event of the specified type occurs/ объект, который принимает
|
|
461
|
+
* уведомление, когда событие указанного типа произошло
|
|
462
|
+
* @param options object that specifies characteristics/ объект options
|
|
463
|
+
* @param detail an event-dependent value associated with the event/ зависимое от события
|
|
464
|
+
* значение, связанное с событием
|
|
465
|
+
*/
|
|
466
|
+
constructor(t, e = ["click"], s, n, o) {
|
|
467
|
+
/**
|
|
468
|
+
* Element.
|
|
469
|
+
*
|
|
470
|
+
* Элемент.
|
|
471
|
+
*/
|
|
472
|
+
c(this, "element");
|
|
473
|
+
/**
|
|
474
|
+
* Element for checking. If the element is missing in the DOM, the event is turned off.
|
|
475
|
+
*
|
|
476
|
+
* Элемент для проверки. Если элемент отсутствует в DOM, событие выключается.
|
|
477
|
+
*/
|
|
478
|
+
c(this, "elementControl");
|
|
479
|
+
c(this, "elementControlEdit");
|
|
480
|
+
/**
|
|
481
|
+
* A case-sensitive string representing the event type to listen for.
|
|
482
|
+
*
|
|
483
|
+
* Чувствительная к регистру строка, представляющая тип обрабатываемого события.
|
|
484
|
+
*/
|
|
485
|
+
c(this, "type");
|
|
486
|
+
/**
|
|
487
|
+
* The object that receives a notification (an object that implements the Event interface)
|
|
488
|
+
* when an event of the specified type occurs. This must be null, an object with a
|
|
489
|
+
* handleEvent() method, or a JavaScript function.
|
|
490
|
+
*
|
|
491
|
+
* Объект, который принимает уведомление, когда событие указанного типа произошло.
|
|
492
|
+
* Это должен быть объект, реализующий интерфейс EventListener или просто функция JavaScript.
|
|
493
|
+
*/
|
|
494
|
+
c(this, "listenerRecent", (t) => {
|
|
495
|
+
var e, s;
|
|
496
|
+
Ut(this.elementControl) ? ((e = this.listener) == null || e.call(this.element, t, this.detail), m(this.options) && ((s = this.options) != null && s.once) && this.stop()) : this.stop();
|
|
497
|
+
});
|
|
498
|
+
/**
|
|
499
|
+
* Event states.
|
|
500
|
+
*
|
|
501
|
+
* Состояния события.
|
|
502
|
+
*/
|
|
503
|
+
c(this, "activity", !1);
|
|
504
|
+
c(this, "activityItems", []);
|
|
505
|
+
this.listener = s, this.options = n, this.detail = o, this.element = ct(t), this.elementControl = C(t), this.type = z(e);
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Checks whether event listening is currently enabled.
|
|
509
|
+
*
|
|
510
|
+
* Проверяет, включено ли сейчас прослушивание события.
|
|
511
|
+
*/
|
|
512
|
+
isActive() {
|
|
513
|
+
return this.activity;
|
|
514
|
+
}
|
|
515
|
+
getElement() {
|
|
516
|
+
return this.element;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Change of an element for tracking.
|
|
520
|
+
*
|
|
521
|
+
* Изменение элемента для прослеживания.
|
|
522
|
+
* @param elementSelector element/ элемент
|
|
523
|
+
*/
|
|
524
|
+
setElement(t) {
|
|
525
|
+
const e = ct(t);
|
|
526
|
+
return this.elementControlEdit || (this.elementControl = C(t)), this.element = e, this.reset(), this;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Modifies the object that receives the notification.
|
|
530
|
+
*
|
|
531
|
+
* Модифицирует объект, который получает уведомление.
|
|
532
|
+
* @param elementSelector element/ элемент
|
|
533
|
+
*/
|
|
534
|
+
setElementControl(t) {
|
|
535
|
+
return this.elementControl = C(t), this.elementControlEdit = !Y(this.elementControl), this.elementControlEdit || (this.elementControl = C(this.element)), this;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Changes the type of the handled event.
|
|
539
|
+
*
|
|
540
|
+
* Изменяет тип обрабатываемого события.
|
|
541
|
+
* @param type type/ тип
|
|
542
|
+
*/
|
|
543
|
+
setType(t) {
|
|
544
|
+
return this.type = z(t), this.reset(), this;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Modifies the object that receives the notification.
|
|
548
|
+
*
|
|
549
|
+
* Модифицирует объект, который получает уведомление.
|
|
550
|
+
* @param listener
|
|
551
|
+
*/
|
|
552
|
+
setListener(t) {
|
|
553
|
+
return this.listener = t, this;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Modifying the options object that defines the characteristics of an object.
|
|
557
|
+
*
|
|
558
|
+
* Изменение объекта options, который определяет характеристики объекта.
|
|
559
|
+
* @param options
|
|
560
|
+
*/
|
|
561
|
+
setOptions(t) {
|
|
562
|
+
return this.options = t, this.reset(), this;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Modifying a dependent value for the dispatch method.
|
|
566
|
+
*
|
|
567
|
+
* Изменение зависимого значения для метода dispatch.
|
|
568
|
+
* @param detail
|
|
569
|
+
*/
|
|
570
|
+
setDetail(t) {
|
|
571
|
+
return this.detail = t, this;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* The method of the EventTarget sends an Event to the object, (synchronously) invoking
|
|
575
|
+
* the affected EventListeners in the appropriate order.
|
|
576
|
+
*
|
|
577
|
+
* Отправляет событие в общую систему событий. Это событие подчиняется тем же правилам
|
|
578
|
+
* поведения "Захвата" и "Всплывания" как и непосредственно инициированные события.
|
|
579
|
+
* @param detail an event-dependent value associated with the event/ зависимое от события
|
|
580
|
+
* значение, связанное с событием
|
|
581
|
+
*/
|
|
582
|
+
dispatch(t = this.detail) {
|
|
583
|
+
return this.type.forEach(
|
|
584
|
+
(e) => {
|
|
585
|
+
var s;
|
|
586
|
+
return (s = this.element) == null ? void 0 : s.dispatchEvent(new CustomEvent(e, { detail: t }));
|
|
587
|
+
}
|
|
588
|
+
), this;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Starting event listening.
|
|
592
|
+
*
|
|
593
|
+
* Запуск прослушивания события.
|
|
594
|
+
*/
|
|
595
|
+
start() {
|
|
596
|
+
return this.activity || (this.activity = !0, this.activityItems = [], this.type.forEach((t) => {
|
|
597
|
+
this.element && !(t === "resize" && this.makeResize()) && !(t === "scroll-sync" && this.makeScroll()) && (this.element.addEventListener(t, this.listenerRecent, this.options), this.activityItems.push({
|
|
598
|
+
element: this.element,
|
|
599
|
+
type: t
|
|
600
|
+
}));
|
|
601
|
+
})), this;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Stopping event listening.
|
|
605
|
+
*
|
|
606
|
+
* Остановка прослушивания события.
|
|
607
|
+
*/
|
|
608
|
+
stop() {
|
|
609
|
+
return this.activity && (this.activity = !1, this.activityItems.forEach(({
|
|
610
|
+
element: t,
|
|
611
|
+
type: e,
|
|
612
|
+
listener: s,
|
|
613
|
+
observer: n
|
|
614
|
+
}) => {
|
|
615
|
+
n ? n.disconnect() : s ? t == null || t.removeEventListener(e, s) : t == null || t.removeEventListener(e, this.listenerRecent);
|
|
616
|
+
})), this;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Toggling event handler state.
|
|
620
|
+
*
|
|
621
|
+
* Переключение состояния работы события.
|
|
622
|
+
* @param activity event activation/ активация события
|
|
623
|
+
*/
|
|
624
|
+
toggle(t) {
|
|
625
|
+
return t ? this.start() : this.stop();
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Overloads the listening events.
|
|
629
|
+
*
|
|
630
|
+
* Перегружает события прослушивания.
|
|
631
|
+
*/
|
|
632
|
+
reset() {
|
|
633
|
+
return this.activity && (this.stop(), this.start()), this;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Checks if the ResizeObserver object exists.
|
|
637
|
+
*
|
|
638
|
+
* Проверяет, существует ли объект ResizeObserver.
|
|
639
|
+
*/
|
|
640
|
+
isObserver() {
|
|
641
|
+
return "ResizeObserver" in window;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* The implementation of the resize event for an element.
|
|
645
|
+
*
|
|
646
|
+
* Реализация события изменения размера для элемента.
|
|
647
|
+
*/
|
|
648
|
+
makeResize() {
|
|
649
|
+
if (this.element && this.element instanceof HTMLElement && this.element !== document.body && this.isObserver()) {
|
|
650
|
+
const t = new ResizeObserver(
|
|
651
|
+
(e) => this.listenerRecent(e == null ? void 0 : e[0])
|
|
652
|
+
);
|
|
653
|
+
return t.observe(this.element), this.activityItems.push({
|
|
654
|
+
element: this.element,
|
|
655
|
+
type: "resize",
|
|
656
|
+
observer: t
|
|
657
|
+
}), !0;
|
|
658
|
+
}
|
|
659
|
+
return !1;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Implementation of the scroll event for an element.
|
|
663
|
+
*
|
|
664
|
+
* Реализация события изменения положения скролла для элемента.
|
|
665
|
+
*/
|
|
666
|
+
makeScroll() {
|
|
667
|
+
if (this.element) {
|
|
668
|
+
let t = !1;
|
|
669
|
+
const e = (s) => {
|
|
670
|
+
t || (t = !0, requestAnimationFrame(() => {
|
|
671
|
+
this.listenerRecent(s), t = !1;
|
|
672
|
+
}));
|
|
673
|
+
};
|
|
674
|
+
return this.element.addEventListener("scroll", e, this.options), this.element.addEventListener("resize", e, this.options), this.activityItems.push(
|
|
675
|
+
{
|
|
676
|
+
element: this.element,
|
|
677
|
+
type: "scroll",
|
|
678
|
+
listener: e
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
element: this.element,
|
|
682
|
+
type: "resize",
|
|
683
|
+
listener: e
|
|
684
|
+
}
|
|
685
|
+
), !0;
|
|
686
|
+
}
|
|
687
|
+
return !1;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
const ht = "ui-loading", Z = class Z {
|
|
691
|
+
/**
|
|
692
|
+
* Check if the loader is active now.
|
|
693
|
+
*
|
|
694
|
+
* Проверить, активен ли сейчас загрузчик.
|
|
695
|
+
*/
|
|
696
|
+
static is() {
|
|
697
|
+
return this.value > 0;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Shows the loader.
|
|
701
|
+
*
|
|
702
|
+
* Показывает загрузчик.
|
|
703
|
+
*/
|
|
704
|
+
static show() {
|
|
705
|
+
this.value++, this.dispatch();
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Hides the loader.
|
|
709
|
+
*
|
|
710
|
+
* Скрывает загрузчик.
|
|
711
|
+
*/
|
|
712
|
+
static hide() {
|
|
713
|
+
this.is() && (this.value--, this.dispatch());
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Event registration to listen for data changes.
|
|
717
|
+
*
|
|
718
|
+
* Регистрация события для прослушивания изменений данных.
|
|
719
|
+
* @param listener the object that receives a notification (an object that implements the
|
|
720
|
+
* Event interface) when an event of the specified type occurs/ объект, который принимает
|
|
721
|
+
* уведомление, когда событие указанного типа произошло
|
|
722
|
+
* @param element element/ элемент
|
|
723
|
+
*/
|
|
724
|
+
static registrationEvent(t, e) {
|
|
725
|
+
l() && new ut(window, ht, t).setElementControl(e).start();
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Calls the event listener.
|
|
729
|
+
*
|
|
730
|
+
* Вызывает слушателя событий.
|
|
731
|
+
*/
|
|
732
|
+
static dispatch() {
|
|
733
|
+
var t;
|
|
734
|
+
(t = this.event) == null || t.dispatch({ loading: this.is() });
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
c(Z, "value", 0), c(Z, "event"), l() && (Z.event = new ut(window, ht));
|
|
738
|
+
let F = Z;
|
|
739
|
+
class jt {
|
|
740
|
+
constructor() {
|
|
741
|
+
/** Default headers/ Заголовки по умолчанию */
|
|
742
|
+
c(this, "headers", {});
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Getting the header for the request.
|
|
746
|
+
*
|
|
747
|
+
* Получение заголовка для запроса.
|
|
748
|
+
* @param value list of headers/ список заголовков
|
|
749
|
+
* @param type type of request/ тип запроса
|
|
750
|
+
*/
|
|
751
|
+
get(t, e = "application/json;charset=UTF-8") {
|
|
752
|
+
if (t !== null) {
|
|
753
|
+
const s = {
|
|
754
|
+
...this.headers,
|
|
755
|
+
...t || {}
|
|
756
|
+
};
|
|
757
|
+
return D(e) && (s["Content-Type"] = e), s;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Modifies the default header data.
|
|
762
|
+
*
|
|
763
|
+
* Изменяет данные заголовка по умолчанию.
|
|
764
|
+
*/
|
|
765
|
+
set(t) {
|
|
766
|
+
return k(t) && (this.headers = t), this;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
var S = /* @__PURE__ */ ((i) => (i.get = "GET", i.post = "POST", i.put = "PUT", i.delete = "DELETE", i))(S || {});
|
|
770
|
+
class zt {
|
|
771
|
+
constructor() {
|
|
772
|
+
/** Default request data/ Данные запроса по умолчанию */
|
|
773
|
+
c(this, "value");
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Checks if default request data exists.
|
|
777
|
+
*
|
|
778
|
+
* Проверяет, существуют ли данные запроса по умолчанию.
|
|
779
|
+
*/
|
|
780
|
+
is() {
|
|
781
|
+
return !!this.value;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Gets the default request data.
|
|
785
|
+
*
|
|
786
|
+
* Получает данные запроса по умолчанию.
|
|
787
|
+
*/
|
|
788
|
+
get() {
|
|
789
|
+
return this.value;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Adds default data to the request.
|
|
793
|
+
*
|
|
794
|
+
* Добавляет данные по умолчанию к запросу.
|
|
795
|
+
* @param request request data/ данные запроса
|
|
796
|
+
*/
|
|
797
|
+
request(t) {
|
|
798
|
+
const e = this.get();
|
|
799
|
+
if (e) {
|
|
800
|
+
if (t instanceof FormData)
|
|
801
|
+
this.addByFormData(t, e);
|
|
802
|
+
else if (k(t))
|
|
803
|
+
return {
|
|
804
|
+
...e,
|
|
805
|
+
...t
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
return t;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Modifies the default request data.
|
|
812
|
+
*
|
|
813
|
+
* Изменяет данные запроса по умолчанию.
|
|
814
|
+
*/
|
|
815
|
+
set(t) {
|
|
816
|
+
this.value = t;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Adds default data to FormData request.
|
|
820
|
+
*
|
|
821
|
+
* Добавляет данные по умолчанию к запросу FormData.
|
|
822
|
+
* @param request FormData request/ запрос FormData
|
|
823
|
+
* @param value default values/ значения по умолчанию
|
|
824
|
+
*/
|
|
825
|
+
addByFormData(t, e) {
|
|
826
|
+
for (const s in e)
|
|
827
|
+
t.has(s) || t.set(s, e[s]);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
class Ht {
|
|
831
|
+
constructor() {
|
|
832
|
+
c(this, "value");
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Last response data
|
|
836
|
+
*
|
|
837
|
+
* Данные последнего ответа
|
|
838
|
+
*/
|
|
839
|
+
get() {
|
|
840
|
+
return this.value;
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Returns the execution status code.
|
|
844
|
+
*
|
|
845
|
+
* Возвращает код статуса выполнения.
|
|
846
|
+
*/
|
|
847
|
+
getStatus() {
|
|
848
|
+
var t;
|
|
849
|
+
return (t = this.get()) == null ? void 0 : t.status;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Returns the execution status text.
|
|
853
|
+
*
|
|
854
|
+
* Возвращает текст статуса выполнения.
|
|
855
|
+
*/
|
|
856
|
+
getStatusText() {
|
|
857
|
+
var t;
|
|
858
|
+
return (t = this.get()) == null ? void 0 : t.statusText;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Returns the script execution error.
|
|
862
|
+
*
|
|
863
|
+
* Возвращает ошибку выполнения скрипта.
|
|
864
|
+
*/
|
|
865
|
+
getError() {
|
|
866
|
+
var t;
|
|
867
|
+
return (t = this.get()) == null ? void 0 : t.error;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Returns the data of the last request.
|
|
871
|
+
*
|
|
872
|
+
* Возвращает данные последнего запроса.
|
|
873
|
+
*/
|
|
874
|
+
getResponse() {
|
|
875
|
+
var t;
|
|
876
|
+
return (t = this.get()) == null ? void 0 : t.lastResponse;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Returns messages from the last request.
|
|
880
|
+
*
|
|
881
|
+
* Возвращает сообщения от последнего запроса.
|
|
882
|
+
*/
|
|
883
|
+
getMessage() {
|
|
884
|
+
var t;
|
|
885
|
+
return ((t = this.get()) == null ? void 0 : t.lastMessage) || "";
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Sets the status item data.
|
|
889
|
+
*
|
|
890
|
+
* Устанавливает данные элемента статуса.
|
|
891
|
+
* @param data status item data/ данные элемента статуса
|
|
892
|
+
*/
|
|
893
|
+
set(t) {
|
|
894
|
+
return "status" in t && this.setValue("status", t.status), "statusText" in t && this.setValue("statusText", t.statusText), "error" in t && this.setValue("error", t.error), "lastResponse" in t && this.setValue("lastResponse", t.lastResponse), "lastMessage" in t && this.setValue("lastMessage", t.lastMessage), this;
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Sets the status code and optional status text.
|
|
898
|
+
*
|
|
899
|
+
* Устанавливает код статуса и необязательный текст статуса.
|
|
900
|
+
* @param status status code/ код статуса
|
|
901
|
+
* @param statusText optional status text/ необязательный текст статуса
|
|
902
|
+
*/
|
|
903
|
+
setStatus(t, e) {
|
|
904
|
+
return this.set({
|
|
905
|
+
status: t,
|
|
906
|
+
statusText: e
|
|
907
|
+
}), this;
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Sets the error message.
|
|
911
|
+
*
|
|
912
|
+
* Устанавливает сообщение об ошибке.
|
|
913
|
+
* @param error error message/ сообщение об ошибке
|
|
914
|
+
*/
|
|
915
|
+
setError(t) {
|
|
916
|
+
return this.set({ error: t }), this;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Sets the data of the last response.
|
|
920
|
+
*
|
|
921
|
+
* Устанавливает данные последнего ответа.
|
|
922
|
+
* @param response response data/ данные ответа
|
|
923
|
+
*/
|
|
924
|
+
setLastResponse(t) {
|
|
925
|
+
return t && k(t) && "message" in t && this.setLastMessage(String(t.message)), this.set({ lastResponse: t }), this;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Sets messages from the last request.
|
|
929
|
+
*
|
|
930
|
+
* Устанавливает сообщения от последнего запроса.
|
|
931
|
+
* @param message message text/ текст сообщения
|
|
932
|
+
*/
|
|
933
|
+
setLastMessage(t) {
|
|
934
|
+
return this.set({ lastMessage: t }), this;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Sets a specific field in the status item.
|
|
938
|
+
*
|
|
939
|
+
* Устанавливает конкретное поле в элементе статуса.
|
|
940
|
+
* @param name field name/ название поля
|
|
941
|
+
* @param value field value/ значение поля
|
|
942
|
+
*/
|
|
943
|
+
setValue(t, e) {
|
|
944
|
+
this.value || (this.value = {}), this.value[t] = e;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
async function Zt(i) {
|
|
948
|
+
const t = N(i);
|
|
949
|
+
return t instanceof Promise ? await t : t;
|
|
950
|
+
}
|
|
951
|
+
function V(i, t) {
|
|
952
|
+
return Math.floor(Math.random() * (t - i + 1) + i);
|
|
953
|
+
}
|
|
954
|
+
const lt = "d-response-loading";
|
|
955
|
+
class Kt {
|
|
956
|
+
/**
|
|
957
|
+
* Constructor
|
|
958
|
+
* @param requestDefault default request processor/ процессор запросов по умолчанию
|
|
959
|
+
*/
|
|
960
|
+
constructor(t) {
|
|
961
|
+
/** List of first-time API requests/ Список первичных API запросов */
|
|
962
|
+
c(this, "first", []);
|
|
963
|
+
/** Cached responses/ Кешированные ответы */
|
|
964
|
+
c(this, "response", []);
|
|
965
|
+
/** Loading instance/ Экземпляр загрузки */
|
|
966
|
+
c(this, "loading");
|
|
967
|
+
/** Developer mode flag/ Флаг режима разработчика */
|
|
968
|
+
c(this, "devMode", !1);
|
|
969
|
+
this.requestDefault = t;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Checks if there is a global cached request, if there is, returns it.
|
|
973
|
+
*
|
|
974
|
+
* Проверяет, есть ли глобальный кешированный запрос, если есть, возвращает его.
|
|
975
|
+
* @param path link to the request/ ссылка на запрос
|
|
976
|
+
* @param method request method/ метод запроса
|
|
977
|
+
* @param request data for the request/ данные для запроса
|
|
978
|
+
* @param devMode is it developer mode/ является ли режим разработчика
|
|
979
|
+
*/
|
|
980
|
+
get(t = "", e, s, n) {
|
|
981
|
+
return this.response.find((o) => !this.isDisable(o) && this.isPath(o, t) && e === o.method && this.isFirst(o, n) && this.isResponse(o, s) ? (this.isDevMode(n) && console.warn(`Response type: ${o.path}`), this.first.push(o), !0) : !1);
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Returns a list of data about the emulator.
|
|
985
|
+
*
|
|
986
|
+
* Возвращает список данных об эмуляторе.
|
|
987
|
+
*/
|
|
988
|
+
getList() {
|
|
989
|
+
return this.response.filter((t) => t.isForGlobal !== !0);
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Adding cached requests.
|
|
993
|
+
*
|
|
994
|
+
* Добавление кешированных запросов.
|
|
995
|
+
* @param response data for caching/ данные для кеширования
|
|
996
|
+
*/
|
|
997
|
+
add(t) {
|
|
998
|
+
return this.response.push(...z(t)), this;
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Sets developer mode.
|
|
1002
|
+
*
|
|
1003
|
+
* Устанавливает режим разработчика.
|
|
1004
|
+
* @param devMode is it developer mode/ является ли режим разработчика
|
|
1005
|
+
*/
|
|
1006
|
+
setDevMode(t) {
|
|
1007
|
+
return this.devMode = t, this;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* Выполнение эмулятора, если доступно
|
|
1011
|
+
* @param apiFetch property of the request/ свойство запроса
|
|
1012
|
+
*/
|
|
1013
|
+
async emulator(t) {
|
|
1014
|
+
const {
|
|
1015
|
+
path: e = "",
|
|
1016
|
+
method: s = S.get,
|
|
1017
|
+
global: n = s === S.get,
|
|
1018
|
+
devMode: o = !1
|
|
1019
|
+
} = t;
|
|
1020
|
+
if (n || this.isDevMode(o)) {
|
|
1021
|
+
const a = this.requestDefault.request(t.request), u = this.get(e, s, a, o);
|
|
1022
|
+
if (u) {
|
|
1023
|
+
const h = await this.fetch(u, a);
|
|
1024
|
+
return this.isDevMode(o) && console.warn("Response data:", e, a, h), h;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Checks if the cached item is disabled.
|
|
1030
|
+
*
|
|
1031
|
+
* Проверяет, отключен ли кешированный элемент.
|
|
1032
|
+
* @param item cached item/ кешированный элемент
|
|
1033
|
+
*/
|
|
1034
|
+
isDisable(t) {
|
|
1035
|
+
return !!N(t == null ? void 0 : t.disable);
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Checks if the path matches the cached one.
|
|
1039
|
+
*
|
|
1040
|
+
* Проверяет, совпадает ли путь с кешированным.
|
|
1041
|
+
* @param item cached item/ кешированный элемент
|
|
1042
|
+
* @param path request path/ путь запроса
|
|
1043
|
+
*/
|
|
1044
|
+
isPath(t, e) {
|
|
1045
|
+
return e === t.path || !!(t.path instanceof RegExp && e.match(t.path));
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Checks if it is developer mode.
|
|
1049
|
+
*
|
|
1050
|
+
* Проверяет, является ли режимом разработчика.
|
|
1051
|
+
* @param devMode is it developer mode/ является ли режим разработчика
|
|
1052
|
+
*/
|
|
1053
|
+
isDevMode(t) {
|
|
1054
|
+
return t || this.devMode;
|
|
1055
|
+
}
|
|
1056
|
+
/**
|
|
1057
|
+
* Checks if this is the first request.
|
|
1058
|
+
*
|
|
1059
|
+
* Проверяет, является ли это первым запросом.
|
|
1060
|
+
* @param item cached item/ кешированный элемент
|
|
1061
|
+
* @param devMode is it developer mode/ является ли режим разработчика
|
|
1062
|
+
*/
|
|
1063
|
+
isFirst(t, e) {
|
|
1064
|
+
return this.first.indexOf(t) === -1 || this.isDevMode(e);
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Checks if the request matches the cached one.
|
|
1068
|
+
*
|
|
1069
|
+
* Проверяет, совпадает ли запрос с кешированным.
|
|
1070
|
+
* @param item cached item/ кешированный элемент
|
|
1071
|
+
* @param request request data/ данные запроса
|
|
1072
|
+
*/
|
|
1073
|
+
isResponse(t, e) {
|
|
1074
|
+
const s = this.requestDefault.request(t == null ? void 0 : t.request);
|
|
1075
|
+
return e === s || s === "*any" || D(e) && D(s) && k(e) && k(s) && !(e instanceof FormData) && !(s instanceof FormData) && Object.values(e).length === Object.values(s).length && Object.entries(s).reduce(
|
|
1076
|
+
(n, [o, a]) => n && (a === (e == null ? void 0 : e[o]) || a === "*any"),
|
|
1077
|
+
!0
|
|
1078
|
+
);
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Emulates an execution request.
|
|
1082
|
+
*
|
|
1083
|
+
* Эмулирует запрос выполнения.
|
|
1084
|
+
* @param response Data for pre-request/ Данные для пред-запроса
|
|
1085
|
+
* @param request data for the request/ данные для запроса
|
|
1086
|
+
*/
|
|
1087
|
+
fetch(t, e) {
|
|
1088
|
+
return this.startResponseLoading(), new Promise((s) => {
|
|
1089
|
+
Zt(
|
|
1090
|
+
kt(t.response) ? t.response(e) : t.response
|
|
1091
|
+
).then((n) => {
|
|
1092
|
+
t != null && t.lag ? (F.show(), setTimeout(() => {
|
|
1093
|
+
this.stopResponseLoading(), s(n), F.hide();
|
|
1094
|
+
}, V(0, 2e3))) : (this.stopResponseLoading(), s(n));
|
|
1095
|
+
});
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Enable loading for request emulation.
|
|
1100
|
+
*
|
|
1101
|
+
* Включить загрузку для эмуляции запроса.
|
|
1102
|
+
*/
|
|
1103
|
+
startResponseLoading() {
|
|
1104
|
+
this.loading && clearTimeout(this.loading), l() && document.body.classList.add(lt);
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Disable loading for request emulation.
|
|
1108
|
+
*
|
|
1109
|
+
* Отключить загрузку для эмуляции запроса.
|
|
1110
|
+
*/
|
|
1111
|
+
stopResponseLoading() {
|
|
1112
|
+
this.loading = setTimeout(() => {
|
|
1113
|
+
this.loading = void 0, l() && document.body.classList.remove(lt);
|
|
1114
|
+
}, 1200);
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
class Vt {
|
|
1118
|
+
constructor() {
|
|
1119
|
+
/** Function for call before the request/ Функция для вызова перед запросом */
|
|
1120
|
+
c(this, "callback");
|
|
1121
|
+
/** Function for call after the request/ Функция для вызова после запроса */
|
|
1122
|
+
c(this, "callbackEnd");
|
|
1123
|
+
/** Is the preparation in progress/ Идет ли подготовка */
|
|
1124
|
+
c(this, "loading", !1);
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Preparation before executing the request.
|
|
1128
|
+
*
|
|
1129
|
+
* Подготовка перед выполнением запроса.
|
|
1130
|
+
* @param active is preparation active/ активна ли подготовка
|
|
1131
|
+
*/
|
|
1132
|
+
async make(t) {
|
|
1133
|
+
if (t && this.callback)
|
|
1134
|
+
return this.go();
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Analysis of the request after execution.
|
|
1138
|
+
*
|
|
1139
|
+
* Анализ запроса после выполнения.
|
|
1140
|
+
* @param active is preparation active/ активна ли подготовка
|
|
1141
|
+
* @param query data received in the request/ данные, полученные в запросе
|
|
1142
|
+
*/
|
|
1143
|
+
async makeEnd(t, e) {
|
|
1144
|
+
let s = {};
|
|
1145
|
+
return t && this.callbackEnd && (s = await this.callbackEnd(e)), s;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* The function is modified for a call before the request.
|
|
1149
|
+
*
|
|
1150
|
+
* Изменить функцию перед запросом.
|
|
1151
|
+
* @param callback function for call/ функция для вызова
|
|
1152
|
+
*/
|
|
1153
|
+
set(t) {
|
|
1154
|
+
return this.callback = t, this;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Modify the function after the request.
|
|
1158
|
+
*
|
|
1159
|
+
* Изменить функцию после запроса.
|
|
1160
|
+
* @param callback function for call/ функция для вызова
|
|
1161
|
+
*/
|
|
1162
|
+
setEnd(t) {
|
|
1163
|
+
return this.callbackEnd = t, this;
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* To execute preparation.
|
|
1167
|
+
*
|
|
1168
|
+
* Выполнить подготовку.
|
|
1169
|
+
*/
|
|
1170
|
+
async go() {
|
|
1171
|
+
return new Promise((t) => {
|
|
1172
|
+
this.loading ? setTimeout(() => this.go().then(t), 160) : this.callback ? (this.loading = !0, this.callback().then(() => {
|
|
1173
|
+
this.loading = !1, t();
|
|
1174
|
+
})) : t();
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Analysis of the request after execution.
|
|
1179
|
+
*
|
|
1180
|
+
* Анализ запроса после выполнения.
|
|
1181
|
+
* @param query data received in the request/ данные, полученные в запросе
|
|
1182
|
+
*/
|
|
1183
|
+
async end(t) {
|
|
1184
|
+
let e = {};
|
|
1185
|
+
return this.callbackEnd && (e = await this.callbackEnd(t)), e;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
const w = class w {
|
|
1189
|
+
/**
|
|
1190
|
+
* Is the server local.
|
|
1191
|
+
*
|
|
1192
|
+
* Является ли сервер локальный.
|
|
1193
|
+
*/
|
|
1194
|
+
static isLocalhost() {
|
|
1195
|
+
return typeof location == "undefined" || location.hostname === "localhost";
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Returns the status of the last request.
|
|
1199
|
+
*
|
|
1200
|
+
* Возвращает статус последнего запроса.
|
|
1201
|
+
*/
|
|
1202
|
+
static getStatus() {
|
|
1203
|
+
return this.status;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Getting the response handler.
|
|
1207
|
+
*
|
|
1208
|
+
* Получение обработчика ответа.
|
|
1209
|
+
*/
|
|
1210
|
+
static getResponse() {
|
|
1211
|
+
return this.response;
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Getting the full path to the request script.
|
|
1215
|
+
*
|
|
1216
|
+
* Получение полного пути к скрипту запроса.
|
|
1217
|
+
* @param path path to the script/ путь к скрипту
|
|
1218
|
+
* @param api adding a path to the site’s API/ добавление пути к API сайта
|
|
1219
|
+
*/
|
|
1220
|
+
static getUrl(t, e = !0) {
|
|
1221
|
+
return `${e ? this.url : ""}${t}`.replace("{locale}", b.getLocation()).replace("{country}", b.getCountry()).replace("{language}", b.getLanguage());
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Getting data for the body.
|
|
1225
|
+
*
|
|
1226
|
+
* Получение данных для тела.
|
|
1227
|
+
* @param request this request/ данный запрос
|
|
1228
|
+
* @param method method for request/ метод запрос
|
|
1229
|
+
*/
|
|
1230
|
+
static getBody(t = {}, e = S.get) {
|
|
1231
|
+
if (t instanceof FormData)
|
|
1232
|
+
return t;
|
|
1233
|
+
if (e !== S.get && D(t))
|
|
1234
|
+
return j(t) ? t : JSON.stringify(t);
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Getting data for the body of the get method.
|
|
1238
|
+
*
|
|
1239
|
+
* Получение данных для тела метода get.
|
|
1240
|
+
* @param request this request/ данный запрос
|
|
1241
|
+
* @param path path to request/ путь к запрос
|
|
1242
|
+
* @param method method for request/ метод запрос
|
|
1243
|
+
*/
|
|
1244
|
+
static getBodyForGet(t, e = "", s = S.get) {
|
|
1245
|
+
if (s === S.get) {
|
|
1246
|
+
const n = e.match(/\?/) ? "&" : "?", o = typeof t == "object" ? Lt(t) : t;
|
|
1247
|
+
if (D(o))
|
|
1248
|
+
return `${n}${o}`;
|
|
1249
|
+
}
|
|
1250
|
+
return "";
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Modifies the default header data.
|
|
1254
|
+
*
|
|
1255
|
+
* Изменяет данные заголовка по умолчанию.
|
|
1256
|
+
*/
|
|
1257
|
+
static setHeaders(t) {
|
|
1258
|
+
return this.headers.set(t), w;
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Modifies the default request data.
|
|
1262
|
+
*
|
|
1263
|
+
* Изменяет данные запроса по умолчанию.
|
|
1264
|
+
*/
|
|
1265
|
+
static setRequestDefault(t) {
|
|
1266
|
+
return this.requestDefault.set(t), w;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Change the base path to the script.
|
|
1270
|
+
*
|
|
1271
|
+
* Изменить базовый путь к скрипту.
|
|
1272
|
+
* @param url path to the script/ путь к скрипту
|
|
1273
|
+
*/
|
|
1274
|
+
static setUrl(t) {
|
|
1275
|
+
return this.url = t, w;
|
|
1276
|
+
}
|
|
1277
|
+
/**
|
|
1278
|
+
* The function is modified for a call before the request.
|
|
1279
|
+
*
|
|
1280
|
+
* Изменить функцию перед запросом.
|
|
1281
|
+
* @param callback function for call/ функция для вызова
|
|
1282
|
+
*/
|
|
1283
|
+
static setPreparation(t) {
|
|
1284
|
+
return this.preparation.set(t), w;
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Modify the function after the request.
|
|
1288
|
+
*
|
|
1289
|
+
* Изменить функцию после запроса.
|
|
1290
|
+
* @param callback function for call/ функция для вызова
|
|
1291
|
+
*/
|
|
1292
|
+
static setEnd(t) {
|
|
1293
|
+
return this.preparation.setEnd(t), w;
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* To execute a request.
|
|
1297
|
+
*
|
|
1298
|
+
* Выполнить запрос.
|
|
1299
|
+
* @param pathRequest query string or list of parameters/ строка запроса или список параметров
|
|
1300
|
+
*/
|
|
1301
|
+
static async request(t) {
|
|
1302
|
+
return j(t) ? await this.fetch({
|
|
1303
|
+
path: t
|
|
1304
|
+
}) : await this.fetch(t);
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Sends a get method request.
|
|
1308
|
+
*
|
|
1309
|
+
* Отправляет запрос метода get.
|
|
1310
|
+
* @param request list of parameters/ список параметров
|
|
1311
|
+
*/
|
|
1312
|
+
static get(t) {
|
|
1313
|
+
return this.request({
|
|
1314
|
+
...t,
|
|
1315
|
+
method: S.get
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Sends a post method request.
|
|
1320
|
+
*
|
|
1321
|
+
* Отправляет запрос метода post.
|
|
1322
|
+
* @param request list of parameters/ список параметров
|
|
1323
|
+
*/
|
|
1324
|
+
static post(t) {
|
|
1325
|
+
return this.request({
|
|
1326
|
+
...t,
|
|
1327
|
+
method: S.post
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Sends a put method request.
|
|
1332
|
+
*
|
|
1333
|
+
* Отправляет запрос метода put.
|
|
1334
|
+
* @param request list of parameters/ список параметров
|
|
1335
|
+
*/
|
|
1336
|
+
static put(t) {
|
|
1337
|
+
return this.request({
|
|
1338
|
+
...t,
|
|
1339
|
+
method: S.put
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
/**
|
|
1343
|
+
* Sends a delete method request.
|
|
1344
|
+
*
|
|
1345
|
+
* Отправляет запрос метода delete.
|
|
1346
|
+
* @param request list of parameters/ список параметров
|
|
1347
|
+
*/
|
|
1348
|
+
static delete(t) {
|
|
1349
|
+
return this.request({
|
|
1350
|
+
...t,
|
|
1351
|
+
method: S.delete
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* To execute a request.
|
|
1356
|
+
*
|
|
1357
|
+
* Выполнить запрос.
|
|
1358
|
+
* @param apiFetch property of the request/ свойство запроса
|
|
1359
|
+
*/
|
|
1360
|
+
static async fetch(t) {
|
|
1361
|
+
const {
|
|
1362
|
+
toData: e = !0,
|
|
1363
|
+
hideError: s = !1,
|
|
1364
|
+
queryReturn: n = void 0,
|
|
1365
|
+
globalPreparation: o = !0,
|
|
1366
|
+
globalEnd: a = !0
|
|
1367
|
+
} = t, u = await this.response.emulator(t);
|
|
1368
|
+
if (u)
|
|
1369
|
+
return u;
|
|
1370
|
+
let h = {};
|
|
1371
|
+
F.show();
|
|
1372
|
+
try {
|
|
1373
|
+
await this.preparation.make(o);
|
|
1374
|
+
const f = await this.makeQuery(t), d = await this.preparation.makeEnd(a, f);
|
|
1375
|
+
if (this.status.setStatus(
|
|
1376
|
+
f.status,
|
|
1377
|
+
f.statusText
|
|
1378
|
+
), d != null && d.reset)
|
|
1379
|
+
return F.hide(), await this.fetch(t);
|
|
1380
|
+
h = await this.readData(
|
|
1381
|
+
f,
|
|
1382
|
+
n,
|
|
1383
|
+
d
|
|
1384
|
+
);
|
|
1385
|
+
} catch (f) {
|
|
1386
|
+
s || console.error("Api: ", f), this.status.setError(String(f));
|
|
1387
|
+
}
|
|
1388
|
+
return F.hide(), this.makeData(h, e);
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Reading data from the response.
|
|
1392
|
+
*
|
|
1393
|
+
* Чтение данных из ответа.
|
|
1394
|
+
* @param query response from the server/ ответ от сервера
|
|
1395
|
+
* @param queryReturn custom function for reading data/ кастомная функция для чтения данных
|
|
1396
|
+
* @param end finalization data/ данные финализации
|
|
1397
|
+
*/
|
|
1398
|
+
static async readData(t, e, s) {
|
|
1399
|
+
var n;
|
|
1400
|
+
return e ? await e(t) : "data" in s ? s.data : ((n = t.headers.get("Content-Type")) != null ? n : "").match("application/json") ? await t.json() : { data: await t.text() };
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Executing the request.
|
|
1404
|
+
*
|
|
1405
|
+
* Выполнение запроса.
|
|
1406
|
+
* @param apiFetch property of the request/ свойство запроса
|
|
1407
|
+
*/
|
|
1408
|
+
static async makeQuery(t) {
|
|
1409
|
+
const e = this.requestDefault.request(t.request), {
|
|
1410
|
+
api: s = !0,
|
|
1411
|
+
path: n = "",
|
|
1412
|
+
pathFull: o = void 0,
|
|
1413
|
+
method: a = S.get,
|
|
1414
|
+
headers: u = {},
|
|
1415
|
+
type: h = "application/json;charset=UTF-8",
|
|
1416
|
+
init: f = {}
|
|
1417
|
+
} = t, d = o != null ? o : this.getUrl(n, s), E = `${d}${this.getBodyForGet(e, d, a)}`, J = this.headers.get(u, h), Q = {
|
|
1418
|
+
...f,
|
|
1419
|
+
method: a,
|
|
1420
|
+
body: this.getBody(e, a)
|
|
1421
|
+
};
|
|
1422
|
+
return J && (Q.headers = J), await fetch(E, Q);
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Transforms data if needed.
|
|
1426
|
+
*
|
|
1427
|
+
* Преобразует данные, если нужно.
|
|
1428
|
+
* @param data data for transformation/ данные для преобразования
|
|
1429
|
+
* @param toData is it necessary to process the data/ нужно ли обрабатывать данные
|
|
1430
|
+
*/
|
|
1431
|
+
static makeData(t, e) {
|
|
1432
|
+
if (this.status.setLastResponse(t), t && e && k(t) && "data" in t) {
|
|
1433
|
+
if (k(t.data)) {
|
|
1434
|
+
const s = { ...t.data };
|
|
1435
|
+
return "success" in t && (s.success = t.success), s;
|
|
1436
|
+
}
|
|
1437
|
+
return t.data;
|
|
1438
|
+
}
|
|
1439
|
+
return t;
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
c(w, "url", "/api/"), c(w, "headers", new jt()), c(w, "requestDefault", new zt()), c(w, "status", new Ht()), c(w, "response", new Kt(w.requestDefault)), c(w, "preparation", new Vt());
|
|
1443
|
+
let U = w;
|
|
1444
|
+
class ve {
|
|
1445
|
+
/**
|
|
1446
|
+
* Constructor
|
|
1447
|
+
* @param name channel name/ название канала
|
|
1448
|
+
* @param callback callback on message received/ колбэк на получение сообщения
|
|
1449
|
+
*/
|
|
1450
|
+
constructor(t, e) {
|
|
1451
|
+
c(this, "channel");
|
|
1452
|
+
/**
|
|
1453
|
+
* Update state on message received.
|
|
1454
|
+
*
|
|
1455
|
+
* Обновление состояния при получении сообщения.
|
|
1456
|
+
* @param event message event/ событие сообщения
|
|
1457
|
+
*/
|
|
1458
|
+
c(this, "update", (t) => {
|
|
1459
|
+
var e;
|
|
1460
|
+
return (e = this.callback) == null || e.call(this, t), this;
|
|
1461
|
+
});
|
|
1462
|
+
if (this.callback = e, l())
|
|
1463
|
+
try {
|
|
1464
|
+
this.channel = new BroadcastChannel(`${Yt()}__${t}`), this.channel.onmessage = this.update;
|
|
1465
|
+
} catch (s) {
|
|
1466
|
+
console.error(`BroadcastMessage ${t}:`, s);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Send a message to the channel.
|
|
1471
|
+
*
|
|
1472
|
+
* Отправить сообщение в канал.
|
|
1473
|
+
* @param message message to send/ сообщение для отправки
|
|
1474
|
+
*/
|
|
1475
|
+
post(t) {
|
|
1476
|
+
var e;
|
|
1477
|
+
return (e = this.channel) == null || e.postMessage(t), this;
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Set the callback function to be called when a message is received.
|
|
1481
|
+
*
|
|
1482
|
+
* Установить функцию колбэка, которая будет вызвана при получении сообщения.
|
|
1483
|
+
* @param callback callback function/ функция колбэка
|
|
1484
|
+
*/
|
|
1485
|
+
setCallback(t) {
|
|
1486
|
+
return this.callback = t, this;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
const Yt = () => new _("__broadcast-name").get(() => `name_${V(1e6, 9999999)}`);
|
|
1490
|
+
class qt {
|
|
1491
|
+
/**
|
|
1492
|
+
* Constructor
|
|
1493
|
+
* @param callback function for the cache/ функция для кэша
|
|
1494
|
+
*/
|
|
1495
|
+
constructor(t) {
|
|
1496
|
+
c(this, "cache");
|
|
1497
|
+
c(this, "cacheOld");
|
|
1498
|
+
c(this, "comparisons", []);
|
|
1499
|
+
this.callback = t;
|
|
1500
|
+
}
|
|
1501
|
+
/**
|
|
1502
|
+
* Getting data for the cache, and if there is no cache, it performs a function to save the cache.
|
|
1503
|
+
*
|
|
1504
|
+
* Получение данных для кэша, и если нет кэша, выполняет функцию для сохранения кэша.
|
|
1505
|
+
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1506
|
+
*/
|
|
1507
|
+
getCache(t) {
|
|
1508
|
+
return this.isUpdate(t) && (this.cacheOld = this.cache, this.setCache()), this.cache;
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Getting the previous value of the cache.
|
|
1512
|
+
*
|
|
1513
|
+
* Получение предыдущего значения кэша.
|
|
1514
|
+
*/
|
|
1515
|
+
getCacheOld() {
|
|
1516
|
+
return this.cacheOld;
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* Getting data for the cache, and if there is no cache, it performs a function to save the cache (Async).
|
|
1520
|
+
*
|
|
1521
|
+
* Получение данных для кэша, и если нет кэша, выполняет функцию для сохранения кэша (Async).
|
|
1522
|
+
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1523
|
+
*/
|
|
1524
|
+
async getCacheAsync(t) {
|
|
1525
|
+
return this.isUpdate(t) && (this.cacheOld = this.cache, await this.setCacheAsync()), this.cache;
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Overwrites or adds new values for the cache.
|
|
1529
|
+
*
|
|
1530
|
+
* Перезаписывает или добавляет новые значения для кэша.
|
|
1531
|
+
*/
|
|
1532
|
+
setCache() {
|
|
1533
|
+
this.cache = this.callback();
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Overwrites or adds new values for the cache (Async).
|
|
1537
|
+
*
|
|
1538
|
+
* Перезаписывает или добавляет новые значения для кэша (Async).
|
|
1539
|
+
*/
|
|
1540
|
+
async setCacheAsync() {
|
|
1541
|
+
this.cache = await this.callback();
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Checking additional data.
|
|
1545
|
+
*
|
|
1546
|
+
* Проверка дополнительных данных.
|
|
1547
|
+
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1548
|
+
*/
|
|
1549
|
+
isUpdate(t) {
|
|
1550
|
+
return this.cache === void 0 || this.comparisons.length !== t.length || this.comparisons.findIndex((e, s) => e !== t[s]) >= 0 ? (this.comparisons = [...t], !0) : !1;
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
class Jt {
|
|
1554
|
+
constructor() {
|
|
1555
|
+
c(this, "cache", {});
|
|
1556
|
+
}
|
|
1557
|
+
/**
|
|
1558
|
+
* Getting data for the cache, and if there is no cache, it performs a function to save the cache.
|
|
1559
|
+
*
|
|
1560
|
+
* Получение данных для кэша, и если нет кэша, выполняет функцию для сохранения кэша.
|
|
1561
|
+
* @param name cache name/ название кэша
|
|
1562
|
+
* @param callback function for the cache/ функция для кэша
|
|
1563
|
+
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1564
|
+
*/
|
|
1565
|
+
get(t, e, s) {
|
|
1566
|
+
return this.getCacheItem(t, e).getCache(s != null ? s : []);
|
|
1567
|
+
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Getting data for the cache, and if there is no cache, it performs a function to save the cache (Async).
|
|
1570
|
+
*
|
|
1571
|
+
* Получение данных для кэша, и если нет кэша, выполняет функцию для сохранения кэша (Async).
|
|
1572
|
+
* @param name cache name/ название кэша
|
|
1573
|
+
* @param callback function for the cache/ функция для кэша
|
|
1574
|
+
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1575
|
+
*/
|
|
1576
|
+
async getAsync(t, e, s) {
|
|
1577
|
+
return await this.getCacheItem(t, e).getCacheAsync(s != null ? s : []);
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* Returns an instance of the object for working with the cache element.
|
|
1581
|
+
*
|
|
1582
|
+
* Возвращает экземпляр объекта для работы с элементом кэша.
|
|
1583
|
+
* @param name cache name/ название кэша
|
|
1584
|
+
* @param callback function for the cache/ функция для кэша
|
|
1585
|
+
*/
|
|
1586
|
+
getCacheItem(t, e) {
|
|
1587
|
+
return t in this.cache || (this.cache[t] = new qt(e)), this.cache[t];
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
const M = class M {
|
|
1591
|
+
/**
|
|
1592
|
+
* Getting data for the cache, and if there is no cache, it performs a function to save the cache.
|
|
1593
|
+
*
|
|
1594
|
+
* Получение данных для кэша, и если нет кэша, выполняет функцию для сохранения кэша.
|
|
1595
|
+
* @param name cache name/ название кэша
|
|
1596
|
+
* @param callback function for the cache/ функция для кэша
|
|
1597
|
+
* @param comparison additional data for comparison/ дополнительные данные для сравнения
|
|
1598
|
+
*/
|
|
1599
|
+
static get(t, e, s) {
|
|
1600
|
+
return this.cache.get(t, e, s);
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
c(M, "cache"), M.cache = new Jt();
|
|
1604
|
+
let dt = M;
|
|
1605
|
+
function At(i, t = !1) {
|
|
1606
|
+
if (typeof i == "string") {
|
|
1607
|
+
const e = i.trim();
|
|
1608
|
+
switch (e) {
|
|
1609
|
+
case "undefined":
|
|
1610
|
+
return;
|
|
1611
|
+
case "null":
|
|
1612
|
+
return null;
|
|
1613
|
+
case "true":
|
|
1614
|
+
return !0;
|
|
1615
|
+
case "false":
|
|
1616
|
+
return !1;
|
|
1617
|
+
default:
|
|
1618
|
+
if (/^[{[]/.exec(e))
|
|
1619
|
+
try {
|
|
1620
|
+
return JSON.parse(e);
|
|
1621
|
+
} catch (s) {
|
|
1622
|
+
console.error("transformation: JSON error", s);
|
|
1623
|
+
}
|
|
1624
|
+
else {
|
|
1625
|
+
if (/^[0-9]+\.[0-9.]+$/.exec(e))
|
|
1626
|
+
return parseFloat(e);
|
|
1627
|
+
if (/^[0-9]+$/.exec(e))
|
|
1628
|
+
return parseInt(e, 10);
|
|
1629
|
+
if (t && l() && typeof (window == null ? void 0 : window[e]) == "function")
|
|
1630
|
+
return window[e];
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
return i;
|
|
1635
|
+
}
|
|
1636
|
+
const Qt = "cookie-block";
|
|
1637
|
+
class Nt {
|
|
1638
|
+
/**
|
|
1639
|
+
* Obtaining status.
|
|
1640
|
+
*
|
|
1641
|
+
* Получение статуса.
|
|
1642
|
+
*/
|
|
1643
|
+
static get() {
|
|
1644
|
+
var t;
|
|
1645
|
+
return (t = this.storage.get()) != null ? t : !1;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Changing status.
|
|
1649
|
+
*
|
|
1650
|
+
* Изменение статуса.
|
|
1651
|
+
* @param value value to be changed/ значение, на которое будет изменен
|
|
1652
|
+
*/
|
|
1653
|
+
static set(t) {
|
|
1654
|
+
this.storage.set(t);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
c(Nt, "storage", new _(Qt));
|
|
1658
|
+
const X = {}, nt = class nt {
|
|
1659
|
+
constructor(t) {
|
|
1660
|
+
c(this, "value");
|
|
1661
|
+
c(this, "options", {});
|
|
1662
|
+
if (this.name = t, t in T)
|
|
1663
|
+
return T[t];
|
|
1664
|
+
this.value = X == null ? void 0 : X[t], T[t] = this;
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Get data or update if none.
|
|
1668
|
+
*
|
|
1669
|
+
* Получает данные или обновляет, если их нет.
|
|
1670
|
+
* @param defaultValue value or function to change data/ значение или функция для изменения данных
|
|
1671
|
+
* @param options additional parameters/ дополнительные параметры
|
|
1672
|
+
*/
|
|
1673
|
+
get(t, e) {
|
|
1674
|
+
return this.value === void 0 && t && this.set(t, e), this.value;
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* Updates cookie data.
|
|
1678
|
+
*
|
|
1679
|
+
* Обновляет данные cookie.
|
|
1680
|
+
* @param value value or function to change data/ значение или функция для изменения данных
|
|
1681
|
+
* @param options additional parameters/ дополнительные параметры
|
|
1682
|
+
*/
|
|
1683
|
+
set(t, e) {
|
|
1684
|
+
this.value = N(t), Object.assign(this.options, e), this.update();
|
|
1685
|
+
}
|
|
1686
|
+
/**
|
|
1687
|
+
* Delete cookie data.
|
|
1688
|
+
*
|
|
1689
|
+
* Удаление данных из cookie.
|
|
1690
|
+
*/
|
|
1691
|
+
remove() {
|
|
1692
|
+
this.set("");
|
|
1693
|
+
}
|
|
1694
|
+
/**
|
|
1695
|
+
* Returns cache time.
|
|
1696
|
+
*
|
|
1697
|
+
* Возвращает время кэширования.
|
|
1698
|
+
*/
|
|
1699
|
+
getAge() {
|
|
1700
|
+
var t, e;
|
|
1701
|
+
return (e = (t = this.options) == null ? void 0 : t.age) != null ? e : 10080 * 60;
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Update cookie data.
|
|
1705
|
+
*
|
|
1706
|
+
* Обновление данных cookie.
|
|
1707
|
+
*/
|
|
1708
|
+
update() {
|
|
1709
|
+
var t, e, s, n, o;
|
|
1710
|
+
if (l() && !Nt.get()) {
|
|
1711
|
+
const a = String((t = this.value) != null ? t : "");
|
|
1712
|
+
document.cookie = [
|
|
1713
|
+
`${encodeURIComponent(this.name)}=${encodeURIComponent(a)}`,
|
|
1714
|
+
`max-age=${a === "" ? "-1" : this.getAge()}`,
|
|
1715
|
+
`SameSite=${(s = (e = this.options) == null ? void 0 : e.sameSite) != null ? s : "strict"}`,
|
|
1716
|
+
...(o = (n = this.options) == null ? void 0 : n.arguments) != null ? o : []
|
|
1717
|
+
].join("; ");
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
/**
|
|
1721
|
+
* Update data from cookies.
|
|
1722
|
+
*
|
|
1723
|
+
* Обновляет данные из cookies.
|
|
1724
|
+
*/
|
|
1725
|
+
static updateData() {
|
|
1726
|
+
for (const t of document.cookie.split(";")) {
|
|
1727
|
+
const [e, s] = t.trim().split("=");
|
|
1728
|
+
e && D(s) && (X[e] = At(s));
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
l() && nt.updateData();
|
|
1733
|
+
let gt = nt;
|
|
1734
|
+
const T = {};
|
|
1735
|
+
function I(i) {
|
|
1736
|
+
var n, o, a, u, h, f, d, E;
|
|
1737
|
+
if (i instanceof Date)
|
|
1738
|
+
return i;
|
|
1739
|
+
if (Y(i))
|
|
1740
|
+
return /* @__PURE__ */ new Date();
|
|
1741
|
+
if (typeof i == "number")
|
|
1742
|
+
return new Date(i);
|
|
1743
|
+
let t = i, e = b.getTimezoneFormat();
|
|
1744
|
+
i.replace(/^([\s\S]+)([-+]\d{2}:?\d{2})$/, (J, Q, Ft) => (t = Q, e = Ft, J));
|
|
1745
|
+
const s = (E = (d = (f = (h = (u = (a = (o = (n = /^\d{4}\d{2}\d{2}$/.exec(t) && `${t.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3")}T00:00:00`) != null ? n : /^\d{4}\d{2}$/.exec(t) && `${t.replace(/^(\d{4})(\d{2})$/, "$1-$2")}-01T00:00:00`) != null ? o : /^\d{4}\d{2}\d{2} \d{2}:\d{2}:\d{2}$/.exec(t) && t.replace(/^(\d{4})(\d{2})(\d{2}) (\d{2}):(\d{2}):(\d{2})$/, "$1-$2-$3T$4:$5:$6")) != null ? a : /^\d{4}-\d{2}-\d{2}$/.exec(t) && `${t}T00:00:00`) != null ? u : /^\d{4}-\d{2}$/.exec(t) && `${t}-01T00:00:00`) != null ? h : /^\d{4}$/.exec(t) && `${t}-01-01T00:00:00`) != null ? f : /^\d{2}:\d{2}$/.exec(t) && `2000-01-01T${t}:00`) != null ? d : /^\d{2}:\d{2}:\d{2}$/.exec(t) && `2000-01-01T${t}`) != null ? E : t.replace(" ", "T");
|
|
1746
|
+
return /* @__PURE__ */ new Date(`${s}${e}`);
|
|
1747
|
+
}
|
|
1748
|
+
function Xt(i, t) {
|
|
1749
|
+
return g(i, (e) => e == null ? void 0 : e[t]);
|
|
1750
|
+
}
|
|
1751
|
+
class q {
|
|
1752
|
+
/**
|
|
1753
|
+
* Constructor
|
|
1754
|
+
* @param code country code, full form language-country or one of them/
|
|
1755
|
+
* код страны, полный вид язык-страна или один из них
|
|
1756
|
+
*/
|
|
1757
|
+
constructor(t = b.getLocation()) {
|
|
1758
|
+
c(this, "geo");
|
|
1759
|
+
this.geo = b.find(t);
|
|
1760
|
+
const e = this.getLocation();
|
|
1761
|
+
if (e in G)
|
|
1762
|
+
return G[e];
|
|
1763
|
+
G[e] = this;
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Returns an instance of the class according to the specified country code.
|
|
1767
|
+
*
|
|
1768
|
+
* Возвращает экземпляр класса по указанному коду страны.
|
|
1769
|
+
* @param code country code, full form language-country or one of them/
|
|
1770
|
+
* код страны, полный вид язык-страна или один из них
|
|
1771
|
+
*/
|
|
1772
|
+
static getInstance(t = b.getLocation()) {
|
|
1773
|
+
return new q(t);
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* Returns country code and language.
|
|
1777
|
+
*
|
|
1778
|
+
* Возвращает код страны и языка.
|
|
1779
|
+
*/
|
|
1780
|
+
getLocation() {
|
|
1781
|
+
return this.geo.standard;
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Returns the first day of the week.
|
|
1785
|
+
*
|
|
1786
|
+
* Возвращает первый день недели.
|
|
1787
|
+
*/
|
|
1788
|
+
getFirstDay() {
|
|
1789
|
+
return this.geo.firstDay;
|
|
1790
|
+
}
|
|
1791
|
+
/**
|
|
1792
|
+
* The consistent translation of language, region and script display names.
|
|
1793
|
+
*
|
|
1794
|
+
* Последовательный перевод отображаемых названий языка, региона и скрипта.
|
|
1795
|
+
* @param value the code to provide depends on the type/ предоставляемый код зависит от типа
|
|
1796
|
+
* @param typeOptions an object with some or all of the following properties/
|
|
1797
|
+
* объект с некоторыми или всеми из следующих свойств
|
|
1798
|
+
*/
|
|
1799
|
+
display(t, e) {
|
|
1800
|
+
var o;
|
|
1801
|
+
let s = { type: "language" }, n;
|
|
1802
|
+
e && (typeof e == "string" ? s.type = e : s = {
|
|
1803
|
+
...s,
|
|
1804
|
+
...e
|
|
1805
|
+
});
|
|
1806
|
+
try {
|
|
1807
|
+
l() && (t ? n = new Intl.DisplayNames(this.getLocation(), s).of(t) : s.type === "language" ? n = new Intl.DisplayNames(this.getLocation(), s).of(this.geo.language) : s.type === "region" && (n = new Intl.DisplayNames(this.getLocation(), s).of(this.geo.country)));
|
|
1808
|
+
} catch (a) {
|
|
1809
|
+
console.error("display: ", a);
|
|
1810
|
+
}
|
|
1811
|
+
return (o = n != null ? n : t) != null ? o : "";
|
|
1812
|
+
}
|
|
1813
|
+
/**
|
|
1814
|
+
* Get display names of language.
|
|
1815
|
+
*
|
|
1816
|
+
* Получить отображаемые имена языка.
|
|
1817
|
+
* @param value the code to provide depends on the type/ предоставляемый код зависит от типа
|
|
1818
|
+
* @param style the formatting style to use/ используемый стиль форматирования
|
|
1819
|
+
*/
|
|
1820
|
+
languageName(t, e) {
|
|
1821
|
+
const s = {
|
|
1822
|
+
type: "language",
|
|
1823
|
+
style: e
|
|
1824
|
+
};
|
|
1825
|
+
return this.display(b.getByCode(t).language, s);
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Get display names of region.
|
|
1829
|
+
*
|
|
1830
|
+
* Получить отображаемые имена региона.
|
|
1831
|
+
* @param value the code to provide depends on the type/ предоставляемый код зависит от типа
|
|
1832
|
+
* @param style the formatting style to use/ используемый стиль форматирования
|
|
1833
|
+
*/
|
|
1834
|
+
countryName(t, e) {
|
|
1835
|
+
const s = {
|
|
1836
|
+
type: "region",
|
|
1837
|
+
style: e
|
|
1838
|
+
};
|
|
1839
|
+
return this.display(t, s);
|
|
1840
|
+
}
|
|
1841
|
+
/**
|
|
1842
|
+
* The method returns a string containing the full name in a specific format.
|
|
1843
|
+
*
|
|
1844
|
+
* Метод возвращает строку, содержащую полное имя в определённом формате.
|
|
1845
|
+
* @param last last name/ фамилию
|
|
1846
|
+
* @param first first name/ имя
|
|
1847
|
+
* @param surname surname middle name (optional)/ отчество
|
|
1848
|
+
* @param short shorten the names/ сократить названия
|
|
1849
|
+
*/
|
|
1850
|
+
fullName(t, e, s, n) {
|
|
1851
|
+
var u, h;
|
|
1852
|
+
const o = (h = (u = this.geo) == null ? void 0 : u.nameFormat) != null ? h : "fl";
|
|
1853
|
+
let a;
|
|
1854
|
+
switch (o) {
|
|
1855
|
+
case "fsl":
|
|
1856
|
+
a = `${e}${s ? ` ${s}` : ""} ${t}`;
|
|
1857
|
+
break;
|
|
1858
|
+
case "lf":
|
|
1859
|
+
a = `${t} ${e}`;
|
|
1860
|
+
break;
|
|
1861
|
+
case "lsf":
|
|
1862
|
+
a = `${t}${s ? ` ${s}` : ""} ${e}`;
|
|
1863
|
+
break;
|
|
1864
|
+
default:
|
|
1865
|
+
a = `${e} ${t}`;
|
|
1866
|
+
break;
|
|
1867
|
+
}
|
|
1868
|
+
return n ? a.replace(/ (.)[^ ]+/ig, " $1.") : a;
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* In basic use without specifying a locale, a formatted string.
|
|
1872
|
+
*
|
|
1873
|
+
* При обычном использовании без указания локали форматированная строка.
|
|
1874
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
1875
|
+
* @param options an object with some or all properties/ объект с некоторыми
|
|
1876
|
+
* или всеми свойствами
|
|
1877
|
+
*/
|
|
1878
|
+
number(t, e) {
|
|
1879
|
+
var s, n;
|
|
1880
|
+
return ((n = (s = this.numberObject(e)) == null ? void 0 : s.format) == null ? void 0 : n.call(s, L(t))) || t.toString();
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* Decimal point symbol.
|
|
1884
|
+
*
|
|
1885
|
+
* Символ десятичной точки.
|
|
1886
|
+
*/
|
|
1887
|
+
decimal() {
|
|
1888
|
+
var t, e, s, n, o;
|
|
1889
|
+
return ((o = (n = (s = (e = (t = this.numberObject()) == null ? void 0 : t.formatToParts) == null ? void 0 : e.call(t, 1.2)) == null ? void 0 : s.find) == null ? void 0 : n.call(s, (a) => a.type === "decimal")) == null ? void 0 : o.value) || ".";
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Currency formatting.
|
|
1893
|
+
*
|
|
1894
|
+
* Форматирование валюты.
|
|
1895
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
1896
|
+
* @param currencyOptions the currency to use in currency formatting/
|
|
1897
|
+
* валюта для использования в форматировании валюты
|
|
1898
|
+
* @param numberOnly do not display the currency symbol/ не выводить значок валюты
|
|
1899
|
+
*/
|
|
1900
|
+
currency(t, e, s = !1) {
|
|
1901
|
+
const n = {
|
|
1902
|
+
style: "currency",
|
|
1903
|
+
currencyDisplay: "symbol",
|
|
1904
|
+
...typeof e == "string" ? { currency: e } : e || {}
|
|
1905
|
+
}, o = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]{3})$/i, (...a) => (n.currency = String(a[2]).toUpperCase(), String(a[1])));
|
|
1906
|
+
if (s) {
|
|
1907
|
+
const a = this.numberObject(n);
|
|
1908
|
+
return a ? Xt(
|
|
1909
|
+
a.formatToParts(L(t)).filter((u) => ["literal", "currency"].indexOf(u.type) === -1),
|
|
1910
|
+
"value"
|
|
1911
|
+
).join("") : t.toString();
|
|
1912
|
+
} else return "currency" in n ? this.number(
|
|
1913
|
+
typeof t == "number" ? t : o,
|
|
1914
|
+
n
|
|
1915
|
+
) : this.number(
|
|
1916
|
+
typeof t == "number" ? t : o,
|
|
1917
|
+
{
|
|
1918
|
+
...n,
|
|
1919
|
+
style: "decimal"
|
|
1920
|
+
}
|
|
1921
|
+
);
|
|
1922
|
+
}
|
|
1923
|
+
/**
|
|
1924
|
+
* Returns the currency symbol if it exists, otherwise the currency code.
|
|
1925
|
+
*
|
|
1926
|
+
* Возвращает символ для валюты, если он есть, или сам код валюты.
|
|
1927
|
+
* @param currency the currency to use in currency formatting/
|
|
1928
|
+
* валюта для использования в форматировании валюты
|
|
1929
|
+
* @param currencyDisplay how to display the currency in currency formatting/
|
|
1930
|
+
* как отобразить валюту в формате валюты
|
|
1931
|
+
*/
|
|
1932
|
+
currencySymbol(t, e = "symbol") {
|
|
1933
|
+
var s, n, o, a, u;
|
|
1934
|
+
return ((u = (a = (o = (n = (s = this.numberObject({
|
|
1935
|
+
style: "currency",
|
|
1936
|
+
currencyDisplay: e,
|
|
1937
|
+
currency: t
|
|
1938
|
+
})) == null ? void 0 : s.formatToParts) == null ? void 0 : n.call(s, 100)) == null ? void 0 : o.find) == null ? void 0 : a.call(o, (h) => h.type === "currency")) == null ? void 0 : u.value) || t;
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Unit formatting.
|
|
1942
|
+
* If the style is 'unit', a unit property must be provided.
|
|
1943
|
+
*
|
|
1944
|
+
* Форматирование юнитов.
|
|
1945
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
1946
|
+
* @param unitOptions the unit to use in unit formatting/ блок для использования
|
|
1947
|
+
* в форматировании блока
|
|
1948
|
+
*/
|
|
1949
|
+
unit(t, e) {
|
|
1950
|
+
const s = {
|
|
1951
|
+
style: "unit",
|
|
1952
|
+
...typeof e == "string" ? { unit: e } : e || {}
|
|
1953
|
+
}, n = t.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]+)$/i, (...o) => (s.unit = String(o[2]).toLowerCase(), String(o[1])));
|
|
1954
|
+
return this.number(n, s);
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Возвращает отформатированный размер файла
|
|
1958
|
+
* @param value a number, bigint, or string, to format /<br>число для форматирования
|
|
1959
|
+
* @param unitOptions the unit to use in unit formatting /<br>блок для использования
|
|
1960
|
+
* в форматировании блока
|
|
1961
|
+
*/
|
|
1962
|
+
sizeFile(t, e = "byte") {
|
|
1963
|
+
const s = L(t);
|
|
1964
|
+
if (s > 1024 && j(e))
|
|
1965
|
+
switch (e) {
|
|
1966
|
+
case "byte":
|
|
1967
|
+
return this.sizeFile(s / 1024, "kilobyte");
|
|
1968
|
+
case "kilobyte":
|
|
1969
|
+
return this.sizeFile(s / 1024, "megabyte");
|
|
1970
|
+
case "megabyte":
|
|
1971
|
+
return this.sizeFile(s / 1024, "gigabyte");
|
|
1972
|
+
case "gigabyte":
|
|
1973
|
+
return this.sizeFile(s / 1024, "terabyte");
|
|
1974
|
+
case "terabyte":
|
|
1975
|
+
return this.sizeFile(s / 1024, "petabyte");
|
|
1976
|
+
}
|
|
1977
|
+
return this.unit(t, e);
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Number as a percentage.
|
|
1981
|
+
*
|
|
1982
|
+
* Число в виде процента.
|
|
1983
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
1984
|
+
* @param options an object with some or all properties/ объект с некоторыми или всеми свойствами
|
|
1985
|
+
*/
|
|
1986
|
+
percent(t, e) {
|
|
1987
|
+
return this.number(t, {
|
|
1988
|
+
style: "percent",
|
|
1989
|
+
...e || {}
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
/**
|
|
1993
|
+
* Number as a percentage (unit).
|
|
1994
|
+
*
|
|
1995
|
+
* Число в виде процента (единица).
|
|
1996
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
1997
|
+
* @param options an object with some or all properties/
|
|
1998
|
+
* объект с некоторыми или всеми свойствами
|
|
1999
|
+
*/
|
|
2000
|
+
percentBy100(t, e) {
|
|
2001
|
+
return this.percent(L(t) / 100, e);
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Применять форматирование, учитывающее множественное число, и языковые правила, связанные с множественным числом
|
|
2005
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
2006
|
+
* @param words list of words for formatting (in the format one|two|few|many|other|zero)/
|
|
2007
|
+
* список слов для форматирования (в формате `one|two|few|many|other|zero`)
|
|
2008
|
+
* @param options Property for PluralRules/ свойство для PluralRules
|
|
2009
|
+
* @param optionsNumber an object with some or all properties/ объект с некоторыми или всеми свойствами
|
|
2010
|
+
*/
|
|
2011
|
+
plural(t, e, s, n) {
|
|
2012
|
+
var u;
|
|
2013
|
+
const o = L(t), a = e.split("|");
|
|
2014
|
+
if (a.length > 1)
|
|
2015
|
+
try {
|
|
2016
|
+
if (l()) {
|
|
2017
|
+
const f = new Intl.PluralRules(this.getLocation(), s).select(o);
|
|
2018
|
+
let d;
|
|
2019
|
+
switch (f) {
|
|
2020
|
+
case "zero":
|
|
2021
|
+
d = a[a.length - 1];
|
|
2022
|
+
break;
|
|
2023
|
+
case "one":
|
|
2024
|
+
d = a == null ? void 0 : a[0];
|
|
2025
|
+
break;
|
|
2026
|
+
case "two":
|
|
2027
|
+
d = a == null ? void 0 : a[1];
|
|
2028
|
+
break;
|
|
2029
|
+
case "few":
|
|
2030
|
+
d = a != null && a[3] ? a == null ? void 0 : a[2] : a == null ? void 0 : a[1];
|
|
2031
|
+
break;
|
|
2032
|
+
case "many":
|
|
2033
|
+
d = (a == null ? void 0 : a[3]) || (a == null ? void 0 : a[2]) || (a == null ? void 0 : a[1]);
|
|
2034
|
+
break;
|
|
2035
|
+
case "other":
|
|
2036
|
+
a.length === 6 ? d = a[a.length - 2] : d = a[a.length - 1];
|
|
2037
|
+
break;
|
|
2038
|
+
}
|
|
2039
|
+
return `${this.number(o, n)} ${d != null ? d : ""}`.trim();
|
|
2040
|
+
}
|
|
2041
|
+
} catch (h) {
|
|
2042
|
+
console.error("plural: ", h);
|
|
2043
|
+
}
|
|
2044
|
+
return `${this.number(o, n)} ${(u = a == null ? void 0 : a[0]) != null ? u : ""}`.trim();
|
|
2045
|
+
}
|
|
2046
|
+
/**
|
|
2047
|
+
* Enables language-sensitive date and time formatting.
|
|
2048
|
+
*
|
|
2049
|
+
* Конструктором объектов, включающих языка-зависимое форматирование даты и времени.
|
|
2050
|
+
* @param value the date to format/ дата для форматирования
|
|
2051
|
+
* @param type type of data format/ тип формата data
|
|
2052
|
+
* @param styleOptions the representation of the month/ представление месяца
|
|
2053
|
+
* @param hour24 whether to use 12-hour time/ использовать ли 12-часовое время
|
|
2054
|
+
*/
|
|
2055
|
+
date(t, e, s, n) {
|
|
2056
|
+
const o = I(t), a = typeof s == "string", u = this.dateOptions(e, a ? s : "short");
|
|
2057
|
+
return n && (u.hour12 = !1), a || Object.assign(u, s), o.toLocaleString(this.getLocation(), u);
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* Enables language-sensitive relative time formatting.
|
|
2061
|
+
*
|
|
2062
|
+
* Включает форматирование относительного времени с учетом языка.
|
|
2063
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
2064
|
+
* @param styleOptions the length of the internationalized message/
|
|
2065
|
+
* длина интернационализированного сообщения
|
|
2066
|
+
* @param todayValue current day/ текущий день
|
|
2067
|
+
*/
|
|
2068
|
+
relative(t, e, s) {
|
|
2069
|
+
const n = I(t), o = s || /* @__PURE__ */ new Date(), a = {
|
|
2070
|
+
numeric: "auto",
|
|
2071
|
+
...typeof e == "string" ? { style: e } : e || {}
|
|
2072
|
+
};
|
|
2073
|
+
let u = "second", h = (n.getTime() - o.getTime()) / 1e3;
|
|
2074
|
+
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, a);
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Enables language-sensitive relative time formatting
|
|
2078
|
+
* Including the ability to add a limit to output the standard time format if the value
|
|
2079
|
+
* exceeds the allowable limit.
|
|
2080
|
+
*
|
|
2081
|
+
* Включает форматирование относительного времени с учетом языка.
|
|
2082
|
+
* Включая возможность добавления лимита, чтобы выводить уже стандартный формат времени,
|
|
2083
|
+
* если значение вышло за пределы допустимого.
|
|
2084
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
2085
|
+
* @param limit values that determine the output limit (values per day)/
|
|
2086
|
+
* значения, по которым определяем предел вывода (значения в день)
|
|
2087
|
+
* @param todayValue current day/ текущий день
|
|
2088
|
+
* @param relativeOptions the length of the internationalized message/
|
|
2089
|
+
* длина интернационализированного сообщения
|
|
2090
|
+
* @param dateOptions the representation of the month/ представление месяца
|
|
2091
|
+
* @param type type of data format/ тип формата data
|
|
2092
|
+
* @param hour24 whether to use 12-hour time/ использовать ли 12-часовое время
|
|
2093
|
+
*/
|
|
2094
|
+
relativeLimit(t, e, s, n, o, a, u) {
|
|
2095
|
+
const h = I(t), f = s || /* @__PURE__ */ new Date(), d = new Date(f), E = new Date(f);
|
|
2096
|
+
return d.setDate(f.getDate() - e), E.setDate(f.getDate() + e), h >= d && h <= E ? this.relative(
|
|
2097
|
+
h,
|
|
2098
|
+
n,
|
|
2099
|
+
f
|
|
2100
|
+
) : this.date(
|
|
2101
|
+
h,
|
|
2102
|
+
a,
|
|
2103
|
+
o,
|
|
2104
|
+
u
|
|
2105
|
+
);
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* Возвращает отформатированное значение времени, прошедшего с момента события
|
|
2109
|
+
* @param value a number, bigint, or string, to format/ число для форматирования
|
|
2110
|
+
* @param unit time unit/ единица времени
|
|
2111
|
+
* @param styleOptions additional option or formatting style/ дополнительная опция или стиль форматирования
|
|
2112
|
+
*/
|
|
2113
|
+
relativeByValue(t, e, s) {
|
|
2114
|
+
const n = {
|
|
2115
|
+
numeric: "auto",
|
|
2116
|
+
...typeof s == "string" ? { style: s } : s || {}
|
|
2117
|
+
};
|
|
2118
|
+
try {
|
|
2119
|
+
if (l())
|
|
2120
|
+
return new Intl.RelativeTimeFormat(this.getLocation(), n).format(Math.round(L(t)), e);
|
|
2121
|
+
} catch (o) {
|
|
2122
|
+
console.error("relative: ", o);
|
|
2123
|
+
}
|
|
2124
|
+
return "";
|
|
2125
|
+
}
|
|
2126
|
+
/**
|
|
2127
|
+
* Names of months.<br>
|
|
2128
|
+
* Названия месяцев.
|
|
2129
|
+
* @param value the date to format/ дата для форматирования
|
|
2130
|
+
* @param style the representation of the month/ представление месяца
|
|
2131
|
+
*/
|
|
2132
|
+
month(t, e) {
|
|
2133
|
+
try {
|
|
2134
|
+
if (l())
|
|
2135
|
+
return Intl.DateTimeFormat(this.getLocation(), { month: e || "long" }).format(I(t));
|
|
2136
|
+
} catch (s) {
|
|
2137
|
+
console.error("month: ", s);
|
|
2138
|
+
}
|
|
2139
|
+
return "";
|
|
2140
|
+
}
|
|
2141
|
+
/**
|
|
2142
|
+
* Array to list of months.
|
|
2143
|
+
*
|
|
2144
|
+
* Массив в список месяцев.
|
|
2145
|
+
* @param style the representation of the month/ представление месяца
|
|
2146
|
+
*/
|
|
2147
|
+
months(t) {
|
|
2148
|
+
const e = [{
|
|
2149
|
+
label: "",
|
|
2150
|
+
value: void 0
|
|
2151
|
+
}];
|
|
2152
|
+
try {
|
|
2153
|
+
if (l()) {
|
|
2154
|
+
const s = /* @__PURE__ */ new Date(), n = Intl.DateTimeFormat(this.getLocation(), { month: t || "long" });
|
|
2155
|
+
for (let o = 0; o < 12; o++)
|
|
2156
|
+
s.setMonth(o), e.push({
|
|
2157
|
+
label: n.format(s).replace(/^./, (a) => a.toUpperCase()),
|
|
2158
|
+
value: o + 1
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2161
|
+
} catch (s) {
|
|
2162
|
+
console.error("months: ", s);
|
|
2163
|
+
}
|
|
2164
|
+
return e;
|
|
2165
|
+
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Returns names of days of the week.
|
|
2168
|
+
*
|
|
2169
|
+
* Возвращает названия дней недели.
|
|
2170
|
+
* @param value the date to format/ дата для форматирования
|
|
2171
|
+
* @param style the representation of the weekday/ представление о дне недели
|
|
2172
|
+
*/
|
|
2173
|
+
weekday(t, e) {
|
|
2174
|
+
try {
|
|
2175
|
+
if (l())
|
|
2176
|
+
return Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }).format(I(t));
|
|
2177
|
+
} catch (s) {
|
|
2178
|
+
console.error("weekday: ", s);
|
|
2179
|
+
}
|
|
2180
|
+
return "";
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* An array of the list of names of the days of the week.
|
|
2184
|
+
*
|
|
2185
|
+
* Массив из списка названий дней недели.
|
|
2186
|
+
* @param style the representation of the weekday/ представление о дне недели
|
|
2187
|
+
*/
|
|
2188
|
+
weekdays(t) {
|
|
2189
|
+
const e = [{
|
|
2190
|
+
label: "",
|
|
2191
|
+
value: void 0
|
|
2192
|
+
}];
|
|
2193
|
+
try {
|
|
2194
|
+
if (l()) {
|
|
2195
|
+
const s = /* @__PURE__ */ new Date(), n = Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }), o = s.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
|
|
2196
|
+
s.setDate(s.getDate() - o);
|
|
2197
|
+
for (let a = 0; a < 7; a++)
|
|
2198
|
+
e.push({
|
|
2199
|
+
label: n.format(s).replace(/^./, (u) => u.toUpperCase()),
|
|
2200
|
+
value: s.getDay()
|
|
2201
|
+
}), s.setDate(s.getDate() + 1);
|
|
2202
|
+
}
|
|
2203
|
+
} catch (s) {
|
|
2204
|
+
console.error("weekdays: ", s);
|
|
2205
|
+
}
|
|
2206
|
+
return e;
|
|
2207
|
+
}
|
|
2208
|
+
/**
|
|
2209
|
+
* Time.
|
|
2210
|
+
*
|
|
2211
|
+
* Время.
|
|
2212
|
+
* @param value the date to format/ дата для форматирования
|
|
2213
|
+
*/
|
|
2214
|
+
time(t) {
|
|
2215
|
+
return this.date(t, "time");
|
|
2216
|
+
}
|
|
2217
|
+
/**
|
|
2218
|
+
* Sorts strings taking into account the characteristics of countries.
|
|
2219
|
+
*
|
|
2220
|
+
* Сортирует строки с учетом особенностей стран.
|
|
2221
|
+
* @param data an array with data/ массив с данными
|
|
2222
|
+
* @param compareFn a function for sorting/ функция для сортировки
|
|
2223
|
+
*/
|
|
2224
|
+
sort(t, e = (s, n) => [s, n]) {
|
|
2225
|
+
if (l()) {
|
|
2226
|
+
const s = new Intl.Collator(this.getLocation());
|
|
2227
|
+
return t.sort((n, o) => s.compare(...e(n, o)));
|
|
2228
|
+
}
|
|
2229
|
+
return t;
|
|
2230
|
+
}
|
|
2231
|
+
/**
|
|
2232
|
+
* The object enables language-sensitive number formatting.
|
|
2233
|
+
*
|
|
2234
|
+
* Объект включает форматирование чисел с учетом языка.
|
|
2235
|
+
* @param options an object with some or all properties/
|
|
2236
|
+
* объект с некоторыми или всеми свойствами
|
|
2237
|
+
*/
|
|
2238
|
+
numberObject(t) {
|
|
2239
|
+
try {
|
|
2240
|
+
if (l())
|
|
2241
|
+
return new Intl.NumberFormat(this.getLocation(), t);
|
|
2242
|
+
} catch (e) {
|
|
2243
|
+
console.error("numberObject: ", e);
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Returns options for data according to its type.
|
|
2248
|
+
*
|
|
2249
|
+
* Возвращает options для data по его типу.
|
|
2250
|
+
* @param type type of data format/ тип формата data
|
|
2251
|
+
* @param display the representation of the month/ представление месяца
|
|
2252
|
+
*/
|
|
2253
|
+
dateOptions(t, e = "short") {
|
|
2254
|
+
const s = {};
|
|
2255
|
+
return ["full", "datetime", "date", void 0, "year-month", "year"].indexOf(t) !== -1 && (s.year = "numeric"), ["full", "datetime", "date", void 0, "year-month", "month", "day-month"].indexOf(t) !== -1 && (s.month = e), ["full", "datetime", "date", void 0, "day", "day-month"].indexOf(t) !== -1 && (s.day = "2-digit"), t !== void 0 && (["full", "datetime", "time", "hour-minute", "hour"].indexOf(t) !== -1 && (s.hour = "2-digit"), ["full", "datetime", "time", "hour-minute", "minute"].indexOf(t) !== -1 && (s.minute = "2-digit"), ["full", "time", "second"].indexOf(t) !== -1 && (s.second = "2-digit")), s;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
const G = {};
|
|
2259
|
+
class Et {
|
|
2260
|
+
/**
|
|
2261
|
+
* Constructor
|
|
2262
|
+
* @param date date for processing/ дата для обработки
|
|
2263
|
+
* @param type type of date format for output/ тип формата даты вывода
|
|
2264
|
+
* @param code country and language code/ код страны и языка
|
|
2265
|
+
*/
|
|
2266
|
+
constructor(t, e = "date", s = b.getLocation()) {
|
|
2267
|
+
c(this, "date");
|
|
2268
|
+
c(this, "hour24", !1);
|
|
2269
|
+
c(this, "watch");
|
|
2270
|
+
this.type = e, this.code = s, this.date = I(t);
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* Returns an object for working with formatting.
|
|
2274
|
+
*
|
|
2275
|
+
* Возвращает объект для работы с форматированием.
|
|
2276
|
+
*/
|
|
2277
|
+
getIntl() {
|
|
2278
|
+
return new q(this.code);
|
|
2279
|
+
}
|
|
2280
|
+
/**
|
|
2281
|
+
* Returns a Date object.
|
|
2282
|
+
*
|
|
2283
|
+
* Возвращает объект Date.
|
|
2284
|
+
*/
|
|
2285
|
+
getDate() {
|
|
2286
|
+
return this.date;
|
|
2287
|
+
}
|
|
2288
|
+
/**
|
|
2289
|
+
* Returns the type of data output.
|
|
2290
|
+
*
|
|
2291
|
+
* Возвращает тип вывода данных.
|
|
2292
|
+
*/
|
|
2293
|
+
getType() {
|
|
2294
|
+
return this.type;
|
|
2295
|
+
}
|
|
2296
|
+
/**
|
|
2297
|
+
* Returns the format of hours.
|
|
2298
|
+
*
|
|
2299
|
+
* Возвращает формат часов.
|
|
2300
|
+
*/
|
|
2301
|
+
getHoursType() {
|
|
2302
|
+
const t = this.clone();
|
|
2303
|
+
return t.setHours(23), t.toLocaleTimeString(this.getIntl().getLocation(), { hour: "2-digit" }).match(/23/ig) ? "24" : "12";
|
|
2304
|
+
}
|
|
2305
|
+
/**
|
|
2306
|
+
* Whether to use 12-hour time.
|
|
2307
|
+
*
|
|
2308
|
+
* Использовать ли 12-часовой формат времени.
|
|
2309
|
+
*/
|
|
2310
|
+
getHour24() {
|
|
2311
|
+
return this.hour24;
|
|
2312
|
+
}
|
|
2313
|
+
/**
|
|
2314
|
+
* The method returns the difference, in minutes, between
|
|
2315
|
+
* a date as evaluated in the UTC time zone, and the same date as evaluated
|
|
2316
|
+
* in the local time zone.
|
|
2317
|
+
*
|
|
2318
|
+
* Метод возвращает смещение часового пояса относительно часового пояса UTC
|
|
2319
|
+
* в минутах для текущей локали.
|
|
2320
|
+
*/
|
|
2321
|
+
getTimeZoneOffset() {
|
|
2322
|
+
return this.date.getTimezoneOffset();
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* Returns the time zone as a string.
|
|
2326
|
+
*
|
|
2327
|
+
* Возвращает временную зону в виде строки.
|
|
2328
|
+
* @param style the style of the returned data/ стиль возвращаемых данных
|
|
2329
|
+
*/
|
|
2330
|
+
getTimeZone(t) {
|
|
2331
|
+
const e = this.getTimeZoneOffset();
|
|
2332
|
+
if (t === "minute")
|
|
2333
|
+
return e.toString();
|
|
2334
|
+
const s = e / 60 * -1;
|
|
2335
|
+
if (t === "hour")
|
|
2336
|
+
return this.getIntl().number(Math.trunc(s), { signDisplay: "always" });
|
|
2337
|
+
const n = this.getIntl().number(Math.trunc(s), {
|
|
2338
|
+
signDisplay: "always",
|
|
2339
|
+
minimumIntegerDigits: 2
|
|
2340
|
+
}), o = s.toString().match(/.\d+/) ? "30" : "00";
|
|
2341
|
+
return t === "RFC" ? `${n}${o}` : `${n}:${o}`;
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* Returns the code of the first day of the week.
|
|
2345
|
+
*
|
|
2346
|
+
* Возвращает код первого дня недели.
|
|
2347
|
+
*/
|
|
2348
|
+
getFirstDayCode() {
|
|
2349
|
+
const t = this.getIntl().getFirstDay();
|
|
2350
|
+
return t === "Sa" ? 6 : t === "Su" ? 0 : 1;
|
|
2351
|
+
}
|
|
2352
|
+
/**
|
|
2353
|
+
* The method returns the year of the specified date according to local time.
|
|
2354
|
+
*
|
|
2355
|
+
* Метод возвращает год указанной даты по местному времени.
|
|
2356
|
+
*/
|
|
2357
|
+
getYear() {
|
|
2358
|
+
return this.date.getFullYear();
|
|
2359
|
+
}
|
|
2360
|
+
/**
|
|
2361
|
+
* The method returns the month in the specified date according to local time,
|
|
2362
|
+
* as a zero-based value.
|
|
2363
|
+
*
|
|
2364
|
+
* Метод возвращает месяц указанной даты по местному времени, нумерация
|
|
2365
|
+
* месяцев начинается с нуля для первого месяца в году.
|
|
2366
|
+
*/
|
|
2367
|
+
getMonth() {
|
|
2368
|
+
return this.date.getMonth() + 1;
|
|
2369
|
+
}
|
|
2370
|
+
/**
|
|
2371
|
+
* The method returns the day of the month for the specified date according to local time.
|
|
2372
|
+
*
|
|
2373
|
+
* Метод возвращает день месяца указанной даты по местному времени
|
|
2374
|
+
*/
|
|
2375
|
+
getDay() {
|
|
2376
|
+
return this.date.getDate();
|
|
2377
|
+
}
|
|
2378
|
+
/**
|
|
2379
|
+
* The method returns the hour for the specified date, according to local time.
|
|
2380
|
+
*
|
|
2381
|
+
* Метод возвращает часы указанной даты по местному времени.
|
|
2382
|
+
*/
|
|
2383
|
+
getHour() {
|
|
2384
|
+
return this.date.getHours();
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* The method returns the minutes in the specified date according to local time.
|
|
2388
|
+
*
|
|
2389
|
+
* Метод возвращает минуты указанной даты по местному времени.
|
|
2390
|
+
*/
|
|
2391
|
+
getMinute() {
|
|
2392
|
+
return this.date.getMinutes();
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* The method returns the seconds in the specified date according to local time.
|
|
2396
|
+
*
|
|
2397
|
+
* Метод возвращает секунды указанной даты по местному времени.
|
|
2398
|
+
*/
|
|
2399
|
+
getSecond() {
|
|
2400
|
+
return this.date.getSeconds();
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Returns the last day of the week.
|
|
2404
|
+
*
|
|
2405
|
+
* Возвращает последний день недели.
|
|
2406
|
+
*/
|
|
2407
|
+
getMaxDay() {
|
|
2408
|
+
return this.getMonth() > 0 ? this.cloneDayLast().getDay() : 0;
|
|
2409
|
+
}
|
|
2410
|
+
/**
|
|
2411
|
+
* Enables language-sensitive date and time formatting.
|
|
2412
|
+
*
|
|
2413
|
+
* Конструктором объектов, включающих языка-зависимое форматирование даты и времени.
|
|
2414
|
+
* @param type type of date format for output/ тип формата даты вывода
|
|
2415
|
+
* @param styleOptions the representation of the month/ представление месяца
|
|
2416
|
+
*/
|
|
2417
|
+
locale(t = this.type, e) {
|
|
2418
|
+
return this.getIntl().date(
|
|
2419
|
+
this.date,
|
|
2420
|
+
t,
|
|
2421
|
+
e,
|
|
2422
|
+
this.hour24
|
|
2423
|
+
);
|
|
2424
|
+
}
|
|
2425
|
+
/**
|
|
2426
|
+
* Returns the formatted year.
|
|
2427
|
+
*
|
|
2428
|
+
* Возвращает отформатированный год.
|
|
2429
|
+
* @param style the representation of the month/ представление месяца
|
|
2430
|
+
*/
|
|
2431
|
+
localeYear(t = "numeric") {
|
|
2432
|
+
return this.locale("year", { year: t });
|
|
2433
|
+
}
|
|
2434
|
+
/**
|
|
2435
|
+
* Returns the formatted month.
|
|
2436
|
+
*
|
|
2437
|
+
* Возвращает отформатированный месяц.
|
|
2438
|
+
* @param style the representation of the month/ представление месяца
|
|
2439
|
+
*/
|
|
2440
|
+
localeMonth(t = "long") {
|
|
2441
|
+
return this.locale("month", { month: t });
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* Returns the formatted day.
|
|
2445
|
+
*
|
|
2446
|
+
* Возвращает отформатированный день.
|
|
2447
|
+
* @param style the representation of the month/ представление месяца
|
|
2448
|
+
*/
|
|
2449
|
+
localeDay(t = "numeric") {
|
|
2450
|
+
return this.locale("day", { day: t });
|
|
2451
|
+
}
|
|
2452
|
+
/**
|
|
2453
|
+
* Returns the formatted hour.
|
|
2454
|
+
*
|
|
2455
|
+
* Возвращает отформатированный час.
|
|
2456
|
+
* @param style the representation of the month/ представление месяца
|
|
2457
|
+
*/
|
|
2458
|
+
localeHour(t = "numeric") {
|
|
2459
|
+
return this.locale("hour", { hour: t });
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* Returns the formatted minute.
|
|
2463
|
+
*
|
|
2464
|
+
* Возвращает отформатированную минуту.
|
|
2465
|
+
* @param style the representation of the month/ представление месяца
|
|
2466
|
+
*/
|
|
2467
|
+
localeMinute(t = "numeric") {
|
|
2468
|
+
return this.locale("minute", { minute: t });
|
|
2469
|
+
}
|
|
2470
|
+
/**
|
|
2471
|
+
* Returns the formatted second.
|
|
2472
|
+
*
|
|
2473
|
+
* Возвращает отформатированную секунду.
|
|
2474
|
+
* @param style the representation of the month/ представление месяца
|
|
2475
|
+
*/
|
|
2476
|
+
localeSecond(t = "numeric") {
|
|
2477
|
+
return this.locale("second", { second: t });
|
|
2478
|
+
}
|
|
2479
|
+
/**
|
|
2480
|
+
* Output of standard data.
|
|
2481
|
+
*
|
|
2482
|
+
* Вывод стандартных данных.
|
|
2483
|
+
* @param timeZone add time zone/ добавить временную зону
|
|
2484
|
+
*/
|
|
2485
|
+
standard(t = !0) {
|
|
2486
|
+
const e = new Et(this.date, this.type, "en-GB"), s = [];
|
|
2487
|
+
let n;
|
|
2488
|
+
return e.setHour24(!0), this.type === "hour-minute" ? n = e.locale(this.type, {
|
|
2489
|
+
year: "numeric",
|
|
2490
|
+
month: "2-digit",
|
|
2491
|
+
hour12: !1
|
|
2492
|
+
}) : (["full", "datetime", "date", "year-month", "year", "month", "day"].indexOf(this.type) !== -1 && (s.push(e.localeYear()), s.push(e.localeMonth("2-digit"))), ["full", "datetime", "date", "year", "month", "day"].indexOf(this.type) !== -1 && s.push(e.localeDay("2-digit")), ["full", "datetime", "time", "hour", "minute", "second"].indexOf(this.type) !== -1 && (n = e.locale("time"))), `${s.join("-")}${n ? `T${n}${t ? e.getTimeZone() : ""}` : ""}`;
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* Change the date completely.
|
|
2496
|
+
*
|
|
2497
|
+
* Изменять полностью дату.
|
|
2498
|
+
* @param value an integer value representing the number/
|
|
2499
|
+
* целочисленное значение, представляющее число
|
|
2500
|
+
*/
|
|
2501
|
+
setDate(t) {
|
|
2502
|
+
return this.date = I(t), this.update(), this;
|
|
2503
|
+
}
|
|
2504
|
+
/**
|
|
2505
|
+
* Change the type of data output.
|
|
2506
|
+
*
|
|
2507
|
+
* Изменить тип вывода данных.
|
|
2508
|
+
* @param value type of output/ тип вывод
|
|
2509
|
+
*/
|
|
2510
|
+
setType(t) {
|
|
2511
|
+
return this.type = t, this.update(), this;
|
|
2512
|
+
}
|
|
2513
|
+
/**
|
|
2514
|
+
* Whether to use 12-hour time.
|
|
2515
|
+
*
|
|
2516
|
+
* Использовать ли 12-часовой формат времени.
|
|
2517
|
+
* @param value If true, output the 12-hour time format/
|
|
2518
|
+
* если true, выводить 12-часовой формат времени
|
|
2519
|
+
*/
|
|
2520
|
+
setHour24(t) {
|
|
2521
|
+
return this.hour24 = t, this.update(), this;
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* To change the location.
|
|
2525
|
+
*
|
|
2526
|
+
* Изменить местоположение.
|
|
2527
|
+
* @param code country and language code/ код страны и языка
|
|
2528
|
+
*/
|
|
2529
|
+
setCode(t) {
|
|
2530
|
+
return this.code = t, this;
|
|
2531
|
+
}
|
|
2532
|
+
/**
|
|
2533
|
+
* The function is called when the data is updated.
|
|
2534
|
+
*
|
|
2535
|
+
* Функция вызывается при обновлении данных.
|
|
2536
|
+
* @param watch the function calls/ функция вызывает
|
|
2537
|
+
*/
|
|
2538
|
+
setWatch(t) {
|
|
2539
|
+
return this.watch = t, this;
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* The method sets the full year for a specified date according to local time.
|
|
2543
|
+
*
|
|
2544
|
+
* Метод устанавливает полный год указанной даты по местному времени.
|
|
2545
|
+
* @param value value/ значения
|
|
2546
|
+
*/
|
|
2547
|
+
setYear(t) {
|
|
2548
|
+
return this.date.setFullYear(t), this.update(), this;
|
|
2549
|
+
}
|
|
2550
|
+
/**
|
|
2551
|
+
* The method sets the month for a specified date according to the currently set year.
|
|
2552
|
+
*
|
|
2553
|
+
* Метод устанавливает месяц указанной даты по местному времени.
|
|
2554
|
+
* @param value value/ значения
|
|
2555
|
+
*/
|
|
2556
|
+
setMonth(t) {
|
|
2557
|
+
return this.date.setMonth(t - 1), this.update(), this;
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* The method changes the day of the month of a given Date instance, based on local time.
|
|
2561
|
+
*
|
|
2562
|
+
* Метод устанавливает день месяца указанной даты по местному времени.
|
|
2563
|
+
* @param value value/ значения
|
|
2564
|
+
*/
|
|
2565
|
+
setDay(t) {
|
|
2566
|
+
return this.date.setDate(t), this.update(), this;
|
|
2567
|
+
}
|
|
2568
|
+
/**
|
|
2569
|
+
* The method sets the hours for a specified date according to local time.
|
|
2570
|
+
*
|
|
2571
|
+
* Метод устанавливает часы указанной даты по местному времени.
|
|
2572
|
+
* @param value value/ значения
|
|
2573
|
+
*/
|
|
2574
|
+
setHour(t) {
|
|
2575
|
+
return this.date.setHours(t), this.update(), this;
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* The method sets the minutes for a specified date according to local time
|
|
2579
|
+
*
|
|
2580
|
+
* Метод устанавливает минуты указанной даты по местному времени
|
|
2581
|
+
* @param value value / значения
|
|
2582
|
+
*/
|
|
2583
|
+
setMinute(t) {
|
|
2584
|
+
return this.date.setMinutes(t), this.update(), this;
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* The method sets the seconds for a specified date according to local time.
|
|
2588
|
+
*
|
|
2589
|
+
* Метод устанавливает секунды указанной даты по местному времени.
|
|
2590
|
+
* @param value value/ значения
|
|
2591
|
+
*/
|
|
2592
|
+
setSecond(t) {
|
|
2593
|
+
return this.date.setSeconds(t), this.update(), this;
|
|
2594
|
+
}
|
|
2595
|
+
/**
|
|
2596
|
+
* Shift the date by a given value in years.
|
|
2597
|
+
*
|
|
2598
|
+
* Сдвинуть дату на заданное значение в годах.
|
|
2599
|
+
* @param value values for moving/ значения для перемещения
|
|
2600
|
+
*/
|
|
2601
|
+
moveByYear(t) {
|
|
2602
|
+
return this.setYear(this.date.getFullYear() + t), this;
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* Shift the date by a given value in months.
|
|
2606
|
+
*
|
|
2607
|
+
* Сдвинуть дату на заданное значение в месяцах.
|
|
2608
|
+
* @param value values for moving/ значения для перемещения
|
|
2609
|
+
*/
|
|
2610
|
+
moveByMonth(t) {
|
|
2611
|
+
return this.setMonth(this.date.getMonth() + 1 + t), this;
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Shift the date by a given value in days.
|
|
2615
|
+
*
|
|
2616
|
+
* Сдвинуть дату на заданное значение в днях.
|
|
2617
|
+
* @param value values for moving/ значения для перемещения
|
|
2618
|
+
*/
|
|
2619
|
+
moveByDay(t) {
|
|
2620
|
+
return this.setDay(this.date.getDate() + t), this;
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* Shift the date by a given value in hours.
|
|
2624
|
+
*
|
|
2625
|
+
* Сдвинуть дату на заданное значение в часах.
|
|
2626
|
+
* @param value values for moving/ значения для перемещения
|
|
2627
|
+
*/
|
|
2628
|
+
moveByHour(t) {
|
|
2629
|
+
return this.setHour(this.date.getHours() + t), this;
|
|
2630
|
+
}
|
|
2631
|
+
/**
|
|
2632
|
+
* Shift the date by a given value in minutes.
|
|
2633
|
+
*
|
|
2634
|
+
* Сдвинуть дату на заданное значение в минутах.
|
|
2635
|
+
* @param value values for moving/ значения для перемещения
|
|
2636
|
+
*/
|
|
2637
|
+
moveByMinute(t) {
|
|
2638
|
+
return this.setMinute(this.date.getMinutes() + t), this;
|
|
2639
|
+
}
|
|
2640
|
+
/**
|
|
2641
|
+
* Shift the date by a given value in seconds.
|
|
2642
|
+
*
|
|
2643
|
+
* Сдвинуть дату на заданное значение в секундах.
|
|
2644
|
+
* @param value values for moving/ значения для перемещения
|
|
2645
|
+
*/
|
|
2646
|
+
moveBySecond(t) {
|
|
2647
|
+
return this.setSecond(this.date.getSeconds() + t), this;
|
|
2648
|
+
}
|
|
2649
|
+
/**
|
|
2650
|
+
* Translate to the first month.
|
|
2651
|
+
*
|
|
2652
|
+
* Переводить на первый месяц.
|
|
2653
|
+
*/
|
|
2654
|
+
moveMonthFirst() {
|
|
2655
|
+
return this.setMonth(1), this;
|
|
2656
|
+
}
|
|
2657
|
+
/**
|
|
2658
|
+
* Translate to the first month.
|
|
2659
|
+
*
|
|
2660
|
+
* Переводить на первый месяц.
|
|
2661
|
+
*/
|
|
2662
|
+
moveMonthLast() {
|
|
2663
|
+
return this.setMonth(12), this;
|
|
2664
|
+
}
|
|
2665
|
+
/**
|
|
2666
|
+
* Translate to the first day of the next month.
|
|
2667
|
+
*
|
|
2668
|
+
* Переводить на первый день следующего месяца.
|
|
2669
|
+
*/
|
|
2670
|
+
moveMonthNext() {
|
|
2671
|
+
return this.setDay(1).moveByMonth(1), this;
|
|
2672
|
+
}
|
|
2673
|
+
/**
|
|
2674
|
+
* Translate to the first day of the previous month.
|
|
2675
|
+
*
|
|
2676
|
+
* Переводить на первый день предыдущего месяца.
|
|
2677
|
+
*/
|
|
2678
|
+
moveMonthPrevious() {
|
|
2679
|
+
return this.setDay(1).moveByMonth(-1), this;
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* Translate to the first day of the week.
|
|
2683
|
+
*
|
|
2684
|
+
* Переводить на первый день недели.
|
|
2685
|
+
*/
|
|
2686
|
+
moveWeekdayFirst() {
|
|
2687
|
+
const t = this.date.getDay(), e = this.getFirstDayCode();
|
|
2688
|
+
return this.moveByDay(
|
|
2689
|
+
(e === 6 ? -1 : e) - t
|
|
2690
|
+
), this;
|
|
2691
|
+
}
|
|
2692
|
+
/**
|
|
2693
|
+
* Translate to the last day of the week.
|
|
2694
|
+
*
|
|
2695
|
+
* Переводить на последний день недели.
|
|
2696
|
+
*/
|
|
2697
|
+
moveWeekdayLast() {
|
|
2698
|
+
return this.moveWeekdayFirst().moveByDay(6), this;
|
|
2699
|
+
}
|
|
2700
|
+
/**
|
|
2701
|
+
* Translate to the first day of the first week of the month.
|
|
2702
|
+
*
|
|
2703
|
+
* Переводить на первый день первой недели месяца.
|
|
2704
|
+
*/
|
|
2705
|
+
moveWeekdayFirstByMonth() {
|
|
2706
|
+
return this.moveDayFirst().moveWeekdayFirst(), this;
|
|
2707
|
+
}
|
|
2708
|
+
/**
|
|
2709
|
+
* Translate to the first day of the first full week of the following month.
|
|
2710
|
+
*
|
|
2711
|
+
* Переводить на первый день первой полной недели следующего месяца.
|
|
2712
|
+
*/
|
|
2713
|
+
moveWeekdayLastByMonth() {
|
|
2714
|
+
return this.moveDayLast().moveWeekdayLast(), this;
|
|
2715
|
+
}
|
|
2716
|
+
/**
|
|
2717
|
+
* Translate to the next week.
|
|
2718
|
+
*
|
|
2719
|
+
* Переводить на следующую неделю.
|
|
2720
|
+
*/
|
|
2721
|
+
moveWeekdayNext() {
|
|
2722
|
+
return this.moveWeekdayFirst().moveByDay(7), this;
|
|
2723
|
+
}
|
|
2724
|
+
/**
|
|
2725
|
+
* Translate to the previous week.
|
|
2726
|
+
*
|
|
2727
|
+
* Переводить на предыдущую неделю.
|
|
2728
|
+
*/
|
|
2729
|
+
moveWeekdayPrevious() {
|
|
2730
|
+
return this.moveWeekdayFirst().moveByDay(-7), this;
|
|
2731
|
+
}
|
|
2732
|
+
/**
|
|
2733
|
+
* Translate to the first day of the month.
|
|
2734
|
+
*
|
|
2735
|
+
* Переводить на первый день месяца.
|
|
2736
|
+
*/
|
|
2737
|
+
moveDayFirst() {
|
|
2738
|
+
return this.setDay(1), this;
|
|
2739
|
+
}
|
|
2740
|
+
/**
|
|
2741
|
+
* Translate to the last day of the month.
|
|
2742
|
+
*
|
|
2743
|
+
* Переводить на последний день месяца.
|
|
2744
|
+
*/
|
|
2745
|
+
moveDayLast() {
|
|
2746
|
+
return this.setDay(1).moveByMonth(1).moveByDay(-1), this;
|
|
2747
|
+
}
|
|
2748
|
+
/**
|
|
2749
|
+
* Translate to the next day.
|
|
2750
|
+
*
|
|
2751
|
+
* Переводить на следующий день.
|
|
2752
|
+
*/
|
|
2753
|
+
moveDayNext() {
|
|
2754
|
+
return this.moveByDay(1), this;
|
|
2755
|
+
}
|
|
2756
|
+
/**
|
|
2757
|
+
* Translate to the previous day.
|
|
2758
|
+
*
|
|
2759
|
+
* Переводить на предыдущий день.
|
|
2760
|
+
*/
|
|
2761
|
+
moveDayPrevious() {
|
|
2762
|
+
return this.moveByDay(-1), this;
|
|
2763
|
+
}
|
|
2764
|
+
/**
|
|
2765
|
+
* Clone the Date object.
|
|
2766
|
+
*
|
|
2767
|
+
* Клонировать объект Date.
|
|
2768
|
+
*/
|
|
2769
|
+
clone() {
|
|
2770
|
+
return new Date(this.date);
|
|
2771
|
+
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Clone the GeoDate object.
|
|
2774
|
+
*
|
|
2775
|
+
* Клонировать объект GeoDate.
|
|
2776
|
+
*/
|
|
2777
|
+
cloneClass() {
|
|
2778
|
+
return new this.constructor(
|
|
2779
|
+
this.clone(),
|
|
2780
|
+
this.type,
|
|
2781
|
+
this.code
|
|
2782
|
+
);
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* Clone the GeoDate object and set the month to January.
|
|
2786
|
+
*
|
|
2787
|
+
* Клонировать объект GeoDate и установить месяц на январь.
|
|
2788
|
+
*/
|
|
2789
|
+
cloneMonthFirst() {
|
|
2790
|
+
return this.cloneClass().moveMonthFirst();
|
|
2791
|
+
}
|
|
2792
|
+
/**
|
|
2793
|
+
* Clone the GeoDate object and move the month to the end of the year.
|
|
2794
|
+
*
|
|
2795
|
+
* Клонировать объект GeoDate и перевести месяц на конец года.
|
|
2796
|
+
*/
|
|
2797
|
+
cloneMonthLast() {
|
|
2798
|
+
return this.cloneClass().moveMonthLast();
|
|
2799
|
+
}
|
|
2800
|
+
/**
|
|
2801
|
+
* Clone the GeoDate object and transfer it one month ahead.
|
|
2802
|
+
*
|
|
2803
|
+
* Клонировать объект GeoDate и перевести на 1 месяц вперед.
|
|
2804
|
+
*/
|
|
2805
|
+
cloneMonthNext() {
|
|
2806
|
+
return this.cloneClass().moveMonthNext();
|
|
2807
|
+
}
|
|
2808
|
+
/**
|
|
2809
|
+
* Clone the GeoDate object and transfer it one month back.
|
|
2810
|
+
*
|
|
2811
|
+
* Клонировать объект GeoDate и перевести на 1 месяц назад.
|
|
2812
|
+
*/
|
|
2813
|
+
cloneMonthPrevious() {
|
|
2814
|
+
return this.cloneClass().moveMonthPrevious();
|
|
2815
|
+
}
|
|
2816
|
+
/**
|
|
2817
|
+
* Returns the first day of the week according to the current date.
|
|
2818
|
+
*
|
|
2819
|
+
* Возвращает первый день недели по текущей дате.
|
|
2820
|
+
*/
|
|
2821
|
+
cloneWeekdayFirst() {
|
|
2822
|
+
return this.cloneClass().moveWeekdayFirst();
|
|
2823
|
+
}
|
|
2824
|
+
/**
|
|
2825
|
+
* Returns the last day of the week according to the current date.
|
|
2826
|
+
*
|
|
2827
|
+
* Возвращает последний день недели по текущей дате.
|
|
2828
|
+
*/
|
|
2829
|
+
cloneWeekdayLast() {
|
|
2830
|
+
return this.cloneClass().moveWeekdayLast();
|
|
2831
|
+
}
|
|
2832
|
+
/**
|
|
2833
|
+
* Returns the first day of the week according to the current month.
|
|
2834
|
+
*
|
|
2835
|
+
* Возвращает первый день недели по текущему месяцу.
|
|
2836
|
+
*/
|
|
2837
|
+
cloneWeekdayFirstByMonth() {
|
|
2838
|
+
return this.cloneClass().moveWeekdayFirstByMonth();
|
|
2839
|
+
}
|
|
2840
|
+
/**
|
|
2841
|
+
* Returns the last day of the week according to the current month.
|
|
2842
|
+
*
|
|
2843
|
+
* Возвращает последний день недели по текущему месяцу.
|
|
2844
|
+
*/
|
|
2845
|
+
cloneWeekdayLastByMonth() {
|
|
2846
|
+
return this.cloneClass().moveWeekdayLastByMonth();
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* Returns the next week according to the current date.
|
|
2850
|
+
*
|
|
2851
|
+
* Возвращает следующую неделю по текущей дате.
|
|
2852
|
+
*/
|
|
2853
|
+
cloneWeekdayNext() {
|
|
2854
|
+
return this.cloneClass().moveWeekdayNext();
|
|
2855
|
+
}
|
|
2856
|
+
/**
|
|
2857
|
+
* Returns the previous week according to the current date.
|
|
2858
|
+
*
|
|
2859
|
+
* Возвращает предыдущую неделю по текущей дате.
|
|
2860
|
+
*/
|
|
2861
|
+
cloneWeekdayPrevious() {
|
|
2862
|
+
return this.cloneClass().moveWeekdayPrevious();
|
|
2863
|
+
}
|
|
2864
|
+
/**
|
|
2865
|
+
* Clone the GeoDate object and move the day to the beginning of the month.
|
|
2866
|
+
*
|
|
2867
|
+
* Клонировать объект GeoDate и перевести день на начало месяца.
|
|
2868
|
+
*/
|
|
2869
|
+
cloneDayFirst() {
|
|
2870
|
+
return this.cloneClass().moveDayFirst();
|
|
2871
|
+
}
|
|
2872
|
+
/**
|
|
2873
|
+
* Clone the GeoDate object and move the day to the end of the month.
|
|
2874
|
+
*
|
|
2875
|
+
* Клонировать объект GeoDate и перевести день на конец месяца.
|
|
2876
|
+
*/
|
|
2877
|
+
cloneDayLast() {
|
|
2878
|
+
return this.cloneClass().moveDayLast();
|
|
2879
|
+
}
|
|
2880
|
+
/**
|
|
2881
|
+
* Clone the GeoDate object and move by 1 day.
|
|
2882
|
+
*
|
|
2883
|
+
* Клонировать объект GeoDate и перевести на 1 день.
|
|
2884
|
+
*/
|
|
2885
|
+
cloneDayNext() {
|
|
2886
|
+
return this.cloneClass().moveDayNext();
|
|
2887
|
+
}
|
|
2888
|
+
/**
|
|
2889
|
+
* Clone the GeoDate object and go back by 1 day.
|
|
2890
|
+
*
|
|
2891
|
+
* Клонировать объект GeoDate и вернуться на 1 день.
|
|
2892
|
+
*/
|
|
2893
|
+
cloneDayPrevious() {
|
|
2894
|
+
return this.cloneClass().moveDayPrevious();
|
|
2895
|
+
}
|
|
2896
|
+
/**
|
|
2897
|
+
* Updating all values.
|
|
2898
|
+
*
|
|
2899
|
+
* Обновление всех значений.
|
|
2900
|
+
*/
|
|
2901
|
+
update() {
|
|
2902
|
+
var t;
|
|
2903
|
+
return (t = this.watch) == null || t.call(
|
|
2904
|
+
this,
|
|
2905
|
+
this.date,
|
|
2906
|
+
this.type,
|
|
2907
|
+
this.hour24
|
|
2908
|
+
), this;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
const r = "@flag", R = class R {
|
|
2912
|
+
/**
|
|
2913
|
+
* Constructor
|
|
2914
|
+
* @param code country and language code/ код страны и языка
|
|
2915
|
+
*/
|
|
2916
|
+
constructor(t = b.getLocation()) {
|
|
2917
|
+
this.code = t;
|
|
2918
|
+
}
|
|
2919
|
+
/**
|
|
2920
|
+
* Returns information about the country and its flag.
|
|
2921
|
+
*
|
|
2922
|
+
* Возвращает информацию о стране и её флаге.
|
|
2923
|
+
* @param code country code/ код страны
|
|
2924
|
+
*/
|
|
2925
|
+
get(t = this.code) {
|
|
2926
|
+
var s;
|
|
2927
|
+
const e = b.find(t);
|
|
2928
|
+
if (e) {
|
|
2929
|
+
const n = this.getCountry(e);
|
|
2930
|
+
return {
|
|
2931
|
+
language: this.getLanguage(e),
|
|
2932
|
+
country: n,
|
|
2933
|
+
standard: e.standard,
|
|
2934
|
+
icon: (s = R.flags) == null ? void 0 : s[e.country],
|
|
2935
|
+
label: n,
|
|
2936
|
+
value: e.country
|
|
2937
|
+
};
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
/**
|
|
2941
|
+
* Getting a link to the flag.
|
|
2942
|
+
*
|
|
2943
|
+
* Получение ссылки на флаг.
|
|
2944
|
+
* @param code country code/ код страны
|
|
2945
|
+
*/
|
|
2946
|
+
getFlag(t = this.code) {
|
|
2947
|
+
var e;
|
|
2948
|
+
return (e = this.get(t)) == null ? void 0 : e.icon;
|
|
2949
|
+
}
|
|
2950
|
+
/**
|
|
2951
|
+
* Getting a list of countries by an array of codes.
|
|
2952
|
+
*
|
|
2953
|
+
* Получение списка стран по массиву с кодами.
|
|
2954
|
+
* @param codes country code/ код страны
|
|
2955
|
+
*/
|
|
2956
|
+
getList(t) {
|
|
2957
|
+
return g(this.getCodes(t), (e) => this.get(e));
|
|
2958
|
+
}
|
|
2959
|
+
/**
|
|
2960
|
+
* Getting a list of countries by an array of codes in national language.
|
|
2961
|
+
*
|
|
2962
|
+
* Получение списка стран по массиву с кодами на национальный язык.
|
|
2963
|
+
* @param codes country code/ код страны.
|
|
2964
|
+
*/
|
|
2965
|
+
getNational(t) {
|
|
2966
|
+
return g(this.getList(t), (e) => {
|
|
2967
|
+
const s = new R(e.standard).get(e.standard);
|
|
2968
|
+
return {
|
|
2969
|
+
...e,
|
|
2970
|
+
description: s == null ? void 0 : s.country,
|
|
2971
|
+
nationalLanguage: s == null ? void 0 : s.language,
|
|
2972
|
+
nationalCountry: s == null ? void 0 : s.country
|
|
2973
|
+
};
|
|
2974
|
+
});
|
|
2975
|
+
}
|
|
2976
|
+
/**
|
|
2977
|
+
* To change the location.
|
|
2978
|
+
*
|
|
2979
|
+
* Изменить местоположение.
|
|
2980
|
+
* @param code country and language code/ код страны и языка
|
|
2981
|
+
*/
|
|
2982
|
+
setCode(t) {
|
|
2983
|
+
return this.code = t, this;
|
|
2984
|
+
}
|
|
2985
|
+
/**
|
|
2986
|
+
* Returns a special object for formatting.
|
|
2987
|
+
*
|
|
2988
|
+
* Возвращает специальный объект для работы с форматированием.
|
|
2989
|
+
*/
|
|
2990
|
+
getLocation() {
|
|
2991
|
+
return new q(this.code);
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* Returns a list of countries to retrieve data from.
|
|
2995
|
+
*
|
|
2996
|
+
* Возвращает список стран для получения данных.
|
|
2997
|
+
* @param codes country code/ код страны
|
|
2998
|
+
*/
|
|
2999
|
+
getCodes(t) {
|
|
3000
|
+
return t != null ? t : Object.keys(R.flags);
|
|
3001
|
+
}
|
|
3002
|
+
/**
|
|
3003
|
+
* Getting the name of the language.
|
|
3004
|
+
*
|
|
3005
|
+
* Получение названия языка.
|
|
3006
|
+
* @param data object with information of data/ объект с информацией данных
|
|
3007
|
+
*/
|
|
3008
|
+
getLanguage(t) {
|
|
3009
|
+
return this.getLocation().languageName(t.language);
|
|
3010
|
+
}
|
|
3011
|
+
/**
|
|
3012
|
+
* Getting the name of the country.
|
|
3013
|
+
*
|
|
3014
|
+
* Получение названия страны.
|
|
3015
|
+
* @param data object with information of data/ объект с информацией данных
|
|
3016
|
+
*/
|
|
3017
|
+
getCountry(t) {
|
|
3018
|
+
return this.getLocation().countryName(t.country);
|
|
3019
|
+
}
|
|
3020
|
+
};
|
|
3021
|
+
c(R, "flags", {
|
|
3022
|
+
AD: `${r}-ad`,
|
|
3023
|
+
AE: `${r}-ae`,
|
|
3024
|
+
AF: `${r}-af`,
|
|
3025
|
+
AG: `${r}-ag`,
|
|
3026
|
+
AI: `${r}-ai`,
|
|
3027
|
+
AL: `${r}-al`,
|
|
3028
|
+
AM: `${r}-am`,
|
|
3029
|
+
AN: `${r}-an`,
|
|
3030
|
+
AO: `${r}-ao`,
|
|
3031
|
+
AQ: `${r}-aq`,
|
|
3032
|
+
AR: `${r}-ar`,
|
|
3033
|
+
AS: `${r}-as`,
|
|
3034
|
+
AT: `${r}-at`,
|
|
3035
|
+
AU: `${r}-au`,
|
|
3036
|
+
AW: `${r}-aw`,
|
|
3037
|
+
AZ: `${r}-az`,
|
|
3038
|
+
BA: `${r}-ba`,
|
|
3039
|
+
BB: `${r}-bb`,
|
|
3040
|
+
BD: `${r}-bd`,
|
|
3041
|
+
BE: `${r}-be`,
|
|
3042
|
+
BF: `${r}-bf`,
|
|
3043
|
+
BG: `${r}-bg`,
|
|
3044
|
+
BH: `${r}-bh`,
|
|
3045
|
+
BI: `${r}-bi`,
|
|
3046
|
+
BJ: `${r}-bj`,
|
|
3047
|
+
BL: `${r}-bl`,
|
|
3048
|
+
BM: `${r}-bm`,
|
|
3049
|
+
BN: `${r}-bn`,
|
|
3050
|
+
BO: `${r}-bo`,
|
|
3051
|
+
BR: `${r}-br`,
|
|
3052
|
+
BS: `${r}-bs`,
|
|
3053
|
+
BT: `${r}-bt`,
|
|
3054
|
+
BW: `${r}-bw`,
|
|
3055
|
+
BY: `${r}-by`,
|
|
3056
|
+
BZ: `${r}-bz`,
|
|
3057
|
+
CA: `${r}-ca`,
|
|
3058
|
+
CC: `${r}-cc`,
|
|
3059
|
+
CD: `${r}-cd`,
|
|
3060
|
+
CF: `${r}-cf`,
|
|
3061
|
+
CG: `${r}-cg`,
|
|
3062
|
+
CH: `${r}-ch`,
|
|
3063
|
+
CI: `${r}-ci`,
|
|
3064
|
+
CK: `${r}-ck`,
|
|
3065
|
+
CL: `${r}-cl`,
|
|
3066
|
+
CM: `${r}-cm`,
|
|
3067
|
+
CN: `${r}-cn`,
|
|
3068
|
+
CO: `${r}-co`,
|
|
3069
|
+
CR: `${r}-cr`,
|
|
3070
|
+
CU: `${r}-cu`,
|
|
3071
|
+
CV: `${r}-cv`,
|
|
3072
|
+
CW: `${r}-cw`,
|
|
3073
|
+
CX: `${r}-cx`,
|
|
3074
|
+
CY: `${r}-cy`,
|
|
3075
|
+
CZ: `${r}-cz`,
|
|
3076
|
+
DE: `${r}-de`,
|
|
3077
|
+
DJ: `${r}-dj`,
|
|
3078
|
+
DK: `${r}-dk`,
|
|
3079
|
+
DM: `${r}-dm`,
|
|
3080
|
+
DZ: `${r}-dz`,
|
|
3081
|
+
EC: `${r}-ec`,
|
|
3082
|
+
EE: `${r}-ee`,
|
|
3083
|
+
EG: `${r}-eg`,
|
|
3084
|
+
EH: `${r}-eh`,
|
|
3085
|
+
ER: `${r}-er`,
|
|
3086
|
+
ES: `${r}-es`,
|
|
3087
|
+
ET: `${r}-et`,
|
|
3088
|
+
FI: `${r}-fi`,
|
|
3089
|
+
FJ: `${r}-fj`,
|
|
3090
|
+
FK: `${r}-fk`,
|
|
3091
|
+
FM: `${r}-fm`,
|
|
3092
|
+
FO: `${r}-fo`,
|
|
3093
|
+
FR: `${r}-fr`,
|
|
3094
|
+
GA: `${r}-ga`,
|
|
3095
|
+
GB: `${r}-gb`,
|
|
3096
|
+
GD: `${r}-gd`,
|
|
3097
|
+
GE: `${r}-ge`,
|
|
3098
|
+
GF: `${r}-gf`,
|
|
3099
|
+
GG: `${r}-gg`,
|
|
3100
|
+
GH: `${r}-gh`,
|
|
3101
|
+
GI: `${r}-gi`,
|
|
3102
|
+
GL: `${r}-gl`,
|
|
3103
|
+
GM: `${r}-gm`,
|
|
3104
|
+
GN: `${r}-gn`,
|
|
3105
|
+
GQ: `${r}-gq`,
|
|
3106
|
+
GR: `${r}-gr`,
|
|
3107
|
+
GT: `${r}-gt`,
|
|
3108
|
+
GU: `${r}-gu`,
|
|
3109
|
+
GW: `${r}-gw`,
|
|
3110
|
+
GY: `${r}-gy`,
|
|
3111
|
+
HK: `${r}-hk`,
|
|
3112
|
+
HN: `${r}-hn`,
|
|
3113
|
+
HR: `${r}-hr`,
|
|
3114
|
+
HT: `${r}-ht`,
|
|
3115
|
+
HU: `${r}-hu`,
|
|
3116
|
+
ID: `${r}-id`,
|
|
3117
|
+
IE: `${r}-ie`,
|
|
3118
|
+
IL: `${r}-il`,
|
|
3119
|
+
IM: `${r}-im`,
|
|
3120
|
+
IN: `${r}-in`,
|
|
3121
|
+
IO: `${r}-io`,
|
|
3122
|
+
IQ: `${r}-iq`,
|
|
3123
|
+
IR: `${r}-ir`,
|
|
3124
|
+
IS: `${r}-is`,
|
|
3125
|
+
IT: `${r}-it`,
|
|
3126
|
+
JE: `${r}-je`,
|
|
3127
|
+
JM: `${r}-jm`,
|
|
3128
|
+
JO: `${r}-jo`,
|
|
3129
|
+
JP: `${r}-jp`,
|
|
3130
|
+
KE: `${r}-ke`,
|
|
3131
|
+
KG: `${r}-kg`,
|
|
3132
|
+
KH: `${r}-kh`,
|
|
3133
|
+
KI: `${r}-ki`,
|
|
3134
|
+
KM: `${r}-km`,
|
|
3135
|
+
KN: `${r}-kn`,
|
|
3136
|
+
KP: `${r}-kp`,
|
|
3137
|
+
KR: `${r}-kr`,
|
|
3138
|
+
KW: `${r}-kw`,
|
|
3139
|
+
KY: `${r}-ky`,
|
|
3140
|
+
KZ: `${r}-kz`,
|
|
3141
|
+
LA: `${r}-la`,
|
|
3142
|
+
LB: `${r}-lb`,
|
|
3143
|
+
LC: `${r}-lc`,
|
|
3144
|
+
LI: `${r}-li`,
|
|
3145
|
+
LK: `${r}-lk`,
|
|
3146
|
+
LR: `${r}-lr`,
|
|
3147
|
+
LS: `${r}-ls`,
|
|
3148
|
+
LT: `${r}-lt`,
|
|
3149
|
+
LU: `${r}-lu`,
|
|
3150
|
+
LV: `${r}-lv`,
|
|
3151
|
+
LY: `${r}-ly`,
|
|
3152
|
+
MA: `${r}-ma`,
|
|
3153
|
+
MC: `${r}-mc`,
|
|
3154
|
+
MD: `${r}-md`,
|
|
3155
|
+
ME: `${r}-me`,
|
|
3156
|
+
MF: `${r}-mf`,
|
|
3157
|
+
MG: `${r}-mg`,
|
|
3158
|
+
MH: `${r}-mh`,
|
|
3159
|
+
MK: `${r}-mk`,
|
|
3160
|
+
ML: `${r}-ml`,
|
|
3161
|
+
MM: `${r}-mm`,
|
|
3162
|
+
MN: `${r}-mn`,
|
|
3163
|
+
MO: `${r}-mo`,
|
|
3164
|
+
MP: `${r}-mp`,
|
|
3165
|
+
MQ: `${r}-mq`,
|
|
3166
|
+
MR: `${r}-mr`,
|
|
3167
|
+
MS: `${r}-ms`,
|
|
3168
|
+
MT: `${r}-mt`,
|
|
3169
|
+
MU: `${r}-mu`,
|
|
3170
|
+
MV: `${r}-mv`,
|
|
3171
|
+
MW: `${r}-mw`,
|
|
3172
|
+
MX: `${r}-mx`,
|
|
3173
|
+
MY: `${r}-my`,
|
|
3174
|
+
MZ: `${r}-mz`,
|
|
3175
|
+
NA: `${r}-na`,
|
|
3176
|
+
NC: `${r}-nc`,
|
|
3177
|
+
NE: `${r}-ne`,
|
|
3178
|
+
NF: `${r}-nf`,
|
|
3179
|
+
NG: `${r}-ng`,
|
|
3180
|
+
NI: `${r}-ni`,
|
|
3181
|
+
NL: `${r}-nl`,
|
|
3182
|
+
NO: `${r}-no`,
|
|
3183
|
+
NP: `${r}-np`,
|
|
3184
|
+
NR: `${r}-nr`,
|
|
3185
|
+
NU: `${r}-nu`,
|
|
3186
|
+
NZ: `${r}-nz`,
|
|
3187
|
+
OM: `${r}-om`,
|
|
3188
|
+
PA: `${r}-pa`,
|
|
3189
|
+
PE: `${r}-pe`,
|
|
3190
|
+
PF: `${r}-pf`,
|
|
3191
|
+
PG: `${r}-pg`,
|
|
3192
|
+
PH: `${r}-ph`,
|
|
3193
|
+
PK: `${r}-pk`,
|
|
3194
|
+
PL: `${r}-pl`,
|
|
3195
|
+
PM: `${r}-pm`,
|
|
3196
|
+
PN: `${r}-pn`,
|
|
3197
|
+
PR: `${r}-pr`,
|
|
3198
|
+
PS: `${r}-ps`,
|
|
3199
|
+
PT: `${r}-pt`,
|
|
3200
|
+
PW: `${r}-pw`,
|
|
3201
|
+
PY: `${r}-py`,
|
|
3202
|
+
QA: `${r}-qa`,
|
|
3203
|
+
RE: `${r}-re`,
|
|
3204
|
+
RO: `${r}-ro`,
|
|
3205
|
+
RS: `${r}-rs`,
|
|
3206
|
+
RU: `${r}-ru`,
|
|
3207
|
+
RW: `${r}-rw`,
|
|
3208
|
+
SA: `${r}-sa`,
|
|
3209
|
+
SB: `${r}-sb`,
|
|
3210
|
+
SC: `${r}-sc`,
|
|
3211
|
+
SD: `${r}-sd`,
|
|
3212
|
+
SE: `${r}-se`,
|
|
3213
|
+
SG: `${r}-sg`,
|
|
3214
|
+
SH: `${r}-sh`,
|
|
3215
|
+
SI: `${r}-si`,
|
|
3216
|
+
SJ: `${r}-sj`,
|
|
3217
|
+
SK: `${r}-sk`,
|
|
3218
|
+
SL: `${r}-sl`,
|
|
3219
|
+
SM: `${r}-sm`,
|
|
3220
|
+
SN: `${r}-sn`,
|
|
3221
|
+
SO: `${r}-so`,
|
|
3222
|
+
SR: `${r}-sr`,
|
|
3223
|
+
SS: `${r}-ss`,
|
|
3224
|
+
ST: `${r}-st`,
|
|
3225
|
+
SV: `${r}-sv`,
|
|
3226
|
+
SX: `${r}-sx`,
|
|
3227
|
+
SY: `${r}-sy`,
|
|
3228
|
+
SZ: `${r}-sz`,
|
|
3229
|
+
TC: `${r}-tc`,
|
|
3230
|
+
TD: `${r}-td`,
|
|
3231
|
+
TG: `${r}-tg`,
|
|
3232
|
+
TH: `${r}-th`,
|
|
3233
|
+
TJ: `${r}-tj`,
|
|
3234
|
+
TK: `${r}-tk`,
|
|
3235
|
+
TL: `${r}-tl`,
|
|
3236
|
+
TM: `${r}-tm`,
|
|
3237
|
+
TN: `${r}-tn`,
|
|
3238
|
+
TO: `${r}-to`,
|
|
3239
|
+
TR: `${r}-tr`,
|
|
3240
|
+
TT: `${r}-tt`,
|
|
3241
|
+
TV: `${r}-tv`,
|
|
3242
|
+
TW: `${r}-tw`,
|
|
3243
|
+
TZ: `${r}-tz`,
|
|
3244
|
+
UA: `${r}-ua`,
|
|
3245
|
+
UG: `${r}-ug`,
|
|
3246
|
+
US: `${r}-us`,
|
|
3247
|
+
UY: `${r}-uy`,
|
|
3248
|
+
UZ: `${r}-uz`,
|
|
3249
|
+
VA: `${r}-va`,
|
|
3250
|
+
VC: `${r}-vc`,
|
|
3251
|
+
VE: `${r}-ve`,
|
|
3252
|
+
VG: `${r}-vg`,
|
|
3253
|
+
VI: `${r}-vi`,
|
|
3254
|
+
VN: `${r}-vn`,
|
|
3255
|
+
VU: `${r}-vu`,
|
|
3256
|
+
WF: `${r}-wf`,
|
|
3257
|
+
WS: `${r}-ws`,
|
|
3258
|
+
YE: `${r}-ye`,
|
|
3259
|
+
YT: `${r}-yt`,
|
|
3260
|
+
ZA: `${r}-za`,
|
|
3261
|
+
ZM: `${r}-zm`,
|
|
3262
|
+
ZW: `${r}-zw`
|
|
3263
|
+
});
|
|
3264
|
+
let ft = R;
|
|
3265
|
+
const P = class P {
|
|
3266
|
+
/**
|
|
3267
|
+
* Getting an object with information about the phone code and country.
|
|
3268
|
+
*
|
|
3269
|
+
* Получение объекта с информацией о телефонном коде и стране.
|
|
3270
|
+
* @param code country and language code/ код страны и языка
|
|
3271
|
+
*/
|
|
3272
|
+
static get(t) {
|
|
3273
|
+
return this.list.find((e) => t === e.value);
|
|
3274
|
+
}
|
|
3275
|
+
/**
|
|
3276
|
+
* Getting information by phone.
|
|
3277
|
+
*
|
|
3278
|
+
* Получение информации по телефону.
|
|
3279
|
+
* @param phone phone number/ номер телефон
|
|
3280
|
+
*/
|
|
3281
|
+
static getByPhone(t) {
|
|
3282
|
+
let e = this.map, s, n = "";
|
|
3283
|
+
return this.toNumber(t).forEach((o) => {
|
|
3284
|
+
var a;
|
|
3285
|
+
n === "" && o in e ? (s = e[o], e = (a = s == null ? void 0 : s.next) != null ? a : {}) : n += o;
|
|
3286
|
+
}), {
|
|
3287
|
+
item: s,
|
|
3288
|
+
phone: n
|
|
3289
|
+
};
|
|
3290
|
+
}
|
|
3291
|
+
/**
|
|
3292
|
+
* Retrieves complete mask data by country code.
|
|
3293
|
+
*
|
|
3294
|
+
* Получает полные данные о маске по коду страны.
|
|
3295
|
+
* @param code country and language code/ код страны и языка
|
|
3296
|
+
*/
|
|
3297
|
+
static getByCode(t) {
|
|
3298
|
+
var s;
|
|
3299
|
+
const e = this.get(t);
|
|
3300
|
+
if (e)
|
|
3301
|
+
return (s = this.getByPhone(e.phone.toString())) == null ? void 0 : s.item;
|
|
3302
|
+
}
|
|
3303
|
+
/**
|
|
3304
|
+
* We get an array from a list of all phone numbers.
|
|
3305
|
+
*
|
|
3306
|
+
* Получаем массив из списка всех телефонных кодов.
|
|
3307
|
+
*/
|
|
3308
|
+
static getList() {
|
|
3309
|
+
return this.list;
|
|
3310
|
+
}
|
|
3311
|
+
/**
|
|
3312
|
+
* We get a map of a tree, sorted by its code.
|
|
3313
|
+
*
|
|
3314
|
+
* Получаем карту дерева, отсортированную по его коду.
|
|
3315
|
+
*/
|
|
3316
|
+
static getMap() {
|
|
3317
|
+
return this.map;
|
|
3318
|
+
}
|
|
3319
|
+
/**
|
|
3320
|
+
* Convert to phone mask.
|
|
3321
|
+
*
|
|
3322
|
+
* Преобразовать в маску телефона.
|
|
3323
|
+
* @param phone phone number/ номер телефон
|
|
3324
|
+
* @param masks a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3325
|
+
*/
|
|
3326
|
+
static toMask(t, e) {
|
|
3327
|
+
if (D(t) && Array.isArray(e) && e.length > 0) {
|
|
3328
|
+
const s = this.removeZero(t), n = s.length;
|
|
3329
|
+
for (const o of e)
|
|
3330
|
+
if (this.getUnnecessaryLength(o) === n)
|
|
3331
|
+
return this.toStandard(s, o);
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
/**
|
|
3335
|
+
* Deletes the country code from the input number.
|
|
3336
|
+
*
|
|
3337
|
+
* Удаляет код страны по входному номеру.
|
|
3338
|
+
* @param phone phone number/ номер телефон
|
|
3339
|
+
*/
|
|
3340
|
+
static removeZero(t) {
|
|
3341
|
+
return t.match(/^0/) ? t.replace(/^0/, "") : t.match(/^89/) ? t.replace(/^8/, "") : t;
|
|
3342
|
+
}
|
|
3343
|
+
/**
|
|
3344
|
+
* Returns the symbol by the internal country code.
|
|
3345
|
+
*
|
|
3346
|
+
* Возвращает символ по коду внутри страны.
|
|
3347
|
+
* @param within internal country code/ код внутри страны
|
|
3348
|
+
*/
|
|
3349
|
+
static getWithinSymbol(t) {
|
|
3350
|
+
switch (t) {
|
|
3351
|
+
case 4:
|
|
3352
|
+
case "4":
|
|
3353
|
+
return "$";
|
|
3354
|
+
case 8:
|
|
3355
|
+
case "8":
|
|
3356
|
+
return "~";
|
|
3357
|
+
}
|
|
3358
|
+
return "=";
|
|
3359
|
+
}
|
|
3360
|
+
/**
|
|
3361
|
+
* Deletes all characters that do not belong to the mask.
|
|
3362
|
+
*
|
|
3363
|
+
* Удаляет все символы, не относящиеся к маске.
|
|
3364
|
+
* @param mask A mask to transform a phone number/ маска для преобразования номер телефон
|
|
3365
|
+
*/
|
|
3366
|
+
static getUnnecessaryLength(t) {
|
|
3367
|
+
return t.replace(/[^*]+/ig, "").length;
|
|
3368
|
+
}
|
|
3369
|
+
/**
|
|
3370
|
+
* Creating a list for the map.
|
|
3371
|
+
*
|
|
3372
|
+
* Формирование списка для карты.
|
|
3373
|
+
*/
|
|
3374
|
+
static makeList() {
|
|
3375
|
+
const t = g(b.getList(), (e) => {
|
|
3376
|
+
if (e != null && e.phoneMask)
|
|
3377
|
+
return {
|
|
3378
|
+
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/, "")) || void 0,
|
|
3379
|
+
within: (e == null ? void 0 : e.phoneWithin) || 0,
|
|
3380
|
+
mask: z(e.phoneMask),
|
|
3381
|
+
value: e.country
|
|
3382
|
+
};
|
|
3383
|
+
});
|
|
3384
|
+
this.list = t.sort((e, s) => e.phone - s.phone);
|
|
3385
|
+
}
|
|
3386
|
+
/**
|
|
3387
|
+
* Creating a map for search.
|
|
3388
|
+
*
|
|
3389
|
+
* Создание карты для поиска.
|
|
3390
|
+
*/
|
|
3391
|
+
static makeMap() {
|
|
3392
|
+
this.list.forEach((t) => {
|
|
3393
|
+
t.mask.forEach((e) => {
|
|
3394
|
+
let s = this.map, n;
|
|
3395
|
+
if (this.toNumber(e).forEach((o) => {
|
|
3396
|
+
var a;
|
|
3397
|
+
o in s || (s[o] = {
|
|
3398
|
+
items: [],
|
|
3399
|
+
info: void 0,
|
|
3400
|
+
value: void 0,
|
|
3401
|
+
mask: [],
|
|
3402
|
+
maskFull: [],
|
|
3403
|
+
next: {}
|
|
3404
|
+
}), n = s[o], s = (a = n == null ? void 0 : n.next) != null ? a : {};
|
|
3405
|
+
}), n) {
|
|
3406
|
+
n.value === void 0 && (n.info = t, n.value = t.value);
|
|
3407
|
+
const o = this.toWithin(e, t.within);
|
|
3408
|
+
n.mask.push(o), n.maskFull.push(o.replace(/\d/ig, "*")), n.items.push(t);
|
|
3409
|
+
}
|
|
3410
|
+
});
|
|
3411
|
+
});
|
|
3412
|
+
}
|
|
3413
|
+
/**
|
|
3414
|
+
* The method parses a string argument and returns a floating point number.
|
|
3415
|
+
*
|
|
3416
|
+
* Метод принимает строку в качестве аргумента и возвращает десятичное число.
|
|
3417
|
+
* @param value the value to parse/ текстовая строка
|
|
3418
|
+
*/
|
|
3419
|
+
static toNumber(t) {
|
|
3420
|
+
return t.replace(/\D+/ig, "").split("");
|
|
3421
|
+
}
|
|
3422
|
+
/**
|
|
3423
|
+
* Converts the phone to a standard.
|
|
3424
|
+
*
|
|
3425
|
+
* Преобразовывает телефон в стандарт.
|
|
3426
|
+
* @param phone phone number/ номер телефон
|
|
3427
|
+
* @param mask a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3428
|
+
*/
|
|
3429
|
+
static toStandard(t, e) {
|
|
3430
|
+
let s = 0;
|
|
3431
|
+
return e.replace(/\*/ig, () => String(t[s++]));
|
|
3432
|
+
}
|
|
3433
|
+
/**
|
|
3434
|
+
* Replaces the first character with the internal country code
|
|
3435
|
+
*
|
|
3436
|
+
* Заменяет первый символ на код внутри страны.
|
|
3437
|
+
* @param mask a mask to transform a phone number/ маска для преобразования номер телефон
|
|
3438
|
+
* @param within internal country code/ код внутри страны
|
|
3439
|
+
*/
|
|
3440
|
+
static toWithin(t, e) {
|
|
3441
|
+
return t.replace(/\*/, this.getWithinSymbol(e));
|
|
3442
|
+
}
|
|
3443
|
+
};
|
|
3444
|
+
c(P, "list", []), c(P, "map", {}), P.makeList(), P.makeMap();
|
|
3445
|
+
let mt = P, x;
|
|
3446
|
+
class Se {
|
|
3447
|
+
/**
|
|
3448
|
+
* Returns the value by its name.
|
|
3449
|
+
*
|
|
3450
|
+
* Возвращает значение по его имени.
|
|
3451
|
+
* @param name property name/ название свойства
|
|
3452
|
+
*/
|
|
3453
|
+
static get(t) {
|
|
3454
|
+
return x && (x == null ? void 0 : x[t]);
|
|
3455
|
+
}
|
|
3456
|
+
/**
|
|
3457
|
+
* Adds data, this method works only once.
|
|
3458
|
+
*
|
|
3459
|
+
* Добавляет данные, этот метод работает только 1 раз.
|
|
3460
|
+
* @param data global data/ глобальные данные
|
|
3461
|
+
*/
|
|
3462
|
+
static add(t) {
|
|
3463
|
+
x === void 0 && (x = { ...t });
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
const B = class B {
|
|
3467
|
+
/**
|
|
3468
|
+
* Get data from hash.
|
|
3469
|
+
*
|
|
3470
|
+
* Получение данных из хэша.
|
|
3471
|
+
* @param name variable names/ названия переменных
|
|
3472
|
+
* @param defaultValue value or function to change data/ значение или функция для изменения данных
|
|
3473
|
+
*/
|
|
3474
|
+
static get(t, e) {
|
|
3475
|
+
return !(t in this.hash) && e && this.set(t, e), this.hash[t];
|
|
3476
|
+
}
|
|
3477
|
+
/**
|
|
3478
|
+
* Change data in hash.
|
|
3479
|
+
*
|
|
3480
|
+
* Изменение данных в хэше.
|
|
3481
|
+
* @param name variable names/ названия переменных
|
|
3482
|
+
* @param callback value or function to change data/ значение или функция для изменения данных
|
|
3483
|
+
*/
|
|
3484
|
+
static set(t, e) {
|
|
3485
|
+
var n;
|
|
3486
|
+
const s = N(e);
|
|
3487
|
+
s !== ((n = this.hash) == null ? void 0 : n[t]) && (this.hash[t] = s, this.update());
|
|
3488
|
+
}
|
|
3489
|
+
/**
|
|
3490
|
+
* Adding an event when data is changed.
|
|
3491
|
+
*
|
|
3492
|
+
* Добавление события при изменении данных.
|
|
3493
|
+
* @param name variable names/ названия переменных
|
|
3494
|
+
* @param callback the function is called when the data is changed/ функция вызывается при изменении данных
|
|
3495
|
+
*/
|
|
3496
|
+
static addWatch(t, e) {
|
|
3497
|
+
var s;
|
|
3498
|
+
t in this.watch ? (s = this.watch[t]) == null || s.push(e) : this.watch[t] = [e];
|
|
3499
|
+
}
|
|
3500
|
+
/**
|
|
3501
|
+
* Update hash variable from URL string.
|
|
3502
|
+
*
|
|
3503
|
+
* Обновление переменной хэша из строки URL.
|
|
3504
|
+
*/
|
|
3505
|
+
static reload() {
|
|
3506
|
+
if (!this.block) {
|
|
3507
|
+
const t = this.getLocation();
|
|
3508
|
+
this.makeWatch(t), this.hash = t;
|
|
3509
|
+
}
|
|
3510
|
+
}
|
|
3511
|
+
/**
|
|
3512
|
+
* Obtaining data from the URL string.
|
|
3513
|
+
*
|
|
3514
|
+
* Получение данных из строки URL.
|
|
3515
|
+
*/
|
|
3516
|
+
static getLocation() {
|
|
3517
|
+
const t = {};
|
|
3518
|
+
return location.hash.replace(
|
|
3519
|
+
/([\w-]+)[:=]([^;]+)/ig,
|
|
3520
|
+
(...e) => (t[String(e[1])] = At(e[2]), "")
|
|
3521
|
+
), t;
|
|
3522
|
+
}
|
|
3523
|
+
/**
|
|
3524
|
+
* Update hash string in URL.
|
|
3525
|
+
*
|
|
3526
|
+
* Обновление строки хэша в URL.
|
|
3527
|
+
*/
|
|
3528
|
+
static update() {
|
|
3529
|
+
this.block = !0, history.replaceState(null, "", `#${Lt(this.hash, "=", ";")}`), requestAnimationFrame(() => {
|
|
3530
|
+
this.block = !1;
|
|
3531
|
+
});
|
|
3532
|
+
}
|
|
3533
|
+
/**
|
|
3534
|
+
* Calling all functions whose data has changed.
|
|
3535
|
+
*
|
|
3536
|
+
* Вызов всех функций, у которых были изменены данные.
|
|
3537
|
+
* @param location fresh data/ свежий данные
|
|
3538
|
+
*/
|
|
3539
|
+
static makeWatch(t) {
|
|
3540
|
+
g(this.watch, (e, s) => {
|
|
3541
|
+
var n;
|
|
3542
|
+
((n = this.hash) == null ? void 0 : n[s]) !== (t == null ? void 0 : t[s]) && e.forEach((o) => o(t[s]));
|
|
3543
|
+
});
|
|
3544
|
+
}
|
|
3545
|
+
};
|
|
3546
|
+
c(B, "hash", {}), c(B, "watch", {}), c(B, "block", !1), l() && (B.reload(), addEventListener("hashchange", () => B.reload()));
|
|
3547
|
+
let yt = B;
|
|
3548
|
+
const tt = "__UI_ICON", $t = 320, pt = "--LOAD--", K = class K {
|
|
3549
|
+
/**
|
|
3550
|
+
* Checks if the given icon is in the list of connected icons.
|
|
3551
|
+
*
|
|
3552
|
+
* Проверяет, есть ли данная иконка в списке подключенных иконок.
|
|
3553
|
+
* @param index icon name/ название иконки
|
|
3554
|
+
*/
|
|
3555
|
+
static is(t) {
|
|
3556
|
+
return t in this.icons || this.getName(t) in this.icons;
|
|
3557
|
+
}
|
|
3558
|
+
/**
|
|
3559
|
+
* Returns the icon by the name.
|
|
3560
|
+
*
|
|
3561
|
+
* Возвращает иконку по названию.
|
|
3562
|
+
* @param index icon name/ название иконки
|
|
3563
|
+
* @param url path to the storage location of the icon, if the icon does not exist/
|
|
3564
|
+
* путь к месту хранения иконки, если иконка не существует
|
|
3565
|
+
* @param wait waiting time for picture loading/
|
|
3566
|
+
* время ожидания загрузки картинки
|
|
3567
|
+
*/
|
|
3568
|
+
static async get(t, e = "", s = 1e3 * 60 * 3) {
|
|
3569
|
+
var o, a, u, h;
|
|
3570
|
+
const n = (h = (u = (o = this.icons) == null ? void 0 : o[this.getName(t)]) != null ? u : (a = this.icons) == null ? void 0 : a[t]) != null ? h : `${t.replace(/^@/, e != null ? e : this.url)}.svg`;
|
|
3571
|
+
return typeof n == "string" ? n === pt && s > 0 ? (await this.wait(), this.get(t, e, s - $t)) : n : await n;
|
|
3572
|
+
}
|
|
3573
|
+
/**
|
|
3574
|
+
* Returns a list of names of all registered icons.
|
|
3575
|
+
*
|
|
3576
|
+
* Возвращает список названий всех зарегистрированных иконок.
|
|
3577
|
+
*/
|
|
3578
|
+
static getNameList() {
|
|
3579
|
+
return g(this.icons, (t, e) => e.replace(/^@/, ""));
|
|
3580
|
+
}
|
|
3581
|
+
/**
|
|
3582
|
+
* Returns a global link.
|
|
3583
|
+
*
|
|
3584
|
+
* Возвращает глобальную ссылку.
|
|
3585
|
+
*/
|
|
3586
|
+
static getUrlGlobal() {
|
|
3587
|
+
return `${U.isLocalhost(), ""}${this.url}`;
|
|
3588
|
+
}
|
|
3589
|
+
/**
|
|
3590
|
+
* Adding custom icons.
|
|
3591
|
+
*
|
|
3592
|
+
* Добавление пользовательских иконок.
|
|
3593
|
+
* @param index icon name/ название иконки
|
|
3594
|
+
* @param file path to the file/ путь к файлу
|
|
3595
|
+
*/
|
|
3596
|
+
static add(t, e) {
|
|
3597
|
+
this.icons[this.getName(t)] = e;
|
|
3598
|
+
}
|
|
3599
|
+
/**
|
|
3600
|
+
* Adding custom icons in loading mode.
|
|
3601
|
+
*
|
|
3602
|
+
* Добавление пользовательских иконок в режиме загрузки.
|
|
3603
|
+
* @param index icon name/ название иконки
|
|
3604
|
+
*/
|
|
3605
|
+
static addLoad(t) {
|
|
3606
|
+
this.icons[this.getName(t)] = pt;
|
|
3607
|
+
}
|
|
3608
|
+
/**
|
|
3609
|
+
* Adding custom global icons.
|
|
3610
|
+
*
|
|
3611
|
+
* Добавление пользовательских глобальных иконок.
|
|
3612
|
+
* @param index icon name/ название иконки
|
|
3613
|
+
* @param file path to the file/ путь к файлу
|
|
3614
|
+
*/
|
|
3615
|
+
static addGlobal(t, e) {
|
|
3616
|
+
this.icons[this.getName(t)] = `${this.getUrlGlobal()}${e}`;
|
|
3617
|
+
}
|
|
3618
|
+
/**
|
|
3619
|
+
* Adding an icon by the list.
|
|
3620
|
+
*
|
|
3621
|
+
* Добавление иконки по списку.
|
|
3622
|
+
* @param list list of icons/ список иконки
|
|
3623
|
+
*/
|
|
3624
|
+
static addByList(t) {
|
|
3625
|
+
g(t, (e, s) => this.add(s, e));
|
|
3626
|
+
}
|
|
3627
|
+
/**
|
|
3628
|
+
* Changes the file path.
|
|
3629
|
+
*
|
|
3630
|
+
* Изменяет путь к файлу.
|
|
3631
|
+
* @param url new file path/ новый путь к файлу
|
|
3632
|
+
*/
|
|
3633
|
+
static setUrl(t) {
|
|
3634
|
+
this.url = t;
|
|
3635
|
+
}
|
|
3636
|
+
/**
|
|
3637
|
+
* Returns the icon name.
|
|
3638
|
+
*
|
|
3639
|
+
* Возвращает название иконки.
|
|
3640
|
+
* @param index icon name/ название иконки
|
|
3641
|
+
*/
|
|
3642
|
+
static getName(t) {
|
|
3643
|
+
return `@${t}`;
|
|
3644
|
+
}
|
|
3645
|
+
/**
|
|
3646
|
+
* Script execution delay.
|
|
3647
|
+
*
|
|
3648
|
+
* Задержка выполнения скрипта.
|
|
3649
|
+
*/
|
|
3650
|
+
static wait() {
|
|
3651
|
+
return new Promise((t) => setTimeout(() => t(), $t));
|
|
3652
|
+
}
|
|
3653
|
+
};
|
|
3654
|
+
c(K, "icons", {}), c(K, "url", "/icons/"), l() && (tt in window || (window[tt] = {}), K.icons = window[tt]);
|
|
3655
|
+
let bt = K;
|
|
3656
|
+
function Mt(i, t, e) {
|
|
3657
|
+
var s, n;
|
|
3658
|
+
return (n = (s = C(i)) == null ? void 0 : s[t]) != null ? n : e;
|
|
3659
|
+
}
|
|
3660
|
+
function _t(i, t, e) {
|
|
3661
|
+
const s = C(i);
|
|
3662
|
+
if (s) {
|
|
3663
|
+
const n = Mt(s, t);
|
|
3664
|
+
if (m(n) && m(e))
|
|
3665
|
+
g(e, (o, a) => {
|
|
3666
|
+
n[a] = N(o);
|
|
3667
|
+
});
|
|
3668
|
+
else {
|
|
3669
|
+
const o = N(e);
|
|
3670
|
+
!(t in s) && typeof o == "string" ? s.setAttribute(t.toString(), o) : s[t] = N(e);
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
return s;
|
|
3674
|
+
}
|
|
3675
|
+
function it(i, t = "div", e, s) {
|
|
3676
|
+
if (!l())
|
|
3677
|
+
return;
|
|
3678
|
+
const n = document.createElement(t);
|
|
3679
|
+
return typeof e == "function" ? e(n) : k(e) && g(e, (o, a) => {
|
|
3680
|
+
_t(n, a, o);
|
|
3681
|
+
}), i == null || i.insertBefore(n, s != null ? s : null), n;
|
|
3682
|
+
}
|
|
3683
|
+
function Ot(i) {
|
|
3684
|
+
return i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").trim();
|
|
3685
|
+
}
|
|
3686
|
+
class rt {
|
|
3687
|
+
/**
|
|
3688
|
+
* Creates an instance of MetaManager.
|
|
3689
|
+
*
|
|
3690
|
+
* Создает экземпляр MetaManager.
|
|
3691
|
+
* @param listMeta list of meta-tag names to manage / список имен мета-тегов для управления
|
|
3692
|
+
* @param isProperty use 'property' attribute instead of 'name' / использовать атрибут 'property' вместо 'name'
|
|
3693
|
+
*/
|
|
3694
|
+
constructor(t, e = !1) {
|
|
3695
|
+
c(this, "items", {});
|
|
3696
|
+
this.listMeta = t, this.isProperty = e, this.update();
|
|
3697
|
+
}
|
|
3698
|
+
/**
|
|
3699
|
+
* Returns the list of meta tag names.
|
|
3700
|
+
*
|
|
3701
|
+
* Возвращает список имен мета-тегов.
|
|
3702
|
+
*/
|
|
3703
|
+
getListMeta() {
|
|
3704
|
+
return this.listMeta;
|
|
3705
|
+
}
|
|
3706
|
+
/**
|
|
3707
|
+
* Get the content of a meta tag by name.
|
|
3708
|
+
*
|
|
3709
|
+
* Получает содержимое мета-тега по имени.
|
|
3710
|
+
* @param name meta tag name / имя мета-тега
|
|
3711
|
+
*/
|
|
3712
|
+
get(t) {
|
|
3713
|
+
var e;
|
|
3714
|
+
return (e = this.items[t]) != null ? e : "";
|
|
3715
|
+
}
|
|
3716
|
+
/**
|
|
3717
|
+
* Returns all meta tags.
|
|
3718
|
+
*
|
|
3719
|
+
* Возвращает все мета-теги.
|
|
3720
|
+
*/
|
|
3721
|
+
getItems() {
|
|
3722
|
+
return this.items;
|
|
3723
|
+
}
|
|
3724
|
+
/**
|
|
3725
|
+
* Returns all meta tags as HTML string.
|
|
3726
|
+
*
|
|
3727
|
+
* Возвращает все мета-теги в виде HTML-строки.
|
|
3728
|
+
*/
|
|
3729
|
+
html() {
|
|
3730
|
+
return g(
|
|
3731
|
+
this.listMeta,
|
|
3732
|
+
(e) => this.toHtmlString(e)
|
|
3733
|
+
).join("");
|
|
3734
|
+
}
|
|
3735
|
+
/**
|
|
3736
|
+
* Sets the content of a meta tag.
|
|
3737
|
+
*
|
|
3738
|
+
* Устанавливает содержимое мета-тега.
|
|
3739
|
+
* @param name meta tag name / имя мета-тега
|
|
3740
|
+
* @param content meta tag content / содержимое мета-тега
|
|
3741
|
+
*/
|
|
3742
|
+
set(t, e) {
|
|
3743
|
+
return this.setItem(t, e).setMeta(t), this;
|
|
3744
|
+
}
|
|
3745
|
+
/**
|
|
3746
|
+
* Sets multiple meta tags from an object.
|
|
3747
|
+
*
|
|
3748
|
+
* Устанавливает несколько мета-тегов из объекта.
|
|
3749
|
+
* @param metaList object with meta tag names and content / объект с именами и содержимым мета-тегов
|
|
3750
|
+
*/
|
|
3751
|
+
setByList(t) {
|
|
3752
|
+
return g(
|
|
3753
|
+
t,
|
|
3754
|
+
(e, s) => this.set(s, String(e))
|
|
3755
|
+
), this;
|
|
3756
|
+
}
|
|
3757
|
+
/**
|
|
3758
|
+
* Returns the attribute name for meta tags.
|
|
3759
|
+
*
|
|
3760
|
+
* Возвращает имя атрибута для мета-тегов.
|
|
3761
|
+
*/
|
|
3762
|
+
getAttributeName() {
|
|
3763
|
+
return this.isProperty ? "property" : "name";
|
|
3764
|
+
}
|
|
3765
|
+
/**
|
|
3766
|
+
* Finds a meta element in the DOM.
|
|
3767
|
+
*
|
|
3768
|
+
* Находит мета-элемент в DOM.
|
|
3769
|
+
* @param name meta tag name / имя мета-тега
|
|
3770
|
+
*/
|
|
3771
|
+
findMetaElement(t) {
|
|
3772
|
+
if (!l())
|
|
3773
|
+
return;
|
|
3774
|
+
const e = `meta[${this.getAttributeName()}="${t}"]`;
|
|
3775
|
+
return document.querySelector(e) || void 0;
|
|
3776
|
+
}
|
|
3777
|
+
/**
|
|
3778
|
+
* Sets the content of a meta tag in internal storage.
|
|
3779
|
+
*
|
|
3780
|
+
* Устанавливает содержимое мета-тега во внутреннем хранилище.
|
|
3781
|
+
* @param name meta tag name / имя мета-тега
|
|
3782
|
+
* @param content meta tag content / содержимое мета-тега
|
|
3783
|
+
*/
|
|
3784
|
+
setItem(t, e) {
|
|
3785
|
+
return this.items[t] = e, this;
|
|
3786
|
+
}
|
|
3787
|
+
/**
|
|
3788
|
+
* Sets or creates a meta tag in the DOM.
|
|
3789
|
+
*
|
|
3790
|
+
* Устанавливает или создает мета-тег в DOM.
|
|
3791
|
+
* @param name meta tag name / имя мета-тега
|
|
3792
|
+
*/
|
|
3793
|
+
setMeta(t) {
|
|
3794
|
+
var n;
|
|
3795
|
+
const e = this.findMetaElement(t), s = (n = this.items[t]) != null ? n : "";
|
|
3796
|
+
if (e)
|
|
3797
|
+
e.content = s;
|
|
3798
|
+
else if (l()) {
|
|
3799
|
+
const o = { content: s };
|
|
3800
|
+
this.isProperty ? o.property = t : o.name = t, it(document.head, "meta", o);
|
|
3801
|
+
}
|
|
3802
|
+
return this;
|
|
3803
|
+
}
|
|
3804
|
+
/**
|
|
3805
|
+
* Converts meta tag to HTML string.
|
|
3806
|
+
*
|
|
3807
|
+
* Преобразует мета-тег в HTML-строку.
|
|
3808
|
+
* @param name meta tag name / имя мета-тега
|
|
3809
|
+
*/
|
|
3810
|
+
toHtmlString(t) {
|
|
3811
|
+
var s;
|
|
3812
|
+
const e = Ot((s = this.items[t]) != null ? s : "");
|
|
3813
|
+
return e ? `<meta ${this.getAttributeName()}="${t}" content="${e}">` : "";
|
|
3814
|
+
}
|
|
3815
|
+
/**
|
|
3816
|
+
* Updates meta tags data from the DOM.
|
|
3817
|
+
*
|
|
3818
|
+
* Обновляет данные мета-тегов из DOM.
|
|
3819
|
+
*/
|
|
3820
|
+
update() {
|
|
3821
|
+
return this.listMeta.forEach((t) => {
|
|
3822
|
+
var e, s;
|
|
3823
|
+
this.items[t] = (s = (e = this.findMetaElement(t)) == null ? void 0 : e.content) != null ? s : "";
|
|
3824
|
+
}), this;
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3827
|
+
var v = /* @__PURE__ */ ((i) => (i.description = "description", i.keywords = "keywords", i.canonical = "canonical", i.robots = "robots", i.author = "author", i))(v || {}), Tt = /* @__PURE__ */ ((i) => (i.indexFollow = "index, follow", i.noIndexFollow = "noindex, follow", i.indexNoFollow = "index, nofollow", i.noIndexNoFollow = "noindex, nofollow", i.noArchive = "noarchive", i.noSnippet = "nosnippet", i.noImageIndex = "noimageindex", i.images = "images", i.noTranslate = "notranslate", i.noPreview = "nopreview", i.textOnly = "textonly", i.noIndexSubpages = "noindex, noarchive", i.none = "none", i))(Tt || {}), y = /* @__PURE__ */ ((i) => (i.title = "og:title", i.type = "og:type", i.url = "og:url", i.image = "og:image", i.description = "og:description", i.locale = "og:locale", i.siteName = "og:site_name", i.localeAlternate = "og:locale:alternate", i.imageUrl = "og:image:url", i.imageSecureUrl = "og:image:secure_url", i.imageType = "og:image:type", i.imageWidth = "og:image:width", i.imageHeight = "og:image:height", i.imageAlt = "og:image:alt", i.video = "og:video", i.videoUrl = "og:video:url", i.videoSecureUrl = "og:video:secure_url", i.videoType = "og:video:type", i.videoWidth = "og:video:width", i.videoHeight = "og:video:height", i.audio = "og:audio", i.audioSecureUrl = "og:audio:secure_url", i.audioType = "og:audio:type", i.articlePublishedTime = "article:published_time", i.articleModifiedTime = "article:modified_time", i.articleExpirationTime = "article:expiration_time", i.articleAuthor = "article:author", i.articleSection = "article:section", i.articleTag = "article:tag", i.bookAuthor = "book:author", i.bookIsbn = "book:isbn", i.bookReleaseDate = "book:release_date", i.bookTag = "book:tag", i.musicDuration = "music:duration", i.musicAlbum = "music:album", i.musicAlbumDisc = "music:album:disc", i.musicAlbumTrack = "music:album:track", i.musicMusician = "music:musician", i.musicSong = "music:song", i.musicSongDisc = "music:song:disc", i.musicSongTrack = "music:song:track", i.musicReleaseDate = "music:release_date", i.musicCreator = "music:creator", i.videoActor = "video:actor", i.videoActorRole = "video:actor:role", i.videoDirector = "video:director", i.videoWriter = "video:writer", i.videoDuration = "video:duration", i.videoReleaseDate = "video:release_date", i.videoTag = "video:tag", i.videoSeries = "video:series", i.profileFirstName = "profile:first_name", i.profileLastName = "profile:last_name", i.profileUsername = "profile:username", i.profileGender = "profile:gender", i.productBrand = "product:brand", i.productAvailability = "product:availability", i.productCondition = "product:condition", i.productPriceAmount = "product:price:amount", i.productPriceCurrency = "product:price:currency", i.productRetailerItemId = "product:retailer_item_id", i.productCategory = "product:category", i.productEan = "product:ean", i.productIsbn = "product:isbn", i.productMfrPartNo = "product:mfr_part_no", i.productUpc = "product:upc", i.productWeightValue = "product:weight:value", i.productWeightUnits = "product:weight:units", i.productColor = "product:color", i.productMaterial = "product:material", i.productPattern = "product:pattern", i.productAgeGroup = "product:age_group", i.productGender = "product:gender", i))(y || {}), Gt = /* @__PURE__ */ ((i) => (i.website = "website", i.article = "article", i.video = "video.other", i.videoTvShow = "video.tv_show", i.videoEpisode = "video.episode", i.videoMovie = "video.movie", i.musicAlbum = "music.album", i.musicPlaylist = "music.playlist", i.musicSong = "music.song", i.musicRadioStation = "music.radio_station", i.app = "app", i.product = "product", i.business = "business.business", i.place = "place", i.event = "event", i.profile = "profile", i.book = "book", i))(Gt || {}), te = /* @__PURE__ */ ((i) => (i.inStock = "in stock", i.outOfStock = "out of stock", i.preorder = "preorder", i.backorder = "backorder", i.discontinued = "discontinued", i.pending = "pending", i))(te || {}), ee = /* @__PURE__ */ ((i) => (i.new = "new", i.used = "used", i.refurbished = "refurbished", i))(ee || {}), ie = /* @__PURE__ */ ((i) => (i.newborn = "newborn", i.infant = "infant", i.toddler = "toddler", i.kids = "kids", i.adult = "adult", i))(ie || {}), se = /* @__PURE__ */ ((i) => (i.female = "female", i.male = "male", i.unisex = "unisex", i))(se || {}), $ = /* @__PURE__ */ ((i) => (i.card = "twitter:card", i.site = "twitter:site", i.creator = "twitter:creator", i.url = "twitter:url", i.title = "twitter:title", i.description = "twitter:description", i.image = "twitter:image", i.imageAlt = "twitter:image:alt", i.imageSrc = "twitter:image:src", i.imageWidth = "twitter:image:width", i.imageHeight = "twitter:image:height", i.label1 = "twitter:label1", i.data1 = "twitter:data1", i.label2 = "twitter:label2", i.data2 = "twitter:data2", i.appNameIphone = "twitter:app:name:iphone", i.appIdIphone = "twitter:app:id:iphone", i.appUrlIphone = "twitter:app:url:iphone", i.appNameIpad = "twitter:app:name:ipad", i.appIdIpad = "twitter:app:id:ipad", i.appUrlIpad = "twitter:app:url:ipad", i.appNameGooglePlay = "twitter:app:name:googleplay", i.appIdGooglePlay = "twitter:app:id:googleplay", i.appUrlGooglePlay = "twitter:app:url:googleplay", i.player = "twitter:player", i.playerWidth = "twitter:player:width", i.playerHeight = "twitter:player:height", i.playerStream = "twitter:player:stream", i.playerStreamContentType = "twitter:player:stream:content_type", i))($ || {}), re = /* @__PURE__ */ ((i) => (i.summary = "summary", i.summaryLargeImage = "summary_large_image", i.app = "app", i.player = "player", i.product = "product", i.gallery = "gallery", i.photo = "photo", i.leadGeneration = "lead_generation", i.audio = "audio", i.poll = "poll", i))(re || {});
|
|
3828
|
+
class ne extends rt {
|
|
3829
|
+
constructor() {
|
|
3830
|
+
super(Object.values(y), !0);
|
|
3831
|
+
}
|
|
3832
|
+
/**
|
|
3833
|
+
* Gets the Open Graph title.
|
|
3834
|
+
*
|
|
3835
|
+
* Получает заголовок Open Graph.
|
|
3836
|
+
*/
|
|
3837
|
+
getTitle() {
|
|
3838
|
+
return this.get(y.title);
|
|
3839
|
+
}
|
|
3840
|
+
/**
|
|
3841
|
+
* Gets the Open Graph type.
|
|
3842
|
+
*
|
|
3843
|
+
* Получает тип Open Graph.
|
|
3844
|
+
*/
|
|
3845
|
+
getType() {
|
|
3846
|
+
return this.get(y.type);
|
|
3847
|
+
}
|
|
3848
|
+
/**
|
|
3849
|
+
* Gets the Open Graph URL.
|
|
3850
|
+
*
|
|
3851
|
+
* Получает URL Open Graph.
|
|
3852
|
+
*/
|
|
3853
|
+
getUrl() {
|
|
3854
|
+
return this.get(y.url);
|
|
3855
|
+
}
|
|
3856
|
+
/**
|
|
3857
|
+
* Gets the Open Graph image URL.
|
|
3858
|
+
*
|
|
3859
|
+
* Получает URL изображения Open Graph.
|
|
3860
|
+
*/
|
|
3861
|
+
getImage() {
|
|
3862
|
+
return this.get(y.image);
|
|
3863
|
+
}
|
|
3864
|
+
/**
|
|
3865
|
+
* Gets the Open Graph description.
|
|
3866
|
+
*
|
|
3867
|
+
* Получает описание Open Graph.
|
|
3868
|
+
*/
|
|
3869
|
+
getDescription() {
|
|
3870
|
+
return this.get(y.description);
|
|
3871
|
+
}
|
|
3872
|
+
/**
|
|
3873
|
+
* Gets the Open Graph locale.
|
|
3874
|
+
*
|
|
3875
|
+
* Получает локаль Open Graph.
|
|
3876
|
+
*/
|
|
3877
|
+
getLocale() {
|
|
3878
|
+
return this.get(y.locale);
|
|
3879
|
+
}
|
|
3880
|
+
/**
|
|
3881
|
+
* Gets the Open Graph site name.
|
|
3882
|
+
*
|
|
3883
|
+
* Получает название сайта Open Graph.
|
|
3884
|
+
*/
|
|
3885
|
+
getSiteName() {
|
|
3886
|
+
return this.get(y.siteName);
|
|
3887
|
+
}
|
|
3888
|
+
/**
|
|
3889
|
+
* Sets the Open Graph title.
|
|
3890
|
+
*
|
|
3891
|
+
* Устанавливает заголовок Open Graph.
|
|
3892
|
+
* @param title title / заголовок
|
|
3893
|
+
*/
|
|
3894
|
+
setTitle(t) {
|
|
3895
|
+
return this.set(y.title, t);
|
|
3896
|
+
}
|
|
3897
|
+
/**
|
|
3898
|
+
* Sets the Open Graph type.
|
|
3899
|
+
*
|
|
3900
|
+
* Устанавливает тип Open Graph.
|
|
3901
|
+
* @param type type / тип
|
|
3902
|
+
*/
|
|
3903
|
+
setType(t) {
|
|
3904
|
+
return this.set(y.type, t);
|
|
3905
|
+
}
|
|
3906
|
+
/**
|
|
3907
|
+
* Sets the Open Graph URL.
|
|
3908
|
+
*
|
|
3909
|
+
* Устанавливает URL Open Graph.
|
|
3910
|
+
* @param url URL / URL
|
|
3911
|
+
*/
|
|
3912
|
+
setUrl(t) {
|
|
3913
|
+
return this.set(y.url, t);
|
|
3914
|
+
}
|
|
3915
|
+
/**
|
|
3916
|
+
* Sets the Open Graph image URL.
|
|
3917
|
+
*
|
|
3918
|
+
* Устанавливает URL изображения Open Graph.
|
|
3919
|
+
* @param url image URL / URL изображения
|
|
3920
|
+
*/
|
|
3921
|
+
setImage(t) {
|
|
3922
|
+
return this.set(y.image, t);
|
|
3923
|
+
}
|
|
3924
|
+
/**
|
|
3925
|
+
* Sets the Open Graph description.
|
|
3926
|
+
*
|
|
3927
|
+
* Устанавливает описание Open Graph.
|
|
3928
|
+
* @param description description / описание
|
|
3929
|
+
*/
|
|
3930
|
+
setDescription(t) {
|
|
3931
|
+
return this.set(y.description, t);
|
|
3932
|
+
}
|
|
3933
|
+
/**
|
|
3934
|
+
* Sets the Open Graph locale.
|
|
3935
|
+
*
|
|
3936
|
+
* Устанавливает локаль Open Graph.
|
|
3937
|
+
* @param locale locale (e.g. 'en_US', 'ru_RU') / локаль (например, 'en_US', 'ru_RU')
|
|
3938
|
+
*/
|
|
3939
|
+
setLocale(t) {
|
|
3940
|
+
return this.set(y.locale, t);
|
|
3941
|
+
}
|
|
3942
|
+
/**
|
|
3943
|
+
* Sets the Open Graph site name.
|
|
3944
|
+
*
|
|
3945
|
+
* Устанавливает название сайта Open Graph.
|
|
3946
|
+
* @param siteName site name / название сайта
|
|
3947
|
+
*/
|
|
3948
|
+
setSiteName(t) {
|
|
3949
|
+
return this.set(y.siteName, t);
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
class oe extends rt {
|
|
3953
|
+
constructor() {
|
|
3954
|
+
super(Object.values($));
|
|
3955
|
+
}
|
|
3956
|
+
/**
|
|
3957
|
+
* Gets the Twitter Card type.
|
|
3958
|
+
*
|
|
3959
|
+
* Получает тип Twitter Card.
|
|
3960
|
+
*/
|
|
3961
|
+
getCard() {
|
|
3962
|
+
return this.get($.card);
|
|
3963
|
+
}
|
|
3964
|
+
/**
|
|
3965
|
+
* Gets the website or brand @username.
|
|
3966
|
+
*
|
|
3967
|
+
* Получает аккаунт сайта или бренда (@username).
|
|
3968
|
+
*/
|
|
3969
|
+
getSite() {
|
|
3970
|
+
return this.get($.site);
|
|
3971
|
+
}
|
|
3972
|
+
/**
|
|
3973
|
+
* Gets the content creator @username.
|
|
3974
|
+
*
|
|
3975
|
+
* Получает автора контента (@username).
|
|
3976
|
+
*/
|
|
3977
|
+
getCreator() {
|
|
3978
|
+
return this.get($.creator);
|
|
3979
|
+
}
|
|
3980
|
+
/**
|
|
3981
|
+
* Gets the page URL.
|
|
3982
|
+
*
|
|
3983
|
+
* Получает URL страницы.
|
|
3984
|
+
*/
|
|
3985
|
+
getUrl() {
|
|
3986
|
+
return this.get($.url);
|
|
3987
|
+
}
|
|
3988
|
+
/**
|
|
3989
|
+
* Gets the card title.
|
|
3990
|
+
*
|
|
3991
|
+
* Получает заголовок карточки.
|
|
3992
|
+
*/
|
|
3993
|
+
getTitle() {
|
|
3994
|
+
return this.get($.title);
|
|
3995
|
+
}
|
|
3996
|
+
/**
|
|
3997
|
+
* Gets the card description.
|
|
3998
|
+
*
|
|
3999
|
+
* Получает описание карточки.
|
|
4000
|
+
*/
|
|
4001
|
+
getDescription() {
|
|
4002
|
+
return this.get($.description);
|
|
4003
|
+
}
|
|
4004
|
+
/**
|
|
4005
|
+
* Gets the card image URL.
|
|
4006
|
+
*
|
|
4007
|
+
* Получает URL изображения карточки.
|
|
4008
|
+
*/
|
|
4009
|
+
getImage() {
|
|
4010
|
+
return this.get($.image);
|
|
4011
|
+
}
|
|
4012
|
+
/**
|
|
4013
|
+
* Sets the Twitter Card type.
|
|
4014
|
+
*
|
|
4015
|
+
* Устанавливает тип Twitter Card.
|
|
4016
|
+
* @param card card type / тип карточки
|
|
4017
|
+
*/
|
|
4018
|
+
setCard(t) {
|
|
4019
|
+
return this.set($.card, t), this;
|
|
4020
|
+
}
|
|
4021
|
+
/**
|
|
4022
|
+
* Sets the website or brand @username.
|
|
4023
|
+
*
|
|
4024
|
+
* Устанавливает аккаунт сайта или бренда (@username).
|
|
4025
|
+
* @param site @username / аккаунт
|
|
4026
|
+
*/
|
|
4027
|
+
setSite(t) {
|
|
4028
|
+
return this.set($.site, t), this;
|
|
4029
|
+
}
|
|
4030
|
+
/**
|
|
4031
|
+
* Sets the content creator @username.
|
|
4032
|
+
*
|
|
4033
|
+
* Устанавливает автора контента (@username).
|
|
4034
|
+
* @param creator @username / аккаунт автора
|
|
4035
|
+
*/
|
|
4036
|
+
setCreator(t) {
|
|
4037
|
+
return this.set($.creator, t), this;
|
|
4038
|
+
}
|
|
4039
|
+
/**
|
|
4040
|
+
* Sets the page URL.
|
|
4041
|
+
*
|
|
4042
|
+
* Устанавливает URL страницы.
|
|
4043
|
+
* @param url URL / URL
|
|
4044
|
+
*/
|
|
4045
|
+
setUrl(t) {
|
|
4046
|
+
return this.set($.url, t), this;
|
|
4047
|
+
}
|
|
4048
|
+
/**
|
|
4049
|
+
* Sets the card title.
|
|
4050
|
+
*
|
|
4051
|
+
* Устанавливает заголовок карточки.
|
|
4052
|
+
* @param title title / заголовок
|
|
4053
|
+
*/
|
|
4054
|
+
setTitle(t) {
|
|
4055
|
+
return this.set($.title, t), this;
|
|
4056
|
+
}
|
|
4057
|
+
/**
|
|
4058
|
+
* Sets the card description.
|
|
4059
|
+
*
|
|
4060
|
+
* Устанавливает описание карточки.
|
|
4061
|
+
* @param description description / описание
|
|
4062
|
+
*/
|
|
4063
|
+
setDescription(t) {
|
|
4064
|
+
return this.set($.description, t), this;
|
|
4065
|
+
}
|
|
4066
|
+
/**
|
|
4067
|
+
* Sets the card image URL.
|
|
4068
|
+
*
|
|
4069
|
+
* Устанавливает URL изображения карточки.
|
|
4070
|
+
* @param image image URL / URL изображения
|
|
4071
|
+
*/
|
|
4072
|
+
setImage(t) {
|
|
4073
|
+
return this.set($.image, t), this;
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
class De extends rt {
|
|
4077
|
+
/**
|
|
4078
|
+
* Creates an instance of Meta with integrated Open Graph and Twitter Card support.
|
|
4079
|
+
*
|
|
4080
|
+
* Создает экземпляр Meta с интегрированной поддержкой Open Graph и Twitter Card.
|
|
4081
|
+
*/
|
|
4082
|
+
constructor() {
|
|
4083
|
+
super(Object.values(v));
|
|
4084
|
+
c(this, "suffix");
|
|
4085
|
+
c(this, "og");
|
|
4086
|
+
c(this, "twitter");
|
|
4087
|
+
this.og = new ne(), this.twitter = new oe();
|
|
4088
|
+
}
|
|
4089
|
+
/**
|
|
4090
|
+
* Gets the MetaOg instance for advanced Open Graph operations.
|
|
4091
|
+
*
|
|
4092
|
+
* Получает экземпляр MetaOg для расширенных операций с Open Graph.
|
|
4093
|
+
*/
|
|
4094
|
+
getOg() {
|
|
4095
|
+
return this.og;
|
|
4096
|
+
}
|
|
4097
|
+
/**
|
|
4098
|
+
* Gets the MetaTwitter instance for advanced Twitter Card operations.
|
|
4099
|
+
*
|
|
4100
|
+
* Получает экземпляр MetaTwitter для расширенных операций с Twitter Card.
|
|
4101
|
+
*/
|
|
4102
|
+
getTwitter() {
|
|
4103
|
+
return this.twitter;
|
|
4104
|
+
}
|
|
4105
|
+
/**
|
|
4106
|
+
* Gets the page title without suffix.
|
|
4107
|
+
*
|
|
4108
|
+
* Получает заголовок страницы без суффикса.
|
|
4109
|
+
*/
|
|
4110
|
+
getTitle() {
|
|
4111
|
+
return l() ? document.title.replace(this.getSuffix(), "").trim() : "";
|
|
4112
|
+
}
|
|
4113
|
+
/**
|
|
4114
|
+
* Gets the keywords meta tag.
|
|
4115
|
+
*
|
|
4116
|
+
* Получает мета-тег keywords.
|
|
4117
|
+
*/
|
|
4118
|
+
getKeywords() {
|
|
4119
|
+
return this.get(v.keywords);
|
|
4120
|
+
}
|
|
4121
|
+
/**
|
|
4122
|
+
* Gets the description meta tag.
|
|
4123
|
+
*
|
|
4124
|
+
* Получает мета-тег description.
|
|
4125
|
+
*/
|
|
4126
|
+
getDescription() {
|
|
4127
|
+
return this.get(v.description);
|
|
4128
|
+
}
|
|
4129
|
+
/**
|
|
4130
|
+
* Gets the Open Graph image URL.
|
|
4131
|
+
*
|
|
4132
|
+
* Получает URL изображения Open Graph.
|
|
4133
|
+
*/
|
|
4134
|
+
getImage() {
|
|
4135
|
+
return this.og.getImage();
|
|
4136
|
+
}
|
|
4137
|
+
/**
|
|
4138
|
+
* Gets the canonical URL.
|
|
4139
|
+
*
|
|
4140
|
+
* Получает канонический URL.
|
|
4141
|
+
*/
|
|
4142
|
+
getCanonical() {
|
|
4143
|
+
return this.get(v.canonical);
|
|
4144
|
+
}
|
|
4145
|
+
/**
|
|
4146
|
+
* Gets the robots meta tag value.
|
|
4147
|
+
*
|
|
4148
|
+
* Получает значение мета-тега robots.
|
|
4149
|
+
*/
|
|
4150
|
+
getRobots() {
|
|
4151
|
+
return this.get(v.robots);
|
|
4152
|
+
}
|
|
4153
|
+
/**
|
|
4154
|
+
* Gets the author meta tag.
|
|
4155
|
+
*
|
|
4156
|
+
* Получает мета-тег author.
|
|
4157
|
+
*/
|
|
4158
|
+
getAuthor() {
|
|
4159
|
+
return this.get(v.author);
|
|
4160
|
+
}
|
|
4161
|
+
/**
|
|
4162
|
+
* Gets the Open Graph site name.
|
|
4163
|
+
*
|
|
4164
|
+
* Получает название сайта Open Graph.
|
|
4165
|
+
*/
|
|
4166
|
+
getSiteName() {
|
|
4167
|
+
return this.og.getSiteName();
|
|
4168
|
+
}
|
|
4169
|
+
/**
|
|
4170
|
+
* Gets the Open Graph locale.
|
|
4171
|
+
*
|
|
4172
|
+
* Получает локаль Open Graph.
|
|
4173
|
+
*/
|
|
4174
|
+
getLocale() {
|
|
4175
|
+
return this.og.getLocale();
|
|
4176
|
+
}
|
|
4177
|
+
/**
|
|
4178
|
+
* Sets the page title (with suffix) and updates Open Graph and Twitter Card titles.
|
|
4179
|
+
*
|
|
4180
|
+
* Устанавливает заголовок страницы (с суффиксом) и обновляет заголовки Open Graph и Twitter Card.
|
|
4181
|
+
* @param title page title / заголовок страницы
|
|
4182
|
+
*/
|
|
4183
|
+
setTitle(e) {
|
|
4184
|
+
if (l()) {
|
|
4185
|
+
const s = D(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
|
|
4186
|
+
document.title = s, this.og.setTitle(s), this.twitter.setTitle(s);
|
|
4187
|
+
}
|
|
4188
|
+
return this;
|
|
4189
|
+
}
|
|
4190
|
+
/**
|
|
4191
|
+
* Sets the keywords meta tag.
|
|
4192
|
+
*
|
|
4193
|
+
* Устанавливает мета-тег keywords.
|
|
4194
|
+
* @param keywords keywords as string or array / ключевые слова в виде строки или массива
|
|
4195
|
+
*/
|
|
4196
|
+
setKeywords(e) {
|
|
4197
|
+
return this.set(v.keywords, z(e).join(", ")), this;
|
|
4198
|
+
}
|
|
4199
|
+
/**
|
|
4200
|
+
* Sets the description meta tag.
|
|
4201
|
+
*
|
|
4202
|
+
* Устанавливает мета-тег description.
|
|
4203
|
+
* @param description page description / описание страницы
|
|
4204
|
+
*/
|
|
4205
|
+
setDescription(e) {
|
|
4206
|
+
return this.set(v.description, e), this;
|
|
4207
|
+
}
|
|
4208
|
+
/**
|
|
4209
|
+
* Sets the image for Open Graph and Twitter Card.
|
|
4210
|
+
*
|
|
4211
|
+
* Устанавливает изображение для Open Graph и Twitter Card.
|
|
4212
|
+
* @param image image URL / URL изображения
|
|
4213
|
+
*/
|
|
4214
|
+
setImage(e) {
|
|
4215
|
+
return this.og.setImage(e), this.twitter.setImage(e), this;
|
|
4216
|
+
}
|
|
4217
|
+
/**
|
|
4218
|
+
* Sets the canonical URL and updates Open Graph and Twitter Card URLs.
|
|
4219
|
+
*
|
|
4220
|
+
* Устанавливает канонический URL и обновляет URL для Open Graph и Twitter Card.
|
|
4221
|
+
* @param canonical canonical URL / канонический URL
|
|
4222
|
+
*/
|
|
4223
|
+
setCanonical(e) {
|
|
4224
|
+
return this.set(v.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
|
|
4225
|
+
}
|
|
4226
|
+
/**
|
|
4227
|
+
* Sets the robots meta tag.
|
|
4228
|
+
*
|
|
4229
|
+
* Устанавливает мета-тег robots.
|
|
4230
|
+
* @param robots robots directive / директива robots
|
|
4231
|
+
*/
|
|
4232
|
+
setRobots(e) {
|
|
4233
|
+
return this.set(v.robots, e), this;
|
|
4234
|
+
}
|
|
4235
|
+
/**
|
|
4236
|
+
* Sets the author meta tag.
|
|
4237
|
+
*
|
|
4238
|
+
* Устанавливает мета-тег author.
|
|
4239
|
+
* @param author author name / имя автора
|
|
4240
|
+
*/
|
|
4241
|
+
setAuthor(e) {
|
|
4242
|
+
return this.set(v.author, e), this;
|
|
4243
|
+
}
|
|
4244
|
+
/**
|
|
4245
|
+
* Sets the site name for Open Graph and Twitter Card.
|
|
4246
|
+
*
|
|
4247
|
+
* Устанавливает название сайта для Open Graph и Twitter Card.
|
|
4248
|
+
* @param siteName site name / название сайта
|
|
4249
|
+
*/
|
|
4250
|
+
setSiteName(e) {
|
|
4251
|
+
return this.og.setSiteName(e), this.twitter.setSite(e), this;
|
|
4252
|
+
}
|
|
4253
|
+
/**
|
|
4254
|
+
* Sets the locale for Open Graph.
|
|
4255
|
+
*
|
|
4256
|
+
* Устанавливает локаль для Open Graph.
|
|
4257
|
+
* @param locale locale (e.g. 'en_US', 'ru_RU') / локаль (например, 'en_US', 'ru_RU')
|
|
4258
|
+
*/
|
|
4259
|
+
setLocale(e) {
|
|
4260
|
+
return this.og.setLocale(e), this;
|
|
4261
|
+
}
|
|
4262
|
+
/**
|
|
4263
|
+
* Sets the suffix to append to page title.
|
|
4264
|
+
*
|
|
4265
|
+
* Устанавливает суффикс для добавления к заголовку страницы.
|
|
4266
|
+
* @param suffix title suffix (e.g. 'My Site') / суффикс заголовка (например, 'Мой Сайт')
|
|
4267
|
+
*/
|
|
4268
|
+
setSuffix(e) {
|
|
4269
|
+
this.suffix = e;
|
|
4270
|
+
}
|
|
4271
|
+
/**
|
|
4272
|
+
* Generates the complete HTML for all meta-tags including Open Graph and Twitter Card.
|
|
4273
|
+
*
|
|
4274
|
+
* Генерирует полный HTML для всех мета-тегов, включая Open Graph и Twitter Card.
|
|
4275
|
+
*/
|
|
4276
|
+
html() {
|
|
4277
|
+
return `${super.html()}${this.og.html()}${this.twitter.html()}`;
|
|
4278
|
+
}
|
|
4279
|
+
/**
|
|
4280
|
+
* Gets the formatted suffix with separator.
|
|
4281
|
+
*
|
|
4282
|
+
* Получает отформатированный суффикс с разделителем.
|
|
4283
|
+
*/
|
|
4284
|
+
getSuffix() {
|
|
4285
|
+
return D(this.suffix) ? ` - ${this.suffix}` : "";
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
class st {
|
|
4289
|
+
/**
|
|
4290
|
+
* Checks whether to enable scroll hiding.
|
|
4291
|
+
*
|
|
4292
|
+
* Проверяет, надо ли включить скрытие скролла.
|
|
4293
|
+
*/
|
|
4294
|
+
static async is() {
|
|
4295
|
+
const t = await this.get();
|
|
4296
|
+
return t !== -1 && t <= 8;
|
|
4297
|
+
}
|
|
4298
|
+
/**
|
|
4299
|
+
* Returns the width of the scroll.
|
|
4300
|
+
*
|
|
4301
|
+
* Возвращает ширину скролла.
|
|
4302
|
+
*/
|
|
4303
|
+
static async get() {
|
|
4304
|
+
var e;
|
|
4305
|
+
const t = (e = this.storage.get()) != null ? e : -1;
|
|
4306
|
+
if (!this.calculate && t === -1) {
|
|
4307
|
+
const s = await this.init();
|
|
4308
|
+
return this.storage.set(s), s;
|
|
4309
|
+
}
|
|
4310
|
+
return t;
|
|
4311
|
+
}
|
|
4312
|
+
/**
|
|
4313
|
+
* Creates elements to check the width of the scroll.
|
|
4314
|
+
*
|
|
4315
|
+
* Создает элементы для проверки ширины скролла.
|
|
4316
|
+
*/
|
|
4317
|
+
static createElement() {
|
|
4318
|
+
return it(document.body, "div", (t) => {
|
|
4319
|
+
t.style.height = "24px", t.style.overflowY = "scroll", t.style.position = "fixed", t.style.width = "100%", it(t, "div", (e) => {
|
|
4320
|
+
e.style.height = "100px";
|
|
4321
|
+
});
|
|
4322
|
+
});
|
|
4323
|
+
}
|
|
4324
|
+
/**
|
|
4325
|
+
* Initialization of data to check the width of the scroll.
|
|
4326
|
+
*
|
|
4327
|
+
* Инициализация данных для проверки ширины скролла.
|
|
4328
|
+
*/
|
|
4329
|
+
static init() {
|
|
4330
|
+
return new Promise((t) => {
|
|
4331
|
+
this.calculate = !0;
|
|
4332
|
+
const e = this.createElement();
|
|
4333
|
+
e ? requestAnimationFrame(() => {
|
|
4334
|
+
t(e.offsetWidth - e.clientWidth), e.remove(), this.calculate = !1;
|
|
4335
|
+
}) : t(0);
|
|
4336
|
+
});
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
c(st, "storage", new _("scrollbar", !0)), c(st, "calculate", !1);
|
|
4340
|
+
const ae = [
|
|
4341
|
+
"d",
|
|
4342
|
+
"e",
|
|
4343
|
+
"f",
|
|
4344
|
+
"g",
|
|
4345
|
+
"h",
|
|
4346
|
+
"i",
|
|
4347
|
+
"j",
|
|
4348
|
+
"k",
|
|
4349
|
+
"l",
|
|
4350
|
+
"m",
|
|
4351
|
+
"n",
|
|
4352
|
+
"o",
|
|
4353
|
+
"p",
|
|
4354
|
+
"q",
|
|
4355
|
+
"r",
|
|
4356
|
+
"s",
|
|
4357
|
+
"t",
|
|
4358
|
+
"u",
|
|
4359
|
+
"v"
|
|
4360
|
+
], ce = (i, t = {}) => {
|
|
4361
|
+
let e = String(i);
|
|
4362
|
+
if (i.match(/%[a-z]/)) {
|
|
4363
|
+
let s = 0;
|
|
4364
|
+
g(t, (n) => {
|
|
4365
|
+
e = e.replace(new RegExp(`%${ae[s++]}`, "g"), String(n));
|
|
4366
|
+
});
|
|
4367
|
+
}
|
|
4368
|
+
return k(t) && g(t, (s, n) => {
|
|
4369
|
+
e = e.replace(
|
|
4370
|
+
new RegExp(`\\[${n}\\](.*?)\\[/${n}\\]`, "g"),
|
|
4371
|
+
(o, a) => String(s).replace(/\[content]/g, a)
|
|
4372
|
+
).replace(new RegExp(`\\[${n}\\]`, "g"), String(s));
|
|
4373
|
+
}), e;
|
|
4374
|
+
}, A = class A {
|
|
4375
|
+
/**
|
|
4376
|
+
* Getting the translation text by its code.
|
|
4377
|
+
*
|
|
4378
|
+
* Получение текста перевода по его коду.
|
|
4379
|
+
* @param name code name/ название кода
|
|
4380
|
+
* @param replacement If set, replaces the text with the specified values/ если установлено, заменяет текст на указанные значения
|
|
4381
|
+
*/
|
|
4382
|
+
static async get(t, e) {
|
|
4383
|
+
var n, o;
|
|
4384
|
+
const s = this.getName(t);
|
|
4385
|
+
return s in this.data ? this.replacement(this.data[s], e) : (U.isLocalhost() || await this.add(t), this.replacement((o = (n = this.data) == null ? void 0 : n[s]) != null ? o : t));
|
|
4386
|
+
}
|
|
4387
|
+
/**
|
|
4388
|
+
* Getting the translation text by its code (Sync).
|
|
4389
|
+
*
|
|
4390
|
+
* Получение текста перевода по его коду (Sync).
|
|
4391
|
+
* @param name code name/ название кода
|
|
4392
|
+
* @param first If set to false, returns an empty string if there is no text/
|
|
4393
|
+
* если установлено false, возвращает пустую строку, если нет текста
|
|
4394
|
+
* @param replacement If set, replaces the text with the specified values/
|
|
4395
|
+
* если установлено, заменяет текст на указанные значения
|
|
4396
|
+
*/
|
|
4397
|
+
static getSync(t, e = !1, s) {
|
|
4398
|
+
const n = this.getName(t);
|
|
4399
|
+
return n in this.data ? this.replacement(String(this.data[n]), s) : e ? " " : t;
|
|
4400
|
+
}
|
|
4401
|
+
/**
|
|
4402
|
+
* Getting a list of translations by an array of text codes.
|
|
4403
|
+
*
|
|
4404
|
+
* Получение списка переводов по массиву кодов текста.
|
|
4405
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
4406
|
+
*/
|
|
4407
|
+
static getList(t) {
|
|
4408
|
+
return new Promise((e) => {
|
|
4409
|
+
const s = {};
|
|
4410
|
+
let n = 0;
|
|
4411
|
+
for (const o of t) {
|
|
4412
|
+
const a = Array.isArray(o) ? o[0] : o, u = Array.isArray(o) ? o.slice(1) : void 0;
|
|
4413
|
+
this.get(a, u).then((h) => {
|
|
4414
|
+
s[a] = h, ++n >= t.length && e(s);
|
|
4415
|
+
});
|
|
4416
|
+
}
|
|
4417
|
+
});
|
|
4418
|
+
}
|
|
4419
|
+
/**
|
|
4420
|
+
* Getting a list of translations by an array of text codes.
|
|
4421
|
+
*
|
|
4422
|
+
* Получение списка переводов по массиву кодов текста.
|
|
4423
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
4424
|
+
* @param first If set to false, returns an empty string if there is no text/
|
|
4425
|
+
* если установлено false, возвращает пустую строку, если нет текста
|
|
4426
|
+
*/
|
|
4427
|
+
static getListSync(t, e = !1) {
|
|
4428
|
+
const s = {};
|
|
4429
|
+
for (const n of t) {
|
|
4430
|
+
const o = Array.isArray(n) ? n[0] : n, a = Array.isArray(n) ? n.slice(1) : void 0;
|
|
4431
|
+
s[o] = this.getSync(o, e, a);
|
|
4432
|
+
}
|
|
4433
|
+
return s;
|
|
4434
|
+
}
|
|
4435
|
+
/**
|
|
4436
|
+
* Added a list of translated texts.
|
|
4437
|
+
*
|
|
4438
|
+
* Добавлен список переведенных текстов.
|
|
4439
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
4440
|
+
*/
|
|
4441
|
+
static add(t) {
|
|
4442
|
+
return new Promise((e) => {
|
|
4443
|
+
this.getNamesNone(t).length > 0 ? (this.cache.push(...this.getNamesNone(t)), this.resolveList.push(e), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(() => {
|
|
4444
|
+
this.timeout = void 0, this.make().then(() => {
|
|
4445
|
+
this.resolveList.forEach((n) => n()), this.resolveList = [];
|
|
4446
|
+
});
|
|
4447
|
+
}, 160)) : e();
|
|
4448
|
+
});
|
|
4449
|
+
}
|
|
4450
|
+
/**
|
|
4451
|
+
* Adds texts in sync mode.
|
|
4452
|
+
*
|
|
4453
|
+
* Добавляет тексты в режиме синхронизации.
|
|
4454
|
+
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4455
|
+
*/
|
|
4456
|
+
static addSync(t) {
|
|
4457
|
+
g(t, (e, s) => {
|
|
4458
|
+
j(e) && D(e) && (this.data[this.getName(s)] = e);
|
|
4459
|
+
});
|
|
4460
|
+
}
|
|
4461
|
+
/**
|
|
4462
|
+
* Adding data in the form of a query or directly, depending on the execution environment.
|
|
4463
|
+
*
|
|
4464
|
+
* Добавление данных в виде запроса или напрямую, в зависимости от среды выполнения.
|
|
4465
|
+
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
4466
|
+
*/
|
|
4467
|
+
static async addNormalOrSync(t) {
|
|
4468
|
+
if (D(t))
|
|
4469
|
+
if (U.isLocalhost())
|
|
4470
|
+
this.addSync(t);
|
|
4471
|
+
else {
|
|
4472
|
+
const e = Object.keys(t);
|
|
4473
|
+
e.length > 0 && await this.add(e);
|
|
4474
|
+
}
|
|
4475
|
+
}
|
|
4476
|
+
/**
|
|
4477
|
+
* Change the path to the script for obtaining the translation.
|
|
4478
|
+
*
|
|
4479
|
+
* Изменить путь к скрипту для получения перевода.
|
|
4480
|
+
* @param url path to the script/ путь к скрипту
|
|
4481
|
+
*/
|
|
4482
|
+
static setUrl(t) {
|
|
4483
|
+
return this.url = t, A;
|
|
4484
|
+
}
|
|
4485
|
+
static setPropsName(t) {
|
|
4486
|
+
return this.propsName = t, this;
|
|
4487
|
+
}
|
|
4488
|
+
/**
|
|
4489
|
+
* Getting the full title for translation.
|
|
4490
|
+
*
|
|
4491
|
+
* Получение полного названия для перевода.
|
|
4492
|
+
* @param name code name/ название кода
|
|
4493
|
+
*/
|
|
4494
|
+
static getName(t) {
|
|
4495
|
+
return `${b.getLocation()}-${t}`;
|
|
4496
|
+
}
|
|
4497
|
+
/**
|
|
4498
|
+
* Returns a list of names that are not yet in the list.
|
|
4499
|
+
*
|
|
4500
|
+
* Возвращает список имен, которых еще нет в списке.
|
|
4501
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
4502
|
+
*/
|
|
4503
|
+
static getNamesNone(t) {
|
|
4504
|
+
const e = [];
|
|
4505
|
+
return z(t).forEach((s) => {
|
|
4506
|
+
s !== "__TRANSLATE_START__" && s !== "__TRANSLATE_END__" && !(this.getName(s) in this.data) && e.push(s);
|
|
4507
|
+
}), e;
|
|
4508
|
+
}
|
|
4509
|
+
/**
|
|
4510
|
+
* Getting the list of translations from the server.
|
|
4511
|
+
*
|
|
4512
|
+
* Получение списка переводов с сервера.
|
|
4513
|
+
*/
|
|
4514
|
+
static async getResponse() {
|
|
4515
|
+
const t = await U.get({
|
|
4516
|
+
api: !1,
|
|
4517
|
+
path: this.url,
|
|
4518
|
+
request: {
|
|
4519
|
+
[this.propsName]: this.cache
|
|
4520
|
+
},
|
|
4521
|
+
toData: !0,
|
|
4522
|
+
global: !0
|
|
4523
|
+
});
|
|
4524
|
+
return t != null ? t : {};
|
|
4525
|
+
}
|
|
4526
|
+
/**
|
|
4527
|
+
* Replaces the text with the specified values.
|
|
4528
|
+
*
|
|
4529
|
+
* Заменяет текст на указанные значения.
|
|
4530
|
+
* @param text text to replace/ текст для замены
|
|
4531
|
+
* @param replacement values for replacement/ значения для замены
|
|
4532
|
+
*/
|
|
4533
|
+
static replacement(t, e) {
|
|
4534
|
+
return e ? ce(t, e) : t;
|
|
4535
|
+
}
|
|
4536
|
+
/**
|
|
4537
|
+
* Adding translation data from the server.
|
|
4538
|
+
*
|
|
4539
|
+
* Добавление данных по переводу с сервера.
|
|
4540
|
+
*/
|
|
4541
|
+
static async make() {
|
|
4542
|
+
const t = await this.getResponse();
|
|
4543
|
+
this.cache.forEach((e) => {
|
|
4544
|
+
var s;
|
|
4545
|
+
this.data[this.getName(e)] = (s = t == null ? void 0 : t[e]) != null ? s : "";
|
|
4546
|
+
}), this.cache = [];
|
|
4547
|
+
}
|
|
4548
|
+
};
|
|
4549
|
+
c(A, "url", "/api/translate"), c(A, "propsName", "list"), c(A, "data", {}), c(A, "cache", []), c(A, "resolveList", []), c(A, "timeout");
|
|
4550
|
+
let wt = A;
|
|
4551
|
+
function It(i) {
|
|
4552
|
+
return Array.isArray(i);
|
|
4553
|
+
}
|
|
4554
|
+
function Le(i) {
|
|
4555
|
+
var t;
|
|
4556
|
+
return j(i) ? i.trim() : It(i) && i.findIndex((e) => m(e)) === -1 ? i.join(",") : m(i) ? JSON.stringify(i) : i === !0 ? "1" : i === !1 ? "0" : (t = i == null ? void 0 : i.toString()) != null ? t : "";
|
|
4557
|
+
}
|
|
4558
|
+
function ue(i, t) {
|
|
4559
|
+
return Array(t).fill(i);
|
|
4560
|
+
}
|
|
4561
|
+
function ke(i) {
|
|
4562
|
+
var t;
|
|
4563
|
+
if (l())
|
|
4564
|
+
return (t = document.querySelector(i)) != null ? t : void 0;
|
|
4565
|
+
}
|
|
4566
|
+
function Ce(i) {
|
|
4567
|
+
if (l())
|
|
4568
|
+
return document.querySelectorAll(i);
|
|
4569
|
+
}
|
|
4570
|
+
function Ae(i) {
|
|
4571
|
+
i.preventDefault(), i.stopPropagation();
|
|
4572
|
+
}
|
|
4573
|
+
function he(i, t, e) {
|
|
4574
|
+
const s = () => {
|
|
4575
|
+
i(), t != null && t() ? he(i, t, e) : e == null || e();
|
|
4576
|
+
};
|
|
4577
|
+
l() ? requestAnimationFrame(s) : s();
|
|
4578
|
+
}
|
|
4579
|
+
function Ne(i) {
|
|
4580
|
+
var s;
|
|
4581
|
+
const t = {}, e = C(i);
|
|
4582
|
+
if (e)
|
|
4583
|
+
for (const n of e.attributes)
|
|
4584
|
+
t[n.name] = (s = (n == null ? void 0 : n.value) || (n == null ? void 0 : n.textContent)) != null ? s : void 0;
|
|
4585
|
+
return t;
|
|
4586
|
+
}
|
|
4587
|
+
async function Ee(i) {
|
|
4588
|
+
var t, e;
|
|
4589
|
+
return (e = (t = i == null ? void 0 : i.clipboardData) == null ? void 0 : t.getData("text")) != null ? e : await navigator.clipboard.readText() || "";
|
|
4590
|
+
}
|
|
4591
|
+
let vt = V(1e5, 9e5);
|
|
4592
|
+
function Ie(i, t) {
|
|
4593
|
+
const e = C(i);
|
|
4594
|
+
return e ? (D(e.id) || e.setAttribute("id", `id-${vt++}`), t ? `#${e.id}${t}`.trim() : e.id) : `id-${vt++}`;
|
|
4595
|
+
}
|
|
4596
|
+
function le(i, t = "ig", e = ":value") {
|
|
4597
|
+
const s = i.replace(/([[\]\\^$.?*+()/])/g, "\\$1");
|
|
4598
|
+
return new RegExp(e.replace(/:value/g, s), t);
|
|
4599
|
+
}
|
|
4600
|
+
function de(i, t) {
|
|
4601
|
+
var n;
|
|
4602
|
+
const e = t.split(".", 2), s = e[0];
|
|
4603
|
+
return s && (i != null && i[s]) && k(i[s]) && (e != null && e[1]) ? de(i[s], e[1]) : (n = s && (i == null ? void 0 : i[s])) != null ? n : "";
|
|
4604
|
+
}
|
|
4605
|
+
function Be(i) {
|
|
4606
|
+
var t, e, s;
|
|
4607
|
+
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();
|
|
4608
|
+
}
|
|
4609
|
+
function Bt(i) {
|
|
4610
|
+
return g(i, (t) => t.length);
|
|
4611
|
+
}
|
|
4612
|
+
function Fe(i) {
|
|
4613
|
+
return Math.max(...Bt(i));
|
|
4614
|
+
}
|
|
4615
|
+
function xe(i) {
|
|
4616
|
+
return Math.min(...Bt(i));
|
|
4617
|
+
}
|
|
4618
|
+
function ge(i) {
|
|
4619
|
+
var t, e, s, n;
|
|
4620
|
+
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) || ((n = (s = i == null ? void 0 : i.touches) == null ? void 0 : s[0]) == null ? void 0 : n.clientX) || 0;
|
|
4621
|
+
}
|
|
4622
|
+
function fe(i) {
|
|
4623
|
+
var t, e, s, n;
|
|
4624
|
+
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) || ((n = (s = i == null ? void 0 : i.touches) == null ? void 0 : s[0]) == null ? void 0 : n.clientY) || 0;
|
|
4625
|
+
}
|
|
4626
|
+
function Re(i) {
|
|
4627
|
+
return {
|
|
4628
|
+
x: ge(i),
|
|
4629
|
+
y: fe(i)
|
|
4630
|
+
};
|
|
4631
|
+
}
|
|
4632
|
+
function Pe(i, t) {
|
|
4633
|
+
const e = {};
|
|
4634
|
+
return t.forEach((s) => {
|
|
4635
|
+
s in i && i[s] !== void 0 && (e[s] = i[s]);
|
|
4636
|
+
}), e;
|
|
4637
|
+
}
|
|
4638
|
+
function We(i, t = void 0) {
|
|
4639
|
+
const e = {};
|
|
4640
|
+
return g(i, (s, n) => {
|
|
4641
|
+
s !== t && (e[n] = s);
|
|
4642
|
+
}), e;
|
|
4643
|
+
}
|
|
4644
|
+
function Ue(i) {
|
|
4645
|
+
return k(i) ? i : {};
|
|
4646
|
+
}
|
|
4647
|
+
function me(i, t) {
|
|
4648
|
+
return ue(i, t).join("");
|
|
4649
|
+
}
|
|
4650
|
+
function je(i, t, e = "#", s = 2, n = 12) {
|
|
4651
|
+
const o = V(i, t), a = [];
|
|
4652
|
+
for (let u = 0; u < o; u++)
|
|
4653
|
+
a.push(me(e, V(s, n)));
|
|
4654
|
+
return a.join(" ");
|
|
4655
|
+
}
|
|
4656
|
+
function ze(i, t) {
|
|
4657
|
+
const e = i != null ? i : 0;
|
|
4658
|
+
return t > e ? 100 / (t - e) : 0;
|
|
4659
|
+
}
|
|
4660
|
+
function He(i, t) {
|
|
4661
|
+
const e = i != null ? i : 0;
|
|
4662
|
+
return t > e ? (t - e) / 100 : 0;
|
|
4663
|
+
}
|
|
4664
|
+
const St = 0;
|
|
4665
|
+
function Ze(i, t, e) {
|
|
4666
|
+
const s = t == null ? void 0 : t.closest(i);
|
|
4667
|
+
if (t && s && s.scrollHeight !== s.offsetHeight)
|
|
4668
|
+
if (e) {
|
|
4669
|
+
const n = e.getBoundingClientRect(), o = s.getBoundingClientRect(), a = t.getBoundingClientRect();
|
|
4670
|
+
s.scrollTop = t.offsetTop - (n.top - o.top) - (n.height / 2 - a.height / 2), s.scrollTop + s.offsetHeight < t.offsetTop + t.offsetHeight && (s.scrollTop = t.offsetTop + t.offsetHeight - s.offsetHeight);
|
|
4671
|
+
} else s.scrollTop > t.offsetTop ? s.scrollTop = t.offsetTop - St : s.scrollTop + s.offsetHeight < t.offsetTop + t.offsetHeight && (s.scrollTop = t.offsetTop + t.offsetHeight - s.offsetHeight + St);
|
|
4672
|
+
}
|
|
4673
|
+
function Ke(i, t) {
|
|
4674
|
+
return i.indexOf(t) !== -1;
|
|
4675
|
+
}
|
|
4676
|
+
async function Ve() {
|
|
4677
|
+
if (l()) {
|
|
4678
|
+
const i = await st.get();
|
|
4679
|
+
document.body.style.setProperty("--sys-scrollbar-offset", `${i}px`);
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
function Ye(i, t) {
|
|
4683
|
+
const e = {};
|
|
4684
|
+
return m(i) && m(t) && g(i, (s, n) => {
|
|
4685
|
+
n in t && (e[n] = s);
|
|
4686
|
+
}), e;
|
|
4687
|
+
}
|
|
4688
|
+
function qe(i, t) {
|
|
4689
|
+
let e = Object.keys(i).length !== Object.keys(t).length;
|
|
4690
|
+
return e || g(i, (s, n) => {
|
|
4691
|
+
s !== (t == null ? void 0 : t[n]) && (e = !0);
|
|
4692
|
+
}), e;
|
|
4693
|
+
}
|
|
4694
|
+
function Je(i) {
|
|
4695
|
+
switch (typeof i) {
|
|
4696
|
+
case "number":
|
|
4697
|
+
return !0;
|
|
4698
|
+
case "string":
|
|
4699
|
+
return !!i.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
|
|
4700
|
+
default:
|
|
4701
|
+
return !1;
|
|
4702
|
+
}
|
|
4703
|
+
}
|
|
4704
|
+
function Qe(i, t) {
|
|
4705
|
+
const e = Math.floor(t);
|
|
4706
|
+
return i >= e && i < e + 1;
|
|
4707
|
+
}
|
|
4708
|
+
function Xe(i, t) {
|
|
4709
|
+
return Array.isArray(i) ? i.every((e) => et(e, t)) : et(i, t);
|
|
4710
|
+
}
|
|
4711
|
+
function ye(i) {
|
|
4712
|
+
return [...new Set(i)];
|
|
4713
|
+
}
|
|
4714
|
+
function H(i, t, e = !0) {
|
|
4715
|
+
const s = W(i);
|
|
4716
|
+
return m(i) && m(t) && g(
|
|
4717
|
+
t,
|
|
4718
|
+
(n, o) => {
|
|
4719
|
+
const a = i == null ? void 0 : i[o];
|
|
4720
|
+
m(a) && m(n) ? e && Array.isArray(a) && Array.isArray(n) ? s[o] = W(ye([...a, ...n])) : s[o] = H(
|
|
4721
|
+
Array.isArray(a) ? { ...a } : a,
|
|
4722
|
+
n,
|
|
4723
|
+
e
|
|
4724
|
+
) : s[o] = m(n) ? W(n) : n;
|
|
4725
|
+
}
|
|
4726
|
+
), s;
|
|
4727
|
+
}
|
|
4728
|
+
function Me(i, t) {
|
|
4729
|
+
let e = i;
|
|
4730
|
+
return g(t, (s, n) => {
|
|
4731
|
+
e = e.replace(le(`[${n}]`), N(s));
|
|
4732
|
+
}), e;
|
|
4733
|
+
}
|
|
4734
|
+
function _e(i) {
|
|
4735
|
+
const t = L(i);
|
|
4736
|
+
if (t > 0) {
|
|
4737
|
+
const e = String(Math.floor(t / 60)).padStart(2, "0"), s = String(t % 60).padStart(2, "0");
|
|
4738
|
+
return `${e}:${s}`;
|
|
4739
|
+
}
|
|
4740
|
+
return "00:00";
|
|
4741
|
+
}
|
|
4742
|
+
function Oe(i, t, {
|
|
4743
|
+
multiple: e = !1,
|
|
4744
|
+
maxlength: s = 0,
|
|
4745
|
+
alwaysChange: n = !0,
|
|
4746
|
+
notEmpty: o = !1
|
|
4747
|
+
}) {
|
|
4748
|
+
if (e) {
|
|
4749
|
+
if (It(i)) {
|
|
4750
|
+
const a = i.indexOf(t), u = [...i];
|
|
4751
|
+
return a !== -1 ? (!o || u.length > 1) && u.splice(a, 1) : (!s || i.length < s) && u.push(t), u;
|
|
4752
|
+
}
|
|
4753
|
+
return i === t ? [] : i ? [i, t] : [t];
|
|
4754
|
+
}
|
|
4755
|
+
return n || i !== t ? t : i;
|
|
4756
|
+
}
|
|
4757
|
+
function Te(i, t, e) {
|
|
4758
|
+
if (m(i) && m(t)) {
|
|
4759
|
+
if (e) {
|
|
4760
|
+
let s = {}, n = !1;
|
|
4761
|
+
return g(i, (o, a) => {
|
|
4762
|
+
!n && (e === a || e === o) ? (n = !0, s = H(s, t)) : n ? s = H(s, { [a]: o }) : s[a] = m(o) ? W(o) : o;
|
|
4763
|
+
}), n ? s : H(i, t);
|
|
4764
|
+
}
|
|
4765
|
+
if (m(t))
|
|
4766
|
+
return H(i, t);
|
|
4767
|
+
}
|
|
4768
|
+
return W(i);
|
|
4769
|
+
}
|
|
4770
|
+
function $e(i) {
|
|
4771
|
+
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()}`);
|
|
4772
|
+
}
|
|
4773
|
+
function Ge(i) {
|
|
4774
|
+
return $e(i).replace(/^([a-z])/, (t) => `${t.toUpperCase()}`);
|
|
4775
|
+
}
|
|
4776
|
+
function ti(i) {
|
|
4777
|
+
return i.toString().trim().replace(/[^\w- ]+/g, "").replace(/ +/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (t) => `${t.toLowerCase()}`).replace(/^[A-Z]/, (t) => t.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (t) => `-${t.toLowerCase()}`).replace(/[A-Z]/g, (t) => t.toLowerCase());
|
|
4778
|
+
}
|
|
4779
|
+
function ei(i, t, e, s) {
|
|
4780
|
+
const n = L(i), o = L(t);
|
|
4781
|
+
return t && o < n ? `${Dt(o, e, s)}+` : Dt(n, e, s);
|
|
4782
|
+
}
|
|
4783
|
+
const Dt = (i, t, e) => t ? new q(e).number(i) : i;
|
|
4784
|
+
function pe(i, t) {
|
|
4785
|
+
return 1 / i * t;
|
|
4786
|
+
}
|
|
4787
|
+
function ii(i, t) {
|
|
4788
|
+
return pe(i, t) * 100;
|
|
4789
|
+
}
|
|
4790
|
+
async function si(i) {
|
|
4791
|
+
if (l())
|
|
4792
|
+
try {
|
|
4793
|
+
await navigator.clipboard.writeText(i);
|
|
4794
|
+
} catch (t) {
|
|
4795
|
+
document == null || document.execCommand(i);
|
|
4796
|
+
}
|
|
4797
|
+
}
|
|
4798
|
+
export {
|
|
4799
|
+
U as Api,
|
|
4800
|
+
zt as ApiDefault,
|
|
4801
|
+
jt as ApiHeaders,
|
|
4802
|
+
S as ApiMethodItem,
|
|
4803
|
+
Vt as ApiPreparation,
|
|
4804
|
+
Kt as ApiResponse,
|
|
4805
|
+
Ht as ApiStatus,
|
|
4806
|
+
ve as BroadcastMessage,
|
|
4807
|
+
Jt as Cache,
|
|
4808
|
+
qt as CacheItem,
|
|
4809
|
+
dt as CacheStatic,
|
|
4810
|
+
gt as Cookie,
|
|
4811
|
+
Nt as CookieBlock,
|
|
4812
|
+
_ as DataStorage,
|
|
4813
|
+
Et as Datetime,
|
|
4814
|
+
ut as EventItem,
|
|
4815
|
+
r as GEO_FLAG_ICON_NAME,
|
|
4816
|
+
b as Geo,
|
|
4817
|
+
ft as GeoFlag,
|
|
4818
|
+
q as GeoIntl,
|
|
4819
|
+
mt as GeoPhone,
|
|
4820
|
+
Se as Global,
|
|
4821
|
+
yt as Hash,
|
|
4822
|
+
bt as Icons,
|
|
4823
|
+
F as Loading,
|
|
4824
|
+
De as Meta,
|
|
4825
|
+
rt as MetaManager,
|
|
4826
|
+
ne as MetaOg,
|
|
4827
|
+
ie as MetaOpenGraphAge,
|
|
4828
|
+
te as MetaOpenGraphAvailability,
|
|
4829
|
+
ee as MetaOpenGraphCondition,
|
|
4830
|
+
se as MetaOpenGraphGender,
|
|
4831
|
+
y as MetaOpenGraphTag,
|
|
4832
|
+
Gt as MetaOpenGraphType,
|
|
4833
|
+
Tt as MetaRobots,
|
|
4834
|
+
v as MetaTag,
|
|
4835
|
+
oe as MetaTwitter,
|
|
4836
|
+
re as MetaTwitterCard,
|
|
4837
|
+
$ as MetaTwitterTag,
|
|
4838
|
+
st as ScrollbarWidth,
|
|
4839
|
+
wt as Translate,
|
|
4840
|
+
Le as anyToString,
|
|
4841
|
+
ce as applyTemplate,
|
|
4842
|
+
ue as arrFill,
|
|
4843
|
+
W as copyObject,
|
|
4844
|
+
it as createElement,
|
|
4845
|
+
ke as domQuerySelector,
|
|
4846
|
+
Ce as domQuerySelectorAll,
|
|
4847
|
+
Ot as encodeAttribute,
|
|
4848
|
+
Ae as eventStopPropagation,
|
|
4849
|
+
N as executeFunction,
|
|
4850
|
+
Zt as executePromise,
|
|
4851
|
+
g as forEach,
|
|
4852
|
+
he as frame,
|
|
4853
|
+
Ne as getAttributes,
|
|
4854
|
+
Ee as getClipboardData,
|
|
4855
|
+
Xt as getColumn,
|
|
4856
|
+
C as getElement,
|
|
4857
|
+
Ie as getElementId,
|
|
4858
|
+
Mt as getElementItem,
|
|
4859
|
+
ct as getElementOrWindow,
|
|
4860
|
+
le as getExp,
|
|
4861
|
+
de as getItemByPath,
|
|
4862
|
+
Be as getKey,
|
|
4863
|
+
Bt as getLengthOfAllArray,
|
|
4864
|
+
Fe as getMaxLengthAllArray,
|
|
4865
|
+
xe as getMinLengthAllArray,
|
|
4866
|
+
Re as getMouseClient,
|
|
4867
|
+
ge as getMouseClientX,
|
|
4868
|
+
fe as getMouseClientY,
|
|
4869
|
+
Pe as getObjectByKeys,
|
|
4870
|
+
We as getObjectNoUndefined,
|
|
4871
|
+
Ue as getObjectOrNone,
|
|
4872
|
+
je as getRandomText,
|
|
4873
|
+
Lt as getRequestString,
|
|
4874
|
+
ze as getStepPercent,
|
|
4875
|
+
He as getStepValue,
|
|
4876
|
+
Ze as goScroll,
|
|
4877
|
+
Ke as inArray,
|
|
4878
|
+
Ve as initScrollbarOffset,
|
|
4879
|
+
Ye as intersectKey,
|
|
4880
|
+
It as isArray,
|
|
4881
|
+
qe as isDifferent,
|
|
4882
|
+
l as isDomRuntime,
|
|
4883
|
+
D as isFilled,
|
|
4884
|
+
Je as isFloat,
|
|
4885
|
+
kt as isFunction,
|
|
4886
|
+
Ut as isInDom,
|
|
4887
|
+
Qe as isIntegerBetween,
|
|
4888
|
+
Y as isNull,
|
|
4889
|
+
ot as isNumber,
|
|
4890
|
+
m as isObject,
|
|
4891
|
+
k as isObjectNotArray,
|
|
4892
|
+
et as isSelected,
|
|
4893
|
+
Xe as isSelectedByList,
|
|
4894
|
+
j as isString,
|
|
4895
|
+
Ct as isWindow,
|
|
4896
|
+
V as random,
|
|
4897
|
+
H as replaceRecursive,
|
|
4898
|
+
Me as replaceTemplate,
|
|
4899
|
+
_e as secondToTime,
|
|
4900
|
+
_t as setElementItem,
|
|
4901
|
+
Oe as setValues,
|
|
4902
|
+
Te as splice,
|
|
4903
|
+
me as strFill,
|
|
4904
|
+
z as toArray,
|
|
4905
|
+
$e as toCamelCase,
|
|
4906
|
+
Ge as toCamelCaseFirst,
|
|
4907
|
+
I as toDate,
|
|
4908
|
+
ti as toKebabCase,
|
|
4909
|
+
L as toNumber,
|
|
4910
|
+
ei as toNumberByMax,
|
|
4911
|
+
pe as toPercent,
|
|
4912
|
+
ii as toPercentBy100,
|
|
4913
|
+
At as transformation,
|
|
4914
|
+
ye as uniqueArray,
|
|
4915
|
+
si as writeClipboardData
|
|
4916
|
+
};
|