gc_i18n 1.5.9 → 1.5.10
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/lib/gc_i18n.es.js +216 -216
- package/lib/gc_i18n.umd.js +9 -9
- package/package.json +1 -1
- package/packages/index.js +0 -6
package/lib/gc_i18n.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './gc_i18n.css';
|
|
2
2
|
import ft from "keyboardjs";
|
|
3
|
-
import { h as
|
|
3
|
+
import { h as ye, ref as ne, computed as De, onMounted as In, nextTick as pt, Vue as ve } from "vue-demi";
|
|
4
4
|
import Xe from "axios";
|
|
5
5
|
import k from "store2";
|
|
6
6
|
import T from "lodash-es";
|
|
@@ -27,7 +27,7 @@ const Mn = [
|
|
|
27
27
|
s[0] === "common" && T.find(t, { key: `${n}.${s[1]}` }) && T.remove(t, { key: `${n}.${s[1]}` });
|
|
28
28
|
const r = T.find(t, { key: o.key });
|
|
29
29
|
r ? T.merge(r, o) : t.push(o);
|
|
30
|
-
}), t),
|
|
30
|
+
}), t), he = Xe.create({
|
|
31
31
|
timeout: 8e3
|
|
32
32
|
}), ke = /* @__PURE__ */ new Map(), qe = (t) => String(t || "guest").replace(/[^\w-]/g, "_"), It = async ({
|
|
33
33
|
baseUrl: t,
|
|
@@ -44,7 +44,7 @@ const Mn = [
|
|
|
44
44
|
if (!n)
|
|
45
45
|
return [];
|
|
46
46
|
try {
|
|
47
|
-
const r = await
|
|
47
|
+
const r = await he.get(`${t}/i18n-web//app/getsupportedlangs`, {
|
|
48
48
|
headers: {
|
|
49
49
|
appCode: n,
|
|
50
50
|
Authorization: e
|
|
@@ -61,7 +61,7 @@ const Mn = [
|
|
|
61
61
|
console.error("获取语言列表失败:", r);
|
|
62
62
|
}
|
|
63
63
|
return [];
|
|
64
|
-
}, zn = async ({ baseUrl: t, token: e, appCode: n }) =>
|
|
64
|
+
}, zn = async ({ baseUrl: t, token: e, appCode: n }) => he.get(
|
|
65
65
|
t + "/i18n-web/app/getsupportedlangs?appCode=" + n,
|
|
66
66
|
{
|
|
67
67
|
headers: {
|
|
@@ -76,7 +76,7 @@ const Mn = [
|
|
|
76
76
|
token: s
|
|
77
77
|
}) => {
|
|
78
78
|
try {
|
|
79
|
-
const r = o + "/i18n-web/kv_translate/kv_translates", d = n ? r + "?lastPullDate=" + n : r, c = await
|
|
79
|
+
const r = o + "/i18n-web/kv_translate/kv_translates", d = n ? r + "?lastPullDate=" + n : r, c = await he({
|
|
80
80
|
url: d,
|
|
81
81
|
method: "GET",
|
|
82
82
|
headers: {
|
|
@@ -89,14 +89,14 @@ const Mn = [
|
|
|
89
89
|
} catch (r) {
|
|
90
90
|
return console.error("获取翻译数据失败:", r), null;
|
|
91
91
|
}
|
|
92
|
-
}, jn = async ({ data: t, token: e, baseUrl: n }) =>
|
|
92
|
+
}, jn = async ({ data: t, token: e, baseUrl: n }) => he({
|
|
93
93
|
url: n + "/i18n-web/kv_translate/userDicts",
|
|
94
94
|
method: "POST",
|
|
95
95
|
headers: {
|
|
96
96
|
Authorization: e
|
|
97
97
|
},
|
|
98
98
|
data: t
|
|
99
|
-
}), Dn = async ({ data: t, token: e, baseUrl: n }) =>
|
|
99
|
+
}), Dn = async ({ data: t, token: e, baseUrl: n }) => he({
|
|
100
100
|
url: n + "/i18n-web/kv_translate/batch",
|
|
101
101
|
method: "POST",
|
|
102
102
|
data: t,
|
|
@@ -173,14 +173,14 @@ function Pt(t, e, n) {
|
|
|
173
173
|
if (typeof t == "function" ? t === e : t.has(e)) return arguments.length < 3 ? e : n;
|
|
174
174
|
throw new TypeError("Private element is not present on this object");
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Rn(t, e) {
|
|
177
177
|
if (e.has(t)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
178
178
|
}
|
|
179
179
|
function mt(t, e) {
|
|
180
180
|
return t.get(Pt(t, e));
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
182
|
+
function Vn(t, e, n) {
|
|
183
|
+
Rn(t, e), e.set(t, n);
|
|
184
184
|
}
|
|
185
185
|
function Fn(t, e, n) {
|
|
186
186
|
return t.set(Pt(t, e), n), n;
|
|
@@ -204,25 +204,25 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
204
204
|
{}
|
|
205
205
|
), Ot = "SweetAlert2:", Je = (t) => t.charAt(0).toUpperCase() + t.slice(1), z = (t) => {
|
|
206
206
|
console.warn(`${Ot} ${typeof t == "object" ? t.join(" ") : t}`);
|
|
207
|
-
},
|
|
207
|
+
}, ee = (t) => {
|
|
208
208
|
console.error(`${Ot} ${t}`);
|
|
209
209
|
}, bt = [], Zn = (t) => {
|
|
210
210
|
bt.includes(t) || (bt.push(t), z(t));
|
|
211
211
|
}, Nt = (t, e = null) => {
|
|
212
212
|
Zn(`"${t}" is deprecated and will be removed in the next major release.${e ? ` Use "${e}" instead.` : ""}`);
|
|
213
|
-
}, Me = (t) => typeof t == "function" ? t() : t, Qe = (t) => t && typeof t.toPromise == "function",
|
|
213
|
+
}, Me = (t) => typeof t == "function" ? t() : t, Qe = (t) => t && typeof t.toPromise == "function", we = (t) => Qe(t) ? t.toPromise() : Promise.resolve(t), et = (t) => t && Promise.resolve(t) === t, j = () => document.body.querySelector(`.${a.container}`), fe = (t) => {
|
|
214
214
|
const e = j();
|
|
215
215
|
return e ? e.querySelector(t) : null;
|
|
216
|
-
}, H = (t) =>
|
|
216
|
+
}, H = (t) => fe(`.${t}`), S = () => H(a.popup), ie = () => H(a.icon), Xn = () => H(a["icon-content"]), zt = () => H(a.title), tt = () => H(a["html-container"]), jt = () => H(a.image), nt = () => H(a["progress-steps"]), Oe = () => H(a["validation-message"]), q = () => (
|
|
217
217
|
/** @type {HTMLButtonElement} */
|
|
218
|
-
|
|
219
|
-
),
|
|
218
|
+
fe(`.${a.actions} .${a.confirm}`)
|
|
219
|
+
), ae = () => (
|
|
220
220
|
/** @type {HTMLButtonElement} */
|
|
221
|
-
|
|
222
|
-
),
|
|
221
|
+
fe(`.${a.actions} .${a.cancel}`)
|
|
222
|
+
), te = () => (
|
|
223
223
|
/** @type {HTMLButtonElement} */
|
|
224
|
-
|
|
225
|
-
), Jn = () => H(a["input-label"]),
|
|
224
|
+
fe(`.${a.actions} .${a.deny}`)
|
|
225
|
+
), Jn = () => H(a["input-label"]), le = () => fe(`.${a.loader}`), pe = () => H(a.actions), Dt = () => H(a.footer), Ne = () => H(a["timer-progress-bar"]), ot = () => H(a.close), Qn = `
|
|
226
226
|
a[href],
|
|
227
227
|
area[href],
|
|
228
228
|
input:not([disabled]),
|
|
@@ -246,13 +246,13 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
246
246
|
return c > i ? 1 : c < i ? -1 : 0;
|
|
247
247
|
}), o = t.querySelectorAll(Qn), s = Array.from(o).filter((r) => r.getAttribute("tabindex") !== "-1");
|
|
248
248
|
return [...new Set(n.concat(s))].filter((r) => D(r));
|
|
249
|
-
}, rt = () =>
|
|
249
|
+
}, rt = () => K(document.body, a.shown) && !K(document.body, a["toast-shown"]) && !K(document.body, a["no-backdrop"]), ze = () => {
|
|
250
250
|
const t = S();
|
|
251
|
-
return t ?
|
|
251
|
+
return t ? K(t, a.toast) : !1;
|
|
252
252
|
}, eo = () => {
|
|
253
253
|
const t = S();
|
|
254
254
|
return t ? t.hasAttribute("data-loading") : !1;
|
|
255
|
-
},
|
|
255
|
+
}, R = (t, e) => {
|
|
256
256
|
if (t.textContent = "", e) {
|
|
257
257
|
const o = new DOMParser().parseFromString(e, "text/html"), s = o.querySelector("head");
|
|
258
258
|
s && Array.from(s.childNodes).forEach((d) => {
|
|
@@ -263,7 +263,7 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
263
263
|
d instanceof HTMLVideoElement || d instanceof HTMLAudioElement ? t.appendChild(d.cloneNode(!0)) : t.appendChild(d);
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
-
},
|
|
266
|
+
}, K = (t, e) => {
|
|
267
267
|
if (!e)
|
|
268
268
|
return !1;
|
|
269
269
|
const n = e.split(/\s+/);
|
|
@@ -319,16 +319,16 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
319
319
|
}));
|
|
320
320
|
}, L = (t, e) => {
|
|
321
321
|
Ht(t, e, !0);
|
|
322
|
-
},
|
|
322
|
+
}, V = (t, e) => {
|
|
323
323
|
Ht(t, e, !1);
|
|
324
|
-
},
|
|
324
|
+
}, G = (t, e) => {
|
|
325
325
|
const n = Array.from(t.children);
|
|
326
326
|
for (let o = 0; o < n.length; o++) {
|
|
327
327
|
const s = n[o];
|
|
328
|
-
if (s instanceof HTMLElement &&
|
|
328
|
+
if (s instanceof HTMLElement && K(s, e))
|
|
329
329
|
return s;
|
|
330
330
|
}
|
|
331
|
-
},
|
|
331
|
+
}, J = (t, e, n) => {
|
|
332
332
|
n === `${parseInt(`${n}`)}` && (n = parseInt(n)), n || parseInt(`${n}`) === 0 ? t.style.setProperty(e, typeof n == "number" ? `${n}px` : (
|
|
333
333
|
/** @type {string} */
|
|
334
334
|
n
|
|
@@ -339,7 +339,7 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
339
339
|
t && (t.style.display = "none");
|
|
340
340
|
}, it = (t, e = "block") => {
|
|
341
341
|
t && new MutationObserver(() => {
|
|
342
|
-
|
|
342
|
+
ge(t, t.innerHTML, e);
|
|
343
343
|
}).observe(t, {
|
|
344
344
|
childList: !0,
|
|
345
345
|
subtree: !0
|
|
@@ -347,9 +347,9 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
347
347
|
}, yt = (t, e, n, o) => {
|
|
348
348
|
const s = t.querySelector(e);
|
|
349
349
|
s && s.style.setProperty(n, o);
|
|
350
|
-
},
|
|
350
|
+
}, ge = (t, e, n = "flex") => {
|
|
351
351
|
e ? M(t, n) : N(t);
|
|
352
|
-
}, D = (t) => !!(t && (t.offsetWidth || t.offsetHeight || t.getClientRects().length)), no = () => !D(
|
|
352
|
+
}, D = (t) => !!(t && (t.offsetWidth || t.offsetHeight || t.getClientRects().length)), no = () => !D(q()) && !D(te()) && !D(ae()), Ke = (t) => t.scrollHeight > t.clientHeight, oo = (t, e) => {
|
|
353
353
|
let n = (
|
|
354
354
|
/** @type {HTMLElement | null} */
|
|
355
355
|
t
|
|
@@ -360,7 +360,7 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
360
360
|
n = n.parentElement;
|
|
361
361
|
}
|
|
362
362
|
return !1;
|
|
363
|
-
},
|
|
363
|
+
}, Rt = (t) => {
|
|
364
364
|
const e = window.getComputedStyle(t), n = parseFloat(e.getPropertyValue("animation-duration") || "0"), o = parseFloat(e.getPropertyValue("transition-duration") || "0");
|
|
365
365
|
return n > 0 || o > 0;
|
|
366
366
|
}, at = (t, e = !1) => {
|
|
@@ -411,23 +411,23 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
411
411
|
</div>
|
|
412
412
|
`.replace(/(^|\n)\s*/g, ""), ao = () => {
|
|
413
413
|
const t = j();
|
|
414
|
-
return t ? (t.remove(),
|
|
414
|
+
return t ? (t.remove(), V([document.documentElement, document.body], [
|
|
415
415
|
a["no-backdrop"],
|
|
416
416
|
a["toast-shown"],
|
|
417
417
|
// @ts-ignore: 'has-column' is not defined in swalClasses but may be set dynamically
|
|
418
418
|
a["has-column"]
|
|
419
419
|
]), !0) : !1;
|
|
420
|
-
},
|
|
420
|
+
}, Z = () => {
|
|
421
421
|
p.currentInstance && p.currentInstance.resetValidationMessage();
|
|
422
422
|
}, lo = () => {
|
|
423
423
|
const t = S();
|
|
424
424
|
if (!t)
|
|
425
425
|
return;
|
|
426
|
-
const e =
|
|
427
|
-
e && (e.oninput =
|
|
428
|
-
|
|
426
|
+
const e = G(t, a.input), n = G(t, a.file), o = t.querySelector(`.${a.range} input`), s = t.querySelector(`.${a.range} output`), r = G(t, a.select), d = t.querySelector(`.${a.checkbox} input`), c = G(t, a.textarea);
|
|
427
|
+
e && (e.oninput = Z), n && (n.onchange = Z), r && (r.onchange = Z), d && (d.onchange = Z), c && (c.oninput = Z), o && s && (o.oninput = () => {
|
|
428
|
+
Z(), s.value = o.value;
|
|
429
429
|
}, o.onchange = () => {
|
|
430
|
-
|
|
430
|
+
Z(), s.value = o.value;
|
|
431
431
|
});
|
|
432
432
|
}, co = (t) => {
|
|
433
433
|
if (typeof t == "string") {
|
|
@@ -448,17 +448,17 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
448
448
|
}, wo = (t) => {
|
|
449
449
|
const e = ao();
|
|
450
450
|
if (ro()) {
|
|
451
|
-
|
|
451
|
+
ee("SweetAlert2 requires document to initialize");
|
|
452
452
|
return;
|
|
453
453
|
}
|
|
454
454
|
const n = document.createElement("div");
|
|
455
|
-
n.className = a.container, e && L(n, a["no-transition"]),
|
|
455
|
+
n.className = a.container, e && L(n, a["no-transition"]), R(n, io), n.dataset.swal2Theme = t.theme;
|
|
456
456
|
const o = co(t.target || "body");
|
|
457
457
|
o.appendChild(n), t.topLayer && (n.setAttribute("popover", ""), n.showPopover()), uo(t), ho(o), lo();
|
|
458
458
|
}, lt = (t, e) => {
|
|
459
|
-
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ? fo(t, e) : t &&
|
|
459
|
+
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ? fo(t, e) : t && R(e, t);
|
|
460
460
|
}, fo = (t, e) => {
|
|
461
|
-
"jquery" in t ? po(e, t) :
|
|
461
|
+
"jquery" in t ? po(e, t) : R(e, t.toString());
|
|
462
462
|
}, po = (t, e) => {
|
|
463
463
|
if (t.textContent = "", 0 in e)
|
|
464
464
|
for (let n = 0; n in e; n++)
|
|
@@ -466,16 +466,16 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
466
466
|
else
|
|
467
467
|
t.appendChild(e.cloneNode(!0));
|
|
468
468
|
}, go = (t, e) => {
|
|
469
|
-
const n =
|
|
470
|
-
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? N(n) : M(n), U(n, e, "actions"), mo(n, o, e),
|
|
469
|
+
const n = pe(), o = le();
|
|
470
|
+
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? N(n) : M(n), U(n, e, "actions"), mo(n, o, e), R(o, e.loaderHtml || ""), U(o, e, "loader"));
|
|
471
471
|
};
|
|
472
472
|
function mo(t, e, n) {
|
|
473
|
-
const o =
|
|
473
|
+
const o = q(), s = te(), r = ae();
|
|
474
474
|
!o || !s || !r || (He(o, "confirm", n), He(s, "deny", n), He(r, "cancel", n), bo(o, s, r, n), n.reverseButtons && (n.toast ? (t.insertBefore(r, o), t.insertBefore(s, o)) : (t.insertBefore(r, e), t.insertBefore(s, e), t.insertBefore(o, e))));
|
|
475
475
|
}
|
|
476
476
|
function bo(t, e, n, o) {
|
|
477
477
|
if (!o.buttonsStyling) {
|
|
478
|
-
|
|
478
|
+
V([t, e, n], a.styled);
|
|
479
479
|
return;
|
|
480
480
|
}
|
|
481
481
|
L([t, e, n], a.styled), o.confirmButtonColor && t.style.setProperty("--swal2-confirm-button-background-color", o.confirmButtonColor), o.denyButtonColor && e.style.setProperty("--swal2-deny-button-background-color", o.denyButtonColor), o.cancelButtonColor && n.style.setProperty("--swal2-cancel-button-background-color", o.cancelButtonColor), Ue(t), Ue(e), Ue(n);
|
|
@@ -492,11 +492,11 @@ function He(t, e, n) {
|
|
|
492
492
|
/** @type {'Confirm' | 'Deny' | 'Cancel'} */
|
|
493
493
|
Je(e)
|
|
494
494
|
);
|
|
495
|
-
|
|
495
|
+
ge(t, n[`show${o}Button`], "inline-block"), R(t, n[`${e}ButtonText`] || ""), t.setAttribute("aria-label", n[`${e}ButtonAriaLabel`] || ""), t.className = a[e], U(t, n, `${e}Button`);
|
|
496
496
|
}
|
|
497
497
|
const yo = (t, e) => {
|
|
498
498
|
const n = ot();
|
|
499
|
-
n && (
|
|
499
|
+
n && (R(n, e.closeButtonHtml || ""), U(n, e, "closeButton"), ge(n, e.showCloseButton), n.setAttribute("aria-label", e.closeButtonAriaLabel || ""));
|
|
500
500
|
}, vo = (t, e) => {
|
|
501
501
|
const n = j();
|
|
502
502
|
n && (Co(n, e.backdrop), ko(n, e.position), xo(n, e.grow), U(n, e, "container"));
|
|
@@ -520,17 +520,17 @@ const Ao = ["input", "file", "range", "select", "radio", "checkbox", "textarea"]
|
|
|
520
520
|
return;
|
|
521
521
|
const o = _.innerParams.get(t), s = !o || e.input !== o.input;
|
|
522
522
|
Ao.forEach((r) => {
|
|
523
|
-
const d =
|
|
523
|
+
const d = G(n, a[r]);
|
|
524
524
|
d && (To(r, e.inputAttributes), d.className = a[r], s && N(d));
|
|
525
525
|
}), e.input && (s && Lo(e), _o(e));
|
|
526
526
|
}, Lo = (t) => {
|
|
527
527
|
if (!t.input)
|
|
528
528
|
return;
|
|
529
529
|
if (!I[t.input]) {
|
|
530
|
-
|
|
530
|
+
ee(`Unexpected type of input! Expected ${Object.keys(I).join(" | ")}, got "${t.input}"`);
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
|
-
const e =
|
|
533
|
+
const e = Vt(t.input);
|
|
534
534
|
if (!e)
|
|
535
535
|
return;
|
|
536
536
|
const n = I[t.input](e, t);
|
|
@@ -555,19 +555,19 @@ const Ao = ["input", "file", "range", "select", "radio", "checkbox", "textarea"]
|
|
|
555
555
|
}, _o = (t) => {
|
|
556
556
|
if (!t.input)
|
|
557
557
|
return;
|
|
558
|
-
const e =
|
|
558
|
+
const e = Vt(t.input);
|
|
559
559
|
e && U(e, t, "input");
|
|
560
560
|
}, ct = (t, e) => {
|
|
561
561
|
!t.placeholder && e.inputPlaceholder && (t.placeholder = e.inputPlaceholder);
|
|
562
|
-
},
|
|
562
|
+
}, me = (t, e, n) => {
|
|
563
563
|
if (n.inputLabel) {
|
|
564
564
|
const o = document.createElement("label"), s = a["input-label"];
|
|
565
565
|
o.setAttribute("for", t.id), o.className = s, typeof n.customClass == "object" && L(o, n.customClass.inputLabel), o.innerText = n.inputLabel, e.insertAdjacentElement("beforebegin", o);
|
|
566
566
|
}
|
|
567
|
-
},
|
|
567
|
+
}, Vt = (t) => {
|
|
568
568
|
const e = S();
|
|
569
569
|
if (e)
|
|
570
|
-
return
|
|
570
|
+
return G(e, a[
|
|
571
571
|
/** @type {SwalClass} */
|
|
572
572
|
t
|
|
573
573
|
] || a.input);
|
|
@@ -580,7 +580,7 @@ I.text = I.email = I.password = I.number = I.tel = I.url = I.search = I.date = I
|
|
|
580
580
|
/** @type {HTMLInputElement} */
|
|
581
581
|
t
|
|
582
582
|
);
|
|
583
|
-
return Le(n, e.inputValue),
|
|
583
|
+
return Le(n, e.inputValue), me(n, n, e), ct(n, e), n.type = /** @type {string} */
|
|
584
584
|
e.input, n;
|
|
585
585
|
};
|
|
586
586
|
I.file = (t, e) => {
|
|
@@ -588,7 +588,7 @@ I.file = (t, e) => {
|
|
|
588
588
|
/** @type {HTMLInputElement} */
|
|
589
589
|
t
|
|
590
590
|
);
|
|
591
|
-
return
|
|
591
|
+
return me(n, n, e), ct(n, e), n;
|
|
592
592
|
};
|
|
593
593
|
I.range = (t, e) => {
|
|
594
594
|
const n = (
|
|
@@ -596,7 +596,7 @@ I.range = (t, e) => {
|
|
|
596
596
|
t
|
|
597
597
|
), o = n.querySelector("input"), s = n.querySelector("output");
|
|
598
598
|
return o && (Le(o, e.inputValue), o.type = /** @type {string} */
|
|
599
|
-
e.input,
|
|
599
|
+
e.input, me(
|
|
600
600
|
o,
|
|
601
601
|
/** @type {Input} */
|
|
602
602
|
t,
|
|
@@ -611,9 +611,9 @@ I.select = (t, e) => {
|
|
|
611
611
|
);
|
|
612
612
|
if (n.textContent = "", e.inputPlaceholder) {
|
|
613
613
|
const o = document.createElement("option");
|
|
614
|
-
|
|
614
|
+
R(o, e.inputPlaceholder), o.value = "", o.disabled = !0, o.selected = !0, n.appendChild(o);
|
|
615
615
|
}
|
|
616
|
-
return
|
|
616
|
+
return me(n, n, e), n;
|
|
617
617
|
};
|
|
618
618
|
I.radio = (t) => {
|
|
619
619
|
const e = (
|
|
@@ -634,7 +634,7 @@ I.checkbox = (t, e) => {
|
|
|
634
634
|
const r = /** @type {HTMLElement} */ t.querySelector("span");
|
|
635
635
|
if (r) {
|
|
636
636
|
const d = e.inputPlaceholder || e.inputLabel;
|
|
637
|
-
d &&
|
|
637
|
+
d && R(r, d);
|
|
638
638
|
}
|
|
639
639
|
return o;
|
|
640
640
|
};
|
|
@@ -643,7 +643,7 @@ I.textarea = (t, e) => {
|
|
|
643
643
|
/** @type {HTMLTextAreaElement} */
|
|
644
644
|
t
|
|
645
645
|
);
|
|
646
|
-
Le(n, e.inputValue), ct(n, e),
|
|
646
|
+
Le(n, e.inputValue), ct(n, e), me(n, n, e);
|
|
647
647
|
const o = (s) => parseInt(window.getComputedStyle(s).marginLeft) + parseInt(window.getComputedStyle(s).marginRight);
|
|
648
648
|
return setTimeout(() => {
|
|
649
649
|
if ("MutationObserver" in window) {
|
|
@@ -654,7 +654,7 @@ I.textarea = (t, e) => {
|
|
|
654
654
|
if (!document.body.contains(n))
|
|
655
655
|
return;
|
|
656
656
|
const c = n.offsetWidth + o(n), i = S();
|
|
657
|
-
i && (c > r ? i.style.width = `${c}px` :
|
|
657
|
+
i && (c > r ? i.style.width = `${c}px` : J(i, "width", e.width));
|
|
658
658
|
};
|
|
659
659
|
new MutationObserver(d).observe(n, {
|
|
660
660
|
attributes: !0,
|
|
@@ -668,9 +668,9 @@ const $o = (t, e) => {
|
|
|
668
668
|
n && (it(n), U(n, e, "htmlContainer"), e.html ? (lt(e.html, n), M(n, "block")) : e.text ? (n.textContent = e.text, M(n, "block")) : N(n), Eo(t, e));
|
|
669
669
|
}, Bo = (t, e) => {
|
|
670
670
|
const n = Dt();
|
|
671
|
-
n && (it(n),
|
|
671
|
+
n && (it(n), ge(n, !!e.footer, "block"), e.footer && lt(e.footer, n), U(n, e, "footer"));
|
|
672
672
|
}, Io = (t, e) => {
|
|
673
|
-
const n = _.innerParams.get(t), o =
|
|
673
|
+
const n = _.innerParams.get(t), o = ie();
|
|
674
674
|
if (!o)
|
|
675
675
|
return;
|
|
676
676
|
if (n && e.icon === n.icon) {
|
|
@@ -682,13 +682,13 @@ const $o = (t, e) => {
|
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
684
|
if (e.icon && Object.keys(Ee).indexOf(e.icon) === -1) {
|
|
685
|
-
|
|
685
|
+
ee(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`), N(o);
|
|
686
686
|
return;
|
|
687
687
|
}
|
|
688
688
|
M(o), Ct(o, e), vt(o, e), L(o, e.showClass && e.showClass.icon), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", Ft);
|
|
689
689
|
}, vt = (t, e) => {
|
|
690
690
|
for (const [n, o] of Object.entries(Ee))
|
|
691
|
-
e.icon !== n &&
|
|
691
|
+
e.icon !== n && V(t, o);
|
|
692
692
|
L(t, e.icon && Ee[e.icon]), Oo(t, e), Ft(), U(t, e, "icon");
|
|
693
693
|
}, Ft = () => {
|
|
694
694
|
const t = S();
|
|
@@ -716,7 +716,7 @@ const $o = (t, e) => {
|
|
|
716
716
|
question: "?",
|
|
717
717
|
warning: "!",
|
|
718
718
|
info: "i"
|
|
719
|
-
}[e.icon])), n.trim() !== o.trim() &&
|
|
719
|
+
}[e.icon])), n.trim() !== o.trim() && R(t, o);
|
|
720
720
|
}, Oo = (t, e) => {
|
|
721
721
|
if (e.iconColor) {
|
|
722
722
|
t.style.color = e.iconColor, t.style.borderColor = e.iconColor;
|
|
@@ -731,7 +731,7 @@ const $o = (t, e) => {
|
|
|
731
731
|
N(n);
|
|
732
732
|
return;
|
|
733
733
|
}
|
|
734
|
-
M(n, ""), n.setAttribute("src", e.imageUrl), n.setAttribute("alt", e.imageAlt || ""),
|
|
734
|
+
M(n, ""), n.setAttribute("src", e.imageUrl), n.setAttribute("alt", e.imageAlt || ""), J(n, "width", e.imageWidth), J(n, "height", e.imageHeight), n.className = a.image, U(n, e, "image");
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
737
|
let dt = !1, qt = 0, Kt = 0, Gt = 0, Wt = 0;
|
|
@@ -743,7 +743,7 @@ const zo = (t) => {
|
|
|
743
743
|
const e = S();
|
|
744
744
|
if (!e)
|
|
745
745
|
return;
|
|
746
|
-
const n =
|
|
746
|
+
const n = ie();
|
|
747
747
|
if (t.target === e || n && n.contains(
|
|
748
748
|
/** @type {HTMLElement} */
|
|
749
749
|
t.target
|
|
@@ -764,7 +764,7 @@ const zo = (t) => {
|
|
|
764
764
|
}
|
|
765
765
|
}, _e = () => {
|
|
766
766
|
const t = S();
|
|
767
|
-
dt = !1,
|
|
767
|
+
dt = !1, V(t, "swal2-dragging");
|
|
768
768
|
}, Yt = (t) => {
|
|
769
769
|
let e = 0, n = 0;
|
|
770
770
|
return t.type.startsWith("mouse") ? (e = /** @type {MouseEvent} */
|
|
@@ -779,12 +779,12 @@ const zo = (t) => {
|
|
|
779
779
|
const n = j(), o = S();
|
|
780
780
|
if (!(!n || !o)) {
|
|
781
781
|
if (e.toast) {
|
|
782
|
-
|
|
783
|
-
const s =
|
|
784
|
-
s && o.insertBefore(s,
|
|
782
|
+
J(n, "width", e.width), o.style.width = "100%";
|
|
783
|
+
const s = le();
|
|
784
|
+
s && o.insertBefore(s, ie());
|
|
785
785
|
} else
|
|
786
|
-
|
|
787
|
-
|
|
786
|
+
J(o, "width", e.width);
|
|
787
|
+
J(o, "padding", e.padding), e.color && (o.style.color = e.color), e.background && (o.style.background = e.background), N(Oe()), Uo(o, e), e.draggable && !e.toast ? (L(o, a.draggable), zo(o)) : (V(o, a.draggable), jo(o));
|
|
788
788
|
}
|
|
789
789
|
}, Uo = (t, e) => {
|
|
790
790
|
const n = e.showClass || {};
|
|
@@ -802,21 +802,21 @@ const zo = (t) => {
|
|
|
802
802
|
return;
|
|
803
803
|
}
|
|
804
804
|
M(n), n.textContent = "", s >= o.length && z("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"), o.forEach((r, d) => {
|
|
805
|
-
const c =
|
|
805
|
+
const c = Ro(r);
|
|
806
806
|
if (n.appendChild(c), d === s && L(c, a["active-progress-step"]), d !== o.length - 1) {
|
|
807
|
-
const i =
|
|
807
|
+
const i = Vo(e);
|
|
808
808
|
n.appendChild(i);
|
|
809
809
|
}
|
|
810
810
|
});
|
|
811
|
-
}, Vo = (t) => {
|
|
812
|
-
const e = document.createElement("li");
|
|
813
|
-
return L(e, a["progress-step"]), V(e, t), e;
|
|
814
811
|
}, Ro = (t) => {
|
|
815
812
|
const e = document.createElement("li");
|
|
816
|
-
return L(e, a["progress-step
|
|
813
|
+
return L(e, a["progress-step"]), R(e, t), e;
|
|
814
|
+
}, Vo = (t) => {
|
|
815
|
+
const e = document.createElement("li");
|
|
816
|
+
return L(e, a["progress-step-line"]), t.progressStepsDistance && J(e, "width", t.progressStepsDistance), e;
|
|
817
817
|
}, Fo = (t, e) => {
|
|
818
818
|
const n = zt();
|
|
819
|
-
n && (it(n),
|
|
819
|
+
n && (it(n), ge(n, !!(e.title || e.titleText), "block"), e.title && lt(e.title, n), e.titleText && (n.innerText = e.titleText), U(n, e, "title"));
|
|
820
820
|
}, Zt = (t, e) => {
|
|
821
821
|
var n;
|
|
822
822
|
Do(t, e), vo(t, e), Ho(t, e), Io(t, e), No(t, e), Fo(t, e), yo(t, e), $o(t, e), go(t, e), Bo(t, e);
|
|
@@ -824,14 +824,14 @@ const zo = (t) => {
|
|
|
824
824
|
typeof e.didRender == "function" && o && e.didRender(o), (n = p.eventEmitter) === null || n === void 0 || n.emit("didRender", o);
|
|
825
825
|
}, qo = () => D(S()), Xt = () => {
|
|
826
826
|
var t;
|
|
827
|
-
return (t =
|
|
827
|
+
return (t = q()) === null || t === void 0 ? void 0 : t.click();
|
|
828
828
|
}, Ko = () => {
|
|
829
829
|
var t;
|
|
830
|
-
return (t =
|
|
830
|
+
return (t = te()) === null || t === void 0 ? void 0 : t.click();
|
|
831
831
|
}, Go = () => {
|
|
832
832
|
var t;
|
|
833
|
-
return (t =
|
|
834
|
-
},
|
|
833
|
+
return (t = ae()) === null || t === void 0 ? void 0 : t.click();
|
|
834
|
+
}, ce = Object.freeze({
|
|
835
835
|
cancel: "cancel",
|
|
836
836
|
backdrop: "backdrop",
|
|
837
837
|
close: "close",
|
|
@@ -897,7 +897,7 @@ const zo = (t) => {
|
|
|
897
897
|
}
|
|
898
898
|
t.shiftKey ? Ge(o, -1) : Ge(o, 1), t.stopPropagation(), t.preventDefault();
|
|
899
899
|
}, Qo = (t) => {
|
|
900
|
-
const e =
|
|
900
|
+
const e = pe(), n = q(), o = te(), s = ae();
|
|
901
901
|
if (!e || !n || !o || !s)
|
|
902
902
|
return;
|
|
903
903
|
const r = [n, o, s];
|
|
@@ -915,9 +915,9 @@ const zo = (t) => {
|
|
|
915
915
|
c instanceof HTMLButtonElement && c.focus();
|
|
916
916
|
}
|
|
917
917
|
}, es = (t, e, n) => {
|
|
918
|
-
t.preventDefault(), Me(e.allowEscapeKey) && n(
|
|
918
|
+
t.preventDefault(), Me(e.allowEscapeKey) && n(ce.esc);
|
|
919
919
|
};
|
|
920
|
-
var
|
|
920
|
+
var se = {
|
|
921
921
|
swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
|
|
922
922
|
swalPromiseReject: /* @__PURE__ */ new WeakMap()
|
|
923
923
|
};
|
|
@@ -931,7 +931,7 @@ const ts = () => {
|
|
|
931
931
|
e.hasAttribute("data-previous-aria-hidden") ? (e.setAttribute("aria-hidden", e.getAttribute("data-previous-aria-hidden") || ""), e.removeAttribute("data-previous-aria-hidden")) : e.removeAttribute("aria-hidden");
|
|
932
932
|
});
|
|
933
933
|
}, tn = typeof window < "u" && !!window.GestureEvent, ns = () => {
|
|
934
|
-
if (tn && !
|
|
934
|
+
if (tn && !K(document.body, a.iosfix)) {
|
|
935
935
|
const t = document.body.scrollTop;
|
|
936
936
|
document.body.style.top = `${t * -1}px`, L(document.body, a.iosfix), os();
|
|
937
937
|
}
|
|
@@ -954,9 +954,9 @@ const ts = () => {
|
|
|
954
954
|
o.contains(e));
|
|
955
955
|
}, rs = (t) => !!(t.touches && t.touches.length && // @ts-ignore - touchType is not a standard property
|
|
956
956
|
t.touches[0].touchType === "stylus"), is = (t) => t.touches && t.touches.length > 1, as = () => {
|
|
957
|
-
if (
|
|
957
|
+
if (K(document.body, a.iosfix)) {
|
|
958
958
|
const t = parseInt(document.body.style.top, 10);
|
|
959
|
-
|
|
959
|
+
V(document.body, a.iosfix), document.body.style.top = "", document.body.scrollTop = t * -1;
|
|
960
960
|
}
|
|
961
961
|
}, ls = () => {
|
|
962
962
|
const t = document.createElement("div");
|
|
@@ -964,39 +964,39 @@ t.touches[0].touchType === "stylus"), is = (t) => t.touches && t.touches.length
|
|
|
964
964
|
const e = t.getBoundingClientRect().width - t.clientWidth;
|
|
965
965
|
return document.body.removeChild(t), e;
|
|
966
966
|
};
|
|
967
|
-
let
|
|
967
|
+
let oe = null;
|
|
968
968
|
const cs = (t) => {
|
|
969
|
-
|
|
969
|
+
oe === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (oe = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${oe + ls()}px`);
|
|
970
970
|
}, ds = () => {
|
|
971
|
-
|
|
971
|
+
oe !== null && (document.body.style.paddingRight = `${oe}px`, oe = null);
|
|
972
972
|
};
|
|
973
973
|
function nn(t, e, n, o) {
|
|
974
974
|
ze() ? xt(t, o) : (Gn(n).then(() => xt(t, o)), Jt(p)), tn ? (e.setAttribute("style", "display:none !important"), e.removeAttribute("class"), e.innerHTML = "") : e.remove(), rt() && (ds(), as(), en()), us();
|
|
975
975
|
}
|
|
976
976
|
function us() {
|
|
977
|
-
|
|
977
|
+
V([document.documentElement, document.body], [a.shown, a["height-auto"], a["no-backdrop"], a["toast-shown"]]);
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function W(t) {
|
|
980
980
|
t = ws(t);
|
|
981
|
-
const e =
|
|
982
|
-
this.isAwaitingPromise ? t.isDismissed || (
|
|
981
|
+
const e = se.swalPromiseResolve.get(this), n = hs(this);
|
|
982
|
+
this.isAwaitingPromise ? t.isDismissed || (be(this), e(t)) : n && e(t);
|
|
983
983
|
}
|
|
984
984
|
const hs = (t) => {
|
|
985
985
|
const e = S();
|
|
986
986
|
if (!e)
|
|
987
987
|
return !1;
|
|
988
988
|
const n = _.innerParams.get(t);
|
|
989
|
-
if (!n ||
|
|
989
|
+
if (!n || K(e, n.hideClass.popup))
|
|
990
990
|
return !1;
|
|
991
|
-
|
|
991
|
+
V(e, n.showClass.popup), L(e, n.hideClass.popup);
|
|
992
992
|
const o = j();
|
|
993
|
-
return
|
|
993
|
+
return V(o, n.showClass.backdrop), L(o, n.hideClass.backdrop), fs(t, e, n), !0;
|
|
994
994
|
};
|
|
995
995
|
function on(t) {
|
|
996
|
-
const e =
|
|
997
|
-
|
|
996
|
+
const e = se.swalPromiseReject.get(this);
|
|
997
|
+
be(this), e && e(t);
|
|
998
998
|
}
|
|
999
|
-
const
|
|
999
|
+
const be = (t) => {
|
|
1000
1000
|
t.isAwaitingPromise && (delete t.isAwaitingPromise, _.innerParams.get(t) || t._destroy());
|
|
1001
1001
|
}, ws = (t) => typeof t > "u" ? {
|
|
1002
1002
|
isConfirmed: !1,
|
|
@@ -1008,7 +1008,7 @@ const ye = (t) => {
|
|
|
1008
1008
|
isDismissed: !1
|
|
1009
1009
|
}, t), fs = (t, e, n) => {
|
|
1010
1010
|
var o;
|
|
1011
|
-
const s = j(), r =
|
|
1011
|
+
const s = j(), r = Rt(e);
|
|
1012
1012
|
typeof n.willClose == "function" && n.willClose(e), (o = p.eventEmitter) === null || o === void 0 || o.emit("willClose", e), r && s ? ps(t, e, s, !!n.returnFocus, n.didClose) : s && nn(t, s, !!n.returnFocus, n.didClose);
|
|
1013
1013
|
}, ps = (t, e, n, o, s) => {
|
|
1014
1014
|
p.swalCloseEventFinishedCallback = nn.bind(null, t, n, o, s);
|
|
@@ -1024,17 +1024,17 @@ const ye = (t) => {
|
|
|
1024
1024
|
var n;
|
|
1025
1025
|
typeof e == "function" && e.bind(t.params)(), (n = p.eventEmitter) === null || n === void 0 || n.emit("didClose"), t._destroy && t._destroy();
|
|
1026
1026
|
});
|
|
1027
|
-
},
|
|
1027
|
+
}, re = (t) => {
|
|
1028
1028
|
let e = S();
|
|
1029
1029
|
if (e || new O(), e = S(), !e)
|
|
1030
1030
|
return;
|
|
1031
|
-
const n =
|
|
1032
|
-
ze() ? N(
|
|
1031
|
+
const n = le();
|
|
1032
|
+
ze() ? N(ie()) : gs(e, t), M(n), e.setAttribute("data-loading", "true"), e.setAttribute("aria-busy", "true"), e.focus();
|
|
1033
1033
|
}, gs = (t, e) => {
|
|
1034
|
-
const n =
|
|
1035
|
-
!n || !o || (!e && D(
|
|
1034
|
+
const n = pe(), o = le();
|
|
1035
|
+
!n || !o || (!e && D(q()) && (e = q()), M(n), e && (N(e), o.setAttribute("data-button-to-replace", e.className), n.insertBefore(o, e)), L([t, n], a.loading));
|
|
1036
1036
|
}, ms = (t, e) => {
|
|
1037
|
-
e.input === "select" || e.input === "radio" ? ks(t, e) : ["text", "email", "number", "tel", "textarea"].some((n) => n === e.input) && (Qe(e.inputValue) || et(e.inputValue)) && (
|
|
1037
|
+
e.input === "select" || e.input === "radio" ? ks(t, e) : ["text", "email", "number", "tel", "textarea"].some((n) => n === e.input) && (Qe(e.inputValue) || et(e.inputValue)) && (re(q()), xs(t, e));
|
|
1038
1038
|
}, bs = (t, e) => {
|
|
1039
1039
|
const n = t.getInput();
|
|
1040
1040
|
if (!n)
|
|
@@ -1056,24 +1056,24 @@ const ye = (t) => {
|
|
|
1056
1056
|
const o = (s) => {
|
|
1057
1057
|
e.input === "select" ? As(n, $e(s), e) : e.input === "radio" && Es(n, $e(s), e);
|
|
1058
1058
|
};
|
|
1059
|
-
Qe(e.inputOptions) || et(e.inputOptions) ? (
|
|
1059
|
+
Qe(e.inputOptions) || et(e.inputOptions) ? (re(q()), we(e.inputOptions).then((s) => {
|
|
1060
1060
|
t.hideLoading(), o(s);
|
|
1061
|
-
})) : typeof e.inputOptions == "object" ? o(e.inputOptions) :
|
|
1061
|
+
})) : typeof e.inputOptions == "object" ? o(e.inputOptions) : ee(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`);
|
|
1062
1062
|
}, xs = (t, e) => {
|
|
1063
1063
|
const n = t.getInput();
|
|
1064
|
-
n && (N(n),
|
|
1064
|
+
n && (N(n), we(e.inputValue).then((o) => {
|
|
1065
1065
|
n.value = e.input === "number" ? `${parseFloat(o) || 0}` : `${o}`, M(n), n.focus(), t.hideLoading();
|
|
1066
1066
|
}).catch((o) => {
|
|
1067
|
-
|
|
1067
|
+
ee(`Error in inputValue promise: ${o}`), n.value = "", M(n), n.focus(), t.hideLoading();
|
|
1068
1068
|
}));
|
|
1069
1069
|
};
|
|
1070
1070
|
function As(t, e, n) {
|
|
1071
|
-
const o =
|
|
1071
|
+
const o = G(t, a.select);
|
|
1072
1072
|
if (!o)
|
|
1073
1073
|
return;
|
|
1074
1074
|
const s = (r, d, c) => {
|
|
1075
1075
|
const i = document.createElement("option");
|
|
1076
|
-
i.value = c,
|
|
1076
|
+
i.value = c, R(i, d), i.selected = sn(c, n.inputValue), r.appendChild(i);
|
|
1077
1077
|
};
|
|
1078
1078
|
e.forEach((r) => {
|
|
1079
1079
|
const d = r[0], c = r[1];
|
|
@@ -1085,14 +1085,14 @@ function As(t, e, n) {
|
|
|
1085
1085
|
}), o.focus();
|
|
1086
1086
|
}
|
|
1087
1087
|
function Es(t, e, n) {
|
|
1088
|
-
const o =
|
|
1088
|
+
const o = G(t, a.radio);
|
|
1089
1089
|
if (!o)
|
|
1090
1090
|
return;
|
|
1091
1091
|
e.forEach((r) => {
|
|
1092
1092
|
const d = r[0], c = r[1], i = document.createElement("input"), l = document.createElement("label");
|
|
1093
1093
|
i.type = "radio", i.name = a.radio, i.value = d, sn(d, n.inputValue) && (i.checked = !0);
|
|
1094
1094
|
const u = document.createElement("span");
|
|
1095
|
-
|
|
1095
|
+
R(u, c), u.className = a.label, l.appendChild(i), l.appendChild(u), o.appendChild(l);
|
|
1096
1096
|
});
|
|
1097
1097
|
const s = o.querySelectorAll("input");
|
|
1098
1098
|
s.length && s[0].focus();
|
|
@@ -1113,24 +1113,24 @@ const $e = (t) => {
|
|
|
1113
1113
|
const e = _.innerParams.get(t);
|
|
1114
1114
|
t.disableButtons(), e.returnInputValueOnDeny ? rn(t, "deny") : ut(t, !1);
|
|
1115
1115
|
}, Ts = (t, e) => {
|
|
1116
|
-
t.disableButtons(), e(
|
|
1116
|
+
t.disableButtons(), e(ce.cancel);
|
|
1117
1117
|
}, rn = (t, e) => {
|
|
1118
1118
|
const n = _.innerParams.get(t);
|
|
1119
1119
|
if (!n.input) {
|
|
1120
|
-
|
|
1120
|
+
ee(`The "input" parameter is needed to be set when using returnInputValueOn${Je(e)}`);
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
1123
|
const o = t.getInput(), s = bs(t, n);
|
|
1124
1124
|
n.inputValidator ? _s(t, s, e) : o && !o.checkValidity() ? (t.enableButtons(), t.showValidationMessage(n.validationMessage || o.validationMessage)) : e === "deny" ? ut(t, s) : ht(t, s);
|
|
1125
1125
|
}, _s = (t, e, n) => {
|
|
1126
1126
|
const o = _.innerParams.get(t);
|
|
1127
|
-
t.disableInput(), Promise.resolve().then(() =>
|
|
1127
|
+
t.disableInput(), Promise.resolve().then(() => we(o.inputValidator(e, o.validationMessage))).then((r) => {
|
|
1128
1128
|
t.enableButtons(), t.enableInput(), r ? t.showValidationMessage(r) : n === "deny" ? ut(t, e) : ht(t, e);
|
|
1129
1129
|
});
|
|
1130
1130
|
}, ut = (t, e) => {
|
|
1131
1131
|
const n = _.innerParams.get(t);
|
|
1132
|
-
n.showLoaderOnDeny &&
|
|
1133
|
-
s === !1 ? (t.hideLoading(),
|
|
1132
|
+
n.showLoaderOnDeny && re(te()), n.preDeny ? (t.isAwaitingPromise = !0, Promise.resolve().then(() => we(n.preDeny(e, n.validationMessage))).then((s) => {
|
|
1133
|
+
s === !1 ? (t.hideLoading(), be(t)) : t.close(
|
|
1134
1134
|
/** @type SweetAlertResult */
|
|
1135
1135
|
{
|
|
1136
1136
|
isDenied: !0,
|
|
@@ -1156,8 +1156,8 @@ const $e = (t) => {
|
|
|
1156
1156
|
t.rejectPromise(e);
|
|
1157
1157
|
}, ht = (t, e) => {
|
|
1158
1158
|
const n = _.innerParams.get(t);
|
|
1159
|
-
n.showLoaderOnConfirm &&
|
|
1160
|
-
D(Oe()) || s === !1 ? (t.hideLoading(),
|
|
1159
|
+
n.showLoaderOnConfirm && re(), n.preConfirm ? (t.resetValidationMessage(), t.isAwaitingPromise = !0, Promise.resolve().then(() => we(n.preConfirm(e, n.validationMessage))).then((s) => {
|
|
1160
|
+
D(Oe()) || s === !1 ? (t.hideLoading(), be(t)) : At(t, typeof s > "u" ? e : s);
|
|
1161
1161
|
}).catch((s) => an(t, s))) : At(t, e);
|
|
1162
1162
|
};
|
|
1163
1163
|
function Be() {
|
|
@@ -1165,7 +1165,7 @@ function Be() {
|
|
|
1165
1165
|
if (!t)
|
|
1166
1166
|
return;
|
|
1167
1167
|
const e = _.domCache.get(this);
|
|
1168
|
-
N(e.loader), ze() ? t.icon && M(
|
|
1168
|
+
N(e.loader), ze() ? t.icon && M(ie()) : $s(e), V([e.popup, e.actions], a.loading), e.popup.removeAttribute("aria-busy"), e.popup.removeAttribute("data-loading"), e.confirmButton.disabled = !1, e.denyButton.disabled = !1, e.cancelButton.disabled = !1;
|
|
1169
1169
|
}
|
|
1170
1170
|
const $s = (t) => {
|
|
1171
1171
|
const e = t.loader.getAttribute("data-button-to-replace"), n = e ? t.popup.getElementsByClassName(e) : [];
|
|
@@ -1209,7 +1209,7 @@ function fn() {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
function pn(t) {
|
|
1211
1211
|
const e = _.domCache.get(this), n = _.innerParams.get(this);
|
|
1212
|
-
|
|
1212
|
+
R(e.validationMessage, t), e.validationMessage.className = a["validation-message"], n.customClass && n.customClass.validationMessage && L(e.validationMessage, n.customClass.validationMessage), M(e.validationMessage);
|
|
1213
1213
|
const o = this.getInput();
|
|
1214
1214
|
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby", a["validation-message"]), Ut(o), L(o, a.inputerror));
|
|
1215
1215
|
}
|
|
@@ -1217,9 +1217,9 @@ function gn() {
|
|
|
1217
1217
|
const t = _.domCache.get(this);
|
|
1218
1218
|
t.validationMessage && N(t.validationMessage);
|
|
1219
1219
|
const e = this.getInput();
|
|
1220
|
-
e && (e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"),
|
|
1220
|
+
e && (e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), V(e, a.inputerror));
|
|
1221
1221
|
}
|
|
1222
|
-
const
|
|
1222
|
+
const Y = {
|
|
1223
1223
|
title: "",
|
|
1224
1224
|
titleText: "",
|
|
1225
1225
|
text: "",
|
|
@@ -1314,7 +1314,7 @@ const Z = {
|
|
|
1314
1314
|
topLayer: !1
|
|
1315
1315
|
}, Bs = ["allowEscapeKey", "allowOutsideClick", "background", "buttonsStyling", "cancelButtonAriaLabel", "cancelButtonColor", "cancelButtonText", "closeButtonAriaLabel", "closeButtonHtml", "color", "confirmButtonAriaLabel", "confirmButtonColor", "confirmButtonText", "currentProgressStep", "customClass", "denyButtonAriaLabel", "denyButtonColor", "denyButtonText", "didClose", "didDestroy", "draggable", "footer", "hideClass", "html", "icon", "iconColor", "iconHtml", "imageAlt", "imageHeight", "imageUrl", "imageWidth", "preConfirm", "preDeny", "progressSteps", "returnFocus", "reverseButtons", "showCancelButton", "showCloseButton", "showConfirmButton", "showDenyButton", "text", "title", "titleText", "theme", "willClose"], Is = {
|
|
1316
1316
|
allowEnterKey: void 0
|
|
1317
|
-
}, Ps = ["allowOutsideClick", "allowEnterKey", "backdrop", "draggable", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"], mn = (t) => Object.prototype.hasOwnProperty.call(
|
|
1317
|
+
}, Ps = ["allowOutsideClick", "allowEnterKey", "backdrop", "draggable", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"], mn = (t) => Object.prototype.hasOwnProperty.call(Y, t), bn = (t) => Bs.indexOf(t) !== -1, yn = (t) => Is[t], Ms = (t) => {
|
|
1318
1318
|
mn(t) || z(`Unknown parameter "${t}"`);
|
|
1319
1319
|
}, Os = (t) => {
|
|
1320
1320
|
Ps.includes(t) && z(`The parameter "${t}" is incompatible with toasts`);
|
|
@@ -1328,7 +1328,7 @@ const Z = {
|
|
|
1328
1328
|
};
|
|
1329
1329
|
function Cn(t) {
|
|
1330
1330
|
const e = j(), n = S(), o = _.innerParams.get(this);
|
|
1331
|
-
if (!n ||
|
|
1331
|
+
if (!n || K(n, o.hideClass.popup)) {
|
|
1332
1332
|
z("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");
|
|
1333
1333
|
return;
|
|
1334
1334
|
}
|
|
@@ -1366,25 +1366,25 @@ function kn() {
|
|
|
1366
1366
|
const js = (t) => {
|
|
1367
1367
|
xn(t), delete t.params, delete p.keydownHandler, delete p.keydownTarget, delete p.currentInstance;
|
|
1368
1368
|
}, xn = (t) => {
|
|
1369
|
-
t.isAwaitingPromise ? (
|
|
1370
|
-
},
|
|
1369
|
+
t.isAwaitingPromise ? (Re(_, t), t.isAwaitingPromise = !0) : (Re(se, t), Re(_, t), delete t.isAwaitingPromise, delete t.disableButtons, delete t.enableButtons, delete t.getInput, delete t.disableInput, delete t.enableInput, delete t.hideLoading, delete t.disableLoading, delete t.showValidationMessage, delete t.resetValidationMessage, delete t.close, delete t.closePopup, delete t.closeModal, delete t.closeToast, delete t.rejectPromise, delete t.update, delete t._destroy);
|
|
1370
|
+
}, Re = (t, e) => {
|
|
1371
1371
|
for (const n in t)
|
|
1372
1372
|
t[n].delete(e);
|
|
1373
1373
|
};
|
|
1374
1374
|
var Ds = /* @__PURE__ */ Object.freeze({
|
|
1375
1375
|
__proto__: null,
|
|
1376
1376
|
_destroy: kn,
|
|
1377
|
-
close:
|
|
1378
|
-
closeModal:
|
|
1379
|
-
closePopup:
|
|
1380
|
-
closeToast:
|
|
1377
|
+
close: W,
|
|
1378
|
+
closeModal: W,
|
|
1379
|
+
closePopup: W,
|
|
1380
|
+
closeToast: W,
|
|
1381
1381
|
disableButtons: hn,
|
|
1382
1382
|
disableInput: fn,
|
|
1383
1383
|
disableLoading: Be,
|
|
1384
1384
|
enableButtons: un,
|
|
1385
1385
|
enableInput: wn,
|
|
1386
1386
|
getInput: ln,
|
|
1387
|
-
handleAwaitingPromise:
|
|
1387
|
+
handleAwaitingPromise: be,
|
|
1388
1388
|
hideLoading: Be,
|
|
1389
1389
|
rejectPromise: on,
|
|
1390
1390
|
resetValidationMessage: gn,
|
|
@@ -1392,14 +1392,14 @@ var Ds = /* @__PURE__ */ Object.freeze({
|
|
|
1392
1392
|
update: Cn
|
|
1393
1393
|
});
|
|
1394
1394
|
const Us = (t, e, n) => {
|
|
1395
|
-
t.toast ? Hs(t, e, n) : (
|
|
1395
|
+
t.toast ? Hs(t, e, n) : (Vs(e), Fs(e), qs(t, e, n));
|
|
1396
1396
|
}, Hs = (t, e, n) => {
|
|
1397
1397
|
e.popup.onclick = () => {
|
|
1398
|
-
t && (
|
|
1398
|
+
t && (Rs(t) || t.timer || t.input) || n(ce.close);
|
|
1399
1399
|
};
|
|
1400
|
-
},
|
|
1400
|
+
}, Rs = (t) => !!(t.showConfirmButton || t.showDenyButton || t.showCancelButton || t.showCloseButton);
|
|
1401
1401
|
let Ie = !1;
|
|
1402
|
-
const
|
|
1402
|
+
const Vs = (t) => {
|
|
1403
1403
|
t.popup.onmousedown = () => {
|
|
1404
1404
|
t.container.onmouseup = function(e) {
|
|
1405
1405
|
t.container.onmouseup = () => {
|
|
@@ -1419,13 +1419,13 @@ const Rs = (t) => {
|
|
|
1419
1419
|
Ie = !1;
|
|
1420
1420
|
return;
|
|
1421
1421
|
}
|
|
1422
|
-
o.target === e.container && Me(t.allowOutsideClick) && n(
|
|
1422
|
+
o.target === e.container && Me(t.allowOutsideClick) && n(ce.backdrop);
|
|
1423
1423
|
};
|
|
1424
1424
|
}, Ks = (t) => typeof t == "object" && t !== null && "jquery" in t, Et = (t) => t instanceof Element || Ks(t), Gs = (t) => {
|
|
1425
1425
|
const e = {};
|
|
1426
1426
|
return typeof t[0] == "object" && !Et(t[0]) ? Object.assign(e, t[0]) : ["title", "html", "icon"].forEach((n, o) => {
|
|
1427
1427
|
const s = t[o];
|
|
1428
|
-
typeof s == "string" || Et(s) ? e[n] = s : s !== void 0 &&
|
|
1428
|
+
typeof s == "string" || Et(s) ? e[n] = s : s !== void 0 && ee(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`);
|
|
1429
1429
|
}), /** @type {SweetAlertOptions} */
|
|
1430
1430
|
e;
|
|
1431
1431
|
};
|
|
@@ -1567,22 +1567,22 @@ var ir = /* @__PURE__ */ Object.freeze({
|
|
|
1567
1567
|
clickCancel: Go,
|
|
1568
1568
|
clickConfirm: Xt,
|
|
1569
1569
|
clickDeny: Ko,
|
|
1570
|
-
enableLoading:
|
|
1570
|
+
enableLoading: re,
|
|
1571
1571
|
fire: Ws,
|
|
1572
|
-
getActions:
|
|
1573
|
-
getCancelButton:
|
|
1572
|
+
getActions: pe,
|
|
1573
|
+
getCancelButton: ae,
|
|
1574
1574
|
getCloseButton: ot,
|
|
1575
|
-
getConfirmButton:
|
|
1575
|
+
getConfirmButton: q,
|
|
1576
1576
|
getContainer: j,
|
|
1577
|
-
getDenyButton:
|
|
1577
|
+
getDenyButton: te,
|
|
1578
1578
|
getFocusableElements: st,
|
|
1579
1579
|
getFooter: Dt,
|
|
1580
1580
|
getHtmlContainer: tt,
|
|
1581
|
-
getIcon:
|
|
1581
|
+
getIcon: ie,
|
|
1582
1582
|
getIconContent: Xn,
|
|
1583
1583
|
getImage: jt,
|
|
1584
1584
|
getInputLabel: Jn,
|
|
1585
|
-
getLoader:
|
|
1585
|
+
getLoader: le,
|
|
1586
1586
|
getPopup: S,
|
|
1587
1587
|
getProgressSteps: nt,
|
|
1588
1588
|
getTimerLeft: Zs,
|
|
@@ -1601,7 +1601,7 @@ var ir = /* @__PURE__ */ Object.freeze({
|
|
|
1601
1601
|
on: or,
|
|
1602
1602
|
once: sr,
|
|
1603
1603
|
resumeTimer: En,
|
|
1604
|
-
showLoading:
|
|
1604
|
+
showLoading: re,
|
|
1605
1605
|
stopTimer: An,
|
|
1606
1606
|
toggleTimer: Xs
|
|
1607
1607
|
});
|
|
@@ -1658,15 +1658,15 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1658
1658
|
}, cr = (t) => {
|
|
1659
1659
|
const e = {};
|
|
1660
1660
|
return Array.from(t.querySelectorAll("swal-param")).forEach((o) => {
|
|
1661
|
-
|
|
1661
|
+
Q(o, ["name", "value"]);
|
|
1662
1662
|
const s = (
|
|
1663
1663
|
/** @type {keyof SweetAlertOptions} */
|
|
1664
1664
|
o.getAttribute("name")
|
|
1665
1665
|
), r = o.getAttribute("value");
|
|
1666
|
-
!s || !r || (s in
|
|
1666
|
+
!s || !r || (s in Y && typeof Y[
|
|
1667
1667
|
/** @type {keyof typeof defaultParams} */
|
|
1668
1668
|
s
|
|
1669
|
-
] == "boolean" ? e[s] = r !== "false" : s in
|
|
1669
|
+
] == "boolean" ? e[s] = r !== "false" : s in Y && typeof Y[
|
|
1670
1670
|
/** @type {keyof typeof defaultParams} */
|
|
1671
1671
|
s
|
|
1672
1672
|
] == "object" ? e[s] = JSON.parse(r) : e[s] = r);
|
|
@@ -1683,7 +1683,7 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1683
1683
|
}, ur = (t) => {
|
|
1684
1684
|
const e = {};
|
|
1685
1685
|
return Array.from(t.querySelectorAll("swal-button")).forEach((o) => {
|
|
1686
|
-
|
|
1686
|
+
Q(o, ["type", "color", "aria-label"]);
|
|
1687
1687
|
const s = o.getAttribute("type");
|
|
1688
1688
|
if (!(!s || !["confirm", "cancel", "deny"].includes(s))) {
|
|
1689
1689
|
if (e[`${s}ButtonText`] = o.innerHTML, e[`show${Je(s)}Button`] = !0, o.hasAttribute("color")) {
|
|
@@ -1698,16 +1698,16 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1698
1698
|
}), e;
|
|
1699
1699
|
}, hr = (t) => {
|
|
1700
1700
|
const e = {}, n = t.querySelector("swal-image");
|
|
1701
|
-
return n && (
|
|
1701
|
+
return n && (Q(n, ["src", "width", "height", "alt"]), n.hasAttribute("src") && (e.imageUrl = n.getAttribute("src") || void 0), n.hasAttribute("width") && (e.imageWidth = n.getAttribute("width") || void 0), n.hasAttribute("height") && (e.imageHeight = n.getAttribute("height") || void 0), n.hasAttribute("alt") && (e.imageAlt = n.getAttribute("alt") || void 0)), e;
|
|
1702
1702
|
}, wr = (t) => {
|
|
1703
1703
|
const e = {}, n = t.querySelector("swal-icon");
|
|
1704
|
-
return n && (
|
|
1704
|
+
return n && (Q(n, ["type", "color"]), n.hasAttribute("type") && (e.icon = n.getAttribute("type")), n.hasAttribute("color") && (e.iconColor = n.getAttribute("color")), e.iconHtml = n.innerHTML), e;
|
|
1705
1705
|
}, fr = (t) => {
|
|
1706
1706
|
const e = {}, n = t.querySelector("swal-input");
|
|
1707
|
-
n && (
|
|
1707
|
+
n && (Q(n, ["type", "label", "placeholder", "value"]), e.input = n.getAttribute("type") || "text", n.hasAttribute("label") && (e.inputLabel = n.getAttribute("label")), n.hasAttribute("placeholder") && (e.inputPlaceholder = n.getAttribute("placeholder")), n.hasAttribute("value") && (e.inputValue = n.getAttribute("value")));
|
|
1708
1708
|
const o = Array.from(t.querySelectorAll("swal-input-option"));
|
|
1709
1709
|
return o.length && (e.inputOptions = {}, o.forEach((s) => {
|
|
1710
|
-
|
|
1710
|
+
Q(s, ["value"]);
|
|
1711
1711
|
const r = s.getAttribute("value");
|
|
1712
1712
|
if (!r)
|
|
1713
1713
|
return;
|
|
@@ -1718,7 +1718,7 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1718
1718
|
const n = {};
|
|
1719
1719
|
for (const o in e) {
|
|
1720
1720
|
const s = e[o], r = t.querySelector(s);
|
|
1721
|
-
r && (
|
|
1721
|
+
r && (Q(r, []), n[s.replace(/^swal-/, "")] = r.innerHTML.trim());
|
|
1722
1722
|
}
|
|
1723
1723
|
return n;
|
|
1724
1724
|
}, gr = (t) => {
|
|
@@ -1727,7 +1727,7 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1727
1727
|
const o = n.tagName.toLowerCase();
|
|
1728
1728
|
e.includes(o) || z(`Unrecognized element <${o}>`);
|
|
1729
1729
|
});
|
|
1730
|
-
},
|
|
1730
|
+
}, Q = (t, e) => {
|
|
1731
1731
|
Array.from(t.attributes).forEach((n) => {
|
|
1732
1732
|
e.indexOf(n.name) === -1 && z([`Unrecognized attribute "${n.name}" on <${t.tagName.toLowerCase()}>.`, `${e.length ? `Allowed attributes are: ${e.join(", ")}` : "To set the value, use HTML within the element."}`]);
|
|
1733
1733
|
});
|
|
@@ -1750,9 +1750,9 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1750
1750
|
if (!e || t.target !== e)
|
|
1751
1751
|
return;
|
|
1752
1752
|
const n = j();
|
|
1753
|
-
n && (e.removeEventListener("animationend", Pe), e.removeEventListener("transitionend", Pe), n.style.overflowY = "auto",
|
|
1753
|
+
n && (e.removeEventListener("animationend", Pe), e.removeEventListener("transitionend", Pe), n.style.overflowY = "auto", V(n, a["no-transition"]));
|
|
1754
1754
|
}, br = (t, e) => {
|
|
1755
|
-
|
|
1755
|
+
Rt(e) ? (t.style.overflowY = "hidden", e.addEventListener("animationend", Pe), e.addEventListener("transitionend", Pe)) : t.style.overflowY = "auto";
|
|
1756
1756
|
}, yr = (t, e, n) => {
|
|
1757
1757
|
ns(), e && n !== "hidden" && cs(n), setTimeout(() => {
|
|
1758
1758
|
t.scrollTop = 0;
|
|
@@ -1790,7 +1790,7 @@ showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
|
1790
1790
|
https://sweetalert2.github.io/#ajax-request`), kr(t), typeof t.title == "string" && (t.title = t.title.split(`
|
|
1791
1791
|
`).join("<br />")), wo(t);
|
|
1792
1792
|
}
|
|
1793
|
-
let
|
|
1793
|
+
let F;
|
|
1794
1794
|
var xe = /* @__PURE__ */ new WeakMap();
|
|
1795
1795
|
class P {
|
|
1796
1796
|
/**
|
|
@@ -1798,7 +1798,7 @@ class P {
|
|
|
1798
1798
|
* @this {SweetAlert}
|
|
1799
1799
|
*/
|
|
1800
1800
|
constructor(...e) {
|
|
1801
|
-
if (
|
|
1801
|
+
if (Vn(
|
|
1802
1802
|
this,
|
|
1803
1803
|
xe,
|
|
1804
1804
|
/** @type {Promise<SweetAlertResult>} */
|
|
@@ -1809,9 +1809,9 @@ class P {
|
|
|
1809
1809
|
})
|
|
1810
1810
|
), typeof window > "u")
|
|
1811
1811
|
return;
|
|
1812
|
-
|
|
1812
|
+
F = this;
|
|
1813
1813
|
const n = Object.freeze(this.constructor.argsToParams(e));
|
|
1814
|
-
this.params = n, this.isAwaitingPromise = !1, Fn(xe, this, this._main(
|
|
1814
|
+
this.params = n, this.isAwaitingPromise = !1, Fn(xe, this, this._main(F.params));
|
|
1815
1815
|
}
|
|
1816
1816
|
/**
|
|
1817
1817
|
* @param {any} userParams
|
|
@@ -1819,18 +1819,18 @@ class P {
|
|
|
1819
1819
|
*/
|
|
1820
1820
|
_main(e, n = {}) {
|
|
1821
1821
|
if (vn(Object.assign({}, n, e)), p.currentInstance) {
|
|
1822
|
-
const r =
|
|
1822
|
+
const r = se.swalPromiseResolve.get(p.currentInstance), {
|
|
1823
1823
|
isAwaitingPromise: d
|
|
1824
1824
|
} = p.currentInstance;
|
|
1825
1825
|
p.currentInstance._destroy(), d || r({
|
|
1826
1826
|
isDismissed: !0
|
|
1827
1827
|
}), rt() && en();
|
|
1828
1828
|
}
|
|
1829
|
-
p.currentInstance =
|
|
1829
|
+
p.currentInstance = F;
|
|
1830
1830
|
const o = Er(e, n);
|
|
1831
1831
|
xr(o), Object.freeze(o), p.timeout && (p.timeout.stop(), delete p.timeout), clearTimeout(p.restoreFocusTimeout);
|
|
1832
|
-
const s = Lr(
|
|
1833
|
-
return Zt(
|
|
1832
|
+
const s = Lr(F);
|
|
1833
|
+
return Zt(F, o), _.innerParams.set(F, o), Ar(F, s, o);
|
|
1834
1834
|
}
|
|
1835
1835
|
// `catch` cannot be the name of a module export, so we define our thenable methods here instead
|
|
1836
1836
|
/**
|
|
@@ -1855,20 +1855,20 @@ const Ar = (t, e, n) => new Promise((o, s) => {
|
|
|
1855
1855
|
isDenied: !1
|
|
1856
1856
|
});
|
|
1857
1857
|
};
|
|
1858
|
-
|
|
1858
|
+
se.swalPromiseResolve.set(t, o), se.swalPromiseReject.set(t, s), e.confirmButton.onclick = () => {
|
|
1859
1859
|
Ls(t);
|
|
1860
1860
|
}, e.denyButton.onclick = () => {
|
|
1861
1861
|
Ss(t);
|
|
1862
1862
|
}, e.cancelButton.onclick = () => {
|
|
1863
1863
|
Ts(t, r);
|
|
1864
1864
|
}, e.closeButton.onclick = () => {
|
|
1865
|
-
r(
|
|
1865
|
+
r(ce.close);
|
|
1866
1866
|
}, Us(n, e, r), Wo(p, n, r), ms(t, n), mr(n), Sr(p, n, r), Tr(e, n), setTimeout(() => {
|
|
1867
1867
|
e.container.scrollTop = 0;
|
|
1868
1868
|
});
|
|
1869
1869
|
}), Er = (t, e) => {
|
|
1870
|
-
const n = lr(t), o = Object.assign({},
|
|
1871
|
-
return o.showClass = Object.assign({},
|
|
1870
|
+
const n = lr(t), o = Object.assign({}, Y, e, n, t);
|
|
1871
|
+
return o.showClass = Object.assign({}, Y.showClass, o.showClass), o.hideClass = Object.assign({}, Y.hideClass, o.hideClass), o.animation === !1 && (o.showClass = {
|
|
1872
1872
|
backdrop: "swal2-noanimation"
|
|
1873
1873
|
}, o.hideClass = {}), o;
|
|
1874
1874
|
}, Lr = (t) => {
|
|
@@ -1885,23 +1885,23 @@ const Ar = (t, e, n) => new Promise((o, s) => {
|
|
|
1885
1885
|
),
|
|
1886
1886
|
actions: (
|
|
1887
1887
|
/** @type {HTMLElement} */
|
|
1888
|
-
|
|
1888
|
+
pe()
|
|
1889
1889
|
),
|
|
1890
1890
|
confirmButton: (
|
|
1891
1891
|
/** @type {HTMLElement} */
|
|
1892
|
-
|
|
1892
|
+
q()
|
|
1893
1893
|
),
|
|
1894
1894
|
denyButton: (
|
|
1895
1895
|
/** @type {HTMLElement} */
|
|
1896
|
-
|
|
1896
|
+
te()
|
|
1897
1897
|
),
|
|
1898
1898
|
cancelButton: (
|
|
1899
1899
|
/** @type {HTMLElement} */
|
|
1900
|
-
|
|
1900
|
+
ae()
|
|
1901
1901
|
),
|
|
1902
1902
|
loader: (
|
|
1903
1903
|
/** @type {HTMLElement} */
|
|
1904
|
-
|
|
1904
|
+
le()
|
|
1905
1905
|
),
|
|
1906
1906
|
closeButton: (
|
|
1907
1907
|
/** @type {HTMLElement} */
|
|
@@ -1954,21 +1954,21 @@ P.prototype.hideLoading = Be;
|
|
|
1954
1954
|
P.prototype.disableLoading = Be;
|
|
1955
1955
|
P.prototype.showValidationMessage = pn;
|
|
1956
1956
|
P.prototype.resetValidationMessage = gn;
|
|
1957
|
-
P.prototype.close =
|
|
1958
|
-
P.prototype.closePopup =
|
|
1959
|
-
P.prototype.closeModal =
|
|
1960
|
-
P.prototype.closeToast =
|
|
1957
|
+
P.prototype.close = W;
|
|
1958
|
+
P.prototype.closePopup = W;
|
|
1959
|
+
P.prototype.closeModal = W;
|
|
1960
|
+
P.prototype.closeToast = W;
|
|
1961
1961
|
P.prototype.rejectPromise = on;
|
|
1962
1962
|
P.prototype.update = Cn;
|
|
1963
1963
|
P.prototype._destroy = kn;
|
|
1964
1964
|
Object.assign(P, ir);
|
|
1965
1965
|
Object.keys(Ds).forEach((t) => {
|
|
1966
1966
|
P[t] = function(...e) {
|
|
1967
|
-
if (
|
|
1968
|
-
return
|
|
1967
|
+
if (F && F[t])
|
|
1968
|
+
return F[t](...e);
|
|
1969
1969
|
};
|
|
1970
1970
|
});
|
|
1971
|
-
P.DismissReason =
|
|
1971
|
+
P.DismissReason = ce;
|
|
1972
1972
|
P.version = "11.26.18";
|
|
1973
1973
|
const O = P;
|
|
1974
1974
|
O.default = O;
|
|
@@ -2346,7 +2346,7 @@ const Pr = new Ir();
|
|
|
2346
2346
|
function Mr(t) {
|
|
2347
2347
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2348
2348
|
}
|
|
2349
|
-
var
|
|
2349
|
+
var Ve = { exports: {} }, Tt;
|
|
2350
2350
|
function Or() {
|
|
2351
2351
|
return Tt || (Tt = 1, (function(t) {
|
|
2352
2352
|
var e = (function() {
|
|
@@ -2542,7 +2542,7 @@ function Or() {
|
|
|
2542
2542
|
t != null ? t.exports = e : typeof angular < "u" && angular != null && angular.module("LZString", []).factory("LZString", function() {
|
|
2543
2543
|
return e;
|
|
2544
2544
|
});
|
|
2545
|
-
})(
|
|
2545
|
+
})(Ve)), Ve.exports;
|
|
2546
2546
|
}
|
|
2547
2547
|
var Nr = Or();
|
|
2548
2548
|
const Ae = /* @__PURE__ */ Mr(Nr);
|
|
@@ -2619,7 +2619,7 @@ const _t = {
|
|
|
2619
2619
|
},
|
|
2620
2620
|
emits: ["update:modelValue"],
|
|
2621
2621
|
setup(t, { emit: e }) {
|
|
2622
|
-
const n =
|
|
2622
|
+
const n = ne("zh-CN"), o = ne(""), s = ne(""), r = ne([]), d = () => {
|
|
2623
2623
|
const g = k.get("I18N_CONFIG") || {};
|
|
2624
2624
|
o.value = g.appCode || "", s.value = g.token || (k.get("I18N_CONFIG") || {}).token || "", n.value = k.get("I18N_LANGUAGE") || g.locale || "zh-CN";
|
|
2625
2625
|
}, c = async () => {
|
|
@@ -2781,8 +2781,8 @@ const _t = {
|
|
|
2781
2781
|
},
|
|
2782
2782
|
render() {
|
|
2783
2783
|
const { editable: t, width: e, className: n } = this, o = e !== null ? { width: e + "px" } : {}, s = n ? `earth ${n}` : "earth";
|
|
2784
|
-
return
|
|
2785
|
-
|
|
2784
|
+
return ye("div", { class: s }, [
|
|
2785
|
+
ye("input", {
|
|
2786
2786
|
class: "input",
|
|
2787
2787
|
type: "text",
|
|
2788
2788
|
value: this.currentValue,
|
|
@@ -2791,7 +2791,7 @@ const _t = {
|
|
|
2791
2791
|
placeholder: "",
|
|
2792
2792
|
style: o
|
|
2793
2793
|
}),
|
|
2794
|
-
|
|
2794
|
+
ye(
|
|
2795
2795
|
"svg",
|
|
2796
2796
|
{
|
|
2797
2797
|
class: "icon earth-icon",
|
|
@@ -2802,7 +2802,7 @@ const _t = {
|
|
|
2802
2802
|
onClick: this.openModal
|
|
2803
2803
|
},
|
|
2804
2804
|
[
|
|
2805
|
-
|
|
2805
|
+
ye("path", {
|
|
2806
2806
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
|
|
2807
2807
|
})
|
|
2808
2808
|
]
|
|
@@ -2810,7 +2810,7 @@ const _t = {
|
|
|
2810
2810
|
]);
|
|
2811
2811
|
}
|
|
2812
2812
|
};
|
|
2813
|
-
function
|
|
2813
|
+
function ue(t) {
|
|
2814
2814
|
if (!t || typeof t != "string") return t;
|
|
2815
2815
|
const e = t.toLowerCase();
|
|
2816
2816
|
return {
|
|
@@ -2824,14 +2824,14 @@ function he(t) {
|
|
|
2824
2824
|
function Tn(t = {}) {
|
|
2825
2825
|
const e = Object.entries(t || {});
|
|
2826
2826
|
return e.some(([, o]) => o && typeof o == "object" && !Array.isArray(o) && Object.keys(o).some((s) => s.includes("-"))) ? e.reduce((o, [s, r]) => (!r || typeof r != "object" || Array.isArray(r) || Object.entries(r).forEach(([d, c]) => {
|
|
2827
|
-
const i =
|
|
2827
|
+
const i = ue(d);
|
|
2828
2828
|
o[i] = o[i] || {}, o[i][s] = c;
|
|
2829
|
-
}), o), {}) : e.reduce((o, [s, r]) => (o[
|
|
2829
|
+
}), o), {}) : e.reduce((o, [s, r]) => (o[ue(s)] = r, o), {});
|
|
2830
2830
|
}
|
|
2831
2831
|
function $t(t, e) {
|
|
2832
|
-
return t[e] || t[
|
|
2832
|
+
return t[e] || t[ue(e)] || t[String(e || "").toLowerCase()] || {};
|
|
2833
2833
|
}
|
|
2834
|
-
function
|
|
2834
|
+
function de(t, e) {
|
|
2835
2835
|
if (typeof t != "string" || !e || typeof e != "object" || Array.isArray(e))
|
|
2836
2836
|
return t;
|
|
2837
2837
|
const n = Object.entries(e);
|
|
@@ -2853,7 +2853,7 @@ function _n(t, e) {
|
|
|
2853
2853
|
};
|
|
2854
2854
|
}
|
|
2855
2855
|
function zr(t) {
|
|
2856
|
-
const { locale: e = "zh-CN", messages: n = {} } = t, o = Tn(n), s =
|
|
2856
|
+
const { locale: e = "zh-CN", messages: n = {} } = t, o = Tn(n), s = ne(e), r = ne(0), d = wt(), c = Ze() && d && typeof d.observable == "function" ? d.observable({
|
|
2857
2857
|
locale: e,
|
|
2858
2858
|
messageVersion: 0
|
|
2859
2859
|
}) : null, i = () => c ? c.locale : s.value, l = (w) => {
|
|
@@ -2876,14 +2876,14 @@ function zr(t) {
|
|
|
2876
2876
|
x = $.defaultValue, A = $.values, r.value, c && c.messageVersion;
|
|
2877
2877
|
const B = i();
|
|
2878
2878
|
if (B === "zh-CN" && !w.startsWith("i.") && !w.startsWith("pro."))
|
|
2879
|
-
return
|
|
2879
|
+
return de(x || w, A);
|
|
2880
2880
|
const E = $t(o, B);
|
|
2881
2881
|
let g = E[w];
|
|
2882
|
-
return g === void 0 && w.includes(".") && (g = w.split(".").reduce((y, C) => y && typeof y == "object" ? y[C] : void 0, E)),
|
|
2882
|
+
return g === void 0 && w.includes(".") && (g = w.split(".").reduce((y, C) => y && typeof y == "object" ? y[C] : void 0, E)), de(g && typeof g == "string" && g !== w ? g : x || w, A);
|
|
2883
2883
|
},
|
|
2884
2884
|
// 设置某个语言的所有消息
|
|
2885
2885
|
setLocaleMessage(w, x) {
|
|
2886
|
-
return o[
|
|
2886
|
+
return o[ue(w)] = { ...x }, u(), o[ue(w)];
|
|
2887
2887
|
},
|
|
2888
2888
|
// 获取某个语言的消息
|
|
2889
2889
|
getLocaleMessage(w) {
|
|
@@ -2921,7 +2921,7 @@ function Fe(t, ...e) {
|
|
|
2921
2921
|
return t(...e);
|
|
2922
2922
|
}
|
|
2923
2923
|
function wt(t) {
|
|
2924
|
-
return t && (t.version || t.prototype || t.config) ? t :
|
|
2924
|
+
return t && (t.version || t.prototype || t.config) ? t : ve && ve.version ? ve : ve;
|
|
2925
2925
|
}
|
|
2926
2926
|
function Ze(t) {
|
|
2927
2927
|
if (t && t.config && t.config.globalProperties)
|
|
@@ -2933,7 +2933,7 @@ function Bn(t, e = /* @__PURE__ */ new Set()) {
|
|
|
2933
2933
|
if (!t || e.has(t)) return;
|
|
2934
2934
|
e.add(t), typeof t.$forceUpdate == "function" && t.$forceUpdate(), (t.$children || []).forEach((o) => Bn(o, e));
|
|
2935
2935
|
}
|
|
2936
|
-
class
|
|
2936
|
+
class X {
|
|
2937
2937
|
constructor(e = {}) {
|
|
2938
2938
|
const {
|
|
2939
2939
|
router: n,
|
|
@@ -3081,7 +3081,7 @@ class J {
|
|
|
3081
3081
|
}
|
|
3082
3082
|
// 初始化路由守卫
|
|
3083
3083
|
initRouterGuards() {
|
|
3084
|
-
this.router && (
|
|
3084
|
+
this.router && (X._routerGuardRegistered || (X._routerGuardRegistered = !0, this.router.beforeEach(async (e, n, o) => {
|
|
3085
3085
|
var c, i;
|
|
3086
3086
|
const { language: s, token: r } = e.query;
|
|
3087
3087
|
if (this.configInstance && this.configInstance.closeModal(), this.name = e.name, this.translationKeySet = /* @__PURE__ */ new Set(), r && this.setToken(r), this.loadI18n)
|
|
@@ -3122,7 +3122,7 @@ class J {
|
|
|
3122
3122
|
return;
|
|
3123
3123
|
}
|
|
3124
3124
|
o();
|
|
3125
|
-
}),
|
|
3125
|
+
}), X._afterEachGuardRegistered || (X._afterEachGuardRegistered = !0, this.router.afterEach(async () => {
|
|
3126
3126
|
var r, d;
|
|
3127
3127
|
await pt();
|
|
3128
3128
|
const e = Array.from(this.translationKeySet), n = Array.from(
|
|
@@ -3151,7 +3151,7 @@ class J {
|
|
|
3151
3151
|
var h, w;
|
|
3152
3152
|
const d = _n(s, r);
|
|
3153
3153
|
if (s = d.defaultValue, r = d.values, typeof o == "string" && (n.translationKeySet.add(o), globalThis.__I18N_ALL_KEYS__ && globalThis.__I18N_ALL_KEYS__.add(o)), n.i18n.global.locale.value === "zh-CN" && typeof o == "string" && !o.startsWith("i.") && !o.startsWith("pro."))
|
|
3154
|
-
return
|
|
3154
|
+
return de(s || o, r);
|
|
3155
3155
|
const i = (h = n.router) == null ? void 0 : h.currentRoute, l = (w = (i == null ? void 0 : i.value) ?? i) == null ? void 0 : w.name;
|
|
3156
3156
|
let u;
|
|
3157
3157
|
if (l) {
|
|
@@ -3164,7 +3164,7 @@ class J {
|
|
|
3164
3164
|
}
|
|
3165
3165
|
} else
|
|
3166
3166
|
u = n.i18n.t(o, void 0, r);
|
|
3167
|
-
return u === o && typeof s == "string" && s && (u = s), u =
|
|
3167
|
+
return u === o && typeof s == "string" && s && (u = s), u = de(u, r), typeof o == "string" && typeof u == "string" && (n.keyValueMap[u] = o, globalThis.__I18N_KEY_VALUE_MAP__ || (globalThis.__I18N_KEY_VALUE_MAP__ = {}), globalThis.__I18N_KEY_VALUE_MAP__[u] = o), u;
|
|
3168
3168
|
}, this.t = globalThis.$t, globalThis.$deepScan = function(o) {
|
|
3169
3169
|
return o;
|
|
3170
3170
|
}, globalThis.$clearI18n = this.clearI18n = () => {
|
|
@@ -3341,8 +3341,8 @@ class J {
|
|
|
3341
3341
|
install(e, n = {}) {
|
|
3342
3342
|
if (Ze(e)) {
|
|
3343
3343
|
const o = wt(e);
|
|
3344
|
-
if (o.prototype.$t = this.t || globalThis.$t, o.prototype.$i18n = this.i18n, !
|
|
3345
|
-
|
|
3344
|
+
if (o.prototype.$t = this.t || globalThis.$t, o.prototype.$i18n = this.i18n, !X._vue2UpdateMixinRegistered && o.mixin) {
|
|
3345
|
+
X._vue2UpdateMixinRegistered = !0;
|
|
3346
3346
|
const s = this;
|
|
3347
3347
|
o.mixin({
|
|
3348
3348
|
beforeCreate() {
|
|
@@ -3368,6 +3368,6 @@ class J {
|
|
|
3368
3368
|
}
|
|
3369
3369
|
}
|
|
3370
3370
|
export {
|
|
3371
|
-
|
|
3372
|
-
|
|
3371
|
+
X as I18n,
|
|
3372
|
+
X as default
|
|
3373
3373
|
};
|