@dxtmisha/functional-basic 0.12.2 → 0.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/library.d.ts +763 -114
- package/dist/library.js +988 -602
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
import { geo as e } from "@dxtmisha/media";
|
|
2
|
-
//#region src/functions/
|
|
3
|
-
function t(e
|
|
4
|
-
return
|
|
2
|
+
//#region src/functions/isObject.ts
|
|
3
|
+
function t(e) {
|
|
4
|
+
return !!(e && typeof e == "object");
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
|
-
//#region src/functions/
|
|
7
|
+
//#region src/functions/isObjectNotArray.ts
|
|
8
8
|
function n(e) {
|
|
9
|
-
return
|
|
9
|
+
return t(e) && !Array.isArray(e);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/functions/copyObjectLite.ts
|
|
13
|
+
function r(e, t) {
|
|
14
|
+
return t ? Object.assign({}, e, t) : Object.assign({}, e);
|
|
10
15
|
}
|
|
11
16
|
//#endregion
|
|
12
17
|
//#region src/functions/forEach.ts
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
let
|
|
16
|
-
return e instanceof Map || Array.isArray(e) ? e.forEach((r, i) =>
|
|
18
|
+
function i(e, n, r) {
|
|
19
|
+
if (t(e)) {
|
|
20
|
+
let t = [];
|
|
21
|
+
return e instanceof Map || Array.isArray(e) ? e.forEach((r, i) => t.push(n(r, i, e))) : Object.entries(e).forEach(([r, i]) => t.push(n(i, r, e))), r ? t : t.filter((e) => e !== void 0);
|
|
17
22
|
}
|
|
18
23
|
return [];
|
|
19
24
|
}
|
|
20
25
|
//#endregion
|
|
21
26
|
//#region src/functions/getRequestString.ts
|
|
22
|
-
function
|
|
23
|
-
return
|
|
27
|
+
function a(e, t = "=", n = "&") {
|
|
28
|
+
return i(e, (e, n) => `${n}${t}${encodeURIComponent(String(e).trim())}`).sort().join(n);
|
|
24
29
|
}
|
|
25
30
|
//#endregion
|
|
26
31
|
//#region src/functions/isArray.ts
|
|
27
|
-
function
|
|
32
|
+
function o(e) {
|
|
28
33
|
return Array.isArray(e);
|
|
29
34
|
}
|
|
30
35
|
//#endregion
|
|
31
36
|
//#region src/functions/isNull.ts
|
|
32
|
-
function
|
|
37
|
+
function s(e) {
|
|
33
38
|
return e == null;
|
|
34
39
|
}
|
|
35
40
|
//#endregion
|
|
36
41
|
//#region src/functions/isFilled.ts
|
|
37
|
-
function
|
|
42
|
+
function c(e, t) {
|
|
38
43
|
if (e) {
|
|
39
44
|
if (t && e === "0") return !0;
|
|
40
45
|
switch (typeof e) {
|
|
@@ -43,7 +48,7 @@ function s(e, t) {
|
|
|
43
48
|
case "boolean": return e;
|
|
44
49
|
case "function":
|
|
45
50
|
case "symbol": return !0;
|
|
46
|
-
case "object": return Array.isArray(e) ? e.length > 0 : Object.values(e).some((e) => !
|
|
51
|
+
case "object": return Array.isArray(e) ? e.length > 0 : Object.values(e).some((e) => !s(e));
|
|
47
52
|
case "string": return ![
|
|
48
53
|
"",
|
|
49
54
|
"undefined",
|
|
@@ -59,28 +64,38 @@ function s(e, t) {
|
|
|
59
64
|
return !1;
|
|
60
65
|
}
|
|
61
66
|
//#endregion
|
|
62
|
-
//#region src/functions/
|
|
63
|
-
function
|
|
64
|
-
return
|
|
67
|
+
//#region src/functions/isOnLine.ts
|
|
68
|
+
function l() {
|
|
69
|
+
return typeof navigator > "u" || navigator.onLine;
|
|
65
70
|
}
|
|
66
71
|
//#endregion
|
|
67
72
|
//#region src/functions/isString.ts
|
|
68
|
-
function
|
|
73
|
+
function u(e) {
|
|
69
74
|
return typeof e == "string";
|
|
70
75
|
}
|
|
71
76
|
//#endregion
|
|
77
|
+
//#region src/functions/random.ts
|
|
78
|
+
function d(e, t) {
|
|
79
|
+
return Math.floor(Math.random() * (t - e + 1) + e);
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/functions/sleep.ts
|
|
83
|
+
function f(e) {
|
|
84
|
+
return new Promise((t) => setTimeout(t, e));
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
72
87
|
//#region src/functions/copyObject.ts
|
|
73
|
-
function
|
|
88
|
+
function p(e) {
|
|
74
89
|
return JSON.parse(JSON.stringify(e));
|
|
75
90
|
}
|
|
76
91
|
//#endregion
|
|
77
92
|
//#region src/functions/isDomRuntime.ts
|
|
78
|
-
function
|
|
93
|
+
function m() {
|
|
79
94
|
return typeof window < "u" && !!window.document;
|
|
80
95
|
}
|
|
81
96
|
//#endregion
|
|
82
97
|
//#region src/functions/isNumber.ts
|
|
83
|
-
function
|
|
98
|
+
function h(e) {
|
|
84
99
|
switch (typeof e) {
|
|
85
100
|
case "number": return !0;
|
|
86
101
|
case "string": return !!e.match(/^-?[0-9]+(\.[0-9]+)?$/);
|
|
@@ -89,7 +104,7 @@ function f(e) {
|
|
|
89
104
|
}
|
|
90
105
|
//#endregion
|
|
91
106
|
//#region src/functions/toNumber.ts
|
|
92
|
-
function
|
|
107
|
+
function g(e) {
|
|
93
108
|
if (typeof e == "number") return e;
|
|
94
109
|
if (!e) return 0;
|
|
95
110
|
let t = e.replace(/[^\d., ]+/gi, "");
|
|
@@ -97,42 +112,42 @@ function p(e) {
|
|
|
97
112
|
}
|
|
98
113
|
//#endregion
|
|
99
114
|
//#region src/functions/isSelected.ts
|
|
100
|
-
function
|
|
101
|
-
return
|
|
115
|
+
function _(e, t) {
|
|
116
|
+
return s(e) ? !1 : Array.isArray(t) ? t.includes(e) : h(e) && h(t) ? g(e) === g(t) : e === t;
|
|
102
117
|
}
|
|
103
118
|
//#endregion
|
|
104
119
|
//#region src/functions/isFunction.ts
|
|
105
|
-
function
|
|
120
|
+
function v(e) {
|
|
106
121
|
return e instanceof Function || typeof e == "function";
|
|
107
122
|
}
|
|
108
123
|
//#endregion
|
|
109
124
|
//#region src/functions/executeFunction.ts
|
|
110
|
-
function
|
|
111
|
-
return
|
|
125
|
+
function y(e) {
|
|
126
|
+
return v(e) ? e() : e;
|
|
112
127
|
}
|
|
113
128
|
//#endregion
|
|
114
129
|
//#region src/functions/isDomData.ts
|
|
115
|
-
function
|
|
130
|
+
function b() {
|
|
116
131
|
return location.href.startsWith("data:");
|
|
117
132
|
}
|
|
118
133
|
//#endregion
|
|
119
134
|
//#region \0@oxc-project+runtime@0.120.0/helpers/typeof.js
|
|
120
|
-
function
|
|
135
|
+
function x(e) {
|
|
121
136
|
"@babel/helpers - typeof";
|
|
122
|
-
return
|
|
137
|
+
return x = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
123
138
|
return typeof e;
|
|
124
139
|
} : function(e) {
|
|
125
140
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
126
|
-
},
|
|
141
|
+
}, x(e);
|
|
127
142
|
}
|
|
128
143
|
//#endregion
|
|
129
144
|
//#region \0@oxc-project+runtime@0.120.0/helpers/toPrimitive.js
|
|
130
145
|
function ee(e, t) {
|
|
131
|
-
if (
|
|
146
|
+
if (x(e) != "object" || !e) return e;
|
|
132
147
|
var n = e[Symbol.toPrimitive];
|
|
133
148
|
if (n !== void 0) {
|
|
134
149
|
var r = n.call(e, t || "default");
|
|
135
|
-
if (
|
|
150
|
+
if (x(r) != "object") return r;
|
|
136
151
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
137
152
|
}
|
|
138
153
|
return (t === "string" ? String : Number)(e);
|
|
@@ -141,11 +156,11 @@ function ee(e, t) {
|
|
|
141
156
|
//#region \0@oxc-project+runtime@0.120.0/helpers/toPropertyKey.js
|
|
142
157
|
function te(e) {
|
|
143
158
|
var t = ee(e, "string");
|
|
144
|
-
return
|
|
159
|
+
return x(t) == "symbol" ? t : t + "";
|
|
145
160
|
}
|
|
146
161
|
//#endregion
|
|
147
162
|
//#region \0@oxc-project+runtime@0.120.0/helpers/defineProperty.js
|
|
148
|
-
function
|
|
163
|
+
function S(e, t, n) {
|
|
149
164
|
return (t = te(t)) in e ? Object.defineProperty(e, t, {
|
|
150
165
|
value: n,
|
|
151
166
|
enumerable: !0,
|
|
@@ -154,23 +169,188 @@ function y(e, t, n) {
|
|
|
154
169
|
}) : e[t] = n, e;
|
|
155
170
|
}
|
|
156
171
|
//#endregion
|
|
172
|
+
//#region src/classes/ErrorCenterHandler.ts
|
|
173
|
+
var ne = class {
|
|
174
|
+
constructor(e) {
|
|
175
|
+
S(this, "handlers", []), e && this.addList(e);
|
|
176
|
+
}
|
|
177
|
+
has(e) {
|
|
178
|
+
return !!this.get(e);
|
|
179
|
+
}
|
|
180
|
+
get(e) {
|
|
181
|
+
return this.handlers.find((t) => t.group === e);
|
|
182
|
+
}
|
|
183
|
+
add(e, t) {
|
|
184
|
+
let n = this.get(e);
|
|
185
|
+
return n ? n.handlers.push(t) : this.handlers.push({
|
|
186
|
+
group: e,
|
|
187
|
+
handlers: [t]
|
|
188
|
+
}), this;
|
|
189
|
+
}
|
|
190
|
+
addList(e) {
|
|
191
|
+
return e.forEach((e) => e.handlers.forEach((t) => this.add(e.group, t))), this;
|
|
192
|
+
}
|
|
193
|
+
on(e) {
|
|
194
|
+
if (m()) {
|
|
195
|
+
var t;
|
|
196
|
+
let n = (t = this.get(e.group)) == null ? this.get(void 0) : t;
|
|
197
|
+
n && n.handlers.forEach((t) => t(e)), this.toConsole(e);
|
|
198
|
+
}
|
|
199
|
+
return this;
|
|
200
|
+
}
|
|
201
|
+
toConsole(e) {
|
|
202
|
+
return console.error(`Error Center: ${e.code}`), console.error(e.message), this;
|
|
203
|
+
}
|
|
204
|
+
}, re = class {
|
|
205
|
+
constructor(e, t = new ne()) {
|
|
206
|
+
S(this, "causes", []), this.handler = t, e && this.addList(e);
|
|
207
|
+
}
|
|
208
|
+
has(e, t) {
|
|
209
|
+
return !!this.get(e, t);
|
|
210
|
+
}
|
|
211
|
+
get(e, t) {
|
|
212
|
+
return this.causes.find((n) => n.group === t && n.code === e);
|
|
213
|
+
}
|
|
214
|
+
add(e) {
|
|
215
|
+
return this.causes.unshift(e), this;
|
|
216
|
+
}
|
|
217
|
+
addList(e) {
|
|
218
|
+
return this.causes.unshift(...e), this;
|
|
219
|
+
}
|
|
220
|
+
addHandler(e, t) {
|
|
221
|
+
return this.handler.add(e, t), this;
|
|
222
|
+
}
|
|
223
|
+
addHandlerList(e) {
|
|
224
|
+
return this.handler.addList(e), this;
|
|
225
|
+
}
|
|
226
|
+
on(e) {
|
|
227
|
+
return this.handler.on(this.assign(e)), this;
|
|
228
|
+
}
|
|
229
|
+
assign(e) {
|
|
230
|
+
let t = this.get(e.code, e.group);
|
|
231
|
+
return t ? {
|
|
232
|
+
...t,
|
|
233
|
+
...e
|
|
234
|
+
} : e;
|
|
235
|
+
}
|
|
236
|
+
}, ie = [
|
|
237
|
+
{
|
|
238
|
+
group: "api",
|
|
239
|
+
code: "unknown",
|
|
240
|
+
label: "Unknown Error",
|
|
241
|
+
message: "An unexpected error occurred. Please try again later."
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
group: "api",
|
|
245
|
+
code: "timeout",
|
|
246
|
+
label: "Request Timeout",
|
|
247
|
+
message: "The request took too long to complete. Please check your connection."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
group: "api",
|
|
251
|
+
code: "offline",
|
|
252
|
+
label: "No Internet Connection",
|
|
253
|
+
message: "Your device is currently offline. Please check your network settings."
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
group: "api",
|
|
257
|
+
code: "notFound",
|
|
258
|
+
label: "Resource Not Found",
|
|
259
|
+
message: "The requested resource could not be found on the server."
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
group: "api",
|
|
263
|
+
code: "server",
|
|
264
|
+
label: "Internal Server Error",
|
|
265
|
+
message: "Something went wrong on our end. We are working to fix it."
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
group: "broadcast",
|
|
269
|
+
code: "error",
|
|
270
|
+
label: "Broadcast Error",
|
|
271
|
+
message: "An unexpected error occurred. Please try again later."
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
group: "storage",
|
|
275
|
+
code: "error",
|
|
276
|
+
label: "Storage Error",
|
|
277
|
+
message: "An unexpected error occurred. Please try again later."
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
group: "intl",
|
|
281
|
+
code: "display",
|
|
282
|
+
label: "Intl Display Error",
|
|
283
|
+
message: "An unexpected error occurred. Please try again later."
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
group: "intl",
|
|
287
|
+
code: "plural",
|
|
288
|
+
label: "Intl Plural Error",
|
|
289
|
+
message: "An unexpected error occurred. Please try again later."
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
group: "intl",
|
|
293
|
+
code: "relative",
|
|
294
|
+
label: "Intl Relative Error",
|
|
295
|
+
message: "An unexpected error occurred. Please try again later."
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
group: "intl",
|
|
299
|
+
code: "datetime",
|
|
300
|
+
label: "Intl Datetime Error",
|
|
301
|
+
message: "An unexpected error occurred. Please try again later."
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
group: "intl",
|
|
305
|
+
code: "number",
|
|
306
|
+
label: "Intl Number Error",
|
|
307
|
+
message: "An unexpected error occurred. Please try again later."
|
|
308
|
+
}
|
|
309
|
+
], C = class {
|
|
310
|
+
static has(e, t) {
|
|
311
|
+
return this.item.has(e, t);
|
|
312
|
+
}
|
|
313
|
+
static get(e, t) {
|
|
314
|
+
return this.item.get(e, t);
|
|
315
|
+
}
|
|
316
|
+
static getItem() {
|
|
317
|
+
return this.item;
|
|
318
|
+
}
|
|
319
|
+
static add(e) {
|
|
320
|
+
return this.item.add(e), this;
|
|
321
|
+
}
|
|
322
|
+
static addList(e) {
|
|
323
|
+
return this.item.addList(e), this;
|
|
324
|
+
}
|
|
325
|
+
static addHandler(e, t) {
|
|
326
|
+
return this.item.addHandler(e, t), this;
|
|
327
|
+
}
|
|
328
|
+
static addHandlerList(e) {
|
|
329
|
+
return this.item.addHandlerList(e), this;
|
|
330
|
+
}
|
|
331
|
+
static on(e) {
|
|
332
|
+
return this.item.on(e), this;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
S(C, "item", new re(ie));
|
|
336
|
+
//#endregion
|
|
157
337
|
//#region src/classes/DataStorage.ts
|
|
158
|
-
var
|
|
338
|
+
var ae = {}, oe = "ui-storage", w = class {
|
|
159
339
|
static setPrefix(e) {
|
|
160
|
-
|
|
340
|
+
oe = e;
|
|
161
341
|
}
|
|
162
|
-
constructor(e, t = !1) {
|
|
163
|
-
|
|
164
|
-
let
|
|
165
|
-
if (
|
|
166
|
-
this.make(),
|
|
342
|
+
constructor(e, t = !1, n = C.getItem()) {
|
|
343
|
+
S(this, "value", void 0), S(this, "age", void 0), this.name = e, this.isSession = t, this.errorCenter = n;
|
|
344
|
+
let r = `${t ? "session" : "storage"}#${e}`;
|
|
345
|
+
if (r in ae) return ae[r];
|
|
346
|
+
this.make(), ae[r] = this;
|
|
167
347
|
}
|
|
168
348
|
get(e, t) {
|
|
169
349
|
if (this.value !== null && this.value !== void 0 && this.isCache(t)) return this.value;
|
|
170
350
|
if (e !== void 0) return this.set(e);
|
|
171
351
|
}
|
|
172
352
|
set(e) {
|
|
173
|
-
if (this.value =
|
|
353
|
+
if (this.value = y(e), this.age = (/* @__PURE__ */ new Date()).getTime(), this.value === void 0) this.remove();
|
|
174
354
|
else {
|
|
175
355
|
var t;
|
|
176
356
|
(t = this.getMethod()) == null || t.setItem(this.getIndex(), JSON.stringify({
|
|
@@ -188,17 +368,17 @@ var ne = {}, re = "ui-storage", b = class {
|
|
|
188
368
|
return this.make(), this;
|
|
189
369
|
}
|
|
190
370
|
isCache(e) {
|
|
191
|
-
return
|
|
371
|
+
return s(e) || this.age && this.age + e * 1e3 >= (/* @__PURE__ */ new Date()).getTime();
|
|
192
372
|
}
|
|
193
373
|
getMethod() {
|
|
194
|
-
if (
|
|
374
|
+
if (m() && !b()) {
|
|
195
375
|
var e, t;
|
|
196
376
|
let n = this.isSession ? (e = window) == null ? void 0 : e.sessionStorage : (t = window) == null ? void 0 : t.localStorage;
|
|
197
377
|
if (n) return n;
|
|
198
378
|
}
|
|
199
379
|
}
|
|
200
380
|
getIndex() {
|
|
201
|
-
return `${
|
|
381
|
+
return `${oe}__${this.name}`;
|
|
202
382
|
}
|
|
203
383
|
getValue() {
|
|
204
384
|
var e;
|
|
@@ -206,14 +386,18 @@ var ne = {}, re = "ui-storage", b = class {
|
|
|
206
386
|
if (t) try {
|
|
207
387
|
return JSON.parse(t);
|
|
208
388
|
} catch (e) {
|
|
209
|
-
|
|
389
|
+
this.errorCenter.on({
|
|
390
|
+
group: "storage",
|
|
391
|
+
code: "error",
|
|
392
|
+
details: e
|
|
393
|
+
});
|
|
210
394
|
}
|
|
211
395
|
}
|
|
212
396
|
make() {
|
|
213
397
|
let e = this.getValue();
|
|
214
398
|
return e ? (this.value = e.value, this.age = e.age) : (this.value = void 0, this.age = void 0), this;
|
|
215
399
|
}
|
|
216
|
-
},
|
|
400
|
+
}, T, se = "geo-code", E = class {
|
|
217
401
|
static get() {
|
|
218
402
|
return this.item;
|
|
219
403
|
}
|
|
@@ -233,7 +417,7 @@ var ne = {}, re = "ui-storage", b = class {
|
|
|
233
417
|
return this.location;
|
|
234
418
|
}
|
|
235
419
|
static getItem() {
|
|
236
|
-
return
|
|
420
|
+
return r(this.item, { language: this.language });
|
|
237
421
|
}
|
|
238
422
|
static getList() {
|
|
239
423
|
return e;
|
|
@@ -241,10 +425,10 @@ var ne = {}, re = "ui-storage", b = class {
|
|
|
241
425
|
static getByCode(e) {
|
|
242
426
|
var t;
|
|
243
427
|
let n;
|
|
244
|
-
return e && (e.match(/([A-Z]{2}-[a-z]{2})|([a-z]{2}-[A-Z]{2})/) && (n = this.getByCodeFull(e)), !n && e.match(/[A-Z]{2}/) && (n = this.getByCountry(this.toCountry(e))), !n && e.match(/[a-z]{2}/) && (n = this.getByLanguage(this.toLanguage(e)))), this.toFull(
|
|
428
|
+
return e && (e.match(/([A-Z]{2}-[a-z]{2})|([a-z]{2}-[A-Z]{2})/) && (n = this.getByCodeFull(e)), !n && e.match(/[A-Z]{2}/) && (n = this.getByCountry(this.toCountry(e))), !n && e.match(/[a-z]{2}/) && (n = this.getByLanguage(this.toLanguage(e)))), this.toFull(p((t = n) == null ? this.getList()[0] : t));
|
|
245
429
|
}
|
|
246
430
|
static getByCodeFull(e) {
|
|
247
|
-
return this.getList().find((t) =>
|
|
431
|
+
return this.getList().find((t) => _(e, [`${t.language}-${t.country}`, `${t.country}-${t.language}`]));
|
|
248
432
|
}
|
|
249
433
|
static getByCountry(e) {
|
|
250
434
|
return this.getList().find((t) => {
|
|
@@ -279,7 +463,7 @@ var ne = {}, re = "ui-storage", b = class {
|
|
|
279
463
|
}
|
|
280
464
|
static findLocation() {
|
|
281
465
|
var e;
|
|
282
|
-
return
|
|
466
|
+
return m() && (this.storage.get() || ((e = document.querySelector("html")) == null ? void 0 : e.lang) || navigator.language || navigator.languages[0] || "en-GB") || "en-GB";
|
|
283
467
|
}
|
|
284
468
|
static findLanguage(e) {
|
|
285
469
|
return e && e.match(/[a-z]{2}/) ? this.toLanguage(e) : this.item.language;
|
|
@@ -291,24 +475,24 @@ var ne = {}, re = "ui-storage", b = class {
|
|
|
291
475
|
return e.replace(/[^a-z]+/g, "");
|
|
292
476
|
}
|
|
293
477
|
static toFull(e) {
|
|
294
|
-
return
|
|
478
|
+
return r(e, {
|
|
295
479
|
standard: this.toStandard(e),
|
|
296
480
|
firstDay: (e == null ? void 0 : e.firstDay) || "Mo"
|
|
297
481
|
});
|
|
298
482
|
}
|
|
299
483
|
};
|
|
300
|
-
|
|
484
|
+
T = E, S(E, "storage", new w(se)), S(E, "location", void 0), S(E, "item", void 0), S(E, "language", void 0), S(E, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), T.location = T.findLocation(), T.language = T.findLanguage(T.location), T.item = T.getByCode(T.location);
|
|
301
485
|
//#endregion
|
|
302
486
|
//#region src/functions/isWindow.ts
|
|
303
|
-
function
|
|
304
|
-
return
|
|
487
|
+
function ce(e) {
|
|
488
|
+
return m() && e === window;
|
|
305
489
|
}
|
|
306
490
|
//#endregion
|
|
307
491
|
//#region src/functions/getElement.ts
|
|
308
|
-
function
|
|
309
|
-
if (
|
|
310
|
-
if (
|
|
311
|
-
if (
|
|
492
|
+
function D(e) {
|
|
493
|
+
if (m()) {
|
|
494
|
+
if (ce(e)) return document.body;
|
|
495
|
+
if (u(e)) {
|
|
312
496
|
var t;
|
|
313
497
|
return (t = document.querySelector(e)) == null ? void 0 : t;
|
|
314
498
|
}
|
|
@@ -317,30 +501,30 @@ function C(e) {
|
|
|
317
501
|
}
|
|
318
502
|
//#endregion
|
|
319
503
|
//#region src/functions/getElementOrWindow.ts
|
|
320
|
-
function
|
|
321
|
-
return
|
|
504
|
+
function O(e) {
|
|
505
|
+
return ce(e) ? e : D(e);
|
|
322
506
|
}
|
|
323
507
|
//#endregion
|
|
324
508
|
//#region src/functions/isInDom.ts
|
|
325
|
-
function
|
|
509
|
+
function le(e) {
|
|
326
510
|
var t;
|
|
327
|
-
return !!((t =
|
|
511
|
+
return !!((t = D(e)) != null && t.closest("html"));
|
|
328
512
|
}
|
|
329
513
|
//#endregion
|
|
330
514
|
//#region src/functions/toArray.ts
|
|
331
|
-
function
|
|
515
|
+
function k(e) {
|
|
332
516
|
return Array.isArray(e) ? e : [e];
|
|
333
517
|
}
|
|
334
518
|
//#endregion
|
|
335
519
|
//#region src/classes/EventItem.ts
|
|
336
|
-
var
|
|
337
|
-
constructor(e,
|
|
338
|
-
|
|
339
|
-
if (
|
|
340
|
-
var
|
|
341
|
-
(
|
|
520
|
+
var A = class {
|
|
521
|
+
constructor(e, n = ["click"], r, i, a) {
|
|
522
|
+
S(this, "element", void 0), S(this, "elementControl", void 0), S(this, "elementControlEdit", void 0), S(this, "type", void 0), S(this, "listenerRecent", (e) => {
|
|
523
|
+
if (le(this.elementControl)) {
|
|
524
|
+
var n, r;
|
|
525
|
+
(n = this.listener) == null || n.call(this.element, e, this.detail), t(this.options) && (r = this.options) != null && r.once && this.stop();
|
|
342
526
|
} else this.stop();
|
|
343
|
-
}),
|
|
527
|
+
}), S(this, "activity", !1), S(this, "activityItems", []), this.listener = r, this.options = i, this.detail = a, this.element = O(e), this.elementControl = D(e), this.type = k(n);
|
|
344
528
|
}
|
|
345
529
|
isActive() {
|
|
346
530
|
return this.activity;
|
|
@@ -349,14 +533,14 @@ var ce = class {
|
|
|
349
533
|
return this.element;
|
|
350
534
|
}
|
|
351
535
|
setElement(e) {
|
|
352
|
-
let t =
|
|
353
|
-
return this.elementControlEdit || (this.elementControl =
|
|
536
|
+
let t = O(e);
|
|
537
|
+
return this.elementControlEdit || (this.elementControl = D(e)), this.element = t, this.reset(), this;
|
|
354
538
|
}
|
|
355
539
|
setElementControl(e) {
|
|
356
|
-
return this.elementControl =
|
|
540
|
+
return this.elementControl = D(e), this.elementControlEdit = !s(this.elementControl), this.elementControlEdit || (this.elementControl = D(this.element)), this;
|
|
357
541
|
}
|
|
358
542
|
setType(e) {
|
|
359
|
-
return this.type =
|
|
543
|
+
return this.type = k(e), this.reset(), this;
|
|
360
544
|
}
|
|
361
545
|
setListener(e) {
|
|
362
546
|
return this.listener = e, this;
|
|
@@ -425,22 +609,25 @@ var ce = class {
|
|
|
425
609
|
}
|
|
426
610
|
return !1;
|
|
427
611
|
}
|
|
428
|
-
},
|
|
429
|
-
|
|
612
|
+
}, ue = "ui-loading", de = class {
|
|
613
|
+
constructor(e = ue) {
|
|
614
|
+
S(this, "value", 0), S(this, "event", void 0), S(this, "registrationList", []), this.eventName = e, m() && (this.event = new A(window, this.eventName));
|
|
615
|
+
}
|
|
616
|
+
is() {
|
|
430
617
|
return this.value > 0;
|
|
431
618
|
}
|
|
432
|
-
|
|
619
|
+
get() {
|
|
433
620
|
return this.value;
|
|
434
621
|
}
|
|
435
|
-
|
|
622
|
+
show() {
|
|
436
623
|
this.value++, this.dispatch();
|
|
437
624
|
}
|
|
438
|
-
|
|
625
|
+
hide() {
|
|
439
626
|
this.is() && (this.value--, this.dispatch());
|
|
440
627
|
}
|
|
441
|
-
|
|
442
|
-
if (
|
|
443
|
-
let n = new
|
|
628
|
+
registrationEvent(e, t) {
|
|
629
|
+
if (m()) {
|
|
630
|
+
let n = new A(window, this.eventName, e).setElementControl(t).start();
|
|
444
631
|
this.registrationList.push({
|
|
445
632
|
item: n,
|
|
446
633
|
listener: e,
|
|
@@ -448,35 +635,57 @@ var ce = class {
|
|
|
448
635
|
});
|
|
449
636
|
}
|
|
450
637
|
}
|
|
451
|
-
|
|
638
|
+
unregistrationEvent(e, t) {
|
|
452
639
|
this.registrationList = this.registrationList.filter((n) => n.listener === e && n.element === t ? (n.item.stop(), !1) : !0);
|
|
453
640
|
}
|
|
454
|
-
|
|
641
|
+
dispatch() {
|
|
455
642
|
var e;
|
|
456
643
|
(e = this.event) == null || e.dispatch({ loading: this.is() });
|
|
457
644
|
}
|
|
645
|
+
}, j = class {
|
|
646
|
+
static is() {
|
|
647
|
+
return this.item.is();
|
|
648
|
+
}
|
|
649
|
+
static get() {
|
|
650
|
+
return this.item.get();
|
|
651
|
+
}
|
|
652
|
+
static getItem() {
|
|
653
|
+
return this.item;
|
|
654
|
+
}
|
|
655
|
+
static show() {
|
|
656
|
+
this.item.show();
|
|
657
|
+
}
|
|
658
|
+
static hide() {
|
|
659
|
+
this.item.hide();
|
|
660
|
+
}
|
|
661
|
+
static registrationEvent(e, t) {
|
|
662
|
+
this.item.registrationEvent(e, t);
|
|
663
|
+
}
|
|
664
|
+
static unregistrationEvent(e, t) {
|
|
665
|
+
this.item.unregistrationEvent(e, t);
|
|
666
|
+
}
|
|
458
667
|
};
|
|
459
|
-
|
|
668
|
+
S(j, "item", new de());
|
|
460
669
|
//#endregion
|
|
461
670
|
//#region src/classes/ApiHeaders.ts
|
|
462
|
-
var
|
|
671
|
+
var fe = class {
|
|
463
672
|
constructor() {
|
|
464
|
-
|
|
673
|
+
S(this, "headers", {});
|
|
465
674
|
}
|
|
466
|
-
get(e,
|
|
675
|
+
get(e, t = "application/json;charset=UTF-8") {
|
|
467
676
|
if (e !== null) {
|
|
468
|
-
let
|
|
469
|
-
return
|
|
677
|
+
let n = r(this.headers, e);
|
|
678
|
+
return c(t) && (n["Content-Type"] = t), n;
|
|
470
679
|
}
|
|
471
680
|
}
|
|
472
681
|
set(e) {
|
|
473
|
-
return
|
|
682
|
+
return n(e) && (this.headers = e), this;
|
|
474
683
|
}
|
|
475
|
-
},
|
|
684
|
+
}, M = /* @__PURE__ */ function(e) {
|
|
476
685
|
return e.get = "GET", e.post = "POST", e.put = "PUT", e.delete = "DELETE", e;
|
|
477
|
-
}({}),
|
|
686
|
+
}({}), pe = class {
|
|
478
687
|
constructor() {
|
|
479
|
-
|
|
688
|
+
S(this, "value", void 0);
|
|
480
689
|
}
|
|
481
690
|
is() {
|
|
482
691
|
return !!this.value;
|
|
@@ -485,10 +694,10 @@ var de = class {
|
|
|
485
694
|
return this.value;
|
|
486
695
|
}
|
|
487
696
|
request(e) {
|
|
488
|
-
let
|
|
489
|
-
if (
|
|
490
|
-
if (e instanceof FormData) this.addByFormData(e,
|
|
491
|
-
else if (
|
|
697
|
+
let t = this.get();
|
|
698
|
+
if (t) {
|
|
699
|
+
if (e instanceof FormData) this.addByFormData(e, t);
|
|
700
|
+
else if (n(e)) return r(t, e);
|
|
492
701
|
}
|
|
493
702
|
return e;
|
|
494
703
|
}
|
|
@@ -498,9 +707,9 @@ var de = class {
|
|
|
498
707
|
addByFormData(e, t) {
|
|
499
708
|
for (let n in t) e.has(n) || e.set(n, t[n]);
|
|
500
709
|
}
|
|
501
|
-
},
|
|
710
|
+
}, me = class {
|
|
502
711
|
constructor() {
|
|
503
|
-
|
|
712
|
+
S(this, "value", void 0);
|
|
504
713
|
}
|
|
505
714
|
get() {
|
|
506
715
|
return this.value;
|
|
@@ -542,7 +751,7 @@ var de = class {
|
|
|
542
751
|
return this.set({ error: e }), this;
|
|
543
752
|
}
|
|
544
753
|
setLastResponse(e) {
|
|
545
|
-
return e &&
|
|
754
|
+
return e && n(e) && ("message" in e && this.setLastMessage(String(e.message)), "status" in e && this.setLastStatus(String(e.status))), this.set({ lastResponse: e }), this;
|
|
546
755
|
}
|
|
547
756
|
setLastStatus(e) {
|
|
548
757
|
return this.set({ lastStatus: e }), this;
|
|
@@ -556,20 +765,15 @@ var de = class {
|
|
|
556
765
|
};
|
|
557
766
|
//#endregion
|
|
558
767
|
//#region src/functions/executePromise.ts
|
|
559
|
-
async function
|
|
560
|
-
let t =
|
|
768
|
+
async function he(e) {
|
|
769
|
+
let t = y(e);
|
|
561
770
|
return t instanceof Promise ? await t : t;
|
|
562
771
|
}
|
|
563
772
|
//#endregion
|
|
564
|
-
//#region src/functions/random.ts
|
|
565
|
-
function O(e, t) {
|
|
566
|
-
return Math.floor(Math.random() * (t - e + 1) + e);
|
|
567
|
-
}
|
|
568
|
-
//#endregion
|
|
569
773
|
//#region src/classes/ApiResponse.ts
|
|
570
|
-
var
|
|
774
|
+
var ge = "d-response-loading", _e = class {
|
|
571
775
|
constructor(e) {
|
|
572
|
-
|
|
776
|
+
S(this, "first", []), S(this, "response", []), S(this, "loading", void 0), S(this, "devMode", !1), this.requestDefault = e;
|
|
573
777
|
}
|
|
574
778
|
get(e = "", t, n, r) {
|
|
575
779
|
return this.response.find((i) => !this.isDisable(i) && this.isPath(i, e) && t === i.method && this.isFirst(i, r) && this.isResponse(i, n) ? (this.isDevMode(r) && console.warn(`Response type: ${i.path}`), this.first.push(i), !0) : !1);
|
|
@@ -578,13 +782,13 @@ var me = "d-response-loading", he = class {
|
|
|
578
782
|
return this.response.filter((e) => e.isForGlobal !== !0);
|
|
579
783
|
}
|
|
580
784
|
add(e) {
|
|
581
|
-
return this.response.push(...
|
|
785
|
+
return this.response.push(...k(e)), this;
|
|
582
786
|
}
|
|
583
787
|
setDevMode(e) {
|
|
584
788
|
return this.devMode = e, this;
|
|
585
789
|
}
|
|
586
790
|
async emulator(e) {
|
|
587
|
-
let { path: t = "", method: n =
|
|
791
|
+
let { path: t = "", method: n = M.get, global: r = n === M.get, devMode: i = !1 } = e;
|
|
588
792
|
if (r || this.isDevMode(i)) {
|
|
589
793
|
let r = this.requestDefault.request(e.request), a = this.get(t, n, r, i);
|
|
590
794
|
if (a) {
|
|
@@ -594,7 +798,7 @@ var me = "d-response-loading", he = class {
|
|
|
594
798
|
}
|
|
595
799
|
}
|
|
596
800
|
isDisable(e) {
|
|
597
|
-
return !!
|
|
801
|
+
return !!y(e == null ? void 0 : e.disable);
|
|
598
802
|
}
|
|
599
803
|
isPath(e, t) {
|
|
600
804
|
return t === e.path || !!(e.path instanceof RegExp && t.match(e.path));
|
|
@@ -606,29 +810,29 @@ var me = "d-response-loading", he = class {
|
|
|
606
810
|
return this.first.indexOf(e) === -1 || this.isDevMode(t);
|
|
607
811
|
}
|
|
608
812
|
isResponse(e, t) {
|
|
609
|
-
let
|
|
610
|
-
return t ===
|
|
813
|
+
let r = this.requestDefault.request(e == null ? void 0 : e.request);
|
|
814
|
+
return t === r || r === "*any" || c(t) && c(r) && n(t) && n(r) && !(t instanceof FormData) && !(r instanceof FormData) && Object.values(t).length === Object.values(r).length && Object.entries(r).reduce((e, [n, r]) => e && (r === (t == null ? void 0 : t[n]) || r === "*any"), !0);
|
|
611
815
|
}
|
|
612
816
|
fetch(e, t) {
|
|
613
817
|
return this.startResponseLoading(), new Promise((n) => {
|
|
614
|
-
|
|
615
|
-
e != null && e.lag ? (
|
|
616
|
-
this.stopResponseLoading(), n(t),
|
|
617
|
-
},
|
|
818
|
+
he(v(e.response) ? e.response(t) : e.response).then((t) => {
|
|
819
|
+
e != null && e.lag ? (j.show(), setTimeout(() => {
|
|
820
|
+
this.stopResponseLoading(), n(t), j.hide();
|
|
821
|
+
}, d(0, 2e3))) : (this.stopResponseLoading(), n(t));
|
|
618
822
|
});
|
|
619
823
|
});
|
|
620
824
|
}
|
|
621
825
|
startResponseLoading() {
|
|
622
|
-
this.loading && clearTimeout(this.loading),
|
|
826
|
+
this.loading && clearTimeout(this.loading), m() && document.body.classList.add(ge);
|
|
623
827
|
}
|
|
624
828
|
stopResponseLoading() {
|
|
625
829
|
this.loading = setTimeout(() => {
|
|
626
|
-
this.loading = void 0,
|
|
830
|
+
this.loading = void 0, m() && document.body.classList.remove(ge);
|
|
627
831
|
}, 1200);
|
|
628
832
|
}
|
|
629
|
-
},
|
|
833
|
+
}, ve = class {
|
|
630
834
|
constructor() {
|
|
631
|
-
|
|
835
|
+
S(this, "callback", void 0), S(this, "callbackEnd", void 0), S(this, "loading", !1);
|
|
632
836
|
}
|
|
633
837
|
async make(e, t) {
|
|
634
838
|
if (e && this.callback) return this.go(t);
|
|
@@ -654,9 +858,11 @@ var me = "d-response-loading", he = class {
|
|
|
654
858
|
let n = {};
|
|
655
859
|
return this.callbackEnd && (n = await this.callbackEnd(e, t)), n;
|
|
656
860
|
}
|
|
657
|
-
},
|
|
658
|
-
constructor(e = "/api/") {
|
|
659
|
-
|
|
861
|
+
}, ye = class {
|
|
862
|
+
constructor(e = "/api/", t = {}) {
|
|
863
|
+
S(this, "headers", void 0), S(this, "requestDefault", void 0), S(this, "status", void 0), S(this, "response", void 0), S(this, "preparation", void 0), S(this, "loading", void 0), S(this, "errorCenter", void 0), S(this, "timeout", 16e3), this.url = e;
|
|
864
|
+
let { headersClass: n = fe, requestDefaultClass: r = pe, statusClass: i = me, responseClass: a = _e, preparationClass: o = ve, loadingClass: s = j.getItem(), errorCenterClass: c = C.getItem() } = t;
|
|
865
|
+
this.headers = new n(), this.requestDefault = new r(), this.status = new i(), this.response = new a(this.requestDefault), this.preparation = new o(), this.loading = s, this.errorCenter = c;
|
|
660
866
|
}
|
|
661
867
|
isLocalhost() {
|
|
662
868
|
return typeof location > "u" || location.hostname === "localhost";
|
|
@@ -668,16 +874,16 @@ var me = "d-response-loading", he = class {
|
|
|
668
874
|
return this.response;
|
|
669
875
|
}
|
|
670
876
|
getUrl(e, t = !0) {
|
|
671
|
-
return `${t ? this.url : ""}${e}`.replace("{locale}",
|
|
877
|
+
return `${t ? this.url : ""}${e}`.replace("{locale}", E.getLocation()).replace("{country}", E.getCountry()).replace("{language}", E.getLanguage());
|
|
672
878
|
}
|
|
673
|
-
getBody(e = {}, t =
|
|
879
|
+
getBody(e = {}, t = M.get) {
|
|
674
880
|
if (e instanceof FormData) return e;
|
|
675
|
-
if (t !==
|
|
881
|
+
if (t !== M.get && c(e)) return u(e) ? e : JSON.stringify(e);
|
|
676
882
|
}
|
|
677
|
-
getBodyForGet(e, t = "", n =
|
|
678
|
-
if (n ===
|
|
679
|
-
let n = t.match(/\?/) ? "&" : "?", r = typeof e == "object" ?
|
|
680
|
-
if (
|
|
883
|
+
getBodyForGet(e, t = "", n = M.get) {
|
|
884
|
+
if (n === M.get) {
|
|
885
|
+
let n = t.match(/\?/) ? "&" : "?", r = typeof e == "object" ? a(e) : e;
|
|
886
|
+
if (c(r)) return `${n}${r}`;
|
|
681
887
|
}
|
|
682
888
|
return "";
|
|
683
889
|
}
|
|
@@ -696,60 +902,134 @@ var me = "d-response-loading", he = class {
|
|
|
696
902
|
setEnd(e) {
|
|
697
903
|
return this.preparation.setEnd(e), this;
|
|
698
904
|
}
|
|
905
|
+
setTimeout(e) {
|
|
906
|
+
return this.timeout = e, this;
|
|
907
|
+
}
|
|
699
908
|
async request(e) {
|
|
700
|
-
return
|
|
909
|
+
return u(e) ? await this.fetch({ path: e }) : await this.fetch(e);
|
|
701
910
|
}
|
|
702
911
|
get(e) {
|
|
703
|
-
return this.request(
|
|
912
|
+
return this.request(r(e, { method: M.get }));
|
|
704
913
|
}
|
|
705
914
|
post(e) {
|
|
706
|
-
return this.request(
|
|
915
|
+
return this.request(r(e, { method: M.post }));
|
|
707
916
|
}
|
|
708
917
|
put(e) {
|
|
709
|
-
return this.request(
|
|
918
|
+
return this.request(r(e, { method: M.put }));
|
|
710
919
|
}
|
|
711
920
|
delete(e) {
|
|
712
|
-
return this.request(
|
|
921
|
+
return this.request(r(e, { method: M.delete }));
|
|
713
922
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
923
|
+
getRetryDelay(e, t) {
|
|
924
|
+
return d(t, t + e * t);
|
|
925
|
+
}
|
|
926
|
+
async fetch(e, t = 0) {
|
|
927
|
+
let { toData: n = !0, hideError: r = !1, hideLoading: i = !1, retry: a = 0, retryDelay: o = 64, queryReturn: s = void 0, globalPreparation: c = !0, globalEnd: l = !0 } = e, u = await this.response.emulator(e);
|
|
928
|
+
if (u) return u;
|
|
929
|
+
let d = new me(), p;
|
|
930
|
+
i || this.loading.show();
|
|
719
931
|
try {
|
|
720
|
-
await this.preparation.make(
|
|
721
|
-
let
|
|
722
|
-
|
|
723
|
-
|
|
932
|
+
await this.preparation.make(c, e);
|
|
933
|
+
let { query: n, timeoutId: i } = await this.makeQuery(e);
|
|
934
|
+
i && clearTimeout(i);
|
|
935
|
+
let u = await this.preparation.makeEnd(l, n, e);
|
|
936
|
+
if (d.setStatus(n.status, n.statusText), this.status.setStatus(n.status, n.statusText), !r && n.status >= 400 && this.makeErrorQuery(n), u != null && u.reset || t < a) return await f(this.getRetryDelay(t, o)), this.loading.hide(), await this.fetch(e, t + 1);
|
|
937
|
+
p = await this.readData(n, s, u);
|
|
724
938
|
} catch (e) {
|
|
725
|
-
throw
|
|
939
|
+
throw r || this.makeError(e), d.setError(String(e)), this.status.setError(String(e)), i || this.loading.hide(), e;
|
|
726
940
|
}
|
|
727
|
-
return
|
|
941
|
+
return i || this.loading.hide(), d.setLastResponse(p), this.status.setLastResponse(p), this.makeStatus(this.makeData(p, n), d);
|
|
728
942
|
}
|
|
729
943
|
async readData(e, t, n) {
|
|
730
944
|
var r;
|
|
731
945
|
return t ? await t(e) : "data" in n ? n.data : ((r = e.headers.get("Content-Type")) == null ? "" : r).match("application/json") ? await e.json() : { data: await e.text() };
|
|
732
946
|
}
|
|
733
947
|
async makeQuery(e) {
|
|
734
|
-
let
|
|
948
|
+
let t = this.requestDefault.request(e.request), { api: n = !0, path: i = "", pathFull: a = void 0, method: o = M.get, headers: s = {}, type: c = "application/json;charset=UTF-8", init: l = {} } = e, u = a == null ? this.getUrl(i, n) : a, d = `${u}${this.getBodyForGet(t, u, o)}`, f = this.headers.get(s, c), p = r(l, {
|
|
735
949
|
method: o,
|
|
736
|
-
body: this.getBody(
|
|
950
|
+
body: this.getBody(t, o)
|
|
737
951
|
});
|
|
738
|
-
|
|
952
|
+
f && (p.headers = f);
|
|
953
|
+
let m = this.initController(e, p);
|
|
954
|
+
return {
|
|
955
|
+
query: await fetch(d, p),
|
|
956
|
+
timeoutId: m
|
|
957
|
+
};
|
|
739
958
|
}
|
|
740
|
-
makeData(e,
|
|
741
|
-
if (!
|
|
742
|
-
if (e.data !== null && typeof e.data != "object" ||
|
|
743
|
-
let
|
|
744
|
-
return "success" in e && !("success" in
|
|
959
|
+
makeData(e, t) {
|
|
960
|
+
if (!t || !e || !n(e) || !("data" in e)) return e;
|
|
961
|
+
if (e.data !== null && typeof e.data != "object" || o(e.data)) return e.data;
|
|
962
|
+
let i = r(e.data);
|
|
963
|
+
return "success" in e && !("success" in i) && (i.success = e.success), "status" in e && !("status" in i) && (i.status = e.status), "message" in e && !("message" in i) && (i.message = e.message), i;
|
|
745
964
|
}
|
|
746
965
|
makeStatus(e, t) {
|
|
747
|
-
return e &&
|
|
966
|
+
return e && n(e) ? {
|
|
748
967
|
...e,
|
|
749
968
|
statusObject: t.get()
|
|
750
969
|
} : e;
|
|
751
970
|
}
|
|
752
|
-
|
|
971
|
+
makeError(e, t = "api") {
|
|
972
|
+
switch (e.name) {
|
|
973
|
+
case "TimeoutError":
|
|
974
|
+
this.errorCenter.on({
|
|
975
|
+
group: t,
|
|
976
|
+
code: "timeout",
|
|
977
|
+
details: e
|
|
978
|
+
});
|
|
979
|
+
break;
|
|
980
|
+
case "AbortError": break;
|
|
981
|
+
default: l() ? this.errorCenter.on({
|
|
982
|
+
group: t,
|
|
983
|
+
code: "unknown",
|
|
984
|
+
details: e
|
|
985
|
+
}) : this.errorCenter.on({
|
|
986
|
+
group: t,
|
|
987
|
+
code: "offline",
|
|
988
|
+
details: e
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
makeErrorQuery(e) {
|
|
993
|
+
switch (e.status) {
|
|
994
|
+
case 404:
|
|
995
|
+
this.errorCenter.on({
|
|
996
|
+
group: "api",
|
|
997
|
+
code: "notFound",
|
|
998
|
+
details: e
|
|
999
|
+
});
|
|
1000
|
+
break;
|
|
1001
|
+
case 500:
|
|
1002
|
+
this.errorCenter.on({
|
|
1003
|
+
group: "api",
|
|
1004
|
+
code: "server",
|
|
1005
|
+
details: e
|
|
1006
|
+
});
|
|
1007
|
+
break;
|
|
1008
|
+
default: this.errorCenter.on({
|
|
1009
|
+
group: "api-server",
|
|
1010
|
+
code: String(e.status),
|
|
1011
|
+
details: e
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
initController(e, t) {
|
|
1016
|
+
let { timeout: n = this.timeout, controller: r } = e;
|
|
1017
|
+
if (n && !r && typeof AbortSignal < "u") {
|
|
1018
|
+
t.signal = AbortSignal.timeout(n);
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
if (!n && r) {
|
|
1022
|
+
t.signal = r.signal;
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
1025
|
+
if (n) {
|
|
1026
|
+
let e = r == null ? new AbortController() : r;
|
|
1027
|
+
return t.signal = e.signal, setTimeout(() => {
|
|
1028
|
+
e.abort(new DOMException("Timeout", "TimeoutError"));
|
|
1029
|
+
}, n);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}, N = class e {
|
|
753
1033
|
static isLocalhost() {
|
|
754
1034
|
return this.item.isLocalhost();
|
|
755
1035
|
}
|
|
@@ -765,10 +1045,10 @@ var me = "d-response-loading", he = class {
|
|
|
765
1045
|
static getUrl(e, t = !0) {
|
|
766
1046
|
return this.item.getUrl(e, t);
|
|
767
1047
|
}
|
|
768
|
-
static getBody(e = {}, t =
|
|
1048
|
+
static getBody(e = {}, t = M.get) {
|
|
769
1049
|
return this.item.getBody(e, t);
|
|
770
1050
|
}
|
|
771
|
-
static getBodyForGet(e, t = "", n =
|
|
1051
|
+
static getBodyForGet(e, t = "", n = M.get) {
|
|
772
1052
|
return this.item.getBodyForGet(e, t, n);
|
|
773
1053
|
}
|
|
774
1054
|
static setHeaders(t) {
|
|
@@ -786,6 +1066,12 @@ var me = "d-response-loading", he = class {
|
|
|
786
1066
|
static setEnd(t) {
|
|
787
1067
|
return this.item.setEnd(t), e;
|
|
788
1068
|
}
|
|
1069
|
+
static setTimeout(t) {
|
|
1070
|
+
return this.item.setTimeout(t), e;
|
|
1071
|
+
}
|
|
1072
|
+
static setConfig(e) {
|
|
1073
|
+
return e && n(e) && (e.urlRoot && this.setUrl(e.urlRoot), e.headers && this.setHeaders(e.headers), e.requestDefault && this.setRequestDefault(e.requestDefault), e.preparation && this.setPreparation(e.preparation), e.end && this.setEnd(e.end), e.timeout && this.setTimeout(e.timeout)), this;
|
|
1074
|
+
}
|
|
789
1075
|
static async request(e) {
|
|
790
1076
|
return this.item.request(e);
|
|
791
1077
|
}
|
|
@@ -802,21 +1088,25 @@ var me = "d-response-loading", he = class {
|
|
|
802
1088
|
return this.item.delete(e);
|
|
803
1089
|
}
|
|
804
1090
|
};
|
|
805
|
-
|
|
1091
|
+
S(N, "item", new ye());
|
|
806
1092
|
//#endregion
|
|
807
1093
|
//#region src/classes/BroadcastMessage.ts
|
|
808
|
-
var
|
|
809
|
-
constructor(e, t, n) {
|
|
810
|
-
if (
|
|
1094
|
+
var be = class {
|
|
1095
|
+
constructor(e, t, n, r = C.getItem()) {
|
|
1096
|
+
if (S(this, "channel", void 0), S(this, "update", (e) => {
|
|
811
1097
|
var t;
|
|
812
1098
|
return (t = this.callback) == null || t.call(this, e), this;
|
|
813
|
-
}),
|
|
1099
|
+
}), S(this, "updateError", (e) => {
|
|
814
1100
|
var t;
|
|
815
1101
|
return (t = this.callbackError) == null || t.call(this, e), this;
|
|
816
|
-
}), this.callback = t, this.callbackError = n,
|
|
817
|
-
this.channel = new BroadcastChannel(`${
|
|
818
|
-
} catch (
|
|
819
|
-
|
|
1102
|
+
}), this.callback = t, this.callbackError = n, m()) try {
|
|
1103
|
+
this.channel = new BroadcastChannel(`${xe()}__${e}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
|
|
1104
|
+
} catch (e) {
|
|
1105
|
+
r.on({
|
|
1106
|
+
group: "broadcast",
|
|
1107
|
+
code: "error",
|
|
1108
|
+
details: e
|
|
1109
|
+
});
|
|
820
1110
|
}
|
|
821
1111
|
}
|
|
822
1112
|
getChannel() {
|
|
@@ -832,9 +1122,9 @@ var ve = class {
|
|
|
832
1122
|
setCallbackError(e) {
|
|
833
1123
|
return this.callbackError = e, this;
|
|
834
1124
|
}
|
|
835
|
-
},
|
|
1125
|
+
}, xe = () => new w("__broadcast-name").get(() => `name_${d(1e6, 9999999)}`), Se = class {
|
|
836
1126
|
constructor(e) {
|
|
837
|
-
|
|
1127
|
+
S(this, "cache", void 0), S(this, "cacheOld", void 0), S(this, "comparisons", []), this.callback = e;
|
|
838
1128
|
}
|
|
839
1129
|
getCache(e) {
|
|
840
1130
|
return this.isUpdate(e) && (this.cacheOld = this.cache, this.setCache()), this.cache;
|
|
@@ -854,9 +1144,9 @@ var ve = class {
|
|
|
854
1144
|
isUpdate(e) {
|
|
855
1145
|
return this.cache === void 0 || this.comparisons.length !== e.length || this.comparisons.findIndex((t, n) => t !== e[n]) >= 0 ? (this.comparisons = [...e], !0) : !1;
|
|
856
1146
|
}
|
|
857
|
-
},
|
|
1147
|
+
}, Ce = class {
|
|
858
1148
|
constructor() {
|
|
859
|
-
|
|
1149
|
+
S(this, "cache", {});
|
|
860
1150
|
}
|
|
861
1151
|
get(e, t, n) {
|
|
862
1152
|
return this.getCacheItem(e, t).getCache(n == null ? [] : n);
|
|
@@ -865,17 +1155,17 @@ var ve = class {
|
|
|
865
1155
|
return await this.getCacheItem(e, t).getCacheAsync(n == null ? [] : n);
|
|
866
1156
|
}
|
|
867
1157
|
getCacheItem(e, t) {
|
|
868
|
-
return e in this.cache || (this.cache[e] = new
|
|
1158
|
+
return e in this.cache || (this.cache[e] = new Se(t)), this.cache[e];
|
|
869
1159
|
}
|
|
870
|
-
},
|
|
1160
|
+
}, we, Te = class {
|
|
871
1161
|
static get(e, t, n) {
|
|
872
1162
|
return this.cache.get(e, t, n);
|
|
873
1163
|
}
|
|
874
1164
|
};
|
|
875
|
-
|
|
1165
|
+
we = Te, S(Te, "cache", void 0), we.cache = new Ce();
|
|
876
1166
|
//#endregion
|
|
877
1167
|
//#region src/functions/transformation.ts
|
|
878
|
-
function
|
|
1168
|
+
function Ee(e, t = !1) {
|
|
879
1169
|
if (typeof e == "string") {
|
|
880
1170
|
let r = e.trim();
|
|
881
1171
|
switch (r) {
|
|
@@ -892,14 +1182,14 @@ function we(e, t = !1) {
|
|
|
892
1182
|
}
|
|
893
1183
|
else if (/^[0-9]+\.[0-9.]+$/.exec(r)) return parseFloat(r);
|
|
894
1184
|
else if (/^[0-9]+$/.exec(r)) return parseInt(r, 10);
|
|
895
|
-
else if (t &&
|
|
1185
|
+
else if (t && m() && typeof ((n = window) == null ? void 0 : n[r]) == "function") return window[r];
|
|
896
1186
|
}
|
|
897
1187
|
}
|
|
898
1188
|
return e;
|
|
899
1189
|
}
|
|
900
1190
|
//#endregion
|
|
901
1191
|
//#region src/classes/CookieBlock.ts
|
|
902
|
-
var
|
|
1192
|
+
var De = "cookie-block", Oe = class {
|
|
903
1193
|
static get() {
|
|
904
1194
|
var e;
|
|
905
1195
|
return (e = this.storage.get()) == null ? !1 : e;
|
|
@@ -908,19 +1198,19 @@ var Te = "cookie-block", Ee = class {
|
|
|
908
1198
|
this.storage.set(e);
|
|
909
1199
|
}
|
|
910
1200
|
};
|
|
911
|
-
|
|
1201
|
+
S(Oe, "storage", new w(De));
|
|
912
1202
|
//#endregion
|
|
913
1203
|
//#region src/classes/Cookie.ts
|
|
914
|
-
var
|
|
1204
|
+
var ke, Ae = {}, je = class {
|
|
915
1205
|
constructor(e) {
|
|
916
|
-
if (
|
|
917
|
-
this.value =
|
|
1206
|
+
if (S(this, "value", void 0), S(this, "options", {}), this.name = e, e in Me) return Me[e];
|
|
1207
|
+
this.value = Ae == null ? void 0 : Ae[e], Me[e] = this;
|
|
918
1208
|
}
|
|
919
1209
|
get(e, t) {
|
|
920
1210
|
return this.value === void 0 && e && this.set(e, t), this.value;
|
|
921
1211
|
}
|
|
922
1212
|
set(e, t) {
|
|
923
|
-
this.value =
|
|
1213
|
+
this.value = y(e), Object.assign(this.options, t), this.update();
|
|
924
1214
|
}
|
|
925
1215
|
remove() {
|
|
926
1216
|
this.set("");
|
|
@@ -930,7 +1220,7 @@ var De, A = {}, Oe = class {
|
|
|
930
1220
|
return (e = (t = this.options) == null ? void 0 : t.age) == null ? 10080 * 60 : e;
|
|
931
1221
|
}
|
|
932
1222
|
update() {
|
|
933
|
-
if (
|
|
1223
|
+
if (m() && !b() && !Oe.get()) {
|
|
934
1224
|
var e, t, n, r, i;
|
|
935
1225
|
let a = String((e = this.value) == null ? "" : e);
|
|
936
1226
|
document.cookie = [
|
|
@@ -944,40 +1234,40 @@ var De, A = {}, Oe = class {
|
|
|
944
1234
|
static updateData() {
|
|
945
1235
|
for (let e of document.cookie.split(";")) {
|
|
946
1236
|
let [t, n] = e.trim().split("=");
|
|
947
|
-
t &&
|
|
1237
|
+
t && c(n) && (Ae[t] = Ee(n));
|
|
948
1238
|
}
|
|
949
1239
|
}
|
|
950
1240
|
};
|
|
951
|
-
|
|
952
|
-
var
|
|
1241
|
+
ke = je, m() && !b() && ke.updateData();
|
|
1242
|
+
var Me = {};
|
|
953
1243
|
//#endregion
|
|
954
1244
|
//#region src/functions/toDate.ts
|
|
955
|
-
function
|
|
956
|
-
var t, n, r, i, a,
|
|
1245
|
+
function P(e) {
|
|
1246
|
+
var t, n, r, i, a, o, c, l;
|
|
957
1247
|
if (e instanceof Date) return e;
|
|
958
|
-
if (
|
|
1248
|
+
if (s(e)) return /* @__PURE__ */ new Date();
|
|
959
1249
|
if (typeof e == "number") return new Date(e);
|
|
960
|
-
let u = e, d =
|
|
1250
|
+
let u = e, d = E.getTimezoneFormat().trim();
|
|
961
1251
|
e.replace(/^([\s\S]+)([-+]\d{2}:?\d{2})$/, (e, t, n) => (u = t, d = n.trim(), e));
|
|
962
|
-
let f = (t = (n = (r = (i = (a = (
|
|
1252
|
+
let f = (t = (n = (r = (i = (a = (o = (c = (l = /^\d{4}\d{2}\d{2}$/.exec(u) && `${u.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3")}T00:00:00`) == null ? /^\d{4}\d{2}$/.exec(u) && `${u.replace(/^(\d{4})(\d{2})$/, "$1-$2")}-01T00:00:00` : l) == null ? /^\d{4}\d{2}\d{2} \d{2}:\d{2}:\d{2}$/.exec(u) && u.replace(/^(\d{4})(\d{2})(\d{2}) (\d{2}):(\d{2}):(\d{2})$/, "$1-$2-$3T$4:$5:$6") : c) == null ? /^\d{4}-\d{2}-\d{2}$/.exec(u) && `${u}T00:00:00` : o) == null ? /^\d{4}-\d{2}$/.exec(u) && `${u}-01T00:00:00` : a) == null ? /^\d{4}$/.exec(u) && `${u}-01-01T00:00:00` : i) == null ? /^\d{2}:\d{2}$/.exec(u) && `2000-01-01T${u}:00` : r) == null ? /^\d{2}:\d{2}:\d{2}$/.exec(u) && `2000-01-01T${u}` : n) == null ? u.replace(" ", "T") : t;
|
|
963
1253
|
return /* @__PURE__ */ new Date(`${f.trim()}${d}`);
|
|
964
1254
|
}
|
|
965
1255
|
//#endregion
|
|
966
1256
|
//#region src/functions/getColumn.ts
|
|
967
|
-
function
|
|
968
|
-
return
|
|
1257
|
+
function Ne(e, t) {
|
|
1258
|
+
return i(e, (e) => e == null ? void 0 : e[t], !0);
|
|
969
1259
|
}
|
|
970
1260
|
//#endregion
|
|
971
1261
|
//#region src/classes/GeoIntl.ts
|
|
972
|
-
var
|
|
973
|
-
static getInstance(t =
|
|
1262
|
+
var F = class e {
|
|
1263
|
+
static getInstance(t = E.getLocation()) {
|
|
974
1264
|
return new e(t);
|
|
975
1265
|
}
|
|
976
|
-
constructor(e =
|
|
977
|
-
|
|
978
|
-
let
|
|
979
|
-
if (
|
|
980
|
-
|
|
1266
|
+
constructor(e = E.getLocation(), t = C.getItem()) {
|
|
1267
|
+
S(this, "geo", void 0), this.errorCenter = t, this.geo = E.find(e);
|
|
1268
|
+
let n = this.getLocation();
|
|
1269
|
+
if (n in I) return I[n];
|
|
1270
|
+
I[n] = this;
|
|
981
1271
|
}
|
|
982
1272
|
getLocation() {
|
|
983
1273
|
return this.geo.standard;
|
|
@@ -995,7 +1285,11 @@ var N = class e {
|
|
|
995
1285
|
try {
|
|
996
1286
|
typeof Intl < "u" && (e ? a = new Intl.DisplayNames(this.getLocation(), i).of(e) : i.type === "language" ? a = new Intl.DisplayNames(this.getLocation(), i).of(this.geo.language) : i.type === "region" && (a = new Intl.DisplayNames(this.getLocation(), i).of(this.geo.country)));
|
|
997
1287
|
} catch (e) {
|
|
998
|
-
|
|
1288
|
+
this.errorCenter.on({
|
|
1289
|
+
group: "intl",
|
|
1290
|
+
code: "display",
|
|
1291
|
+
details: e
|
|
1292
|
+
});
|
|
999
1293
|
}
|
|
1000
1294
|
return (n = (r = a) == null ? e : r) == null ? "" : n;
|
|
1001
1295
|
}
|
|
@@ -1004,7 +1298,7 @@ var N = class e {
|
|
|
1004
1298
|
type: "language",
|
|
1005
1299
|
style: t
|
|
1006
1300
|
};
|
|
1007
|
-
return this.display(
|
|
1301
|
+
return this.display(E.getByCode(e).language, n);
|
|
1008
1302
|
}
|
|
1009
1303
|
countryName(e, t) {
|
|
1010
1304
|
let n = {
|
|
@@ -1034,7 +1328,7 @@ var N = class e {
|
|
|
1034
1328
|
}
|
|
1035
1329
|
number(e, t) {
|
|
1036
1330
|
var n, r;
|
|
1037
|
-
return ((n = this.numberObject(t)) == null || (r = n.format) == null ? void 0 : r.call(n,
|
|
1331
|
+
return ((n = this.numberObject(t)) == null || (r = n.format) == null ? void 0 : r.call(n, g(e))) || e.toString();
|
|
1038
1332
|
}
|
|
1039
1333
|
decimal() {
|
|
1040
1334
|
var e, t, n;
|
|
@@ -1048,7 +1342,7 @@ var N = class e {
|
|
|
1048
1342
|
}, i = e.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]{3})$/i, (...e) => (r.currency = String(e[2]).toUpperCase(), String(e[1])));
|
|
1049
1343
|
if (n) {
|
|
1050
1344
|
let t = this.numberObject(r);
|
|
1051
|
-
return t ?
|
|
1345
|
+
return t ? Ne(t.formatToParts(g(e)).filter((e) => ["literal", "currency"].indexOf(e.type) === -1), "value").join("") : e.toString();
|
|
1052
1346
|
} else if ("currency" in r) return this.number(typeof e == "number" ? e : i, r);
|
|
1053
1347
|
else return this.number(typeof e == "number" ? e : i, {
|
|
1054
1348
|
...r,
|
|
@@ -1071,8 +1365,8 @@ var N = class e {
|
|
|
1071
1365
|
return this.number(r, n);
|
|
1072
1366
|
}
|
|
1073
1367
|
sizeFile(e, t = "byte") {
|
|
1074
|
-
let n =
|
|
1075
|
-
if (n > 1024 &&
|
|
1368
|
+
let n = g(e);
|
|
1369
|
+
if (n > 1024 && u(t)) switch (t) {
|
|
1076
1370
|
case "byte": return this.sizeFile(n / 1024, "kilobyte");
|
|
1077
1371
|
case "kilobyte": return this.sizeFile(n / 1024, "megabyte");
|
|
1078
1372
|
case "megabyte": return this.sizeFile(n / 1024, "gigabyte");
|
|
@@ -1088,11 +1382,11 @@ var N = class e {
|
|
|
1088
1382
|
});
|
|
1089
1383
|
}
|
|
1090
1384
|
percentBy100(e, t) {
|
|
1091
|
-
return this.percent(
|
|
1385
|
+
return this.percent(g(e) / 100, t);
|
|
1092
1386
|
}
|
|
1093
1387
|
plural(e, t, n, r) {
|
|
1094
1388
|
var i;
|
|
1095
|
-
let a =
|
|
1389
|
+
let a = g(e), o = t.split("|");
|
|
1096
1390
|
if (o.length > 1) try {
|
|
1097
1391
|
if (typeof Intl < "u") {
|
|
1098
1392
|
var s;
|
|
@@ -1120,23 +1414,27 @@ var N = class e {
|
|
|
1120
1414
|
return `${this.number(a, r)} ${(s = t) == null ? "" : s}`.trim();
|
|
1121
1415
|
}
|
|
1122
1416
|
} catch (e) {
|
|
1123
|
-
|
|
1417
|
+
this.errorCenter.on({
|
|
1418
|
+
group: "intl",
|
|
1419
|
+
code: "plural",
|
|
1420
|
+
details: e
|
|
1421
|
+
});
|
|
1124
1422
|
}
|
|
1125
1423
|
return `${this.number(a, r)} ${(i = o == null ? void 0 : o[0]) == null ? "" : i}`.trim();
|
|
1126
1424
|
}
|
|
1127
1425
|
date(e, t, n, r) {
|
|
1128
|
-
let i =
|
|
1426
|
+
let i = P(e), a = typeof n == "string", o = this.dateOptions(t, a ? n : "short");
|
|
1129
1427
|
return r && (o.hour12 = !1), a || Object.assign(o, n), i.toLocaleString(this.getLocation(), o);
|
|
1130
1428
|
}
|
|
1131
1429
|
relative(e, t, n) {
|
|
1132
|
-
let r =
|
|
1430
|
+
let r = P(e), i = n || /* @__PURE__ */ new Date(), a = {
|
|
1133
1431
|
numeric: "auto",
|
|
1134
1432
|
...typeof t == "string" ? { style: t } : t || {}
|
|
1135
1433
|
}, o = "second", s = (r.getTime() - i.getTime()) / 1e3;
|
|
1136
1434
|
return Math.abs(s) >= 60 && (o = "minute", s /= 60, Math.abs(s) >= 60 && (o = "hour", s /= 60, Math.abs(s) >= 24 && (o = "day", s /= 24, Math.abs(s) >= 30 && (o = "month", s /= 30, Math.abs(s) >= 12 && (o = "year", s /= 12))))), this.relativeByValue(s, o, a);
|
|
1137
1435
|
}
|
|
1138
1436
|
relativeLimit(e, t, n, r, i, a, o) {
|
|
1139
|
-
let s =
|
|
1437
|
+
let s = P(e), c = n || /* @__PURE__ */ new Date(), l = new Date(c), u = new Date(c);
|
|
1140
1438
|
return l.setDate(c.getDate() - t), u.setDate(c.getDate() + t), s >= l && s <= u ? this.relative(s, r, c) : this.date(s, a, i, o);
|
|
1141
1439
|
}
|
|
1142
1440
|
relativeByValue(e, t, n) {
|
|
@@ -1145,17 +1443,25 @@ var N = class e {
|
|
|
1145
1443
|
...typeof n == "string" ? { style: n } : n || {}
|
|
1146
1444
|
};
|
|
1147
1445
|
try {
|
|
1148
|
-
if (this.hasIntl() && Intl.RelativeTimeFormat !== void 0) return new Intl.RelativeTimeFormat(this.getLocation(), r).format(Math.round(
|
|
1446
|
+
if (this.hasIntl() && Intl.RelativeTimeFormat !== void 0) return new Intl.RelativeTimeFormat(this.getLocation(), r).format(Math.round(g(e)), t);
|
|
1149
1447
|
} catch (e) {
|
|
1150
|
-
|
|
1448
|
+
this.errorCenter.on({
|
|
1449
|
+
group: "intl",
|
|
1450
|
+
code: "relative",
|
|
1451
|
+
details: e
|
|
1452
|
+
});
|
|
1151
1453
|
}
|
|
1152
1454
|
return "";
|
|
1153
1455
|
}
|
|
1154
1456
|
month(e, t) {
|
|
1155
1457
|
try {
|
|
1156
|
-
if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { month: t || "long" }).format(
|
|
1458
|
+
if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { month: t || "long" }).format(P(e));
|
|
1157
1459
|
} catch (e) {
|
|
1158
|
-
|
|
1460
|
+
this.errorCenter.on({
|
|
1461
|
+
group: "intl",
|
|
1462
|
+
code: "datetime",
|
|
1463
|
+
details: e
|
|
1464
|
+
});
|
|
1159
1465
|
}
|
|
1160
1466
|
return "";
|
|
1161
1467
|
}
|
|
@@ -1173,15 +1479,23 @@ var N = class e {
|
|
|
1173
1479
|
});
|
|
1174
1480
|
}
|
|
1175
1481
|
} catch (e) {
|
|
1176
|
-
|
|
1482
|
+
this.errorCenter.on({
|
|
1483
|
+
group: "intl",
|
|
1484
|
+
code: "datetime",
|
|
1485
|
+
details: e
|
|
1486
|
+
});
|
|
1177
1487
|
}
|
|
1178
1488
|
return t;
|
|
1179
1489
|
}
|
|
1180
1490
|
weekday(e, t) {
|
|
1181
1491
|
try {
|
|
1182
|
-
if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }).format(
|
|
1492
|
+
if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }).format(P(e));
|
|
1183
1493
|
} catch (e) {
|
|
1184
|
-
|
|
1494
|
+
this.errorCenter.on({
|
|
1495
|
+
group: "intl",
|
|
1496
|
+
code: "datetime",
|
|
1497
|
+
details: e
|
|
1498
|
+
});
|
|
1185
1499
|
}
|
|
1186
1500
|
return "";
|
|
1187
1501
|
}
|
|
@@ -1200,7 +1514,11 @@ var N = class e {
|
|
|
1200
1514
|
}), n.setDate(n.getDate() + 1);
|
|
1201
1515
|
}
|
|
1202
1516
|
} catch (e) {
|
|
1203
|
-
|
|
1517
|
+
this.errorCenter.on({
|
|
1518
|
+
group: "intl",
|
|
1519
|
+
code: "datetime",
|
|
1520
|
+
details: e
|
|
1521
|
+
});
|
|
1204
1522
|
}
|
|
1205
1523
|
return t;
|
|
1206
1524
|
}
|
|
@@ -1224,7 +1542,11 @@ var N = class e {
|
|
|
1224
1542
|
try {
|
|
1225
1543
|
if (this.hasIntl() && Intl.NumberFormat !== void 0) return new Intl.NumberFormat(this.getLocation(), e);
|
|
1226
1544
|
} catch (e) {
|
|
1227
|
-
|
|
1545
|
+
this.errorCenter.on({
|
|
1546
|
+
group: "intl",
|
|
1547
|
+
code: "number",
|
|
1548
|
+
details: e
|
|
1549
|
+
});
|
|
1228
1550
|
}
|
|
1229
1551
|
}
|
|
1230
1552
|
dateOptions(e, t = "short") {
|
|
@@ -1269,12 +1591,12 @@ var N = class e {
|
|
|
1269
1591
|
"second"
|
|
1270
1592
|
].indexOf(e) !== -1 && (n.second = "2-digit")), n;
|
|
1271
1593
|
}
|
|
1272
|
-
},
|
|
1273
|
-
constructor(e, t = "date", n =
|
|
1274
|
-
|
|
1594
|
+
}, I = {}, Pe = class e {
|
|
1595
|
+
constructor(e, t = "date", n = E.getLocation()) {
|
|
1596
|
+
S(this, "date", void 0), S(this, "hour24", !1), S(this, "watch", void 0), this.type = t, this.code = n, this.date = P(e);
|
|
1275
1597
|
}
|
|
1276
1598
|
getIntl() {
|
|
1277
|
-
return new
|
|
1599
|
+
return new F(this.code);
|
|
1278
1600
|
}
|
|
1279
1601
|
getDate() {
|
|
1280
1602
|
return this.date;
|
|
@@ -1377,7 +1699,7 @@ var N = class e {
|
|
|
1377
1699
|
].indexOf(this.type) !== -1 && (i = n.locale("time"))), `${r.join("-")}${i ? `T${i}${t ? n.getTimeZone() : ""}` : ""}`;
|
|
1378
1700
|
}
|
|
1379
1701
|
setDate(e) {
|
|
1380
|
-
return this.date =
|
|
1702
|
+
return this.date = P(e), this.update(), this;
|
|
1381
1703
|
}
|
|
1382
1704
|
setType(e) {
|
|
1383
1705
|
return this.type = e, this.update(), this;
|
|
@@ -1519,7 +1841,7 @@ var N = class e {
|
|
|
1519
1841
|
return this.cloneClass().moveDayPrevious();
|
|
1520
1842
|
}
|
|
1521
1843
|
toTimeZoneHourFormat(e) {
|
|
1522
|
-
|
|
1844
|
+
m() && this.getIntl().number(Math.trunc(e), {
|
|
1523
1845
|
signDisplay: "always",
|
|
1524
1846
|
minimumIntegerDigits: 2
|
|
1525
1847
|
});
|
|
@@ -1533,36 +1855,36 @@ var N = class e {
|
|
|
1533
1855
|
};
|
|
1534
1856
|
//#endregion
|
|
1535
1857
|
//#region src/functions/anyToString.ts
|
|
1536
|
-
function
|
|
1858
|
+
function L(e, n = !0) {
|
|
1537
1859
|
var r;
|
|
1538
|
-
return
|
|
1860
|
+
return u(e) ? e.trim() : o(e) && e.findIndex((e) => t(e)) === -1 && n ? e.join(",") : t(e) ? JSON.stringify(e) : e === !0 ? "1" : e === !1 ? "0" : (r = e == null ? void 0 : e.toString()) == null ? "" : r;
|
|
1539
1861
|
}
|
|
1540
1862
|
//#endregion
|
|
1541
1863
|
//#region src/functions/strSplit.ts
|
|
1542
|
-
function
|
|
1543
|
-
let r =
|
|
1864
|
+
function Fe(e, t, n) {
|
|
1865
|
+
let r = L(e);
|
|
1544
1866
|
if (!n || n <= 0) return r.split(t);
|
|
1545
1867
|
let i = r.split(t, n), a = r.split(t);
|
|
1546
1868
|
return i.length === a.length ? i : (i.pop(), [...i, a.slice(n - 1).join(t)]);
|
|
1547
1869
|
}
|
|
1548
1870
|
//#endregion
|
|
1549
1871
|
//#region src/functions/getItemByPath.ts
|
|
1550
|
-
function
|
|
1872
|
+
function R(e, n) {
|
|
1551
1873
|
var r;
|
|
1552
|
-
if (!
|
|
1553
|
-
let i =
|
|
1554
|
-
return a && e != null && e[a] &&
|
|
1874
|
+
if (!c(n)) return;
|
|
1875
|
+
let i = Fe(n, ".", 2), a = i[0];
|
|
1876
|
+
return a && e != null && e[a] && t(e[a]) && i != null && i[1] ? R(e[a], i[1]) : (r = c(a) && (e == null ? void 0 : e[a])) == null ? void 0 : r;
|
|
1555
1877
|
}
|
|
1556
1878
|
//#endregion
|
|
1557
1879
|
//#region src/functions/toCamelCase.ts
|
|
1558
|
-
function
|
|
1880
|
+
function z(e) {
|
|
1559
1881
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/-+([a-zA-Z0-9])/g, (...e) => `${String(e[1]).toUpperCase()}`).replace(/^([A-Z])/, (e) => `${e.toLowerCase()}`);
|
|
1560
1882
|
}
|
|
1561
1883
|
//#endregion
|
|
1562
1884
|
//#region src/types/formattersTypes.ts
|
|
1563
|
-
var
|
|
1885
|
+
var B = /* @__PURE__ */ function(e) {
|
|
1564
1886
|
return e.currency = "currency", e.date = "date", e.name = "name", e.number = "number", e.plural = "plural", e.unit = "unit", e;
|
|
1565
|
-
}({}),
|
|
1887
|
+
}({}), Ie = class {
|
|
1566
1888
|
constructor(e, t) {
|
|
1567
1889
|
this.options = e, this.list = t;
|
|
1568
1890
|
}
|
|
@@ -1576,7 +1898,7 @@ var L = /* @__PURE__ */ function(e) {
|
|
|
1576
1898
|
return this.list ? this.isArray() ? this.list.length : 1 : 0;
|
|
1577
1899
|
}
|
|
1578
1900
|
getList() {
|
|
1579
|
-
return this.list ?
|
|
1901
|
+
return this.list ? k(this.list) : [];
|
|
1580
1902
|
}
|
|
1581
1903
|
getOptions() {
|
|
1582
1904
|
return this.options;
|
|
@@ -1585,7 +1907,7 @@ var L = /* @__PURE__ */ function(e) {
|
|
|
1585
1907
|
return this.list = e, this;
|
|
1586
1908
|
}
|
|
1587
1909
|
to() {
|
|
1588
|
-
let e =
|
|
1910
|
+
let e = i(this.getList(), (e) => ({
|
|
1589
1911
|
...e,
|
|
1590
1912
|
...this.getFormatData(e)
|
|
1591
1913
|
}));
|
|
@@ -1593,51 +1915,51 @@ var L = /* @__PURE__ */ function(e) {
|
|
|
1593
1915
|
}
|
|
1594
1916
|
getFormatData(e) {
|
|
1595
1917
|
let t = {};
|
|
1596
|
-
return
|
|
1597
|
-
let i = `${
|
|
1598
|
-
n != null && n.transformation ?
|
|
1918
|
+
return i(this.options, (n, r) => {
|
|
1919
|
+
let i = `${z(r)}Format`, a = R(e, r);
|
|
1920
|
+
n != null && n.transformation ? c(a) ? t[i] = n.transformation(a, e, n.options) : t[i] = "" : t[i] = this.transformation(a, e, n.type, n.options);
|
|
1599
1921
|
}), t;
|
|
1600
1922
|
}
|
|
1601
1923
|
transformation(e, t, n, r) {
|
|
1602
|
-
if (
|
|
1603
|
-
case
|
|
1604
|
-
case
|
|
1605
|
-
case
|
|
1606
|
-
case
|
|
1607
|
-
case
|
|
1608
|
-
case
|
|
1924
|
+
if (c(e) || n === B.name) switch (n) {
|
|
1925
|
+
case B.currency: return this.formatCurrency(e, t, r);
|
|
1926
|
+
case B.date: return this.formatDate(e, r);
|
|
1927
|
+
case B.name: return this.formatName(t, r);
|
|
1928
|
+
case B.number: return this.formatNumber(e, r);
|
|
1929
|
+
case B.plural: return this.formatPlural(e, r);
|
|
1930
|
+
case B.unit: return this.formatUnit(e, r);
|
|
1609
1931
|
default: return String(e);
|
|
1610
1932
|
}
|
|
1611
1933
|
return "";
|
|
1612
1934
|
}
|
|
1613
1935
|
formatCurrency(e, t, n) {
|
|
1614
1936
|
var r;
|
|
1615
|
-
let i = n != null && n.currencyPropName ?
|
|
1616
|
-
return
|
|
1937
|
+
let i = n != null && n.currencyPropName ? R(t, n.currencyPropName) : t == null ? void 0 : t.currency;
|
|
1938
|
+
return F.getInstance().currency(e, (r = n == null ? void 0 : n.options) == null ? i : r, n == null ? void 0 : n.numberOnly);
|
|
1617
1939
|
}
|
|
1618
1940
|
formatDate(e, t) {
|
|
1619
|
-
return
|
|
1941
|
+
return F.getInstance().date(e, t == null ? void 0 : t.type, t == null ? void 0 : t.options, t == null ? void 0 : t.hour24);
|
|
1620
1942
|
}
|
|
1621
1943
|
formatName(e, t) {
|
|
1622
1944
|
var n, r, i;
|
|
1623
|
-
let a =
|
|
1624
|
-
return a && o ?
|
|
1945
|
+
let a = R(e, (n = t == null ? void 0 : t.lastPropName) == null ? "lastName" : n), o = R(e, (r = t == null ? void 0 : t.firstPropName) == null ? "firstName" : r), s = R(e, (i = t == null ? void 0 : t.surname) == null ? "surname" : i);
|
|
1946
|
+
return a && o ? F.getInstance().fullName(a, o, s, t == null ? void 0 : t.short) : "";
|
|
1625
1947
|
}
|
|
1626
1948
|
formatNumber(e, t) {
|
|
1627
|
-
return
|
|
1949
|
+
return F.getInstance().number(e, t == null ? void 0 : t.options);
|
|
1628
1950
|
}
|
|
1629
1951
|
formatPlural(e, t) {
|
|
1630
|
-
return t && t.words ?
|
|
1952
|
+
return t && t.words ? F.getInstance().plural(e, t == null ? void 0 : t.words, t == null ? void 0 : t.options, t == null ? void 0 : t.optionsNumber) : e;
|
|
1631
1953
|
}
|
|
1632
1954
|
formatUnit(e, t) {
|
|
1633
|
-
return t && t.unit ?
|
|
1955
|
+
return t && t.unit ? F.getInstance().unit(e, t.unit) : e;
|
|
1634
1956
|
}
|
|
1635
|
-
},
|
|
1636
|
-
constructor(e =
|
|
1957
|
+
}, Le = "f", Re = class e {
|
|
1958
|
+
constructor(e = E.getLocation()) {
|
|
1637
1959
|
this.code = e;
|
|
1638
1960
|
}
|
|
1639
1961
|
get(t = this.code) {
|
|
1640
|
-
let n =
|
|
1962
|
+
let n = E.find(t);
|
|
1641
1963
|
if (n) {
|
|
1642
1964
|
var r;
|
|
1643
1965
|
let t = this.getCountry(n);
|
|
@@ -1656,10 +1978,10 @@ var L = /* @__PURE__ */ function(e) {
|
|
|
1656
1978
|
return (t = this.get(e)) == null ? void 0 : t.icon;
|
|
1657
1979
|
}
|
|
1658
1980
|
getList(e) {
|
|
1659
|
-
return
|
|
1981
|
+
return i(this.getCodes(e), (e) => this.get(e));
|
|
1660
1982
|
}
|
|
1661
1983
|
getNational(t) {
|
|
1662
|
-
return
|
|
1984
|
+
return i(this.getList(t), (t) => {
|
|
1663
1985
|
let n = new e(t.standard).get(t.standard);
|
|
1664
1986
|
return {
|
|
1665
1987
|
...t,
|
|
@@ -1673,7 +1995,7 @@ var L = /* @__PURE__ */ function(e) {
|
|
|
1673
1995
|
return this.code = e, this;
|
|
1674
1996
|
}
|
|
1675
1997
|
getLocation() {
|
|
1676
|
-
return new
|
|
1998
|
+
return new F(this.code);
|
|
1677
1999
|
}
|
|
1678
2000
|
getCodes(t) {
|
|
1679
2001
|
return t == null ? Object.keys(e.flags) : t;
|
|
@@ -1685,7 +2007,7 @@ var L = /* @__PURE__ */ function(e) {
|
|
|
1685
2007
|
return this.getLocation().countryName(e.country);
|
|
1686
2008
|
}
|
|
1687
2009
|
};
|
|
1688
|
-
|
|
2010
|
+
S(Re, "flags", {
|
|
1689
2011
|
AD: "f-ad",
|
|
1690
2012
|
AE: "f-ae",
|
|
1691
2013
|
AF: "f-af",
|
|
@@ -1930,12 +2252,12 @@ y(Fe, "flags", {
|
|
|
1930
2252
|
});
|
|
1931
2253
|
//#endregion
|
|
1932
2254
|
//#region src/classes/GeoPhone.ts
|
|
1933
|
-
var
|
|
2255
|
+
var V = class {
|
|
1934
2256
|
static get(e) {
|
|
1935
|
-
return this.
|
|
2257
|
+
return this.getList().find((t) => e === t.value);
|
|
1936
2258
|
}
|
|
1937
2259
|
static getByPhone(e) {
|
|
1938
|
-
let t = this.toNumber(e), n = [""], r = this.
|
|
2260
|
+
let t = this.toNumber(e), n = [""], r = this.getMap(), i;
|
|
1939
2261
|
for (let e of t) if (n[n.length - 1] += e, e in r) {
|
|
1940
2262
|
var a, o, s;
|
|
1941
2263
|
(a = r[e]) != null && a.value && (i = r[e], n.push("")), r = (o = (s = r[e]) == null ? void 0 : s.next) == null ? {} : o;
|
|
@@ -1956,13 +2278,15 @@ var R, z = class {
|
|
|
1956
2278
|
}
|
|
1957
2279
|
}
|
|
1958
2280
|
static getList() {
|
|
1959
|
-
|
|
2281
|
+
var e;
|
|
2282
|
+
return this.list || this.makeList(), (e = this.list) == null ? [] : e;
|
|
1960
2283
|
}
|
|
1961
2284
|
static getMap() {
|
|
1962
|
-
|
|
2285
|
+
var e;
|
|
2286
|
+
return this.map || this.makeMap(), (e = this.map) == null ? {} : e;
|
|
1963
2287
|
}
|
|
1964
2288
|
static toMask(e, t) {
|
|
1965
|
-
if (
|
|
2289
|
+
if (c(e) && Array.isArray(t) && t.length > 0) {
|
|
1966
2290
|
let n = this.removeZero(e), r = n.length;
|
|
1967
2291
|
for (let e of t) if (this.getUnnecessaryLength(e) === r) return this.toStandard(n, e);
|
|
1968
2292
|
}
|
|
@@ -1984,17 +2308,17 @@ var R, z = class {
|
|
|
1984
2308
|
return (t = (n = e.match(/\*/g)) == null ? void 0 : n.length) == null ? 0 : t;
|
|
1985
2309
|
}
|
|
1986
2310
|
static makeList() {
|
|
1987
|
-
this.list =
|
|
2311
|
+
this.list = i(E.getList(), (e) => {
|
|
1988
2312
|
if (e != null && e.phoneMask) return {
|
|
1989
2313
|
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/, "")) || void 0,
|
|
1990
2314
|
within: (e == null ? void 0 : e.phoneWithin) || 0,
|
|
1991
|
-
mask:
|
|
2315
|
+
mask: k(e.phoneMask),
|
|
1992
2316
|
value: e.country
|
|
1993
2317
|
};
|
|
1994
2318
|
}).sort((e, t) => e.phone - t.phone);
|
|
1995
2319
|
}
|
|
1996
2320
|
static makeMap() {
|
|
1997
|
-
this.
|
|
2321
|
+
this.map = {}, this.getList().forEach((e) => {
|
|
1998
2322
|
e.mask.forEach((t) => {
|
|
1999
2323
|
let n = this.map, r;
|
|
2000
2324
|
if (this.toNumber(t).forEach((e) => {
|
|
@@ -2026,23 +2350,23 @@ var R, z = class {
|
|
|
2026
2350
|
return e.replace(/\*/, this.getWithinSymbol(t));
|
|
2027
2351
|
}
|
|
2028
2352
|
};
|
|
2029
|
-
|
|
2353
|
+
S(V, "list", void 0), S(V, "map", void 0);
|
|
2030
2354
|
//#endregion
|
|
2031
2355
|
//#region src/classes/Global.ts
|
|
2032
|
-
var
|
|
2356
|
+
var H, ze = class {
|
|
2033
2357
|
static get(e) {
|
|
2034
|
-
return
|
|
2358
|
+
return H && (H == null ? void 0 : H[e]);
|
|
2035
2359
|
}
|
|
2036
2360
|
static add(e) {
|
|
2037
|
-
|
|
2361
|
+
H === void 0 && (H = r(e));
|
|
2038
2362
|
}
|
|
2039
|
-
},
|
|
2363
|
+
}, U, W = class {
|
|
2040
2364
|
static get(e, t) {
|
|
2041
2365
|
return !(e in this.hash) && t && this.set(e, t), this.hash[e];
|
|
2042
2366
|
}
|
|
2043
2367
|
static set(e, t) {
|
|
2044
2368
|
var n;
|
|
2045
|
-
let r =
|
|
2369
|
+
let r = y(t);
|
|
2046
2370
|
r !== ((n = this.hash) == null ? void 0 : n[e]) && (this.hash[e] = r, this.update());
|
|
2047
2371
|
}
|
|
2048
2372
|
static addWatch(e, t) {
|
|
@@ -2064,102 +2388,105 @@ var B, Ie = class {
|
|
|
2064
2388
|
}
|
|
2065
2389
|
static getLocation() {
|
|
2066
2390
|
let e = {};
|
|
2067
|
-
return location.hash.replace(/([\w-]+)[:=]([^;]+)/gi, (...t) => (e[String(t[1])] =
|
|
2391
|
+
return location.hash.replace(/([\w-]+)[:=]([^;]+)/gi, (...t) => (e[String(t[1])] = Ee(t[2]), "")), e;
|
|
2068
2392
|
}
|
|
2069
2393
|
static update() {
|
|
2070
|
-
this.block = !0, history.replaceState(null, "", `#${
|
|
2394
|
+
this.block = !0, history.replaceState(null, "", `#${a(this.hash, "=", ";")}`), requestAnimationFrame(() => {
|
|
2071
2395
|
this.block = !1;
|
|
2072
2396
|
});
|
|
2073
2397
|
}
|
|
2074
2398
|
static makeWatch(e) {
|
|
2075
|
-
|
|
2399
|
+
i(this.watch, (t, n) => {
|
|
2076
2400
|
var r;
|
|
2077
2401
|
((r = this.hash) == null ? void 0 : r[n]) !== (e == null ? void 0 : e[n]) && t.forEach((t) => t(e[n]));
|
|
2078
2402
|
});
|
|
2079
2403
|
}
|
|
2080
2404
|
};
|
|
2081
|
-
|
|
2405
|
+
U = W, S(W, "hash", {}), S(W, "watch", {}), S(W, "block", !1), m() && (U.reload(), addEventListener("hashchange", () => U.reload()));
|
|
2082
2406
|
//#endregion
|
|
2083
2407
|
//#region src/classes/Icons.ts
|
|
2084
|
-
var
|
|
2408
|
+
var Be, Ve = "__UI_ICON", He = 320, Ue = "--LOAD--", G = class {
|
|
2085
2409
|
static is(e) {
|
|
2086
2410
|
return e in this.icons || this.getName(e) in this.icons;
|
|
2087
2411
|
}
|
|
2088
2412
|
static async get(e, t = "", n = 1e3 * 60 * 3) {
|
|
2089
2413
|
var r, i, a, o;
|
|
2090
2414
|
let s = (r = (i = (a = this.icons) == null ? void 0 : a[this.getName(e)]) == null ? (o = this.icons) == null ? void 0 : o[e] : i) == null ? `${e.replace(/^@/, t == null ? this.url : t)}.svg` : r;
|
|
2091
|
-
return typeof s == "string" ? s ===
|
|
2415
|
+
return typeof s == "string" ? s === Ue && n > 0 ? (await this.wait(), this.get(e, t, n - He)) : s : v(s) ? await s() : await s;
|
|
2092
2416
|
}
|
|
2093
2417
|
static getNameList() {
|
|
2094
|
-
return
|
|
2418
|
+
return i(this.icons, (e, t) => t.replace(/^@/, ""));
|
|
2095
2419
|
}
|
|
2096
2420
|
static getUrlGlobal() {
|
|
2097
|
-
return `${
|
|
2421
|
+
return `${N.isLocalhost(), ""}${this.url}`;
|
|
2098
2422
|
}
|
|
2099
2423
|
static add(e, t) {
|
|
2100
2424
|
this.icons[this.getName(e)] = t;
|
|
2101
2425
|
}
|
|
2102
2426
|
static addLoad(e) {
|
|
2103
|
-
this.icons[this.getName(e)] =
|
|
2427
|
+
this.icons[this.getName(e)] = Ue;
|
|
2104
2428
|
}
|
|
2105
2429
|
static addGlobal(e, t) {
|
|
2106
2430
|
this.icons[this.getName(e)] = `${this.getUrlGlobal()}${t}`;
|
|
2107
2431
|
}
|
|
2108
2432
|
static addByList(e) {
|
|
2109
|
-
|
|
2433
|
+
i(e, (e, t) => this.add(t, e));
|
|
2110
2434
|
}
|
|
2111
2435
|
static setUrl(e) {
|
|
2112
2436
|
this.url = e;
|
|
2113
2437
|
}
|
|
2438
|
+
static setConfig(e) {
|
|
2439
|
+
e.url && this.setUrl(e.url), e.list && this.addByList(e.list);
|
|
2440
|
+
}
|
|
2114
2441
|
static getName(e) {
|
|
2115
2442
|
return `@${e}`;
|
|
2116
2443
|
}
|
|
2117
2444
|
static wait() {
|
|
2118
|
-
return new Promise((e) => setTimeout(() => e(),
|
|
2445
|
+
return new Promise((e) => setTimeout(() => e(), He));
|
|
2119
2446
|
}
|
|
2120
2447
|
};
|
|
2121
|
-
|
|
2448
|
+
Be = G, S(G, "icons", {}), S(G, "url", "/icons/"), m() && (Ve in window || (window[Ve] = {}), Be.icons = window[Ve]);
|
|
2122
2449
|
//#endregion
|
|
2123
2450
|
//#region src/functions/getElementItem.ts
|
|
2124
|
-
function
|
|
2451
|
+
function We(e, t, n) {
|
|
2125
2452
|
var r, i;
|
|
2126
|
-
return (r = (i =
|
|
2453
|
+
return (r = (i = D(e)) == null ? void 0 : i[t]) == null ? n : r;
|
|
2127
2454
|
}
|
|
2128
2455
|
//#endregion
|
|
2129
2456
|
//#region src/functions/setElementItem.ts
|
|
2130
|
-
function
|
|
2131
|
-
let a =
|
|
2457
|
+
function Ge(e, n, r) {
|
|
2458
|
+
let a = D(e);
|
|
2132
2459
|
if (a) {
|
|
2133
|
-
let e =
|
|
2134
|
-
if (
|
|
2135
|
-
e[n] =
|
|
2460
|
+
let e = We(a, n);
|
|
2461
|
+
if (t(e) && t(r)) i(r, (t, n) => {
|
|
2462
|
+
e[n] = y(t);
|
|
2136
2463
|
});
|
|
2137
2464
|
else {
|
|
2138
|
-
let e =
|
|
2139
|
-
!(
|
|
2465
|
+
let e = y(r);
|
|
2466
|
+
!(n in a) && typeof e == "string" ? a.setAttribute(n.toString(), e) : a[n] = y(r);
|
|
2140
2467
|
}
|
|
2141
2468
|
}
|
|
2142
2469
|
return a;
|
|
2143
2470
|
}
|
|
2144
2471
|
//#endregion
|
|
2145
2472
|
//#region src/functions/createElement.ts
|
|
2146
|
-
function
|
|
2147
|
-
if (!
|
|
2148
|
-
let
|
|
2149
|
-
return typeof
|
|
2150
|
-
|
|
2151
|
-
}), e == null || e.insertBefore(
|
|
2473
|
+
function K(e, t = "div", r, a) {
|
|
2474
|
+
if (!m()) return;
|
|
2475
|
+
let o = document.createElement(t);
|
|
2476
|
+
return typeof r == "function" ? r(o) : n(r) && i(r, (e, t) => {
|
|
2477
|
+
Ge(o, t, e);
|
|
2478
|
+
}), e == null || e.insertBefore(o, a == null ? null : a), o;
|
|
2152
2479
|
}
|
|
2153
2480
|
//#endregion
|
|
2154
2481
|
//#region src/functions/encodeAttribute.ts
|
|
2155
|
-
function
|
|
2482
|
+
function Ke(e) {
|
|
2156
2483
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").trim();
|
|
2157
2484
|
}
|
|
2158
2485
|
//#endregion
|
|
2159
2486
|
//#region src/classes/MetaManager.ts
|
|
2160
|
-
var
|
|
2487
|
+
var q = class {
|
|
2161
2488
|
constructor(e, t = !1) {
|
|
2162
|
-
|
|
2489
|
+
S(this, "items", {}), this.listMeta = e, this.isProperty = t, this.update();
|
|
2163
2490
|
}
|
|
2164
2491
|
getListMeta() {
|
|
2165
2492
|
return this.listMeta;
|
|
@@ -2172,19 +2499,19 @@ var G = class {
|
|
|
2172
2499
|
return this.items;
|
|
2173
2500
|
}
|
|
2174
2501
|
html() {
|
|
2175
|
-
return
|
|
2502
|
+
return i(this.listMeta, (e) => this.toHtmlString(e)).join("");
|
|
2176
2503
|
}
|
|
2177
2504
|
set(e, t) {
|
|
2178
2505
|
return this.setItem(e, t).setMeta(e), this;
|
|
2179
2506
|
}
|
|
2180
2507
|
setByList(e) {
|
|
2181
|
-
return
|
|
2508
|
+
return i(e, (e, t) => this.set(t, String(e))), this;
|
|
2182
2509
|
}
|
|
2183
2510
|
getAttributeName() {
|
|
2184
2511
|
return this.isProperty ? "property" : "name";
|
|
2185
2512
|
}
|
|
2186
2513
|
findMetaElement(e) {
|
|
2187
|
-
if (!
|
|
2514
|
+
if (!m()) return;
|
|
2188
2515
|
let t = `meta[${this.getAttributeName()}="${e}"]`;
|
|
2189
2516
|
return document.querySelector(t) || void 0;
|
|
2190
2517
|
}
|
|
@@ -2195,15 +2522,15 @@ var G = class {
|
|
|
2195
2522
|
var t;
|
|
2196
2523
|
let n = this.findMetaElement(e), r = (t = this.items[e]) == null ? "" : t;
|
|
2197
2524
|
if (n) n.content = r;
|
|
2198
|
-
else if (
|
|
2525
|
+
else if (m()) {
|
|
2199
2526
|
let t = { content: r };
|
|
2200
|
-
this.isProperty ? t.property = e : t.name = e,
|
|
2527
|
+
this.isProperty ? t.property = e : t.name = e, K(document.head, "meta", t);
|
|
2201
2528
|
}
|
|
2202
2529
|
return this;
|
|
2203
2530
|
}
|
|
2204
2531
|
toHtmlString(e) {
|
|
2205
2532
|
var t;
|
|
2206
|
-
let n =
|
|
2533
|
+
let n = Ke((t = this.items[e]) == null ? "" : t);
|
|
2207
2534
|
return n ? `<meta ${this.getAttributeName()}="${e}" content="${n}">` : "";
|
|
2208
2535
|
}
|
|
2209
2536
|
update() {
|
|
@@ -2212,121 +2539,121 @@ var G = class {
|
|
|
2212
2539
|
this.items[e] = (t = (n = this.findMetaElement(e)) == null ? void 0 : n.content) == null ? "" : t;
|
|
2213
2540
|
}), this;
|
|
2214
2541
|
}
|
|
2215
|
-
},
|
|
2542
|
+
}, J = /* @__PURE__ */ function(e) {
|
|
2216
2543
|
return e.description = "description", e.keywords = "keywords", e.canonical = "canonical", e.robots = "robots", e.author = "author", e;
|
|
2217
|
-
}({}),
|
|
2544
|
+
}({}), qe = /* @__PURE__ */ function(e) {
|
|
2218
2545
|
return e.indexFollow = "index, follow", e.noIndexFollow = "noindex, follow", e.indexNoFollow = "index, nofollow", e.noIndexNoFollow = "noindex, nofollow", e.noArchive = "noarchive", e.noSnippet = "nosnippet", e.noImageIndex = "noimageindex", e.images = "images", e.noTranslate = "notranslate", e.noPreview = "nopreview", e.textOnly = "textonly", e.noIndexSubpages = "noindex, noarchive", e.none = "none", e;
|
|
2219
|
-
}({}),
|
|
2546
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
2220
2547
|
return e.title = "og:title", e.type = "og:type", e.url = "og:url", e.image = "og:image", e.description = "og:description", e.locale = "og:locale", e.siteName = "og:site_name", e.localeAlternate = "og:locale:alternate", e.imageUrl = "og:image:url", e.imageSecureUrl = "og:image:secure_url", e.imageType = "og:image:type", e.imageWidth = "og:image:width", e.imageHeight = "og:image:height", e.imageAlt = "og:image:alt", e.video = "og:video", e.videoUrl = "og:video:url", e.videoSecureUrl = "og:video:secure_url", e.videoType = "og:video:type", e.videoWidth = "og:video:width", e.videoHeight = "og:video:height", e.audio = "og:audio", e.audioSecureUrl = "og:audio:secure_url", e.audioType = "og:audio:type", e.articlePublishedTime = "article:published_time", e.articleModifiedTime = "article:modified_time", e.articleExpirationTime = "article:expiration_time", e.articleAuthor = "article:author", e.articleSection = "article:section", e.articleTag = "article:tag", e.bookAuthor = "book:author", e.bookIsbn = "book:isbn", e.bookReleaseDate = "book:release_date", e.bookTag = "book:tag", e.musicDuration = "music:duration", e.musicAlbum = "music:album", e.musicAlbumDisc = "music:album:disc", e.musicAlbumTrack = "music:album:track", e.musicMusician = "music:musician", e.musicSong = "music:song", e.musicSongDisc = "music:song:disc", e.musicSongTrack = "music:song:track", e.musicReleaseDate = "music:release_date", e.musicCreator = "music:creator", e.videoActor = "video:actor", e.videoActorRole = "video:actor:role", e.videoDirector = "video:director", e.videoWriter = "video:writer", e.videoDuration = "video:duration", e.videoReleaseDate = "video:release_date", e.videoTag = "video:tag", e.videoSeries = "video:series", e.profileFirstName = "profile:first_name", e.profileLastName = "profile:last_name", e.profileUsername = "profile:username", e.profileGender = "profile:gender", e.productBrand = "product:brand", e.productAvailability = "product:availability", e.productCondition = "product:condition", e.productPriceAmount = "product:price:amount", e.productPriceCurrency = "product:price:currency", e.productRetailerItemId = "product:retailer_item_id", e.productCategory = "product:category", e.productEan = "product:ean", e.productIsbn = "product:isbn", e.productMfrPartNo = "product:mfr_part_no", e.productUpc = "product:upc", e.productWeightValue = "product:weight:value", e.productWeightUnits = "product:weight:units", e.productColor = "product:color", e.productMaterial = "product:material", e.productPattern = "product:pattern", e.productAgeGroup = "product:age_group", e.productGender = "product:gender", e;
|
|
2221
|
-
}({}),
|
|
2548
|
+
}({}), Je = /* @__PURE__ */ function(e) {
|
|
2222
2549
|
return e.website = "website", e.article = "article", e.video = "video.other", e.videoTvShow = "video.tv_show", e.videoEpisode = "video.episode", e.videoMovie = "video.movie", e.musicAlbum = "music.album", e.musicPlaylist = "music.playlist", e.musicSong = "music.song", e.musicRadioStation = "music.radio_station", e.app = "app", e.product = "product", e.business = "business.business", e.place = "place", e.event = "event", e.profile = "profile", e.book = "book", e;
|
|
2223
|
-
}({}),
|
|
2550
|
+
}({}), Ye = /* @__PURE__ */ function(e) {
|
|
2224
2551
|
return e.inStock = "in stock", e.outOfStock = "out of stock", e.preorder = "preorder", e.backorder = "backorder", e.discontinued = "discontinued", e.pending = "pending", e;
|
|
2225
|
-
}({}),
|
|
2552
|
+
}({}), Xe = /* @__PURE__ */ function(e) {
|
|
2226
2553
|
return e.new = "new", e.used = "used", e.refurbished = "refurbished", e;
|
|
2227
|
-
}({}),
|
|
2554
|
+
}({}), Ze = /* @__PURE__ */ function(e) {
|
|
2228
2555
|
return e.newborn = "newborn", e.infant = "infant", e.toddler = "toddler", e.kids = "kids", e.adult = "adult", e;
|
|
2229
|
-
}({}),
|
|
2556
|
+
}({}), Qe = /* @__PURE__ */ function(e) {
|
|
2230
2557
|
return e.female = "female", e.male = "male", e.unisex = "unisex", e;
|
|
2231
|
-
}({}),
|
|
2558
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
2232
2559
|
return e.card = "twitter:card", e.site = "twitter:site", e.creator = "twitter:creator", e.url = "twitter:url", e.title = "twitter:title", e.description = "twitter:description", e.image = "twitter:image", e.imageAlt = "twitter:image:alt", e.imageSrc = "twitter:image:src", e.imageWidth = "twitter:image:width", e.imageHeight = "twitter:image:height", e.label1 = "twitter:label1", e.data1 = "twitter:data1", e.label2 = "twitter:label2", e.data2 = "twitter:data2", e.appNameIphone = "twitter:app:name:iphone", e.appIdIphone = "twitter:app:id:iphone", e.appUrlIphone = "twitter:app:url:iphone", e.appNameIpad = "twitter:app:name:ipad", e.appIdIpad = "twitter:app:id:ipad", e.appUrlIpad = "twitter:app:url:ipad", e.appNameGooglePlay = "twitter:app:name:googleplay", e.appIdGooglePlay = "twitter:app:id:googleplay", e.appUrlGooglePlay = "twitter:app:url:googleplay", e.player = "twitter:player", e.playerWidth = "twitter:player:width", e.playerHeight = "twitter:player:height", e.playerStream = "twitter:player:stream", e.playerStreamContentType = "twitter:player:stream:content_type", e;
|
|
2233
|
-
}({}),
|
|
2560
|
+
}({}), $e = /* @__PURE__ */ function(e) {
|
|
2234
2561
|
return e.summary = "summary", e.summaryLargeImage = "summary_large_image", e.app = "app", e.player = "player", e.product = "product", e.gallery = "gallery", e.photo = "photo", e.leadGeneration = "lead_generation", e.audio = "audio", e.poll = "poll", e;
|
|
2235
|
-
}({}),
|
|
2562
|
+
}({}), et = class extends q {
|
|
2236
2563
|
constructor() {
|
|
2237
|
-
super(Object.values(
|
|
2564
|
+
super(Object.values(Y), !0);
|
|
2238
2565
|
}
|
|
2239
2566
|
getTitle() {
|
|
2240
|
-
return this.get(
|
|
2567
|
+
return this.get(Y.title);
|
|
2241
2568
|
}
|
|
2242
2569
|
getType() {
|
|
2243
|
-
return this.get(
|
|
2570
|
+
return this.get(Y.type);
|
|
2244
2571
|
}
|
|
2245
2572
|
getUrl() {
|
|
2246
|
-
return this.get(
|
|
2573
|
+
return this.get(Y.url);
|
|
2247
2574
|
}
|
|
2248
2575
|
getImage() {
|
|
2249
|
-
return this.get(
|
|
2576
|
+
return this.get(Y.image);
|
|
2250
2577
|
}
|
|
2251
2578
|
getDescription() {
|
|
2252
|
-
return this.get(
|
|
2579
|
+
return this.get(Y.description);
|
|
2253
2580
|
}
|
|
2254
2581
|
getLocale() {
|
|
2255
|
-
return this.get(
|
|
2582
|
+
return this.get(Y.locale);
|
|
2256
2583
|
}
|
|
2257
2584
|
getSiteName() {
|
|
2258
|
-
return this.get(
|
|
2585
|
+
return this.get(Y.siteName);
|
|
2259
2586
|
}
|
|
2260
2587
|
setTitle(e) {
|
|
2261
|
-
return this.set(
|
|
2588
|
+
return this.set(Y.title, e);
|
|
2262
2589
|
}
|
|
2263
2590
|
setType(e) {
|
|
2264
|
-
return this.set(
|
|
2591
|
+
return this.set(Y.type, e);
|
|
2265
2592
|
}
|
|
2266
2593
|
setUrl(e) {
|
|
2267
|
-
return this.set(
|
|
2594
|
+
return this.set(Y.url, e);
|
|
2268
2595
|
}
|
|
2269
2596
|
setImage(e) {
|
|
2270
|
-
return this.set(
|
|
2597
|
+
return this.set(Y.image, e);
|
|
2271
2598
|
}
|
|
2272
2599
|
setDescription(e) {
|
|
2273
|
-
return this.set(
|
|
2600
|
+
return this.set(Y.description, e);
|
|
2274
2601
|
}
|
|
2275
2602
|
setLocale(e) {
|
|
2276
|
-
return this.set(
|
|
2603
|
+
return this.set(Y.locale, e);
|
|
2277
2604
|
}
|
|
2278
2605
|
setSiteName(e) {
|
|
2279
|
-
return this.set(
|
|
2606
|
+
return this.set(Y.siteName, e);
|
|
2280
2607
|
}
|
|
2281
|
-
},
|
|
2608
|
+
}, tt = class extends q {
|
|
2282
2609
|
constructor() {
|
|
2283
|
-
super(Object.values(
|
|
2610
|
+
super(Object.values(X));
|
|
2284
2611
|
}
|
|
2285
2612
|
getCard() {
|
|
2286
|
-
return this.get(
|
|
2613
|
+
return this.get(X.card);
|
|
2287
2614
|
}
|
|
2288
2615
|
getSite() {
|
|
2289
|
-
return this.get(
|
|
2616
|
+
return this.get(X.site);
|
|
2290
2617
|
}
|
|
2291
2618
|
getCreator() {
|
|
2292
|
-
return this.get(
|
|
2619
|
+
return this.get(X.creator);
|
|
2293
2620
|
}
|
|
2294
2621
|
getUrl() {
|
|
2295
|
-
return this.get(
|
|
2622
|
+
return this.get(X.url);
|
|
2296
2623
|
}
|
|
2297
2624
|
getTitle() {
|
|
2298
|
-
return this.get(
|
|
2625
|
+
return this.get(X.title);
|
|
2299
2626
|
}
|
|
2300
2627
|
getDescription() {
|
|
2301
|
-
return this.get(
|
|
2628
|
+
return this.get(X.description);
|
|
2302
2629
|
}
|
|
2303
2630
|
getImage() {
|
|
2304
|
-
return this.get(
|
|
2631
|
+
return this.get(X.image);
|
|
2305
2632
|
}
|
|
2306
2633
|
setCard(e) {
|
|
2307
|
-
return this.set(
|
|
2634
|
+
return this.set(X.card, e), this;
|
|
2308
2635
|
}
|
|
2309
2636
|
setSite(e) {
|
|
2310
|
-
return this.set(
|
|
2637
|
+
return this.set(X.site, e), this;
|
|
2311
2638
|
}
|
|
2312
2639
|
setCreator(e) {
|
|
2313
|
-
return this.set(
|
|
2640
|
+
return this.set(X.creator, e), this;
|
|
2314
2641
|
}
|
|
2315
2642
|
setUrl(e) {
|
|
2316
|
-
return this.set(
|
|
2643
|
+
return this.set(X.url, e), this;
|
|
2317
2644
|
}
|
|
2318
2645
|
setTitle(e) {
|
|
2319
|
-
return this.set(
|
|
2646
|
+
return this.set(X.title, e), this;
|
|
2320
2647
|
}
|
|
2321
2648
|
setDescription(e) {
|
|
2322
|
-
return this.set(
|
|
2649
|
+
return this.set(X.description, e), this;
|
|
2323
2650
|
}
|
|
2324
2651
|
setImage(e) {
|
|
2325
|
-
return this.set(
|
|
2652
|
+
return this.set(X.image, e), this;
|
|
2326
2653
|
}
|
|
2327
|
-
},
|
|
2654
|
+
}, nt = class extends q {
|
|
2328
2655
|
constructor() {
|
|
2329
|
-
super(Object.values(
|
|
2656
|
+
super(Object.values(J)), S(this, "suffix", void 0), S(this, "og", void 0), S(this, "twitter", void 0), this.og = new et(), this.twitter = new tt();
|
|
2330
2657
|
}
|
|
2331
2658
|
getOg() {
|
|
2332
2659
|
return this.og;
|
|
@@ -2335,25 +2662,25 @@ var G = class {
|
|
|
2335
2662
|
return this.twitter;
|
|
2336
2663
|
}
|
|
2337
2664
|
getTitle() {
|
|
2338
|
-
return
|
|
2665
|
+
return m() ? document.title.replace(this.getSuffix(), "").trim() : "";
|
|
2339
2666
|
}
|
|
2340
2667
|
getKeywords() {
|
|
2341
|
-
return this.get(
|
|
2668
|
+
return this.get(J.keywords);
|
|
2342
2669
|
}
|
|
2343
2670
|
getDescription() {
|
|
2344
|
-
return this.get(
|
|
2671
|
+
return this.get(J.description);
|
|
2345
2672
|
}
|
|
2346
2673
|
getImage() {
|
|
2347
2674
|
return this.og.getImage();
|
|
2348
2675
|
}
|
|
2349
2676
|
getCanonical() {
|
|
2350
|
-
return this.get(
|
|
2677
|
+
return this.get(J.canonical);
|
|
2351
2678
|
}
|
|
2352
2679
|
getRobots() {
|
|
2353
|
-
return this.get(
|
|
2680
|
+
return this.get(J.robots);
|
|
2354
2681
|
}
|
|
2355
2682
|
getAuthor() {
|
|
2356
|
-
return this.get(
|
|
2683
|
+
return this.get(J.author);
|
|
2357
2684
|
}
|
|
2358
2685
|
getSiteName() {
|
|
2359
2686
|
return this.og.getSiteName();
|
|
@@ -2362,29 +2689,29 @@ var G = class {
|
|
|
2362
2689
|
return this.og.getLocale();
|
|
2363
2690
|
}
|
|
2364
2691
|
setTitle(e) {
|
|
2365
|
-
if (
|
|
2366
|
-
let t =
|
|
2692
|
+
if (m()) {
|
|
2693
|
+
let t = c(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
|
|
2367
2694
|
document.title = t, this.og.setTitle(t), this.twitter.setTitle(t);
|
|
2368
2695
|
}
|
|
2369
2696
|
return this;
|
|
2370
2697
|
}
|
|
2371
2698
|
setKeywords(e) {
|
|
2372
|
-
return this.set(
|
|
2699
|
+
return this.set(J.keywords, k(e).join(", ")), this;
|
|
2373
2700
|
}
|
|
2374
2701
|
setDescription(e) {
|
|
2375
|
-
return this.set(
|
|
2702
|
+
return this.set(J.description, e), this;
|
|
2376
2703
|
}
|
|
2377
2704
|
setImage(e) {
|
|
2378
2705
|
return this.og.setImage(e), this.twitter.setImage(e), this;
|
|
2379
2706
|
}
|
|
2380
2707
|
setCanonical(e) {
|
|
2381
|
-
return this.set(
|
|
2708
|
+
return this.set(J.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
|
|
2382
2709
|
}
|
|
2383
2710
|
setRobots(e) {
|
|
2384
|
-
return this.set(
|
|
2711
|
+
return this.set(J.robots, e), this;
|
|
2385
2712
|
}
|
|
2386
2713
|
setAuthor(e) {
|
|
2387
|
-
return this.set(
|
|
2714
|
+
return this.set(J.author, e), this;
|
|
2388
2715
|
}
|
|
2389
2716
|
setSiteName(e) {
|
|
2390
2717
|
return this.og.setSiteName(e), this.twitter.setSite(e), this;
|
|
@@ -2399,9 +2726,9 @@ var G = class {
|
|
|
2399
2726
|
return `${super.html()}${this.og.html()}${this.twitter.html()}`;
|
|
2400
2727
|
}
|
|
2401
2728
|
getSuffix() {
|
|
2402
|
-
return
|
|
2729
|
+
return c(this.suffix) ? ` - ${this.suffix}` : "";
|
|
2403
2730
|
}
|
|
2404
|
-
},
|
|
2731
|
+
}, Z = class {
|
|
2405
2732
|
static async is() {
|
|
2406
2733
|
let e = await this.get();
|
|
2407
2734
|
return e !== -1 && e <= 8;
|
|
@@ -2422,8 +2749,8 @@ var G = class {
|
|
|
2422
2749
|
return this.calculate;
|
|
2423
2750
|
}
|
|
2424
2751
|
static createElement() {
|
|
2425
|
-
return
|
|
2426
|
-
e.style.height = "24px", e.style.overflowY = "scroll", e.style.position = "fixed", e.style.width = "100%",
|
|
2752
|
+
return K(document.body, "div", (e) => {
|
|
2753
|
+
e.style.height = "24px", e.style.overflowY = "scroll", e.style.position = "fixed", e.style.width = "100%", K(e, "div", (e) => {
|
|
2427
2754
|
e.style.height = "100px";
|
|
2428
2755
|
});
|
|
2429
2756
|
});
|
|
@@ -2438,28 +2765,28 @@ var G = class {
|
|
|
2438
2765
|
});
|
|
2439
2766
|
}
|
|
2440
2767
|
};
|
|
2441
|
-
|
|
2768
|
+
S(Z, "storage", new w("scrollbar", !0)), S(Z, "calculate", !1);
|
|
2442
2769
|
//#endregion
|
|
2443
2770
|
//#region src/functions/escapeExp.ts
|
|
2444
|
-
function
|
|
2771
|
+
function Q(e) {
|
|
2445
2772
|
return e.replace(/([[\]\\^$.?*+(){}/|])/g, "\\$1");
|
|
2446
2773
|
}
|
|
2447
2774
|
//#endregion
|
|
2448
2775
|
//#region src/functions/getSeparatingSearchExp.ts
|
|
2449
|
-
function
|
|
2450
|
-
let t =
|
|
2776
|
+
function rt(e) {
|
|
2777
|
+
let t = i(e.split(" "), (e) => Q(e)).join("|");
|
|
2451
2778
|
return RegExp(`(${t})`, "ig");
|
|
2452
2779
|
}
|
|
2453
2780
|
//#endregion
|
|
2454
2781
|
//#region src/functions/addTagHighlightMatch.ts
|
|
2455
|
-
function
|
|
2456
|
-
return t ? String(e).replace(
|
|
2782
|
+
function it(e, t, n = "sys-highlight-match") {
|
|
2783
|
+
return t ? String(e).replace(rt(t), `<span class="${n}">$1</span>`) : e;
|
|
2457
2784
|
}
|
|
2458
2785
|
//#endregion
|
|
2459
2786
|
//#region src/classes/SearchListData.ts
|
|
2460
|
-
var
|
|
2787
|
+
var at = class {
|
|
2461
2788
|
constructor(e, t, n, r) {
|
|
2462
|
-
|
|
2789
|
+
S(this, "listCache", void 0), this.list = e, this.columns = t, this.item = n, this.options = r;
|
|
2463
2790
|
}
|
|
2464
2791
|
is() {
|
|
2465
2792
|
return !!(this.list && this.columns);
|
|
@@ -2496,8 +2823,8 @@ var nt = class {
|
|
|
2496
2823
|
toFormatItem(e, t) {
|
|
2497
2824
|
let n = {};
|
|
2498
2825
|
return this.columns && this.columns.forEach((r) => {
|
|
2499
|
-
let i = this.getColumnName(r), a =
|
|
2500
|
-
n[i] =
|
|
2826
|
+
let i = this.getColumnName(r), a = R(e, r);
|
|
2827
|
+
n[i] = c(a) && t ? this.addTag(a) : L(a);
|
|
2501
2828
|
}), {
|
|
2502
2829
|
...e,
|
|
2503
2830
|
...n,
|
|
@@ -2508,7 +2835,7 @@ var nt = class {
|
|
|
2508
2835
|
return e.replace(/\.([a-z0-9])/gi, (e, t) => t.toUpperCase()) + "Search";
|
|
2509
2836
|
}
|
|
2510
2837
|
addTag(e) {
|
|
2511
|
-
return
|
|
2838
|
+
return it(L(e), this.item.get(), this.options.getClassName());
|
|
2512
2839
|
}
|
|
2513
2840
|
generateCache() {
|
|
2514
2841
|
if (!this.isList()) return [];
|
|
@@ -2516,8 +2843,8 @@ var nt = class {
|
|
|
2516
2843
|
for (let t of this.list) {
|
|
2517
2844
|
let n = "";
|
|
2518
2845
|
if (this.columns) for (let e of this.columns) {
|
|
2519
|
-
let r =
|
|
2520
|
-
|
|
2846
|
+
let r = R(t, e);
|
|
2847
|
+
c(r) && (n += ` ${L(r)}`);
|
|
2521
2848
|
}
|
|
2522
2849
|
e.push({
|
|
2523
2850
|
item: t,
|
|
@@ -2532,7 +2859,7 @@ var nt = class {
|
|
|
2532
2859
|
resetCache() {
|
|
2533
2860
|
this.listCache = void 0;
|
|
2534
2861
|
}
|
|
2535
|
-
},
|
|
2862
|
+
}, ot = class {
|
|
2536
2863
|
constructor(e, t) {
|
|
2537
2864
|
this.value = e, this.options = t;
|
|
2538
2865
|
}
|
|
@@ -2552,29 +2879,29 @@ var nt = class {
|
|
|
2552
2879
|
};
|
|
2553
2880
|
//#endregion
|
|
2554
2881
|
//#region src/functions/getExp.ts
|
|
2555
|
-
function
|
|
2556
|
-
let r =
|
|
2882
|
+
function st(e, t = "ig", n = ":value") {
|
|
2883
|
+
let r = Q(e);
|
|
2557
2884
|
return new RegExp(n.replace(/:value/g, r), t);
|
|
2558
2885
|
}
|
|
2559
2886
|
//#endregion
|
|
2560
2887
|
//#region src/functions/getExactSearchExp.ts
|
|
2561
|
-
function
|
|
2562
|
-
return
|
|
2888
|
+
function ct(e) {
|
|
2889
|
+
return st(e, "i", "(:value)");
|
|
2563
2890
|
}
|
|
2564
2891
|
//#endregion
|
|
2565
2892
|
//#region src/functions/getSearchExp.ts
|
|
2566
|
-
function
|
|
2893
|
+
function lt(e) {
|
|
2567
2894
|
let t = "";
|
|
2568
2895
|
return e.split(" ").forEach((e) => {
|
|
2569
|
-
let n =
|
|
2570
|
-
|
|
2896
|
+
let n = Q(e).trim();
|
|
2897
|
+
c(n) && (t += `(?=.*?${n})`);
|
|
2571
2898
|
}), RegExp(`^${t}`, "ig");
|
|
2572
2899
|
}
|
|
2573
2900
|
//#endregion
|
|
2574
2901
|
//#region src/classes/SearchListMatcher.ts
|
|
2575
|
-
var
|
|
2902
|
+
var ut = class {
|
|
2576
2903
|
constructor(e, t) {
|
|
2577
|
-
|
|
2904
|
+
S(this, "matcher", void 0), this.item = e, this.options = t, this.initMatcher();
|
|
2578
2905
|
}
|
|
2579
2906
|
is() {
|
|
2580
2907
|
return !!this.matcher;
|
|
@@ -2589,9 +2916,9 @@ var st = class {
|
|
|
2589
2916
|
this.initMatcher();
|
|
2590
2917
|
}
|
|
2591
2918
|
initMatcher() {
|
|
2592
|
-
this.item.is() ? this.matcher = this.options.getFindExactMatch() ?
|
|
2919
|
+
this.item.is() ? this.matcher = this.options.getFindExactMatch() ? ct(this.item.get()) : lt(this.item.get()) : this.matcher = void 0;
|
|
2593
2920
|
}
|
|
2594
|
-
},
|
|
2921
|
+
}, dt = class {
|
|
2595
2922
|
constructor(e) {
|
|
2596
2923
|
this.options = e;
|
|
2597
2924
|
}
|
|
@@ -2621,12 +2948,12 @@ var st = class {
|
|
|
2621
2948
|
setOptions(e) {
|
|
2622
2949
|
return this.options = e, this;
|
|
2623
2950
|
}
|
|
2624
|
-
},
|
|
2951
|
+
}, ft = class {
|
|
2625
2952
|
constructor(e, t, n, r) {
|
|
2626
|
-
|
|
2953
|
+
S(this, "options", void 0), S(this, "item", void 0), S(this, "matcher", void 0), S(this, "data", void 0), S(this, "callbackToSelection", (e, t) => {
|
|
2627
2954
|
if (this.matcher.isSelection(t)) return this.data.toFormatItem(e, !0);
|
|
2628
2955
|
if (this.options.getReturnEverything()) return this.data.toFormatItem(e, !1);
|
|
2629
|
-
}),
|
|
2956
|
+
}), S(this, "callbackToNone", (e) => this.data.toFormatItem(e, !1)), this.options = new dt(r), this.item = new ot(n, this.options), this.matcher = new ut(this.item, this.options), this.data = new at(e, t, this.item, this.options);
|
|
2630
2957
|
}
|
|
2631
2958
|
getData() {
|
|
2632
2959
|
return this.data;
|
|
@@ -2661,9 +2988,9 @@ var st = class {
|
|
|
2661
2988
|
to() {
|
|
2662
2989
|
if (this.item.isSearch()) return this.data.forEach(this.callbackToSelection);
|
|
2663
2990
|
let e = this.data.getList();
|
|
2664
|
-
return e ?
|
|
2991
|
+
return e ? i(e, this.callbackToNone) : [];
|
|
2665
2992
|
}
|
|
2666
|
-
},
|
|
2993
|
+
}, pt = [
|
|
2667
2994
|
"d",
|
|
2668
2995
|
"e",
|
|
2669
2996
|
"f",
|
|
@@ -2683,62 +3010,72 @@ var st = class {
|
|
|
2683
3010
|
"t",
|
|
2684
3011
|
"u",
|
|
2685
3012
|
"v"
|
|
2686
|
-
],
|
|
2687
|
-
let
|
|
3013
|
+
], mt = (e, t = {}) => {
|
|
3014
|
+
let r = String(e);
|
|
2688
3015
|
if (e.match(/%[a-z]/)) {
|
|
2689
3016
|
let e = 0;
|
|
2690
|
-
|
|
2691
|
-
|
|
3017
|
+
i(t, (t) => {
|
|
3018
|
+
r = r.replace(RegExp(`%${pt[e++]}`, "g"), String(t));
|
|
2692
3019
|
});
|
|
2693
3020
|
}
|
|
2694
|
-
return
|
|
2695
|
-
|
|
2696
|
-
}),
|
|
2697
|
-
},
|
|
2698
|
-
|
|
3021
|
+
return n(t) && i(t, (e, t) => {
|
|
3022
|
+
r = r.replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})(.*?)(?:\\[|\\{)\\/${t}(?:\\]|\\})`, "g"), (t, n) => String(e).replace(/(?:\[|\{)content(?:\]|\})/g, n)).replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})`, "g"), String(e));
|
|
3023
|
+
}), r;
|
|
3024
|
+
}, ht = "global", gt = 160, _t = class {
|
|
3025
|
+
constructor(e, t = () => E.getLanguage(), n = () => E.getLocation()) {
|
|
3026
|
+
S(this, "files", {}), S(this, "data", {}), this.language = t, this.location = n, e && this.add(e);
|
|
3027
|
+
}
|
|
3028
|
+
isFile() {
|
|
2699
3029
|
return Object.keys(this.files).length > 0 && this.getIndex() !== void 0;
|
|
2700
3030
|
}
|
|
2701
|
-
|
|
3031
|
+
getLocation() {
|
|
3032
|
+
return y(this.location);
|
|
3033
|
+
}
|
|
3034
|
+
getLanguage() {
|
|
3035
|
+
return y(this.language);
|
|
3036
|
+
}
|
|
3037
|
+
async getList() {
|
|
2702
3038
|
let e = this.getIndex();
|
|
2703
3039
|
if (e) {
|
|
2704
3040
|
var t;
|
|
2705
3041
|
return (t = this.getByData(e)) == null ? await this.getByFile(e) : t;
|
|
2706
3042
|
}
|
|
2707
3043
|
}
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
3044
|
+
add(e) {
|
|
3045
|
+
i(e, (e, t) => {
|
|
3046
|
+
v(e) && (this.files[t] = e);
|
|
2711
3047
|
});
|
|
2712
3048
|
}
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
if (
|
|
2716
|
-
|
|
3049
|
+
getIndex() {
|
|
3050
|
+
let e = this.getLocation();
|
|
3051
|
+
if (e in this.files) return e;
|
|
3052
|
+
let t = this.getLanguage();
|
|
3053
|
+
if (t in this.files) return t;
|
|
3054
|
+
if ("global" in this.files) return ht;
|
|
2717
3055
|
}
|
|
2718
|
-
|
|
3056
|
+
getByData(e) {
|
|
2719
3057
|
if (e in this.data) return this.data[e];
|
|
2720
3058
|
}
|
|
2721
|
-
|
|
3059
|
+
async getByFile(e) {
|
|
2722
3060
|
if (e in this.files) {
|
|
2723
|
-
let t = await
|
|
3061
|
+
let t = await y(this.files[e]);
|
|
2724
3062
|
return t && (this.data[e] = t), t;
|
|
2725
3063
|
}
|
|
2726
3064
|
}
|
|
2727
|
-
}
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
static async get(e, t) {
|
|
3065
|
+
}, vt = class {
|
|
3066
|
+
constructor(e = "/api/translate", t = "list", n = new _t()) {
|
|
3067
|
+
S(this, "data", {}), S(this, "cache", []), S(this, "resolveList", []), S(this, "timeout", void 0), S(this, "isReadApi", !0), this.url = e, this.propsName = t, this.files = n;
|
|
3068
|
+
}
|
|
3069
|
+
async get(e, t) {
|
|
2733
3070
|
var n;
|
|
2734
3071
|
let r = this.getText(e);
|
|
2735
|
-
return r ? this.replacement(r, t) : (
|
|
3072
|
+
return r ? this.replacement(r, t) : (N.isLocalhost() || await this.add(e), this.replacement((n = this.getText(e)) == null ? e : n));
|
|
2736
3073
|
}
|
|
2737
|
-
|
|
3074
|
+
getSync(e, t = !1, n) {
|
|
2738
3075
|
let r = this.getText(e);
|
|
2739
3076
|
return r ? this.replacement(r, n) : t ? " " : e;
|
|
2740
3077
|
}
|
|
2741
|
-
|
|
3078
|
+
getList(e) {
|
|
2742
3079
|
return new Promise((t) => {
|
|
2743
3080
|
let n = {}, r = 0;
|
|
2744
3081
|
for (let i of e) {
|
|
@@ -2749,7 +3086,7 @@ var Q = class e {
|
|
|
2749
3086
|
}
|
|
2750
3087
|
});
|
|
2751
3088
|
}
|
|
2752
|
-
|
|
3089
|
+
getListSync(e, t = !1) {
|
|
2753
3090
|
let n = {};
|
|
2754
3091
|
for (let r of e) {
|
|
2755
3092
|
let e = Array.isArray(r) ? r[0] : r, i = Array.isArray(r) ? r.slice(1) : void 0;
|
|
@@ -2757,49 +3094,50 @@ var Q = class e {
|
|
|
2757
3094
|
}
|
|
2758
3095
|
return n;
|
|
2759
3096
|
}
|
|
2760
|
-
|
|
3097
|
+
add(e) {
|
|
2761
3098
|
return new Promise((t) => {
|
|
2762
|
-
|
|
3099
|
+
let n = this.getNamesNone(e);
|
|
3100
|
+
n.length > 0 ? (this.cache.push(...n), this.resolveList.push(t), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(() => {
|
|
2763
3101
|
this.timeout = void 0, this.make().then(() => {
|
|
2764
3102
|
this.resolveList.forEach((e) => e()), this.resolveList = [];
|
|
2765
3103
|
});
|
|
2766
3104
|
}, 160)) : t();
|
|
2767
3105
|
});
|
|
2768
3106
|
}
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
3107
|
+
addSync(e) {
|
|
3108
|
+
i(e, (e, t) => {
|
|
3109
|
+
u(e) && c(e) && (this.data[this.getName(t)] = e);
|
|
2772
3110
|
});
|
|
2773
3111
|
}
|
|
2774
|
-
|
|
2775
|
-
if (
|
|
3112
|
+
async addNormalOrSync(e) {
|
|
3113
|
+
if (c(e)) if (N.isLocalhost()) this.addSync(e);
|
|
2776
3114
|
else {
|
|
2777
3115
|
let t = Object.keys(e);
|
|
2778
3116
|
t.length > 0 && await this.add(t);
|
|
2779
3117
|
}
|
|
2780
3118
|
}
|
|
2781
|
-
|
|
2782
|
-
|
|
3119
|
+
addSyncByLocation(e) {
|
|
3120
|
+
i(e, (e, t) => i(e, (e, n) => {
|
|
2783
3121
|
let r = `${t}-${n}`;
|
|
2784
3122
|
r in this.data || (this.data[r] = e);
|
|
2785
3123
|
}));
|
|
2786
3124
|
}
|
|
2787
|
-
|
|
2788
|
-
|
|
3125
|
+
addSyncByFile(e) {
|
|
3126
|
+
this.files.add(e);
|
|
2789
3127
|
}
|
|
2790
|
-
|
|
2791
|
-
return this.url =
|
|
3128
|
+
setUrl(e) {
|
|
3129
|
+
return this.url = e, this;
|
|
2792
3130
|
}
|
|
2793
|
-
|
|
3131
|
+
setPropsName(e) {
|
|
2794
3132
|
return this.propsName = e, this;
|
|
2795
3133
|
}
|
|
2796
|
-
|
|
3134
|
+
setReadApi(e) {
|
|
2797
3135
|
return this.isReadApi = e, this;
|
|
2798
3136
|
}
|
|
2799
|
-
|
|
3137
|
+
hasName(e) {
|
|
2800
3138
|
return this.getName(e) in this.data || this.getNameByLanguage(e) in this.data || this.getNameByGlobal(e) in this.data;
|
|
2801
3139
|
}
|
|
2802
|
-
|
|
3140
|
+
getText(e) {
|
|
2803
3141
|
let t = this.getName(e);
|
|
2804
3142
|
if (t in this.data) return this.data[t];
|
|
2805
3143
|
let n = this.getNameByLanguage(e);
|
|
@@ -2807,23 +3145,23 @@ var Q = class e {
|
|
|
2807
3145
|
let r = this.getNameByGlobal(e);
|
|
2808
3146
|
if (r in this.data) return this.data[r];
|
|
2809
3147
|
}
|
|
2810
|
-
|
|
2811
|
-
return `${
|
|
3148
|
+
getName(e) {
|
|
3149
|
+
return `${this.files.getLocation()}-${e}`;
|
|
2812
3150
|
}
|
|
2813
|
-
|
|
2814
|
-
return `${
|
|
3151
|
+
getNameByLanguage(e) {
|
|
3152
|
+
return `${this.files.getLanguage()}-${e}`;
|
|
2815
3153
|
}
|
|
2816
|
-
|
|
2817
|
-
return `${
|
|
3154
|
+
getNameByGlobal(e) {
|
|
3155
|
+
return `${ht}-${e}`;
|
|
2818
3156
|
}
|
|
2819
|
-
|
|
3157
|
+
getNamesNone(e) {
|
|
2820
3158
|
let t = [];
|
|
2821
|
-
return
|
|
2822
|
-
e !== "__TRANSLATE_START__" && e !== "__TRANSLATE_END__" && !
|
|
3159
|
+
return k(e).forEach((e) => {
|
|
3160
|
+
e !== "__TRANSLATE_START__" && e !== "__TRANSLATE_END__" && !this.hasName(e) && t.push(e);
|
|
2823
3161
|
}), t;
|
|
2824
3162
|
}
|
|
2825
|
-
|
|
2826
|
-
let e = await
|
|
3163
|
+
async getResponse() {
|
|
3164
|
+
let e = await N.get({
|
|
2827
3165
|
api: !1,
|
|
2828
3166
|
path: this.url,
|
|
2829
3167
|
request: { [this.propsName]: this.cache },
|
|
@@ -2832,97 +3170,145 @@ var Q = class e {
|
|
|
2832
3170
|
});
|
|
2833
3171
|
return e == null ? {} : e;
|
|
2834
3172
|
}
|
|
2835
|
-
|
|
2836
|
-
return t ?
|
|
3173
|
+
replacement(e, t) {
|
|
3174
|
+
return t ? mt(e, t) : e;
|
|
2837
3175
|
}
|
|
2838
|
-
|
|
3176
|
+
async make() {
|
|
2839
3177
|
let e;
|
|
2840
|
-
|
|
3178
|
+
this.files.isFile() ? e = await this.files.getList() : this.isReadApi && (e = await this.getResponse()), e && this.makeList(e);
|
|
2841
3179
|
}
|
|
2842
|
-
|
|
3180
|
+
makeList(e) {
|
|
2843
3181
|
this.cache.forEach((t) => {
|
|
2844
3182
|
var n;
|
|
2845
3183
|
this.data[this.getName(t)] = (n = e == null ? void 0 : e[t]) == null ? "" : n;
|
|
2846
3184
|
}), this.cache = [];
|
|
2847
3185
|
}
|
|
3186
|
+
}, yt = class {
|
|
3187
|
+
static async get(e, t) {
|
|
3188
|
+
return this.item.get(e, t);
|
|
3189
|
+
}
|
|
3190
|
+
static getItem() {
|
|
3191
|
+
return this.item;
|
|
3192
|
+
}
|
|
3193
|
+
static getSync(e, t = !1, n) {
|
|
3194
|
+
return this.item.getSync(e, t, n);
|
|
3195
|
+
}
|
|
3196
|
+
static getList(e) {
|
|
3197
|
+
return this.item.getList(e);
|
|
3198
|
+
}
|
|
3199
|
+
static getListSync(e, t = !1) {
|
|
3200
|
+
return this.item.getListSync(e, t);
|
|
3201
|
+
}
|
|
3202
|
+
static async add(e) {
|
|
3203
|
+
await this.item.add(e);
|
|
3204
|
+
}
|
|
3205
|
+
static addSync(e) {
|
|
3206
|
+
this.item.addSync(e);
|
|
3207
|
+
}
|
|
3208
|
+
static async addNormalOrSync(e) {
|
|
3209
|
+
await this.item.addNormalOrSync(e);
|
|
3210
|
+
}
|
|
3211
|
+
static addSyncByLocation(e) {
|
|
3212
|
+
this.item.addSyncByLocation(e);
|
|
3213
|
+
}
|
|
3214
|
+
static addSyncByFile(e) {
|
|
3215
|
+
this.item.addSyncByFile(e);
|
|
3216
|
+
}
|
|
3217
|
+
static setUrl(e) {
|
|
3218
|
+
return this.item.setUrl(e), this;
|
|
3219
|
+
}
|
|
3220
|
+
static setPropsName(e) {
|
|
3221
|
+
return this.item.setPropsName(e), this;
|
|
3222
|
+
}
|
|
3223
|
+
static setReadApi(e) {
|
|
3224
|
+
return this.item.setReadApi(e), this;
|
|
3225
|
+
}
|
|
3226
|
+
static setConfig(e) {
|
|
3227
|
+
return e.url && this.item.setUrl(e.url), e.propsName && this.item.setPropsName(e.propsName), typeof e.readApi == "boolean" && this.item.setReadApi(e.readApi), this;
|
|
3228
|
+
}
|
|
2848
3229
|
};
|
|
2849
|
-
|
|
3230
|
+
S(yt, "item", new vt());
|
|
2850
3231
|
//#endregion
|
|
2851
3232
|
//#region src/functions/arrFill.ts
|
|
2852
|
-
function
|
|
3233
|
+
function bt(e, t) {
|
|
2853
3234
|
return Array(t).fill(e);
|
|
2854
3235
|
}
|
|
2855
3236
|
//#endregion
|
|
2856
3237
|
//#region src/functions/blobToBase64.ts
|
|
2857
|
-
function
|
|
3238
|
+
function xt(e) {
|
|
2858
3239
|
return new Promise((t, n) => {
|
|
2859
3240
|
let r = new FileReader();
|
|
2860
3241
|
r.onloadend = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
|
|
2861
3242
|
});
|
|
2862
3243
|
}
|
|
2863
3244
|
//#endregion
|
|
3245
|
+
//#region src/functions/capitalize.ts
|
|
3246
|
+
function St(e) {
|
|
3247
|
+
return c(e) ? e.charAt(0).toUpperCase() + e.slice(1) : e;
|
|
3248
|
+
}
|
|
3249
|
+
//#endregion
|
|
2864
3250
|
//#region src/functions/domQuerySelector.ts
|
|
2865
|
-
function
|
|
2866
|
-
if (
|
|
3251
|
+
function Ct(e) {
|
|
3252
|
+
if (m()) {
|
|
2867
3253
|
var t;
|
|
2868
3254
|
return (t = document.querySelector(e)) == null ? void 0 : t;
|
|
2869
3255
|
}
|
|
2870
3256
|
}
|
|
2871
3257
|
//#endregion
|
|
2872
3258
|
//#region src/functions/domQuerySelectorAll.ts
|
|
2873
|
-
function
|
|
2874
|
-
if (
|
|
3259
|
+
function wt(e) {
|
|
3260
|
+
if (m()) return document.querySelectorAll(e);
|
|
2875
3261
|
}
|
|
2876
3262
|
//#endregion
|
|
2877
3263
|
//#region src/functions/getElementImage.ts
|
|
2878
|
-
function
|
|
2879
|
-
return
|
|
3264
|
+
function Tt(e) {
|
|
3265
|
+
return u(e) ? K(void 0, "img", { src: e }) : e;
|
|
2880
3266
|
}
|
|
2881
3267
|
//#endregion
|
|
2882
3268
|
//#region src/functions/resizeImageByMax.ts
|
|
2883
|
-
function
|
|
3269
|
+
function Et(e, t = "auto") {
|
|
2884
3270
|
switch (t) {
|
|
2885
3271
|
case "auto": return e.naturalWidth >= e.naturalHeight;
|
|
2886
3272
|
case "width": return !0;
|
|
2887
3273
|
case "height": return !1;
|
|
2888
3274
|
}
|
|
2889
3275
|
}
|
|
2890
|
-
function
|
|
2891
|
-
let i =
|
|
3276
|
+
function Dt(e, t, n = "auto", r) {
|
|
3277
|
+
let i = Tt(e);
|
|
2892
3278
|
if (i && (i.naturalWidth > t && (n === "auto" || n === "width") || i.naturalHeight > t && (n === "auto" || n === "height"))) {
|
|
2893
3279
|
var a;
|
|
2894
|
-
let e =
|
|
3280
|
+
let e = Et(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
|
|
2895
3281
|
if (o) return o.canvas.width = e ? t : i.naturalWidth / i.naturalHeight * t, o.canvas.height = e ? i.naturalHeight / i.naturalWidth * t : t, o.drawImage(i, 0, 0, o.canvas.width, o.canvas.height), o.canvas.toDataURL(r);
|
|
2896
3282
|
}
|
|
2897
3283
|
}
|
|
2898
3284
|
//#endregion
|
|
2899
3285
|
//#region src/functions/ensureMaxSize.ts
|
|
2900
|
-
async function
|
|
3286
|
+
async function Ot(e, t = .56, n = "image/jpeg") {
|
|
2901
3287
|
return new Promise((r) => {
|
|
2902
|
-
let i = new Blob([e], { type: n }), a =
|
|
3288
|
+
let i = new Blob([e], { type: n }), a = Tt(URL.createObjectURL(i));
|
|
2903
3289
|
a ? a.onload = () => {
|
|
2904
|
-
let e =
|
|
3290
|
+
let e = Dt(a, t * a.naturalWidth, "width", n);
|
|
2905
3291
|
r(e == null ? "" : e);
|
|
2906
|
-
} :
|
|
3292
|
+
} : xt(i).then((e) => r(String(e == null ? "" : e)));
|
|
2907
3293
|
});
|
|
2908
3294
|
}
|
|
2909
3295
|
//#endregion
|
|
2910
3296
|
//#region src/functions/eventStopPropagation.ts
|
|
2911
|
-
function
|
|
3297
|
+
function kt(e) {
|
|
2912
3298
|
e.preventDefault(), e.stopPropagation();
|
|
2913
3299
|
}
|
|
2914
3300
|
//#endregion
|
|
2915
3301
|
//#region src/functions/frame.ts
|
|
2916
|
-
function
|
|
3302
|
+
function At(e, t, n) {
|
|
2917
3303
|
let r = () => {
|
|
2918
|
-
e(), t != null && t() ?
|
|
3304
|
+
e(), t != null && t() ? At(e, t, n) : n == null || n();
|
|
2919
3305
|
};
|
|
2920
|
-
|
|
3306
|
+
m() ? requestAnimationFrame(r) : r();
|
|
2921
3307
|
}
|
|
2922
3308
|
//#endregion
|
|
2923
3309
|
//#region src/functions/getAttributes.ts
|
|
2924
|
-
function
|
|
2925
|
-
let t = {}, n =
|
|
3310
|
+
function jt(e) {
|
|
3311
|
+
let t = {}, n = D(e);
|
|
2926
3312
|
if (n) for (let e of n.attributes) {
|
|
2927
3313
|
var r;
|
|
2928
3314
|
t[e.name] = (r = (e == null ? void 0 : e.value) || (e == null ? void 0 : e.textContent)) == null ? void 0 : r;
|
|
@@ -2931,66 +3317,66 @@ function wt(e) {
|
|
|
2931
3317
|
}
|
|
2932
3318
|
//#endregion
|
|
2933
3319
|
//#region src/functions/getClipboardData.ts
|
|
2934
|
-
async function
|
|
3320
|
+
async function Mt(e) {
|
|
2935
3321
|
var t, n;
|
|
2936
3322
|
return (t = e == null || (n = e.clipboardData) == null ? void 0 : n.getData("text")) == null ? await navigator.clipboard.readText() || "" : t;
|
|
2937
3323
|
}
|
|
2938
3324
|
//#endregion
|
|
2939
3325
|
//#region src/functions/getCurrentDate.ts
|
|
2940
|
-
function
|
|
2941
|
-
return new
|
|
3326
|
+
function Nt(e = "datetime") {
|
|
3327
|
+
return new Pe(void 0, e).standard();
|
|
2942
3328
|
}
|
|
2943
3329
|
//#endregion
|
|
2944
3330
|
//#region src/functions/getElementId.ts
|
|
2945
|
-
var
|
|
2946
|
-
function
|
|
2947
|
-
let n =
|
|
2948
|
-
return n ? (
|
|
3331
|
+
var Pt = d(1e5, 9e5);
|
|
3332
|
+
function Ft(e, t) {
|
|
3333
|
+
let n = D(e);
|
|
3334
|
+
return n ? (c(n.id) || n.setAttribute("id", `id-${Pt++}`), t ? `#${n.id}${t}`.trim() : n.id) : `id-${Pt++}`;
|
|
2949
3335
|
}
|
|
2950
3336
|
//#endregion
|
|
2951
3337
|
//#region src/functions/getKey.ts
|
|
2952
|
-
function
|
|
3338
|
+
function It(e) {
|
|
2953
3339
|
var t, n, r;
|
|
2954
3340
|
return (t = (n = e == null ? void 0 : e.key) == null ? e == null ? void 0 : e.code : n) == null ? e == null || (r = e.keyCode) == null ? void 0 : r.toString() : t;
|
|
2955
3341
|
}
|
|
2956
3342
|
//#endregion
|
|
2957
3343
|
//#region src/functions/getLengthOfAllArray.ts
|
|
2958
|
-
function
|
|
2959
|
-
return
|
|
3344
|
+
function Lt(e) {
|
|
3345
|
+
return i(e, (e) => e.length);
|
|
2960
3346
|
}
|
|
2961
3347
|
//#endregion
|
|
2962
3348
|
//#region src/functions/getMaxLengthAllArray.ts
|
|
2963
|
-
function
|
|
2964
|
-
return Math.max(...
|
|
3349
|
+
function Rt(e) {
|
|
3350
|
+
return Math.max(...Lt(e));
|
|
2965
3351
|
}
|
|
2966
3352
|
//#endregion
|
|
2967
3353
|
//#region src/functions/getMinLengthAllArray.ts
|
|
2968
|
-
function
|
|
2969
|
-
return Math.min(...
|
|
3354
|
+
function zt(e) {
|
|
3355
|
+
return Math.min(...Lt(e));
|
|
2970
3356
|
}
|
|
2971
3357
|
//#endregion
|
|
2972
3358
|
//#region src/functions/getMouseClientX.ts
|
|
2973
|
-
function
|
|
3359
|
+
function Bt(e) {
|
|
2974
3360
|
var t, n;
|
|
2975
3361
|
return (e == null ? void 0 : e.clientX) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientX) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientX) || 0;
|
|
2976
3362
|
}
|
|
2977
3363
|
//#endregion
|
|
2978
3364
|
//#region src/functions/getMouseClientY.ts
|
|
2979
|
-
function
|
|
3365
|
+
function Vt(e) {
|
|
2980
3366
|
var t, n;
|
|
2981
3367
|
return (e == null ? void 0 : e.clientY) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientY) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientY) || 0;
|
|
2982
3368
|
}
|
|
2983
3369
|
//#endregion
|
|
2984
3370
|
//#region src/functions/getMouseClient.ts
|
|
2985
|
-
function
|
|
3371
|
+
function Ht(e) {
|
|
2986
3372
|
return {
|
|
2987
|
-
x:
|
|
2988
|
-
y:
|
|
3373
|
+
x: Bt(e),
|
|
3374
|
+
y: Vt(e)
|
|
2989
3375
|
};
|
|
2990
3376
|
}
|
|
2991
3377
|
//#endregion
|
|
2992
3378
|
//#region src/functions/getObjectByKeys.ts
|
|
2993
|
-
function
|
|
3379
|
+
function Ut(e, t) {
|
|
2994
3380
|
let n = {};
|
|
2995
3381
|
return t.forEach((t) => {
|
|
2996
3382
|
t in e && e[t] !== void 0 && (n[t] = e[t]);
|
|
@@ -2998,58 +3384,58 @@ function It(e, t) {
|
|
|
2998
3384
|
}
|
|
2999
3385
|
//#endregion
|
|
3000
3386
|
//#region src/functions/getObjectNoUndefined.ts
|
|
3001
|
-
function
|
|
3387
|
+
function Wt(e, t = void 0) {
|
|
3002
3388
|
let n = {};
|
|
3003
|
-
return
|
|
3389
|
+
return i(e, (e, r) => {
|
|
3004
3390
|
e !== t && (n[r] = e);
|
|
3005
3391
|
}), n;
|
|
3006
3392
|
}
|
|
3007
3393
|
//#endregion
|
|
3008
3394
|
//#region src/functions/getObjectOrNone.ts
|
|
3009
|
-
function
|
|
3010
|
-
return
|
|
3395
|
+
function Gt(e) {
|
|
3396
|
+
return n(e) ? e : {};
|
|
3011
3397
|
}
|
|
3012
3398
|
//#endregion
|
|
3013
3399
|
//#region src/functions/strFill.ts
|
|
3014
|
-
function
|
|
3015
|
-
return
|
|
3400
|
+
function Kt(e, t) {
|
|
3401
|
+
return bt(e, t).join("");
|
|
3016
3402
|
}
|
|
3017
3403
|
//#endregion
|
|
3018
3404
|
//#region src/functions/getRandomText.ts
|
|
3019
|
-
function
|
|
3020
|
-
let a =
|
|
3021
|
-
for (let e = 0; e < a; e++) o.push(
|
|
3405
|
+
function qt(e, t, n = "#", r = 2, i = 12) {
|
|
3406
|
+
let a = d(e, t), o = [];
|
|
3407
|
+
for (let e = 0; e < a; e++) o.push(Kt(n, d(r, i)));
|
|
3022
3408
|
return o.join(" ");
|
|
3023
3409
|
}
|
|
3024
3410
|
//#endregion
|
|
3025
3411
|
//#region src/functions/getStepPercent.ts
|
|
3026
|
-
function
|
|
3412
|
+
function Jt(e, t) {
|
|
3027
3413
|
let n = e == null ? 0 : e;
|
|
3028
3414
|
return t > n ? 100 / (t - n) : 0;
|
|
3029
3415
|
}
|
|
3030
3416
|
//#endregion
|
|
3031
3417
|
//#region src/functions/getStepValue.ts
|
|
3032
|
-
function
|
|
3418
|
+
function Yt(e, t) {
|
|
3033
3419
|
let n = e == null ? 0 : e;
|
|
3034
3420
|
return t > n ? (t - n) / 100 : 0;
|
|
3035
3421
|
}
|
|
3036
3422
|
//#endregion
|
|
3037
3423
|
//#region src/functions/goScroll.ts
|
|
3038
|
-
var
|
|
3039
|
-
function
|
|
3424
|
+
var Xt = 0;
|
|
3425
|
+
function Zt(e, t, n) {
|
|
3040
3426
|
let r = t == null ? void 0 : t.closest(e);
|
|
3041
3427
|
if (t && r && r.scrollHeight !== r.offsetHeight) {
|
|
3042
3428
|
let e = r.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
3043
3429
|
if (n) {
|
|
3044
3430
|
let a = n.getBoundingClientRect();
|
|
3045
3431
|
r.scrollTop = t.offsetTop - (a.top - e.top) - (a.height / 2 - i.height / 2), r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = t.offsetTop + t.offsetHeight - r.offsetHeight);
|
|
3046
|
-
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top -
|
|
3432
|
+
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top - Xt : r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = i.top - e.top + i.height - e.height + Xt);
|
|
3047
3433
|
}
|
|
3048
3434
|
}
|
|
3049
3435
|
//#endregion
|
|
3050
3436
|
//#region src/functions/goScrollSmooth.ts
|
|
3051
|
-
function
|
|
3052
|
-
if (!
|
|
3437
|
+
function Qt(e, t, n = 0) {
|
|
3438
|
+
if (!m()) return;
|
|
3053
3439
|
let r = (t == null ? void 0 : t.behavior) || "smooth";
|
|
3054
3440
|
if ("scrollIntoView" in e && !n) {
|
|
3055
3441
|
e.scrollIntoView({
|
|
@@ -3070,8 +3456,8 @@ function Gt(e, t, n = 0) {
|
|
|
3070
3456
|
}
|
|
3071
3457
|
//#endregion
|
|
3072
3458
|
//#region src/functions/goScrollTo.ts
|
|
3073
|
-
function
|
|
3074
|
-
if (!
|
|
3459
|
+
function $t(e, t, n = "smooth") {
|
|
3460
|
+
if (!m() || !e || !t) return;
|
|
3075
3461
|
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
3076
3462
|
e.scrollBy({
|
|
3077
3463
|
top: i.top - r.top,
|
|
@@ -3081,13 +3467,13 @@ function Kt(e, t, n = "smooth") {
|
|
|
3081
3467
|
}
|
|
3082
3468
|
//#endregion
|
|
3083
3469
|
//#region src/functions/isShare.ts
|
|
3084
|
-
function
|
|
3085
|
-
return
|
|
3470
|
+
function en() {
|
|
3471
|
+
return m() && typeof navigator < "u" && !!navigator.share;
|
|
3086
3472
|
}
|
|
3087
3473
|
//#endregion
|
|
3088
3474
|
//#region src/functions/handleShare.ts
|
|
3089
|
-
async function
|
|
3090
|
-
if (
|
|
3475
|
+
async function tn(e) {
|
|
3476
|
+
if (en() && navigator.canShare && navigator.canShare(e)) try {
|
|
3091
3477
|
return await navigator.share(e), !0;
|
|
3092
3478
|
} catch (e) {
|
|
3093
3479
|
console.error("handleShare error:", e);
|
|
@@ -3096,60 +3482,60 @@ async function Jt(e) {
|
|
|
3096
3482
|
}
|
|
3097
3483
|
//#endregion
|
|
3098
3484
|
//#region src/functions/inArray.ts
|
|
3099
|
-
function
|
|
3485
|
+
function nn(e, t) {
|
|
3100
3486
|
return e.indexOf(t) !== -1;
|
|
3101
3487
|
}
|
|
3102
3488
|
//#endregion
|
|
3103
3489
|
//#region src/functions/initScrollbarOffset.ts
|
|
3104
|
-
async function
|
|
3105
|
-
if (
|
|
3106
|
-
let e = await
|
|
3490
|
+
async function rn() {
|
|
3491
|
+
if (m()) {
|
|
3492
|
+
let e = await Z.get();
|
|
3107
3493
|
document.body.style.setProperty("--sys-scrollbar-offset", `${e}px`);
|
|
3108
3494
|
}
|
|
3109
3495
|
}
|
|
3110
3496
|
//#endregion
|
|
3111
3497
|
//#region src/functions/intersectKey.ts
|
|
3112
|
-
function
|
|
3113
|
-
let
|
|
3114
|
-
return
|
|
3115
|
-
|
|
3116
|
-
}),
|
|
3498
|
+
function an(e, n) {
|
|
3499
|
+
let r = {};
|
|
3500
|
+
return t(e) && t(n) && i(e, (e, t) => {
|
|
3501
|
+
t in n && (r[t] = e);
|
|
3502
|
+
}), r;
|
|
3117
3503
|
}
|
|
3118
3504
|
//#endregion
|
|
3119
3505
|
//#region src/functions/isApiSuccess.ts
|
|
3120
|
-
var
|
|
3506
|
+
var on = (e) => {
|
|
3121
3507
|
var t;
|
|
3122
|
-
return
|
|
3508
|
+
return o(e) ? !0 : !!(e && n(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || !(e == null || (t = e.statusObject) == null) && t.status && String(e.statusObject.status).match(/^2/) || !("status" in e) && !("success" in e) && !("statusObject" in e) && String(N.getStatus().getStatus()).match(/^2/)));
|
|
3123
3509
|
};
|
|
3124
3510
|
//#endregion
|
|
3125
3511
|
//#region src/functions/isDifferent.ts
|
|
3126
|
-
function
|
|
3512
|
+
function sn(e, t) {
|
|
3127
3513
|
let n = Object.keys(e).length !== Object.keys(t).length;
|
|
3128
|
-
return n ||
|
|
3514
|
+
return n || i(e, (e, r) => {
|
|
3129
3515
|
e !== (t == null ? void 0 : t[r]) && (n = !0);
|
|
3130
3516
|
}), n;
|
|
3131
3517
|
}
|
|
3132
3518
|
//#endregion
|
|
3133
3519
|
//#region src/functions/isElementVisible.ts
|
|
3134
|
-
function
|
|
3135
|
-
if (!
|
|
3136
|
-
let t =
|
|
3520
|
+
function cn(e) {
|
|
3521
|
+
if (!m()) return !1;
|
|
3522
|
+
let t = D(e);
|
|
3137
3523
|
if (!t || "isConnected" in t && t.isConnected === !1) return !1;
|
|
3138
3524
|
let n = window.getComputedStyle(t);
|
|
3139
3525
|
return n.display !== "none" && n.visibility !== "hidden" && n.opacity !== "0" && t.offsetWidth !== 0 && t.offsetHeight !== 0;
|
|
3140
3526
|
}
|
|
3141
3527
|
//#endregion
|
|
3142
3528
|
//#region src/functions/isInput.ts
|
|
3143
|
-
var
|
|
3529
|
+
var ln = (e) => {
|
|
3144
3530
|
if (e instanceof HTMLElement) {
|
|
3145
3531
|
let t = e.tagName.toLowerCase();
|
|
3146
3532
|
return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true");
|
|
3147
3533
|
}
|
|
3148
3534
|
return !1;
|
|
3149
|
-
},
|
|
3535
|
+
}, un = (e, t) => e.code === "Space" || e.code === "Enter" || e.key === " " || e.key === "Spacebar" || e.key === "Enter" || e.keyCode === 13 || e.keyCode === 32 ? t === void 0 ? !ln(e.target) : !t : !1;
|
|
3150
3536
|
//#endregion
|
|
3151
3537
|
//#region src/functions/isFloat.ts
|
|
3152
|
-
function
|
|
3538
|
+
function dn(e) {
|
|
3153
3539
|
switch (typeof e) {
|
|
3154
3540
|
case "number": return !0;
|
|
3155
3541
|
case "string": return !!e.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
|
|
@@ -3158,18 +3544,18 @@ function rn(e) {
|
|
|
3158
3544
|
}
|
|
3159
3545
|
//#endregion
|
|
3160
3546
|
//#region src/functions/isIntegerBetween.ts
|
|
3161
|
-
function
|
|
3547
|
+
function fn(e, t) {
|
|
3162
3548
|
let n = Math.floor(t);
|
|
3163
3549
|
return e >= n && e < n + 1;
|
|
3164
3550
|
}
|
|
3165
3551
|
//#endregion
|
|
3166
3552
|
//#region src/functions/isSelectedByList.ts
|
|
3167
|
-
function
|
|
3168
|
-
return Array.isArray(e) ? e.every((e) =>
|
|
3553
|
+
function pn(e, t) {
|
|
3554
|
+
return Array.isArray(e) ? e.every((e) => _(e, t)) : _(e, t);
|
|
3169
3555
|
}
|
|
3170
3556
|
//#endregion
|
|
3171
3557
|
//#region src/functions/removeCommonPrefix.ts
|
|
3172
|
-
function
|
|
3558
|
+
function mn(e, t) {
|
|
3173
3559
|
if (e.startsWith(t)) return e.slice(t.length).trim();
|
|
3174
3560
|
let n = 0;
|
|
3175
3561
|
for (; e[n] === t[n] && n < e.length && n < t.length;) n++;
|
|
@@ -3177,45 +3563,45 @@ function sn(e, t) {
|
|
|
3177
3563
|
}
|
|
3178
3564
|
//#endregion
|
|
3179
3565
|
//#region src/functions/replaceComponentName.ts
|
|
3180
|
-
var
|
|
3566
|
+
var hn = (e, t, n) => {
|
|
3181
3567
|
var r;
|
|
3182
3568
|
return e == null || (r = e.replace(RegExp(`<${t}`, "ig"), `<${n}`)) == null || (r = r.replace(RegExp(`</${t}`, "ig"), `</${n}`)) == null ? void 0 : r.trim();
|
|
3183
3569
|
};
|
|
3184
3570
|
//#endregion
|
|
3185
3571
|
//#region src/functions/uniqueArray.ts
|
|
3186
|
-
function
|
|
3572
|
+
function gn(e) {
|
|
3187
3573
|
return [...new Set(e)];
|
|
3188
3574
|
}
|
|
3189
3575
|
//#endregion
|
|
3190
3576
|
//#region src/functions/replaceRecursive.ts
|
|
3191
|
-
function $(e,
|
|
3192
|
-
let a =
|
|
3193
|
-
return
|
|
3194
|
-
let o = e == null ? void 0 : e[
|
|
3195
|
-
|
|
3577
|
+
function $(e, n, r = !0) {
|
|
3578
|
+
let a = p(e);
|
|
3579
|
+
return t(e) && t(n) && i(n, (n, i) => {
|
|
3580
|
+
let o = e == null ? void 0 : e[i];
|
|
3581
|
+
t(o) && t(n) ? r && Array.isArray(o) && Array.isArray(n) ? a[i] = p(gn([...o, ...n])) : a[i] = $(Array.isArray(o) ? { ...o } : o, n, r) : a[i] = t(n) ? p(n) : n;
|
|
3196
3582
|
}), a;
|
|
3197
3583
|
}
|
|
3198
3584
|
//#endregion
|
|
3199
3585
|
//#region src/functions/replaceTemplate.ts
|
|
3200
|
-
function
|
|
3586
|
+
function _n(e, t) {
|
|
3201
3587
|
let n = e;
|
|
3202
|
-
return
|
|
3203
|
-
n = n.replace(
|
|
3588
|
+
return i(t, (e, t) => {
|
|
3589
|
+
n = n.replace(st(`[${t}]`), y(e));
|
|
3204
3590
|
}), n;
|
|
3205
3591
|
}
|
|
3206
3592
|
//#endregion
|
|
3207
3593
|
//#region src/functions/secondToTime.ts
|
|
3208
|
-
function
|
|
3209
|
-
let t =
|
|
3594
|
+
function vn(e) {
|
|
3595
|
+
let t = g(e);
|
|
3210
3596
|
return t > 0 ? `${String(Math.floor(t / 60)).padStart(2, "0")}:${String(t % 60).padStart(2, "0")}` : "00:00";
|
|
3211
3597
|
}
|
|
3212
3598
|
//#endregion
|
|
3213
3599
|
//#region src/functions/setValues.ts
|
|
3214
|
-
function
|
|
3600
|
+
function yn(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: i = !0, notEmpty: a = !1 }) {
|
|
3215
3601
|
if (n) {
|
|
3216
|
-
if (
|
|
3602
|
+
if (o(e)) {
|
|
3217
3603
|
let n = e.indexOf(t), i = [...e];
|
|
3218
|
-
return n === -1 ? (!r || e.length < r) && i.push(t) : (!
|
|
3604
|
+
return n === -1 ? (!r || e.length < r) && i.push(t) : (!a || i.length > 1) && i.splice(n, 1), i;
|
|
3219
3605
|
}
|
|
3220
3606
|
return e === t ? [] : e ? [e, t] : [t];
|
|
3221
3607
|
}
|
|
@@ -3223,51 +3609,51 @@ function fn(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: i = !0, no
|
|
|
3223
3609
|
}
|
|
3224
3610
|
//#endregion
|
|
3225
3611
|
//#region src/functions/splice.ts
|
|
3226
|
-
function
|
|
3227
|
-
if (
|
|
3228
|
-
if (
|
|
3612
|
+
function bn(e, n, r) {
|
|
3613
|
+
if (t(e) && t(n)) {
|
|
3614
|
+
if (r) {
|
|
3229
3615
|
let a = {}, o = !1;
|
|
3230
|
-
return
|
|
3231
|
-
!o && (
|
|
3232
|
-
}), o ? a : $(e,
|
|
3616
|
+
return i(e, (e, i) => {
|
|
3617
|
+
!o && (r === i || r === e) ? (o = !0, a = $(a, n)) : o ? a = $(a, { [i]: e }) : a[i] = t(e) ? p(e) : e;
|
|
3618
|
+
}), o ? a : $(e, n);
|
|
3233
3619
|
}
|
|
3234
|
-
if (n
|
|
3620
|
+
if (t(n)) return $(e, n);
|
|
3235
3621
|
}
|
|
3236
|
-
return
|
|
3622
|
+
return p(e);
|
|
3237
3623
|
}
|
|
3238
3624
|
//#endregion
|
|
3239
3625
|
//#region src/functions/toCamelCaseFirst.ts
|
|
3240
|
-
function
|
|
3241
|
-
return
|
|
3626
|
+
function xn(e) {
|
|
3627
|
+
return z(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
|
|
3242
3628
|
}
|
|
3243
3629
|
//#endregion
|
|
3244
3630
|
//#region src/functions/toKebabCase.ts
|
|
3245
|
-
function
|
|
3631
|
+
function Sn(e) {
|
|
3246
3632
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/^[A-Z]/, (e) => e.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (e) => `-${e.toLowerCase()}`).replace(/[A-Z]/g, (e) => e.toLowerCase());
|
|
3247
3633
|
}
|
|
3248
3634
|
//#endregion
|
|
3249
3635
|
//#region src/functions/toNumberByMax.ts
|
|
3250
|
-
function
|
|
3251
|
-
let i =
|
|
3252
|
-
return t && a < i ? `${
|
|
3636
|
+
function Cn(e, t, n, r) {
|
|
3637
|
+
let i = g(e), a = g(t);
|
|
3638
|
+
return t && a < i ? `${wn(a, n, r)}+` : wn(i, n, r);
|
|
3253
3639
|
}
|
|
3254
|
-
var
|
|
3640
|
+
var wn = (e, t, n) => t ? new F(n).number(e) : e;
|
|
3255
3641
|
//#endregion
|
|
3256
3642
|
//#region src/functions/toPercent.ts
|
|
3257
|
-
function
|
|
3643
|
+
function Tn(e, t) {
|
|
3258
3644
|
return 1 / e * t;
|
|
3259
3645
|
}
|
|
3260
3646
|
//#endregion
|
|
3261
3647
|
//#region src/functions/toPercentBy100.ts
|
|
3262
|
-
function
|
|
3263
|
-
return
|
|
3648
|
+
function En(e, t) {
|
|
3649
|
+
return Tn(e, t) * 100;
|
|
3264
3650
|
}
|
|
3265
3651
|
//#endregion
|
|
3266
3652
|
//#region src/functions/uint8ArrayToBase64.ts
|
|
3267
|
-
function
|
|
3653
|
+
function Dn(e) {
|
|
3268
3654
|
let t = "";
|
|
3269
3655
|
for (let n of e) t += String.fromCharCode(n);
|
|
3270
|
-
if (
|
|
3656
|
+
if (m()) return window.btoa(t);
|
|
3271
3657
|
if (globalThis && globalThis.Buffer) {
|
|
3272
3658
|
var n;
|
|
3273
3659
|
return (n = globalThis) == null ? void 0 : n.Buffer.from(e).toString("base64");
|
|
@@ -3276,8 +3662,8 @@ function bn(e) {
|
|
|
3276
3662
|
}
|
|
3277
3663
|
//#endregion
|
|
3278
3664
|
//#region src/functions/writeClipboardData.ts
|
|
3279
|
-
async function
|
|
3280
|
-
if (
|
|
3665
|
+
async function On(e) {
|
|
3666
|
+
if (m()) try {
|
|
3281
3667
|
await navigator.clipboard.writeText(e);
|
|
3282
3668
|
} catch (n) {
|
|
3283
3669
|
var t;
|
|
@@ -3285,4 +3671,4 @@ async function xn(e) {
|
|
|
3285
3671
|
}
|
|
3286
3672
|
}
|
|
3287
3673
|
//#endregion
|
|
3288
|
-
export {
|
|
3674
|
+
export { N as Api, pe as ApiDefault, fe as ApiHeaders, ye as ApiInstance, M as ApiMethodItem, ve as ApiPreparation, _e as ApiResponse, me as ApiStatus, be as BroadcastMessage, Ce as Cache, Se as CacheItem, Te as CacheStatic, je as Cookie, Oe as CookieBlock, w as DataStorage, Pe as Datetime, C as ErrorCenter, ne as ErrorCenterHandler, re as ErrorCenterInstance, A as EventItem, Ie as Formatters, B as FormattersType, Le as GEO_FLAG_ICON_NAME, E as Geo, Re as GeoFlag, F as GeoIntl, V as GeoPhone, ze as Global, W as Hash, G as Icons, j as Loading, de as LoadingInstance, nt as Meta, q as MetaManager, et as MetaOg, Ze as MetaOpenGraphAge, Ye as MetaOpenGraphAvailability, Xe as MetaOpenGraphCondition, Qe as MetaOpenGraphGender, Y as MetaOpenGraphTag, Je as MetaOpenGraphType, qe as MetaRobots, J as MetaTag, tt as MetaTwitter, $e as MetaTwitterCard, X as MetaTwitterTag, Z as ScrollbarWidth, ft as SearchList, at as SearchListData, ot as SearchListItem, ut as SearchListMatcher, dt as SearchListOptions, ht as TRANSLATE_GLOBAL_PREFIX, gt as TRANSLATE_TIME_OUT, yt as Translate, _t as TranslateFile, vt as TranslateInstance, it as addTagHighlightMatch, L as anyToString, mt as applyTemplate, bt as arrFill, xt as blobToBase64, St as capitalize, p as copyObject, r as copyObjectLite, K as createElement, Ct as domQuerySelector, wt as domQuerySelectorAll, Ke as encodeAttribute, Ot as ensureMaxSize, Q as escapeExp, kt as eventStopPropagation, y as executeFunction, he as executePromise, i as forEach, At as frame, jt as getAttributes, Mt as getClipboardData, Ne as getColumn, Nt as getCurrentDate, D as getElement, Ft as getElementId, Tt as getElementImage, We as getElementItem, O as getElementOrWindow, ct as getExactSearchExp, st as getExp, R as getItemByPath, It as getKey, Lt as getLengthOfAllArray, Rt as getMaxLengthAllArray, zt as getMinLengthAllArray, Ht as getMouseClient, Bt as getMouseClientX, Vt as getMouseClientY, Ut as getObjectByKeys, Wt as getObjectNoUndefined, Gt as getObjectOrNone, qt as getRandomText, a as getRequestString, lt as getSearchExp, rt as getSeparatingSearchExp, Jt as getStepPercent, Yt as getStepValue, Zt as goScroll, Qt as goScrollSmooth, $t as goScrollTo, tn as handleShare, nn as inArray, rn as initScrollbarOffset, an as intersectKey, on as isApiSuccess, o as isArray, sn as isDifferent, b as isDomData, m as isDomRuntime, cn as isElementVisible, un as isEnter, c as isFilled, dn as isFloat, v as isFunction, le as isInDom, ln as isInput, fn as isIntegerBetween, s as isNull, h as isNumber, t as isObject, n as isObjectNotArray, l as isOnLine, _ as isSelected, pn as isSelectedByList, en as isShare, u as isString, ce as isWindow, d as random, mn as removeCommonPrefix, hn as replaceComponentName, $ as replaceRecursive, _n as replaceTemplate, Dt as resizeImageByMax, vn as secondToTime, Ge as setElementItem, yn as setValues, f as sleep, bn as splice, Kt as strFill, Fe as strSplit, k as toArray, z as toCamelCase, xn as toCamelCaseFirst, P as toDate, Sn as toKebabCase, g as toNumber, Cn as toNumberByMax, Tn as toPercent, En as toPercentBy100, Ee as transformation, Dn as uint8ArrayToBase64, gn as uniqueArray, On as writeClipboardData };
|