@dxtmisha/functional-basic 0.14.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/library.js CHANGED
@@ -9,46 +9,61 @@ function n(e) {
9
9
  return t(e) && !Array.isArray(e);
10
10
  }
11
11
  //#endregion
12
- //#region src/functions/copyObjectLite.ts
13
- function r(e, t) {
14
- return t ? Object.assign({}, e, t) : Object.assign({}, e);
15
- }
16
- //#endregion
17
12
  //#region src/functions/forEach.ts
18
- function i(e, n, r) {
13
+ function r(e, n, r) {
19
14
  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);
15
+ let t = [], i = (e, i, a) => {
16
+ let o = n(e, i, a);
17
+ (r || o !== void 0) && t.push(o);
18
+ };
19
+ if (Array.isArray(e)) e.forEach((t, n) => i(t, n, e));
20
+ else if (e instanceof Map) e.forEach((t, n) => i(t, n, e));
21
+ else if (e instanceof Set) e.forEach((t) => i(t, t, e));
22
+ else for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && i(e[t], t, e);
23
+ return t;
22
24
  }
23
25
  return [];
24
26
  }
25
27
  //#endregion
28
+ //#region src/functions/isArray.ts
29
+ function i(e) {
30
+ return Array.isArray(e);
31
+ }
32
+ //#endregion
33
+ //#region src/functions/toString.ts
34
+ function a(e) {
35
+ return String(e == null ? "" : e);
36
+ }
37
+ //#endregion
26
38
  //#region src/functions/getRequestString.ts
27
- function a(e, t = "=", n = "&") {
28
- return i(e, (e, n) => `${n}${t}${encodeURIComponent(String(e).trim())}`).sort().join(n);
39
+ function o(e, n = "=", s = "&", c) {
40
+ return r(e, (r, l) => {
41
+ let u = encodeURIComponent(a(l).trim());
42
+ if (u !== "") {
43
+ let l = c ? `${c}[${i(e) ? "" : u}]` : u;
44
+ return t(r) ? o(r, n, s, l) : `${l}${n}${encodeURIComponent(a(r))}`;
45
+ }
46
+ }).sort().join(s);
29
47
  }
30
48
  //#endregion
31
- //#region src/functions/isArray.ts
32
- function o(e) {
33
- return Array.isArray(e);
49
+ //#region src/functions/isDomRuntime.ts
50
+ function s() {
51
+ return typeof window < "u" && !!window.document;
34
52
  }
35
53
  //#endregion
36
54
  //#region src/functions/isNull.ts
37
- function s(e) {
55
+ function c(e) {
38
56
  return e == null;
39
57
  }
40
58
  //#endregion
41
59
  //#region src/functions/isFilled.ts
42
- function c(e, t) {
60
+ function l(e, t) {
43
61
  if (e) {
44
62
  if (t && e === "0") return !0;
45
63
  switch (typeof e) {
46
- case "bigint":
47
- case "number": return e !== 0;
48
- case "boolean": return e;
49
64
  case "function":
50
65
  case "symbol": return !0;
51
- case "object": return Array.isArray(e) ? e.length > 0 : Object.values(e).some((e) => !s(e));
66
+ case "object": return Array.isArray(e) ? e.length > 0 : e instanceof RegExp ? !0 : e instanceof Map || e instanceof Set ? e.size > 0 : Object.values(e).some((e) => !c(e));
52
67
  case "string": return ![
53
68
  "",
54
69
  "undefined",
@@ -56,8 +71,7 @@ function c(e, t) {
56
71
  "0",
57
72
  "false",
58
73
  "[]"
59
- ].includes(e);
60
- case "undefined": return !1;
74
+ ].includes(e.trim());
61
75
  default: return !!e;
62
76
  }
63
77
  }
@@ -65,73 +79,79 @@ function c(e, t) {
65
79
  }
66
80
  //#endregion
67
81
  //#region src/functions/isOnLine.ts
68
- function l() {
82
+ function u() {
69
83
  return typeof navigator > "u" || navigator.onLine;
70
84
  }
71
85
  //#endregion
72
86
  //#region src/functions/isString.ts
73
- function u(e) {
87
+ function d(e) {
74
88
  return typeof e == "string";
75
89
  }
76
90
  //#endregion
77
91
  //#region src/functions/random.ts
78
- function d(e, t) {
92
+ function f(e, t) {
79
93
  return Math.floor(Math.random() * (t - e + 1) + e);
80
94
  }
81
95
  //#endregion
82
96
  //#region src/functions/sleep.ts
83
- function f(e) {
84
- return new Promise((t) => setTimeout(t, e));
85
- }
86
- //#endregion
87
- //#region src/functions/copyObject.ts
88
97
  function p(e) {
89
- return JSON.parse(JSON.stringify(e));
90
- }
91
- //#endregion
92
- //#region src/functions/isDomRuntime.ts
93
- function m() {
94
- return typeof window < "u" && !!window.document;
98
+ return new Promise((t) => setTimeout(t, e));
95
99
  }
96
100
  //#endregion
97
101
  //#region src/functions/isNumber.ts
102
+ var m = /^-?[0-9]+(\.[0-9]+)?$/;
98
103
  function h(e) {
99
104
  switch (typeof e) {
100
- case "number": return !0;
101
- case "string": return !!e.match(/^-?[0-9]+(\.[0-9]+)?$/);
105
+ case "number": return Number.isFinite(e);
106
+ case "bigint": return !0;
107
+ case "string": return m.test(e.trim());
102
108
  default: return !1;
103
109
  }
104
110
  }
105
111
  //#endregion
106
112
  //#region src/functions/toNumber.ts
107
- function g(e) {
108
- if (typeof e == "number") return e;
113
+ var ee = /[^-+\d., ]+/g, te = /( [0-9]{3}[ ,.]|[0-9] [0-9])/, ne = / /g, g = /,/g, re = /,[0-9]{3}[,.]/, ie = /[.][0-9]{3}[,.]/, ae = /[.]/g;
114
+ function _(e) {
115
+ if (typeof e == "number") return Number.isFinite(e) && e || 0;
109
116
  if (!e) return 0;
110
- let t = e.replace(/[^\d., ]+/gi, "");
111
- return t = t.match(/( [0-9]{3}[ ,.]|[0-9] [0-9])/gi) ? t.replace(/ /gi, "").replace(/,/gi, ".") : t.match(/,[0-9]{3}[,.]/gi) ? t.replace(/,/gi, "") : t.match(/[.][0-9]{3}[,.]/gi) ? t.replace(/[.]/gi, "").replace(/,/gi, ".") : t.replace(/,/gi, "."), parseFloat(t);
117
+ let t = e.replace(ee, "");
118
+ return t = te.test(t) ? t.replace(ne, "").replace(g, ".") : re.test(t) ? t.replace(g, "") : ie.test(t) ? t.replace(ae, "").replace(g, ".") : t.replace(g, "."), parseFloat(t) || 0;
112
119
  }
113
120
  //#endregion
114
121
  //#region src/functions/isSelected.ts
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;
122
+ function v(e, t) {
123
+ return c(e) ? !1 : Array.isArray(t) ? t.includes(e) : h(e) && h(t) ? _(e) === _(t) : e === t;
124
+ }
125
+ //#endregion
126
+ //#region src/functions/encodeLiteAttribute.ts
127
+ var oe = {
128
+ "<": "&lt;",
129
+ ">": "&gt;",
130
+ "&": "&amp;"
131
+ };
132
+ function se(e) {
133
+ return String(e).replace(/[<>&]/g, (e) => {
134
+ var t;
135
+ return (t = oe == null ? void 0 : oe[e]) == null ? e : t;
136
+ });
117
137
  }
118
138
  //#endregion
119
139
  //#region src/functions/isFunction.ts
120
- function v(e) {
140
+ function y(e) {
121
141
  return e instanceof Function || typeof e == "function";
122
142
  }
123
143
  //#endregion
124
144
  //#region src/functions/executeFunction.ts
125
- function y(e, ...t) {
126
- return v(e) ? e(...t) : e;
145
+ function b(e, ...t) {
146
+ return y(e) ? e(...t) : e;
127
147
  }
128
148
  //#endregion
129
149
  //#region src/functions/isDomData.ts
130
- function b() {
131
- return location.href.startsWith("data:");
150
+ function ce() {
151
+ return s() && location.href.startsWith("data:");
132
152
  }
133
153
  //#endregion
134
- //#region \0@oxc-project+runtime@0.123.0/helpers/typeof.js
154
+ //#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
135
155
  function x(e) {
136
156
  "@babel/helpers - typeof";
137
157
  return x = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -141,8 +161,8 @@ function x(e) {
141
161
  }, x(e);
142
162
  }
143
163
  //#endregion
144
- //#region \0@oxc-project+runtime@0.123.0/helpers/toPrimitive.js
145
- function ee(e, t) {
164
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
165
+ function le(e, t) {
146
166
  if (x(e) != "object" || !e) return e;
147
167
  var n = e[Symbol.toPrimitive];
148
168
  if (n !== void 0) {
@@ -153,15 +173,15 @@ function ee(e, t) {
153
173
  return (t === "string" ? String : Number)(e);
154
174
  }
155
175
  //#endregion
156
- //#region \0@oxc-project+runtime@0.123.0/helpers/toPropertyKey.js
157
- function te(e) {
158
- var t = ee(e, "string");
176
+ //#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
177
+ function ue(e) {
178
+ var t = le(e, "string");
159
179
  return x(t) == "symbol" ? t : t + "";
160
180
  }
161
181
  //#endregion
162
- //#region \0@oxc-project+runtime@0.123.0/helpers/defineProperty.js
182
+ //#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
163
183
  function S(e, t, n) {
164
- return (t = te(t)) in e ? Object.defineProperty(e, t, {
184
+ return (t = ue(t)) in e ? Object.defineProperty(e, t, {
165
185
  value: n,
166
186
  enumerable: !0,
167
187
  configurable: !0,
@@ -170,7 +190,7 @@ function S(e, t, n) {
170
190
  }
171
191
  //#endregion
172
192
  //#region src/classes/ErrorCenterHandler.ts
173
- var ne = class {
193
+ var de = class {
174
194
  constructor(e) {
175
195
  S(this, "handlers", []), e && this.addList(e);
176
196
  }
@@ -191,18 +211,15 @@ var ne = class {
191
211
  return e.forEach((e) => e.handlers.forEach((t) => this.add(e.group, t))), this;
192
212
  }
193
213
  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;
214
+ var t;
215
+ let n = (t = this.get(e.group)) == null ? this.get(void 0) : t;
216
+ return n && n.handlers.forEach((t) => t(e)), this.toConsole(e), this;
200
217
  }
201
218
  toConsole(e) {
202
219
  return console.error(`Error Center: ${e.code}`), console.error(e.message), this;
203
220
  }
204
- }, re = class {
205
- constructor(e, t = new ne()) {
221
+ }, fe = class {
222
+ constructor(e, t = new de()) {
206
223
  S(this, "causes", []), this.handler = t, e && this.addList(e);
207
224
  }
208
225
  has(e, t) {
@@ -228,29 +245,48 @@ var ne = class {
228
245
  }
229
246
  assign(e) {
230
247
  let t = this.get(e.code, e.group);
231
- return t ? {
232
- ...t,
233
- ...e
234
- } : e;
248
+ if (t) {
249
+ var n, r;
250
+ return ((n = t.priority) == null ? 500 : n) > ((r = e.priority) == null ? 500 : r) ? {
251
+ ...e,
252
+ ...t
253
+ } : {
254
+ ...t,
255
+ ...e
256
+ };
257
+ }
258
+ return e;
235
259
  }
236
- }, ie = [
260
+ }, pe = [
237
261
  {
238
262
  group: "api",
239
- code: "unknown",
240
- label: "Unknown Error",
241
- message: "An unexpected error occurred. Please try again later."
263
+ code: "cacheClear",
264
+ label: "Cache Clearing Error",
265
+ message: "An error occurred during background cache cleaning."
242
266
  },
243
267
  {
244
268
  group: "api",
245
- code: "timeout",
246
- label: "Request Timeout",
247
- message: "The request took too long to complete. Please check your connection."
269
+ code: "cacheGet",
270
+ label: "Cache Get Error",
271
+ message: "Failed to retrieve data from the cache."
248
272
  },
249
273
  {
250
274
  group: "api",
251
- code: "offline",
252
- label: "No Internet Connection",
253
- message: "Your device is currently offline. Please check your network settings."
275
+ code: "cacheRemove",
276
+ label: "Cache Remove Error",
277
+ message: "Failed to remove data from the cache."
278
+ },
279
+ {
280
+ group: "api",
281
+ code: "cacheSet",
282
+ label: "Cache Set Error",
283
+ message: "Failed to save data to cache."
284
+ },
285
+ {
286
+ group: "api",
287
+ code: "forbidden",
288
+ label: "Forbidden",
289
+ message: "You do not have the necessary permissions to access this resource."
254
290
  },
255
291
  {
256
292
  group: "api",
@@ -258,12 +294,36 @@ var ne = class {
258
294
  label: "Resource Not Found",
259
295
  message: "The requested resource could not be found on the server."
260
296
  },
297
+ {
298
+ group: "api",
299
+ code: "offline",
300
+ label: "No Internet Connection",
301
+ message: "Your device is currently offline. Please check your network settings."
302
+ },
261
303
  {
262
304
  group: "api",
263
305
  code: "server",
264
306
  label: "Internal Server Error",
265
307
  message: "Something went wrong on our end. We are working to fix it."
266
308
  },
309
+ {
310
+ group: "api",
311
+ code: "timeout",
312
+ label: "Request Timeout",
313
+ message: "The request took too long to complete. Please check your connection."
314
+ },
315
+ {
316
+ group: "api",
317
+ code: "unauthorized",
318
+ label: "Unauthorized access",
319
+ message: "Your session has expired, or you do not have permission to access this resource."
320
+ },
321
+ {
322
+ group: "api",
323
+ code: "unknown",
324
+ label: "Unknown Error",
325
+ message: "An unexpected error occurred. Please try again later."
326
+ },
267
327
  {
268
328
  group: "broadcast",
269
329
  code: "error",
@@ -271,17 +331,41 @@ var ne = class {
271
331
  message: "An unexpected error occurred. Please try again later."
272
332
  },
273
333
  {
274
- group: "storage",
334
+ group: "clipboard",
275
335
  code: "error",
276
- label: "Storage Error",
336
+ label: "Clipboard Error",
337
+ message: "An unexpected error occurred while accessing the clipboard."
338
+ },
339
+ {
340
+ group: "hydration",
341
+ code: "error",
342
+ label: "Hydration Error",
343
+ message: "An error occurred during data hydration."
344
+ },
345
+ {
346
+ group: "intl",
347
+ code: "datetime",
348
+ label: "Intl Datetime Error",
277
349
  message: "An unexpected error occurred. Please try again later."
278
350
  },
351
+ {
352
+ group: "intl",
353
+ code: "invalid",
354
+ label: "Invalid Date",
355
+ message: "The provided date is invalid or in an incorrect format."
356
+ },
279
357
  {
280
358
  group: "intl",
281
359
  code: "display",
282
360
  label: "Intl Display Error",
283
361
  message: "An unexpected error occurred. Please try again later."
284
362
  },
363
+ {
364
+ group: "intl",
365
+ code: "number",
366
+ label: "Intl Number Error",
367
+ message: "An unexpected error occurred. Please try again later."
368
+ },
285
369
  {
286
370
  group: "intl",
287
371
  code: "plural",
@@ -295,68 +379,175 @@ var ne = class {
295
379
  message: "An unexpected error occurred. Please try again later."
296
380
  },
297
381
  {
298
- group: "intl",
299
- code: "datetime",
300
- label: "Intl Datetime Error",
301
- message: "An unexpected error occurred. Please try again later."
382
+ group: "share",
383
+ code: "error",
384
+ label: "Share Error",
385
+ message: "An unexpected error occurred during sharing."
302
386
  },
303
387
  {
304
- group: "intl",
305
- code: "number",
306
- label: "Intl Number Error",
388
+ group: "storage",
389
+ code: "context",
390
+ label: "Context Missing Error",
391
+ message: "Storage context is missing (is init() called?). Isolation failed: data will not be saved for this request."
392
+ },
393
+ {
394
+ group: "storage",
395
+ code: "error",
396
+ label: "Storage Error",
307
397
  message: "An unexpected error occurred. Please try again later."
398
+ },
399
+ {
400
+ group: "transformation",
401
+ code: "error",
402
+ label: "Transformation Error",
403
+ message: "An error occurred during data transformation."
404
+ },
405
+ {
406
+ group: "translate",
407
+ code: "error",
408
+ label: "Translate Error",
409
+ message: "An error occurred while loading translations."
308
410
  }
309
411
  ], C = class {
412
+ static getItem() {
413
+ return this.item;
414
+ }
310
415
  static has(e, t) {
311
- return this.item.has(e, t);
416
+ return this.getItem().has(e, t);
312
417
  }
313
418
  static get(e, t) {
314
- return this.item.get(e, t);
315
- }
316
- static getItem() {
317
- return this.item;
419
+ return this.getItem().get(e, t);
318
420
  }
319
421
  static add(e) {
320
- return this.item.add(e), this;
422
+ this.getItem().add(e);
321
423
  }
322
424
  static addList(e) {
323
- return this.item.addList(e), this;
425
+ this.getItem().addList(e);
324
426
  }
325
427
  static addHandler(e, t) {
326
- return this.item.addHandler(e, t), this;
428
+ this.getItem().addHandler(e, t);
327
429
  }
328
430
  static addHandlerList(e) {
329
- return this.item.addHandlerList(e), this;
431
+ this.getItem().addHandlerList(e);
330
432
  }
331
433
  static on(e) {
332
- return this.item.on(e), this;
434
+ this.getItem().on(e);
333
435
  }
334
436
  };
335
- S(C, "item", new re(ie));
437
+ S(C, "item", new fe(pe));
438
+ //#endregion
439
+ //#region src/functions/getElementSafeScript.ts
440
+ function me(e, t) {
441
+ return `<script id="${e.replace(/"/g, "&quot;")}" type="application/json">${JSON.stringify(t).replace(/<\/(script)>/gi, "<\\/$1>")}<\/script>`;
442
+ }
443
+ //#endregion
444
+ //#region src/functions/getHydrationData.ts
445
+ function he(e, t, n = !0) {
446
+ if (typeof document < "u") {
447
+ let t = document.getElementById(e);
448
+ if (t) try {
449
+ let e = JSON.parse(t.textContent || "");
450
+ return n && t.remove(), e;
451
+ } catch (t) {
452
+ C.on({
453
+ group: "hydration",
454
+ code: "error",
455
+ details: {
456
+ id: e,
457
+ error: t
458
+ }
459
+ });
460
+ }
461
+ }
462
+ return t;
463
+ }
464
+ //#endregion
465
+ //#region src/classes/ServerStorage.ts
466
+ var w = "__ui:server-storage__", ge = "__ui:server:storage:id__", T = class {
467
+ static init(e) {
468
+ return this.listener || (this.listener = e), this;
469
+ }
470
+ static reset() {
471
+ this.storage = void 0, this.listener = void 0;
472
+ }
473
+ static has(e) {
474
+ return e in this.getStorage();
475
+ }
476
+ static get(e, t, n = !1) {
477
+ let r = this.getStorage();
478
+ if (e in r) return r[e].value;
479
+ if (t) return this.set(e, t, n);
480
+ }
481
+ static set(e, t, n = !1) {
482
+ let r = this.getStorage(), i = t();
483
+ return r[e] = {
484
+ value: i,
485
+ hydration: n
486
+ }, i;
487
+ }
488
+ static setErrorStatus(e) {
489
+ this.hideError = e;
490
+ }
491
+ static remove(e) {
492
+ let t = this.getStorage();
493
+ e in t && delete t[e];
494
+ }
495
+ static toString() {
496
+ return me(ge, this.getDataForHydration());
497
+ }
498
+ static getStorage() {
499
+ var e;
500
+ if (s()) return this.getStorageDom();
501
+ let t = (e = this.listener) == null ? void 0 : e.call(this);
502
+ return t ? (w in t || (t[w] = {}), t[w]) : (this.hideError || C.on({
503
+ group: "storage",
504
+ code: "context"
505
+ }), this.storage || (this.storage = {}), this.storage);
506
+ }
507
+ static getStorageDom() {
508
+ if (!this.storage) {
509
+ let e = he(ge, {});
510
+ this.storage = {}, r(e, (e, t) => {
511
+ this.storage[t] = {
512
+ value: e,
513
+ hydration: !0
514
+ };
515
+ });
516
+ }
517
+ return this.storage;
518
+ }
519
+ static getDataForHydration() {
520
+ let e = this.getStorage(), t = {};
521
+ return r(e, (e, n) => {
522
+ e.hydration && (t[n] = e.value);
523
+ }), t;
524
+ }
525
+ };
526
+ S(T, "storage", void 0), S(T, "listener", void 0), S(T, "hideError", void 0);
336
527
  //#endregion
337
528
  //#region src/classes/DataStorage.ts
338
- var w = {}, ae = "ui-storage", T = class {
529
+ var _e = "ui-storage", ve = () => T.get("__ui:data-storage__", () => ({})), E = class {
339
530
  static setPrefix(e) {
340
- ae = e;
531
+ _e = e;
341
532
  }
342
533
  constructor(e, t = !1, n = C.getItem()) {
343
534
  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 w) return w[r];
346
- this.make(), w[r] = this;
535
+ let r = `${t ? "session" : "storage"}#${e}`, i = ve();
536
+ if (r in i) return i[r];
537
+ this.make(), i[r] = this;
347
538
  }
348
539
  get(e, t) {
349
- if (this.value !== null && this.value !== void 0 && this.isCache(t)) return this.value;
540
+ if (!c(this.value) && this.isCache(t)) return this.value;
350
541
  if (e !== void 0) return this.set(e);
351
542
  }
352
543
  set(e) {
353
- if (this.value = y(e), this.age = (/* @__PURE__ */ new Date()).getTime(), this.value === void 0) this.remove();
544
+ if (this.value = b(e), this.age = Date.now(), this.value === void 0) this.remove();
354
545
  else {
355
546
  var t;
356
- (t = this.getMethod()) == null || t.setItem(this.getIndex(), JSON.stringify({
547
+ (t = this.getMethod()) == null || t.setItem(this.getIndex(), se(JSON.stringify({
357
548
  value: this.value,
358
549
  age: this.age
359
- }));
550
+ })));
360
551
  }
361
552
  return this.value;
362
553
  }
@@ -368,23 +559,23 @@ var w = {}, ae = "ui-storage", T = class {
368
559
  return this.make(), this;
369
560
  }
370
561
  isCache(e) {
371
- return s(e) || this.age && this.age + e * 1e3 >= (/* @__PURE__ */ new Date()).getTime();
562
+ return c(e) || this.age && this.age + e * 1e3 >= Date.now();
372
563
  }
373
564
  getMethod() {
374
- if (m() && !b()) {
565
+ if (s() && !ce()) {
375
566
  var e, t;
376
567
  let n = this.isSession ? (e = window) == null ? void 0 : e.sessionStorage : (t = window) == null ? void 0 : t.localStorage;
377
568
  if (n) return n;
378
569
  }
379
570
  }
380
571
  getIndex() {
381
- return `${ae}__${this.name}`;
572
+ return `${_e}__${this.name}`;
382
573
  }
383
574
  getValue() {
384
- var e;
385
- let t = (e = this.getMethod()) == null ? void 0 : e.getItem(this.getIndex());
386
- if (t) try {
387
- return JSON.parse(t);
575
+ var e, t;
576
+ let n = (e = this.getMethod()) == null || (t = e.getItem) == null ? void 0 : t.call(e, this.getIndex());
577
+ if (n) try {
578
+ return JSON.parse(n);
388
579
  } catch (e) {
389
580
  this.errorCenter.on({
390
581
  group: "storage",
@@ -397,134 +588,198 @@ var w = {}, ae = "ui-storage", T = class {
397
588
  let e = this.getValue();
398
589
  return e ? (this.value = e.value, this.age = e.age) : (this.value = void 0, this.age = void 0), this;
399
590
  }
400
- }, E, oe = "geo-code", D = class {
401
- static get() {
591
+ }, ye = "__ui:geo-code__", be = class {
592
+ constructor() {
593
+ S(this, "storage", new E(ye)), S(this, "location", void 0), S(this, "item", void 0), S(this, "language", void 0), S(this, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), this.location = this.findLocation(), this.item = this.getByCode(this.location), this.language = this.findLanguage(this.location);
594
+ }
595
+ get() {
402
596
  return this.item;
403
597
  }
404
- static getCountry() {
598
+ getCountry() {
405
599
  return this.item.country;
406
600
  }
407
- static getLanguage() {
601
+ getLanguage() {
408
602
  return this.language;
409
603
  }
410
- static getStandard() {
411
- return this.item.standard;
604
+ getStandard() {
605
+ return this.getItem().standard;
412
606
  }
413
- static getFirstDay() {
607
+ getFirstDay() {
414
608
  return this.item.firstDay;
415
609
  }
416
- static getLocation() {
610
+ getLocation() {
417
611
  return this.location;
418
612
  }
419
- static getItem() {
420
- return r(this.item, { language: this.language });
613
+ getItem() {
614
+ return {
615
+ ...this.item,
616
+ language: this.language,
617
+ standard: `${this.language}-${this.item.country}`
618
+ };
421
619
  }
422
- static getList() {
620
+ getList() {
423
621
  return e;
424
622
  }
425
- static getByCode(e) {
623
+ getByCode(e) {
426
624
  var t;
427
625
  let n;
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));
626
+ return e && (/([A-Z]{2}-[a-z]{2})|([a-z]{2}-[A-Z]{2})/.test(e) && (n = this.getByCodeFull(e)), !n && /[a-z]{2}/.test(e) && (n = this.getByLanguage(this.toLanguage(e))), !n && /[A-Z]{2}/.test(e) && (n = this.getByCountry(this.toCountry(e)))), this.toFull((t = n) == null ? this.getList()[0] : t);
429
627
  }
430
- static getByCodeFull(e) {
431
- return this.getList().find((t) => _(e, [`${t.language}-${t.country}`, `${t.country}-${t.language}`]));
628
+ getByCodeFull(e) {
629
+ return this.getList().find((t) => v(e, [`${t.language}-${t.country}`, `${t.country}-${t.language}`]));
432
630
  }
433
- static getByCountry(e) {
631
+ getByCountry(e) {
434
632
  return this.getList().find((t) => {
435
633
  var n;
436
- return t.country === e || (t == null || (n = t.countryAlternative) == null ? void 0 : n.find((t) => t === e));
634
+ return t.country === e || (t == null || (n = t.countryAlternative) == null ? void 0 : n.includes(e));
437
635
  });
438
636
  }
439
- static getByLanguage(e) {
637
+ getByLanguage(e) {
440
638
  return this.getList().find((t) => {
441
639
  var n;
442
- return t.language === e || (t == null || (n = t.languageAlternative) == null ? void 0 : n.find((t) => t === e));
640
+ return t.language === e || (t == null || (n = t.languageAlternative) == null ? void 0 : n.includes(e));
443
641
  });
444
642
  }
445
- static getTimezone() {
643
+ getTimezone() {
446
644
  return this.timezone;
447
645
  }
448
- static getTimezoneFormat() {
646
+ getTimezoneFormat() {
449
647
  let e = Math.abs(Math.trunc(this.timezone / 60)).toString().padStart(2, "0"), t = Math.abs(this.timezone % 60).toString().padStart(2, "0");
450
648
  return this.timezone >= 0 ? `-${e}:${t}` : `+${e}:${t}`;
451
649
  }
452
- static find(e) {
650
+ find(e) {
453
651
  return this.getByCode(e);
454
652
  }
455
- static toStandard(e) {
653
+ toStandard(e) {
456
654
  return `${e.language}-${e.country}`;
457
655
  }
458
- static set(e, t) {
656
+ set(e, t) {
459
657
  this.location = e, this.item = this.getByCode(this.location), this.language = this.findLanguage(this.location), t && this.storage.set(this.location);
460
658
  }
461
- static setTimezone(e) {
659
+ setTimezone(e) {
462
660
  this.timezone = e;
463
661
  }
464
- static findLocation() {
662
+ findLocation() {
465
663
  var e;
466
- return m() && (this.storage.get() || ((e = document.querySelector("html")) == null ? void 0 : e.lang) || navigator.language || navigator.languages[0] || "en-GB") || "en-GB";
664
+ return s() && (this.storage.get() || ((e = document.querySelector("html")) == null ? void 0 : e.lang) || navigator.language || navigator.languages[0] || "en-GB") || "en-GB";
467
665
  }
468
- static findLanguage(e) {
469
- return e && e.match(/[a-z]{2}/) ? this.toLanguage(e) : this.item.language;
666
+ findLanguage(e) {
667
+ return e && /[a-z]{2}/.test(e) ? this.toLanguage(e) : this.item.language;
470
668
  }
471
- static toCountry(e) {
669
+ toCountry(e) {
472
670
  return e.replace(/[^A-Z]+/g, "");
473
671
  }
474
- static toLanguage(e) {
672
+ toLanguage(e) {
475
673
  return e.replace(/[^a-z]+/g, "");
476
674
  }
477
- static toFull(e) {
478
- return r(e, {
675
+ toFull(e) {
676
+ return {
677
+ ...e,
479
678
  standard: this.toStandard(e),
480
679
  firstDay: (e == null ? void 0 : e.firstDay) || "Mo"
481
- });
680
+ };
681
+ }
682
+ }, D = class {
683
+ static getObject() {
684
+ return T.get("__ui:geo-instance__", () => new be());
685
+ }
686
+ static get() {
687
+ return this.getObject().get();
688
+ }
689
+ static getCountry() {
690
+ return this.getObject().getCountry();
691
+ }
692
+ static getLanguage() {
693
+ return this.getObject().getLanguage();
694
+ }
695
+ static getStandard() {
696
+ return this.getObject().getStandard();
697
+ }
698
+ static getFirstDay() {
699
+ return this.getObject().getFirstDay();
700
+ }
701
+ static getLocation() {
702
+ return this.getObject().getLocation();
703
+ }
704
+ static getItem() {
705
+ return this.getObject().getItem();
706
+ }
707
+ static getList() {
708
+ return this.getObject().getList();
709
+ }
710
+ static getByCode(e) {
711
+ return this.getObject().getByCode(e);
712
+ }
713
+ static getByCodeFull(e) {
714
+ return this.getObject().getByCodeFull(e);
715
+ }
716
+ static getByCountry(e) {
717
+ return this.getObject().getByCountry(e);
718
+ }
719
+ static getByLanguage(e) {
720
+ return this.getObject().getByLanguage(e);
721
+ }
722
+ static getTimezone() {
723
+ return this.getObject().getTimezone();
724
+ }
725
+ static getTimezoneFormat() {
726
+ return this.getObject().getTimezoneFormat();
727
+ }
728
+ static find(e) {
729
+ return this.getObject().find(e);
730
+ }
731
+ static toStandard(e) {
732
+ return this.getObject().toStandard(e);
733
+ }
734
+ static set(e, t) {
735
+ this.getObject().set(e, t);
736
+ }
737
+ static setTimezone(e) {
738
+ this.getObject().setTimezone(e);
482
739
  }
483
740
  };
484
- E = D, S(D, "storage", new T(oe)), S(D, "location", void 0), S(D, "item", void 0), S(D, "language", void 0), S(D, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), E.location = E.findLocation(), E.language = E.findLanguage(E.location), E.item = E.getByCode(E.location);
485
741
  //#endregion
486
742
  //#region src/functions/isWindow.ts
487
- function O(e) {
488
- return m() && e === window;
743
+ function xe(e) {
744
+ return s() && e === window;
489
745
  }
490
746
  //#endregion
491
747
  //#region src/functions/getElement.ts
492
- function k(e) {
493
- if (m()) {
494
- if (O(e)) return document.body;
495
- if (u(e)) {
496
- var t;
497
- return (t = document.querySelector(e)) == null ? void 0 : t;
498
- }
499
- return e;
748
+ function O(e) {
749
+ if (!s()) return d(e) ? void 0 : e;
750
+ if (xe(e)) return document.body;
751
+ if (d(e)) {
752
+ var t;
753
+ return (t = document.querySelector(e)) == null ? void 0 : t;
500
754
  }
755
+ return e;
501
756
  }
502
757
  //#endregion
503
758
  //#region src/functions/getElementOrWindow.ts
504
- function se(e) {
505
- return O(e) ? e : k(e);
759
+ function Se(e) {
760
+ return xe(e) ? e : O(e);
506
761
  }
507
762
  //#endregion
508
763
  //#region src/functions/isInDom.ts
509
- function ce(e) {
764
+ function Ce(e) {
510
765
  var t;
511
- return !!((t = k(e)) != null && t.closest("html"));
766
+ return (e == null ? void 0 : e.isConnected) || !!((t = O(e)) != null && t.closest("html"));
512
767
  }
513
768
  //#endregion
514
769
  //#region src/functions/toArray.ts
515
- function A(e) {
770
+ function k(e) {
516
771
  return Array.isArray(e) ? e : [e];
517
772
  }
518
773
  //#endregion
519
774
  //#region src/classes/EventItem.ts
520
- var le = class {
775
+ var we = class {
521
776
  constructor(e, n = ["click"], r, i, a) {
522
777
  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 (ce(this.elementControl)) {
778
+ if (Ce(this.elementControl)) {
524
779
  var n, r;
525
780
  (n = this.listener) == null || n.call(this.element, e, this.detail), t(this.options) && (r = this.options) != null && r.once && this.stop();
526
781
  } else this.stop();
527
- }), S(this, "activity", !1), S(this, "activityItems", []), this.listener = r, this.options = i, this.detail = a, this.element = se(e), this.elementControl = k(e), this.type = A(n);
782
+ }), S(this, "activity", !1), S(this, "activityItems", []), this.listener = r, this.options = i, this.detail = a, this.element = Se(e), this.elementControl = O(e), this.type = k(n);
528
783
  }
529
784
  isActive() {
530
785
  return this.activity;
@@ -533,14 +788,14 @@ var le = class {
533
788
  return this.element;
534
789
  }
535
790
  setElement(e) {
536
- let t = se(e);
537
- return this.elementControlEdit || (this.elementControl = k(e)), this.element = t, this.reset(), this;
791
+ let t = Se(e);
792
+ return this.elementControlEdit || (this.elementControl = O(e)), this.element = t, this.reset(), this;
538
793
  }
539
794
  setElementControl(e) {
540
- return this.elementControl = k(e), this.elementControlEdit = !s(this.elementControl), this.elementControlEdit || (this.elementControl = k(this.element)), this;
795
+ return this.elementControl = O(e), this.elementControlEdit = !c(this.elementControl), this.elementControlEdit || (this.elementControl = O(this.element)), this;
541
796
  }
542
797
  setType(e) {
543
- return this.type = A(e), this.reset(), this;
798
+ return this.type = k(e), this.reset(), this;
544
799
  }
545
800
  setListener(e) {
546
801
  return this.listener = e, this;
@@ -558,7 +813,7 @@ var le = class {
558
813
  }), this;
559
814
  }
560
815
  start() {
561
- return this.activity || (this.activity = !0, this.activityItems = [], this.type.forEach((e) => {
816
+ return !this.activity && s() && (this.activity = !0, this.activityItems = [], this.type.forEach((e) => {
562
817
  this.element && !(e === "resize" && this.makeResize()) && !(e === "scroll-sync" && this.makeScroll()) && (this.element.addEventListener(e, this.listenerRecent, this.options), this.activityItems.push({
563
818
  element: this.element,
564
819
  type: e
@@ -577,7 +832,7 @@ var le = class {
577
832
  return this.activity && (this.stop(), this.start()), this;
578
833
  }
579
834
  isObserver() {
580
- return "ResizeObserver" in window;
835
+ return s() && "ResizeObserver" in window;
581
836
  }
582
837
  makeResize() {
583
838
  if (this.element && this.element instanceof HTMLElement && this.element !== document.body && this.isObserver()) {
@@ -609,9 +864,9 @@ var le = class {
609
864
  }
610
865
  return !1;
611
866
  }
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 le(window, this.eventName));
867
+ }, Te = "ui-loading", Ee = class {
868
+ constructor(e = Te) {
869
+ S(this, "value", 0), S(this, "event", void 0), S(this, "registrationList", []), this.eventName = e, s() && (this.event = new we(window, this.eventName));
615
870
  }
616
871
  is() {
617
872
  return this.value > 0;
@@ -626,8 +881,8 @@ var le = class {
626
881
  this.is() && (this.value--, this.dispatch());
627
882
  }
628
883
  registrationEvent(e, t) {
629
- if (m()) {
630
- let n = new le(window, this.eventName, e).setElementControl(t).start();
884
+ if (s()) {
885
+ let n = new we(window, this.eventName, e).setElementControl(t).start();
631
886
  this.registrationList.push({
632
887
  item: n,
633
888
  listener: e,
@@ -642,72 +897,117 @@ var le = class {
642
897
  var e;
643
898
  (e = this.event) == null || e.dispatch({ loading: this.is() });
644
899
  }
645
- }, j = class {
900
+ }, A = class {
646
901
  static is() {
647
- return this.item.is();
902
+ return this.getItem().is();
648
903
  }
649
904
  static get() {
650
- return this.item.get();
905
+ return this.getItem().get();
651
906
  }
652
907
  static getItem() {
653
- return this.item;
908
+ return T.get("__ui:loading-instance__", () => new Ee());
654
909
  }
655
910
  static show() {
656
- this.item.show();
911
+ this.getItem().show();
657
912
  }
658
913
  static hide() {
659
- this.item.hide();
914
+ this.getItem().hide();
660
915
  }
661
916
  static registrationEvent(e, t) {
662
- this.item.registrationEvent(e, t);
917
+ this.getItem().registrationEvent(e, t);
663
918
  }
664
919
  static unregistrationEvent(e, t) {
665
- this.item.unregistrationEvent(e, t);
920
+ this.getItem().unregistrationEvent(e, t);
666
921
  }
667
- };
668
- S(j, "item", new de());
669
- //#endregion
670
- //#region src/classes/ApiHeaders.ts
671
- var fe = class {
672
- constructor() {
673
- S(this, "headers", {});
674
- }
675
- get(e, t = "application/json;charset=UTF-8") {
676
- if (e !== null) {
677
- let n = r(this.headers, e);
678
- return c(t) && (n["Content-Type"] = t), n;
679
- }
922
+ }, De, Oe = 1440 * 60, j = class {
923
+ static init(e, t, n, r) {
924
+ this.getListener = e, this.setListener = t, this.removeListener = n, r && (this.cacheStepAgeClearOld = r, this.stepAgeClearOld = r);
680
925
  }
681
- set(e) {
682
- return n(e) && (this.headers = e), this;
926
+ static reset() {
927
+ this.items = void 0, this.getListener = void 0, this.setListener = void 0, this.removeListener = void 0, this.stepAgeClearOld = this.cacheStepAgeClearOld;
683
928
  }
684
- }, M = /* @__PURE__ */ function(e) {
685
- return e.get = "GET", e.post = "POST", e.put = "PUT", e.delete = "DELETE", e;
686
- }({}), pe = class {
687
- constructor() {
688
- S(this, "value", void 0);
929
+ static async get(e) {
930
+ let t = await this.getItemOrListener(e);
931
+ return this.clearOld().catch((e) => {
932
+ C.on({
933
+ group: "api",
934
+ code: "cacheClear",
935
+ details: e
936
+ });
937
+ }), t == null ? void 0 : t.value;
689
938
  }
690
- is() {
691
- return !!this.value;
939
+ static async getByFetch(e) {
940
+ if (!this.isCache(e)) return;
941
+ let t = this.generateKey(e);
942
+ return await this.get(t);
692
943
  }
693
- get() {
694
- return this.value;
944
+ static async set(e, t, n = Oe) {
945
+ let r = {
946
+ value: t,
947
+ age: n,
948
+ cacheAge: Date.now()
949
+ };
950
+ await this.setItemOrListener(e, r);
695
951
  }
696
- request(e) {
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);
952
+ static async setByFetch(e, t) {
953
+ if (this.isCache(e)) {
954
+ let n = this.generateKey(e);
955
+ await this.set(n, t, e.cache);
701
956
  }
702
- return e;
703
957
  }
704
- set(e) {
705
- this.value = e;
958
+ static async remove(e) {
959
+ await this.removeItemOrListener(e);
960
+ }
961
+ static isCache(e) {
962
+ let { cache: t, enableClientCache: n } = e;
963
+ return s() && !n ? !1 : !!t;
964
+ }
965
+ static isAge(e) {
966
+ return e ? e.age ? e.age * 1e3 + e.cacheAge >= Date.now() : !0 : !1;
967
+ }
968
+ static isItem(e) {
969
+ return e in this.getList();
970
+ }
971
+ static generateKey(e) {
972
+ return JSON.stringify({
973
+ api: e.api,
974
+ auth: e.auth,
975
+ method: e.method,
976
+ path: e.path,
977
+ pathFull: e.pathFull,
978
+ request: e.request,
979
+ toData: e.toData,
980
+ cacheId: e.cacheId
981
+ });
706
982
  }
707
- addByFormData(e, t) {
708
- for (let n in t) e.has(n) || e.set(n, t[n]);
983
+ static async getItemOrListener(e) {
984
+ let t = this.getListener ? await this.getListener(e) : this.getList()[e];
985
+ if (this.isAge(t)) return t;
709
986
  }
710
- }, N = class {
987
+ static getList() {
988
+ return this.items || (this.items = {}), this.items;
989
+ }
990
+ static async setItemOrListener(e, t) {
991
+ let n = this.setListener ? await this.setListener(e, t) : !1;
992
+ this.getList()[e] = {
993
+ ...t,
994
+ value: n ? void 0 : t.value
995
+ };
996
+ }
997
+ static async removeItemOrListener(e) {
998
+ this.removeListener && await this.removeListener(e), this.isItem(e) && delete this.getList()[e];
999
+ }
1000
+ static async clearOld() {
1001
+ if (!(this.stepAgeClearOld-- > 0) && (this.stepAgeClearOld = this.cacheStepAgeClearOld, this.items)) for (let e in this.items) {
1002
+ let t = this.items[e];
1003
+ this.isAge(t) || await this.removeItemOrListener(e);
1004
+ }
1005
+ }
1006
+ };
1007
+ De = j, S(j, "items", void 0), S(j, "getListener", void 0), S(j, "setListener", void 0), S(j, "removeListener", void 0), S(j, "cacheStepAgeClearOld", 16384), S(j, "stepAgeClearOld", De.cacheStepAgeClearOld);
1008
+ //#endregion
1009
+ //#region src/classes/ApiStatus.ts
1010
+ var ke = class {
711
1011
  constructor() {
712
1012
  S(this, "value", void 0);
713
1013
  }
@@ -726,6 +1026,10 @@ var fe = class {
726
1026
  var e;
727
1027
  return (e = this.get()) == null ? void 0 : e.lastStatus;
728
1028
  }
1029
+ getCode() {
1030
+ var e;
1031
+ return (e = this.get()) == null ? void 0 : e.lastCode;
1032
+ }
729
1033
  getError() {
730
1034
  var e;
731
1035
  return (e = this.get()) == null ? void 0 : e.error;
@@ -739,7 +1043,7 @@ var fe = class {
739
1043
  return ((e = this.get()) == null ? void 0 : e.lastMessage) || "";
740
1044
  }
741
1045
  set(e) {
742
- return "status" in e && this.setValue("status", e.status), "statusText" in e && this.setValue("statusText", e.statusText), "error" in e && this.setValue("error", e.error), "lastResponse" in e && this.setValue("lastResponse", e.lastResponse), "lastMessage" in e && this.setValue("lastMessage", e.lastMessage), this;
1046
+ return "status" in e && this.setValue("status", e.status), "statusText" in e && this.setValue("statusText", e.statusText), "error" in e && this.setValue("error", e.error), "lastResponse" in e && this.setValue("lastResponse", e.lastResponse), "lastMessage" in e && this.setValue("lastMessage", e.lastMessage), "lastStatus" in e && this.setValue("lastStatus", e.lastStatus), "lastCode" in e && this.setValue("lastCode", e.lastCode), this;
743
1047
  }
744
1048
  setStatus(e, t) {
745
1049
  return this.set({
@@ -751,27 +1055,163 @@ var fe = class {
751
1055
  return this.set({ error: e }), this;
752
1056
  }
753
1057
  setLastResponse(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;
1058
+ return e && n(e) && ("message" in e && this.setLastMessage(String(e.message)), "status" in e && this.setLastStatus(String(e.status)), "code" in e && this.setLastCode(String(e.code))), this.set({ lastResponse: e }), this;
755
1059
  }
756
1060
  setLastStatus(e) {
757
1061
  return this.set({ lastStatus: e }), this;
758
1062
  }
1063
+ setLastCode(e) {
1064
+ return this.set({ lastCode: e }), this;
1065
+ }
759
1066
  setLastMessage(e) {
760
1067
  return this.set({ lastMessage: e }), this;
761
1068
  }
762
1069
  setValue(e, t) {
763
1070
  this.value || (this.value = {}), this.value[e] = t;
764
1071
  }
1072
+ }, Ae = [
1073
+ "success",
1074
+ "status",
1075
+ "code",
1076
+ "message"
1077
+ ], je = class {
1078
+ constructor(e, t, n) {
1079
+ S(this, "data", void 0), S(this, "dataMod", void 0), this.apiFetch = e, this.query = t, this.end = n;
1080
+ }
1081
+ async init() {
1082
+ return this.data = await this.readData(), this;
1083
+ }
1084
+ get() {
1085
+ return this.dataMod || (this.dataMod = this.initData()), this.dataMod;
1086
+ }
1087
+ getAndStatus(e) {
1088
+ let t = this.get();
1089
+ return t && n(t) ? {
1090
+ ...t,
1091
+ statusObject: e.get()
1092
+ } : t;
1093
+ }
1094
+ getData() {
1095
+ return this.data;
1096
+ }
1097
+ async readData() {
1098
+ var e;
1099
+ let { queryReturn: t } = this.apiFetch, n = this.query;
1100
+ return t ? await t(n) : "data" in this.end ? this.end.data : ((e = n.headers.get("Content-Type")) == null ? "" : e).includes("application/json") ? await n.json() : { data: await n.text() };
1101
+ }
1102
+ initData() {
1103
+ let { toData: e = !0 } = this.apiFetch, t = this.getData();
1104
+ return t ? !e || !t || !n(t) || !("data" in t) ? t : t.data !== null && typeof t.data != "object" || i(t.data) ? t.data : this.initItem(t) : {};
1105
+ }
1106
+ initItem(e) {
1107
+ let t = { ...e.data };
1108
+ return Ae.forEach((n) => {
1109
+ n in e && !(n in t) && (t[n] = e[n]);
1110
+ }), t;
1111
+ }
1112
+ }, M = /* @__PURE__ */ function(e) {
1113
+ return e.delete = "DELETE", e.get = "GET", e.post = "POST", e.put = "PUT", e.patch = "PATCH", e;
1114
+ }({}), Me = class {
1115
+ constructor() {
1116
+ S(this, "value", void 0);
1117
+ }
1118
+ is() {
1119
+ return !!this.value;
1120
+ }
1121
+ get() {
1122
+ return this.value;
1123
+ }
1124
+ request(e) {
1125
+ let t = this.get();
1126
+ if (l(t)) {
1127
+ if (e instanceof FormData) this.addByFormData(e, t);
1128
+ else if (n(e)) return {
1129
+ ...t,
1130
+ ...e
1131
+ };
1132
+ }
1133
+ return e;
1134
+ }
1135
+ set(e) {
1136
+ return this.value = e, this;
1137
+ }
1138
+ addByFormData(e, t) {
1139
+ return Object.entries(t).forEach(([t, n]) => {
1140
+ e.has(t) || e.set(t, n);
1141
+ }), this;
1142
+ }
1143
+ }, Ne = class {
1144
+ constructor() {
1145
+ S(this, "headers", {});
1146
+ }
1147
+ get(e, t = "application/json;charset=UTF-8") {
1148
+ if (e === null) return;
1149
+ let r = { ...this.headers };
1150
+ return n(e) && Object.assign(r, e), l(t) && (r["Content-Type"] = t), r;
1151
+ }
1152
+ getByRequest(e, t, n = "application/json;charset=UTF-8") {
1153
+ return e instanceof FormData ? this.get(t, null) : this.get(t, n);
1154
+ }
1155
+ set(e) {
1156
+ return n(e) && (this.headers = e), this;
1157
+ }
1158
+ }, Pe = "__ui:api:hydration:id__", Fe = class {
1159
+ constructor() {
1160
+ S(this, "list", []);
1161
+ }
1162
+ initResponse(e) {
1163
+ s() && e.add(this.getListByClient());
1164
+ }
1165
+ toClient(e, t) {
1166
+ let { path: n, method: r = M.get, request: i, global: a = r === M.get } = e;
1167
+ !a || !n || s() || this.list.push({
1168
+ path: n,
1169
+ method: r,
1170
+ request: i,
1171
+ response: t
1172
+ });
1173
+ }
1174
+ toString() {
1175
+ return me(Pe, this.list);
1176
+ }
1177
+ getListByClient() {
1178
+ return he(Pe, []);
1179
+ }
1180
+ }, Ie = class {
1181
+ constructor() {
1182
+ S(this, "callback", void 0), S(this, "callbackEnd", void 0), S(this, "loading", !1);
1183
+ }
1184
+ async make(e, t) {
1185
+ if (e && this.callback) return this.go(t);
1186
+ }
1187
+ async makeEnd(e, t, n) {
1188
+ return e && this.callbackEnd ? await this.callbackEnd(t, n) : {};
1189
+ }
1190
+ set(e) {
1191
+ return this.callback = e, this;
1192
+ }
1193
+ setEnd(e) {
1194
+ return this.callbackEnd = e, this;
1195
+ }
1196
+ async go(e, t = 32) {
1197
+ return new Promise((n) => {
1198
+ this.loading && t > 0 ? setTimeout(() => this.go(e, t - 1).then(n), 160) : this.callback ? (this.loading = !0, this.callback(e).then(() => {
1199
+ this.loading = !1, n();
1200
+ }).catch(() => {
1201
+ this.loading = !1, n();
1202
+ })) : n();
1203
+ });
1204
+ }
765
1205
  };
766
1206
  //#endregion
767
1207
  //#region src/functions/executePromise.ts
768
- async function me(e, ...t) {
769
- let n = y(e, ...t);
1208
+ async function Le(e, ...t) {
1209
+ let n = b(e, ...t);
770
1210
  return n instanceof Promise ? await n : n;
771
1211
  }
772
1212
  //#endregion
773
1213
  //#region src/classes/ApiResponse.ts
774
- var he = "d-response-loading", ge = class {
1214
+ var Re = "d-response-loading", ze = class {
775
1215
  constructor(e) {
776
1216
  S(this, "first", []), S(this, "response", []), S(this, "loading", void 0), S(this, "devMode", !1), this.requestDefault = e;
777
1217
  }
@@ -782,12 +1222,13 @@ var he = "d-response-loading", ge = class {
782
1222
  return this.response.filter((e) => e.isForGlobal !== !0);
783
1223
  }
784
1224
  add(e) {
785
- return this.response.push(...A(e)), this;
1225
+ return this.response.push(...k(e)), this;
786
1226
  }
787
1227
  setDevMode(e) {
788
1228
  return this.devMode = e, this;
789
1229
  }
790
1230
  async emulator(e) {
1231
+ if (!s()) return;
791
1232
  let { path: t = "", method: n = M.get, global: r = n === M.get, devMode: i = !1 } = e;
792
1233
  if (r || this.isDevMode(i)) {
793
1234
  let r = this.requestDefault.request(e.request), a = this.get(t, n, r, i);
@@ -798,10 +1239,10 @@ var he = "d-response-loading", ge = class {
798
1239
  }
799
1240
  }
800
1241
  isDisable(e) {
801
- return !!y(e == null ? void 0 : e.disable);
1242
+ return !!b(e == null ? void 0 : e.disable);
802
1243
  }
803
1244
  isPath(e, t) {
804
- return t === e.path || !!(e.path instanceof RegExp && t.match(e.path));
1245
+ return t === e.path || !!(e.path instanceof RegExp && e.path.test(t));
805
1246
  }
806
1247
  isDevMode(e) {
807
1248
  return e || this.devMode;
@@ -811,61 +1252,33 @@ var he = "d-response-loading", ge = class {
811
1252
  }
812
1253
  isResponse(e, t) {
813
1254
  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);
1255
+ return t === r || r === "*any" || l(t) && l(r) && n(t) && n(r) && !(t instanceof FormData) && !(r instanceof FormData) && Object.values(t).length === Object.values(r).length && Object.entries(r).every(([e, n]) => n === (t == null ? void 0 : t[e]) || n === "*any");
815
1256
  }
816
1257
  fetch(e, t) {
817
1258
  return this.startResponseLoading(), new Promise((n) => {
818
- me(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));
1259
+ Le(y(e.response) ? e.response(t) : e.response).then((t) => {
1260
+ e != null && e.lag ? (A.show(), setTimeout(() => {
1261
+ this.stopResponseLoading(), n(t), A.hide();
1262
+ }, f(0, 2e3))) : (this.stopResponseLoading(), n(t));
822
1263
  });
823
1264
  });
824
1265
  }
825
1266
  startResponseLoading() {
826
- this.loading && clearTimeout(this.loading), m() && document.body.classList.add(he);
1267
+ this.loading && clearTimeout(this.loading), s() && document.body.classList.add(Re);
827
1268
  }
828
1269
  stopResponseLoading() {
829
- this.loading = setTimeout(() => {
830
- this.loading = void 0, m() && document.body.classList.remove(he);
831
- }, 1200);
832
- }
833
- }, _e = class {
834
- constructor() {
835
- S(this, "callback", void 0), S(this, "callbackEnd", void 0), S(this, "loading", !1);
836
- }
837
- async make(e, t) {
838
- if (e && this.callback) return this.go(t);
839
- }
840
- async makeEnd(e, t, n) {
841
- let r = {};
842
- return e && this.callbackEnd && (r = await this.callbackEnd(t, n)), r;
843
- }
844
- set(e) {
845
- return this.callback = e, this;
1270
+ s() && (this.loading = setTimeout(() => {
1271
+ this.loading = void 0, document.body.classList.remove(Re);
1272
+ }, 2400));
846
1273
  }
847
- setEnd(e) {
848
- return this.callbackEnd = e, this;
849
- }
850
- async go(e) {
851
- return new Promise((t) => {
852
- this.loading ? setTimeout(() => this.go(e).then(t), 160) : this.callback ? (this.loading = !0, this.callback(e).then(() => {
853
- this.loading = !1, t();
854
- })) : t();
855
- });
856
- }
857
- async end(e, t) {
858
- let n = {};
859
- return this.callbackEnd && (n = await this.callbackEnd(e, t)), n;
860
- }
861
- }, ve = class {
1274
+ }, Be = class {
862
1275
  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 = N, responseClass: a = ge, preparationClass: o = _e, 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;
1276
+ 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, "hydration", void 0), S(this, "timeout", 16e3), this.url = e;
1277
+ let { headersClass: n = Ne, requestDefaultClass: r = Me, statusClass: i = ke, responseClass: a = ze, preparationClass: o = Ie, loadingClass: s = A.getItem(), errorCenterClass: c = C.getItem(), hydrationClass: l = Fe } = t;
1278
+ 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, this.hydration = new l(), this.hydration.initResponse(this.response);
866
1279
  }
867
1280
  isLocalhost() {
868
- return typeof location > "u" || location.hostname === "localhost";
1281
+ return s() && typeof location < "u" && location.hostname === "localhost";
869
1282
  }
870
1283
  getStatus() {
871
1284
  return this.status;
@@ -873,20 +1286,26 @@ var he = "d-response-loading", ge = class {
873
1286
  getResponse() {
874
1287
  return this.response;
875
1288
  }
1289
+ getHydration() {
1290
+ return this.hydration;
1291
+ }
876
1292
  getUrl(e, t = !0) {
877
1293
  return `${t ? this.url : ""}${e}`.replace("{locale}", D.getLocation()).replace("{country}", D.getCountry()).replace("{language}", D.getLanguage());
878
1294
  }
879
1295
  getBody(e = {}, t = M.get) {
880
1296
  if (e instanceof FormData) return e;
881
- if (t !== M.get && c(e)) return u(e) ? e : JSON.stringify(e);
1297
+ if (t !== M.get && l(e)) return d(e) ? e : JSON.stringify(e);
882
1298
  }
883
1299
  getBodyForGet(e, t = "", n = M.get) {
884
1300
  if (n === M.get) {
885
- let n = t.match(/\?/) ? "&" : "?", r = typeof e == "object" ? a(e) : e;
886
- if (c(r)) return `${n}${r}`;
1301
+ let n = t.match(/\?/) ? "&" : "?", r = typeof e == "object" ? o(e) : e;
1302
+ if (l(r)) return `${n}${r}`;
887
1303
  }
888
1304
  return "";
889
1305
  }
1306
+ getHydrationScript() {
1307
+ return this.hydration.toString();
1308
+ }
890
1309
  setHeaders(e) {
891
1310
  return this.headers.set(e), this;
892
1311
  }
@@ -906,68 +1325,81 @@ var he = "d-response-loading", ge = class {
906
1325
  return this.timeout = e, this;
907
1326
  }
908
1327
  async request(e) {
909
- return u(e) ? await this.fetch({ path: e }) : await this.fetch(e);
1328
+ return d(e) ? await this.fetch({ path: e }) : await this.fetch(e);
910
1329
  }
911
1330
  get(e) {
912
- return this.request(r(e, { method: M.get }));
1331
+ return this.request({
1332
+ ...e,
1333
+ method: M.get
1334
+ });
913
1335
  }
914
1336
  post(e) {
915
- return this.request(r(e, { method: M.post }));
1337
+ return this.request({
1338
+ ...e,
1339
+ method: M.post
1340
+ });
916
1341
  }
917
1342
  put(e) {
918
- return this.request(r(e, { method: M.put }));
1343
+ return this.request({
1344
+ ...e,
1345
+ method: M.put
1346
+ });
1347
+ }
1348
+ patch(e) {
1349
+ return this.request({
1350
+ ...e,
1351
+ method: M.patch
1352
+ });
919
1353
  }
920
1354
  delete(e) {
921
- return this.request(r(e, { method: M.delete }));
1355
+ return this.request({
1356
+ ...e,
1357
+ method: M.delete
1358
+ });
922
1359
  }
923
1360
  getRetryDelay(e, t) {
924
- return d(t, t + e * t);
1361
+ return f(t, t + e * t);
925
1362
  }
926
1363
  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 N(), p;
930
- i || this.loading.show();
1364
+ let { hideError: n = !1, hideLoading: r = !1, retry: i = 0, retryDelay: a = 64, globalPreparation: o = !0, globalEnd: s = !0, endResetLimit: c = 8 } = e, l = await this.response.emulator(e);
1365
+ if (l) return l;
1366
+ let u = await j.getByFetch(e);
1367
+ if (u) return this.hydration.toClient(e, u), u;
1368
+ let d = new ke(), f;
1369
+ r || this.loading.show();
931
1370
  try {
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);
1371
+ await this.preparation.make(o, e);
1372
+ let { query: l, timeoutId: u } = await this.makeQuery(e);
1373
+ u && clearTimeout(u);
1374
+ let m = await this.preparation.makeEnd(s, l, e);
1375
+ if (d.setStatus(l.status, l.statusText), this.status.setStatus(l.status, l.statusText), !n && l.status >= 400 && this.makeErrorQuery(l), m != null && m.reset && t < c || t < i) return await p(this.getRetryDelay(t, a)), r || this.loading.hide(), await this.fetch(e, t + 1);
1376
+ f = new je(e, l, m), await f.init();
938
1377
  } catch (e) {
939
- throw r || this.makeError(e), d.setError(String(e)), this.status.setError(String(e)), i || this.loading.hide(), e;
1378
+ throw n || this.makeError(e), d.setError(String(e)), this.status.setError(String(e)), r || this.loading.hide(), e;
940
1379
  }
941
- return i || this.loading.hide(), d.setLastResponse(p), this.status.setLastResponse(p), this.makeStatus(this.makeData(p, n), d);
942
- }
943
- async readData(e, t, n) {
944
- var r;
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() };
1380
+ d.setLastResponse(f.getData()), this.status.setLastResponse(f.getData());
1381
+ let m = f.getAndStatus(d);
1382
+ return r || this.loading.hide(), this.hydration.toClient(e, m), await j.setByFetch(e, m), m;
946
1383
  }
947
1384
  async makeQuery(e) {
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, {
949
- method: o,
950
- body: this.getBody(t, o)
951
- });
952
- f && (p.headers = f);
953
- let m = this.initController(e, p);
1385
+ let t = this.requestDefault.request(e.request), { api: n = !0, path: r = "", pathFull: i = void 0, method: a = M.get, headers: o = {}, type: s = "application/json;charset=UTF-8", init: c = {} } = e, l = i == null ? this.getUrl(r, n) : i, u = `${l}${this.getBodyForGet(t, l, a)}`, d = this.headers.getByRequest(e.request, o, s), f = {
1386
+ ...c,
1387
+ method: a,
1388
+ body: this.getBody(t, a)
1389
+ };
1390
+ if (d) {
1391
+ var p;
1392
+ f.headers = {
1393
+ ...d,
1394
+ ...(p = c.headers) == null ? {} : p
1395
+ };
1396
+ }
1397
+ let m = this.initController(e, f);
954
1398
  return {
955
- query: await fetch(d, p),
1399
+ query: await fetch(u, f),
956
1400
  timeoutId: m
957
1401
  };
958
1402
  }
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;
964
- }
965
- makeStatus(e, t) {
966
- return e && n(e) ? {
967
- ...e,
968
- statusObject: t.get()
969
- } : e;
970
- }
971
1403
  makeError(e, t = "api") {
972
1404
  switch (e.name) {
973
1405
  case "TimeoutError":
@@ -978,7 +1410,7 @@ var he = "d-response-loading", ge = class {
978
1410
  });
979
1411
  break;
980
1412
  case "AbortError": break;
981
- default: l() ? this.errorCenter.on({
1413
+ default: u() ? this.errorCenter.on({
982
1414
  group: t,
983
1415
  code: "unknown",
984
1416
  details: e
@@ -991,6 +1423,20 @@ var he = "d-response-loading", ge = class {
991
1423
  }
992
1424
  makeErrorQuery(e) {
993
1425
  switch (e.status) {
1426
+ case 401:
1427
+ this.errorCenter.on({
1428
+ group: "api",
1429
+ code: "unauthorized",
1430
+ details: e
1431
+ });
1432
+ break;
1433
+ case 403:
1434
+ this.errorCenter.on({
1435
+ group: "api",
1436
+ code: "forbidden",
1437
+ details: e
1438
+ });
1439
+ break;
994
1440
  case 404:
995
1441
  this.errorCenter.on({
996
1442
  group: "api",
@@ -1014,7 +1460,7 @@ var he = "d-response-loading", ge = class {
1014
1460
  }
1015
1461
  initController(e, t) {
1016
1462
  let { timeout: n = this.timeout, controller: r } = e;
1017
- if (n && !r && typeof AbortSignal < "u") {
1463
+ if (n && !r && typeof AbortSignal < "u" && typeof AbortSignal.timeout == "function") {
1018
1464
  t.signal = AbortSignal.timeout(n);
1019
1465
  return;
1020
1466
  }
@@ -1029,69 +1475,74 @@ var he = "d-response-loading", ge = class {
1029
1475
  }, n);
1030
1476
  }
1031
1477
  }
1032
- }, P = class e {
1478
+ }, N = class {
1033
1479
  static isLocalhost() {
1034
- return this.item.isLocalhost();
1480
+ return this.getItem().isLocalhost();
1035
1481
  }
1036
1482
  static getItem() {
1037
- return this.item;
1483
+ return T.get("__ui:api-instance__", () => new Be());
1038
1484
  }
1039
1485
  static getStatus() {
1040
- return this.item.getStatus();
1486
+ return this.getItem().getStatus();
1041
1487
  }
1042
1488
  static getResponse() {
1043
- return this.item.getResponse();
1489
+ return this.getItem().getResponse();
1490
+ }
1491
+ static getHydration() {
1492
+ return this.getItem().getHydration();
1493
+ }
1494
+ static getHydrationScript() {
1495
+ return this.getItem().getHydrationScript();
1044
1496
  }
1045
1497
  static getUrl(e, t = !0) {
1046
- return this.item.getUrl(e, t);
1498
+ return this.getItem().getUrl(e, t);
1047
1499
  }
1048
1500
  static getBody(e = {}, t = M.get) {
1049
- return this.item.getBody(e, t);
1501
+ return this.getItem().getBody(e, t);
1050
1502
  }
1051
1503
  static getBodyForGet(e, t = "", n = M.get) {
1052
- return this.item.getBodyForGet(e, t, n);
1504
+ return this.getItem().getBodyForGet(e, t, n);
1053
1505
  }
1054
- static setHeaders(t) {
1055
- return this.item.setHeaders(t), e;
1506
+ static setHeaders(e) {
1507
+ this.getItem().setHeaders(e);
1056
1508
  }
1057
- static setRequestDefault(t) {
1058
- return this.item.setRequestDefault(t), e;
1509
+ static setRequestDefault(e) {
1510
+ this.getItem().setRequestDefault(e);
1059
1511
  }
1060
- static setUrl(t) {
1061
- return this.item.setUrl(t), e;
1512
+ static setUrl(e) {
1513
+ this.getItem().setUrl(e);
1062
1514
  }
1063
- static setPreparation(t) {
1064
- return this.item.setPreparation(t), e;
1515
+ static setPreparation(e) {
1516
+ this.getItem().setPreparation(e);
1065
1517
  }
1066
- static setEnd(t) {
1067
- return this.item.setEnd(t), e;
1518
+ static setEnd(e) {
1519
+ this.getItem().setEnd(e);
1068
1520
  }
1069
- static setTimeout(t) {
1070
- return this.item.setTimeout(t), e;
1521
+ static setTimeout(e) {
1522
+ this.getItem().setTimeout(e);
1071
1523
  }
1072
1524
  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;
1525
+ 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));
1074
1526
  }
1075
1527
  static async request(e) {
1076
- return this.item.request(e);
1528
+ return this.getItem().request(e);
1077
1529
  }
1078
1530
  static get(e) {
1079
- return this.item.get(e);
1531
+ return this.getItem().get(e);
1080
1532
  }
1081
1533
  static post(e) {
1082
- return this.item.post(e);
1534
+ return this.getItem().post(e);
1083
1535
  }
1084
1536
  static put(e) {
1085
- return this.item.put(e);
1537
+ return this.getItem().put(e);
1538
+ }
1539
+ static patch(e) {
1540
+ return this.getItem().patch(e);
1086
1541
  }
1087
1542
  static delete(e) {
1088
- return this.item.delete(e);
1543
+ return this.getItem().delete(e);
1089
1544
  }
1090
- };
1091
- S(P, "item", new ve());
1092
- //#endregion
1093
- //#region src/classes/BroadcastMessage.ts
1094
- var ye = class {
1545
+ }, Ve = class {
1095
1546
  constructor(e, t, n, r = C.getItem()) {
1096
1547
  if (S(this, "channel", void 0), S(this, "update", (e) => {
1097
1548
  var t;
@@ -1099,8 +1550,8 @@ var ye = class {
1099
1550
  }), S(this, "updateError", (e) => {
1100
1551
  var t;
1101
1552
  return (t = this.callbackError) == null || t.call(this, e), this;
1102
- }), this.callback = t, this.callbackError = n, m()) try {
1103
- this.channel = new BroadcastChannel(`${be()}__${e}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
1553
+ }), this.callback = t, this.callbackError = n, s()) try {
1554
+ this.channel = new BroadcastChannel(`${He()}__${e}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
1104
1555
  } catch (e) {
1105
1556
  r.on({
1106
1557
  group: "broadcast",
@@ -1122,7 +1573,11 @@ var ye = class {
1122
1573
  setCallbackError(e) {
1123
1574
  return this.callbackError = e, this;
1124
1575
  }
1125
- }, be = () => new T("__broadcast-name").get(() => `name_${d(1e6, 9999999)}`), xe = class {
1576
+ destroy() {
1577
+ var e;
1578
+ return (e = this.channel) == null || e.close(), this.channel = void 0, this;
1579
+ }
1580
+ }, He = () => new E("__ui:broadcast-name__").get(() => `name_${f(1e6, 9999999)}`), Ue = class {
1126
1581
  constructor(e) {
1127
1582
  S(this, "cache", void 0), S(this, "cacheOld", void 0), S(this, "comparisons", []), this.callback = e;
1128
1583
  }
@@ -1144,7 +1599,7 @@ var ye = class {
1144
1599
  isUpdate(e) {
1145
1600
  return this.cache === void 0 || this.comparisons.length !== e.length || this.comparisons.findIndex((t, n) => t !== e[n]) >= 0 ? (this.comparisons = [...e], !0) : !1;
1146
1601
  }
1147
- }, Se = class {
1602
+ }, We = class {
1148
1603
  constructor() {
1149
1604
  S(this, "cache", {});
1150
1605
  }
@@ -1155,17 +1610,44 @@ var ye = class {
1155
1610
  return await this.getCacheItem(e, t).getCacheAsync(n == null ? [] : n);
1156
1611
  }
1157
1612
  getCacheItem(e, t) {
1158
- return e in this.cache || (this.cache[e] = new xe(t)), this.cache[e];
1613
+ return e in this.cache || (this.cache[e] = new Ue(t)), this.cache[e];
1614
+ }
1615
+ }, Ge = class {
1616
+ static getItem() {
1617
+ return T.get("__ui:cache-static__", () => new We());
1159
1618
  }
1160
- }, Ce, F = class {
1161
1619
  static get(e, t, n) {
1162
- return this.cache.get(e, t, n);
1620
+ return this.getItem().get(e, t, n);
1621
+ }
1622
+ static async getAsync(e, t, n) {
1623
+ return await this.getItem().getAsync(e, t, n);
1163
1624
  }
1164
1625
  };
1165
- Ce = F, S(F, "cache", void 0), Ce.cache = new Se();
1626
+ //#endregion
1627
+ //#region src/functions/anyToString.ts
1628
+ function P(e, n = !0, r = !0) {
1629
+ var a;
1630
+ if (d(e)) return r ? e.trim() : e;
1631
+ if (c(e)) return "";
1632
+ if (i(e) && !e.some((e) => t(e)) && n) return e.join(",");
1633
+ if (t(e)) try {
1634
+ return JSON.stringify(e);
1635
+ } catch (t) {
1636
+ return String(e);
1637
+ }
1638
+ return e === !0 ? "1" : e === !1 ? "0" : (a = e == null ? void 0 : e.toString()) == null ? "" : a;
1639
+ }
1640
+ //#endregion
1641
+ //#region src/functions/strSplit.ts
1642
+ function F(e, t, n) {
1643
+ let r = P(e);
1644
+ if (!n || n <= 0) return r.split(t);
1645
+ let i = r.split(t, n), a = r.split(t);
1646
+ return i.length === a.length ? i : (i.pop(), [...i, a.slice(n - 1).join(t)]);
1647
+ }
1166
1648
  //#endregion
1167
1649
  //#region src/functions/transformation.ts
1168
- function we(e, t = !1) {
1650
+ function I(e, t = !1) {
1169
1651
  if (typeof e == "string") {
1170
1652
  let r = e.trim();
1171
1653
  switch (r) {
@@ -1178,96 +1660,157 @@ function we(e, t = !1) {
1178
1660
  if (/^[{[]/.exec(r)) try {
1179
1661
  return JSON.parse(r);
1180
1662
  } catch (e) {
1181
- console.error("transformation: JSON error", e);
1663
+ C.on({
1664
+ group: "transformation",
1665
+ code: "error",
1666
+ details: e
1667
+ });
1182
1668
  }
1183
- else if (/^[0-9]+\.[0-9.]+$/.exec(r)) return parseFloat(r);
1184
- else if (/^[0-9]+$/.exec(r)) return parseInt(r, 10);
1185
- else if (t && m() && typeof ((n = window) == null ? void 0 : n[r]) == "function") return window[r];
1669
+ else if (/^-?[0-9]+\.[0-9]+$/.exec(r)) return parseFloat(r);
1670
+ else if (/^-?[0-9]+$/.exec(r)) return parseInt(r, 10);
1671
+ else if (t && s() && typeof ((n = window) == null ? void 0 : n[r]) == "function") return window[r];
1186
1672
  }
1187
1673
  }
1188
1674
  return e;
1189
1675
  }
1190
1676
  //#endregion
1191
- //#region src/classes/CookieBlock.ts
1192
- var Te = "cookie-block", Ee = class {
1193
- static get() {
1677
+ //#region src/classes/CookieBlockInstance.ts
1678
+ var Ke = "__ui:cookie-block__", qe = class {
1679
+ constructor() {
1680
+ S(this, "storage", new E(Ke));
1681
+ }
1682
+ get() {
1194
1683
  var e;
1195
1684
  return (e = this.storage.get()) == null ? !1 : e;
1196
1685
  }
1197
- static set(e) {
1686
+ set(e) {
1198
1687
  this.storage.set(e);
1199
1688
  }
1689
+ }, Je = class {
1690
+ static getItem() {
1691
+ return T.get("__ui:cookie-block__", () => new qe());
1692
+ }
1693
+ static get() {
1694
+ return this.getItem().get();
1695
+ }
1696
+ static set(e) {
1697
+ this.getItem().set(e);
1698
+ }
1699
+ }, Ye = "__ui:cookie-storage__", L = class {
1700
+ static init(e, t) {
1701
+ this.getListener = e, this.setListener = t;
1702
+ }
1703
+ static reset() {
1704
+ this.getListener = void 0, this.setListener = void 0;
1705
+ }
1706
+ static get(e, t) {
1707
+ let n = this.getListener ? this.getListener(e) : this.initItems()[e];
1708
+ return n === void 0 && t !== void 0 ? this.set(e, t) : I(n);
1709
+ }
1710
+ static set(e, t, n) {
1711
+ let r = b(t);
1712
+ if (Je.get()) return r;
1713
+ let i = P(r, !1);
1714
+ return this.setListener ? this.setListener(e, i, n) : (this.initItems()[e] = i === "" ? void 0 : r, this.hasDom() && (document.cookie = [
1715
+ `${encodeURIComponent(e)}=${encodeURIComponent(i)}`,
1716
+ this.toMaxAge(i, n == null ? void 0 : n.age),
1717
+ this.toSameSite(n == null ? void 0 : n.sameSite),
1718
+ ...this.toArguments(n == null ? void 0 : n.arguments)
1719
+ ].join("; "))), r;
1720
+ }
1721
+ static remove(e) {
1722
+ this.set(e, "", { age: -1 });
1723
+ }
1724
+ static update() {
1725
+ s() && (T.remove(Ye), this.initItems());
1726
+ }
1727
+ static hasDom() {
1728
+ return s() && !ce();
1729
+ }
1730
+ static initItems() {
1731
+ return T.get(Ye, () => {
1732
+ let e = {};
1733
+ if (this.hasDom()) for (let t of document.cookie.split(";")) {
1734
+ let [n, r] = F(t.trim(), "=", 2);
1735
+ n && l(r) && (e[n] = r);
1736
+ }
1737
+ return e;
1738
+ });
1739
+ }
1740
+ static toMaxAge(e, t) {
1741
+ return `max-age=${e === "" ? -1 : t == null ? 10080 * 60 : t}`;
1742
+ }
1743
+ static toSameSite(e) {
1744
+ return `SameSite=${e == null ? "strict" : e}`;
1745
+ }
1746
+ static toArguments(e) {
1747
+ return e === void 0 ? [] : Array.isArray(e) ? e : Object.entries(e).map(([e, t]) => `${e}=${P(t)}`);
1748
+ }
1200
1749
  };
1201
- S(Ee, "storage", new T(Te));
1750
+ S(L, "getListener", void 0), S(L, "setListener", void 0);
1202
1751
  //#endregion
1203
1752
  //#region src/classes/Cookie.ts
1204
- var De, Oe = {}, ke = class {
1753
+ var Xe = () => T.get("__ui:cookie-items__", () => ({})), Ze = class e {
1754
+ static getInstance(t) {
1755
+ var n, r;
1756
+ return (n = (r = Xe()) == null ? void 0 : r[t]) == null ? new e(t) : n;
1757
+ }
1205
1758
  constructor(e) {
1206
- if (S(this, "value", void 0), S(this, "options", {}), this.name = e, e in Ae) return Ae[e];
1207
- this.value = Oe == null ? void 0 : Oe[e], Ae[e] = this;
1759
+ S(this, "value", void 0), S(this, "options", {}), this.name = e;
1760
+ let t = Xe();
1761
+ if (e in t) return t[e];
1762
+ this.value = L.get(this.name), t[e] = this;
1208
1763
  }
1209
1764
  get(e, t) {
1210
1765
  return this.value === void 0 && e && this.set(e, t), this.value;
1211
1766
  }
1212
1767
  set(e, t) {
1213
- this.value = y(e), Object.assign(this.options, t), this.update();
1768
+ this.value = b(e), Object.assign(this.options, t), this.update();
1214
1769
  }
1215
1770
  remove() {
1216
1771
  this.set("");
1217
1772
  }
1218
- getAge() {
1219
- var e, t;
1220
- return (e = (t = this.options) == null ? void 0 : t.age) == null ? 10080 * 60 : e;
1221
- }
1222
1773
  update() {
1223
- if (m() && !b() && !Ee.get()) {
1224
- var e, t, n, r, i;
1225
- let a = String((e = this.value) == null ? "" : e);
1226
- document.cookie = [
1227
- `${encodeURIComponent(this.name)}=${encodeURIComponent(a)}`,
1228
- `max-age=${a === "" ? "-1" : this.getAge()}`,
1229
- `SameSite=${(t = (n = this.options) == null ? void 0 : n.sameSite) == null ? "strict" : t}`,
1230
- ...(r = (i = this.options) == null ? void 0 : i.arguments) == null ? [] : r
1231
- ].join("; ");
1232
- }
1233
- }
1234
- static updateData() {
1235
- for (let e of document.cookie.split(";")) {
1236
- let [t, n] = e.trim().split("=");
1237
- t && c(n) && (Oe[t] = we(n));
1238
- }
1774
+ L.set(this.name, this.value, this.options);
1239
1775
  }
1240
1776
  };
1241
- De = ke, m() && !b() && De.updateData();
1242
- var Ae = {};
1243
1777
  //#endregion
1244
1778
  //#region src/functions/toDate.ts
1245
- function I(e) {
1246
- var t, n, r, i, a, o, c, l;
1779
+ function R(e) {
1780
+ var t, n, r, i, a, o, s, l;
1247
1781
  if (e instanceof Date) return e;
1248
- if (s(e)) return /* @__PURE__ */ new Date();
1782
+ if (c(e)) return /* @__PURE__ */ new Date();
1249
1783
  if (typeof e == "number") return new Date(e);
1250
1784
  let u = e, d = D.getTimezoneFormat().trim();
1251
1785
  e.replace(/^([\s\S]+)([-+]\d{2}:?\d{2})$/, (e, t, n) => (u = t, d = n.trim(), e));
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;
1786
+ let f = (t = (n = (r = (i = (a = (o = (s = (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") : s) == 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;
1253
1787
  return /* @__PURE__ */ new Date(`${f.trim()}${d}`);
1254
1788
  }
1255
1789
  //#endregion
1256
1790
  //#region src/functions/getColumn.ts
1257
- function je(e, t) {
1258
- return i(e, (e) => e == null ? void 0 : e[t], !0);
1791
+ function Qe(e, t) {
1792
+ return r(e, (e) => e == null ? void 0 : e[t], !0);
1259
1793
  }
1260
1794
  //#endregion
1261
1795
  //#region src/classes/GeoIntl.ts
1262
- var L = class e {
1796
+ var z = class e {
1797
+ static isItem(e = D.getLocation()) {
1798
+ return this.getLocation(e) in V;
1799
+ }
1800
+ static getLocation(e = D.getLocation()) {
1801
+ if (e in B) return B[e];
1802
+ let t = D.find(e);
1803
+ return B[e] = t.standard, t.standard;
1804
+ }
1263
1805
  static getInstance(t = D.getLocation()) {
1264
- return new e(t);
1806
+ let n = this.getLocation(t);
1807
+ return n in V ? V[n] : new e(t);
1265
1808
  }
1266
1809
  constructor(e = D.getLocation(), t = C.getItem()) {
1267
1810
  S(this, "geo", void 0), this.errorCenter = t, this.geo = D.find(e);
1268
1811
  let n = this.getLocation();
1269
- if (n in R) return R[n];
1270
- R[n] = this;
1812
+ if (n in V) return V[n];
1813
+ B[e] = n, V[n] = this;
1271
1814
  }
1272
1815
  getLocation() {
1273
1816
  return this.geo.standard;
@@ -1309,26 +1852,26 @@ var L = class e {
1309
1852
  }
1310
1853
  fullName(e, t, n, r) {
1311
1854
  var i, a;
1312
- let o = (i = (a = this.geo) == null ? void 0 : a.nameFormat) == null ? "fl" : i, s;
1855
+ let o = (i = (a = this.geo) == null ? void 0 : a.nameFormat) == null ? "fl" : i, s = r ? t[0].toUpperCase() + "." : t, c = r ? (n == null ? void 0 : n[0].toUpperCase()) + "." : n, l;
1313
1856
  switch (o) {
1314
1857
  case "fsl":
1315
- s = `${t}${n ? ` ${n}` : ""} ${e}`;
1858
+ l = `${s}${c ? ` ${c}` : ""} ${e}`;
1316
1859
  break;
1317
1860
  case "lf":
1318
- s = `${e} ${t}`;
1861
+ l = `${e} ${s}`;
1319
1862
  break;
1320
1863
  case "lsf":
1321
- s = `${e}${n ? ` ${n}` : ""} ${t}`;
1864
+ l = `${e}${c ? ` ${c}` : ""} ${s}`;
1322
1865
  break;
1323
1866
  default:
1324
- s = `${t} ${e}`;
1867
+ l = `${s} ${e}`;
1325
1868
  break;
1326
1869
  }
1327
- return r ? s.replace(/ (.)[^ ]+/gi, " $1.") : s;
1870
+ return l;
1328
1871
  }
1329
1872
  number(e, t) {
1330
1873
  var n, r;
1331
- return ((n = this.numberObject(t)) == null || (r = n.format) == null ? void 0 : r.call(n, g(e))) || e.toString();
1874
+ return ((n = this.numberObject(t)) == null || (r = n.format) == null ? void 0 : r.call(n, _(e))) || e.toString();
1332
1875
  }
1333
1876
  decimal() {
1334
1877
  var e, t, n;
@@ -1342,7 +1885,7 @@ var L = class e {
1342
1885
  }, i = e.toString().replace(/^([\S\s]+[\d ])([a-zA-Z]{3})$/i, (...e) => (r.currency = String(e[2]).toUpperCase(), String(e[1])));
1343
1886
  if (n) {
1344
1887
  let t = this.numberObject(r);
1345
- return t ? je(t.formatToParts(g(e)).filter((e) => ["literal", "currency"].indexOf(e.type) === -1), "value").join("") : e.toString();
1888
+ return t ? Qe(t.formatToParts(_(e)).filter((e) => ["literal", "currency"].indexOf(e.type) === -1), "value").join("") : e.toString();
1346
1889
  } else if ("currency" in r) return this.number(typeof e == "number" ? e : i, r);
1347
1890
  else return this.number(typeof e == "number" ? e : i, {
1348
1891
  ...r,
@@ -1365,8 +1908,8 @@ var L = class e {
1365
1908
  return this.number(r, n);
1366
1909
  }
1367
1910
  sizeFile(e, t = "byte") {
1368
- let n = g(e);
1369
- if (n > 1024 && u(t)) switch (t) {
1911
+ let n = _(e);
1912
+ if (n > 1024 && d(t)) switch (t) {
1370
1913
  case "byte": return this.sizeFile(n / 1024, "kilobyte");
1371
1914
  case "kilobyte": return this.sizeFile(n / 1024, "megabyte");
1372
1915
  case "megabyte": return this.sizeFile(n / 1024, "gigabyte");
@@ -1382,11 +1925,11 @@ var L = class e {
1382
1925
  });
1383
1926
  }
1384
1927
  percentBy100(e, t) {
1385
- return this.percent(g(e) / 100, t);
1928
+ return this.percent(_(e) / 100, t);
1386
1929
  }
1387
1930
  plural(e, t, n, r) {
1388
1931
  var i;
1389
- let a = g(e), o = t.split("|");
1932
+ let a = _(e), o = t.split("|");
1390
1933
  if (o.length > 1) try {
1391
1934
  if (typeof Intl < "u") {
1392
1935
  var s;
@@ -1423,18 +1966,18 @@ var L = class e {
1423
1966
  return `${this.number(a, r)} ${(i = o == null ? void 0 : o[0]) == null ? "" : i}`.trim();
1424
1967
  }
1425
1968
  date(e, t, n, r) {
1426
- let i = I(e), a = typeof n == "string", o = this.dateOptions(t, a ? n : "short");
1969
+ let i = R(e), a = typeof n == "string", o = this.dateOptions(t, a ? n : "short");
1427
1970
  return r && (o.hour12 = !1), a || Object.assign(o, n), i.toLocaleString(this.getLocation(), o);
1428
1971
  }
1429
1972
  relative(e, t, n) {
1430
- let r = I(e), i = n || /* @__PURE__ */ new Date(), a = {
1973
+ let r = R(e), i = n || /* @__PURE__ */ new Date(), a = {
1431
1974
  numeric: "auto",
1432
1975
  ...typeof t == "string" ? { style: t } : t || {}
1433
1976
  }, o = "second", s = (r.getTime() - i.getTime()) / 1e3;
1434
1977
  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);
1435
1978
  }
1436
1979
  relativeLimit(e, t, n, r, i, a, o) {
1437
- let s = I(e), c = n || /* @__PURE__ */ new Date(), l = new Date(c), u = new Date(c);
1980
+ let s = R(e), c = n || /* @__PURE__ */ new Date(), l = new Date(c), u = new Date(c);
1438
1981
  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);
1439
1982
  }
1440
1983
  relativeByValue(e, t, n) {
@@ -1443,7 +1986,7 @@ var L = class e {
1443
1986
  ...typeof n == "string" ? { style: n } : n || {}
1444
1987
  };
1445
1988
  try {
1446
- if (this.hasIntl() && Intl.RelativeTimeFormat !== void 0) return new Intl.RelativeTimeFormat(this.getLocation(), r).format(Math.round(g(e)), t);
1989
+ if (this.hasIntl() && Intl.RelativeTimeFormat !== void 0) return new Intl.RelativeTimeFormat(this.getLocation(), r).format(Math.round(_(e)), t);
1447
1990
  } catch (e) {
1448
1991
  this.errorCenter.on({
1449
1992
  group: "intl",
@@ -1455,7 +1998,7 @@ var L = class e {
1455
1998
  }
1456
1999
  month(e, t) {
1457
2000
  try {
1458
- if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { month: t || "long" }).format(I(e));
2001
+ if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { month: t || "long" }).format(R(e));
1459
2002
  } catch (e) {
1460
2003
  this.errorCenter.on({
1461
2004
  group: "intl",
@@ -1472,7 +2015,7 @@ var L = class e {
1472
2015
  }];
1473
2016
  try {
1474
2017
  if (this.hasIntlDateTimeFormat()) {
1475
- let n = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { month: e || "long" });
2018
+ let n = /* @__PURE__ */ new Date(), r = new Intl.DateTimeFormat(this.getLocation(), { month: e || "long" });
1476
2019
  for (let e = 0; e < 12; e++) n.setMonth(e), t.push({
1477
2020
  label: r.format(n).replace(/^./, (e) => e.toUpperCase()),
1478
2021
  value: e + 1
@@ -1489,7 +2032,7 @@ var L = class e {
1489
2032
  }
1490
2033
  weekday(e, t) {
1491
2034
  try {
1492
- if (this.hasIntlDateTimeFormat()) return Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }).format(I(e));
2035
+ if (this.hasIntlDateTimeFormat()) return new Intl.DateTimeFormat(this.getLocation(), { weekday: t || "long" }).format(R(e));
1493
2036
  } catch (e) {
1494
2037
  this.errorCenter.on({
1495
2038
  group: "intl",
@@ -1506,7 +2049,7 @@ var L = class e {
1506
2049
  }];
1507
2050
  try {
1508
2051
  if (this.hasIntlDateTimeFormat()) {
1509
- let n = /* @__PURE__ */ new Date(), r = Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }), i = n.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
2052
+ let n = /* @__PURE__ */ new Date(), r = new Intl.DateTimeFormat(this.getLocation(), { weekday: e || "long" }), i = n.getDay() + (this.geo.firstDay === "Mo" ? -1 : 1);
1510
2053
  n.setDate(n.getDate() - i);
1511
2054
  for (let e = 0; e < 7; e++) t.push({
1512
2055
  label: r.format(n).replace(/^./, (e) => e.toUpperCase()),
@@ -1591,12 +2134,15 @@ var L = class e {
1591
2134
  "second"
1592
2135
  ].indexOf(e) !== -1 && (n.second = "2-digit")), n;
1593
2136
  }
1594
- }, R = {}, Me = class e {
2137
+ }, B = {}, V = {}, $e = class e {
1595
2138
  constructor(e, t = "date", n = D.getLocation()) {
1596
- S(this, "date", void 0), S(this, "hour24", !1), S(this, "watch", void 0), this.type = t, this.code = n, this.date = I(e);
2139
+ S(this, "date", void 0), S(this, "hour24", !1), S(this, "watch", void 0), this.type = t, this.code = n, this.date = R(e), isNaN(this.date.getTime()) && C.on({
2140
+ group: "intl",
2141
+ code: "invalid"
2142
+ });
1597
2143
  }
1598
2144
  getIntl() {
1599
- return new L(this.code);
2145
+ return z.getInstance(this.code);
1600
2146
  }
1601
2147
  getDate() {
1602
2148
  return this.date;
@@ -1645,7 +2191,7 @@ var L = class e {
1645
2191
  return this.date.getSeconds();
1646
2192
  }
1647
2193
  getMaxDay() {
1648
- return this.getMonth() > 0 ? this.cloneDayLast().getDay() : 0;
2194
+ return this.cloneDayLast().getDay();
1649
2195
  }
1650
2196
  locale(e = this.type, t) {
1651
2197
  return this.getIntl().date(this.date, e, t, this.hour24);
@@ -1699,7 +2245,7 @@ var L = class e {
1699
2245
  ].indexOf(this.type) !== -1 && (i = n.locale("time"))), `${r.join("-")}${i ? `T${i}${t ? n.getTimeZone() : ""}` : ""}`;
1700
2246
  }
1701
2247
  setDate(e) {
1702
- return this.date = I(e), this.update(), this;
2248
+ return this.date = R(e), this.update(), this;
1703
2249
  }
1704
2250
  setType(e) {
1705
2251
  return this.type = e, this.update(), this;
@@ -1841,12 +2387,8 @@ var L = class e {
1841
2387
  return this.cloneClass().moveDayPrevious();
1842
2388
  }
1843
2389
  toTimeZoneHourFormat(e) {
1844
- m() && this.getIntl().number(Math.trunc(e), {
1845
- signDisplay: "always",
1846
- minimumIntegerDigits: 2
1847
- });
1848
- let t = Math.trunc(e).toString();
1849
- return t.length < 2 && (t = `0${t}`), `${e >= 0 ? "+" : "-"}${t}`;
2390
+ let t = Math.trunc(e).toString().replace("-", "").padStart(2, "0");
2391
+ return `${e >= 0 ? "+" : "-"}${t}`;
1850
2392
  }
1851
2393
  update() {
1852
2394
  var e;
@@ -1854,37 +2396,23 @@ var L = class e {
1854
2396
  }
1855
2397
  };
1856
2398
  //#endregion
1857
- //#region src/functions/anyToString.ts
1858
- function z(e, n = !0) {
1859
- var r;
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;
1861
- }
1862
- //#endregion
1863
- //#region src/functions/strSplit.ts
1864
- function Ne(e, t, n) {
1865
- let r = z(e);
1866
- if (!n || n <= 0) return r.split(t);
1867
- let i = r.split(t, n), a = r.split(t);
1868
- return i.length === a.length ? i : (i.pop(), [...i, a.slice(n - 1).join(t)]);
1869
- }
1870
- //#endregion
1871
2399
  //#region src/functions/getItemByPath.ts
1872
- function B(e, n) {
2400
+ function H(e, n) {
1873
2401
  var r;
1874
- if (!c(n)) return;
1875
- let i = Ne(n, ".", 2), a = i[0];
1876
- return a && e != null && e[a] && t(e[a]) && i != null && i[1] ? B(e[a], i[1]) : (r = c(a) && (e == null ? void 0 : e[a])) == null ? void 0 : r;
2402
+ if (!l(n, !0)) return;
2403
+ let i = F(n, ".", 2), a = i[0];
2404
+ return a && e != null && e[a] && t(e[a]) && i != null && i[1] ? H(e[a], i[1]) : (r = e == null ? void 0 : e[a]) == null ? void 0 : r;
1877
2405
  }
1878
2406
  //#endregion
1879
2407
  //#region src/functions/toCamelCase.ts
1880
- function V(e) {
2408
+ function et(e) {
1881
2409
  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()}`);
1882
2410
  }
1883
2411
  //#endregion
1884
2412
  //#region src/types/formattersTypes.ts
1885
- var H = /* @__PURE__ */ function(e) {
2413
+ var U = /* @__PURE__ */ function(e) {
1886
2414
  return e.currency = "currency", e.date = "date", e.name = "name", e.number = "number", e.plural = "plural", e.unit = "unit", e;
1887
- }({}), Pe = class {
2415
+ }({}), tt = class {
1888
2416
  constructor(e, t) {
1889
2417
  this.options = e, this.list = t;
1890
2418
  }
@@ -1898,7 +2426,7 @@ var H = /* @__PURE__ */ function(e) {
1898
2426
  return this.list ? this.isArray() ? this.list.length : 1 : 0;
1899
2427
  }
1900
2428
  getList() {
1901
- return this.list ? A(this.list) : [];
2429
+ return this.list ? k(this.list) : [];
1902
2430
  }
1903
2431
  getOptions() {
1904
2432
  return this.options;
@@ -1907,7 +2435,7 @@ var H = /* @__PURE__ */ function(e) {
1907
2435
  return this.list = e, this;
1908
2436
  }
1909
2437
  to() {
1910
- let e = i(this.getList(), (e) => ({
2438
+ let e = r(this.getList(), (e) => ({
1911
2439
  ...e,
1912
2440
  ...this.getFormatData(e)
1913
2441
  }));
@@ -1915,46 +2443,46 @@ var H = /* @__PURE__ */ function(e) {
1915
2443
  }
1916
2444
  getFormatData(e) {
1917
2445
  let t = {};
1918
- return i(this.options, (n, r) => {
1919
- let i = `${V(r)}Format`, a = B(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);
2446
+ return r(this.options, (n, r) => {
2447
+ let i = `${et(r)}Format`, a = H(e, r);
2448
+ n != null && n.transformation ? l(a) ? t[i] = n.transformation(a, e, n.options) : t[i] = "" : t[i] = this.transformation(a, e, n.type, n.options);
1921
2449
  }), t;
1922
2450
  }
1923
2451
  transformation(e, t, n, r) {
1924
- if (c(e) || n === H.name) switch (n) {
1925
- case H.currency: return this.formatCurrency(e, t, r);
1926
- case H.date: return this.formatDate(e, r);
1927
- case H.name: return this.formatName(t, r);
1928
- case H.number: return this.formatNumber(e, r);
1929
- case H.plural: return this.formatPlural(e, r);
1930
- case H.unit: return this.formatUnit(e, r);
2452
+ if (l(e) || n === U.name) switch (n) {
2453
+ case U.currency: return this.formatCurrency(e, t, r);
2454
+ case U.date: return this.formatDate(e, r);
2455
+ case U.name: return this.formatName(t, r);
2456
+ case U.number: return this.formatNumber(e, r);
2457
+ case U.plural: return this.formatPlural(e, r);
2458
+ case U.unit: return this.formatUnit(e, r);
1931
2459
  default: return String(e);
1932
2460
  }
1933
2461
  return "";
1934
2462
  }
1935
2463
  formatCurrency(e, t, n) {
1936
2464
  var r;
1937
- let i = n != null && n.currencyPropName ? B(t, n.currencyPropName) : t == null ? void 0 : t.currency;
1938
- return L.getInstance().currency(e, (r = n == null ? void 0 : n.options) == null ? i : r, n == null ? void 0 : n.numberOnly);
2465
+ let i = n != null && n.currencyPropName ? H(t, n.currencyPropName) : t == null ? void 0 : t.currency;
2466
+ return z.getInstance().currency(e, (r = n == null ? void 0 : n.options) == null ? i : r, n == null ? void 0 : n.numberOnly);
1939
2467
  }
1940
2468
  formatDate(e, t) {
1941
- return L.getInstance().date(e, t == null ? void 0 : t.type, t == null ? void 0 : t.options, t == null ? void 0 : t.hour24);
2469
+ return z.getInstance().date(e, t == null ? void 0 : t.type, t == null ? void 0 : t.options, t == null ? void 0 : t.hour24);
1942
2470
  }
1943
2471
  formatName(e, t) {
1944
2472
  var n, r, i;
1945
- let a = B(e, (n = t == null ? void 0 : t.lastPropName) == null ? "lastName" : n), o = B(e, (r = t == null ? void 0 : t.firstPropName) == null ? "firstName" : r), s = B(e, (i = t == null ? void 0 : t.surname) == null ? "surname" : i);
1946
- return a && o ? L.getInstance().fullName(a, o, s, t == null ? void 0 : t.short) : "";
2473
+ let a = H(e, (n = t == null ? void 0 : t.lastPropName) == null ? "lastName" : n), o = H(e, (r = t == null ? void 0 : t.firstPropName) == null ? "firstName" : r), s = H(e, (i = t == null ? void 0 : t.surname) == null ? "surname" : i);
2474
+ return a && o ? z.getInstance().fullName(a, o, s, t == null ? void 0 : t.short) : "";
1947
2475
  }
1948
2476
  formatNumber(e, t) {
1949
- return L.getInstance().number(e, t == null ? void 0 : t.options);
2477
+ return z.getInstance().number(e, t == null ? void 0 : t.options);
1950
2478
  }
1951
2479
  formatPlural(e, t) {
1952
- return t && t.words ? L.getInstance().plural(e, t == null ? void 0 : t.words, t == null ? void 0 : t.options, t == null ? void 0 : t.optionsNumber) : e;
2480
+ return t && t.words ? z.getInstance().plural(e, t == null ? void 0 : t.words, t == null ? void 0 : t.options, t == null ? void 0 : t.optionsNumber) : e;
1953
2481
  }
1954
2482
  formatUnit(e, t) {
1955
- return t && t.unit ? L.getInstance().unit(e, t.unit) : e;
2483
+ return t && t.unit ? z.getInstance().unit(e, t.unit) : e;
1956
2484
  }
1957
- }, Fe = "f", Ie = class e {
2485
+ }, nt = "f", rt = class e {
1958
2486
  constructor(e = D.getLocation()) {
1959
2487
  this.code = e;
1960
2488
  }
@@ -1978,10 +2506,10 @@ var H = /* @__PURE__ */ function(e) {
1978
2506
  return (t = this.get(e)) == null ? void 0 : t.icon;
1979
2507
  }
1980
2508
  getList(e) {
1981
- return i(this.getCodes(e), (e) => this.get(e));
2509
+ return r(this.getCodes(e), (e) => this.get(e));
1982
2510
  }
1983
2511
  getNational(t) {
1984
- return i(this.getList(t), (t) => {
2512
+ return r(this.getList(t), (t) => {
1985
2513
  let n = new e(t.standard).get(t.standard);
1986
2514
  return {
1987
2515
  ...t,
@@ -1995,7 +2523,7 @@ var H = /* @__PURE__ */ function(e) {
1995
2523
  return this.code = e, this;
1996
2524
  }
1997
2525
  getLocation() {
1998
- return new L(this.code);
2526
+ return new z(this.code);
1999
2527
  }
2000
2528
  getCodes(t) {
2001
2529
  return t == null ? Object.keys(e.flags) : t;
@@ -2007,7 +2535,7 @@ var H = /* @__PURE__ */ function(e) {
2007
2535
  return this.getLocation().countryName(e.country);
2008
2536
  }
2009
2537
  };
2010
- S(Ie, "flags", {
2538
+ S(rt, "flags", {
2011
2539
  AD: "f-ad",
2012
2540
  AE: "f-ae",
2013
2541
  AF: "f-af",
@@ -2252,7 +2780,7 @@ S(Ie, "flags", {
2252
2780
  });
2253
2781
  //#endregion
2254
2782
  //#region src/classes/GeoPhone.ts
2255
- var Le = class {
2783
+ var it = class {
2256
2784
  static get(e) {
2257
2785
  return this.getList().find((t) => e === t.value);
2258
2786
  }
@@ -2286,7 +2814,7 @@ var Le = class {
2286
2814
  return this.map || this.makeMap(), (e = this.map) == null ? {} : e;
2287
2815
  }
2288
2816
  static toMask(e, t) {
2289
- if (c(e) && Array.isArray(t) && t.length > 0) {
2817
+ if (l(e) && Array.isArray(t) && t.length > 0) {
2290
2818
  let n = this.removeZero(e), r = n.length;
2291
2819
  for (let e of t) if (this.getUnnecessaryLength(e) === r) return this.toStandard(n, e);
2292
2820
  }
@@ -2308,11 +2836,11 @@ var Le = class {
2308
2836
  return (t = (n = e.match(/\*/g)) == null ? void 0 : n.length) == null ? 0 : t;
2309
2837
  }
2310
2838
  static makeList() {
2311
- this.list = i(D.getList(), (e) => {
2839
+ this.list = r(D.getList(), (e) => {
2312
2840
  if (e != null && e.phoneMask) return {
2313
- phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/, "")) || void 0,
2841
+ phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/g, "")) || void 0,
2314
2842
  within: (e == null ? void 0 : e.phoneWithin) || 0,
2315
- mask: A(e.phoneMask),
2843
+ mask: k(e.phoneMask),
2316
2844
  value: e.country
2317
2845
  };
2318
2846
  }).sort((e, t) => e.phone - t.phone);
@@ -2350,87 +2878,132 @@ var Le = class {
2350
2878
  return e.replace(/\*/, this.getWithinSymbol(t));
2351
2879
  }
2352
2880
  };
2353
- S(Le, "list", void 0), S(Le, "map", void 0);
2881
+ S(it, "list", void 0), S(it, "map", void 0);
2354
2882
  //#endregion
2355
2883
  //#region src/classes/Global.ts
2356
- var U, Re = class {
2884
+ var at = class {
2885
+ static getItem() {
2886
+ return T.get("__ui:global-instance__", () => ({}));
2887
+ }
2357
2888
  static get(e) {
2358
- return U && (U == null ? void 0 : U[e]);
2889
+ var t;
2890
+ return (t = this.getItem()) == null ? void 0 : t[e];
2359
2891
  }
2360
2892
  static add(e) {
2361
- U === void 0 && (U = r(e));
2893
+ let t = this.getItem();
2894
+ Object.keys(t).length > 0 || Object.assign(t, e);
2362
2895
  }
2363
- }, ze, W = class {
2364
- static get(e, t) {
2365
- return !(e in this.hash) && t && this.set(e, t), this.hash[e];
2896
+ }, ot = class {
2897
+ constructor() {
2898
+ S(this, "hash", void 0), S(this, "watch", {}), S(this, "block", !1), S(this, "time", void 0);
2366
2899
  }
2367
- static set(e, t) {
2900
+ get(e, t) {
2901
+ let n = this.getHash();
2902
+ return !(e in n) && t && this.set(e, t), n[e];
2903
+ }
2904
+ set(e, t) {
2368
2905
  var n;
2369
- let r = y(t);
2370
- r !== ((n = this.hash) == null ? void 0 : n[e]) && (this.hash[e] = r, this.update());
2906
+ let r = b(t);
2907
+ return r !== ((n = this.hash) == null ? void 0 : n[e]) && (this.getHash()[e] = r, this.update()), this;
2371
2908
  }
2372
- static addWatch(e, t) {
2909
+ addWatch(e, t) {
2373
2910
  if (e in this.watch) {
2374
2911
  var n;
2375
2912
  (n = this.watch[e]) == null || n.push(t);
2376
2913
  } else this.watch[e] = [t];
2914
+ return this;
2377
2915
  }
2378
- static removeWatch(e, t) {
2916
+ removeWatch(e, t) {
2379
2917
  var n;
2380
2918
  let r = (n = this.watch) == null ? void 0 : n[e];
2381
- r && (this.watch[e] = r.filter((e) => e !== t));
2919
+ return r && (this.watch[e] = r.filter((e) => e !== t)), this;
2382
2920
  }
2383
- static reload() {
2384
- if (!this.block) {
2385
- let e = this.getLocation();
2386
- this.makeWatch(e), this.hash = e;
2387
- }
2921
+ reload() {
2922
+ return this.block ? setTimeout(() => this.reload(), 32) : this.initData(), this;
2388
2923
  }
2389
- static getLocation() {
2924
+ getLocation() {
2390
2925
  let e = {};
2391
- return location.hash.replace(/([\w-]+)[:=]([^;]+)/gi, (...t) => (e[String(t[1])] = we(t[2]), "")), e;
2926
+ if (s()) {
2927
+ let t = location.hash.matchAll(/([\w-]+)[:=]([^;]+)/gi);
2928
+ for (let n of t) e[n[1]] = I(n[2]);
2929
+ }
2930
+ return e;
2392
2931
  }
2393
- static update() {
2394
- this.block = !0, history.replaceState(null, "", `#${a(this.hash, "=", ";")}`), requestAnimationFrame(() => {
2395
- this.block = !1;
2396
- });
2932
+ getHash() {
2933
+ return this.hash || this.init(), this.hash;
2934
+ }
2935
+ init() {
2936
+ return this.initData(), s() && addEventListener("hashchange", () => this.reload()), this;
2937
+ }
2938
+ initData() {
2939
+ let e = this.getLocation();
2940
+ return this.makeWatch(e), this.hash = e, this;
2941
+ }
2942
+ update() {
2943
+ if (s()) {
2944
+ clearTimeout(this.time), this.block = !0;
2945
+ try {
2946
+ let e = this.getHash();
2947
+ history.replaceState(null, "", `#${o(e, "=", ";")}`);
2948
+ } finally {
2949
+ this.time = setTimeout(() => {
2950
+ this.block = !1;
2951
+ }, 120);
2952
+ }
2953
+ }
2954
+ return this;
2397
2955
  }
2398
- static makeWatch(e) {
2399
- i(this.watch, (t, n) => {
2956
+ makeWatch(e) {
2957
+ return r(this.watch, (t, n) => {
2400
2958
  var r;
2401
2959
  ((r = this.hash) == null ? void 0 : r[n]) !== (e == null ? void 0 : e[n]) && t.forEach((t) => t(e[n]));
2402
- });
2960
+ }), this;
2403
2961
  }
2404
- };
2405
- ze = W, S(W, "hash", {}), S(W, "watch", {}), S(W, "block", !1), m() && (ze.reload(), addEventListener("hashchange", () => ze.reload()));
2406
- //#endregion
2407
- //#region src/classes/Icons.ts
2408
- var Be, Ve = "__UI_ICON", He = 320, Ue = "--LOAD--", G = class {
2962
+ }, st = class {
2963
+ static getItem() {
2964
+ return T.get("__ui:hash-instance__", () => new ot());
2965
+ }
2966
+ static get(e, t) {
2967
+ return this.getItem().get(e, t);
2968
+ }
2969
+ static set(e, t) {
2970
+ this.getItem().set(e, t);
2971
+ }
2972
+ static addWatch(e, t) {
2973
+ this.getItem().addWatch(e, t);
2974
+ }
2975
+ static removeWatch(e, t) {
2976
+ this.getItem().removeWatch(e, t);
2977
+ }
2978
+ static reload() {
2979
+ this.getItem().reload();
2980
+ }
2981
+ }, ct = 320, lt = "--LOAD--", ut = class {
2409
2982
  static is(e) {
2410
2983
  return e in this.icons || this.getName(e) in this.icons;
2411
2984
  }
2412
2985
  static async get(e, t = "", n = 1e3 * 60 * 3) {
2413
2986
  var r, i, a, o;
2414
2987
  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;
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;
2988
+ return typeof s == "string" ? s === lt && n > 0 ? (await this.wait(), this.get(e, t, n - ct)) : s : y(s) ? await s() : await s;
2416
2989
  }
2417
2990
  static getNameList() {
2418
- return i(this.icons, (e, t) => t.replace(/^@/, ""));
2991
+ return r(this.icons, (e, t) => t.replace(/^@/, ""));
2419
2992
  }
2420
2993
  static getUrlGlobal() {
2421
- return `${P.isLocalhost(), ""}${this.url}`;
2994
+ return `${N.isLocalhost(), ""}${this.url}`;
2422
2995
  }
2423
2996
  static add(e, t) {
2424
2997
  this.icons[this.getName(e)] = t;
2425
2998
  }
2426
2999
  static addLoad(e) {
2427
- this.icons[this.getName(e)] = Ue;
3000
+ this.icons[this.getName(e)] = lt;
2428
3001
  }
2429
3002
  static addGlobal(e, t) {
2430
3003
  this.icons[this.getName(e)] = `${this.getUrlGlobal()}${t}`;
2431
3004
  }
2432
3005
  static addByList(e) {
2433
- i(e, (e, t) => this.add(t, e));
3006
+ r(e, (e, t) => this.add(t, e));
2434
3007
  }
2435
3008
  static setUrl(e) {
2436
3009
  this.url = e;
@@ -2442,49 +3015,59 @@ var Be, Ve = "__UI_ICON", He = 320, Ue = "--LOAD--", G = class {
2442
3015
  return `@${e}`;
2443
3016
  }
2444
3017
  static wait() {
2445
- return new Promise((e) => setTimeout(() => e(), He));
3018
+ return new Promise((e) => setTimeout(() => e(), ct));
2446
3019
  }
2447
3020
  };
2448
- Be = G, S(G, "icons", {}), S(G, "url", "/icons/"), m() && (Ve in window || (window[Ve] = {}), Be.icons = window[Ve]);
3021
+ S(ut, "icons", {}), S(ut, "url", "/icons/");
2449
3022
  //#endregion
2450
3023
  //#region src/functions/getElementItem.ts
2451
- function We(e, t, n) {
3024
+ function dt(e, t, n) {
2452
3025
  var r, i;
2453
- return (r = (i = k(e)) == null ? void 0 : i[t]) == null ? n : r;
3026
+ return (r = (i = O(e)) == null ? void 0 : i[t]) == null ? n : r;
2454
3027
  }
2455
3028
  //#endregion
2456
3029
  //#region src/functions/setElementItem.ts
2457
- function Ge(e, n, r) {
2458
- let a = k(e);
3030
+ function ft(e, n, i) {
3031
+ let a = O(e);
2459
3032
  if (a) {
2460
- let e = We(a, n);
2461
- if (t(e) && t(r)) i(r, (t, n) => {
2462
- e[n] = y(t);
3033
+ let e = dt(a, n);
3034
+ if (t(e) && t(i)) r(i, (t, n) => {
3035
+ e[n] = b(t);
2463
3036
  });
2464
3037
  else {
2465
- let e = y(r);
2466
- !(n in a) && typeof e == "string" ? a.setAttribute(n.toString(), e) : a[n] = y(r);
3038
+ let e = b(i);
3039
+ !(n in a) && typeof e == "string" ? a.setAttribute(n.toString(), e) : a[n] = e;
2467
3040
  }
2468
3041
  }
2469
3042
  return a;
2470
3043
  }
2471
3044
  //#endregion
2472
3045
  //#region src/functions/createElement.ts
2473
- function K(e, t = "div", r, a) {
2474
- if (!m()) return;
3046
+ function W(e, t = "div", i, a) {
3047
+ if (!s()) return;
2475
3048
  let o = document.createElement(t);
2476
- return typeof r == "function" ? r(o) : n(r) && i(r, (e, t) => {
2477
- Ge(o, t, e);
3049
+ return typeof i == "function" ? i(o) : n(i) && r(i, (e, t) => {
3050
+ ft(o, t, e);
2478
3051
  }), e == null || e.insertBefore(o, a == null ? null : a), o;
2479
3052
  }
2480
3053
  //#endregion
2481
3054
  //#region src/functions/encodeAttribute.ts
2482
- function Ke(e) {
2483
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").trim();
3055
+ var pt = {
3056
+ "&": "&amp;",
3057
+ "<": "&lt;",
3058
+ ">": "&gt;",
3059
+ "\"": "&quot;",
3060
+ "'": "&#39;"
3061
+ };
3062
+ function G(e) {
3063
+ return String(e).replace(/[&<>"']/g, (e) => {
3064
+ var t;
3065
+ return (t = pt == null ? void 0 : pt[e]) == null ? e : t;
3066
+ });
2484
3067
  }
2485
3068
  //#endregion
2486
3069
  //#region src/classes/MetaManager.ts
2487
- var q = class {
3070
+ var K = class {
2488
3071
  constructor(e, t = !1) {
2489
3072
  S(this, "items", {}), this.listMeta = e, this.isProperty = t, this.update();
2490
3073
  }
@@ -2499,19 +3082,19 @@ var q = class {
2499
3082
  return this.items;
2500
3083
  }
2501
3084
  html() {
2502
- return i(this.listMeta, (e) => this.toHtmlString(e)).join("");
3085
+ return r(this.listMeta, (e) => this.toHtmlString(e)).join("");
2503
3086
  }
2504
3087
  set(e, t) {
2505
3088
  return this.setItem(e, t).setMeta(e), this;
2506
3089
  }
2507
3090
  setByList(e) {
2508
- return i(e, (e, t) => this.set(t, String(e))), this;
3091
+ return r(e, (e, t) => this.set(t, String(e))), this;
2509
3092
  }
2510
3093
  getAttributeName() {
2511
3094
  return this.isProperty ? "property" : "name";
2512
3095
  }
2513
3096
  findMetaElement(e) {
2514
- if (!m()) return;
3097
+ if (!s()) return;
2515
3098
  let t = `meta[${this.getAttributeName()}="${e}"]`;
2516
3099
  return document.querySelector(t) || void 0;
2517
3100
  }
@@ -2520,18 +3103,20 @@ var q = class {
2520
3103
  }
2521
3104
  setMeta(e) {
2522
3105
  var t;
2523
- let n = this.findMetaElement(e), r = (t = this.items[e]) == null ? "" : t;
2524
- if (n) n.content = r;
2525
- else if (m()) {
2526
- let t = { content: r };
2527
- this.isProperty ? t.property = e : t.name = e, K(document.head, "meta", t);
2528
- }
2529
- return this;
3106
+ if (!s()) return this;
3107
+ let n = (t = this.items[e]) == null ? "" : t;
3108
+ if (e === "title") return document.title = n, this;
3109
+ let r = this.findMetaElement(e);
3110
+ if (r) return r.content = n, this;
3111
+ let i = { content: n };
3112
+ return this.isProperty ? i.property = e : i.name = e, W(document.head, "meta", i), this;
2530
3113
  }
2531
3114
  toHtmlString(e) {
2532
3115
  var t;
2533
- let n = Ke((t = this.items[e]) == null ? "" : t);
2534
- return n ? `<meta ${this.getAttributeName()}="${e}" content="${n}">` : "";
3116
+ let n = (t = this.items[e]) == null ? "" : t;
3117
+ if (e === "title") return `<title>${se(n)}</title>`;
3118
+ let r = G(n);
3119
+ return r ? `<meta ${this.getAttributeName()}="${e}" content="${r}">` : "";
2535
3120
  }
2536
3121
  update() {
2537
3122
  return this.listMeta.forEach((e) => {
@@ -2539,121 +3124,121 @@ var q = class {
2539
3124
  this.items[e] = (t = (n = this.findMetaElement(e)) == null ? void 0 : n.content) == null ? "" : t;
2540
3125
  }), this;
2541
3126
  }
2542
- }, J = /* @__PURE__ */ function(e) {
2543
- return e.description = "description", e.keywords = "keywords", e.canonical = "canonical", e.robots = "robots", e.author = "author", e;
2544
- }({}), qe = /* @__PURE__ */ function(e) {
3127
+ }, q = /* @__PURE__ */ function(e) {
3128
+ return e.title = "title", e.description = "description", e.keywords = "keywords", e.canonical = "canonical", e.robots = "robots", e.author = "author", e;
3129
+ }({}), mt = /* @__PURE__ */ function(e) {
2545
3130
  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;
2546
- }({}), Y = /* @__PURE__ */ function(e) {
3131
+ }({}), J = /* @__PURE__ */ function(e) {
2547
3132
  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;
2548
- }({}), Je = /* @__PURE__ */ function(e) {
3133
+ }({}), ht = /* @__PURE__ */ function(e) {
2549
3134
  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;
2550
- }({}), Ye = /* @__PURE__ */ function(e) {
3135
+ }({}), gt = /* @__PURE__ */ function(e) {
2551
3136
  return e.inStock = "in stock", e.outOfStock = "out of stock", e.preorder = "preorder", e.backorder = "backorder", e.discontinued = "discontinued", e.pending = "pending", e;
2552
- }({}), Xe = /* @__PURE__ */ function(e) {
3137
+ }({}), _t = /* @__PURE__ */ function(e) {
2553
3138
  return e.new = "new", e.used = "used", e.refurbished = "refurbished", e;
2554
- }({}), Ze = /* @__PURE__ */ function(e) {
3139
+ }({}), vt = /* @__PURE__ */ function(e) {
2555
3140
  return e.newborn = "newborn", e.infant = "infant", e.toddler = "toddler", e.kids = "kids", e.adult = "adult", e;
2556
- }({}), Qe = /* @__PURE__ */ function(e) {
3141
+ }({}), yt = /* @__PURE__ */ function(e) {
2557
3142
  return e.female = "female", e.male = "male", e.unisex = "unisex", e;
2558
- }({}), X = /* @__PURE__ */ function(e) {
3143
+ }({}), Y = /* @__PURE__ */ function(e) {
2559
3144
  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;
2560
- }({}), $e = /* @__PURE__ */ function(e) {
3145
+ }({}), bt = /* @__PURE__ */ function(e) {
2561
3146
  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;
2562
- }({}), et = class extends q {
3147
+ }({}), xt = class extends K {
2563
3148
  constructor() {
2564
- super(Object.values(Y), !0);
3149
+ super(Object.values(J), !0);
2565
3150
  }
2566
3151
  getTitle() {
2567
- return this.get(Y.title);
3152
+ return this.get(J.title);
2568
3153
  }
2569
3154
  getType() {
2570
- return this.get(Y.type);
3155
+ return this.get(J.type);
2571
3156
  }
2572
3157
  getUrl() {
2573
- return this.get(Y.url);
3158
+ return this.get(J.url);
2574
3159
  }
2575
3160
  getImage() {
2576
- return this.get(Y.image);
3161
+ return this.get(J.image);
2577
3162
  }
2578
3163
  getDescription() {
2579
- return this.get(Y.description);
3164
+ return this.get(J.description);
2580
3165
  }
2581
3166
  getLocale() {
2582
- return this.get(Y.locale);
3167
+ return this.get(J.locale);
2583
3168
  }
2584
3169
  getSiteName() {
2585
- return this.get(Y.siteName);
3170
+ return this.get(J.siteName);
2586
3171
  }
2587
3172
  setTitle(e) {
2588
- return this.set(Y.title, e);
3173
+ return this.set(J.title, e);
2589
3174
  }
2590
3175
  setType(e) {
2591
- return this.set(Y.type, e);
3176
+ return this.set(J.type, e);
2592
3177
  }
2593
3178
  setUrl(e) {
2594
- return this.set(Y.url, e);
3179
+ return this.set(J.url, e);
2595
3180
  }
2596
3181
  setImage(e) {
2597
- return this.set(Y.image, e);
3182
+ return this.set(J.image, e);
2598
3183
  }
2599
3184
  setDescription(e) {
2600
- return this.set(Y.description, e);
3185
+ return this.set(J.description, e);
2601
3186
  }
2602
3187
  setLocale(e) {
2603
- return this.set(Y.locale, e);
3188
+ return this.set(J.locale, e);
2604
3189
  }
2605
3190
  setSiteName(e) {
2606
- return this.set(Y.siteName, e);
3191
+ return this.set(J.siteName, e);
2607
3192
  }
2608
- }, tt = class extends q {
3193
+ }, St = class extends K {
2609
3194
  constructor() {
2610
- super(Object.values(X));
3195
+ super(Object.values(Y));
2611
3196
  }
2612
3197
  getCard() {
2613
- return this.get(X.card);
3198
+ return this.get(Y.card);
2614
3199
  }
2615
3200
  getSite() {
2616
- return this.get(X.site);
3201
+ return this.get(Y.site);
2617
3202
  }
2618
3203
  getCreator() {
2619
- return this.get(X.creator);
3204
+ return this.get(Y.creator);
2620
3205
  }
2621
3206
  getUrl() {
2622
- return this.get(X.url);
3207
+ return this.get(Y.url);
2623
3208
  }
2624
3209
  getTitle() {
2625
- return this.get(X.title);
3210
+ return this.get(Y.title);
2626
3211
  }
2627
3212
  getDescription() {
2628
- return this.get(X.description);
3213
+ return this.get(Y.description);
2629
3214
  }
2630
3215
  getImage() {
2631
- return this.get(X.image);
3216
+ return this.get(Y.image);
2632
3217
  }
2633
3218
  setCard(e) {
2634
- return this.set(X.card, e), this;
3219
+ return this.set(Y.card, e), this;
2635
3220
  }
2636
3221
  setSite(e) {
2637
- return this.set(X.site, e), this;
3222
+ return this.set(Y.site, e), this;
2638
3223
  }
2639
3224
  setCreator(e) {
2640
- return this.set(X.creator, e), this;
3225
+ return this.set(Y.creator, e), this;
2641
3226
  }
2642
3227
  setUrl(e) {
2643
- return this.set(X.url, e), this;
3228
+ return this.set(Y.url, e), this;
2644
3229
  }
2645
3230
  setTitle(e) {
2646
- return this.set(X.title, e), this;
3231
+ return this.set(Y.title, e), this;
2647
3232
  }
2648
3233
  setDescription(e) {
2649
- return this.set(X.description, e), this;
3234
+ return this.set(Y.description, e), this;
2650
3235
  }
2651
3236
  setImage(e) {
2652
- return this.set(X.image, e), this;
3237
+ return this.set(Y.image, e), this;
2653
3238
  }
2654
- }, nt = class extends q {
3239
+ }, Ct = class extends K {
2655
3240
  constructor() {
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();
3241
+ super(Object.values(q)), S(this, "suffix", void 0), S(this, "og", void 0), S(this, "twitter", void 0), this.og = new xt(), this.twitter = new St();
2657
3242
  }
2658
3243
  getOg() {
2659
3244
  return this.og;
@@ -2662,25 +3247,26 @@ var q = class {
2662
3247
  return this.twitter;
2663
3248
  }
2664
3249
  getTitle() {
2665
- return m() ? document.title.replace(this.getSuffix(), "").trim() : "";
3250
+ let e = this.get(q.title);
3251
+ return !l(e) && s() && (e = document.title), e.replace(this.getSuffix(), "").trim();
2666
3252
  }
2667
3253
  getKeywords() {
2668
- return this.get(J.keywords);
3254
+ return this.get(q.keywords);
2669
3255
  }
2670
3256
  getDescription() {
2671
- return this.get(J.description);
3257
+ return this.get(q.description);
2672
3258
  }
2673
3259
  getImage() {
2674
3260
  return this.og.getImage();
2675
3261
  }
2676
3262
  getCanonical() {
2677
- return this.get(J.canonical);
3263
+ return this.get(q.canonical);
2678
3264
  }
2679
3265
  getRobots() {
2680
- return this.get(J.robots);
3266
+ return this.get(q.robots);
2681
3267
  }
2682
3268
  getAuthor() {
2683
- return this.get(J.author);
3269
+ return this.get(q.author);
2684
3270
  }
2685
3271
  getSiteName() {
2686
3272
  return this.og.getSiteName();
@@ -2689,29 +3275,26 @@ var q = class {
2689
3275
  return this.og.getLocale();
2690
3276
  }
2691
3277
  setTitle(e) {
2692
- if (m()) {
2693
- let t = c(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
2694
- document.title = t, this.og.setTitle(t), this.twitter.setTitle(t);
2695
- }
2696
- return this;
3278
+ let t = l(e) ? `${e}${this.getSuffix()}` : this.suffix ? this.suffix : "";
3279
+ return s() && (document.title = t), this.set(q.title, t), this.og.setTitle(t), this.twitter.setTitle(t), this;
2697
3280
  }
2698
3281
  setKeywords(e) {
2699
- return this.set(J.keywords, A(e).join(", ")), this;
3282
+ return this.set(q.keywords, k(e).join(", ")), this;
2700
3283
  }
2701
3284
  setDescription(e) {
2702
- return this.set(J.description, e), this;
3285
+ return this.set(q.description, e), this;
2703
3286
  }
2704
3287
  setImage(e) {
2705
3288
  return this.og.setImage(e), this.twitter.setImage(e), this;
2706
3289
  }
2707
3290
  setCanonical(e) {
2708
- return this.set(J.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
3291
+ return this.set(q.canonical, e), this.og.setUrl(e), this.twitter.setUrl(e), this;
2709
3292
  }
2710
3293
  setRobots(e) {
2711
- return this.set(J.robots, e), this;
3294
+ return this.set(q.robots, e), this;
2712
3295
  }
2713
3296
  setAuthor(e) {
2714
- return this.set(J.author, e), this;
3297
+ return this.set(q.author, e), this;
2715
3298
  }
2716
3299
  setSiteName(e) {
2717
3300
  return this.og.setSiteName(e), this.twitter.setSite(e), this;
@@ -2726,31 +3309,140 @@ var q = class {
2726
3309
  return `${super.html()}${this.og.html()}${this.twitter.html()}`;
2727
3310
  }
2728
3311
  getSuffix() {
2729
- return c(this.suffix) ? ` - ${this.suffix}` : "";
3312
+ return l(this.suffix) ? ` - ${this.suffix}` : "";
3313
+ }
3314
+ }, wt = class {
3315
+ static getItem() {
3316
+ return T.get("__ui:meta-instance__", () => new Ct());
3317
+ }
3318
+ static getOg() {
3319
+ return this.getItem().getOg();
3320
+ }
3321
+ static getTwitter() {
3322
+ return this.getItem().getTwitter();
3323
+ }
3324
+ static getTitle() {
3325
+ return this.getItem().getTitle();
3326
+ }
3327
+ static getKeywords() {
3328
+ return this.getItem().getKeywords();
3329
+ }
3330
+ static getDescription() {
3331
+ return this.getItem().getDescription();
3332
+ }
3333
+ static getImage() {
3334
+ return this.getItem().getImage();
3335
+ }
3336
+ static getCanonical() {
3337
+ return this.getItem().getCanonical();
3338
+ }
3339
+ static getRobots() {
3340
+ return this.getItem().getRobots();
3341
+ }
3342
+ static getAuthor() {
3343
+ return this.getItem().getAuthor();
2730
3344
  }
2731
- }, Z = class {
3345
+ static getSiteName() {
3346
+ return this.getItem().getSiteName();
3347
+ }
3348
+ static getLocale() {
3349
+ return this.getItem().getLocale();
3350
+ }
3351
+ static setTitle(e) {
3352
+ return this.getItem().setTitle(e), this;
3353
+ }
3354
+ static setKeywords(e) {
3355
+ return this.getItem().setKeywords(e), this;
3356
+ }
3357
+ static setDescription(e) {
3358
+ return this.getItem().setDescription(e), this;
3359
+ }
3360
+ static setImage(e) {
3361
+ return this.getItem().setImage(e), this;
3362
+ }
3363
+ static setCanonical(e) {
3364
+ return this.getItem().setCanonical(e), this;
3365
+ }
3366
+ static setRobots(e) {
3367
+ return this.getItem().setRobots(e), this;
3368
+ }
3369
+ static setAuthor(e) {
3370
+ return this.getItem().setAuthor(e), this;
3371
+ }
3372
+ static setSiteName(e) {
3373
+ return this.getItem().setSiteName(e), this;
3374
+ }
3375
+ static setLocale(e) {
3376
+ return this.getItem().setLocale(e), this;
3377
+ }
3378
+ static setSuffix(e) {
3379
+ return this.getItem().setSuffix(e), this;
3380
+ }
3381
+ static html() {
3382
+ return this.getItem().html();
3383
+ }
3384
+ }, Tt = class {
3385
+ constructor(e, t = 320, n = !1) {
3386
+ S(this, "timerId", void 0), S(this, "startTime", void 0), S(this, "remaining", void 0), S(this, "completed", !1), this.callback = e, this.delay = t, n || this.resume();
3387
+ }
3388
+ resume() {
3389
+ if (this.timerId || this.completed) return this;
3390
+ let e = this.getRemaining();
3391
+ return e <= 0 ? this.go() : (this.updateStartTime(), this.timerId = setTimeout(() => this.go(), e)), this;
3392
+ }
3393
+ pause() {
3394
+ return this.timerId && !this.completed && this.stop().updateRemaining(), this;
3395
+ }
3396
+ reset() {
3397
+ return this.clear().resume(), this;
3398
+ }
3399
+ clear() {
3400
+ return this.stop(), this.startTime = void 0, this.remaining = void 0, this.completed = !1, this;
3401
+ }
3402
+ getRemaining() {
3403
+ var e;
3404
+ return (e = this.remaining) == null ? this.delay : e;
3405
+ }
3406
+ getStartTime() {
3407
+ var e;
3408
+ return (e = this.startTime) == null ? Date.now() : e;
3409
+ }
3410
+ go() {
3411
+ return this.callback(), this.timerId = void 0, this.completed = !0, this;
3412
+ }
3413
+ updateRemaining() {
3414
+ return this.completed ? this : (this.remaining === void 0 && (this.remaining = this.delay), this.remaining -= Date.now() - this.getStartTime(), this.remaining < 0 && (this.remaining = 0), this);
3415
+ }
3416
+ updateStartTime() {
3417
+ return this.startTime = Date.now(), this;
3418
+ }
3419
+ stop() {
3420
+ return this.timerId && (clearTimeout(this.timerId), this.timerId = void 0), this;
3421
+ }
3422
+ }, Et = class {
2732
3423
  static async is() {
2733
3424
  let e = await this.get();
2734
3425
  return e !== -1 && e <= 8;
2735
3426
  }
2736
3427
  static async get() {
2737
3428
  var e;
2738
- let t = (e = this.storage.get()) == null ? -1 : e;
3429
+ if (!s()) return 0;
3430
+ let t = (e = this.getStorage().get()) == null ? -1 : e;
2739
3431
  if (!this.calculate && t === -1) {
2740
3432
  let e = await this.init();
2741
- return this.storage.set(e), e;
3433
+ return this.getStorage().set(e), e;
2742
3434
  }
2743
3435
  return t;
2744
3436
  }
2745
3437
  static getStorage() {
2746
- return this.storage;
3438
+ return new E("__ui:scrollbar__", !0);
2747
3439
  }
2748
3440
  static getCalculate() {
2749
3441
  return this.calculate;
2750
3442
  }
2751
3443
  static createElement() {
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) => {
3444
+ return W(document.body, "div", (e) => {
3445
+ e.style.height = "24px", e.style.overflowY = "scroll", e.style.position = "fixed", e.style.width = "100%", W(e, "div", (e) => {
2754
3446
  e.style.height = "100px";
2755
3447
  });
2756
3448
  });
@@ -2765,26 +3457,34 @@ var q = class {
2765
3457
  });
2766
3458
  }
2767
3459
  };
2768
- S(Z, "storage", new T("scrollbar", !0)), S(Z, "calculate", !1);
3460
+ S(Et, "calculate", !1);
2769
3461
  //#endregion
2770
3462
  //#region src/functions/escapeExp.ts
2771
- function Q(e) {
2772
- return e.replace(/([[\]\\^$.?*+(){}/|])/g, "\\$1");
3463
+ function X(e) {
3464
+ return String(e).replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
2773
3465
  }
2774
3466
  //#endregion
2775
3467
  //#region src/functions/getSeparatingSearchExp.ts
2776
- function rt(e) {
2777
- let t = i(e.split(" "), (e) => Q(e)).join("|");
2778
- return RegExp(`(${t})`, "ig");
3468
+ function Dt(e, t = 128) {
3469
+ if (e instanceof RegExp) return e;
3470
+ if (!e || e.trim().length === 0 || e.length > t) return /^/;
3471
+ let n = String(e).replace(/\s+/g, " ").trim().split(" ").map(X).join("|");
3472
+ return RegExp(`(${n})`, "ig");
2779
3473
  }
2780
3474
  //#endregion
2781
3475
  //#region src/functions/addTagHighlightMatch.ts
2782
- function it(e, t, n = "sys-highlight-match") {
2783
- return t ? String(e).replace(rt(t), `<span class="${n}">$1</span>`) : e;
3476
+ var Ot = `___HIGHLIGHT_START_${f(1e5, 999999)}___`, kt = `___HIGHLIGHT_END_${f(1e5, 999999)}___`, At = RegExp(`${Ot}|${kt}`, "g");
3477
+ function jt(e, t, n = "sys-highlight-match", r = !1) {
3478
+ let i = a(e);
3479
+ if (l(i) && l(t)) {
3480
+ let e = i.replace(Dt(t), `${Ot}$1${kt}`);
3481
+ return r && (e = G(e)), e.replace(At, (e) => e === Ot ? `<span class="${n}">` : "</span>");
3482
+ }
3483
+ return r ? G(i) : i;
2784
3484
  }
2785
3485
  //#endregion
2786
3486
  //#region src/classes/SearchListData.ts
2787
- var at = class {
3487
+ var Mt = class {
2788
3488
  constructor(e, t, n, r) {
2789
3489
  S(this, "listCache", void 0), this.list = e, this.columns = t, this.item = n, this.options = r;
2790
3490
  }
@@ -2823,8 +3523,8 @@ var at = class {
2823
3523
  toFormatItem(e, t) {
2824
3524
  let n = {};
2825
3525
  return this.columns && this.columns.forEach((r) => {
2826
- let i = this.getColumnName(r), a = B(e, r);
2827
- n[i] = c(a) && t ? this.addTag(a) : z(a);
3526
+ let i = this.getColumnName(r), a = H(e, r);
3527
+ n[i] = l(a) && t ? this.addTag(a) : P(a);
2828
3528
  }), {
2829
3529
  ...e,
2830
3530
  ...n,
@@ -2835,7 +3535,7 @@ var at = class {
2835
3535
  return e.replace(/\.([a-z0-9])/gi, (e, t) => t.toUpperCase()) + "Search";
2836
3536
  }
2837
3537
  addTag(e) {
2838
- return it(z(e), this.item.get(), this.options.getClassName());
3538
+ return jt(P(e), this.item.get(), this.options.getClassName());
2839
3539
  }
2840
3540
  generateCache() {
2841
3541
  if (!this.isList()) return [];
@@ -2843,8 +3543,8 @@ var at = class {
2843
3543
  for (let t of this.list) {
2844
3544
  let n = "";
2845
3545
  if (this.columns) for (let e of this.columns) {
2846
- let r = B(t, e);
2847
- c(r) && (n += ` ${z(r)}`);
3546
+ let r = H(t, e);
3547
+ l(r) && (n += ` ${P(r)}`);
2848
3548
  }
2849
3549
  e.push({
2850
3550
  item: t,
@@ -2859,7 +3559,7 @@ var at = class {
2859
3559
  resetCache() {
2860
3560
  this.listCache = void 0;
2861
3561
  }
2862
- }, ot = class {
3562
+ }, Nt = class {
2863
3563
  constructor(e, t) {
2864
3564
  this.value = e, this.options = t;
2865
3565
  }
@@ -2879,27 +3579,28 @@ var at = class {
2879
3579
  };
2880
3580
  //#endregion
2881
3581
  //#region src/functions/getExp.ts
2882
- function st(e, t = "ig", n = ":value") {
2883
- let r = Q(e);
3582
+ function Pt(e, t = "ig", n = ":value") {
3583
+ let r = X(e);
2884
3584
  return new RegExp(n.replace(/:value/g, r), t);
2885
3585
  }
2886
3586
  //#endregion
2887
3587
  //#region src/functions/getExactSearchExp.ts
2888
- function ct(e) {
2889
- return st(e, "i", "(:value)");
3588
+ function Ft(e) {
3589
+ return Pt(e, "i", "(:value)");
2890
3590
  }
2891
3591
  //#endregion
2892
3592
  //#region src/functions/getSearchExp.ts
2893
- function lt(e) {
2894
- let t = "";
2895
- return e.split(" ").forEach((e) => {
2896
- let n = Q(e).trim();
2897
- c(n) && (t += `(?=.*?${n})`);
2898
- }), RegExp(`^${t}`, "ig");
3593
+ function It(e, t = 128) {
3594
+ if (!d(e) || e.trim().length === 0 || e.length > t) return /^/;
3595
+ let n = [];
3596
+ return a(e).split(" ").forEach((e) => {
3597
+ let t = X(e).trim();
3598
+ l(t) && n.push(`(?=.*?${t})`);
3599
+ }), RegExp(`^${n.join("")}`, "i");
2899
3600
  }
2900
3601
  //#endregion
2901
3602
  //#region src/classes/SearchListMatcher.ts
2902
- var ut = class {
3603
+ var Lt = class {
2903
3604
  constructor(e, t) {
2904
3605
  S(this, "matcher", void 0), this.item = e, this.options = t, this.initMatcher();
2905
3606
  }
@@ -2916,9 +3617,9 @@ var ut = class {
2916
3617
  this.initMatcher();
2917
3618
  }
2918
3619
  initMatcher() {
2919
- this.item.is() ? this.matcher = this.options.getFindExactMatch() ? ct(this.item.get()) : lt(this.item.get()) : this.matcher = void 0;
3620
+ this.item.is() ? this.matcher = this.options.getFindExactMatch() ? Ft(this.item.get()) : It(this.item.get()) : this.matcher = void 0;
2920
3621
  }
2921
- }, dt = class {
3622
+ }, Rt = class {
2922
3623
  constructor(e) {
2923
3624
  this.options = e;
2924
3625
  }
@@ -2948,12 +3649,12 @@ var ut = class {
2948
3649
  setOptions(e) {
2949
3650
  return this.options = e, this;
2950
3651
  }
2951
- }, ft = class {
3652
+ }, zt = class {
2952
3653
  constructor(e, t, n, r) {
2953
3654
  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) => {
2954
3655
  if (this.matcher.isSelection(t)) return this.data.toFormatItem(e, !0);
2955
3656
  if (this.options.getReturnEverything()) return this.data.toFormatItem(e, !1);
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);
3657
+ }), S(this, "callbackToNone", (e) => this.data.toFormatItem(e, !1)), this.options = new Rt(r), this.item = new Nt(n, this.options), this.matcher = new Lt(this.item, this.options), this.data = new Mt(e, t, this.item, this.options);
2957
3658
  }
2958
3659
  getData() {
2959
3660
  return this.data;
@@ -2988,17 +3689,17 @@ var ut = class {
2988
3689
  to() {
2989
3690
  if (this.item.isSearch()) return this.data.forEach(this.callbackToSelection);
2990
3691
  let e = this.data.getList();
2991
- return e ? i(e, this.callbackToNone) : [];
3692
+ return e ? r(e, this.callbackToNone) : [];
2992
3693
  }
2993
- }, pt = class e {
3694
+ }, Bt = () => T.get("__ui:storage-callback__", () => ({})), Vt = class e {
2994
3695
  static getInstance(t, n = "main") {
2995
3696
  return new e(t, n);
2996
3697
  }
2997
3698
  constructor(e, t = "main") {
2998
3699
  S(this, "callbacks", []), S(this, "loading", !1), this.name = e, this.group = t;
2999
- let n = `${t}:${e}`;
3000
- if (n in mt) return mt[n];
3001
- mt[n] = this;
3700
+ let n = `${t}:${e}`, r = Bt();
3701
+ if (n in r) return r[n];
3702
+ r[n] = this;
3002
3703
  }
3003
3704
  isLoading() {
3004
3705
  return this.loading;
@@ -3023,10 +3724,10 @@ var ut = class {
3023
3724
  }
3024
3725
  async run(e) {
3025
3726
  this.loading = !1;
3026
- for (let { callback: t, isOnce: n } of this.callbacks) await me(t, e), n && this.removeCallback(t);
3727
+ for (let { callback: t, isOnce: n } of this.callbacks) await Le(t, e), n && this.removeCallback(t);
3027
3728
  return this;
3028
3729
  }
3029
- }, mt = {}, ht = [
3730
+ }, Ht = [
3030
3731
  "d",
3031
3732
  "e",
3032
3733
  "f",
@@ -3046,18 +3747,32 @@ var ut = class {
3046
3747
  "t",
3047
3748
  "u",
3048
3749
  "v"
3049
- ], gt = (e, t = {}) => {
3750
+ ], Ut = RegExp(`%(${Ht.join("|")})`, "g"), Wt = (e, t = {}) => {
3050
3751
  let r = String(e);
3051
- if (e.match(/%[a-z]/)) {
3052
- let e = 0;
3053
- i(t, (t) => {
3054
- r = r.replace(RegExp(`%${ht[e++]}`, "g"), String(t));
3055
- });
3056
- }
3057
- return n(t) && i(t, (e, t) => {
3058
- r = r.replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})(.*?)(?:\\[|\\{)\\/${t}(?:\\]|\\})`, "g"), (t, n) => String(e).replace(/(?:\[|\{)content(?:\]|\})/g, n)).replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})`, "g"), String(e));
3059
- }), r;
3060
- }, _t = "global", vt = 160, yt = class {
3752
+ return Array.isArray(t) && e.match(/%[a-z]/) && (r = r.replace(Ut, (e, n) => {
3753
+ let r = Ht.indexOf(n);
3754
+ if (r !== -1) {
3755
+ var i;
3756
+ return String((i = t == null ? void 0 : t[r]) == null ? "" : i);
3757
+ }
3758
+ return e;
3759
+ })), n(t) && (r = r.replace(/[[{](.*?)[\]}](.*?)[[{]\/\1[\]}]/g, (e, n, r) => {
3760
+ if (n in t) {
3761
+ var i;
3762
+ return String((i = t[n]) == null ? "" : i).replace(/[[{]content[\]}]/g, () => r);
3763
+ }
3764
+ return e;
3765
+ }), r = r.replace(/[[{](.*?)[\]}]/g, (e, n) => {
3766
+ if (n in t) {
3767
+ var r;
3768
+ return String((r = t[n]) == null ? "" : r);
3769
+ }
3770
+ return e;
3771
+ })), r;
3772
+ }, Gt = (e) => {
3773
+ var t;
3774
+ return i(e) ? !0 : !!(e && n(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || !(e == null || (t = e.statusObject) == null) && t.status && /^2/.test(String(e.statusObject.status)) || !("status" in e) && !("success" in e) && !("statusObject" in e) && /^2/.test(String(N.getStatus().getStatus()))));
3775
+ }, Kt = "global", qt = 160, Jt = class {
3061
3776
  constructor(e, t = () => D.getLanguage(), n = () => D.getLocation()) {
3062
3777
  S(this, "files", {}), S(this, "data", {}), this.language = t, this.location = n, e && this.add(e);
3063
3778
  }
@@ -3065,10 +3780,10 @@ var ut = class {
3065
3780
  return Object.keys(this.files).length > 0 && this.getIndex() !== void 0;
3066
3781
  }
3067
3782
  getLocation() {
3068
- return y(this.location);
3783
+ return b(this.location);
3069
3784
  }
3070
3785
  getLanguage() {
3071
- return y(this.language);
3786
+ return b(this.language);
3072
3787
  }
3073
3788
  async getList() {
3074
3789
  let e = this.getIndex();
@@ -3078,8 +3793,8 @@ var ut = class {
3078
3793
  }
3079
3794
  }
3080
3795
  add(e) {
3081
- i(e, (e, t) => {
3082
- v(e) && (this.files[t] = e);
3796
+ r(e, (e, t) => {
3797
+ y(e) && (this.files[t] = e);
3083
3798
  });
3084
3799
  }
3085
3800
  getIndex() {
@@ -3087,25 +3802,25 @@ var ut = class {
3087
3802
  if (e in this.files) return e;
3088
3803
  let t = this.getLanguage();
3089
3804
  if (t in this.files) return t;
3090
- if ("global" in this.files) return _t;
3805
+ if ("global" in this.files) return Kt;
3091
3806
  }
3092
3807
  getByData(e) {
3093
3808
  if (e in this.data) return this.data[e];
3094
3809
  }
3095
3810
  async getByFile(e) {
3096
3811
  if (e in this.files) {
3097
- let t = await y(this.files[e]);
3812
+ let t = await b(this.files[e]);
3098
3813
  return t && (this.data[e] = t), t;
3099
3814
  }
3100
3815
  }
3101
- }, bt = class {
3102
- constructor(e = "/api/translate", t = "list", n = new yt()) {
3816
+ }, Yt = class {
3817
+ constructor(e = "/api/translate", t = "list", n = new Jt()) {
3103
3818
  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;
3104
3819
  }
3105
3820
  async get(e, t) {
3106
3821
  var n;
3107
3822
  let r = this.getText(e);
3108
- return r ? this.replacement(r, t) : (P.isLocalhost() || await this.add(e), this.replacement((n = this.getText(e)) == null ? e : n));
3823
+ return r ? this.replacement(r, t) : (N.isLocalhost() || await this.add(e), this.replacement((n = this.getText(e)) == null ? e : n));
3109
3824
  }
3110
3825
  getSync(e, t = !1, n) {
3111
3826
  let r = this.getText(e);
@@ -3141,19 +3856,19 @@ var ut = class {
3141
3856
  });
3142
3857
  }
3143
3858
  addSync(e) {
3144
- i(e, (e, t) => {
3145
- u(e) && c(e) && (this.data[this.getName(t)] = e);
3859
+ r(e, (e, t) => {
3860
+ d(e) && l(e) && (this.data[this.getName(t)] = e);
3146
3861
  });
3147
3862
  }
3148
3863
  async addNormalOrSync(e) {
3149
- if (c(e)) if (P.isLocalhost()) this.addSync(e);
3864
+ if (l(e)) if (N.isLocalhost()) this.addSync(e);
3150
3865
  else {
3151
3866
  let t = Object.keys(e);
3152
3867
  t.length > 0 && await this.add(t);
3153
3868
  }
3154
3869
  }
3155
3870
  addSyncByLocation(e) {
3156
- i(e, (e, t) => i(e, (e, n) => {
3871
+ r(e, (e, t) => r(e, (e, n) => {
3157
3872
  let r = `${t}-${n}`;
3158
3873
  r in this.data || (this.data[r] = e);
3159
3874
  }));
@@ -3188,26 +3903,31 @@ var ut = class {
3188
3903
  return `${this.files.getLanguage()}-${e}`;
3189
3904
  }
3190
3905
  getNameByGlobal(e) {
3191
- return `${_t}-${e}`;
3906
+ return `${Kt}-${e}`;
3192
3907
  }
3193
3908
  getNamesNone(e) {
3194
3909
  let t = [];
3195
- return A(e).forEach((e) => {
3910
+ return k(e).forEach((e) => {
3196
3911
  e !== "__TRANSLATE_START__" && e !== "__TRANSLATE_END__" && !this.hasName(e) && t.push(e);
3197
3912
  }), t;
3198
3913
  }
3199
3914
  async getResponse() {
3200
- let e = await P.get({
3915
+ let e = await N.get({
3201
3916
  api: !1,
3202
3917
  path: this.url,
3203
3918
  request: { [this.propsName]: this.cache },
3204
3919
  toData: !0,
3920
+ timeout: 12e3,
3205
3921
  global: !0
3206
3922
  });
3207
- return e == null ? {} : e;
3923
+ return Gt(e) || C.on({
3924
+ group: "translate",
3925
+ code: "error",
3926
+ details: e
3927
+ }), e == null ? {} : e;
3208
3928
  }
3209
3929
  replacement(e, t) {
3210
- return t ? gt(e, t) : e;
3930
+ return t ? Wt(e, t) : e;
3211
3931
  }
3212
3932
  async make() {
3213
3933
  let e;
@@ -3219,132 +3939,188 @@ var ut = class {
3219
3939
  this.data[this.getName(t)] = (n = e == null ? void 0 : e[t]) == null ? "" : n;
3220
3940
  }), this.cache = [];
3221
3941
  }
3222
- }, xt = class {
3942
+ }, Xt = class {
3223
3943
  static async get(e, t) {
3224
- return this.item.get(e, t);
3944
+ return this.getItem().get(e, t);
3225
3945
  }
3226
3946
  static getItem() {
3227
- return this.item;
3947
+ return this.item || (this.item = new Yt()), this.item;
3228
3948
  }
3229
3949
  static getSync(e, t = !1, n) {
3230
- return this.item.getSync(e, t, n);
3950
+ return this.getItem().getSync(e, t, n);
3231
3951
  }
3232
3952
  static getList(e) {
3233
- return this.item.getList(e);
3953
+ return this.getItem().getList(e);
3234
3954
  }
3235
3955
  static getListSync(e, t = !1) {
3236
- return this.item.getListSync(e, t);
3956
+ return this.getItem().getListSync(e, t);
3237
3957
  }
3238
3958
  static async add(e) {
3239
- await this.item.add(e);
3959
+ await this.getItem().add(e);
3240
3960
  }
3241
3961
  static addSync(e) {
3242
- this.item.addSync(e);
3962
+ this.getItem().addSync(e);
3243
3963
  }
3244
3964
  static async addNormalOrSync(e) {
3245
- await this.item.addNormalOrSync(e);
3965
+ await this.getItem().addNormalOrSync(e);
3246
3966
  }
3247
3967
  static addSyncByLocation(e) {
3248
- this.item.addSyncByLocation(e);
3968
+ this.getItem().addSyncByLocation(e);
3249
3969
  }
3250
3970
  static addSyncByFile(e) {
3251
- this.item.addSyncByFile(e);
3971
+ this.getItem().addSyncByFile(e);
3252
3972
  }
3253
3973
  static setUrl(e) {
3254
- return this.item.setUrl(e), this;
3974
+ this.getItem().setUrl(e);
3255
3975
  }
3256
3976
  static setPropsName(e) {
3257
- return this.item.setPropsName(e), this;
3977
+ this.getItem().setPropsName(e);
3258
3978
  }
3259
3979
  static setReadApi(e) {
3260
- return this.item.setReadApi(e), this;
3980
+ this.getItem().setReadApi(e);
3261
3981
  }
3262
3982
  static setConfig(e) {
3263
- 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;
3983
+ e.url && this.getItem().setUrl(e.url), e.propsName && this.getItem().setPropsName(e.propsName), typeof e.readApi == "boolean" && this.getItem().setReadApi(e.readApi);
3264
3984
  }
3265
3985
  };
3266
- S(xt, "item", new bt());
3986
+ S(Xt, "item", void 0);
3267
3987
  //#endregion
3268
3988
  //#region src/functions/arrFill.ts
3269
- function St(e, t) {
3989
+ function Zt(e, t) {
3270
3990
  return Array(t).fill(e);
3271
3991
  }
3272
3992
  //#endregion
3273
3993
  //#region src/functions/blobToBase64.ts
3274
- function Ct(e) {
3275
- return new Promise((t, n) => {
3994
+ var Qt = () => $t() !== void 0, $t = () => {
3995
+ var e;
3996
+ return (e = globalThis) == null ? void 0 : e.Buffer;
3997
+ }, en = async (e) => new Promise((t, n) => {
3998
+ if (typeof FileReader < "u") {
3276
3999
  let r = new FileReader();
3277
- r.onloadend = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
3278
- });
4000
+ r.onloadend = () => {
4001
+ if (!(r != null && r.result)) {
4002
+ n(/* @__PURE__ */ Error("Failed to read blob"));
4003
+ return;
4004
+ }
4005
+ t(r.result.replace(/^data:.*?,/, ""));
4006
+ }, r.onerror = n, r.readAsDataURL(e);
4007
+ } else n();
4008
+ }), tn = (e) => {
4009
+ var t;
4010
+ return ((t = globalThis) == null ? void 0 : t.Buffer).from(e).toString("base64");
4011
+ };
4012
+ async function nn(e, t = !1) {
4013
+ let n = s() ? await en(e) : Qt() ? tn(await e.arrayBuffer()) : void 0;
4014
+ if (n) return t ? n : `data:${e.type};base64,${n}`;
3279
4015
  }
3280
4016
  //#endregion
3281
4017
  //#region src/functions/capitalize.ts
3282
- function wt(e) {
3283
- return c(e) ? e.charAt(0).toUpperCase() + e.slice(1) : e;
4018
+ function rn(e, t = !1) {
4019
+ let n = String(e);
4020
+ return n.length > 0 ? t ? n.charAt(0).toLocaleUpperCase(D.getLocation()) + n.slice(1) : n.charAt(0).toUpperCase() + n.slice(1) : n;
4021
+ }
4022
+ //#endregion
4023
+ //#region src/functions/copyObject.ts
4024
+ function Z(e) {
4025
+ return JSON.parse(JSON.stringify(e));
4026
+ }
4027
+ //#endregion
4028
+ //#region src/functions/copyObjectLite.ts
4029
+ function an(e, t) {
4030
+ return Object.assign({}, e, t);
3284
4031
  }
3285
4032
  //#endregion
3286
4033
  //#region src/functions/domQuerySelector.ts
3287
- function Tt(e) {
3288
- if (m()) {
4034
+ function on(e) {
4035
+ if (s()) {
3289
4036
  var t;
3290
4037
  return (t = document.querySelector(e)) == null ? void 0 : t;
3291
4038
  }
3292
4039
  }
3293
4040
  //#endregion
3294
4041
  //#region src/functions/domQuerySelectorAll.ts
3295
- function Et(e) {
3296
- if (m()) return document.querySelectorAll(e);
4042
+ function sn(e) {
4043
+ if (s()) return document.querySelectorAll(e);
3297
4044
  }
3298
4045
  //#endregion
3299
4046
  //#region src/functions/getElementImage.ts
3300
- function Dt(e) {
3301
- return u(e) ? K(void 0, "img", { src: e }) : e;
4047
+ function cn(e) {
4048
+ return d(e) ? W(void 0, "img", { src: e }) : e;
3302
4049
  }
3303
4050
  //#endregion
3304
4051
  //#region src/functions/resizeImageByMax.ts
3305
- function Ot(e, t = "auto") {
4052
+ function ln(e, t = "auto") {
3306
4053
  switch (t) {
3307
4054
  case "auto": return e.naturalWidth >= e.naturalHeight;
3308
4055
  case "width": return !0;
3309
4056
  case "height": return !1;
3310
4057
  }
3311
4058
  }
3312
- function kt(e, t, n = "auto", r) {
3313
- let i = Dt(e);
3314
- if (i && (i.naturalWidth > t && (n === "auto" || n === "width") || i.naturalHeight > t && (n === "auto" || n === "height"))) {
4059
+ function un(e, t, n = "auto", r) {
4060
+ let i = cn(e);
4061
+ if (s() && i && i.naturalWidth && i.naturalHeight && (i.naturalWidth > t && (n === "auto" || n === "width") || i.naturalHeight > t && (n === "auto" || n === "height"))) {
3315
4062
  var a;
3316
- let e = Ot(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
4063
+ let e = ln(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
3317
4064
  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);
3318
4065
  }
3319
4066
  }
3320
4067
  //#endregion
3321
4068
  //#region src/functions/ensureMaxSize.ts
3322
- async function At(e, t = .56, n = "image/jpeg") {
4069
+ async function dn(e, t = .56, n = "image/jpeg") {
3323
4070
  return new Promise((r) => {
3324
- let i = new Blob([e], { type: n }), a = Dt(URL.createObjectURL(i));
3325
- a ? a.onload = () => {
3326
- let e = kt(a, t * a.naturalWidth, "width", n);
3327
- r(e == null ? "" : e);
3328
- } : Ct(i).then((e) => r(String(e == null ? "" : e)));
4071
+ if (!s()) {
4072
+ r("");
4073
+ return;
4074
+ }
4075
+ let i = new Blob([e], { type: n }), a = URL.createObjectURL(i), o = cn(a);
4076
+ o ? (o.onload = () => {
4077
+ let e = un(o, t * o.naturalWidth, "width", n);
4078
+ r(e == null ? "" : e), URL.revokeObjectURL(a);
4079
+ }, o.onerror = () => {
4080
+ URL.revokeObjectURL(a), r("");
4081
+ }) : nn(i).then((e) => r(String(e == null ? "" : e)));
3329
4082
  });
3330
4083
  }
3331
4084
  //#endregion
3332
4085
  //#region src/functions/eventStopPropagation.ts
3333
- function jt(e) {
4086
+ function fn(e) {
3334
4087
  e.preventDefault(), e.stopPropagation();
3335
4088
  }
3336
4089
  //#endregion
3337
4090
  //#region src/functions/frame.ts
3338
- function Mt(e, t, n) {
4091
+ function pn(e, t, n) {
3339
4092
  let r = () => {
3340
- e(), t != null && t() ? Mt(e, t, n) : n == null || n();
4093
+ e(), s() && t != null && t() ? pn(e, t, n) : n == null || n();
3341
4094
  };
3342
- m() ? requestAnimationFrame(r) : r();
4095
+ s() ? requestAnimationFrame(r) : r();
4096
+ }
4097
+ //#endregion
4098
+ //#region src/functions/getArrayHighlightMatch.ts
4099
+ function mn(e, t) {
4100
+ let n = a(e);
4101
+ if (l(n) && l(t)) {
4102
+ let e = [], r = Dt(t), i = 0, a;
4103
+ for (; (a = r.exec(n)) !== null && a.index !== r.lastIndex;) a.index > i && e.push({
4104
+ text: n.substring(i, a.index),
4105
+ isMatch: !1
4106
+ }), e.push({
4107
+ text: a[0],
4108
+ isMatch: !0
4109
+ }), i = r.lastIndex;
4110
+ return i < n.length && e.push({
4111
+ text: n.substring(i),
4112
+ isMatch: !1
4113
+ }), e;
4114
+ }
4115
+ return [{
4116
+ text: n,
4117
+ isMatch: !1
4118
+ }];
3343
4119
  }
3344
4120
  //#endregion
3345
4121
  //#region src/functions/getAttributes.ts
3346
- function Nt(e) {
3347
- let t = {}, n = k(e);
4122
+ function hn(e) {
4123
+ let t = {}, n = O(e);
3348
4124
  if (n) for (let e of n.attributes) {
3349
4125
  var r;
3350
4126
  t[e.name] = (r = (e == null ? void 0 : e.value) || (e == null ? void 0 : e.textContent)) == null ? void 0 : r;
@@ -3353,130 +4129,163 @@ function Nt(e) {
3353
4129
  }
3354
4130
  //#endregion
3355
4131
  //#region src/functions/getClipboardData.ts
3356
- async function Pt(e) {
3357
- var t, n;
3358
- return (t = e == null || (n = e.clipboardData) == null ? void 0 : n.getData("text")) == null ? await navigator.clipboard.readText() || "" : t;
4132
+ async function gn(e) {
4133
+ if (s()) try {
4134
+ var t, n;
4135
+ return (t = e == null || (n = e.clipboardData) == null ? void 0 : n.getData("text")) == null ? await navigator.clipboard.readText() || "" : t;
4136
+ } catch (e) {
4137
+ C.on({
4138
+ group: "clipboard",
4139
+ code: "error",
4140
+ details: e
4141
+ });
4142
+ }
4143
+ return "";
3359
4144
  }
3360
4145
  //#endregion
3361
4146
  //#region src/functions/getCurrentDate.ts
3362
- function Ft(e = "datetime") {
3363
- return new Me(void 0, e).standard();
4147
+ function _n(e = "datetime") {
4148
+ return new $e(void 0, e).standard();
3364
4149
  }
3365
4150
  //#endregion
3366
4151
  //#region src/functions/getCurrentTime.ts
3367
- function It() {
3368
- return (/* @__PURE__ */ new Date()).getTime();
4152
+ function vn() {
4153
+ return Date.now();
3369
4154
  }
3370
4155
  //#endregion
3371
4156
  //#region src/functions/getElementId.ts
3372
- var Lt = d(1e5, 9e5);
3373
- function Rt(e, t) {
3374
- let n = k(e);
3375
- return n ? (c(n.id) || n.setAttribute("id", `id-${Lt++}`), t ? `#${n.id}${t}`.trim() : n.id) : `id-${Lt++}`;
4157
+ var Q, yn = () => {
4158
+ let e = Q == null ? void 0 : Q();
4159
+ if (e) return `id-server-${e}`;
4160
+ let t = T.get("__ui:getElementId__", () => ({ id: 1e5 }));
4161
+ return `id-${t.id++}`;
4162
+ };
4163
+ function bn(e, t) {
4164
+ if (e) {
4165
+ let n = O(e);
4166
+ if (n) return l(n.id) || n.setAttribute("id", yn()), t ? `#${n.id}${t}`.trim() : n.id;
4167
+ }
4168
+ return yn();
4169
+ }
4170
+ function xn(e) {
4171
+ Q || (Q = e);
3376
4172
  }
3377
4173
  //#endregion
3378
4174
  //#region src/functions/getKey.ts
3379
- function zt(e) {
4175
+ function Sn(e) {
3380
4176
  var t, n, r;
3381
4177
  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;
3382
4178
  }
3383
4179
  //#endregion
3384
4180
  //#region src/functions/getLengthOfAllArray.ts
3385
- function Bt(e) {
3386
- return i(e, (e) => e.length);
4181
+ function Cn(e) {
4182
+ return r(e, (e) => {
4183
+ var t;
4184
+ return (t = e == null ? void 0 : e.length) == null ? 0 : t;
4185
+ });
3387
4186
  }
3388
4187
  //#endregion
3389
4188
  //#region src/functions/getMaxLengthAllArray.ts
3390
- function Vt(e) {
3391
- return Math.max(...Bt(e));
4189
+ function wn(e) {
4190
+ if (!l(e)) return 0;
4191
+ let t = Cn(e);
4192
+ return t.length > 1e4 ? t.reduce((e, t) => Math.max(e, t)) : Math.max(...t);
3392
4193
  }
3393
4194
  //#endregion
3394
4195
  //#region src/functions/getMinLengthAllArray.ts
3395
- function Ht(e) {
3396
- return Math.min(...Bt(e));
4196
+ function Tn(e) {
4197
+ if (!l(e)) return 0;
4198
+ let t = Cn(e);
4199
+ return t.length > 1e4 ? t.reduce((e, t) => Math.min(e, t)) : Math.min(...t);
3397
4200
  }
3398
4201
  //#endregion
3399
4202
  //#region src/functions/getMouseClientX.ts
3400
- function Ut(e) {
4203
+ function En(e) {
3401
4204
  var t, n;
3402
4205
  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;
3403
4206
  }
3404
4207
  //#endregion
3405
4208
  //#region src/functions/getMouseClientY.ts
3406
- function Wt(e) {
4209
+ function Dn(e) {
3407
4210
  var t, n;
3408
4211
  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;
3409
4212
  }
3410
4213
  //#endregion
3411
4214
  //#region src/functions/getMouseClient.ts
3412
- function Gt(e) {
4215
+ function On(e) {
3413
4216
  return {
3414
- x: Ut(e),
3415
- y: Wt(e)
4217
+ x: En(e),
4218
+ y: Dn(e)
3416
4219
  };
3417
4220
  }
3418
4221
  //#endregion
3419
4222
  //#region src/functions/getObjectByKeys.ts
3420
- function Kt(e, t) {
3421
- let n = {};
3422
- return t.forEach((t) => {
3423
- t in e && e[t] !== void 0 && (n[t] = e[t]);
3424
- }), n;
4223
+ function kn(e, t) {
4224
+ let r = {};
4225
+ return n(e) && t.forEach((t) => {
4226
+ t in e && e[t] !== void 0 && (r[t] = e[t]);
4227
+ }), r;
3425
4228
  }
3426
4229
  //#endregion
3427
4230
  //#region src/functions/getObjectNoUndefined.ts
3428
- function qt(e, t = void 0) {
4231
+ function An(e, t = void 0) {
3429
4232
  let n = {};
3430
- return i(e, (e, r) => {
4233
+ return r(e, (e, r) => {
3431
4234
  e !== t && (n[r] = e);
3432
4235
  }), n;
3433
4236
  }
3434
4237
  //#endregion
3435
4238
  //#region src/functions/getObjectOrNone.ts
3436
- function Jt(e) {
4239
+ function jn(e) {
3437
4240
  return n(e) ? e : {};
3438
4241
  }
3439
4242
  //#endregion
4243
+ //#region src/functions/getOnlyText.ts
4244
+ function Mn(e) {
4245
+ return P(e).replace(/[^\p{L}\p{N}\s]+/gu, "").trim();
4246
+ }
4247
+ //#endregion
3440
4248
  //#region src/functions/strFill.ts
3441
- function Yt(e, t) {
3442
- return St(e, t).join("");
4249
+ function Nn(e, t) {
4250
+ return String(e).repeat(t);
3443
4251
  }
3444
4252
  //#endregion
3445
4253
  //#region src/functions/getRandomText.ts
3446
- function Xt(e, t, n = "#", r = 2, i = 12) {
3447
- let a = d(e, t), o = [];
3448
- for (let e = 0; e < a; e++) o.push(Yt(n, d(r, i)));
4254
+ function Pn(e, t, n = "#", r = 2, i = 12) {
4255
+ let a = f(e, t), o = [];
4256
+ for (let e = 0; e < a; e++) o.push(Nn(n, f(r, i)));
3449
4257
  return o.join(" ");
3450
4258
  }
3451
4259
  //#endregion
3452
4260
  //#region src/functions/getStepPercent.ts
3453
- function Zt(e, t) {
4261
+ function Fn(e, t) {
3454
4262
  let n = e == null ? 0 : e;
3455
4263
  return t > n ? 100 / (t - n) : 0;
3456
4264
  }
3457
4265
  //#endregion
3458
4266
  //#region src/functions/getStepValue.ts
3459
- function Qt(e, t) {
4267
+ function In(e, t) {
3460
4268
  let n = e == null ? 0 : e;
3461
4269
  return t > n ? (t - n) / 100 : 0;
3462
4270
  }
3463
4271
  //#endregion
3464
4272
  //#region src/functions/goScroll.ts
3465
- var $t = 0;
3466
- function en(e, t, n) {
4273
+ var Ln = 0;
4274
+ function Rn(e, t, n) {
4275
+ if (!s()) return;
3467
4276
  let r = t == null ? void 0 : t.closest(e);
3468
4277
  if (t && r && r.scrollHeight !== r.offsetHeight) {
3469
4278
  let e = r.getBoundingClientRect(), i = t.getBoundingClientRect();
3470
4279
  if (n) {
3471
4280
  let a = n.getBoundingClientRect();
3472
4281
  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);
3473
- } else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top - $t : r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = i.top - e.top + i.height - e.height + $t);
4282
+ } else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top - Ln : r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = i.top - e.top + i.height - e.height + Ln);
3474
4283
  }
3475
4284
  }
3476
4285
  //#endregion
3477
4286
  //#region src/functions/goScrollSmooth.ts
3478
- function tn(e, t, n = 0) {
3479
- if (!m()) return;
4287
+ function zn(e, t, n = 0) {
4288
+ if (!s()) return;
3480
4289
  let r = (t == null ? void 0 : t.behavior) || "smooth";
3481
4290
  if ("scrollIntoView" in e && !n) {
3482
4291
  e.scrollIntoView({
@@ -3497,8 +4306,8 @@ function tn(e, t, n = 0) {
3497
4306
  }
3498
4307
  //#endregion
3499
4308
  //#region src/functions/goScrollTo.ts
3500
- function nn(e, t, n = "smooth") {
3501
- if (!m() || !e || !t) return;
4309
+ function Bn(e, t, n = "smooth") {
4310
+ if (!s() || !e || !t) return;
3502
4311
  let r = e.getBoundingClientRect(), i = t.getBoundingClientRect();
3503
4312
  e.scrollBy({
3504
4313
  top: i.top - r.top,
@@ -3508,95 +4317,93 @@ function nn(e, t, n = "smooth") {
3508
4317
  }
3509
4318
  //#endregion
3510
4319
  //#region src/functions/isShare.ts
3511
- function rn() {
3512
- return m() && typeof navigator < "u" && !!navigator.share;
4320
+ function Vn() {
4321
+ return s() && typeof navigator < "u" && !!navigator.share;
3513
4322
  }
3514
4323
  //#endregion
3515
4324
  //#region src/functions/handleShare.ts
3516
- async function an(e) {
3517
- if (rn() && navigator.canShare && navigator.canShare(e)) try {
4325
+ async function Hn(e) {
4326
+ if (Vn() && navigator.canShare && navigator.canShare(e)) try {
3518
4327
  return await navigator.share(e), !0;
3519
4328
  } catch (e) {
3520
- console.error("handleShare error:", e);
4329
+ C.on({
4330
+ group: "share",
4331
+ code: "error",
4332
+ details: e
4333
+ });
3521
4334
  }
3522
4335
  return !1;
3523
4336
  }
3524
4337
  //#endregion
3525
4338
  //#region src/functions/inArray.ts
3526
- function on(e, t) {
3527
- return e.indexOf(t) !== -1;
4339
+ function Un(e, t) {
4340
+ return e.includes(t);
3528
4341
  }
3529
4342
  //#endregion
3530
4343
  //#region src/functions/initScrollbarOffset.ts
3531
- async function sn() {
3532
- if (m()) {
3533
- let e = await Z.get();
4344
+ async function Wn() {
4345
+ if (s()) {
4346
+ let e = await Et.get();
3534
4347
  document.body.style.setProperty("--sys-scrollbar-offset", `${e}px`);
3535
4348
  }
3536
4349
  }
3537
4350
  //#endregion
3538
4351
  //#region src/functions/intersectKey.ts
3539
- function cn(e, n) {
3540
- let r = {};
3541
- return t(e) && t(n) && i(e, (e, t) => {
3542
- t in n && (r[t] = e);
3543
- }), r;
4352
+ function Gn(e, n) {
4353
+ let i = {};
4354
+ return t(e) && t(n) && r(e, (e, t) => {
4355
+ t in n && (i[t] = e);
4356
+ }), i;
3544
4357
  }
3545
4358
  //#endregion
3546
- //#region src/functions/isApiSuccess.ts
3547
- var ln = (e) => {
3548
- var t;
3549
- 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(P.getStatus().getStatus()).match(/^2/)));
3550
- };
3551
- //#endregion
3552
4359
  //#region src/functions/isDifferent.ts
3553
- function un(e, t) {
4360
+ function Kn(e, t) {
3554
4361
  let n = Object.keys(e).length !== Object.keys(t).length;
3555
- return n || i(e, (e, r) => {
4362
+ return n || r(e, (e, r) => {
3556
4363
  e !== (t == null ? void 0 : t[r]) && (n = !0);
3557
4364
  }), n;
3558
4365
  }
3559
4366
  //#endregion
3560
4367
  //#region src/functions/isElementVisible.ts
3561
- function dn(e) {
3562
- if (!m()) return !1;
3563
- let t = k(e);
4368
+ function qn(e) {
4369
+ if (!s()) return !1;
4370
+ let t = O(e);
3564
4371
  if (!t || "isConnected" in t && t.isConnected === !1) return !1;
3565
4372
  let n = window.getComputedStyle(t);
3566
4373
  return n.display !== "none" && n.visibility !== "hidden" && n.opacity !== "0" && t.offsetWidth !== 0 && t.offsetHeight !== 0;
3567
4374
  }
3568
4375
  //#endregion
3569
4376
  //#region src/functions/isInput.ts
3570
- var fn = (e) => {
4377
+ var Jn = (e) => {
3571
4378
  if (e instanceof HTMLElement) {
3572
4379
  let t = e.tagName.toLowerCase();
3573
4380
  return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true");
3574
4381
  }
3575
4382
  return !1;
3576
- }, pn = (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 ? !fn(e.target) : !t : !1;
4383
+ }, Yn = (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 ? !Jn(e.target) : !t : !1;
3577
4384
  //#endregion
3578
4385
  //#region src/functions/isFloat.ts
3579
- function mn(e) {
4386
+ function Xn(e) {
3580
4387
  switch (typeof e) {
3581
4388
  case "number": return !0;
3582
- case "string": return !!e.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
4389
+ case "string": return /^-?\d+(\.\d+)?$/.test(e);
3583
4390
  default: return !1;
3584
4391
  }
3585
4392
  }
3586
4393
  //#endregion
3587
4394
  //#region src/functions/isIntegerBetween.ts
3588
- function hn(e, t) {
4395
+ function Zn(e, t) {
3589
4396
  let n = Math.floor(t);
3590
4397
  return e >= n && e < n + 1;
3591
4398
  }
3592
4399
  //#endregion
3593
4400
  //#region src/functions/isSelectedByList.ts
3594
- function gn(e, t) {
3595
- return Array.isArray(e) ? e.every((e) => _(e, t)) : _(e, t);
4401
+ function Qn(e, t) {
4402
+ return Array.isArray(e) ? e.every((e) => v(e, t)) : v(e, t);
3596
4403
  }
3597
4404
  //#endregion
3598
4405
  //#region src/functions/removeCommonPrefix.ts
3599
- function _n(e, t) {
4406
+ function $n(e, t) {
3600
4407
  if (e.startsWith(t)) return e.slice(t.length).trim();
3601
4408
  let n = 0;
3602
4409
  for (; e[n] === t[n] && n < e.length && n < t.length;) n++;
@@ -3604,97 +4411,101 @@ function _n(e, t) {
3604
4411
  }
3605
4412
  //#endregion
3606
4413
  //#region src/functions/replaceComponentName.ts
3607
- var vn = (e, t, n) => {
4414
+ var er = (e, t, n) => {
3608
4415
  var r;
3609
4416
  return e == null || (r = e.replace(RegExp(`<${t}`, "ig"), `<${n}`)) == null || (r = r.replace(RegExp(`</${t}`, "ig"), `</${n}`)) == null ? void 0 : r.trim();
3610
4417
  };
3611
4418
  //#endregion
3612
4419
  //#region src/functions/uniqueArray.ts
3613
- function yn(e) {
4420
+ function tr(e) {
3614
4421
  return [...new Set(e)];
3615
4422
  }
3616
4423
  //#endregion
3617
4424
  //#region src/functions/replaceRecursive.ts
3618
- function $(e, n, r = !0) {
3619
- let a = p(e);
3620
- return t(e) && t(n) && i(n, (n, i) => {
3621
- let o = e == null ? void 0 : e[i];
3622
- t(o) && t(n) ? r && Array.isArray(o) && Array.isArray(n) ? a[i] = p(yn([...o, ...n])) : a[i] = $(Array.isArray(o) ? { ...o } : o, n, r) : a[i] = t(n) ? p(n) : n;
4425
+ function $(e, n, i = !0) {
4426
+ let a = Z(e);
4427
+ return t(e) && t(n) && r(n, (n, r) => {
4428
+ let o = e == null ? void 0 : e[r];
4429
+ t(o) && t(n) ? i && Array.isArray(o) && Array.isArray(n) ? a[r] = Z(tr([...o, ...n])) : a[r] = $(Array.isArray(o) ? { ...o } : o, n, i) : a[r] = t(n) ? Z(n) : n;
3623
4430
  }), a;
3624
4431
  }
3625
4432
  //#endregion
3626
4433
  //#region src/functions/replaceTemplate.ts
3627
- function bn(e, t) {
4434
+ function nr(e, t) {
3628
4435
  let n = e;
3629
- return i(t, (e, t) => {
3630
- n = n.replace(st(`[${t}]`), y(e));
4436
+ return r(t, (e, t) => {
4437
+ n = n.replace(Pt(`[${t}]`), b(e));
3631
4438
  }), n;
3632
4439
  }
3633
4440
  //#endregion
3634
4441
  //#region src/functions/secondToTime.ts
3635
- function xn(e) {
3636
- let t = g(e);
3637
- return t > 0 ? `${String(Math.floor(t / 60)).padStart(2, "0")}:${String(t % 60).padStart(2, "0")}` : "00:00";
4442
+ function rr(e, t) {
4443
+ let n = _(e);
4444
+ if (n > 0) {
4445
+ let e = String(Math.floor(n / 60)).padStart(2, "0"), r = String(n % 60).padStart(2, "0");
4446
+ return t && Number(e) >= 60 ? `${String(Math.floor(Number(e) / 60)).padStart(2, "0")}:${String(Number(e) % 60).padStart(2, "0")}:${r}` : `${e}:${r}`;
4447
+ }
4448
+ return "00:00";
3638
4449
  }
3639
4450
  //#endregion
3640
4451
  //#region src/functions/setValues.ts
3641
- function Sn(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: i = !0, notEmpty: a = !1 }) {
4452
+ function ir(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: a = !0, notEmpty: o = !1 }) {
3642
4453
  if (n) {
3643
- if (o(e)) {
4454
+ if (i(e)) {
3644
4455
  let n = e.indexOf(t), i = [...e];
3645
- return n === -1 ? (!r || e.length < r) && i.push(t) : (!a || i.length > 1) && i.splice(n, 1), i;
4456
+ return n === -1 ? (!r || e.length < r) && i.push(t) : (!o || i.length > 1) && i.splice(n, 1), i;
3646
4457
  }
3647
4458
  return e === t ? [] : e ? [e, t] : [t];
3648
4459
  }
3649
- return i || e !== t ? t : e;
4460
+ return a || e !== t ? t : e;
3650
4461
  }
3651
4462
  //#endregion
3652
4463
  //#region src/functions/splice.ts
3653
- function Cn(e, n, r) {
4464
+ function ar(e, n, i) {
3654
4465
  if (t(e) && t(n)) {
3655
- if (r) {
4466
+ if (i) {
3656
4467
  let a = {}, o = !1;
3657
- return i(e, (e, i) => {
3658
- !o && (r === i || r === e) ? (o = !0, a = $(a, n)) : o ? a = $(a, { [i]: e }) : a[i] = t(e) ? p(e) : e;
4468
+ return r(e, (e, r) => {
4469
+ !o && (i === r || i === e) ? (o = !0, a = $(a, n)) : o ? a = $(a, { [r]: e }) : a[r] = t(e) ? Z(e) : e;
3659
4470
  }), o ? a : $(e, n);
3660
4471
  }
3661
4472
  if (t(n)) return $(e, n);
3662
4473
  }
3663
- return p(e);
4474
+ return Z(e);
3664
4475
  }
3665
4476
  //#endregion
3666
4477
  //#region src/functions/toCamelCaseFirst.ts
3667
- function wn(e) {
3668
- return V(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
4478
+ function or(e) {
4479
+ return et(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
3669
4480
  }
3670
4481
  //#endregion
3671
4482
  //#region src/functions/toKebabCase.ts
3672
- function Tn(e) {
4483
+ function sr(e) {
3673
4484
  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());
3674
4485
  }
3675
4486
  //#endregion
3676
4487
  //#region src/functions/toNumberByMax.ts
3677
- function En(e, t, n, r) {
3678
- let i = g(e), a = g(t);
3679
- return t && a < i ? `${Dn(a, n, r)}+` : Dn(i, n, r);
4488
+ function cr(e, t, n, r) {
4489
+ let i = _(e), a = _(t);
4490
+ return t && a < i ? `${lr(a, n, r)}+` : lr(i, n, r);
3680
4491
  }
3681
- var Dn = (e, t, n) => t ? new L(n).number(e) : e;
4492
+ var lr = (e, t, n) => t ? new z(n).number(e) : e;
3682
4493
  //#endregion
3683
4494
  //#region src/functions/toPercent.ts
3684
- function On(e, t) {
3685
- return 1 / e * t;
4495
+ function ur(e, t) {
4496
+ return e === 0 ? t : 1 / e * t;
3686
4497
  }
3687
4498
  //#endregion
3688
4499
  //#region src/functions/toPercentBy100.ts
3689
- function kn(e, t) {
3690
- return On(e, t) * 100;
4500
+ function dr(e, t) {
4501
+ return ur(e, t) * 100;
3691
4502
  }
3692
4503
  //#endregion
3693
4504
  //#region src/functions/uint8ArrayToBase64.ts
3694
- function An(e) {
4505
+ function fr(e) {
3695
4506
  let t = "";
3696
4507
  for (let n of e) t += String.fromCharCode(n);
3697
- if (m()) return window.btoa(t);
4508
+ if (s()) return window.btoa(t);
3698
4509
  if (globalThis && globalThis.Buffer) {
3699
4510
  var n;
3700
4511
  return (n = globalThis) == null ? void 0 : n.Buffer.from(e).toString("base64");
@@ -3703,13 +4514,13 @@ function An(e) {
3703
4514
  }
3704
4515
  //#endregion
3705
4516
  //#region src/functions/writeClipboardData.ts
3706
- async function jn(e) {
3707
- if (m()) try {
4517
+ async function pr(e) {
4518
+ if (s()) try {
3708
4519
  await navigator.clipboard.writeText(e);
3709
4520
  } catch (n) {
3710
4521
  var t;
3711
- (t = document) == null || t.execCommand(e);
4522
+ (t = document) == null || t.execCommand("copy", !1, e);
3712
4523
  }
3713
4524
  }
3714
4525
  //#endregion
3715
- export { P as Api, pe as ApiDefault, fe as ApiHeaders, ve as ApiInstance, M as ApiMethodItem, _e as ApiPreparation, ge as ApiResponse, N as ApiStatus, ye as BroadcastMessage, Se as Cache, xe as CacheItem, F as CacheStatic, ke as Cookie, Ee as CookieBlock, T as DataStorage, Me as Datetime, C as ErrorCenter, ne as ErrorCenterHandler, re as ErrorCenterInstance, le as EventItem, Pe as Formatters, H as FormattersType, Fe as GEO_FLAG_ICON_NAME, D as Geo, Ie as GeoFlag, L as GeoIntl, Le as GeoPhone, Re 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, pt as StorageCallback, _t as TRANSLATE_GLOBAL_PREFIX, vt as TRANSLATE_TIME_OUT, xt as Translate, yt as TranslateFile, bt as TranslateInstance, it as addTagHighlightMatch, z as anyToString, gt as applyTemplate, St as arrFill, Ct as blobToBase64, wt as capitalize, p as copyObject, r as copyObjectLite, K as createElement, Tt as domQuerySelector, Et as domQuerySelectorAll, Ke as encodeAttribute, At as ensureMaxSize, Q as escapeExp, jt as eventStopPropagation, y as executeFunction, me as executePromise, i as forEach, Mt as frame, Nt as getAttributes, Pt as getClipboardData, je as getColumn, Ft as getCurrentDate, It as getCurrentTime, k as getElement, Rt as getElementId, Dt as getElementImage, We as getElementItem, se as getElementOrWindow, ct as getExactSearchExp, st as getExp, B as getItemByPath, zt as getKey, Bt as getLengthOfAllArray, Vt as getMaxLengthAllArray, Ht as getMinLengthAllArray, Gt as getMouseClient, Ut as getMouseClientX, Wt as getMouseClientY, Kt as getObjectByKeys, qt as getObjectNoUndefined, Jt as getObjectOrNone, Xt as getRandomText, a as getRequestString, lt as getSearchExp, rt as getSeparatingSearchExp, Zt as getStepPercent, Qt as getStepValue, en as goScroll, tn as goScrollSmooth, nn as goScrollTo, an as handleShare, on as inArray, sn as initScrollbarOffset, cn as intersectKey, ln as isApiSuccess, o as isArray, un as isDifferent, b as isDomData, m as isDomRuntime, dn as isElementVisible, pn as isEnter, c as isFilled, mn as isFloat, v as isFunction, ce as isInDom, fn as isInput, hn as isIntegerBetween, s as isNull, h as isNumber, t as isObject, n as isObjectNotArray, l as isOnLine, _ as isSelected, gn as isSelectedByList, rn as isShare, u as isString, O as isWindow, d as random, _n as removeCommonPrefix, vn as replaceComponentName, $ as replaceRecursive, bn as replaceTemplate, kt as resizeImageByMax, xn as secondToTime, Ge as setElementItem, Sn as setValues, f as sleep, Cn as splice, Yt as strFill, Ne as strSplit, A as toArray, V as toCamelCase, wn as toCamelCaseFirst, I as toDate, Tn as toKebabCase, g as toNumber, En as toNumberByMax, On as toPercent, kn as toPercentBy100, we as transformation, An as uint8ArrayToBase64, yn as uniqueArray, jn as writeClipboardData };
4526
+ export { N as Api, j as ApiCache, je as ApiDataReturn, Me as ApiDefault, Ne as ApiHeaders, Fe as ApiHydration, Be as ApiInstance, M as ApiMethodItem, Ie as ApiPreparation, ze as ApiResponse, ke as ApiStatus, Ve as BroadcastMessage, We as Cache, Ue as CacheItem, Ge as CacheStatic, Ze as Cookie, Je as CookieBlock, qe as CookieBlockInstance, L as CookieStorage, E as DataStorage, $e as Datetime, C as ErrorCenter, de as ErrorCenterHandler, fe as ErrorCenterInstance, we as EventItem, tt as Formatters, U as FormattersType, nt as GEO_FLAG_ICON_NAME, D as Geo, rt as GeoFlag, be as GeoInstance, z as GeoIntl, it as GeoPhone, at as Global, st as Hash, ot as HashInstance, ut as Icons, A as Loading, Ee as LoadingInstance, Ct as Meta, K as MetaManager, xt as MetaOg, vt as MetaOpenGraphAge, gt as MetaOpenGraphAvailability, _t as MetaOpenGraphCondition, yt as MetaOpenGraphGender, J as MetaOpenGraphTag, ht as MetaOpenGraphType, mt as MetaRobots, wt as MetaStatic, q as MetaTag, St as MetaTwitter, bt as MetaTwitterCard, Y as MetaTwitterTag, Tt as ResumableTimer, Et as ScrollbarWidth, zt as SearchList, Mt as SearchListData, Nt as SearchListItem, Lt as SearchListMatcher, Rt as SearchListOptions, T as ServerStorage, Vt as StorageCallback, Kt as TRANSLATE_GLOBAL_PREFIX, qt as TRANSLATE_TIME_OUT, Xt as Translate, Jt as TranslateFile, Yt as TranslateInstance, jt as addTagHighlightMatch, P as anyToString, Wt as applyTemplate, Zt as arrFill, nn as blobToBase64, rn as capitalize, Z as copyObject, an as copyObjectLite, W as createElement, on as domQuerySelector, sn as domQuerySelectorAll, G as encodeAttribute, se as encodeLiteAttribute, dn as ensureMaxSize, X as escapeExp, fn as eventStopPropagation, b as executeFunction, Le as executePromise, r as forEach, pn as frame, mn as getArrayHighlightMatch, hn as getAttributes, gn as getClipboardData, Qe as getColumn, _n as getCurrentDate, vn as getCurrentTime, O as getElement, bn as getElementId, cn as getElementImage, dt as getElementItem, Se as getElementOrWindow, me as getElementSafeScript, Ft as getExactSearchExp, Pt as getExp, he as getHydrationData, H as getItemByPath, Sn as getKey, Cn as getLengthOfAllArray, wn as getMaxLengthAllArray, Tn as getMinLengthAllArray, On as getMouseClient, En as getMouseClientX, Dn as getMouseClientY, kn as getObjectByKeys, An as getObjectNoUndefined, jn as getObjectOrNone, Mn as getOnlyText, Pn as getRandomText, o as getRequestString, It as getSearchExp, Dt as getSeparatingSearchExp, Fn as getStepPercent, In as getStepValue, Rn as goScroll, zn as goScrollSmooth, Bn as goScrollTo, Hn as handleShare, Un as inArray, xn as initGetElementId, Wn as initScrollbarOffset, Gn as intersectKey, Gt as isApiSuccess, i as isArray, Kn as isDifferent, ce as isDomData, s as isDomRuntime, qn as isElementVisible, Yn as isEnter, l as isFilled, Xn as isFloat, y as isFunction, Ce as isInDom, Jn as isInput, Zn as isIntegerBetween, c as isNull, h as isNumber, t as isObject, n as isObjectNotArray, u as isOnLine, v as isSelected, Qn as isSelectedByList, Vn as isShare, d as isString, xe as isWindow, f as random, $n as removeCommonPrefix, er as replaceComponentName, $ as replaceRecursive, nr as replaceTemplate, un as resizeImageByMax, rr as secondToTime, ft as setElementItem, ir as setValues, p as sleep, ar as splice, Nn as strFill, F as strSplit, k as toArray, et as toCamelCase, or as toCamelCaseFirst, R as toDate, sr as toKebabCase, _ as toNumber, cr as toNumberByMax, ur as toPercent, dr as toPercentBy100, a as toString, I as transformation, fr as uint8ArrayToBase64, tr as uniqueArray, pr as writeClipboardData };