gc_i18n 1.5.11 → 1.6.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/lib/gc_i18n.es.js +1004 -889
- package/lib/gc_i18n.umd.js +19 -19
- package/package.json +1 -1
- package/packages/index.js +150 -31
- package/packages/libs/service.js +57 -0
package/lib/gc_i18n.es.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import './gc_i18n.css';
|
|
2
2
|
import ft from "keyboardjs";
|
|
3
|
-
import { h as
|
|
3
|
+
import { h as ve, ref as ne, computed as Ue, onMounted as Pn, nextTick as pt, Vue as Ce } from "vue-demi";
|
|
4
4
|
import Xe from "axios";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { jws as
|
|
8
|
-
const
|
|
5
|
+
import x from "store2";
|
|
6
|
+
import A from "lodash-es";
|
|
7
|
+
import { jws as Mn } from "jsrsasign";
|
|
8
|
+
const On = [
|
|
9
9
|
"ar-SA",
|
|
10
10
|
// 阿拉伯语(沙特阿拉伯)
|
|
11
11
|
"ar-EG",
|
|
12
12
|
// 阿拉伯语-埃及
|
|
13
13
|
"fa-IR"
|
|
14
14
|
// 波斯语(伊朗)
|
|
15
|
-
],
|
|
15
|
+
], ke = (t) => {
|
|
16
16
|
if (!t || typeof t != "string") return !1;
|
|
17
|
-
if (
|
|
17
|
+
if (On.includes(t)) return !0;
|
|
18
18
|
const e = t.split("-")[0].toLowerCase();
|
|
19
19
|
return ["ar", "fa"].includes(e);
|
|
20
|
-
},
|
|
20
|
+
}, Nn = (t) => {
|
|
21
21
|
const e = {};
|
|
22
22
|
for (const n of t)
|
|
23
23
|
e[n.key] = n.value;
|
|
24
24
|
return e;
|
|
25
|
-
},
|
|
25
|
+
}, zn = (t, e, n) => (e.forEach((o) => {
|
|
26
26
|
const s = o.key.split(".");
|
|
27
|
-
s[0] === "common" &&
|
|
28
|
-
const r =
|
|
29
|
-
r ?
|
|
30
|
-
}), t),
|
|
27
|
+
s[0] === "common" && A.find(t, { key: `${n}.${s[1]}` }) && A.remove(t, { key: `${n}.${s[1]}` });
|
|
28
|
+
const r = A.find(t, { key: o.key });
|
|
29
|
+
r ? A.merge(r, o) : t.push(o);
|
|
30
|
+
}), t), ie = Xe.create({
|
|
31
31
|
timeout: 8e3
|
|
32
|
-
}),
|
|
32
|
+
}), xe = /* @__PURE__ */ new Map(), qe = (t) => String(t || "guest").replace(/[^\w-]/g, "_"), Pt = async ({
|
|
33
33
|
baseUrl: t,
|
|
34
34
|
token: e,
|
|
35
35
|
appCode: n,
|
|
36
36
|
isRemote: o = !1
|
|
37
37
|
}) => {
|
|
38
|
-
const s =
|
|
38
|
+
const s = x.get("I18N_LANGUAGES");
|
|
39
39
|
if (s && Array.isArray(s) && s.length > 0 && !o)
|
|
40
40
|
return s.map((r) => ({
|
|
41
41
|
langCode: r.language || r.langCode || r,
|
|
@@ -44,24 +44,24 @@ const Mn = [
|
|
|
44
44
|
if (!n)
|
|
45
45
|
return [];
|
|
46
46
|
try {
|
|
47
|
-
const r = await
|
|
47
|
+
const r = await ie.get(`${t}/i18n-web//app/getsupportedlangs`, {
|
|
48
48
|
headers: {
|
|
49
49
|
appCode: n,
|
|
50
50
|
Authorization: e
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
if (r.data && r.data.result === 0) {
|
|
54
|
-
const
|
|
54
|
+
const l = A.get(r.data, "retVal", []), c = l.map((i) => ({
|
|
55
55
|
langCode: i.language || i.langCode || i,
|
|
56
56
|
langName: i.langName || i.language || i
|
|
57
57
|
}));
|
|
58
|
-
return
|
|
58
|
+
return x.set("I18N_LANGUAGES", l), c;
|
|
59
59
|
}
|
|
60
60
|
} catch (r) {
|
|
61
61
|
console.error("获取语言列表失败:", r);
|
|
62
62
|
}
|
|
63
63
|
return [];
|
|
64
|
-
},
|
|
64
|
+
}, jn = async ({ baseUrl: t, token: e, appCode: n }) => ie.get(
|
|
65
65
|
t + "/i18n-web/app/getsupportedlangs?appCode=" + n,
|
|
66
66
|
{
|
|
67
67
|
headers: {
|
|
@@ -76,8 +76,8 @@ const Mn = [
|
|
|
76
76
|
token: s
|
|
77
77
|
}) => {
|
|
78
78
|
try {
|
|
79
|
-
const r = o + "/i18n-web/kv_translate/kv_translates",
|
|
80
|
-
url:
|
|
79
|
+
const r = o + "/i18n-web/kv_translate/kv_translates", l = n ? r + "?lastPullDate=" + n : r, c = await ie({
|
|
80
|
+
url: l,
|
|
81
81
|
method: "GET",
|
|
82
82
|
headers: {
|
|
83
83
|
appCode: t,
|
|
@@ -89,21 +89,59 @@ const Mn = [
|
|
|
89
89
|
} catch (r) {
|
|
90
90
|
return console.error("获取翻译数据失败:", r), null;
|
|
91
91
|
}
|
|
92
|
-
},
|
|
92
|
+
}, Dn = async ({ data: t, token: e, baseUrl: n }) => ie({
|
|
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
|
-
}),
|
|
99
|
+
}), Un = async ({ data: t, token: e, baseUrl: n }) => ie({
|
|
100
100
|
url: n + "/i18n-web/kv_translate/batch",
|
|
101
101
|
method: "POST",
|
|
102
102
|
data: t,
|
|
103
103
|
headers: {
|
|
104
104
|
Authorization: e
|
|
105
105
|
}
|
|
106
|
-
}),
|
|
106
|
+
}), mt = (t) => {
|
|
107
|
+
if (typeof t == "string") {
|
|
108
|
+
const e = t.trim();
|
|
109
|
+
return !e || /^<!doctype/i.test(e) || /^<html/i.test(e) ? (console.warn("i18n_token 接口未返回有效 token,请检查业务项目接口"), "") : e;
|
|
110
|
+
}
|
|
111
|
+
return A.get(t, "retVal.i18n_token") || A.get(t, "retVal.token") || A.get(t, "i18n_token") || A.get(t, "token") || "";
|
|
112
|
+
}, Rn = async ({
|
|
113
|
+
request: t,
|
|
114
|
+
appCode: e,
|
|
115
|
+
orgCode: n,
|
|
116
|
+
userCode: o,
|
|
117
|
+
token: s
|
|
118
|
+
}) => {
|
|
119
|
+
if (typeof t == "function") {
|
|
120
|
+
const l = await t({
|
|
121
|
+
appCode: e,
|
|
122
|
+
orgCode: n,
|
|
123
|
+
userCode: o,
|
|
124
|
+
token: s
|
|
125
|
+
});
|
|
126
|
+
return mt((l == null ? void 0 : l.data) ?? l);
|
|
127
|
+
}
|
|
128
|
+
const r = await ie({
|
|
129
|
+
url: "/i18n_token",
|
|
130
|
+
method: "GET",
|
|
131
|
+
headers: s ? {
|
|
132
|
+
Accept: "application/json",
|
|
133
|
+
Authorization: s
|
|
134
|
+
} : {
|
|
135
|
+
Accept: "application/json"
|
|
136
|
+
},
|
|
137
|
+
params: {
|
|
138
|
+
appCode: e,
|
|
139
|
+
orgCode: n,
|
|
140
|
+
userCode: o
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return mt(r == null ? void 0 : r.data);
|
|
144
|
+
}, Hn = async ({
|
|
107
145
|
baseUrl: t,
|
|
108
146
|
appCode: e,
|
|
109
147
|
language: n = "zh-CN",
|
|
@@ -112,7 +150,7 @@ const Mn = [
|
|
|
112
150
|
cacheScope: r = "guest"
|
|
113
151
|
}) => {
|
|
114
152
|
try {
|
|
115
|
-
const
|
|
153
|
+
const l = qe(r), c = `I18N_${A.toUpper(e)}_${l}`, i = x.namespace(c), d = {
|
|
116
154
|
baseUrl: t,
|
|
117
155
|
appCode: e,
|
|
118
156
|
language: n,
|
|
@@ -121,108 +159,108 @@ const Mn = [
|
|
|
121
159
|
t || "",
|
|
122
160
|
e || "",
|
|
123
161
|
n || "",
|
|
124
|
-
|
|
162
|
+
l,
|
|
125
163
|
o || "",
|
|
126
|
-
|
|
164
|
+
A.get(u, "lastPullDate", "")
|
|
127
165
|
].join("|");
|
|
128
|
-
if (
|
|
129
|
-
return
|
|
166
|
+
if (xe.has(h))
|
|
167
|
+
return xe.get(h);
|
|
130
168
|
const w = (async () => {
|
|
131
169
|
if (!u || !u.lastPullDate) {
|
|
132
|
-
const B = await gt(
|
|
133
|
-
return B ? (i.set(n, B),
|
|
170
|
+
const B = await gt(d);
|
|
171
|
+
return B ? (i.set(n, B), A.get(B, "translatesDTOs", [])) : A.get(u, "translatesDTOs", []);
|
|
134
172
|
}
|
|
135
|
-
const { lastPullDate:
|
|
136
|
-
...
|
|
137
|
-
lastPullDate:
|
|
173
|
+
const { lastPullDate: k } = u, S = await gt({
|
|
174
|
+
...d,
|
|
175
|
+
lastPullDate: k
|
|
138
176
|
});
|
|
139
|
-
if (!
|
|
140
|
-
return
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
const B =
|
|
144
|
-
lastPullDate:
|
|
177
|
+
if (!S)
|
|
178
|
+
return A.get(u, "translatesDTOs", []);
|
|
179
|
+
const _ = A.get(u, "translatesDTOs", []);
|
|
180
|
+
if (!A.isEmpty(S.translatesDTOs)) {
|
|
181
|
+
const B = zn(_, S.translatesDTOs, s), E = {
|
|
182
|
+
lastPullDate: S.lastPullDate,
|
|
145
183
|
translatesDTOs: B
|
|
146
184
|
};
|
|
147
185
|
return i.set(n, E, ":"), B;
|
|
148
186
|
}
|
|
149
|
-
return
|
|
187
|
+
return _;
|
|
150
188
|
})();
|
|
151
|
-
return
|
|
152
|
-
|
|
189
|
+
return xe.set(h, w), w.finally(() => {
|
|
190
|
+
xe.delete(h);
|
|
153
191
|
}), w;
|
|
154
|
-
} catch (
|
|
155
|
-
console.error("处理翻译数据失败:",
|
|
156
|
-
const c = qe(r), i =
|
|
157
|
-
return
|
|
192
|
+
} catch (l) {
|
|
193
|
+
console.error("处理翻译数据失败:", l);
|
|
194
|
+
const c = qe(r), i = x.namespace(`I18N_${A.toUpper(e)}_${c}`);
|
|
195
|
+
return A.get(i.get(n), "translatesDTOs", []);
|
|
158
196
|
}
|
|
159
|
-
},
|
|
197
|
+
}, Vn = ({ appCode: t, cacheScope: e } = {}) => {
|
|
160
198
|
if (t) {
|
|
161
199
|
if (e) {
|
|
162
|
-
|
|
200
|
+
x.namespace(`I18N_${A.toUpper(t)}_${qe(e)}`).clearAll();
|
|
163
201
|
return;
|
|
164
202
|
}
|
|
165
|
-
|
|
203
|
+
x.namespace(`I18N_${A.toUpper(t)}`).clearAll();
|
|
166
204
|
}
|
|
167
205
|
};
|
|
168
206
|
/*!
|
|
169
207
|
* sweetalert2 v11.26.18
|
|
170
208
|
* Released under the MIT License.
|
|
171
209
|
*/
|
|
172
|
-
function
|
|
210
|
+
function Mt(t, e, n) {
|
|
173
211
|
if (typeof t == "function" ? t === e : t.has(e)) return arguments.length < 3 ? e : n;
|
|
174
212
|
throw new TypeError("Private element is not present on this object");
|
|
175
213
|
}
|
|
176
|
-
function
|
|
214
|
+
function Fn(t, e) {
|
|
177
215
|
if (e.has(t)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
178
216
|
}
|
|
179
|
-
function
|
|
180
|
-
return t.get(
|
|
217
|
+
function bt(t, e) {
|
|
218
|
+
return t.get(Mt(t, e));
|
|
181
219
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
220
|
+
function qn(t, e, n) {
|
|
221
|
+
Fn(t, e), e.set(t, n);
|
|
184
222
|
}
|
|
185
|
-
function
|
|
186
|
-
return t.set(
|
|
223
|
+
function Kn(t, e, n) {
|
|
224
|
+
return t.set(Mt(t, e), n), n;
|
|
187
225
|
}
|
|
188
|
-
const
|
|
226
|
+
const Gn = 100, p = {}, Wn = () => {
|
|
189
227
|
p.previousActiveElement instanceof HTMLElement ? (p.previousActiveElement.focus(), p.previousActiveElement = null) : document.body && document.body.focus();
|
|
190
|
-
},
|
|
228
|
+
}, Yn = (t) => new Promise((e) => {
|
|
191
229
|
if (!t)
|
|
192
230
|
return e();
|
|
193
231
|
const n = window.scrollX, o = window.scrollY;
|
|
194
232
|
p.restoreFocusTimeout = setTimeout(() => {
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
}),
|
|
198
|
-
(t, e) => (t[e] =
|
|
233
|
+
Wn(), e();
|
|
234
|
+
}, Gn), window.scrollTo(n, o);
|
|
235
|
+
}), Ot = "swal2-", Zn = ["container", "shown", "height-auto", "iosfix", "popup", "modal", "no-backdrop", "no-transition", "toast", "toast-shown", "show", "hide", "close", "title", "html-container", "actions", "confirm", "deny", "cancel", "footer", "icon", "icon-content", "image", "input", "file", "range", "select", "radio", "checkbox", "label", "textarea", "inputerror", "input-label", "validation-message", "progress-steps", "active-progress-step", "progress-step", "progress-step-line", "loader", "loading", "styled", "top", "top-start", "top-end", "top-left", "top-right", "center", "center-start", "center-end", "center-left", "center-right", "bottom", "bottom-start", "bottom-end", "bottom-left", "bottom-right", "grow-row", "grow-column", "grow-fullscreen", "rtl", "timer-progress-bar", "timer-progress-bar-container", "scrollbar-measure", "icon-success", "icon-warning", "icon-info", "icon-question", "icon-error", "draggable", "dragging"], a = Zn.reduce(
|
|
236
|
+
(t, e) => (t[e] = Ot + e, t),
|
|
199
237
|
/** @type {SwalClasses} */
|
|
200
238
|
{}
|
|
201
|
-
),
|
|
202
|
-
(t, e) => (t[e] =
|
|
239
|
+
), Xn = ["success", "warning", "info", "question", "error"], Le = Xn.reduce(
|
|
240
|
+
(t, e) => (t[e] = Ot + e, t),
|
|
203
241
|
/** @type {SwalIcons} */
|
|
204
242
|
{}
|
|
205
|
-
),
|
|
206
|
-
console.warn(`${
|
|
243
|
+
), Nt = "SweetAlert2:", Je = (t) => t.charAt(0).toUpperCase() + t.slice(1), z = (t) => {
|
|
244
|
+
console.warn(`${Nt} ${typeof t == "object" ? t.join(" ") : t}`);
|
|
207
245
|
}, ee = (t) => {
|
|
208
|
-
console.error(`${
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
},
|
|
246
|
+
console.error(`${Nt} ${t}`);
|
|
247
|
+
}, yt = [], Jn = (t) => {
|
|
248
|
+
yt.includes(t) || (yt.push(t), z(t));
|
|
249
|
+
}, zt = (t, e = null) => {
|
|
250
|
+
Jn(`"${t}" is deprecated and will be removed in the next major release.${e ? ` Use "${e}" instead.` : ""}`);
|
|
251
|
+
}, Oe = (t) => typeof t == "function" ? t() : t, Qe = (t) => t && typeof t.toPromise == "function", fe = (t) => Qe(t) ? t.toPromise() : Promise.resolve(t), et = (t) => t && Promise.resolve(t) === t, j = () => document.body.querySelector(`.${a.container}`), pe = (t) => {
|
|
214
252
|
const e = j();
|
|
215
253
|
return e ? e.querySelector(t) : null;
|
|
216
|
-
},
|
|
254
|
+
}, R = (t) => pe(`.${t}`), T = () => R(a.popup), ae = () => R(a.icon), Qn = () => R(a["icon-content"]), jt = () => R(a.title), tt = () => R(a["html-container"]), Dt = () => R(a.image), nt = () => R(a["progress-steps"]), Ne = () => R(a["validation-message"]), q = () => (
|
|
217
255
|
/** @type {HTMLButtonElement} */
|
|
218
|
-
|
|
219
|
-
),
|
|
256
|
+
pe(`.${a.actions} .${a.confirm}`)
|
|
257
|
+
), le = () => (
|
|
220
258
|
/** @type {HTMLButtonElement} */
|
|
221
|
-
|
|
259
|
+
pe(`.${a.actions} .${a.cancel}`)
|
|
222
260
|
), te = () => (
|
|
223
261
|
/** @type {HTMLButtonElement} */
|
|
224
|
-
|
|
225
|
-
),
|
|
262
|
+
pe(`.${a.actions} .${a.deny}`)
|
|
263
|
+
), eo = () => R(a["input-label"]), ce = () => pe(`.${a.loader}`), ge = () => R(a.actions), Ut = () => R(a.footer), ze = () => R(a["timer-progress-bar"]), ot = () => R(a.close), to = `
|
|
226
264
|
a[href],
|
|
227
265
|
area[href],
|
|
228
266
|
input:not([disabled]),
|
|
@@ -238,29 +276,29 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
238
276
|
video[controls],
|
|
239
277
|
summary
|
|
240
278
|
`, st = () => {
|
|
241
|
-
const t =
|
|
279
|
+
const t = T();
|
|
242
280
|
if (!t)
|
|
243
281
|
return [];
|
|
244
|
-
const e = t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'), n = Array.from(e).sort((r,
|
|
245
|
-
const c = parseInt(r.getAttribute("tabindex") || "0"), i = parseInt(
|
|
282
|
+
const e = t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'), n = Array.from(e).sort((r, l) => {
|
|
283
|
+
const c = parseInt(r.getAttribute("tabindex") || "0"), i = parseInt(l.getAttribute("tabindex") || "0");
|
|
246
284
|
return c > i ? 1 : c < i ? -1 : 0;
|
|
247
|
-
}), o = t.querySelectorAll(
|
|
285
|
+
}), o = t.querySelectorAll(to), s = Array.from(o).filter((r) => r.getAttribute("tabindex") !== "-1");
|
|
248
286
|
return [...new Set(n.concat(s))].filter((r) => D(r));
|
|
249
|
-
}, rt = () => K(document.body, a.shown) && !K(document.body, a["toast-shown"]) && !K(document.body, a["no-backdrop"]),
|
|
250
|
-
const t =
|
|
287
|
+
}, rt = () => K(document.body, a.shown) && !K(document.body, a["toast-shown"]) && !K(document.body, a["no-backdrop"]), je = () => {
|
|
288
|
+
const t = T();
|
|
251
289
|
return t ? K(t, a.toast) : !1;
|
|
252
|
-
},
|
|
253
|
-
const t =
|
|
290
|
+
}, no = () => {
|
|
291
|
+
const t = T();
|
|
254
292
|
return t ? t.hasAttribute("data-loading") : !1;
|
|
255
|
-
},
|
|
293
|
+
}, H = (t, e) => {
|
|
256
294
|
if (t.textContent = "", e) {
|
|
257
295
|
const o = new DOMParser().parseFromString(e, "text/html"), s = o.querySelector("head");
|
|
258
|
-
s && Array.from(s.childNodes).forEach((
|
|
259
|
-
t.appendChild(
|
|
296
|
+
s && Array.from(s.childNodes).forEach((l) => {
|
|
297
|
+
t.appendChild(l);
|
|
260
298
|
});
|
|
261
299
|
const r = o.querySelector("body");
|
|
262
|
-
r && Array.from(r.childNodes).forEach((
|
|
263
|
-
|
|
300
|
+
r && Array.from(r.childNodes).forEach((l) => {
|
|
301
|
+
l instanceof HTMLVideoElement || l instanceof HTMLAudioElement ? t.appendChild(l.cloneNode(!0)) : t.appendChild(l);
|
|
264
302
|
});
|
|
265
303
|
}
|
|
266
304
|
}, K = (t, e) => {
|
|
@@ -271,12 +309,12 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
271
309
|
if (!t.classList.contains(n[o]))
|
|
272
310
|
return !1;
|
|
273
311
|
return !0;
|
|
274
|
-
},
|
|
312
|
+
}, oo = (t, e) => {
|
|
275
313
|
Array.from(t.classList).forEach((n) => {
|
|
276
|
-
!Object.values(a).includes(n) && !Object.values(
|
|
314
|
+
!Object.values(a).includes(n) && !Object.values(Le).includes(n) && !Object.values(e.showClass || {}).includes(n) && t.classList.remove(n);
|
|
277
315
|
});
|
|
278
316
|
}, U = (t, e, n) => {
|
|
279
|
-
if (
|
|
317
|
+
if (oo(t, e), !e.customClass)
|
|
280
318
|
return;
|
|
281
319
|
const o = e.customClass[
|
|
282
320
|
/** @type {keyof SweetAlertCustomClass} */
|
|
@@ -289,7 +327,7 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
289
327
|
}
|
|
290
328
|
L(t, o);
|
|
291
329
|
}
|
|
292
|
-
},
|
|
330
|
+
}, De = (t, e) => {
|
|
293
331
|
if (!e)
|
|
294
332
|
return null;
|
|
295
333
|
switch (e) {
|
|
@@ -306,7 +344,7 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
306
344
|
default:
|
|
307
345
|
return t.querySelector(`.${a.popup} > .${a.input}`);
|
|
308
346
|
}
|
|
309
|
-
},
|
|
347
|
+
}, Rt = (t) => {
|
|
310
348
|
if (t.focus(), t.type !== "file") {
|
|
311
349
|
const e = t.value;
|
|
312
350
|
t.value = "", t.value = e;
|
|
@@ -339,17 +377,17 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
339
377
|
t && (t.style.display = "none");
|
|
340
378
|
}, it = (t, e = "block") => {
|
|
341
379
|
t && new MutationObserver(() => {
|
|
342
|
-
|
|
380
|
+
me(t, t.innerHTML, e);
|
|
343
381
|
}).observe(t, {
|
|
344
382
|
childList: !0,
|
|
345
383
|
subtree: !0
|
|
346
384
|
});
|
|
347
|
-
},
|
|
385
|
+
}, vt = (t, e, n, o) => {
|
|
348
386
|
const s = t.querySelector(e);
|
|
349
387
|
s && s.style.setProperty(n, o);
|
|
350
|
-
},
|
|
388
|
+
}, me = (t, e, n = "flex") => {
|
|
351
389
|
e ? M(t, n) : N(t);
|
|
352
|
-
}, D = (t) => !!(t && (t.offsetWidth || t.offsetHeight || t.getClientRects().length)),
|
|
390
|
+
}, D = (t) => !!(t && (t.offsetWidth || t.offsetHeight || t.getClientRects().length)), so = () => !D(q()) && !D(te()) && !D(le()), Ke = (t) => t.scrollHeight > t.clientHeight, ro = (t, e) => {
|
|
353
391
|
let n = (
|
|
354
392
|
/** @type {HTMLElement | null} */
|
|
355
393
|
t
|
|
@@ -360,23 +398,23 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
360
398
|
n = n.parentElement;
|
|
361
399
|
}
|
|
362
400
|
return !1;
|
|
363
|
-
},
|
|
401
|
+
}, Vt = (t) => {
|
|
364
402
|
const e = window.getComputedStyle(t), n = parseFloat(e.getPropertyValue("animation-duration") || "0"), o = parseFloat(e.getPropertyValue("transition-duration") || "0");
|
|
365
403
|
return n > 0 || o > 0;
|
|
366
404
|
}, at = (t, e = !1) => {
|
|
367
|
-
const n =
|
|
405
|
+
const n = ze();
|
|
368
406
|
n && D(n) && (e && (n.style.transition = "none", n.style.width = "100%"), setTimeout(() => {
|
|
369
407
|
n.style.transition = `width ${t / 1e3}s linear`, n.style.width = "0%";
|
|
370
408
|
}, 10));
|
|
371
|
-
},
|
|
372
|
-
const t =
|
|
409
|
+
}, io = () => {
|
|
410
|
+
const t = ze();
|
|
373
411
|
if (!t)
|
|
374
412
|
return;
|
|
375
413
|
const e = parseInt(window.getComputedStyle(t).width);
|
|
376
414
|
t.style.removeProperty("transition"), t.style.width = "100%";
|
|
377
415
|
const n = parseInt(window.getComputedStyle(t).width), o = e / n * 100;
|
|
378
416
|
t.style.width = `${o}%`;
|
|
379
|
-
},
|
|
417
|
+
}, ao = () => typeof window > "u" || typeof document > "u", lo = `
|
|
380
418
|
<div aria-labelledby="${a.title}" aria-describedby="${a["html-container"]}" class="${a.popup}" tabindex="-1">
|
|
381
419
|
<button type="button" class="${a.close}"></button>
|
|
382
420
|
<ul class="${a["progress-steps"]}"></ul>
|
|
@@ -409,7 +447,7 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
409
447
|
<div class="${a["timer-progress-bar"]}"></div>
|
|
410
448
|
</div>
|
|
411
449
|
</div>
|
|
412
|
-
`.replace(/(^|\n)\s*/g, ""),
|
|
450
|
+
`.replace(/(^|\n)\s*/g, ""), co = () => {
|
|
413
451
|
const t = j();
|
|
414
452
|
return t ? (t.remove(), V([document.documentElement, document.body], [
|
|
415
453
|
a["no-backdrop"],
|
|
@@ -419,17 +457,17 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
419
457
|
]), !0) : !1;
|
|
420
458
|
}, Z = () => {
|
|
421
459
|
p.currentInstance && p.currentInstance.resetValidationMessage();
|
|
422
|
-
},
|
|
423
|
-
const t =
|
|
460
|
+
}, uo = () => {
|
|
461
|
+
const t = T();
|
|
424
462
|
if (!t)
|
|
425
463
|
return;
|
|
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),
|
|
427
|
-
e && (e.oninput = Z), n && (n.onchange = Z), r && (r.onchange = Z),
|
|
464
|
+
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), l = t.querySelector(`.${a.checkbox} input`), c = G(t, a.textarea);
|
|
465
|
+
e && (e.oninput = Z), n && (n.onchange = Z), r && (r.onchange = Z), l && (l.onchange = Z), c && (c.oninput = Z), o && s && (o.oninput = () => {
|
|
428
466
|
Z(), s.value = o.value;
|
|
429
467
|
}, o.onchange = () => {
|
|
430
468
|
Z(), s.value = o.value;
|
|
431
469
|
});
|
|
432
|
-
},
|
|
470
|
+
}, ho = (t) => {
|
|
433
471
|
if (typeof t == "string") {
|
|
434
472
|
const e = document.querySelector(t);
|
|
435
473
|
if (!e)
|
|
@@ -440,47 +478,47 @@ const qn = 100, p = {}, Kn = () => {
|
|
|
440
478
|
);
|
|
441
479
|
}
|
|
442
480
|
return t;
|
|
443
|
-
},
|
|
444
|
-
const e =
|
|
481
|
+
}, wo = (t) => {
|
|
482
|
+
const e = T();
|
|
445
483
|
e && (e.setAttribute("role", t.toast ? "alert" : "dialog"), e.setAttribute("aria-live", t.toast ? "polite" : "assertive"), t.toast || e.setAttribute("aria-modal", "true"));
|
|
446
|
-
},
|
|
484
|
+
}, fo = (t) => {
|
|
447
485
|
window.getComputedStyle(t).direction === "rtl" && (L(j(), a.rtl), p.isRTL = !0);
|
|
448
|
-
},
|
|
449
|
-
const e =
|
|
450
|
-
if (
|
|
486
|
+
}, po = (t) => {
|
|
487
|
+
const e = co();
|
|
488
|
+
if (ao()) {
|
|
451
489
|
ee("SweetAlert2 requires document to initialize");
|
|
452
490
|
return;
|
|
453
491
|
}
|
|
454
492
|
const n = document.createElement("div");
|
|
455
|
-
n.className = a.container, e && L(n, a["no-transition"]),
|
|
456
|
-
const o =
|
|
457
|
-
o.appendChild(n), t.topLayer && (n.setAttribute("popover", ""), n.showPopover()),
|
|
493
|
+
n.className = a.container, e && L(n, a["no-transition"]), H(n, lo), n.dataset.swal2Theme = t.theme;
|
|
494
|
+
const o = ho(t.target || "body");
|
|
495
|
+
o.appendChild(n), t.topLayer && (n.setAttribute("popover", ""), n.showPopover()), wo(t), fo(o), uo();
|
|
458
496
|
}, lt = (t, e) => {
|
|
459
|
-
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ?
|
|
460
|
-
},
|
|
461
|
-
"jquery" in t ?
|
|
462
|
-
},
|
|
497
|
+
t instanceof HTMLElement ? e.appendChild(t) : typeof t == "object" ? go(t, e) : t && H(e, t);
|
|
498
|
+
}, go = (t, e) => {
|
|
499
|
+
"jquery" in t ? mo(e, t) : H(e, t.toString());
|
|
500
|
+
}, mo = (t, e) => {
|
|
463
501
|
if (t.textContent = "", 0 in e)
|
|
464
502
|
for (let n = 0; n in e; n++)
|
|
465
503
|
t.appendChild(e[n].cloneNode(!0));
|
|
466
504
|
else
|
|
467
505
|
t.appendChild(e.cloneNode(!0));
|
|
468
|
-
},
|
|
469
|
-
const n =
|
|
470
|
-
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? N(n) : M(n), U(n, e, "actions"),
|
|
506
|
+
}, bo = (t, e) => {
|
|
507
|
+
const n = ge(), o = ce();
|
|
508
|
+
!n || !o || (!e.showConfirmButton && !e.showDenyButton && !e.showCancelButton ? N(n) : M(n), U(n, e, "actions"), yo(n, o, e), H(o, e.loaderHtml || ""), U(o, e, "loader"));
|
|
471
509
|
};
|
|
472
|
-
function
|
|
473
|
-
const o = q(), s = te(), r =
|
|
474
|
-
!o || !s || !r || (He(o, "confirm", n), He(s, "deny", n), He(r, "cancel", n),
|
|
510
|
+
function yo(t, e, n) {
|
|
511
|
+
const o = q(), s = te(), r = le();
|
|
512
|
+
!o || !s || !r || (He(o, "confirm", n), He(s, "deny", n), He(r, "cancel", n), vo(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
513
|
}
|
|
476
|
-
function
|
|
514
|
+
function vo(t, e, n, o) {
|
|
477
515
|
if (!o.buttonsStyling) {
|
|
478
516
|
V([t, e, n], a.styled);
|
|
479
517
|
return;
|
|
480
518
|
}
|
|
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),
|
|
519
|
+
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), Re(t), Re(e), Re(n);
|
|
482
520
|
}
|
|
483
|
-
function
|
|
521
|
+
function Re(t) {
|
|
484
522
|
const e = window.getComputedStyle(t);
|
|
485
523
|
if (e.getPropertyValue("--swal2-action-button-focus-box-shadow"))
|
|
486
524
|
return;
|
|
@@ -492,86 +530,86 @@ function He(t, e, n) {
|
|
|
492
530
|
/** @type {'Confirm' | 'Deny' | 'Cancel'} */
|
|
493
531
|
Je(e)
|
|
494
532
|
);
|
|
495
|
-
|
|
533
|
+
me(t, n[`show${o}Button`], "inline-block"), H(t, n[`${e}ButtonText`] || ""), t.setAttribute("aria-label", n[`${e}ButtonAriaLabel`] || ""), t.className = a[e], U(t, n, `${e}Button`);
|
|
496
534
|
}
|
|
497
|
-
const
|
|
535
|
+
const Co = (t, e) => {
|
|
498
536
|
const n = ot();
|
|
499
|
-
n && (
|
|
500
|
-
},
|
|
537
|
+
n && (H(n, e.closeButtonHtml || ""), U(n, e, "closeButton"), me(n, e.showCloseButton), n.setAttribute("aria-label", e.closeButtonAriaLabel || ""));
|
|
538
|
+
}, ko = (t, e) => {
|
|
501
539
|
const n = j();
|
|
502
|
-
n && (
|
|
540
|
+
n && (xo(n, e.backdrop), Ao(n, e.position), Eo(n, e.grow), U(n, e, "container"));
|
|
503
541
|
};
|
|
504
|
-
function
|
|
542
|
+
function xo(t, e) {
|
|
505
543
|
typeof e == "string" ? t.style.background = e : e || L([document.documentElement, document.body], a["no-backdrop"]);
|
|
506
544
|
}
|
|
507
|
-
function
|
|
545
|
+
function Ao(t, e) {
|
|
508
546
|
e && (e in a ? L(t, a[e]) : (z('The "position" parameter is not valid, defaulting to "center"'), L(t, a.center)));
|
|
509
547
|
}
|
|
510
|
-
function
|
|
548
|
+
function Eo(t, e) {
|
|
511
549
|
e && L(t, a[`grow-${e}`]);
|
|
512
550
|
}
|
|
513
|
-
var
|
|
551
|
+
var $ = {
|
|
514
552
|
innerParams: /* @__PURE__ */ new WeakMap(),
|
|
515
553
|
domCache: /* @__PURE__ */ new WeakMap()
|
|
516
554
|
};
|
|
517
|
-
const
|
|
518
|
-
const n =
|
|
555
|
+
const Lo = ["input", "file", "range", "select", "radio", "checkbox", "textarea"], To = (t, e) => {
|
|
556
|
+
const n = T();
|
|
519
557
|
if (!n)
|
|
520
558
|
return;
|
|
521
|
-
const o =
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
}), e.input && (s &&
|
|
526
|
-
},
|
|
559
|
+
const o = $.innerParams.get(t), s = !o || e.input !== o.input;
|
|
560
|
+
Lo.forEach((r) => {
|
|
561
|
+
const l = G(n, a[r]);
|
|
562
|
+
l && ($o(r, e.inputAttributes), l.className = a[r], s && N(l));
|
|
563
|
+
}), e.input && (s && So(e), Bo(e));
|
|
564
|
+
}, So = (t) => {
|
|
527
565
|
if (!t.input)
|
|
528
566
|
return;
|
|
529
567
|
if (!I[t.input]) {
|
|
530
568
|
ee(`Unexpected type of input! Expected ${Object.keys(I).join(" | ")}, got "${t.input}"`);
|
|
531
569
|
return;
|
|
532
570
|
}
|
|
533
|
-
const e =
|
|
571
|
+
const e = Ft(t.input);
|
|
534
572
|
if (!e)
|
|
535
573
|
return;
|
|
536
574
|
const n = I[t.input](e, t);
|
|
537
575
|
M(e), t.inputAutoFocus && setTimeout(() => {
|
|
538
|
-
|
|
576
|
+
Rt(n);
|
|
539
577
|
});
|
|
540
|
-
},
|
|
578
|
+
}, _o = (t) => {
|
|
541
579
|
for (let e = 0; e < t.attributes.length; e++) {
|
|
542
580
|
const n = t.attributes[e].name;
|
|
543
581
|
["id", "type", "value", "style"].includes(n) || t.removeAttribute(n);
|
|
544
582
|
}
|
|
545
|
-
},
|
|
546
|
-
const n =
|
|
583
|
+
}, $o = (t, e) => {
|
|
584
|
+
const n = T();
|
|
547
585
|
if (!n)
|
|
548
586
|
return;
|
|
549
|
-
const o =
|
|
587
|
+
const o = De(n, t);
|
|
550
588
|
if (o) {
|
|
551
|
-
|
|
589
|
+
_o(o);
|
|
552
590
|
for (const s in e)
|
|
553
591
|
o.setAttribute(s, e[s]);
|
|
554
592
|
}
|
|
555
|
-
},
|
|
593
|
+
}, Bo = (t) => {
|
|
556
594
|
if (!t.input)
|
|
557
595
|
return;
|
|
558
|
-
const e =
|
|
596
|
+
const e = Ft(t.input);
|
|
559
597
|
e && U(e, t, "input");
|
|
560
598
|
}, ct = (t, e) => {
|
|
561
599
|
!t.placeholder && e.inputPlaceholder && (t.placeholder = e.inputPlaceholder);
|
|
562
|
-
},
|
|
600
|
+
}, be = (t, e, n) => {
|
|
563
601
|
if (n.inputLabel) {
|
|
564
602
|
const o = document.createElement("label"), s = a["input-label"];
|
|
565
603
|
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
604
|
}
|
|
567
|
-
},
|
|
568
|
-
const e =
|
|
605
|
+
}, Ft = (t) => {
|
|
606
|
+
const e = T();
|
|
569
607
|
if (e)
|
|
570
608
|
return G(e, a[
|
|
571
609
|
/** @type {SwalClass} */
|
|
572
610
|
t
|
|
573
611
|
] || a.input);
|
|
574
|
-
},
|
|
612
|
+
}, Te = (t, e) => {
|
|
575
613
|
["string", "number"].includes(typeof e) ? t.value = `${e}` : et(e) || z(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e}"`);
|
|
576
614
|
}, I = {};
|
|
577
615
|
I.text = I.email = I.password = I.number = I.tel = I.url = I.search = I.date = I["datetime-local"] = I.time = I.week = I.month = /** @type {(input: Input | HTMLElement, params: SweetAlertOptions) => Input} */
|
|
@@ -580,7 +618,7 @@ I.text = I.email = I.password = I.number = I.tel = I.url = I.search = I.date = I
|
|
|
580
618
|
/** @type {HTMLInputElement} */
|
|
581
619
|
t
|
|
582
620
|
);
|
|
583
|
-
return
|
|
621
|
+
return Te(n, e.inputValue), be(n, n, e), ct(n, e), n.type = /** @type {string} */
|
|
584
622
|
e.input, n;
|
|
585
623
|
};
|
|
586
624
|
I.file = (t, e) => {
|
|
@@ -588,20 +626,20 @@ I.file = (t, e) => {
|
|
|
588
626
|
/** @type {HTMLInputElement} */
|
|
589
627
|
t
|
|
590
628
|
);
|
|
591
|
-
return
|
|
629
|
+
return be(n, n, e), ct(n, e), n;
|
|
592
630
|
};
|
|
593
631
|
I.range = (t, e) => {
|
|
594
632
|
const n = (
|
|
595
633
|
/** @type {HTMLElement} */
|
|
596
634
|
t
|
|
597
635
|
), o = n.querySelector("input"), s = n.querySelector("output");
|
|
598
|
-
return o && (
|
|
599
|
-
e.input,
|
|
636
|
+
return o && (Te(o, e.inputValue), o.type = /** @type {string} */
|
|
637
|
+
e.input, be(
|
|
600
638
|
o,
|
|
601
639
|
/** @type {Input} */
|
|
602
640
|
t,
|
|
603
641
|
e
|
|
604
|
-
)), s &&
|
|
642
|
+
)), s && Te(s, e.inputValue), /** @type {Input} */
|
|
605
643
|
t;
|
|
606
644
|
};
|
|
607
645
|
I.select = (t, e) => {
|
|
@@ -611,9 +649,9 @@ I.select = (t, e) => {
|
|
|
611
649
|
);
|
|
612
650
|
if (n.textContent = "", e.inputPlaceholder) {
|
|
613
651
|
const o = document.createElement("option");
|
|
614
|
-
|
|
652
|
+
H(o, e.inputPlaceholder), o.value = "", o.disabled = !0, o.selected = !0, n.appendChild(o);
|
|
615
653
|
}
|
|
616
|
-
return
|
|
654
|
+
return be(n, n, e), n;
|
|
617
655
|
};
|
|
618
656
|
I.radio = (t) => {
|
|
619
657
|
const e = (
|
|
@@ -624,17 +662,17 @@ I.radio = (t) => {
|
|
|
624
662
|
t;
|
|
625
663
|
};
|
|
626
664
|
I.checkbox = (t, e) => {
|
|
627
|
-
const n =
|
|
665
|
+
const n = T();
|
|
628
666
|
if (!n)
|
|
629
667
|
throw new Error("Popup not found");
|
|
630
|
-
const o =
|
|
668
|
+
const o = De(n, "checkbox");
|
|
631
669
|
if (!o)
|
|
632
670
|
throw new Error("Checkbox input not found");
|
|
633
671
|
o.value = "1", o.checked = !!e.inputValue;
|
|
634
672
|
const r = /** @type {HTMLElement} */ t.querySelector("span");
|
|
635
673
|
if (r) {
|
|
636
|
-
const
|
|
637
|
-
|
|
674
|
+
const l = e.inputPlaceholder || e.inputLabel;
|
|
675
|
+
l && H(r, l);
|
|
638
676
|
}
|
|
639
677
|
return o;
|
|
640
678
|
};
|
|
@@ -643,89 +681,89 @@ I.textarea = (t, e) => {
|
|
|
643
681
|
/** @type {HTMLTextAreaElement} */
|
|
644
682
|
t
|
|
645
683
|
);
|
|
646
|
-
|
|
684
|
+
Te(n, e.inputValue), ct(n, e), be(n, n, e);
|
|
647
685
|
const o = (s) => parseInt(window.getComputedStyle(s).marginLeft) + parseInt(window.getComputedStyle(s).marginRight);
|
|
648
686
|
return setTimeout(() => {
|
|
649
687
|
if ("MutationObserver" in window) {
|
|
650
|
-
const s =
|
|
688
|
+
const s = T();
|
|
651
689
|
if (!s)
|
|
652
690
|
return;
|
|
653
|
-
const r = parseInt(window.getComputedStyle(s).width),
|
|
691
|
+
const r = parseInt(window.getComputedStyle(s).width), l = () => {
|
|
654
692
|
if (!document.body.contains(n))
|
|
655
693
|
return;
|
|
656
|
-
const c = n.offsetWidth + o(n), i =
|
|
694
|
+
const c = n.offsetWidth + o(n), i = T();
|
|
657
695
|
i && (c > r ? i.style.width = `${c}px` : J(i, "width", e.width));
|
|
658
696
|
};
|
|
659
|
-
new MutationObserver(
|
|
697
|
+
new MutationObserver(l).observe(n, {
|
|
660
698
|
attributes: !0,
|
|
661
699
|
attributeFilter: ["style"]
|
|
662
700
|
});
|
|
663
701
|
}
|
|
664
702
|
}), n;
|
|
665
703
|
};
|
|
666
|
-
const
|
|
704
|
+
const Io = (t, e) => {
|
|
667
705
|
const n = tt();
|
|
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),
|
|
669
|
-
},
|
|
670
|
-
const n =
|
|
671
|
-
n && (it(n),
|
|
672
|
-
},
|
|
673
|
-
const n =
|
|
706
|
+
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), To(t, e));
|
|
707
|
+
}, Po = (t, e) => {
|
|
708
|
+
const n = Ut();
|
|
709
|
+
n && (it(n), me(n, !!e.footer, "block"), e.footer && lt(e.footer, n), U(n, e, "footer"));
|
|
710
|
+
}, Mo = (t, e) => {
|
|
711
|
+
const n = $.innerParams.get(t), o = ae();
|
|
674
712
|
if (!o)
|
|
675
713
|
return;
|
|
676
714
|
if (n && e.icon === n.icon) {
|
|
677
|
-
|
|
715
|
+
kt(o, e), Ct(o, e);
|
|
678
716
|
return;
|
|
679
717
|
}
|
|
680
718
|
if (!e.icon && !e.iconHtml) {
|
|
681
719
|
N(o);
|
|
682
720
|
return;
|
|
683
721
|
}
|
|
684
|
-
if (e.icon && Object.keys(
|
|
722
|
+
if (e.icon && Object.keys(Le).indexOf(e.icon) === -1) {
|
|
685
723
|
ee(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`), N(o);
|
|
686
724
|
return;
|
|
687
725
|
}
|
|
688
|
-
M(o),
|
|
689
|
-
},
|
|
690
|
-
for (const [n, o] of Object.entries(
|
|
726
|
+
M(o), kt(o, e), Ct(o, e), L(o, e.showClass && e.showClass.icon), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", qt);
|
|
727
|
+
}, Ct = (t, e) => {
|
|
728
|
+
for (const [n, o] of Object.entries(Le))
|
|
691
729
|
e.icon !== n && V(t, o);
|
|
692
|
-
L(t, e.icon &&
|
|
693
|
-
},
|
|
694
|
-
const t =
|
|
730
|
+
L(t, e.icon && Le[e.icon]), zo(t, e), qt(), U(t, e, "icon");
|
|
731
|
+
}, qt = () => {
|
|
732
|
+
const t = T();
|
|
695
733
|
if (!t)
|
|
696
734
|
return;
|
|
697
735
|
const e = window.getComputedStyle(t).getPropertyValue("background-color"), n = t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");
|
|
698
736
|
for (let o = 0; o < n.length; o++)
|
|
699
737
|
n[o].style.backgroundColor = e;
|
|
700
|
-
},
|
|
738
|
+
}, Oo = (t) => `
|
|
701
739
|
${t.animation ? '<div class="swal2-success-circular-line-left"></div>' : ""}
|
|
702
740
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
703
741
|
<div class="swal2-success-ring"></div>
|
|
704
742
|
${t.animation ? '<div class="swal2-success-fix"></div>' : ""}
|
|
705
743
|
${t.animation ? '<div class="swal2-success-circular-line-right"></div>' : ""}
|
|
706
|
-
`,
|
|
744
|
+
`, No = `
|
|
707
745
|
<span class="swal2-x-mark">
|
|
708
746
|
<span class="swal2-x-mark-line-left"></span>
|
|
709
747
|
<span class="swal2-x-mark-line-right"></span>
|
|
710
748
|
</span>
|
|
711
|
-
`,
|
|
749
|
+
`, kt = (t, e) => {
|
|
712
750
|
if (!e.icon && !e.iconHtml)
|
|
713
751
|
return;
|
|
714
752
|
let n = t.innerHTML, o = "";
|
|
715
|
-
e.iconHtml ? o =
|
|
753
|
+
e.iconHtml ? o = xt(e.iconHtml) : e.icon === "success" ? (o = Oo(e), n = n.replace(/ style=".*?"/g, "")) : e.icon === "error" ? o = No : e.icon && (o = xt({
|
|
716
754
|
question: "?",
|
|
717
755
|
warning: "!",
|
|
718
756
|
info: "i"
|
|
719
|
-
}[e.icon])), n.trim() !== o.trim() &&
|
|
720
|
-
},
|
|
757
|
+
}[e.icon])), n.trim() !== o.trim() && H(t, o);
|
|
758
|
+
}, zo = (t, e) => {
|
|
721
759
|
if (e.iconColor) {
|
|
722
760
|
t.style.color = e.iconColor, t.style.borderColor = e.iconColor;
|
|
723
761
|
for (const n of [".swal2-success-line-tip", ".swal2-success-line-long", ".swal2-x-mark-line-left", ".swal2-x-mark-line-right"])
|
|
724
|
-
|
|
725
|
-
|
|
762
|
+
vt(t, n, "background-color", e.iconColor);
|
|
763
|
+
vt(t, ".swal2-success-ring", "border-color", e.iconColor);
|
|
726
764
|
}
|
|
727
|
-
},
|
|
728
|
-
const n =
|
|
765
|
+
}, xt = (t) => `<div class="${a["icon-content"]}">${t}</div>`, jo = (t, e) => {
|
|
766
|
+
const n = Dt();
|
|
729
767
|
if (n) {
|
|
730
768
|
if (!e.imageUrl) {
|
|
731
769
|
N(n);
|
|
@@ -734,38 +772,38 @@ const $o = (t, e) => {
|
|
|
734
772
|
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
773
|
}
|
|
736
774
|
};
|
|
737
|
-
let dt = !1,
|
|
738
|
-
const
|
|
739
|
-
t.addEventListener("mousedown", Se), document.body.addEventListener("mousemove",
|
|
740
|
-
},
|
|
741
|
-
t.removeEventListener("mousedown", Se), document.body.removeEventListener("mousemove",
|
|
775
|
+
let dt = !1, Kt = 0, Gt = 0, Wt = 0, Yt = 0;
|
|
776
|
+
const Do = (t) => {
|
|
777
|
+
t.addEventListener("mousedown", Se), document.body.addEventListener("mousemove", _e), t.addEventListener("mouseup", $e), t.addEventListener("touchstart", Se), document.body.addEventListener("touchmove", _e), t.addEventListener("touchend", $e);
|
|
778
|
+
}, Uo = (t) => {
|
|
779
|
+
t.removeEventListener("mousedown", Se), document.body.removeEventListener("mousemove", _e), t.removeEventListener("mouseup", $e), t.removeEventListener("touchstart", Se), document.body.removeEventListener("touchmove", _e), t.removeEventListener("touchend", $e);
|
|
742
780
|
}, Se = (t) => {
|
|
743
|
-
const e =
|
|
781
|
+
const e = T();
|
|
744
782
|
if (!e)
|
|
745
783
|
return;
|
|
746
|
-
const n =
|
|
784
|
+
const n = ae();
|
|
747
785
|
if (t.target === e || n && n.contains(
|
|
748
786
|
/** @type {HTMLElement} */
|
|
749
787
|
t.target
|
|
750
788
|
)) {
|
|
751
789
|
dt = !0;
|
|
752
|
-
const o =
|
|
753
|
-
|
|
790
|
+
const o = Zt(t);
|
|
791
|
+
Kt = o.clientX, Gt = o.clientY, Wt = parseInt(e.style.insetInlineStart) || 0, Yt = parseInt(e.style.insetBlockStart) || 0, L(e, "swal2-dragging");
|
|
754
792
|
}
|
|
755
|
-
},
|
|
756
|
-
const e =
|
|
793
|
+
}, _e = (t) => {
|
|
794
|
+
const e = T();
|
|
757
795
|
if (e && dt) {
|
|
758
796
|
let {
|
|
759
797
|
clientX: n,
|
|
760
798
|
clientY: o
|
|
761
|
-
} =
|
|
762
|
-
const s = n -
|
|
763
|
-
e.style.insetInlineStart = `${
|
|
799
|
+
} = Zt(t);
|
|
800
|
+
const s = n - Kt;
|
|
801
|
+
e.style.insetInlineStart = `${Wt + (p.isRTL ? -s : s)}px`, e.style.insetBlockStart = `${Yt + (o - Gt)}px`;
|
|
764
802
|
}
|
|
765
|
-
},
|
|
766
|
-
const t =
|
|
803
|
+
}, $e = () => {
|
|
804
|
+
const t = T();
|
|
767
805
|
dt = !1, V(t, "swal2-dragging");
|
|
768
|
-
},
|
|
806
|
+
}, Zt = (t) => {
|
|
769
807
|
let e = 0, n = 0;
|
|
770
808
|
return t.type.startsWith("mouse") ? (e = /** @type {MouseEvent} */
|
|
771
809
|
t.clientX, n = /** @type {MouseEvent} */
|
|
@@ -775,21 +813,21 @@ const zo = (t) => {
|
|
|
775
813
|
clientX: e,
|
|
776
814
|
clientY: n
|
|
777
815
|
};
|
|
778
|
-
},
|
|
779
|
-
const n = j(), o =
|
|
816
|
+
}, Ro = (t, e) => {
|
|
817
|
+
const n = j(), o = T();
|
|
780
818
|
if (!(!n || !o)) {
|
|
781
819
|
if (e.toast) {
|
|
782
820
|
J(n, "width", e.width), o.style.width = "100%";
|
|
783
|
-
const s =
|
|
784
|
-
s && o.insertBefore(s,
|
|
821
|
+
const s = ce();
|
|
822
|
+
s && o.insertBefore(s, ae());
|
|
785
823
|
} else
|
|
786
824
|
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(
|
|
825
|
+
J(o, "padding", e.padding), e.color && (o.style.color = e.color), e.background && (o.style.background = e.background), N(Ne()), Ho(o, e), e.draggable && !e.toast ? (L(o, a.draggable), Do(o)) : (V(o, a.draggable), Uo(o));
|
|
788
826
|
}
|
|
789
|
-
},
|
|
827
|
+
}, Ho = (t, e) => {
|
|
790
828
|
const n = e.showClass || {};
|
|
791
829
|
t.className = `${a.popup} ${D(t) ? n.popup : ""}`, e.toast ? (L([document.documentElement, document.body], a["toast-shown"]), L(t, a.toast)) : L(t, a.modal), U(t, e, "popup"), typeof e.customClass == "string" && L(t, e.customClass), e.icon && L(t, a[`icon-${e.icon}`]);
|
|
792
|
-
},
|
|
830
|
+
}, Vo = (t, e) => {
|
|
793
831
|
const n = nt();
|
|
794
832
|
if (!n)
|
|
795
833
|
return;
|
|
@@ -801,43 +839,43 @@ const zo = (t) => {
|
|
|
801
839
|
N(n);
|
|
802
840
|
return;
|
|
803
841
|
}
|
|
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,
|
|
805
|
-
const c =
|
|
806
|
-
if (n.appendChild(c),
|
|
807
|
-
const i =
|
|
842
|
+
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, l) => {
|
|
843
|
+
const c = Fo(r);
|
|
844
|
+
if (n.appendChild(c), l === s && L(c, a["active-progress-step"]), l !== o.length - 1) {
|
|
845
|
+
const i = qo(e);
|
|
808
846
|
n.appendChild(i);
|
|
809
847
|
}
|
|
810
848
|
});
|
|
811
|
-
},
|
|
849
|
+
}, Fo = (t) => {
|
|
812
850
|
const e = document.createElement("li");
|
|
813
|
-
return L(e, a["progress-step"]),
|
|
814
|
-
},
|
|
851
|
+
return L(e, a["progress-step"]), H(e, t), e;
|
|
852
|
+
}, qo = (t) => {
|
|
815
853
|
const e = document.createElement("li");
|
|
816
854
|
return L(e, a["progress-step-line"]), t.progressStepsDistance && J(e, "width", t.progressStepsDistance), e;
|
|
817
|
-
},
|
|
818
|
-
const n =
|
|
819
|
-
n && (it(n),
|
|
820
|
-
},
|
|
855
|
+
}, Ko = (t, e) => {
|
|
856
|
+
const n = jt();
|
|
857
|
+
n && (it(n), me(n, !!(e.title || e.titleText), "block"), e.title && lt(e.title, n), e.titleText && (n.innerText = e.titleText), U(n, e, "title"));
|
|
858
|
+
}, Xt = (t, e) => {
|
|
821
859
|
var n;
|
|
822
|
-
|
|
823
|
-
const o =
|
|
860
|
+
Ro(t, e), ko(t, e), Vo(t, e), Mo(t, e), jo(t, e), Ko(t, e), Co(t, e), Io(t, e), bo(t, e), Po(t, e);
|
|
861
|
+
const o = T();
|
|
824
862
|
typeof e.didRender == "function" && o && e.didRender(o), (n = p.eventEmitter) === null || n === void 0 || n.emit("didRender", o);
|
|
825
|
-
},
|
|
863
|
+
}, Go = () => D(T()), Jt = () => {
|
|
826
864
|
var t;
|
|
827
865
|
return (t = q()) === null || t === void 0 ? void 0 : t.click();
|
|
828
|
-
},
|
|
866
|
+
}, Wo = () => {
|
|
829
867
|
var t;
|
|
830
868
|
return (t = te()) === null || t === void 0 ? void 0 : t.click();
|
|
831
|
-
},
|
|
869
|
+
}, Yo = () => {
|
|
832
870
|
var t;
|
|
833
|
-
return (t =
|
|
834
|
-
},
|
|
871
|
+
return (t = le()) === null || t === void 0 ? void 0 : t.click();
|
|
872
|
+
}, de = Object.freeze({
|
|
835
873
|
cancel: "cancel",
|
|
836
874
|
backdrop: "backdrop",
|
|
837
875
|
close: "close",
|
|
838
876
|
esc: "esc",
|
|
839
877
|
timer: "timer"
|
|
840
|
-
}),
|
|
878
|
+
}), Qt = (t) => {
|
|
841
879
|
if (t.keydownTarget && t.keydownHandlerAdded && t.keydownHandler) {
|
|
842
880
|
const e = (
|
|
843
881
|
/** @type {EventListenerOrEventListenerObject} */
|
|
@@ -848,11 +886,11 @@ const zo = (t) => {
|
|
|
848
886
|
capture: t.keydownListenerCapture
|
|
849
887
|
}), t.keydownHandlerAdded = !1;
|
|
850
888
|
}
|
|
851
|
-
},
|
|
852
|
-
if (
|
|
853
|
-
const o = (r) =>
|
|
889
|
+
}, Zo = (t, e, n) => {
|
|
890
|
+
if (Qt(t), !e.toast) {
|
|
891
|
+
const o = (r) => Jo(e, r, n);
|
|
854
892
|
t.keydownHandler = o;
|
|
855
|
-
const s = e.keydownListenerCapture ? window :
|
|
893
|
+
const s = e.keydownListenerCapture ? window : T();
|
|
856
894
|
if (s) {
|
|
857
895
|
t.keydownTarget = s, t.keydownListenerCapture = e.keydownListenerCapture;
|
|
858
896
|
const r = (
|
|
@@ -872,22 +910,22 @@ const zo = (t) => {
|
|
|
872
910
|
t = t + e, t === -2 && (t = o.length - 1), t === o.length ? t = 0 : t === -1 && (t = o.length - 1), o[t].focus();
|
|
873
911
|
return;
|
|
874
912
|
}
|
|
875
|
-
(n =
|
|
876
|
-
},
|
|
877
|
-
t && (e.isComposing || e.keyCode === 229 || (t.stopKeydownPropagation && e.stopPropagation(), e.key === "Enter" ?
|
|
878
|
-
},
|
|
879
|
-
if (!
|
|
913
|
+
(n = T()) === null || n === void 0 || n.focus();
|
|
914
|
+
}, en = ["ArrowRight", "ArrowDown"], Xo = ["ArrowLeft", "ArrowUp"], Jo = (t, e, n) => {
|
|
915
|
+
t && (e.isComposing || e.keyCode === 229 || (t.stopKeydownPropagation && e.stopPropagation(), e.key === "Enter" ? Qo(e, t) : e.key === "Tab" ? es(e) : [...en, ...Xo].includes(e.key) ? ts(e.key) : e.key === "Escape" && ns(e, t, n)));
|
|
916
|
+
}, Qo = (t, e) => {
|
|
917
|
+
if (!Oe(e.allowEnterKey))
|
|
880
918
|
return;
|
|
881
|
-
const n =
|
|
919
|
+
const n = T();
|
|
882
920
|
if (!n || !e.input)
|
|
883
921
|
return;
|
|
884
|
-
const o =
|
|
922
|
+
const o = De(n, e.input);
|
|
885
923
|
if (t.target && o && t.target instanceof HTMLElement && t.target.outerHTML === o.outerHTML) {
|
|
886
924
|
if (["textarea", "file"].includes(e.input))
|
|
887
925
|
return;
|
|
888
|
-
|
|
926
|
+
Jt(), t.preventDefault();
|
|
889
927
|
}
|
|
890
|
-
},
|
|
928
|
+
}, es = (t) => {
|
|
891
929
|
const e = t.target, n = st();
|
|
892
930
|
let o = -1;
|
|
893
931
|
for (let s = 0; s < n.length; s++)
|
|
@@ -896,109 +934,109 @@ const zo = (t) => {
|
|
|
896
934
|
break;
|
|
897
935
|
}
|
|
898
936
|
t.shiftKey ? Ge(o, -1) : Ge(o, 1), t.stopPropagation(), t.preventDefault();
|
|
899
|
-
},
|
|
900
|
-
const e =
|
|
937
|
+
}, ts = (t) => {
|
|
938
|
+
const e = ge(), n = q(), o = te(), s = le();
|
|
901
939
|
if (!e || !n || !o || !s)
|
|
902
940
|
return;
|
|
903
941
|
const r = [n, o, s];
|
|
904
942
|
if (document.activeElement instanceof HTMLElement && !r.includes(document.activeElement))
|
|
905
943
|
return;
|
|
906
|
-
const
|
|
944
|
+
const l = en.includes(t) ? "nextElementSibling" : "previousElementSibling";
|
|
907
945
|
let c = document.activeElement;
|
|
908
946
|
if (c) {
|
|
909
947
|
for (let i = 0; i < e.children.length; i++) {
|
|
910
|
-
if (c = c[
|
|
948
|
+
if (c = c[l], !c)
|
|
911
949
|
return;
|
|
912
950
|
if (c instanceof HTMLButtonElement && D(c))
|
|
913
951
|
break;
|
|
914
952
|
}
|
|
915
953
|
c instanceof HTMLButtonElement && c.focus();
|
|
916
954
|
}
|
|
917
|
-
},
|
|
918
|
-
t.preventDefault(),
|
|
955
|
+
}, ns = (t, e, n) => {
|
|
956
|
+
t.preventDefault(), Oe(e.allowEscapeKey) && n(de.esc);
|
|
919
957
|
};
|
|
920
958
|
var se = {
|
|
921
959
|
swalPromiseResolve: /* @__PURE__ */ new WeakMap(),
|
|
922
960
|
swalPromiseReject: /* @__PURE__ */ new WeakMap()
|
|
923
961
|
};
|
|
924
|
-
const
|
|
962
|
+
const os = () => {
|
|
925
963
|
const t = j();
|
|
926
964
|
Array.from(document.body.children).forEach((n) => {
|
|
927
965
|
n.contains(t) || (n.hasAttribute("aria-hidden") && n.setAttribute("data-previous-aria-hidden", n.getAttribute("aria-hidden") || ""), n.setAttribute("aria-hidden", "true"));
|
|
928
966
|
});
|
|
929
|
-
},
|
|
967
|
+
}, tn = () => {
|
|
930
968
|
Array.from(document.body.children).forEach((e) => {
|
|
931
969
|
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
970
|
});
|
|
933
|
-
},
|
|
934
|
-
if (
|
|
971
|
+
}, nn = typeof window < "u" && !!window.GestureEvent, ss = () => {
|
|
972
|
+
if (nn && !K(document.body, a.iosfix)) {
|
|
935
973
|
const t = document.body.scrollTop;
|
|
936
|
-
document.body.style.top = `${t * -1}px`, L(document.body, a.iosfix),
|
|
974
|
+
document.body.style.top = `${t * -1}px`, L(document.body, a.iosfix), rs();
|
|
937
975
|
}
|
|
938
|
-
},
|
|
976
|
+
}, rs = () => {
|
|
939
977
|
const t = j();
|
|
940
978
|
if (!t)
|
|
941
979
|
return;
|
|
942
980
|
let e;
|
|
943
981
|
t.ontouchstart = (n) => {
|
|
944
|
-
e =
|
|
982
|
+
e = is(n);
|
|
945
983
|
}, t.ontouchmove = (n) => {
|
|
946
984
|
e && (n.preventDefault(), n.stopPropagation());
|
|
947
985
|
};
|
|
948
|
-
},
|
|
986
|
+
}, is = (t) => {
|
|
949
987
|
const e = t.target, n = j(), o = tt();
|
|
950
|
-
return !n || !o ||
|
|
988
|
+
return !n || !o || as(t) || ls(t) ? !1 : e === n || !Ke(n) && e instanceof HTMLElement && !ro(e, o) && // #2823
|
|
951
989
|
e.tagName !== "INPUT" && // #1603
|
|
952
990
|
e.tagName !== "TEXTAREA" && // #2266
|
|
953
991
|
!(Ke(o) && // #1944
|
|
954
992
|
o.contains(e));
|
|
955
|
-
},
|
|
956
|
-
t.touches[0].touchType === "stylus"),
|
|
993
|
+
}, as = (t) => !!(t.touches && t.touches.length && // @ts-ignore - touchType is not a standard property
|
|
994
|
+
t.touches[0].touchType === "stylus"), ls = (t) => t.touches && t.touches.length > 1, cs = () => {
|
|
957
995
|
if (K(document.body, a.iosfix)) {
|
|
958
996
|
const t = parseInt(document.body.style.top, 10);
|
|
959
997
|
V(document.body, a.iosfix), document.body.style.top = "", document.body.scrollTop = t * -1;
|
|
960
998
|
}
|
|
961
|
-
},
|
|
999
|
+
}, ds = () => {
|
|
962
1000
|
const t = document.createElement("div");
|
|
963
1001
|
t.className = a["scrollbar-measure"], document.body.appendChild(t);
|
|
964
1002
|
const e = t.getBoundingClientRect().width - t.clientWidth;
|
|
965
1003
|
return document.body.removeChild(t), e;
|
|
966
1004
|
};
|
|
967
1005
|
let oe = null;
|
|
968
|
-
const
|
|
969
|
-
oe === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (oe = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${oe +
|
|
970
|
-
},
|
|
1006
|
+
const us = (t) => {
|
|
1007
|
+
oe === null && (document.body.scrollHeight > window.innerHeight || t === "scroll") && (oe = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")), document.body.style.paddingRight = `${oe + ds()}px`);
|
|
1008
|
+
}, hs = () => {
|
|
971
1009
|
oe !== null && (document.body.style.paddingRight = `${oe}px`, oe = null);
|
|
972
1010
|
};
|
|
973
|
-
function
|
|
974
|
-
|
|
1011
|
+
function on(t, e, n, o) {
|
|
1012
|
+
je() ? At(t, o) : (Yn(n).then(() => At(t, o)), Qt(p)), nn ? (e.setAttribute("style", "display:none !important"), e.removeAttribute("class"), e.innerHTML = "") : e.remove(), rt() && (hs(), cs(), tn()), ws();
|
|
975
1013
|
}
|
|
976
|
-
function
|
|
1014
|
+
function ws() {
|
|
977
1015
|
V([document.documentElement, document.body], [a.shown, a["height-auto"], a["no-backdrop"], a["toast-shown"]]);
|
|
978
1016
|
}
|
|
979
1017
|
function W(t) {
|
|
980
|
-
t =
|
|
981
|
-
const e = se.swalPromiseResolve.get(this), n =
|
|
982
|
-
this.isAwaitingPromise ? t.isDismissed || (
|
|
1018
|
+
t = ps(t);
|
|
1019
|
+
const e = se.swalPromiseResolve.get(this), n = fs(this);
|
|
1020
|
+
this.isAwaitingPromise ? t.isDismissed || (ye(this), e(t)) : n && e(t);
|
|
983
1021
|
}
|
|
984
|
-
const
|
|
985
|
-
const e =
|
|
1022
|
+
const fs = (t) => {
|
|
1023
|
+
const e = T();
|
|
986
1024
|
if (!e)
|
|
987
1025
|
return !1;
|
|
988
|
-
const n =
|
|
1026
|
+
const n = $.innerParams.get(t);
|
|
989
1027
|
if (!n || K(e, n.hideClass.popup))
|
|
990
1028
|
return !1;
|
|
991
1029
|
V(e, n.showClass.popup), L(e, n.hideClass.popup);
|
|
992
1030
|
const o = j();
|
|
993
|
-
return V(o, n.showClass.backdrop), L(o, n.hideClass.backdrop),
|
|
1031
|
+
return V(o, n.showClass.backdrop), L(o, n.hideClass.backdrop), gs(t, e, n), !0;
|
|
994
1032
|
};
|
|
995
|
-
function
|
|
1033
|
+
function sn(t) {
|
|
996
1034
|
const e = se.swalPromiseReject.get(this);
|
|
997
|
-
|
|
1035
|
+
ye(this), e && e(t);
|
|
998
1036
|
}
|
|
999
|
-
const
|
|
1000
|
-
t.isAwaitingPromise && (delete t.isAwaitingPromise,
|
|
1001
|
-
},
|
|
1037
|
+
const ye = (t) => {
|
|
1038
|
+
t.isAwaitingPromise && (delete t.isAwaitingPromise, $.innerParams.get(t) || t._destroy());
|
|
1039
|
+
}, ps = (t) => typeof t > "u" ? {
|
|
1002
1040
|
isConfirmed: !1,
|
|
1003
1041
|
isDenied: !1,
|
|
1004
1042
|
isDismissed: !0
|
|
@@ -1006,145 +1044,145 @@ const be = (t) => {
|
|
|
1006
1044
|
isConfirmed: !1,
|
|
1007
1045
|
isDenied: !1,
|
|
1008
1046
|
isDismissed: !1
|
|
1009
|
-
}, t),
|
|
1047
|
+
}, t), gs = (t, e, n) => {
|
|
1010
1048
|
var o;
|
|
1011
|
-
const s = j(), r =
|
|
1012
|
-
typeof n.willClose == "function" && n.willClose(e), (o = p.eventEmitter) === null || o === void 0 || o.emit("willClose", e), r && s ?
|
|
1013
|
-
},
|
|
1014
|
-
p.swalCloseEventFinishedCallback =
|
|
1015
|
-
const r = function(
|
|
1016
|
-
if (
|
|
1049
|
+
const s = j(), r = Vt(e);
|
|
1050
|
+
typeof n.willClose == "function" && n.willClose(e), (o = p.eventEmitter) === null || o === void 0 || o.emit("willClose", e), r && s ? ms(t, e, s, !!n.returnFocus, n.didClose) : s && on(t, s, !!n.returnFocus, n.didClose);
|
|
1051
|
+
}, ms = (t, e, n, o, s) => {
|
|
1052
|
+
p.swalCloseEventFinishedCallback = on.bind(null, t, n, o, s);
|
|
1053
|
+
const r = function(l) {
|
|
1054
|
+
if (l.target === e) {
|
|
1017
1055
|
var c;
|
|
1018
1056
|
(c = p.swalCloseEventFinishedCallback) === null || c === void 0 || c.call(p), delete p.swalCloseEventFinishedCallback, e.removeEventListener("animationend", r), e.removeEventListener("transitionend", r);
|
|
1019
1057
|
}
|
|
1020
1058
|
};
|
|
1021
1059
|
e.addEventListener("animationend", r), e.addEventListener("transitionend", r);
|
|
1022
|
-
},
|
|
1060
|
+
}, At = (t, e) => {
|
|
1023
1061
|
setTimeout(() => {
|
|
1024
1062
|
var n;
|
|
1025
1063
|
typeof e == "function" && e.bind(t.params)(), (n = p.eventEmitter) === null || n === void 0 || n.emit("didClose"), t._destroy && t._destroy();
|
|
1026
1064
|
});
|
|
1027
1065
|
}, re = (t) => {
|
|
1028
|
-
let e =
|
|
1029
|
-
if (e || new O(), e =
|
|
1066
|
+
let e = T();
|
|
1067
|
+
if (e || new O(), e = T(), !e)
|
|
1030
1068
|
return;
|
|
1031
|
-
const n =
|
|
1032
|
-
|
|
1033
|
-
}, gs = (t, e) => {
|
|
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
|
-
}, 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)) && (re(q()), xs(t, e));
|
|
1069
|
+
const n = ce();
|
|
1070
|
+
je() ? N(ae()) : bs(e, t), M(n), e.setAttribute("data-loading", "true"), e.setAttribute("aria-busy", "true"), e.focus();
|
|
1038
1071
|
}, bs = (t, e) => {
|
|
1072
|
+
const n = ge(), o = ce();
|
|
1073
|
+
!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));
|
|
1074
|
+
}, ys = (t, e) => {
|
|
1075
|
+
e.input === "select" || e.input === "radio" ? As(t, e) : ["text", "email", "number", "tel", "textarea"].some((n) => n === e.input) && (Qe(e.inputValue) || et(e.inputValue)) && (re(q()), Es(t, e));
|
|
1076
|
+
}, vs = (t, e) => {
|
|
1039
1077
|
const n = t.getInput();
|
|
1040
1078
|
if (!n)
|
|
1041
1079
|
return null;
|
|
1042
1080
|
switch (e.input) {
|
|
1043
1081
|
case "checkbox":
|
|
1044
|
-
return
|
|
1082
|
+
return Cs(n);
|
|
1045
1083
|
case "radio":
|
|
1046
|
-
return
|
|
1084
|
+
return ks(n);
|
|
1047
1085
|
case "file":
|
|
1048
|
-
return
|
|
1086
|
+
return xs(n);
|
|
1049
1087
|
default:
|
|
1050
1088
|
return e.inputAutoTrim ? n.value.trim() : n.value;
|
|
1051
1089
|
}
|
|
1052
|
-
},
|
|
1053
|
-
const n =
|
|
1090
|
+
}, Cs = (t) => t.checked ? 1 : 0, ks = (t) => t.checked ? t.value : null, xs = (t) => t.files && t.files.length ? t.getAttribute("multiple") !== null ? t.files : t.files[0] : null, As = (t, e) => {
|
|
1091
|
+
const n = T();
|
|
1054
1092
|
if (!n)
|
|
1055
1093
|
return;
|
|
1056
1094
|
const o = (s) => {
|
|
1057
|
-
e.input === "select" ?
|
|
1095
|
+
e.input === "select" ? Ls(n, Be(s), e) : e.input === "radio" && Ts(n, Be(s), e);
|
|
1058
1096
|
};
|
|
1059
|
-
Qe(e.inputOptions) || et(e.inputOptions) ? (re(q()),
|
|
1097
|
+
Qe(e.inputOptions) || et(e.inputOptions) ? (re(q()), fe(e.inputOptions).then((s) => {
|
|
1060
1098
|
t.hideLoading(), o(s);
|
|
1061
1099
|
})) : typeof e.inputOptions == "object" ? o(e.inputOptions) : ee(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`);
|
|
1062
|
-
},
|
|
1100
|
+
}, Es = (t, e) => {
|
|
1063
1101
|
const n = t.getInput();
|
|
1064
|
-
n && (N(n),
|
|
1102
|
+
n && (N(n), fe(e.inputValue).then((o) => {
|
|
1065
1103
|
n.value = e.input === "number" ? `${parseFloat(o) || 0}` : `${o}`, M(n), n.focus(), t.hideLoading();
|
|
1066
1104
|
}).catch((o) => {
|
|
1067
1105
|
ee(`Error in inputValue promise: ${o}`), n.value = "", M(n), n.focus(), t.hideLoading();
|
|
1068
1106
|
}));
|
|
1069
1107
|
};
|
|
1070
|
-
function
|
|
1108
|
+
function Ls(t, e, n) {
|
|
1071
1109
|
const o = G(t, a.select);
|
|
1072
1110
|
if (!o)
|
|
1073
1111
|
return;
|
|
1074
|
-
const s = (r,
|
|
1112
|
+
const s = (r, l, c) => {
|
|
1075
1113
|
const i = document.createElement("option");
|
|
1076
|
-
i.value = c,
|
|
1114
|
+
i.value = c, H(i, l), i.selected = rn(c, n.inputValue), r.appendChild(i);
|
|
1077
1115
|
};
|
|
1078
1116
|
e.forEach((r) => {
|
|
1079
|
-
const
|
|
1117
|
+
const l = r[0], c = r[1];
|
|
1080
1118
|
if (Array.isArray(c)) {
|
|
1081
1119
|
const i = document.createElement("optgroup");
|
|
1082
|
-
i.label =
|
|
1120
|
+
i.label = l, i.disabled = !1, o.appendChild(i), c.forEach((d) => s(i, d[1], d[0]));
|
|
1083
1121
|
} else
|
|
1084
|
-
s(o, c,
|
|
1122
|
+
s(o, c, l);
|
|
1085
1123
|
}), o.focus();
|
|
1086
1124
|
}
|
|
1087
|
-
function
|
|
1125
|
+
function Ts(t, e, n) {
|
|
1088
1126
|
const o = G(t, a.radio);
|
|
1089
1127
|
if (!o)
|
|
1090
1128
|
return;
|
|
1091
1129
|
e.forEach((r) => {
|
|
1092
|
-
const
|
|
1093
|
-
i.type = "radio", i.name = a.radio, i.value =
|
|
1130
|
+
const l = r[0], c = r[1], i = document.createElement("input"), d = document.createElement("label");
|
|
1131
|
+
i.type = "radio", i.name = a.radio, i.value = l, rn(l, n.inputValue) && (i.checked = !0);
|
|
1094
1132
|
const u = document.createElement("span");
|
|
1095
|
-
|
|
1133
|
+
H(u, c), u.className = a.label, d.appendChild(i), d.appendChild(u), o.appendChild(d);
|
|
1096
1134
|
});
|
|
1097
1135
|
const s = o.querySelectorAll("input");
|
|
1098
1136
|
s.length && s[0].focus();
|
|
1099
1137
|
}
|
|
1100
|
-
const
|
|
1138
|
+
const Be = (t) => {
|
|
1101
1139
|
const e = [];
|
|
1102
1140
|
return t instanceof Map ? t.forEach((n, o) => {
|
|
1103
1141
|
let s = n;
|
|
1104
|
-
typeof s == "object" && (s =
|
|
1142
|
+
typeof s == "object" && (s = Be(s)), e.push([o, s]);
|
|
1105
1143
|
}) : Object.keys(t).forEach((n) => {
|
|
1106
1144
|
let o = t[n];
|
|
1107
|
-
typeof o == "object" && (o =
|
|
1145
|
+
typeof o == "object" && (o = Be(o)), e.push([n, o]);
|
|
1108
1146
|
}), e;
|
|
1109
|
-
},
|
|
1110
|
-
const e =
|
|
1111
|
-
t.disableButtons(), e.input ?
|
|
1112
|
-
},
|
|
1113
|
-
const e =
|
|
1114
|
-
t.disableButtons(), e.returnInputValueOnDeny ?
|
|
1115
|
-
},
|
|
1116
|
-
t.disableButtons(), e(
|
|
1117
|
-
},
|
|
1118
|
-
const n =
|
|
1147
|
+
}, rn = (t, e) => !!e && e !== null && e !== void 0 && e.toString() === t.toString(), Ss = (t) => {
|
|
1148
|
+
const e = $.innerParams.get(t);
|
|
1149
|
+
t.disableButtons(), e.input ? an(t, "confirm") : ht(t, !0);
|
|
1150
|
+
}, _s = (t) => {
|
|
1151
|
+
const e = $.innerParams.get(t);
|
|
1152
|
+
t.disableButtons(), e.returnInputValueOnDeny ? an(t, "deny") : ut(t, !1);
|
|
1153
|
+
}, $s = (t, e) => {
|
|
1154
|
+
t.disableButtons(), e(de.cancel);
|
|
1155
|
+
}, an = (t, e) => {
|
|
1156
|
+
const n = $.innerParams.get(t);
|
|
1119
1157
|
if (!n.input) {
|
|
1120
1158
|
ee(`The "input" parameter is needed to be set when using returnInputValueOn${Je(e)}`);
|
|
1121
1159
|
return;
|
|
1122
1160
|
}
|
|
1123
|
-
const o = t.getInput(), s =
|
|
1124
|
-
n.inputValidator ?
|
|
1125
|
-
},
|
|
1126
|
-
const o =
|
|
1127
|
-
t.disableInput(), Promise.resolve().then(() =>
|
|
1161
|
+
const o = t.getInput(), s = vs(t, n);
|
|
1162
|
+
n.inputValidator ? Bs(t, s, e) : o && !o.checkValidity() ? (t.enableButtons(), t.showValidationMessage(n.validationMessage || o.validationMessage)) : e === "deny" ? ut(t, s) : ht(t, s);
|
|
1163
|
+
}, Bs = (t, e, n) => {
|
|
1164
|
+
const o = $.innerParams.get(t);
|
|
1165
|
+
t.disableInput(), Promise.resolve().then(() => fe(o.inputValidator(e, o.validationMessage))).then((r) => {
|
|
1128
1166
|
t.enableButtons(), t.enableInput(), r ? t.showValidationMessage(r) : n === "deny" ? ut(t, e) : ht(t, e);
|
|
1129
1167
|
});
|
|
1130
1168
|
}, ut = (t, e) => {
|
|
1131
|
-
const n =
|
|
1132
|
-
n.showLoaderOnDeny && re(te()), n.preDeny ? (t.isAwaitingPromise = !0, Promise.resolve().then(() =>
|
|
1133
|
-
s === !1 ? (t.hideLoading(),
|
|
1169
|
+
const n = $.innerParams.get(t);
|
|
1170
|
+
n.showLoaderOnDeny && re(te()), n.preDeny ? (t.isAwaitingPromise = !0, Promise.resolve().then(() => fe(n.preDeny(e, n.validationMessage))).then((s) => {
|
|
1171
|
+
s === !1 ? (t.hideLoading(), ye(t)) : t.close(
|
|
1134
1172
|
/** @type SweetAlertResult */
|
|
1135
1173
|
{
|
|
1136
1174
|
isDenied: !0,
|
|
1137
1175
|
value: typeof s > "u" ? e : s
|
|
1138
1176
|
}
|
|
1139
1177
|
);
|
|
1140
|
-
}).catch((s) =>
|
|
1178
|
+
}).catch((s) => ln(t, s))) : t.close(
|
|
1141
1179
|
/** @type SweetAlertResult */
|
|
1142
1180
|
{
|
|
1143
1181
|
isDenied: !0,
|
|
1144
1182
|
value: e
|
|
1145
1183
|
}
|
|
1146
1184
|
);
|
|
1147
|
-
},
|
|
1185
|
+
}, Et = (t, e) => {
|
|
1148
1186
|
t.close(
|
|
1149
1187
|
/** @type SweetAlertResult */
|
|
1150
1188
|
{
|
|
@@ -1152,41 +1190,41 @@ const $e = (t) => {
|
|
|
1152
1190
|
value: e
|
|
1153
1191
|
}
|
|
1154
1192
|
);
|
|
1155
|
-
},
|
|
1193
|
+
}, ln = (t, e) => {
|
|
1156
1194
|
t.rejectPromise(e);
|
|
1157
1195
|
}, ht = (t, e) => {
|
|
1158
|
-
const n =
|
|
1159
|
-
n.showLoaderOnConfirm && re(), n.preConfirm ? (t.resetValidationMessage(), t.isAwaitingPromise = !0, Promise.resolve().then(() =>
|
|
1160
|
-
D(
|
|
1161
|
-
}).catch((s) =>
|
|
1196
|
+
const n = $.innerParams.get(t);
|
|
1197
|
+
n.showLoaderOnConfirm && re(), n.preConfirm ? (t.resetValidationMessage(), t.isAwaitingPromise = !0, Promise.resolve().then(() => fe(n.preConfirm(e, n.validationMessage))).then((s) => {
|
|
1198
|
+
D(Ne()) || s === !1 ? (t.hideLoading(), ye(t)) : Et(t, typeof s > "u" ? e : s);
|
|
1199
|
+
}).catch((s) => ln(t, s))) : Et(t, e);
|
|
1162
1200
|
};
|
|
1163
|
-
function
|
|
1164
|
-
const t =
|
|
1201
|
+
function Ie() {
|
|
1202
|
+
const t = $.innerParams.get(this);
|
|
1165
1203
|
if (!t)
|
|
1166
1204
|
return;
|
|
1167
|
-
const e =
|
|
1168
|
-
N(e.loader),
|
|
1205
|
+
const e = $.domCache.get(this);
|
|
1206
|
+
N(e.loader), je() ? t.icon && M(ae()) : Is(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
1207
|
}
|
|
1170
|
-
const
|
|
1208
|
+
const Is = (t) => {
|
|
1171
1209
|
const e = t.loader.getAttribute("data-button-to-replace"), n = e ? t.popup.getElementsByClassName(e) : [];
|
|
1172
1210
|
n.length ? M(
|
|
1173
1211
|
/** @type {HTMLElement} */
|
|
1174
1212
|
n[0],
|
|
1175
1213
|
"inline-block"
|
|
1176
|
-
) :
|
|
1214
|
+
) : so() && N(t.actions);
|
|
1177
1215
|
};
|
|
1178
|
-
function
|
|
1179
|
-
const t =
|
|
1180
|
-
return e ?
|
|
1216
|
+
function cn() {
|
|
1217
|
+
const t = $.innerParams.get(this), e = $.domCache.get(this);
|
|
1218
|
+
return e ? De(e.popup, t.input) : null;
|
|
1181
1219
|
}
|
|
1182
|
-
function
|
|
1183
|
-
const o =
|
|
1220
|
+
function dn(t, e, n) {
|
|
1221
|
+
const o = $.domCache.get(t);
|
|
1184
1222
|
e.forEach((s) => {
|
|
1185
1223
|
o[s].disabled = n;
|
|
1186
1224
|
});
|
|
1187
1225
|
}
|
|
1188
|
-
function
|
|
1189
|
-
const n =
|
|
1226
|
+
function un(t, e) {
|
|
1227
|
+
const n = T();
|
|
1190
1228
|
if (!(!n || !t))
|
|
1191
1229
|
if (t.type === "radio") {
|
|
1192
1230
|
const o = n.querySelectorAll(`[name="${a.radio}"]`);
|
|
@@ -1195,26 +1233,26 @@ function dn(t, e) {
|
|
|
1195
1233
|
} else
|
|
1196
1234
|
t.disabled = e;
|
|
1197
1235
|
}
|
|
1198
|
-
function un() {
|
|
1199
|
-
cn(this, ["confirmButton", "denyButton", "cancelButton"], !1);
|
|
1200
|
-
}
|
|
1201
1236
|
function hn() {
|
|
1202
|
-
|
|
1237
|
+
dn(this, ["confirmButton", "denyButton", "cancelButton"], !1);
|
|
1203
1238
|
}
|
|
1204
1239
|
function wn() {
|
|
1205
|
-
dn(this
|
|
1240
|
+
dn(this, ["confirmButton", "denyButton", "cancelButton"], !0);
|
|
1206
1241
|
}
|
|
1207
1242
|
function fn() {
|
|
1208
|
-
|
|
1243
|
+
un(this.getInput(), !1);
|
|
1209
1244
|
}
|
|
1210
|
-
function pn(
|
|
1211
|
-
|
|
1212
|
-
|
|
1245
|
+
function pn() {
|
|
1246
|
+
un(this.getInput(), !0);
|
|
1247
|
+
}
|
|
1248
|
+
function gn(t) {
|
|
1249
|
+
const e = $.domCache.get(this), n = $.innerParams.get(this);
|
|
1250
|
+
H(e.validationMessage, t), e.validationMessage.className = a["validation-message"], n.customClass && n.customClass.validationMessage && L(e.validationMessage, n.customClass.validationMessage), M(e.validationMessage);
|
|
1213
1251
|
const o = this.getInput();
|
|
1214
|
-
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby", a["validation-message"]),
|
|
1252
|
+
o && (o.setAttribute("aria-invalid", "true"), o.setAttribute("aria-describedby", a["validation-message"]), Rt(o), L(o, a.inputerror));
|
|
1215
1253
|
}
|
|
1216
|
-
function
|
|
1217
|
-
const t =
|
|
1254
|
+
function mn() {
|
|
1255
|
+
const t = $.domCache.get(this);
|
|
1218
1256
|
t.validationMessage && N(t.validationMessage);
|
|
1219
1257
|
const e = this.getInput();
|
|
1220
1258
|
e && (e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), V(e, a.inputerror));
|
|
@@ -1312,28 +1350,28 @@ const Y = {
|
|
|
1312
1350
|
didDestroy: void 0,
|
|
1313
1351
|
scrollbarPadding: !0,
|
|
1314
1352
|
topLayer: !1
|
|
1315
|
-
},
|
|
1353
|
+
}, Ps = ["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"], Ms = {
|
|
1316
1354
|
allowEnterKey: void 0
|
|
1317
|
-
},
|
|
1318
|
-
|
|
1319
|
-
},
|
|
1320
|
-
|
|
1321
|
-
},
|
|
1322
|
-
const e =
|
|
1323
|
-
e &&
|
|
1324
|
-
},
|
|
1355
|
+
}, Os = ["allowOutsideClick", "allowEnterKey", "backdrop", "draggable", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"], bn = (t) => Object.prototype.hasOwnProperty.call(Y, t), yn = (t) => Ps.indexOf(t) !== -1, vn = (t) => Ms[t], Ns = (t) => {
|
|
1356
|
+
bn(t) || z(`Unknown parameter "${t}"`);
|
|
1357
|
+
}, zs = (t) => {
|
|
1358
|
+
Os.includes(t) && z(`The parameter "${t}" is incompatible with toasts`);
|
|
1359
|
+
}, js = (t) => {
|
|
1360
|
+
const e = vn(t);
|
|
1361
|
+
e && zt(t, e);
|
|
1362
|
+
}, Cn = (t) => {
|
|
1325
1363
|
t.backdrop === !1 && t.allowOutsideClick && z('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'), t.theme && !["light", "dark", "auto", "minimal", "borderless", "bootstrap-4", "bootstrap-4-light", "bootstrap-4-dark", "bootstrap-5", "bootstrap-5-light", "bootstrap-5-dark", "material-ui", "material-ui-light", "material-ui-dark", "embed-iframe", "bulma", "bulma-light", "bulma-dark"].includes(t.theme) && z(`Invalid theme "${t.theme}"`);
|
|
1326
1364
|
for (const e in t)
|
|
1327
|
-
|
|
1365
|
+
Ns(e), t.toast && zs(e), js(e);
|
|
1328
1366
|
};
|
|
1329
|
-
function
|
|
1330
|
-
const e = j(), n =
|
|
1367
|
+
function kn(t) {
|
|
1368
|
+
const e = j(), n = T(), o = $.innerParams.get(this);
|
|
1331
1369
|
if (!n || K(n, o.hideClass.popup)) {
|
|
1332
1370
|
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
1371
|
return;
|
|
1334
1372
|
}
|
|
1335
|
-
const s =
|
|
1336
|
-
|
|
1373
|
+
const s = Ds(t), r = Object.assign({}, o, s);
|
|
1374
|
+
Cn(r), e && (e.dataset.swal2Theme = r.theme), Xt(this, r), $.innerParams.set(this, r), Object.defineProperties(this, {
|
|
1337
1375
|
params: {
|
|
1338
1376
|
value: Object.assign({}, this.params, t),
|
|
1339
1377
|
writable: !1,
|
|
@@ -1341,10 +1379,10 @@ function Cn(t) {
|
|
|
1341
1379
|
}
|
|
1342
1380
|
});
|
|
1343
1381
|
}
|
|
1344
|
-
const
|
|
1382
|
+
const Ds = (t) => {
|
|
1345
1383
|
const e = {};
|
|
1346
1384
|
return Object.keys(t).forEach((n) => {
|
|
1347
|
-
if (
|
|
1385
|
+
if (yn(n)) {
|
|
1348
1386
|
const o = (
|
|
1349
1387
|
/** @type {Record<string, any>} */
|
|
1350
1388
|
t
|
|
@@ -1354,85 +1392,85 @@ const zs = (t) => {
|
|
|
1354
1392
|
z(`Invalid parameter to update: ${n}`);
|
|
1355
1393
|
}), e;
|
|
1356
1394
|
};
|
|
1357
|
-
function
|
|
1395
|
+
function xn() {
|
|
1358
1396
|
var t;
|
|
1359
|
-
const e =
|
|
1397
|
+
const e = $.domCache.get(this), n = $.innerParams.get(this);
|
|
1360
1398
|
if (!n) {
|
|
1361
|
-
|
|
1399
|
+
An(this);
|
|
1362
1400
|
return;
|
|
1363
1401
|
}
|
|
1364
|
-
e.popup && p.swalCloseEventFinishedCallback && (p.swalCloseEventFinishedCallback(), delete p.swalCloseEventFinishedCallback), typeof n.didDestroy == "function" && n.didDestroy(), (t = p.eventEmitter) === null || t === void 0 || t.emit("didDestroy"),
|
|
1402
|
+
e.popup && p.swalCloseEventFinishedCallback && (p.swalCloseEventFinishedCallback(), delete p.swalCloseEventFinishedCallback), typeof n.didDestroy == "function" && n.didDestroy(), (t = p.eventEmitter) === null || t === void 0 || t.emit("didDestroy"), Us(this);
|
|
1365
1403
|
}
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1368
|
-
},
|
|
1369
|
-
t.isAwaitingPromise ? (
|
|
1370
|
-
},
|
|
1404
|
+
const Us = (t) => {
|
|
1405
|
+
An(t), delete t.params, delete p.keydownHandler, delete p.keydownTarget, delete p.currentInstance;
|
|
1406
|
+
}, An = (t) => {
|
|
1407
|
+
t.isAwaitingPromise ? (Ve($, t), t.isAwaitingPromise = !0) : (Ve(se, t), Ve($, 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);
|
|
1408
|
+
}, Ve = (t, e) => {
|
|
1371
1409
|
for (const n in t)
|
|
1372
1410
|
t[n].delete(e);
|
|
1373
1411
|
};
|
|
1374
|
-
var
|
|
1412
|
+
var Rs = /* @__PURE__ */ Object.freeze({
|
|
1375
1413
|
__proto__: null,
|
|
1376
|
-
_destroy:
|
|
1414
|
+
_destroy: xn,
|
|
1377
1415
|
close: W,
|
|
1378
1416
|
closeModal: W,
|
|
1379
1417
|
closePopup: W,
|
|
1380
1418
|
closeToast: W,
|
|
1381
|
-
disableButtons:
|
|
1382
|
-
disableInput:
|
|
1383
|
-
disableLoading:
|
|
1384
|
-
enableButtons:
|
|
1385
|
-
enableInput:
|
|
1386
|
-
getInput:
|
|
1387
|
-
handleAwaitingPromise:
|
|
1388
|
-
hideLoading:
|
|
1389
|
-
rejectPromise:
|
|
1390
|
-
resetValidationMessage:
|
|
1391
|
-
showValidationMessage:
|
|
1392
|
-
update:
|
|
1419
|
+
disableButtons: wn,
|
|
1420
|
+
disableInput: pn,
|
|
1421
|
+
disableLoading: Ie,
|
|
1422
|
+
enableButtons: hn,
|
|
1423
|
+
enableInput: fn,
|
|
1424
|
+
getInput: cn,
|
|
1425
|
+
handleAwaitingPromise: ye,
|
|
1426
|
+
hideLoading: Ie,
|
|
1427
|
+
rejectPromise: sn,
|
|
1428
|
+
resetValidationMessage: mn,
|
|
1429
|
+
showValidationMessage: gn,
|
|
1430
|
+
update: kn
|
|
1393
1431
|
});
|
|
1394
|
-
const
|
|
1395
|
-
t.toast ?
|
|
1396
|
-
},
|
|
1432
|
+
const Hs = (t, e, n) => {
|
|
1433
|
+
t.toast ? Vs(t, e, n) : (qs(e), Ks(e), Gs(t, e, n));
|
|
1434
|
+
}, Vs = (t, e, n) => {
|
|
1397
1435
|
e.popup.onclick = () => {
|
|
1398
|
-
t && (
|
|
1436
|
+
t && (Fs(t) || t.timer || t.input) || n(de.close);
|
|
1399
1437
|
};
|
|
1400
|
-
},
|
|
1401
|
-
let
|
|
1402
|
-
const
|
|
1438
|
+
}, Fs = (t) => !!(t.showConfirmButton || t.showDenyButton || t.showCancelButton || t.showCloseButton);
|
|
1439
|
+
let Pe = !1;
|
|
1440
|
+
const qs = (t) => {
|
|
1403
1441
|
t.popup.onmousedown = () => {
|
|
1404
1442
|
t.container.onmouseup = function(e) {
|
|
1405
1443
|
t.container.onmouseup = () => {
|
|
1406
|
-
}, e.target === t.container && (
|
|
1444
|
+
}, e.target === t.container && (Pe = !0);
|
|
1407
1445
|
};
|
|
1408
1446
|
};
|
|
1409
|
-
},
|
|
1447
|
+
}, Ks = (t) => {
|
|
1410
1448
|
t.container.onmousedown = (e) => {
|
|
1411
1449
|
e.target === t.container && e.preventDefault(), t.popup.onmouseup = function(n) {
|
|
1412
1450
|
t.popup.onmouseup = () => {
|
|
1413
|
-
}, (n.target === t.popup || n.target instanceof HTMLElement && t.popup.contains(n.target)) && (
|
|
1451
|
+
}, (n.target === t.popup || n.target instanceof HTMLElement && t.popup.contains(n.target)) && (Pe = !0);
|
|
1414
1452
|
};
|
|
1415
1453
|
};
|
|
1416
|
-
},
|
|
1454
|
+
}, Gs = (t, e, n) => {
|
|
1417
1455
|
e.container.onclick = (o) => {
|
|
1418
|
-
if (
|
|
1419
|
-
|
|
1456
|
+
if (Pe) {
|
|
1457
|
+
Pe = !1;
|
|
1420
1458
|
return;
|
|
1421
1459
|
}
|
|
1422
|
-
o.target === e.container &&
|
|
1460
|
+
o.target === e.container && Oe(t.allowOutsideClick) && n(de.backdrop);
|
|
1423
1461
|
};
|
|
1424
|
-
},
|
|
1462
|
+
}, Ws = (t) => typeof t == "object" && t !== null && "jquery" in t, Lt = (t) => t instanceof Element || Ws(t), Ys = (t) => {
|
|
1425
1463
|
const e = {};
|
|
1426
|
-
return typeof t[0] == "object" && !
|
|
1464
|
+
return typeof t[0] == "object" && !Lt(t[0]) ? Object.assign(e, t[0]) : ["title", "html", "icon"].forEach((n, o) => {
|
|
1427
1465
|
const s = t[o];
|
|
1428
|
-
typeof s == "string" ||
|
|
1466
|
+
typeof s == "string" || Lt(s) ? e[n] = s : s !== void 0 && ee(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`);
|
|
1429
1467
|
}), /** @type {SweetAlertOptions} */
|
|
1430
1468
|
e;
|
|
1431
1469
|
};
|
|
1432
|
-
function
|
|
1470
|
+
function Zs(...t) {
|
|
1433
1471
|
return new this(...t);
|
|
1434
1472
|
}
|
|
1435
|
-
function
|
|
1473
|
+
function Xs(t) {
|
|
1436
1474
|
class e extends this {
|
|
1437
1475
|
/**
|
|
1438
1476
|
* @param {any} params
|
|
@@ -1444,29 +1482,29 @@ function Ys(t) {
|
|
|
1444
1482
|
}
|
|
1445
1483
|
return e;
|
|
1446
1484
|
}
|
|
1447
|
-
const
|
|
1485
|
+
const Js = () => p.timeout && p.timeout.getTimerLeft(), En = () => {
|
|
1448
1486
|
if (p.timeout)
|
|
1449
|
-
return
|
|
1450
|
-
},
|
|
1487
|
+
return io(), p.timeout.stop();
|
|
1488
|
+
}, Ln = () => {
|
|
1451
1489
|
if (p.timeout) {
|
|
1452
1490
|
const t = p.timeout.start();
|
|
1453
1491
|
return at(t), t;
|
|
1454
1492
|
}
|
|
1455
|
-
},
|
|
1493
|
+
}, Qs = () => {
|
|
1456
1494
|
const t = p.timeout;
|
|
1457
|
-
return t && (t.running ?
|
|
1458
|
-
},
|
|
1495
|
+
return t && (t.running ? En() : Ln());
|
|
1496
|
+
}, er = (t) => {
|
|
1459
1497
|
if (p.timeout) {
|
|
1460
1498
|
const e = p.timeout.increase(t);
|
|
1461
1499
|
return at(e, !0), e;
|
|
1462
1500
|
}
|
|
1463
|
-
},
|
|
1464
|
-
let
|
|
1501
|
+
}, tr = () => !!(p.timeout && p.timeout.isRunning());
|
|
1502
|
+
let Tt = !1;
|
|
1465
1503
|
const We = {};
|
|
1466
|
-
function
|
|
1467
|
-
We[t] = this,
|
|
1504
|
+
function nr(t = "data-swal-template") {
|
|
1505
|
+
We[t] = this, Tt || (document.body.addEventListener("click", or), Tt = !0);
|
|
1468
1506
|
}
|
|
1469
|
-
const
|
|
1507
|
+
const or = (t) => {
|
|
1470
1508
|
for (let e = (
|
|
1471
1509
|
/** @type {any} */
|
|
1472
1510
|
t.target
|
|
@@ -1481,7 +1519,7 @@ const tr = (t) => {
|
|
|
1481
1519
|
}
|
|
1482
1520
|
}
|
|
1483
1521
|
};
|
|
1484
|
-
class
|
|
1522
|
+
class sr {
|
|
1485
1523
|
constructor() {
|
|
1486
1524
|
this.events = {};
|
|
1487
1525
|
}
|
|
@@ -1546,12 +1584,12 @@ class nr {
|
|
|
1546
1584
|
this.events = {};
|
|
1547
1585
|
}
|
|
1548
1586
|
}
|
|
1549
|
-
p.eventEmitter = new
|
|
1550
|
-
const
|
|
1587
|
+
p.eventEmitter = new sr();
|
|
1588
|
+
const rr = (t, e) => {
|
|
1551
1589
|
p.eventEmitter && p.eventEmitter.on(t, e);
|
|
1552
|
-
},
|
|
1590
|
+
}, ir = (t, e) => {
|
|
1553
1591
|
p.eventEmitter && p.eventEmitter.once(t, e);
|
|
1554
|
-
},
|
|
1592
|
+
}, ar = (t, e) => {
|
|
1555
1593
|
if (p.eventEmitter) {
|
|
1556
1594
|
if (!t) {
|
|
1557
1595
|
p.eventEmitter.reset();
|
|
@@ -1560,52 +1598,52 @@ const or = (t, e) => {
|
|
|
1560
1598
|
e ? p.eventEmitter.removeListener(t, e) : p.eventEmitter.removeAllListeners(t);
|
|
1561
1599
|
}
|
|
1562
1600
|
};
|
|
1563
|
-
var
|
|
1601
|
+
var lr = /* @__PURE__ */ Object.freeze({
|
|
1564
1602
|
__proto__: null,
|
|
1565
|
-
argsToParams:
|
|
1566
|
-
bindClickHandler:
|
|
1567
|
-
clickCancel:
|
|
1568
|
-
clickConfirm:
|
|
1569
|
-
clickDeny:
|
|
1603
|
+
argsToParams: Ys,
|
|
1604
|
+
bindClickHandler: nr,
|
|
1605
|
+
clickCancel: Yo,
|
|
1606
|
+
clickConfirm: Jt,
|
|
1607
|
+
clickDeny: Wo,
|
|
1570
1608
|
enableLoading: re,
|
|
1571
|
-
fire:
|
|
1572
|
-
getActions:
|
|
1573
|
-
getCancelButton:
|
|
1609
|
+
fire: Zs,
|
|
1610
|
+
getActions: ge,
|
|
1611
|
+
getCancelButton: le,
|
|
1574
1612
|
getCloseButton: ot,
|
|
1575
1613
|
getConfirmButton: q,
|
|
1576
1614
|
getContainer: j,
|
|
1577
1615
|
getDenyButton: te,
|
|
1578
1616
|
getFocusableElements: st,
|
|
1579
|
-
getFooter:
|
|
1617
|
+
getFooter: Ut,
|
|
1580
1618
|
getHtmlContainer: tt,
|
|
1581
|
-
getIcon:
|
|
1582
|
-
getIconContent:
|
|
1583
|
-
getImage:
|
|
1584
|
-
getInputLabel:
|
|
1585
|
-
getLoader:
|
|
1586
|
-
getPopup:
|
|
1619
|
+
getIcon: ae,
|
|
1620
|
+
getIconContent: Qn,
|
|
1621
|
+
getImage: Dt,
|
|
1622
|
+
getInputLabel: eo,
|
|
1623
|
+
getLoader: ce,
|
|
1624
|
+
getPopup: T,
|
|
1587
1625
|
getProgressSteps: nt,
|
|
1588
|
-
getTimerLeft:
|
|
1589
|
-
getTimerProgressBar:
|
|
1590
|
-
getTitle:
|
|
1591
|
-
getValidationMessage:
|
|
1592
|
-
increaseTimer:
|
|
1593
|
-
isDeprecatedParameter:
|
|
1594
|
-
isLoading:
|
|
1595
|
-
isTimerRunning:
|
|
1596
|
-
isUpdatableParameter:
|
|
1597
|
-
isValidParameter:
|
|
1598
|
-
isVisible:
|
|
1599
|
-
mixin:
|
|
1600
|
-
off:
|
|
1601
|
-
on:
|
|
1602
|
-
once:
|
|
1603
|
-
resumeTimer:
|
|
1626
|
+
getTimerLeft: Js,
|
|
1627
|
+
getTimerProgressBar: ze,
|
|
1628
|
+
getTitle: jt,
|
|
1629
|
+
getValidationMessage: Ne,
|
|
1630
|
+
increaseTimer: er,
|
|
1631
|
+
isDeprecatedParameter: vn,
|
|
1632
|
+
isLoading: no,
|
|
1633
|
+
isTimerRunning: tr,
|
|
1634
|
+
isUpdatableParameter: yn,
|
|
1635
|
+
isValidParameter: bn,
|
|
1636
|
+
isVisible: Go,
|
|
1637
|
+
mixin: Xs,
|
|
1638
|
+
off: ar,
|
|
1639
|
+
on: rr,
|
|
1640
|
+
once: ir,
|
|
1641
|
+
resumeTimer: Ln,
|
|
1604
1642
|
showLoading: re,
|
|
1605
|
-
stopTimer:
|
|
1606
|
-
toggleTimer:
|
|
1643
|
+
stopTimer: En,
|
|
1644
|
+
toggleTimer: Qs
|
|
1607
1645
|
});
|
|
1608
|
-
class
|
|
1646
|
+
class cr {
|
|
1609
1647
|
/**
|
|
1610
1648
|
* @param {() => void} callback
|
|
1611
1649
|
* @param {number} delay
|
|
@@ -1646,7 +1684,7 @@ class ar {
|
|
|
1646
1684
|
return this.running;
|
|
1647
1685
|
}
|
|
1648
1686
|
}
|
|
1649
|
-
const
|
|
1687
|
+
const Tn = ["swal-title", "swal-html", "swal-footer"], dr = (t) => {
|
|
1650
1688
|
const e = typeof t.template == "string" ? (
|
|
1651
1689
|
/** @type {HTMLTemplateElement} */
|
|
1652
1690
|
document.querySelector(t.template)
|
|
@@ -1654,8 +1692,8 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1654
1692
|
if (!e)
|
|
1655
1693
|
return {};
|
|
1656
1694
|
const n = e.content;
|
|
1657
|
-
return
|
|
1658
|
-
},
|
|
1695
|
+
return br(n), Object.assign(ur(n), hr(n), wr(n), fr(n), pr(n), gr(n), mr(n, Tn));
|
|
1696
|
+
}, ur = (t) => {
|
|
1659
1697
|
const e = {};
|
|
1660
1698
|
return Array.from(t.querySelectorAll("swal-param")).forEach((o) => {
|
|
1661
1699
|
Q(o, ["name", "value"]);
|
|
@@ -1671,7 +1709,7 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1671
1709
|
s
|
|
1672
1710
|
] == "object" ? e[s] = JSON.parse(r) : e[s] = r);
|
|
1673
1711
|
}), e;
|
|
1674
|
-
},
|
|
1712
|
+
}, hr = (t) => {
|
|
1675
1713
|
const e = {};
|
|
1676
1714
|
return Array.from(t.querySelectorAll("swal-function-param")).forEach((o) => {
|
|
1677
1715
|
const s = (
|
|
@@ -1680,7 +1718,7 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1680
1718
|
), r = o.getAttribute("value");
|
|
1681
1719
|
!s || !r || (e[s] = new Function(`return ${r}`)());
|
|
1682
1720
|
}), e;
|
|
1683
|
-
},
|
|
1721
|
+
}, wr = (t) => {
|
|
1684
1722
|
const e = {};
|
|
1685
1723
|
return Array.from(t.querySelectorAll("swal-button")).forEach((o) => {
|
|
1686
1724
|
Q(o, ["type", "color", "aria-label"]);
|
|
@@ -1696,13 +1734,13 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1696
1734
|
}
|
|
1697
1735
|
}
|
|
1698
1736
|
}), e;
|
|
1699
|
-
},
|
|
1737
|
+
}, fr = (t) => {
|
|
1700
1738
|
const e = {}, n = t.querySelector("swal-image");
|
|
1701
1739
|
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
|
-
},
|
|
1740
|
+
}, pr = (t) => {
|
|
1703
1741
|
const e = {}, n = t.querySelector("swal-icon");
|
|
1704
1742
|
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
|
-
},
|
|
1743
|
+
}, gr = (t) => {
|
|
1706
1744
|
const e = {}, n = t.querySelector("swal-input");
|
|
1707
1745
|
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
1746
|
const o = Array.from(t.querySelectorAll("swal-input-option"));
|
|
@@ -1711,18 +1749,18 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1711
1749
|
const r = s.getAttribute("value");
|
|
1712
1750
|
if (!r)
|
|
1713
1751
|
return;
|
|
1714
|
-
const
|
|
1715
|
-
e.inputOptions[r] =
|
|
1752
|
+
const l = s.innerHTML;
|
|
1753
|
+
e.inputOptions[r] = l;
|
|
1716
1754
|
})), e;
|
|
1717
|
-
},
|
|
1755
|
+
}, mr = (t, e) => {
|
|
1718
1756
|
const n = {};
|
|
1719
1757
|
for (const o in e) {
|
|
1720
1758
|
const s = e[o], r = t.querySelector(s);
|
|
1721
1759
|
r && (Q(r, []), n[s.replace(/^swal-/, "")] = r.innerHTML.trim());
|
|
1722
1760
|
}
|
|
1723
1761
|
return n;
|
|
1724
|
-
},
|
|
1725
|
-
const e =
|
|
1762
|
+
}, br = (t) => {
|
|
1763
|
+
const e = Tn.concat(["swal-param", "swal-function-param", "swal-button", "swal-image", "swal-icon", "swal-input", "swal-input-option"]);
|
|
1726
1764
|
Array.from(t.children).forEach((n) => {
|
|
1727
1765
|
const o = n.tagName.toLowerCase();
|
|
1728
1766
|
e.includes(o) || z(`Unrecognized element <${o}>`);
|
|
@@ -1731,33 +1769,33 @@ const Ln = ["swal-title", "swal-html", "swal-footer"], lr = (t) => {
|
|
|
1731
1769
|
Array.from(t.attributes).forEach((n) => {
|
|
1732
1770
|
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
1771
|
});
|
|
1734
|
-
}, Sn = 10,
|
|
1772
|
+
}, Sn = 10, yr = (t) => {
|
|
1735
1773
|
var e, n;
|
|
1736
|
-
const o = j(), s =
|
|
1774
|
+
const o = j(), s = T();
|
|
1737
1775
|
if (!o || !s)
|
|
1738
1776
|
return;
|
|
1739
1777
|
typeof t.willOpen == "function" && t.willOpen(s), (e = p.eventEmitter) === null || e === void 0 || e.emit("willOpen", s);
|
|
1740
|
-
const
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1743
|
-
}, Sn), rt() && (
|
|
1778
|
+
const l = window.getComputedStyle(document.body).overflowY;
|
|
1779
|
+
if (kr(o, s, t), setTimeout(() => {
|
|
1780
|
+
vr(o, s);
|
|
1781
|
+
}, Sn), rt() && (Cr(o, t.scrollbarPadding !== void 0 ? t.scrollbarPadding : !1, l), os()), !je() && !p.previousActiveElement && (p.previousActiveElement = document.activeElement), typeof t.didOpen == "function") {
|
|
1744
1782
|
const c = t.didOpen;
|
|
1745
1783
|
setTimeout(() => c(s));
|
|
1746
1784
|
}
|
|
1747
1785
|
(n = p.eventEmitter) === null || n === void 0 || n.emit("didOpen", s);
|
|
1748
|
-
},
|
|
1749
|
-
const e =
|
|
1786
|
+
}, Me = (t) => {
|
|
1787
|
+
const e = T();
|
|
1750
1788
|
if (!e || t.target !== e)
|
|
1751
1789
|
return;
|
|
1752
1790
|
const n = j();
|
|
1753
|
-
n && (e.removeEventListener("animationend",
|
|
1754
|
-
},
|
|
1755
|
-
|
|
1756
|
-
},
|
|
1757
|
-
|
|
1791
|
+
n && (e.removeEventListener("animationend", Me), e.removeEventListener("transitionend", Me), n.style.overflowY = "auto", V(n, a["no-transition"]));
|
|
1792
|
+
}, vr = (t, e) => {
|
|
1793
|
+
Vt(e) ? (t.style.overflowY = "hidden", e.addEventListener("animationend", Me), e.addEventListener("transitionend", Me)) : t.style.overflowY = "auto";
|
|
1794
|
+
}, Cr = (t, e, n) => {
|
|
1795
|
+
ss(), e && n !== "hidden" && us(n), setTimeout(() => {
|
|
1758
1796
|
t.scrollTop = 0;
|
|
1759
1797
|
});
|
|
1760
|
-
},
|
|
1798
|
+
}, kr = (t, e, n) => {
|
|
1761
1799
|
var o;
|
|
1762
1800
|
(o = n.showClass) !== null && o !== void 0 && o.backdrop && L(t, n.showClass.backdrop), n.animation ? (e.style.setProperty("opacity", "0", "important"), M(e, "grid"), setTimeout(() => {
|
|
1763
1801
|
var s;
|
|
@@ -1778,29 +1816,29 @@ var St = {
|
|
|
1778
1816
|
*/
|
|
1779
1817
|
url: (t, e) => /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t) ? Promise.resolve() : Promise.resolve(e || "Invalid URL")
|
|
1780
1818
|
};
|
|
1781
|
-
function
|
|
1819
|
+
function xr(t) {
|
|
1782
1820
|
t.inputValidator || (t.input === "email" && (t.inputValidator = St.email), t.input === "url" && (t.inputValidator = St.url));
|
|
1783
1821
|
}
|
|
1784
|
-
function
|
|
1822
|
+
function Ar(t) {
|
|
1785
1823
|
(!t.target || typeof t.target == "string" && !document.querySelector(t.target) || typeof t.target != "string" && !t.target.appendChild) && (z('Target parameter is not valid, defaulting to "body"'), t.target = "body");
|
|
1786
1824
|
}
|
|
1787
|
-
function
|
|
1788
|
-
|
|
1825
|
+
function Er(t) {
|
|
1826
|
+
xr(t), t.showLoaderOnConfirm && !t.preConfirm && z(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
1789
1827
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
1790
|
-
https://sweetalert2.github.io/#ajax-request`),
|
|
1791
|
-
`).join("<br />")),
|
|
1828
|
+
https://sweetalert2.github.io/#ajax-request`), Ar(t), typeof t.title == "string" && (t.title = t.title.split(`
|
|
1829
|
+
`).join("<br />")), po(t);
|
|
1792
1830
|
}
|
|
1793
1831
|
let F;
|
|
1794
|
-
var
|
|
1832
|
+
var Ae = /* @__PURE__ */ new WeakMap();
|
|
1795
1833
|
class P {
|
|
1796
1834
|
/**
|
|
1797
1835
|
* @param {...(SweetAlertOptions | string)} args
|
|
1798
1836
|
* @this {SweetAlert}
|
|
1799
1837
|
*/
|
|
1800
1838
|
constructor(...e) {
|
|
1801
|
-
if (
|
|
1839
|
+
if (qn(
|
|
1802
1840
|
this,
|
|
1803
|
-
|
|
1841
|
+
Ae,
|
|
1804
1842
|
/** @type {Promise<SweetAlertResult>} */
|
|
1805
1843
|
Promise.resolve({
|
|
1806
1844
|
isConfirmed: !1,
|
|
@@ -1811,73 +1849,73 @@ class P {
|
|
|
1811
1849
|
return;
|
|
1812
1850
|
F = this;
|
|
1813
1851
|
const n = Object.freeze(this.constructor.argsToParams(e));
|
|
1814
|
-
this.params = n, this.isAwaitingPromise = !1,
|
|
1852
|
+
this.params = n, this.isAwaitingPromise = !1, Kn(Ae, this, this._main(F.params));
|
|
1815
1853
|
}
|
|
1816
1854
|
/**
|
|
1817
1855
|
* @param {any} userParams
|
|
1818
1856
|
* @param {any} mixinParams
|
|
1819
1857
|
*/
|
|
1820
1858
|
_main(e, n = {}) {
|
|
1821
|
-
if (
|
|
1859
|
+
if (Cn(Object.assign({}, n, e)), p.currentInstance) {
|
|
1822
1860
|
const r = se.swalPromiseResolve.get(p.currentInstance), {
|
|
1823
|
-
isAwaitingPromise:
|
|
1861
|
+
isAwaitingPromise: l
|
|
1824
1862
|
} = p.currentInstance;
|
|
1825
|
-
p.currentInstance._destroy(),
|
|
1863
|
+
p.currentInstance._destroy(), l || r({
|
|
1826
1864
|
isDismissed: !0
|
|
1827
|
-
}), rt() &&
|
|
1865
|
+
}), rt() && tn();
|
|
1828
1866
|
}
|
|
1829
1867
|
p.currentInstance = F;
|
|
1830
|
-
const o =
|
|
1831
|
-
|
|
1832
|
-
const s =
|
|
1833
|
-
return
|
|
1868
|
+
const o = Tr(e, n);
|
|
1869
|
+
Er(o), Object.freeze(o), p.timeout && (p.timeout.stop(), delete p.timeout), clearTimeout(p.restoreFocusTimeout);
|
|
1870
|
+
const s = Sr(F);
|
|
1871
|
+
return Xt(F, o), $.innerParams.set(F, o), Lr(F, s, o);
|
|
1834
1872
|
}
|
|
1835
1873
|
// `catch` cannot be the name of a module export, so we define our thenable methods here instead
|
|
1836
1874
|
/**
|
|
1837
1875
|
* @param {any} onFulfilled
|
|
1838
1876
|
*/
|
|
1839
1877
|
then(e) {
|
|
1840
|
-
return
|
|
1878
|
+
return bt(Ae, this).then(e);
|
|
1841
1879
|
}
|
|
1842
1880
|
/**
|
|
1843
1881
|
* @param {any} onFinally
|
|
1844
1882
|
*/
|
|
1845
1883
|
finally(e) {
|
|
1846
|
-
return
|
|
1884
|
+
return bt(Ae, this).finally(e);
|
|
1847
1885
|
}
|
|
1848
1886
|
}
|
|
1849
|
-
const
|
|
1850
|
-
const r = (
|
|
1887
|
+
const Lr = (t, e, n) => new Promise((o, s) => {
|
|
1888
|
+
const r = (l) => {
|
|
1851
1889
|
t.close({
|
|
1852
1890
|
isDismissed: !0,
|
|
1853
|
-
dismiss:
|
|
1891
|
+
dismiss: l,
|
|
1854
1892
|
isConfirmed: !1,
|
|
1855
1893
|
isDenied: !1
|
|
1856
1894
|
});
|
|
1857
1895
|
};
|
|
1858
1896
|
se.swalPromiseResolve.set(t, o), se.swalPromiseReject.set(t, s), e.confirmButton.onclick = () => {
|
|
1859
|
-
Ls(t);
|
|
1860
|
-
}, e.denyButton.onclick = () => {
|
|
1861
1897
|
Ss(t);
|
|
1898
|
+
}, e.denyButton.onclick = () => {
|
|
1899
|
+
_s(t);
|
|
1862
1900
|
}, e.cancelButton.onclick = () => {
|
|
1863
|
-
|
|
1901
|
+
$s(t, r);
|
|
1864
1902
|
}, e.closeButton.onclick = () => {
|
|
1865
|
-
r(
|
|
1866
|
-
},
|
|
1903
|
+
r(de.close);
|
|
1904
|
+
}, Hs(n, e, r), Zo(p, n, r), ys(t, n), yr(n), _r(p, n, r), $r(e, n), setTimeout(() => {
|
|
1867
1905
|
e.container.scrollTop = 0;
|
|
1868
1906
|
});
|
|
1869
|
-
}),
|
|
1870
|
-
const n =
|
|
1907
|
+
}), Tr = (t, e) => {
|
|
1908
|
+
const n = dr(t), o = Object.assign({}, Y, e, n, t);
|
|
1871
1909
|
return o.showClass = Object.assign({}, Y.showClass, o.showClass), o.hideClass = Object.assign({}, Y.hideClass, o.hideClass), o.animation === !1 && (o.showClass = {
|
|
1872
1910
|
backdrop: "swal2-noanimation"
|
|
1873
1911
|
}, o.hideClass = {}), o;
|
|
1874
|
-
},
|
|
1912
|
+
}, Sr = (t) => {
|
|
1875
1913
|
const e = (
|
|
1876
1914
|
/** @type {DomCache} */
|
|
1877
1915
|
{
|
|
1878
1916
|
popup: (
|
|
1879
1917
|
/** @type {HTMLElement} */
|
|
1880
|
-
|
|
1918
|
+
T()
|
|
1881
1919
|
),
|
|
1882
1920
|
container: (
|
|
1883
1921
|
/** @type {HTMLElement} */
|
|
@@ -1885,7 +1923,7 @@ const Ar = (t, e, n) => new Promise((o, s) => {
|
|
|
1885
1923
|
),
|
|
1886
1924
|
actions: (
|
|
1887
1925
|
/** @type {HTMLElement} */
|
|
1888
|
-
|
|
1926
|
+
ge()
|
|
1889
1927
|
),
|
|
1890
1928
|
confirmButton: (
|
|
1891
1929
|
/** @type {HTMLElement} */
|
|
@@ -1897,11 +1935,11 @@ const Ar = (t, e, n) => new Promise((o, s) => {
|
|
|
1897
1935
|
),
|
|
1898
1936
|
cancelButton: (
|
|
1899
1937
|
/** @type {HTMLElement} */
|
|
1900
|
-
|
|
1938
|
+
le()
|
|
1901
1939
|
),
|
|
1902
1940
|
loader: (
|
|
1903
1941
|
/** @type {HTMLElement} */
|
|
1904
|
-
|
|
1942
|
+
ce()
|
|
1905
1943
|
),
|
|
1906
1944
|
closeButton: (
|
|
1907
1945
|
/** @type {HTMLElement} */
|
|
@@ -1909,7 +1947,7 @@ const Ar = (t, e, n) => new Promise((o, s) => {
|
|
|
1909
1947
|
),
|
|
1910
1948
|
validationMessage: (
|
|
1911
1949
|
/** @type {HTMLElement} */
|
|
1912
|
-
|
|
1950
|
+
Ne()
|
|
1913
1951
|
),
|
|
1914
1952
|
progressSteps: (
|
|
1915
1953
|
/** @type {HTMLElement} */
|
|
@@ -1917,10 +1955,10 @@ const Ar = (t, e, n) => new Promise((o, s) => {
|
|
|
1917
1955
|
)
|
|
1918
1956
|
}
|
|
1919
1957
|
);
|
|
1920
|
-
return
|
|
1921
|
-
},
|
|
1922
|
-
const o =
|
|
1923
|
-
N(o), e.timer && (t.timeout = new
|
|
1958
|
+
return $.domCache.set(t, e), e;
|
|
1959
|
+
}, _r = (t, e, n) => {
|
|
1960
|
+
const o = ze();
|
|
1961
|
+
N(o), e.timer && (t.timeout = new cr(() => {
|
|
1924
1962
|
n("timer"), delete t.timeout;
|
|
1925
1963
|
}, e.timer), e.timerProgressBar && o && (M(o), U(o, e, "timerProgressBar"), setTimeout(() => {
|
|
1926
1964
|
t.timeout && t.timeout.running && at(
|
|
@@ -1928,47 +1966,47 @@ const Ar = (t, e, n) => new Promise((o, s) => {
|
|
|
1928
1966
|
e.timer
|
|
1929
1967
|
);
|
|
1930
1968
|
})));
|
|
1931
|
-
},
|
|
1969
|
+
}, $r = (t, e) => {
|
|
1932
1970
|
if (!e.toast) {
|
|
1933
|
-
if (!
|
|
1934
|
-
|
|
1971
|
+
if (!Oe(e.allowEnterKey)) {
|
|
1972
|
+
zt("allowEnterKey"), Pr();
|
|
1935
1973
|
return;
|
|
1936
1974
|
}
|
|
1937
|
-
|
|
1975
|
+
Br(t) || Ir(t, e) || Ge(-1, 1);
|
|
1938
1976
|
}
|
|
1939
|
-
},
|
|
1977
|
+
}, Br = (t) => {
|
|
1940
1978
|
const e = Array.from(t.popup.querySelectorAll("[autofocus]"));
|
|
1941
1979
|
for (const n of e)
|
|
1942
1980
|
if (n instanceof HTMLElement && D(n))
|
|
1943
1981
|
return n.focus(), !0;
|
|
1944
1982
|
return !1;
|
|
1945
|
-
},
|
|
1983
|
+
}, Ir = (t, e) => e.focusDeny && D(t.denyButton) ? (t.denyButton.focus(), !0) : e.focusCancel && D(t.cancelButton) ? (t.cancelButton.focus(), !0) : e.focusConfirm && D(t.confirmButton) ? (t.confirmButton.focus(), !0) : !1, Pr = () => {
|
|
1946
1984
|
document.activeElement instanceof HTMLElement && typeof document.activeElement.blur == "function" && document.activeElement.blur();
|
|
1947
1985
|
};
|
|
1948
|
-
P.prototype.disableButtons =
|
|
1949
|
-
P.prototype.enableButtons =
|
|
1950
|
-
P.prototype.getInput =
|
|
1951
|
-
P.prototype.disableInput =
|
|
1952
|
-
P.prototype.enableInput =
|
|
1953
|
-
P.prototype.hideLoading =
|
|
1954
|
-
P.prototype.disableLoading =
|
|
1955
|
-
P.prototype.showValidationMessage =
|
|
1956
|
-
P.prototype.resetValidationMessage =
|
|
1986
|
+
P.prototype.disableButtons = wn;
|
|
1987
|
+
P.prototype.enableButtons = hn;
|
|
1988
|
+
P.prototype.getInput = cn;
|
|
1989
|
+
P.prototype.disableInput = pn;
|
|
1990
|
+
P.prototype.enableInput = fn;
|
|
1991
|
+
P.prototype.hideLoading = Ie;
|
|
1992
|
+
P.prototype.disableLoading = Ie;
|
|
1993
|
+
P.prototype.showValidationMessage = gn;
|
|
1994
|
+
P.prototype.resetValidationMessage = mn;
|
|
1957
1995
|
P.prototype.close = W;
|
|
1958
1996
|
P.prototype.closePopup = W;
|
|
1959
1997
|
P.prototype.closeModal = W;
|
|
1960
1998
|
P.prototype.closeToast = W;
|
|
1961
|
-
P.prototype.rejectPromise =
|
|
1962
|
-
P.prototype.update =
|
|
1963
|
-
P.prototype._destroy =
|
|
1964
|
-
Object.assign(P,
|
|
1965
|
-
Object.keys(
|
|
1999
|
+
P.prototype.rejectPromise = sn;
|
|
2000
|
+
P.prototype.update = kn;
|
|
2001
|
+
P.prototype._destroy = xn;
|
|
2002
|
+
Object.assign(P, lr);
|
|
2003
|
+
Object.keys(Rs).forEach((t) => {
|
|
1966
2004
|
P[t] = function(...e) {
|
|
1967
2005
|
if (F && F[t])
|
|
1968
2006
|
return F[t](...e);
|
|
1969
2007
|
};
|
|
1970
2008
|
});
|
|
1971
|
-
P.DismissReason =
|
|
2009
|
+
P.DismissReason = de;
|
|
1972
2010
|
P.version = "11.26.18";
|
|
1973
2011
|
const O = P;
|
|
1974
2012
|
O.default = O;
|
|
@@ -1982,7 +2020,7 @@ typeof document < "u" && (function(t, e) {
|
|
|
1982
2020
|
}
|
|
1983
2021
|
})(document, ':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}');
|
|
1984
2022
|
Xe.create();
|
|
1985
|
-
class
|
|
2023
|
+
class Mr {
|
|
1986
2024
|
constructor() {
|
|
1987
2025
|
this.isActive = !1, this.baseUrl = "", this.appCode = "", this.token = "", this.currentLocale = "zh-CN", this.languages = [], this.wrappedElements = /* @__PURE__ */ new Set(), this.clickHandler = this.handleElementClick.bind(this);
|
|
1988
2026
|
}
|
|
@@ -1990,14 +2028,14 @@ class Ir {
|
|
|
1990
2028
|
* 初始化配置
|
|
1991
2029
|
*/
|
|
1992
2030
|
async initConfig() {
|
|
1993
|
-
const e =
|
|
1994
|
-
this.baseUrl = n === "local" ? "" : n === "dev" ? "https://test.ihotel.cn" : "https://trans.ihotel.cn", console.log("baseUrl:", this.baseUrl), this.appCode = e.appCode || "", this.unitCode = e.unitCode || "GREENCLOUD", this.token = e.token || (
|
|
2031
|
+
const e = x.get("I18N_CONFIG") || {}, n = e.env || "local";
|
|
2032
|
+
this.baseUrl = n === "local" ? "" : n === "dev" ? "https://test.ihotel.cn" : "https://trans.ihotel.cn", console.log("baseUrl:", this.baseUrl), this.appCode = e.appCode || "", this.unitCode = e.unitCode || "GREENCLOUD", this.token = e.token || (x.get("I18N_CONFIG") || {}).token || "", this.currentLocale = e.locale || x.get("I18N_LANGUAGE") || "zh-CN", await this.loadLanguages();
|
|
1995
2033
|
}
|
|
1996
2034
|
/**
|
|
1997
2035
|
* 加载语言列表
|
|
1998
2036
|
*/
|
|
1999
2037
|
async loadLanguages() {
|
|
2000
|
-
const e =
|
|
2038
|
+
const e = x.get("I18N_LANGUAGES");
|
|
2001
2039
|
if (e && Array.isArray(e) && e.length > 0) {
|
|
2002
2040
|
this.languages = e;
|
|
2003
2041
|
return;
|
|
@@ -2007,17 +2045,17 @@ class Ir {
|
|
|
2007
2045
|
return;
|
|
2008
2046
|
}
|
|
2009
2047
|
try {
|
|
2010
|
-
const n = await
|
|
2048
|
+
const n = await jn({
|
|
2011
2049
|
baseUrl: this.baseUrl,
|
|
2012
2050
|
appCode: this.appCode,
|
|
2013
2051
|
token: this.token
|
|
2014
2052
|
});
|
|
2015
2053
|
if (n.data && n.data.result === 0) {
|
|
2016
|
-
const o =
|
|
2054
|
+
const o = A.get(n.data, "retVal", []);
|
|
2017
2055
|
this.languages = o.map((s) => ({
|
|
2018
2056
|
langCode: s.language || s.langCode || s,
|
|
2019
2057
|
langName: s.langName || s.language || s
|
|
2020
|
-
})),
|
|
2058
|
+
})), x.set("I18N_LANGUAGES", this.languages);
|
|
2021
2059
|
}
|
|
2022
2060
|
} catch (n) {
|
|
2023
2061
|
console.error("获取语言列表失败:", n), this.languages = [];
|
|
@@ -2069,9 +2107,9 @@ class Ir {
|
|
|
2069
2107
|
for (; s = n.nextNode(); )
|
|
2070
2108
|
o.push(s);
|
|
2071
2109
|
o.forEach((r) => {
|
|
2072
|
-
const
|
|
2073
|
-
if (!
|
|
2074
|
-
const c = this.findKeyByValue(
|
|
2110
|
+
const l = r.textContent;
|
|
2111
|
+
if (!l || !l.trim()) return;
|
|
2112
|
+
const c = this.findKeyByValue(l.trim());
|
|
2075
2113
|
c ? this.wrapTextNode(r, c) : this.wrapPartialTextNode(r);
|
|
2076
2114
|
});
|
|
2077
2115
|
}
|
|
@@ -2102,17 +2140,17 @@ class Ir {
|
|
|
2102
2140
|
if (!o || o.tagName === "SCRIPT" || o.tagName === "STYLE" || o.tagName === "IFRAME" || o.classList.contains("i18n-editable-text") || o.classList.contains("i18n-text-overlay") || o.closest(".swal2-container"))
|
|
2103
2141
|
return;
|
|
2104
2142
|
const s = e.textContent, r = document.createDocumentFragment();
|
|
2105
|
-
let
|
|
2143
|
+
let l = 0;
|
|
2106
2144
|
if (n.forEach((c) => {
|
|
2107
|
-
const { translatedValue: i, key:
|
|
2108
|
-
if (u >
|
|
2109
|
-
const w = s.substring(
|
|
2145
|
+
const { translatedValue: i, key: d, index: u } = c;
|
|
2146
|
+
if (u > l) {
|
|
2147
|
+
const w = s.substring(l, u);
|
|
2110
2148
|
r.appendChild(document.createTextNode(w));
|
|
2111
2149
|
}
|
|
2112
2150
|
const h = document.createElement("span");
|
|
2113
|
-
h.className = "i18n-editable-text i18n-text-overlay", h.setAttribute("data-i18n-key",
|
|
2114
|
-
}),
|
|
2115
|
-
const c = s.substring(
|
|
2151
|
+
h.className = "i18n-editable-text i18n-text-overlay", h.setAttribute("data-i18n-key", d), h.textContent = i, r.appendChild(h), this.wrappedElements.add(h), l = u + i.length;
|
|
2152
|
+
}), l < s.length) {
|
|
2153
|
+
const c = s.substring(l);
|
|
2116
2154
|
r.appendChild(document.createTextNode(c));
|
|
2117
2155
|
}
|
|
2118
2156
|
o.replaceChild(r, e);
|
|
@@ -2125,13 +2163,13 @@ class Ir {
|
|
|
2125
2163
|
if (!e) return null;
|
|
2126
2164
|
if (globalThis.__I18N_KEY_VALUE_MAP__ && globalThis.__I18N_KEY_VALUE_MAP__[e])
|
|
2127
2165
|
return globalThis.__I18N_KEY_VALUE_MAP__[e];
|
|
2128
|
-
const s = `I18N_MESSAGES_COMMON_${(
|
|
2129
|
-
for (const [i,
|
|
2130
|
-
if (
|
|
2166
|
+
const s = `I18N_MESSAGES_COMMON_${(x.get("I18N_CONFIG") || {}).locale || "zh-CN"}`, r = x.get(s) || {};
|
|
2167
|
+
for (const [i, d] of Object.entries(r))
|
|
2168
|
+
if (d === e)
|
|
2131
2169
|
return i;
|
|
2132
|
-
const
|
|
2133
|
-
for (const [i,
|
|
2134
|
-
if (
|
|
2170
|
+
const l = `I18N_MESSAGES_${this.currentLocale}`, c = x.get(l) || {};
|
|
2171
|
+
for (const [i, d] of Object.entries(c))
|
|
2172
|
+
if (d === e)
|
|
2135
2173
|
return i;
|
|
2136
2174
|
return null;
|
|
2137
2175
|
}
|
|
@@ -2208,12 +2246,12 @@ class Ir {
|
|
|
2208
2246
|
type="text"
|
|
2209
2247
|
class="i18n-edit-input"
|
|
2210
2248
|
data-lang="${c.langCode}"
|
|
2211
|
-
value="${this.escapeHtml(
|
|
2249
|
+
value="${this.escapeHtml(A.get(o, c.langCode) || "")}"
|
|
2212
2250
|
placeholder="请输入${c.langName}翻译"
|
|
2213
2251
|
/>
|
|
2214
2252
|
</div>
|
|
2215
2253
|
`
|
|
2216
|
-
).join(""), { value: r, isConfirmed:
|
|
2254
|
+
).join(""), { value: r, isConfirmed: l } = await O.fire({
|
|
2217
2255
|
title: `原值参考:${o["zh-CN_raw"]}`,
|
|
2218
2256
|
html: `
|
|
2219
2257
|
<div class="i18n-edit-form">
|
|
@@ -2236,16 +2274,16 @@ class Ir {
|
|
|
2236
2274
|
c.forEach((u) => {
|
|
2237
2275
|
i[u.getAttribute("data-lang")] = u.value;
|
|
2238
2276
|
});
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2277
|
+
const d = document.getElementById("i18n-save-error");
|
|
2278
|
+
d && (d.style.display = "none", d.textContent = "");
|
|
2241
2279
|
try {
|
|
2242
2280
|
return await this.saveTranslations(e, i, n), i;
|
|
2243
2281
|
} catch (u) {
|
|
2244
|
-
return
|
|
2282
|
+
return d && (d.textContent = u.message || "保存失败,请检查网络连接或权限", d.style.display = "block"), !1;
|
|
2245
2283
|
}
|
|
2246
2284
|
}
|
|
2247
2285
|
});
|
|
2248
|
-
|
|
2286
|
+
l && r && (this.notifyLanguageUpdate(), O.fire({
|
|
2249
2287
|
text: "保存成功",
|
|
2250
2288
|
icon: "success",
|
|
2251
2289
|
timer: 1500,
|
|
@@ -2268,12 +2306,12 @@ class Ir {
|
|
|
2268
2306
|
if (!this.appCode)
|
|
2269
2307
|
return [];
|
|
2270
2308
|
try {
|
|
2271
|
-
const o = (
|
|
2309
|
+
const o = (x.get("I18N_CONFIG") || {}).routerName || "", s = await Dn({
|
|
2272
2310
|
baseUrl: this.baseUrl,
|
|
2273
2311
|
data: {
|
|
2274
2312
|
appCode: this.appCode,
|
|
2275
2313
|
commaSeparatedKeys: e,
|
|
2276
|
-
commaSeparatedLangs:
|
|
2314
|
+
commaSeparatedLangs: A.map(this.languages, "langCode").toString(),
|
|
2277
2315
|
searchBlur: "",
|
|
2278
2316
|
page: o,
|
|
2279
2317
|
pageSize: 10
|
|
@@ -2281,7 +2319,7 @@ class Ir {
|
|
|
2281
2319
|
token: this.token
|
|
2282
2320
|
});
|
|
2283
2321
|
if (s.data && s.data.result === 0)
|
|
2284
|
-
return
|
|
2322
|
+
return A.get(s.data, "retVal.datas", []);
|
|
2285
2323
|
} catch (n) {
|
|
2286
2324
|
console.error("获取翻译数据失败:", n);
|
|
2287
2325
|
}
|
|
@@ -2294,20 +2332,20 @@ class Ir {
|
|
|
2294
2332
|
var i;
|
|
2295
2333
|
const s = o[0], { page: r } = s;
|
|
2296
2334
|
console.log(n);
|
|
2297
|
-
const
|
|
2298
|
-
|
|
2299
|
-
|
|
2335
|
+
const l = [];
|
|
2336
|
+
A.map(n, (d, u) => {
|
|
2337
|
+
l.push({
|
|
2300
2338
|
appCode: this.appCode,
|
|
2301
2339
|
page: r,
|
|
2302
2340
|
key: e,
|
|
2303
2341
|
unitCode: this.unitCode,
|
|
2304
2342
|
lang: u,
|
|
2305
|
-
value:
|
|
2343
|
+
value: d,
|
|
2306
2344
|
fromAi: "F"
|
|
2307
2345
|
});
|
|
2308
2346
|
});
|
|
2309
|
-
const c = await
|
|
2310
|
-
data: { data:
|
|
2347
|
+
const c = await Un({
|
|
2348
|
+
data: { data: l, isLocal: "F" },
|
|
2311
2349
|
token: this.token,
|
|
2312
2350
|
baseUrl: this.baseUrl
|
|
2313
2351
|
});
|
|
@@ -2342,63 +2380,63 @@ class Ir {
|
|
|
2342
2380
|
});
|
|
2343
2381
|
}
|
|
2344
2382
|
}
|
|
2345
|
-
const
|
|
2346
|
-
function
|
|
2383
|
+
const Or = new Mr();
|
|
2384
|
+
function Nr(t) {
|
|
2347
2385
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2348
2386
|
}
|
|
2349
|
-
var
|
|
2350
|
-
function
|
|
2351
|
-
return
|
|
2387
|
+
var Fe = { exports: {} }, _t;
|
|
2388
|
+
function zr() {
|
|
2389
|
+
return _t || (_t = 1, (function(t) {
|
|
2352
2390
|
var e = (function() {
|
|
2353
2391
|
var n = String.fromCharCode, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", r = {};
|
|
2354
|
-
function
|
|
2392
|
+
function l(i, d) {
|
|
2355
2393
|
if (!r[i]) {
|
|
2356
2394
|
r[i] = {};
|
|
2357
2395
|
for (var u = 0; u < i.length; u++)
|
|
2358
2396
|
r[i][i.charAt(u)] = u;
|
|
2359
2397
|
}
|
|
2360
|
-
return r[i][
|
|
2398
|
+
return r[i][d];
|
|
2361
2399
|
}
|
|
2362
2400
|
var c = {
|
|
2363
2401
|
compressToBase64: function(i) {
|
|
2364
2402
|
if (i == null) return "";
|
|
2365
|
-
var
|
|
2403
|
+
var d = c._compress(i, 6, function(u) {
|
|
2366
2404
|
return o.charAt(u);
|
|
2367
2405
|
});
|
|
2368
|
-
switch (
|
|
2406
|
+
switch (d.length % 4) {
|
|
2369
2407
|
// To produce valid Base64
|
|
2370
2408
|
default:
|
|
2371
2409
|
// When could this happen ?
|
|
2372
2410
|
case 0:
|
|
2373
|
-
return
|
|
2411
|
+
return d;
|
|
2374
2412
|
case 1:
|
|
2375
|
-
return
|
|
2413
|
+
return d + "===";
|
|
2376
2414
|
case 2:
|
|
2377
|
-
return
|
|
2415
|
+
return d + "==";
|
|
2378
2416
|
case 3:
|
|
2379
|
-
return
|
|
2417
|
+
return d + "=";
|
|
2380
2418
|
}
|
|
2381
2419
|
},
|
|
2382
2420
|
decompressFromBase64: function(i) {
|
|
2383
|
-
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32, function(
|
|
2384
|
-
return
|
|
2421
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32, function(d) {
|
|
2422
|
+
return l(o, i.charAt(d));
|
|
2385
2423
|
});
|
|
2386
2424
|
},
|
|
2387
2425
|
compressToUTF16: function(i) {
|
|
2388
|
-
return i == null ? "" : c._compress(i, 15, function(
|
|
2389
|
-
return n(
|
|
2426
|
+
return i == null ? "" : c._compress(i, 15, function(d) {
|
|
2427
|
+
return n(d + 32);
|
|
2390
2428
|
}) + " ";
|
|
2391
2429
|
},
|
|
2392
2430
|
decompressFromUTF16: function(i) {
|
|
2393
|
-
return i == null ? "" : i == "" ? null : c._decompress(i.length, 16384, function(
|
|
2394
|
-
return i.charCodeAt(
|
|
2431
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 16384, function(d) {
|
|
2432
|
+
return i.charCodeAt(d) - 32;
|
|
2395
2433
|
});
|
|
2396
2434
|
},
|
|
2397
2435
|
//compress into uint8array (UCS-2 big endian format)
|
|
2398
2436
|
compressToUint8Array: function(i) {
|
|
2399
|
-
for (var
|
|
2400
|
-
var
|
|
2401
|
-
u[h * 2] =
|
|
2437
|
+
for (var d = c.compress(i), u = new Uint8Array(d.length * 2), h = 0, w = d.length; h < w; h++) {
|
|
2438
|
+
var k = d.charCodeAt(h);
|
|
2439
|
+
u[h * 2] = k >>> 8, u[h * 2 + 1] = k % 256;
|
|
2402
2440
|
}
|
|
2403
2441
|
return u;
|
|
2404
2442
|
},
|
|
@@ -2406,104 +2444,104 @@ function Or() {
|
|
|
2406
2444
|
decompressFromUint8Array: function(i) {
|
|
2407
2445
|
if (i == null)
|
|
2408
2446
|
return c.decompress(i);
|
|
2409
|
-
for (var
|
|
2410
|
-
|
|
2447
|
+
for (var d = new Array(i.length / 2), u = 0, h = d.length; u < h; u++)
|
|
2448
|
+
d[u] = i[u * 2] * 256 + i[u * 2 + 1];
|
|
2411
2449
|
var w = [];
|
|
2412
|
-
return
|
|
2413
|
-
w.push(n(
|
|
2450
|
+
return d.forEach(function(k) {
|
|
2451
|
+
w.push(n(k));
|
|
2414
2452
|
}), c.decompress(w.join(""));
|
|
2415
2453
|
},
|
|
2416
2454
|
//compress into a string that is already URI encoded
|
|
2417
2455
|
compressToEncodedURIComponent: function(i) {
|
|
2418
|
-
return i == null ? "" : c._compress(i, 6, function(
|
|
2419
|
-
return s.charAt(
|
|
2456
|
+
return i == null ? "" : c._compress(i, 6, function(d) {
|
|
2457
|
+
return s.charAt(d);
|
|
2420
2458
|
});
|
|
2421
2459
|
},
|
|
2422
2460
|
//decompress from an output of compressToEncodedURIComponent
|
|
2423
2461
|
decompressFromEncodedURIComponent: function(i) {
|
|
2424
|
-
return i == null ? "" : i == "" ? null : (i = i.replace(/ /g, "+"), c._decompress(i.length, 32, function(
|
|
2425
|
-
return
|
|
2462
|
+
return i == null ? "" : i == "" ? null : (i = i.replace(/ /g, "+"), c._decompress(i.length, 32, function(d) {
|
|
2463
|
+
return l(s, i.charAt(d));
|
|
2426
2464
|
}));
|
|
2427
2465
|
},
|
|
2428
2466
|
compress: function(i) {
|
|
2429
|
-
return c._compress(i, 16, function(
|
|
2430
|
-
return n(
|
|
2467
|
+
return c._compress(i, 16, function(d) {
|
|
2468
|
+
return n(d);
|
|
2431
2469
|
});
|
|
2432
2470
|
},
|
|
2433
|
-
_compress: function(i,
|
|
2471
|
+
_compress: function(i, d, u) {
|
|
2434
2472
|
if (i == null) return "";
|
|
2435
|
-
var h, w,
|
|
2473
|
+
var h, w, k = {}, S = {}, _ = "", B = "", E = "", g = 2, y = 3, v = 2, C = [], f = 0, m = 0, b;
|
|
2436
2474
|
for (b = 0; b < i.length; b += 1)
|
|
2437
|
-
if (
|
|
2475
|
+
if (_ = i.charAt(b), Object.prototype.hasOwnProperty.call(k, _) || (k[_] = y++, S[_] = !0), B = E + _, Object.prototype.hasOwnProperty.call(k, B))
|
|
2438
2476
|
E = B;
|
|
2439
2477
|
else {
|
|
2440
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2478
|
+
if (Object.prototype.hasOwnProperty.call(S, E)) {
|
|
2441
2479
|
if (E.charCodeAt(0) < 256) {
|
|
2442
|
-
for (h = 0; h <
|
|
2443
|
-
f = f << 1, m ==
|
|
2480
|
+
for (h = 0; h < v; h++)
|
|
2481
|
+
f = f << 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++;
|
|
2444
2482
|
for (w = E.charCodeAt(0), h = 0; h < 8; h++)
|
|
2445
|
-
f = f << 1 | w & 1, m ==
|
|
2483
|
+
f = f << 1 | w & 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = w >> 1;
|
|
2446
2484
|
} else {
|
|
2447
|
-
for (w = 1, h = 0; h <
|
|
2448
|
-
f = f << 1 | w, m ==
|
|
2485
|
+
for (w = 1, h = 0; h < v; h++)
|
|
2486
|
+
f = f << 1 | w, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = 0;
|
|
2449
2487
|
for (w = E.charCodeAt(0), h = 0; h < 16; h++)
|
|
2450
|
-
f = f << 1 | w & 1, m ==
|
|
2488
|
+
f = f << 1 | w & 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = w >> 1;
|
|
2451
2489
|
}
|
|
2452
|
-
g--, g == 0 && (g = Math.pow(2,
|
|
2490
|
+
g--, g == 0 && (g = Math.pow(2, v), v++), delete S[E];
|
|
2453
2491
|
} else
|
|
2454
|
-
for (w =
|
|
2455
|
-
f = f << 1 | w & 1, m ==
|
|
2456
|
-
g--, g == 0 && (g = Math.pow(2,
|
|
2492
|
+
for (w = k[E], h = 0; h < v; h++)
|
|
2493
|
+
f = f << 1 | w & 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = w >> 1;
|
|
2494
|
+
g--, g == 0 && (g = Math.pow(2, v), v++), k[B] = y++, E = String(_);
|
|
2457
2495
|
}
|
|
2458
2496
|
if (E !== "") {
|
|
2459
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2497
|
+
if (Object.prototype.hasOwnProperty.call(S, E)) {
|
|
2460
2498
|
if (E.charCodeAt(0) < 256) {
|
|
2461
|
-
for (h = 0; h <
|
|
2462
|
-
f = f << 1, m ==
|
|
2499
|
+
for (h = 0; h < v; h++)
|
|
2500
|
+
f = f << 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++;
|
|
2463
2501
|
for (w = E.charCodeAt(0), h = 0; h < 8; h++)
|
|
2464
|
-
f = f << 1 | w & 1, m ==
|
|
2502
|
+
f = f << 1 | w & 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = w >> 1;
|
|
2465
2503
|
} else {
|
|
2466
|
-
for (w = 1, h = 0; h <
|
|
2467
|
-
f = f << 1 | w, m ==
|
|
2504
|
+
for (w = 1, h = 0; h < v; h++)
|
|
2505
|
+
f = f << 1 | w, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = 0;
|
|
2468
2506
|
for (w = E.charCodeAt(0), h = 0; h < 16; h++)
|
|
2469
|
-
f = f << 1 | w & 1, m ==
|
|
2507
|
+
f = f << 1 | w & 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = w >> 1;
|
|
2470
2508
|
}
|
|
2471
|
-
g--, g == 0 && (g = Math.pow(2,
|
|
2509
|
+
g--, g == 0 && (g = Math.pow(2, v), v++), delete S[E];
|
|
2472
2510
|
} else
|
|
2473
|
-
for (w =
|
|
2474
|
-
f = f << 1 | w & 1, m ==
|
|
2475
|
-
g--, g == 0 && (g = Math.pow(2,
|
|
2511
|
+
for (w = k[E], h = 0; h < v; h++)
|
|
2512
|
+
f = f << 1 | w & 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = w >> 1;
|
|
2513
|
+
g--, g == 0 && (g = Math.pow(2, v), v++);
|
|
2476
2514
|
}
|
|
2477
|
-
for (w = 2, h = 0; h <
|
|
2478
|
-
f = f << 1 | w & 1, m ==
|
|
2515
|
+
for (w = 2, h = 0; h < v; h++)
|
|
2516
|
+
f = f << 1 | w & 1, m == d - 1 ? (m = 0, C.push(u(f)), f = 0) : m++, w = w >> 1;
|
|
2479
2517
|
for (; ; )
|
|
2480
|
-
if (f = f << 1, m ==
|
|
2518
|
+
if (f = f << 1, m == d - 1) {
|
|
2481
2519
|
C.push(u(f));
|
|
2482
2520
|
break;
|
|
2483
2521
|
} else m++;
|
|
2484
2522
|
return C.join("");
|
|
2485
2523
|
},
|
|
2486
2524
|
decompress: function(i) {
|
|
2487
|
-
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32768, function(
|
|
2488
|
-
return i.charCodeAt(
|
|
2525
|
+
return i == null ? "" : i == "" ? null : c._decompress(i.length, 32768, function(d) {
|
|
2526
|
+
return i.charCodeAt(d);
|
|
2489
2527
|
});
|
|
2490
2528
|
},
|
|
2491
|
-
_decompress: function(i,
|
|
2492
|
-
var h = [], w = 4,
|
|
2529
|
+
_decompress: function(i, d, u) {
|
|
2530
|
+
var h = [], w = 4, k = 4, S = 3, _ = "", B = [], E, g, y, v, C, f, m, b = { val: u(0), position: d, index: 1 };
|
|
2493
2531
|
for (E = 0; E < 3; E += 1)
|
|
2494
2532
|
h[E] = E;
|
|
2495
|
-
for (
|
|
2496
|
-
|
|
2497
|
-
switch (
|
|
2533
|
+
for (y = 0, C = Math.pow(2, 2), f = 1; f != C; )
|
|
2534
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2535
|
+
switch (y) {
|
|
2498
2536
|
case 0:
|
|
2499
|
-
for (
|
|
2500
|
-
|
|
2501
|
-
m = n(
|
|
2537
|
+
for (y = 0, C = Math.pow(2, 8), f = 1; f != C; )
|
|
2538
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2539
|
+
m = n(y);
|
|
2502
2540
|
break;
|
|
2503
2541
|
case 1:
|
|
2504
|
-
for (
|
|
2505
|
-
|
|
2506
|
-
m = n(
|
|
2542
|
+
for (y = 0, C = Math.pow(2, 16), f = 1; f != C; )
|
|
2543
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2544
|
+
m = n(y);
|
|
2507
2545
|
break;
|
|
2508
2546
|
case 2:
|
|
2509
2547
|
return "";
|
|
@@ -2511,29 +2549,29 @@ function Or() {
|
|
|
2511
2549
|
for (h[3] = m, g = m, B.push(m); ; ) {
|
|
2512
2550
|
if (b.index > i)
|
|
2513
2551
|
return "";
|
|
2514
|
-
for (
|
|
2515
|
-
|
|
2516
|
-
switch (m =
|
|
2552
|
+
for (y = 0, C = Math.pow(2, S), f = 1; f != C; )
|
|
2553
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2554
|
+
switch (m = y) {
|
|
2517
2555
|
case 0:
|
|
2518
|
-
for (
|
|
2519
|
-
|
|
2520
|
-
h[
|
|
2556
|
+
for (y = 0, C = Math.pow(2, 8), f = 1; f != C; )
|
|
2557
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2558
|
+
h[k++] = n(y), m = k - 1, w--;
|
|
2521
2559
|
break;
|
|
2522
2560
|
case 1:
|
|
2523
|
-
for (
|
|
2524
|
-
|
|
2525
|
-
h[
|
|
2561
|
+
for (y = 0, C = Math.pow(2, 16), f = 1; f != C; )
|
|
2562
|
+
v = b.val & b.position, b.position >>= 1, b.position == 0 && (b.position = d, b.val = u(b.index++)), y |= (v > 0 ? 1 : 0) * f, f <<= 1;
|
|
2563
|
+
h[k++] = n(y), m = k - 1, w--;
|
|
2526
2564
|
break;
|
|
2527
2565
|
case 2:
|
|
2528
2566
|
return B.join("");
|
|
2529
2567
|
}
|
|
2530
|
-
if (w == 0 && (w = Math.pow(2,
|
|
2531
|
-
|
|
2532
|
-
else if (m ===
|
|
2533
|
-
|
|
2568
|
+
if (w == 0 && (w = Math.pow(2, S), S++), h[m])
|
|
2569
|
+
_ = h[m];
|
|
2570
|
+
else if (m === k)
|
|
2571
|
+
_ = g + g.charAt(0);
|
|
2534
2572
|
else
|
|
2535
2573
|
return null;
|
|
2536
|
-
B.push(
|
|
2574
|
+
B.push(_), h[k++] = g + _.charAt(0), w--, g = _, w == 0 && (w = Math.pow(2, S), S++);
|
|
2537
2575
|
}
|
|
2538
2576
|
}
|
|
2539
2577
|
};
|
|
@@ -2542,10 +2580,10 @@ function Or() {
|
|
|
2542
2580
|
t != null ? t.exports = e : typeof angular < "u" && angular != null && angular.module("LZString", []).factory("LZString", function() {
|
|
2543
2581
|
return e;
|
|
2544
2582
|
});
|
|
2545
|
-
})(
|
|
2583
|
+
})(Fe)), Fe.exports;
|
|
2546
2584
|
}
|
|
2547
|
-
var
|
|
2548
|
-
const
|
|
2585
|
+
var jr = zr();
|
|
2586
|
+
const Ee = /* @__PURE__ */ Nr(jr);
|
|
2549
2587
|
function Ye(t) {
|
|
2550
2588
|
const e = [], n = /(?:\$t|_ctx\.\$t)\s*\(\s*(['"])([^'"]+?)\1/gs;
|
|
2551
2589
|
if (t.template) {
|
|
@@ -2579,7 +2617,7 @@ function Ye(t) {
|
|
|
2579
2617
|
}
|
|
2580
2618
|
return [...new Set(e)];
|
|
2581
2619
|
}
|
|
2582
|
-
const
|
|
2620
|
+
const $t = {
|
|
2583
2621
|
name: "Earth",
|
|
2584
2622
|
props: {
|
|
2585
2623
|
editable: {
|
|
@@ -2619,55 +2657,55 @@ const _t = {
|
|
|
2619
2657
|
},
|
|
2620
2658
|
emits: ["update:modelValue"],
|
|
2621
2659
|
setup(t, { emit: e }) {
|
|
2622
|
-
const n = ne("zh-CN"), o = ne(""), s = ne(""), r = ne([]),
|
|
2623
|
-
const g =
|
|
2624
|
-
o.value = g.appCode || "", s.value = g.token || (
|
|
2660
|
+
const n = ne("zh-CN"), o = ne(""), s = ne(""), r = ne([]), l = () => {
|
|
2661
|
+
const g = x.get("I18N_CONFIG") || {};
|
|
2662
|
+
o.value = g.appCode || "", s.value = g.token || (x.get("I18N_CONFIG") || {}).token || "", n.value = x.get("I18N_LANGUAGE") || g.locale || "zh-CN";
|
|
2625
2663
|
}, c = async () => {
|
|
2626
2664
|
if (t.languages && t.languages.length > 0) {
|
|
2627
2665
|
r.value = t.languages;
|
|
2628
2666
|
return;
|
|
2629
2667
|
}
|
|
2630
|
-
const g = await
|
|
2668
|
+
const g = await Pt({
|
|
2631
2669
|
baseUrl: t.baseUrl,
|
|
2632
2670
|
token: s.value,
|
|
2633
2671
|
appCode: o.value
|
|
2634
2672
|
});
|
|
2635
2673
|
r.value = g;
|
|
2636
|
-
}, i =
|
|
2674
|
+
}, i = Ue(() => {
|
|
2637
2675
|
const g = {};
|
|
2638
|
-
return !t.modelValue || !Array.isArray(t.modelValue) || t.modelValue.forEach((
|
|
2639
|
-
|
|
2640
|
-
g[
|
|
2676
|
+
return !t.modelValue || !Array.isArray(t.modelValue) || t.modelValue.forEach((y) => {
|
|
2677
|
+
y && typeof y == "object" && Object.keys(y).forEach((v) => {
|
|
2678
|
+
g[v] = y[v];
|
|
2641
2679
|
});
|
|
2642
2680
|
}), g;
|
|
2643
|
-
}),
|
|
2644
|
-
lang:
|
|
2645
|
-
value: i.value[
|
|
2681
|
+
}), d = Ue(() => i.value[n.value] || ""), u = Ue(() => Object.keys(i.value).filter((y) => y !== n.value).map((y) => ({
|
|
2682
|
+
lang: y,
|
|
2683
|
+
value: i.value[y]
|
|
2646
2684
|
}))), h = (g) => {
|
|
2647
2685
|
if (!g) return "";
|
|
2648
|
-
const
|
|
2649
|
-
return
|
|
2686
|
+
const y = document.createElement("div");
|
|
2687
|
+
return y.textContent = g, y.innerHTML;
|
|
2650
2688
|
}, w = (g) => {
|
|
2651
|
-
g.data && g.data.type === "updateLanguage" && (n.value =
|
|
2652
|
-
},
|
|
2689
|
+
g.data && g.data.type === "updateLanguage" && (n.value = x.get("I18N_LANGUAGE") || "zh-CN");
|
|
2690
|
+
}, k = () => {
|
|
2653
2691
|
if (typeof window > "u") return;
|
|
2654
|
-
const g = { type: "updateLanguage" },
|
|
2692
|
+
const g = { type: "updateLanguage" }, y = window.location.origin, v = [window];
|
|
2655
2693
|
try {
|
|
2656
|
-
window.parent && window.parent !== window &&
|
|
2694
|
+
window.parent && window.parent !== window && v.push(window.parent);
|
|
2657
2695
|
} catch {
|
|
2658
2696
|
}
|
|
2659
2697
|
try {
|
|
2660
|
-
window.top && window.top !== window && window.top !== window.parent &&
|
|
2698
|
+
window.top && window.top !== window && window.top !== window.parent && v.push(window.top);
|
|
2661
2699
|
} catch {
|
|
2662
2700
|
}
|
|
2663
|
-
Array.from(new Set(
|
|
2664
|
-
C.postMessage(g,
|
|
2701
|
+
Array.from(new Set(v)).forEach((C) => {
|
|
2702
|
+
C.postMessage(g, y);
|
|
2665
2703
|
});
|
|
2666
|
-
},
|
|
2704
|
+
}, S = () => {
|
|
2667
2705
|
window.addEventListener("storage", (g) => {
|
|
2668
2706
|
g.key === "I18N_LANGUAGE" && (n.value = g.newValue || "zh-CN");
|
|
2669
2707
|
});
|
|
2670
|
-
},
|
|
2708
|
+
}, _ = async () => {
|
|
2671
2709
|
r.value.length === 0 && await c();
|
|
2672
2710
|
const g = r.value.map(
|
|
2673
2711
|
(C) => `
|
|
@@ -2682,7 +2720,7 @@ const _t = {
|
|
|
2682
2720
|
/>
|
|
2683
2721
|
</div>
|
|
2684
2722
|
`
|
|
2685
|
-
).join(""), { value:
|
|
2723
|
+
).join(""), { value: y, isConfirmed: v } = await O.fire({
|
|
2686
2724
|
title: "编辑多语言",
|
|
2687
2725
|
html: `
|
|
2688
2726
|
<div class="i18n-edit-form">
|
|
@@ -2715,11 +2753,11 @@ const _t = {
|
|
|
2715
2753
|
return f;
|
|
2716
2754
|
}
|
|
2717
2755
|
});
|
|
2718
|
-
if (
|
|
2719
|
-
const C = Object.keys(
|
|
2720
|
-
[f]:
|
|
2756
|
+
if (v && y) {
|
|
2757
|
+
const C = Object.keys(y).map((f) => ({
|
|
2758
|
+
[f]: y[f]
|
|
2721
2759
|
}));
|
|
2722
|
-
e("update:modelValue", C),
|
|
2760
|
+
e("update:modelValue", C), k(), O.fire({
|
|
2723
2761
|
text: "保存成功",
|
|
2724
2762
|
icon: "success",
|
|
2725
2763
|
timer: 1500,
|
|
@@ -2737,11 +2775,11 @@ const _t = {
|
|
|
2737
2775
|
});
|
|
2738
2776
|
return;
|
|
2739
2777
|
}
|
|
2740
|
-
const
|
|
2741
|
-
(
|
|
2778
|
+
const y = g.map(
|
|
2779
|
+
(v) => `
|
|
2742
2780
|
<div class="i18n-lang-item">
|
|
2743
|
-
<span class="i18n-lang-code">${
|
|
2744
|
-
<span class="i18n-lang-value">${
|
|
2781
|
+
<span class="i18n-lang-code">${v.lang}:</span>
|
|
2782
|
+
<span class="i18n-lang-value">${v.value || "-"}</span>
|
|
2745
2783
|
</div>
|
|
2746
2784
|
`
|
|
2747
2785
|
).join("");
|
|
@@ -2751,11 +2789,11 @@ const _t = {
|
|
|
2751
2789
|
<div class="i18n-modal-content">
|
|
2752
2790
|
<div class="i18n-current-lang">
|
|
2753
2791
|
<strong>当前语言 (${n.value}):</strong>
|
|
2754
|
-
<span>${
|
|
2792
|
+
<span>${d.value || "-"}</span>
|
|
2755
2793
|
</div>
|
|
2756
2794
|
<div class="i18n-other-langs">
|
|
2757
2795
|
<strong>其他语言:</strong>
|
|
2758
|
-
${
|
|
2796
|
+
${y}
|
|
2759
2797
|
</div>
|
|
2760
2798
|
</div>
|
|
2761
2799
|
`,
|
|
@@ -2770,19 +2808,19 @@ const _t = {
|
|
|
2770
2808
|
}
|
|
2771
2809
|
});
|
|
2772
2810
|
}, E = () => {
|
|
2773
|
-
t.request && typeof t.request == "function" ?
|
|
2811
|
+
t.request && typeof t.request == "function" ? _() : B();
|
|
2774
2812
|
};
|
|
2775
|
-
return
|
|
2776
|
-
|
|
2813
|
+
return Pn(() => {
|
|
2814
|
+
l(), c(), window.addEventListener("message", w), S();
|
|
2777
2815
|
}), {
|
|
2778
|
-
currentValue:
|
|
2816
|
+
currentValue: d,
|
|
2779
2817
|
openModal: E
|
|
2780
2818
|
};
|
|
2781
2819
|
},
|
|
2782
2820
|
render() {
|
|
2783
2821
|
const { editable: t, width: e, className: n } = this, o = e !== null ? { width: e + "px" } : {}, s = n ? `earth ${n}` : "earth";
|
|
2784
|
-
return
|
|
2785
|
-
|
|
2822
|
+
return ve("div", { class: s }, [
|
|
2823
|
+
ve("input", {
|
|
2786
2824
|
class: "input",
|
|
2787
2825
|
type: "text",
|
|
2788
2826
|
value: this.currentValue,
|
|
@@ -2791,7 +2829,7 @@ const _t = {
|
|
|
2791
2829
|
placeholder: "",
|
|
2792
2830
|
style: o
|
|
2793
2831
|
}),
|
|
2794
|
-
|
|
2832
|
+
ve(
|
|
2795
2833
|
"svg",
|
|
2796
2834
|
{
|
|
2797
2835
|
class: "icon earth-icon",
|
|
@@ -2802,7 +2840,7 @@ const _t = {
|
|
|
2802
2840
|
onClick: this.openModal
|
|
2803
2841
|
},
|
|
2804
2842
|
[
|
|
2805
|
-
|
|
2843
|
+
ve("path", {
|
|
2806
2844
|
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
2845
|
})
|
|
2808
2846
|
]
|
|
@@ -2810,7 +2848,7 @@ const _t = {
|
|
|
2810
2848
|
]);
|
|
2811
2849
|
}
|
|
2812
2850
|
};
|
|
2813
|
-
function
|
|
2851
|
+
function we(t) {
|
|
2814
2852
|
if (!t || typeof t != "string") return t;
|
|
2815
2853
|
const e = t.toLowerCase();
|
|
2816
2854
|
return {
|
|
@@ -2821,29 +2859,29 @@ function ue(t) {
|
|
|
2821
2859
|
"en-us": "en-US"
|
|
2822
2860
|
}[e] || t;
|
|
2823
2861
|
}
|
|
2824
|
-
function
|
|
2862
|
+
function _n(t = {}) {
|
|
2825
2863
|
const e = Object.entries(t || {});
|
|
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(([
|
|
2827
|
-
const i =
|
|
2864
|
+
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(([l, c]) => {
|
|
2865
|
+
const i = we(l);
|
|
2828
2866
|
o[i] = o[i] || {}, o[i][s] = c;
|
|
2829
|
-
}), o), {}) : e.reduce((o, [s, r]) => (o[
|
|
2867
|
+
}), o), {}) : e.reduce((o, [s, r]) => (o[we(s)] = r, o), {});
|
|
2830
2868
|
}
|
|
2831
|
-
function
|
|
2832
|
-
return t[e] || t[
|
|
2869
|
+
function Bt(t, e) {
|
|
2870
|
+
return t[e] || t[we(e)] || t[String(e || "").toLowerCase()] || {};
|
|
2833
2871
|
}
|
|
2834
|
-
function
|
|
2872
|
+
function he(t, e) {
|
|
2835
2873
|
if (typeof t != "string" || !e || typeof e != "object" || Array.isArray(e))
|
|
2836
2874
|
return t;
|
|
2837
2875
|
const n = Object.entries(e);
|
|
2838
2876
|
return t.replace(/\\?\$\{\s*([^}]+?)\s*\}/g, (o, s) => {
|
|
2839
|
-
const r = String(s || "").trim(),
|
|
2840
|
-
if (!
|
|
2877
|
+
const r = String(s || "").trim(), l = n.find(([i]) => i === r || r === "this." + i || r === "_vm." + i || r === "_ctx." + i || r === "$setup." + i || i === r.replace(/^(?:this|_vm|_ctx|\$setup)\./, ""));
|
|
2878
|
+
if (!l)
|
|
2841
2879
|
return o;
|
|
2842
|
-
const c =
|
|
2880
|
+
const c = l[1];
|
|
2843
2881
|
return c != null ? String(c) : o;
|
|
2844
2882
|
});
|
|
2845
2883
|
}
|
|
2846
|
-
function
|
|
2884
|
+
function $n(t, e) {
|
|
2847
2885
|
return e === void 0 && t && typeof t == "object" && !Array.isArray(t) ? {
|
|
2848
2886
|
defaultValue: void 0,
|
|
2849
2887
|
values: t
|
|
@@ -2852,11 +2890,11 @@ function _n(t, e) {
|
|
|
2852
2890
|
values: e
|
|
2853
2891
|
};
|
|
2854
2892
|
}
|
|
2855
|
-
function
|
|
2856
|
-
const { locale: e = "zh-CN", messages: n = {} } = t, o =
|
|
2893
|
+
function Dr(t) {
|
|
2894
|
+
const { locale: e = "zh-CN", messages: n = {} } = t, o = _n(n), s = ne(e), r = ne(0), l = wt(), c = Ze() && l && typeof l.observable == "function" ? l.observable({
|
|
2857
2895
|
locale: e,
|
|
2858
2896
|
messageVersion: 0
|
|
2859
|
-
}) : null, i = () => c ? c.locale : s.value,
|
|
2897
|
+
}) : null, i = () => c ? c.locale : s.value, d = (w) => {
|
|
2860
2898
|
s.value = w, c && (c.locale = w);
|
|
2861
2899
|
}, u = () => {
|
|
2862
2900
|
r.value += 1, c && (c.messageVersion += 1);
|
|
@@ -2867,48 +2905,75 @@ function zr(t) {
|
|
|
2867
2905
|
return i();
|
|
2868
2906
|
},
|
|
2869
2907
|
set value(w) {
|
|
2870
|
-
|
|
2908
|
+
d(w);
|
|
2871
2909
|
}
|
|
2872
2910
|
},
|
|
2873
2911
|
// 翻译函数(支持嵌套 key 的点号访问)
|
|
2874
|
-
t(w,
|
|
2875
|
-
const
|
|
2876
|
-
|
|
2912
|
+
t(w, k, S) {
|
|
2913
|
+
const _ = $n(k, S);
|
|
2914
|
+
k = _.defaultValue, S = _.values, r.value, c && c.messageVersion;
|
|
2877
2915
|
const B = i();
|
|
2878
2916
|
if (B === "zh-CN" && !w.startsWith("i.") && !w.startsWith("pro."))
|
|
2879
|
-
return
|
|
2880
|
-
const E =
|
|
2917
|
+
return he(k || w, S);
|
|
2918
|
+
const E = Bt(o, B);
|
|
2881
2919
|
let g = E[w];
|
|
2882
|
-
return g === void 0 && w.includes(".") && (g = w.split(".").reduce((
|
|
2920
|
+
return g === void 0 && w.includes(".") && (g = w.split(".").reduce((v, C) => v && typeof v == "object" ? v[C] : void 0, E)), he(g && typeof g == "string" && g !== w ? g : k || w, S);
|
|
2883
2921
|
},
|
|
2884
2922
|
// 设置某个语言的所有消息
|
|
2885
|
-
setLocaleMessage(w,
|
|
2886
|
-
return o[
|
|
2923
|
+
setLocaleMessage(w, k) {
|
|
2924
|
+
return o[we(w)] = { ...k }, u(), o[we(w)];
|
|
2887
2925
|
},
|
|
2888
2926
|
// 获取某个语言的消息
|
|
2889
2927
|
getLocaleMessage(w) {
|
|
2890
|
-
return
|
|
2928
|
+
return Bt(o, w);
|
|
2891
2929
|
}
|
|
2892
2930
|
};
|
|
2893
2931
|
return h.global = h, h;
|
|
2894
2932
|
}
|
|
2895
|
-
const
|
|
2933
|
+
const Bn = Xe.create({
|
|
2896
2934
|
timeout: 8e3
|
|
2897
2935
|
});
|
|
2898
|
-
|
|
2899
|
-
const n = (
|
|
2936
|
+
Bn.interceptors.request.use((t) => {
|
|
2937
|
+
const n = (x.get("I18N_CONFIG") || {}).token;
|
|
2900
2938
|
return n && (t.headers.Authorization = `Bearer ${n}`), t;
|
|
2901
2939
|
});
|
|
2902
|
-
function
|
|
2903
|
-
const
|
|
2940
|
+
function Ur(t = {}) {
|
|
2941
|
+
const n = JSON.stringify({
|
|
2904
2942
|
alg: "HS512"
|
|
2905
2943
|
// 算法
|
|
2906
|
-
},
|
|
2907
|
-
|
|
2908
|
-
}, o = JSON.stringify(e), s = JSON.stringify(n);
|
|
2909
|
-
return Pn.JWS.sign("HS512", o, s, "");
|
|
2944
|
+
}), o = JSON.stringify(t);
|
|
2945
|
+
return Mn.JWS.sign("HS512", n, o, "");
|
|
2910
2946
|
}
|
|
2911
|
-
function
|
|
2947
|
+
function Rr(t) {
|
|
2948
|
+
if (!t || typeof t != "string") return "";
|
|
2949
|
+
const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = e.padEnd(
|
|
2950
|
+
e.length + (4 - e.length % 4) % 4,
|
|
2951
|
+
"="
|
|
2952
|
+
);
|
|
2953
|
+
try {
|
|
2954
|
+
if (typeof atob == "function")
|
|
2955
|
+
return decodeURIComponent(
|
|
2956
|
+
Array.from(atob(n), (o) => `%${o.charCodeAt(0).toString(16).padStart(2, "0")}`).join("")
|
|
2957
|
+
);
|
|
2958
|
+
} catch {
|
|
2959
|
+
}
|
|
2960
|
+
return "";
|
|
2961
|
+
}
|
|
2962
|
+
function Hr(t) {
|
|
2963
|
+
if (!t || typeof t != "string") return null;
|
|
2964
|
+
const e = t.split(".");
|
|
2965
|
+
if (e.length !== 3) return null;
|
|
2966
|
+
try {
|
|
2967
|
+
return JSON.parse(Rr(e[1]));
|
|
2968
|
+
} catch {
|
|
2969
|
+
return null;
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
function Vr(t) {
|
|
2973
|
+
const e = Hr(t);
|
|
2974
|
+
return !!(e && (e.mainAppCode && e.userCode && e.deviceType || e.appCode && e.orgCode && e.userCode && e.i18n_token));
|
|
2975
|
+
}
|
|
2976
|
+
function It(t) {
|
|
2912
2977
|
if (!t) return "";
|
|
2913
2978
|
const e = String(t);
|
|
2914
2979
|
let n = 0;
|
|
@@ -2916,12 +2981,12 @@ function Bt(t) {
|
|
|
2916
2981
|
n = (n << 5) - n + e.charCodeAt(o), n |= 0;
|
|
2917
2982
|
return `user_${Math.abs(n)}`;
|
|
2918
2983
|
}
|
|
2919
|
-
function
|
|
2984
|
+
function ue(t, ...e) {
|
|
2920
2985
|
if (typeof t == "function")
|
|
2921
2986
|
return t(...e);
|
|
2922
2987
|
}
|
|
2923
2988
|
function wt(t) {
|
|
2924
|
-
return t && (t.version || t.prototype || t.config) ? t :
|
|
2989
|
+
return t && (t.version || t.prototype || t.config) ? t : Ce && Ce.version ? Ce : Ce;
|
|
2925
2990
|
}
|
|
2926
2991
|
function Ze(t) {
|
|
2927
2992
|
if (t && t.config && t.config.globalProperties)
|
|
@@ -2929,9 +2994,9 @@ function Ze(t) {
|
|
|
2929
2994
|
const e = wt(t), n = e && e.version;
|
|
2930
2995
|
return typeof n == "string" ? n.split(".")[0] === "2" : !!(e && e.prototype);
|
|
2931
2996
|
}
|
|
2932
|
-
function
|
|
2997
|
+
function In(t, e = /* @__PURE__ */ new Set()) {
|
|
2933
2998
|
if (!t || e.has(t)) return;
|
|
2934
|
-
e.add(t), typeof t.$forceUpdate == "function" && t.$forceUpdate(), (t.$children || []).forEach((o) =>
|
|
2999
|
+
e.add(t), typeof t.$forceUpdate == "function" && t.$forceUpdate(), (t.$children || []).forEach((o) => In(o, e));
|
|
2935
3000
|
}
|
|
2936
3001
|
class X {
|
|
2937
3002
|
constructor(e = {}) {
|
|
@@ -2940,36 +3005,35 @@ class X {
|
|
|
2940
3005
|
appCode: o,
|
|
2941
3006
|
messages: s,
|
|
2942
3007
|
token: r,
|
|
2943
|
-
orgCode:
|
|
3008
|
+
orgCode: l,
|
|
2944
3009
|
loginRouteName: c,
|
|
2945
3010
|
login: i,
|
|
2946
|
-
keyboard:
|
|
3011
|
+
keyboard: d,
|
|
2947
3012
|
locale: u,
|
|
2948
3013
|
env: h,
|
|
2949
3014
|
dev: w,
|
|
2950
|
-
|
|
3015
|
+
i18nTokenRequest: k,
|
|
3016
|
+
auth: S
|
|
2951
3017
|
} = e;
|
|
2952
|
-
this.env = h || "local", this.baseUrl = h === "dev" || w === !0 ? "https://test.ihotel.cn" : !h || h === "local" ? "" : "https://trans.ihotel.cn", this.
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
A.preventDefault();
|
|
2962
|
-
const $ = Array.from(this.translationKeySet);
|
|
3018
|
+
this.env = h || "local", this.baseUrl = h === "dev" || w === !0 ? "https://test.ihotel.cn" : !h || h === "local" ? "" : "https://trans.ihotel.cn", this.i18nTokenRequest = k || null, this.baseToken = r || (x.get("I18N_CONFIG") || {}).token || x.get("token"), this.token = this.baseToken, this.auth = S || null, this.authInfo = {
|
|
3019
|
+
appCode: o,
|
|
3020
|
+
orgCode: l || "",
|
|
3021
|
+
userCode: ""
|
|
3022
|
+
}, this.tokenResolveVersion = 0, this.manualAuthScope = l || (r ? It(r) : ""), this.authUnsubscribe = null, this.authVersion = 0, this.languageVersion = 0, this.activeCacheScope = this.manualAuthScope || "guest", this.loadI18n = !0, this.appCode = o, this.router = n, this.locale = this.normalizeLocale(
|
|
3023
|
+
u || x.get("I18N_LANGUAGE") || navigator.language || "zh-CN"
|
|
3024
|
+
), this._isRTL = ke(this.locale), this.persistI18nConfig(), this.name = "", this.messages = _n(s || {}), this.translationKeys = [], this.translationKeySet = /* @__PURE__ */ new Set(), this.loginRouteName = c || "login", this.login = i, this.loginTranslationKeys = [], this.keyboard = d || "ctrl+shift+l", this.vueInstances = /* @__PURE__ */ new Set(), this.editKeyboard = e.editKeyboard || "ctrl+shift+e", this.applyAuthState(this.resolveAuthState(), { silent: !0 }), this.initI18n(e), this.router && this.initRouterGuards(), ft.bind(this.keyboard, (_) => {
|
|
3025
|
+
_.preventDefault();
|
|
3026
|
+
const B = Array.from(this.translationKeySet);
|
|
2963
3027
|
this.translationKeys = Array.from(
|
|
2964
|
-
/* @__PURE__ */ new Set([...this.translationKeys || [],
|
|
3028
|
+
/* @__PURE__ */ new Set([...this.translationKeys || [], ...B])
|
|
2965
3029
|
);
|
|
2966
|
-
const
|
|
3030
|
+
const E = {
|
|
2967
3031
|
name: this.name,
|
|
2968
3032
|
token: this.token,
|
|
2969
3033
|
appCode: this.appCode,
|
|
2970
3034
|
env: this.env,
|
|
2971
3035
|
translationKeys: this.translationKeys
|
|
2972
|
-
},
|
|
3036
|
+
}, g = this.encodeQueryParams(E), y = `${this.baseUrl}/i18n-admin-front/#/config?data=${g}`;
|
|
2973
3037
|
this.swalInstance = O.fire({
|
|
2974
3038
|
titleText: "多语言管理",
|
|
2975
3039
|
padding: "0px",
|
|
@@ -2985,10 +3049,10 @@ class X {
|
|
|
2985
3049
|
closeButton: "gc_i18n_close_button",
|
|
2986
3050
|
htmlContainer: "gc_i18n_html_container"
|
|
2987
3051
|
},
|
|
2988
|
-
html: `<iframe src="${
|
|
3052
|
+
html: `<iframe src="${y}" style="width: 100%; height: 100%;border: none;min-height: 480px;"></iframe>`
|
|
2989
3053
|
});
|
|
2990
|
-
}), ft.bind(this.editKeyboard, (
|
|
2991
|
-
|
|
3054
|
+
}), ft.bind(this.editKeyboard, (_) => {
|
|
3055
|
+
_.preventDefault(), Or.toggle();
|
|
2992
3056
|
}), this.setupLanguageChangeListener(), this.setupAuthListener(), this.setupMessageListener();
|
|
2993
3057
|
}
|
|
2994
3058
|
/**
|
|
@@ -3010,25 +3074,80 @@ class X {
|
|
|
3010
3074
|
});
|
|
3011
3075
|
}
|
|
3012
3076
|
resolveAuthState() {
|
|
3013
|
-
const e = this.auth || {}, n =
|
|
3014
|
-
o ||
|
|
3077
|
+
const e = this.auth || {}, n = ue(e.getToken) ?? "", o = ue(e.getScope) ?? ue(e.getUserScope) ?? "", s = ue(e.getOrgCode) ?? "", r = ue(e.getUserCode) ?? "", l = typeof e.isAuthenticated == "function" ? !!e.isAuthenticated() : !!n, c = l ? String(
|
|
3078
|
+
o || It(n) || this.manualAuthScope || "user"
|
|
3015
3079
|
) : "guest";
|
|
3016
3080
|
return {
|
|
3017
3081
|
token: n,
|
|
3018
|
-
scope:
|
|
3019
|
-
|
|
3082
|
+
scope: c,
|
|
3083
|
+
orgCode: s,
|
|
3084
|
+
userCode: r,
|
|
3085
|
+
isAuthenticated: l
|
|
3020
3086
|
};
|
|
3021
3087
|
}
|
|
3022
|
-
|
|
3023
|
-
const
|
|
3024
|
-
|
|
3088
|
+
normalizeAuthInfo(e = {}) {
|
|
3089
|
+
const n = {
|
|
3090
|
+
appCode: e.appCode || this.appCode,
|
|
3091
|
+
orgCode: e.orgCode || "",
|
|
3092
|
+
userCode: e.userCode || ""
|
|
3093
|
+
};
|
|
3094
|
+
return this.authInfo = n, n;
|
|
3095
|
+
}
|
|
3096
|
+
persistI18nConfig(e = {}) {
|
|
3097
|
+
x.set("I18N_CONFIG", {
|
|
3098
|
+
...x.get("I18N_CONFIG") || {},
|
|
3025
3099
|
baseUrl: this.baseUrl,
|
|
3026
3100
|
appCode: this.appCode,
|
|
3027
3101
|
token: this.token,
|
|
3028
3102
|
locale: this.locale,
|
|
3029
3103
|
env: this.env,
|
|
3030
|
-
cacheScope: this.activeCacheScope
|
|
3031
|
-
|
|
3104
|
+
cacheScope: this.activeCacheScope,
|
|
3105
|
+
...e
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
async createI18nToken(e, n = {}) {
|
|
3109
|
+
if (!e) return "";
|
|
3110
|
+
if (Vr(e))
|
|
3111
|
+
return e;
|
|
3112
|
+
const o = {
|
|
3113
|
+
appCode: n.appCode || this.appCode,
|
|
3114
|
+
orgCode: n.orgCode || "",
|
|
3115
|
+
userCode: n.userCode || ""
|
|
3116
|
+
};
|
|
3117
|
+
if (!o.orgCode || !o.userCode)
|
|
3118
|
+
return console.warn(
|
|
3119
|
+
"非 JWT token 需要通过 setToken(token, { orgCode, userCode }) 提供鉴权信息"
|
|
3120
|
+
), e;
|
|
3121
|
+
try {
|
|
3122
|
+
const s = await Rn({
|
|
3123
|
+
request: this.i18nTokenRequest,
|
|
3124
|
+
appCode: o.appCode || this.appCode,
|
|
3125
|
+
orgCode: o.orgCode,
|
|
3126
|
+
userCode: o.userCode,
|
|
3127
|
+
token: e
|
|
3128
|
+
});
|
|
3129
|
+
return s ? Ur({
|
|
3130
|
+
appCode: o.appCode || this.appCode,
|
|
3131
|
+
orgCode: o.orgCode,
|
|
3132
|
+
userCode: o.userCode,
|
|
3133
|
+
i18n_token: s
|
|
3134
|
+
}) : (console.warn("获取 i18n_token 失败,继续使用原 token"), e);
|
|
3135
|
+
} catch (s) {
|
|
3136
|
+
return console.warn("获取 i18n_token 失败,继续使用原 token", s), e;
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
resolveAndApplyI18nToken(e, n = {}, { refresh: o = !0 } = {}) {
|
|
3140
|
+
const s = ++this.tokenResolveVersion;
|
|
3141
|
+
return this.createI18nToken(e, n).then((r) => {
|
|
3142
|
+
if (s !== this.tokenResolveVersion || !r)
|
|
3143
|
+
return !1;
|
|
3144
|
+
const l = this.token !== r;
|
|
3145
|
+
return this.token = r, x.set("I18N_TOKEN", this.token), this.persistI18nConfig(), l && o ? this.refreshLanguageForCurrentAuth() : l;
|
|
3146
|
+
});
|
|
3147
|
+
}
|
|
3148
|
+
applyAuthState(e = {}, { silent: n = !1 } = {}) {
|
|
3149
|
+
const o = this.token, s = this.activeCacheScope, r = e.token ?? "", l = e.isAuthenticated ? e.scope || "user" : "guest";
|
|
3150
|
+
return this.userToken = r, this.token = e.isAuthenticated ? r || this.baseToken : this.baseToken, this.activeCacheScope = l, x.set("I18N_TOKEN", this.token), this.persistI18nConfig(), n ? !1 : o !== this.token || s !== this.activeCacheScope;
|
|
3032
3151
|
}
|
|
3033
3152
|
async refreshLanguageForCurrentAuth() {
|
|
3034
3153
|
const e = ++this.authVersion, n = this.locale, o = this.activeCacheScope || "guest";
|
|
@@ -3042,6 +3161,9 @@ class X {
|
|
|
3042
3161
|
const n = {
|
|
3043
3162
|
token: (e == null ? void 0 : e.token) ?? this.resolveAuthState().token,
|
|
3044
3163
|
scope: (e == null ? void 0 : e.scope) ?? (e == null ? void 0 : e.userScope) ?? (e == null ? void 0 : e.orgCode) ?? "",
|
|
3164
|
+
orgCode: (e == null ? void 0 : e.orgCode) ?? "",
|
|
3165
|
+
userCode: (e == null ? void 0 : e.userCode) ?? "",
|
|
3166
|
+
appCode: (e == null ? void 0 : e.appCode) ?? this.appCode,
|
|
3045
3167
|
isAuthenticated: typeof (e == null ? void 0 : e.isAuthenticated) == "boolean" ? e.isAuthenticated : !!((e == null ? void 0 : e.token) ?? this.resolveAuthState().token)
|
|
3046
3168
|
};
|
|
3047
3169
|
this.applyAuthState(n) && this.refreshLanguageForCurrentAuth();
|
|
@@ -3084,56 +3206,56 @@ class X {
|
|
|
3084
3206
|
this.router && (X._routerGuardRegistered || (X._routerGuardRegistered = !0, this.router.beforeEach(async (e, n, o) => {
|
|
3085
3207
|
var c, i;
|
|
3086
3208
|
const { language: s, token: r } = e.query;
|
|
3087
|
-
if (this.configInstance && this.configInstance.closeModal(), this.name = e.name, this.translationKeySet = /* @__PURE__ */ new Set(), r && this.setToken(r), this.loadI18n)
|
|
3209
|
+
if (this.configInstance && this.configInstance.closeModal(), this.name = e.name, this.translationKeySet = /* @__PURE__ */ new Set(), r && await this.setToken(r), this.loadI18n)
|
|
3088
3210
|
try {
|
|
3089
3211
|
await this.setLanguage(s || this.locale, {
|
|
3090
3212
|
cacheScope: this.activeCacheScope
|
|
3091
3213
|
});
|
|
3092
|
-
} catch (
|
|
3093
|
-
console.error("初始化语言失败,已跳过阻塞:",
|
|
3214
|
+
} catch (d) {
|
|
3215
|
+
console.error("初始化语言失败,已跳过阻塞:", d);
|
|
3094
3216
|
}
|
|
3095
3217
|
this.loadI18n = !1;
|
|
3096
|
-
const
|
|
3097
|
-
if (
|
|
3098
|
-
let
|
|
3099
|
-
if (typeof
|
|
3218
|
+
const l = this.router.getRoutes().find((d) => d.name === this.loginRouteName || d.path === `/${this.loginRouteName}`);
|
|
3219
|
+
if (l && l.components) {
|
|
3220
|
+
let d = (c = l.components) == null ? void 0 : c.default;
|
|
3221
|
+
if (typeof d == "function" && d.toString().includes("import("))
|
|
3100
3222
|
try {
|
|
3101
|
-
|
|
3223
|
+
d = await d(), d = d.default;
|
|
3102
3224
|
} catch (h) {
|
|
3103
3225
|
console.error("加载异步组件时出错:", h), o();
|
|
3104
3226
|
return;
|
|
3105
3227
|
}
|
|
3106
|
-
const u = Ye(
|
|
3228
|
+
const u = Ye(d);
|
|
3107
3229
|
this.loginTranslationKeys = u;
|
|
3108
3230
|
}
|
|
3109
3231
|
if (e.matched.length > 0)
|
|
3110
3232
|
try {
|
|
3111
|
-
const
|
|
3233
|
+
const d = [];
|
|
3112
3234
|
for (const u of e.matched) {
|
|
3113
3235
|
let h = (i = u.components) == null ? void 0 : i.default;
|
|
3114
3236
|
if (typeof h == "function" && h.toString().includes("import(") && (h = await h(), h = h.default), h) {
|
|
3115
3237
|
const w = Ye(h);
|
|
3116
|
-
|
|
3238
|
+
d.push(...w);
|
|
3117
3239
|
}
|
|
3118
3240
|
}
|
|
3119
|
-
this.translationKeys =
|
|
3120
|
-
} catch (
|
|
3121
|
-
console.error("加载异步组件时出错:",
|
|
3241
|
+
this.translationKeys = d;
|
|
3242
|
+
} catch (d) {
|
|
3243
|
+
console.error("加载异步组件时出错:", d), o();
|
|
3122
3244
|
return;
|
|
3123
3245
|
}
|
|
3124
3246
|
o();
|
|
3125
3247
|
}), X._afterEachGuardRegistered || (X._afterEachGuardRegistered = !0, this.router.afterEach(async () => {
|
|
3126
|
-
var r,
|
|
3248
|
+
var r, l;
|
|
3127
3249
|
await pt();
|
|
3128
3250
|
const e = Array.from(this.translationKeySet), n = Array.from(
|
|
3129
3251
|
/* @__PURE__ */ new Set([...this.translationKeys || [], ...e])
|
|
3130
3252
|
);
|
|
3131
3253
|
this.translationKeys = n;
|
|
3132
|
-
const o = (r = this.router) == null ? void 0 : r.currentRoute, s = (
|
|
3254
|
+
const o = (r = this.router) == null ? void 0 : r.currentRoute, s = (l = (o == null ? void 0 : o.value) ?? o) == null ? void 0 : l.name;
|
|
3133
3255
|
if (s === this.loginRouteName && (this.loginTranslationKeys = n), s) {
|
|
3134
3256
|
this.name = s;
|
|
3135
|
-
const c =
|
|
3136
|
-
|
|
3257
|
+
const c = x.get("I18N_CONFIG") || {};
|
|
3258
|
+
x.set("I18N_CONFIG", {
|
|
3137
3259
|
...c,
|
|
3138
3260
|
routerName: s
|
|
3139
3261
|
});
|
|
@@ -3142,33 +3264,33 @@ class X {
|
|
|
3142
3264
|
}
|
|
3143
3265
|
// 初始化 i18n 实例
|
|
3144
3266
|
initI18n(e) {
|
|
3145
|
-
this.i18n =
|
|
3267
|
+
this.i18n = Dr({
|
|
3146
3268
|
locale: this.locale,
|
|
3147
3269
|
messages: e.messages || {}
|
|
3148
3270
|
}), this.keyValueMap = {}, globalThis.__I18N_ALL_KEYS__ = /* @__PURE__ */ new Set();
|
|
3149
3271
|
const n = this;
|
|
3150
3272
|
globalThis.$t = (o, s, r) => {
|
|
3151
3273
|
var h, w;
|
|
3152
|
-
const
|
|
3153
|
-
if (s =
|
|
3154
|
-
return
|
|
3155
|
-
const i = (h = n.router) == null ? void 0 : h.currentRoute,
|
|
3274
|
+
const l = $n(s, r);
|
|
3275
|
+
if (s = l.defaultValue, r = l.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."))
|
|
3276
|
+
return he(s || o, r);
|
|
3277
|
+
const i = (h = n.router) == null ? void 0 : h.currentRoute, d = (w = (i == null ? void 0 : i.value) ?? i) == null ? void 0 : w.name;
|
|
3156
3278
|
let u;
|
|
3157
|
-
if (
|
|
3158
|
-
const
|
|
3159
|
-
if (
|
|
3160
|
-
u =
|
|
3279
|
+
if (d) {
|
|
3280
|
+
const k = `${d}.${o}`, S = n.i18n.t(k, void 0, r);
|
|
3281
|
+
if (S !== k && !A.isEmpty(S))
|
|
3282
|
+
u = S;
|
|
3161
3283
|
else {
|
|
3162
|
-
const
|
|
3163
|
-
B !==
|
|
3284
|
+
const _ = `common.${o}`, B = n.i18n.t(_, void 0, r);
|
|
3285
|
+
B !== _ ? u = B : u = n.i18n.t(o, void 0, r);
|
|
3164
3286
|
}
|
|
3165
3287
|
} else
|
|
3166
3288
|
u = n.i18n.t(o, void 0, r);
|
|
3167
|
-
return u === o && typeof s == "string" && s && (u = s), u =
|
|
3289
|
+
return u === o && typeof s == "string" && s && (u = s), u = he(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
3290
|
}, this.t = globalThis.$t, globalThis.$deepScan = function(o) {
|
|
3169
3291
|
return o;
|
|
3170
3292
|
}, globalThis.$clearI18n = this.clearI18n = () => {
|
|
3171
|
-
|
|
3293
|
+
Vn({
|
|
3172
3294
|
appCode: this.appCode,
|
|
3173
3295
|
cacheScope: this.activeCacheScope
|
|
3174
3296
|
});
|
|
@@ -3191,7 +3313,7 @@ class X {
|
|
|
3191
3313
|
* @returns {boolean}
|
|
3192
3314
|
*/
|
|
3193
3315
|
static checkRTL(e) {
|
|
3194
|
-
return
|
|
3316
|
+
return ke(e);
|
|
3195
3317
|
}
|
|
3196
3318
|
/**
|
|
3197
3319
|
* 压缩编码 translationKeys 数组为 URL 安全的字符串
|
|
@@ -3201,7 +3323,7 @@ class X {
|
|
|
3201
3323
|
encodeTranslationKeys(e) {
|
|
3202
3324
|
if (!e || e.length === 0) return "";
|
|
3203
3325
|
const n = JSON.stringify(e);
|
|
3204
|
-
return
|
|
3326
|
+
return Ee.compressToEncodedURIComponent(n);
|
|
3205
3327
|
}
|
|
3206
3328
|
/**
|
|
3207
3329
|
* 压缩整个 query 参数对象为 URL 安全的字符串
|
|
@@ -3211,7 +3333,7 @@ class X {
|
|
|
3211
3333
|
encodeQueryParams(e) {
|
|
3212
3334
|
if (!e) return "";
|
|
3213
3335
|
const n = JSON.stringify(e);
|
|
3214
|
-
return
|
|
3336
|
+
return Ee.compressToEncodedURIComponent(n);
|
|
3215
3337
|
}
|
|
3216
3338
|
/**
|
|
3217
3339
|
* 解码压缩的 translationKeys 字符串
|
|
@@ -3221,7 +3343,7 @@ class X {
|
|
|
3221
3343
|
static decodeTranslationKeys(e) {
|
|
3222
3344
|
if (!e) return [];
|
|
3223
3345
|
try {
|
|
3224
|
-
const n =
|
|
3346
|
+
const n = Ee.decompressFromEncodedURIComponent(e);
|
|
3225
3347
|
return n ? JSON.parse(n) : [];
|
|
3226
3348
|
} catch (n) {
|
|
3227
3349
|
return console.error("解码 translationKeys 失败:", n), [];
|
|
@@ -3235,7 +3357,7 @@ class X {
|
|
|
3235
3357
|
static decodeQueryParams(e) {
|
|
3236
3358
|
if (!e) return {};
|
|
3237
3359
|
try {
|
|
3238
|
-
const n =
|
|
3360
|
+
const n = Ee.decompressFromEncodedURIComponent(e);
|
|
3239
3361
|
return n ? JSON.parse(n) : {};
|
|
3240
3362
|
} catch (n) {
|
|
3241
3363
|
return console.error("解码 query 参数失败:", n), {};
|
|
@@ -3250,7 +3372,7 @@ class X {
|
|
|
3250
3372
|
notifyLanguageChanged(e, n) {
|
|
3251
3373
|
Ze() && this.vueInstances && this.vueInstances.size > 0 && pt(() => {
|
|
3252
3374
|
this.vueInstances.forEach((o) => {
|
|
3253
|
-
|
|
3375
|
+
In(o);
|
|
3254
3376
|
});
|
|
3255
3377
|
}), typeof window < "u" && typeof CustomEvent == "function" && window.dispatchEvent(
|
|
3256
3378
|
new CustomEvent("gc-i18n-language-changed", {
|
|
@@ -3261,19 +3383,12 @@ class X {
|
|
|
3261
3383
|
})
|
|
3262
3384
|
);
|
|
3263
3385
|
}
|
|
3264
|
-
setToken(e) {
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
baseUrl: this.baseUrl,
|
|
3268
|
-
appCode: this.appCode,
|
|
3269
|
-
token: this.token,
|
|
3270
|
-
locale: this.locale,
|
|
3271
|
-
env: this.env,
|
|
3272
|
-
cacheScope: this.activeCacheScope
|
|
3273
|
-
});
|
|
3386
|
+
setToken(e, n = {}) {
|
|
3387
|
+
const o = this.normalizeAuthInfo(n);
|
|
3388
|
+
return this.baseToken = e || "", this.token = this.baseToken, x.set("I18N_TOKEN", this.token), this.persistI18nConfig(), this.resolveAndApplyI18nToken(this.baseToken, o);
|
|
3274
3389
|
}
|
|
3275
3390
|
async getLanguages(e = !1) {
|
|
3276
|
-
return await
|
|
3391
|
+
return await Pt({
|
|
3277
3392
|
baseUrl: this.baseUrl,
|
|
3278
3393
|
token: this.token,
|
|
3279
3394
|
appCode: this.appCode,
|
|
@@ -3282,16 +3397,16 @@ class X {
|
|
|
3282
3397
|
}
|
|
3283
3398
|
async setLanguage(e = "zh-CN", n = {}) {
|
|
3284
3399
|
e = this.normalizeLocale(e);
|
|
3285
|
-
const o = n.cacheScope || this.activeCacheScope || "guest", s = n.authVersion || this.authVersion, r = ++this.languageVersion,
|
|
3286
|
-
let c =
|
|
3287
|
-
if (
|
|
3400
|
+
const o = n.cacheScope || this.activeCacheScope || "guest", s = n.authVersion || this.authVersion, r = ++this.languageVersion, l = "I18N_MESSAGES_COMMON_" + e;
|
|
3401
|
+
let c = x.get(l);
|
|
3402
|
+
if (A.isEmpty(c))
|
|
3288
3403
|
try {
|
|
3289
|
-
const i = await
|
|
3404
|
+
const i = await Bn.get(
|
|
3290
3405
|
`https://cdn.ihotel.cn/i18n_messages/${e}.json`
|
|
3291
3406
|
);
|
|
3292
3407
|
if (i) {
|
|
3293
|
-
const { data:
|
|
3294
|
-
c =
|
|
3408
|
+
const { data: d } = i;
|
|
3409
|
+
c = d, x.set(l, d);
|
|
3295
3410
|
}
|
|
3296
3411
|
} catch (i) {
|
|
3297
3412
|
console.warn(
|
|
@@ -3300,7 +3415,7 @@ class X {
|
|
|
3300
3415
|
), c = {};
|
|
3301
3416
|
}
|
|
3302
3417
|
try {
|
|
3303
|
-
const i = await
|
|
3418
|
+
const i = await Hn({
|
|
3304
3419
|
baseUrl: this.baseUrl,
|
|
3305
3420
|
appCode: this.appCode,
|
|
3306
3421
|
language: e || this.locale,
|
|
@@ -3311,31 +3426,31 @@ class X {
|
|
|
3311
3426
|
if (s !== this.authVersion || r !== this.languageVersion)
|
|
3312
3427
|
return !1;
|
|
3313
3428
|
if (i && Array.isArray(i)) {
|
|
3314
|
-
const
|
|
3429
|
+
const d = Nn(i), u = A.assign(
|
|
3315
3430
|
{},
|
|
3316
3431
|
c,
|
|
3317
|
-
|
|
3318
|
-
|
|
3432
|
+
A.get(this.messages, e),
|
|
3433
|
+
d
|
|
3319
3434
|
);
|
|
3320
3435
|
this.i18n.global.setLocaleMessage(e, u);
|
|
3321
3436
|
} else {
|
|
3322
|
-
const
|
|
3437
|
+
const d = A.assign(
|
|
3323
3438
|
{},
|
|
3324
3439
|
c,
|
|
3325
|
-
|
|
3440
|
+
A.get(this.messages, e)
|
|
3326
3441
|
);
|
|
3327
|
-
this.i18n.global.setLocaleMessage(e,
|
|
3442
|
+
this.i18n.global.setLocaleMessage(e, d);
|
|
3328
3443
|
}
|
|
3329
|
-
return this.locale = e, this._isRTL =
|
|
3444
|
+
return this.locale = e, this._isRTL = ke(e), this.i18n.global.locale.value = e, x.set("I18N_LANGUAGE", e), this.updateDocumentDir(), this.notifyLanguageChanged(e, !0), !0;
|
|
3330
3445
|
} catch (i) {
|
|
3331
3446
|
if (console.error(`设置语言 ${e} 失败,使用本地消息继续运行:`, i), s !== this.authVersion || r !== this.languageVersion)
|
|
3332
3447
|
return !1;
|
|
3333
|
-
const
|
|
3448
|
+
const d = A.assign(
|
|
3334
3449
|
{},
|
|
3335
3450
|
c,
|
|
3336
|
-
|
|
3451
|
+
A.get(this.messages, e)
|
|
3337
3452
|
);
|
|
3338
|
-
return this.i18n.global.setLocaleMessage(e,
|
|
3453
|
+
return this.i18n.global.setLocaleMessage(e, d), this.locale = e, this._isRTL = ke(e), this.i18n.global.locale.value = e, x.set("I18N_LANGUAGE", e), this.updateDocumentDir(), this.notifyLanguageChanged(e, !1), !1;
|
|
3339
3454
|
}
|
|
3340
3455
|
}
|
|
3341
3456
|
install(e, n = {}) {
|
|
@@ -3356,9 +3471,9 @@ class X {
|
|
|
3356
3471
|
} else
|
|
3357
3472
|
e.config.globalProperties.$t = this.t || globalThis.$t, e.config.globalProperties.$i18n = this.i18n;
|
|
3358
3473
|
e.component("i18n-earth", {
|
|
3359
|
-
|
|
3474
|
+
...$t,
|
|
3360
3475
|
props: {
|
|
3361
|
-
|
|
3476
|
+
...$t.props,
|
|
3362
3477
|
baseUrl: {
|
|
3363
3478
|
type: String,
|
|
3364
3479
|
default: this.baseUrl
|