@masonitestudios/spartanauth-widgets 0.2.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sa-widgets.mjs +1420 -1237
- package/dist/sa-widgets.umd.js +14 -4
- package/package.json +1 -1
package/dist/sa-widgets.mjs
CHANGED
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const Vt = (e, t) => e === t, Re = {
|
|
2
|
+
equals: Vt
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const
|
|
4
|
+
let vt = Ft;
|
|
5
|
+
const we = 1, Le = 2, At = {
|
|
6
6
|
owned: null,
|
|
7
7
|
cleanups: null,
|
|
8
8
|
context: null,
|
|
9
9
|
owner: null
|
|
10
10
|
};
|
|
11
|
-
var
|
|
12
|
-
let
|
|
13
|
-
function
|
|
14
|
-
const
|
|
11
|
+
var se = null;
|
|
12
|
+
let He = null, Kt = null, Z = null, ee = null, ve = null, Ke = 0;
|
|
13
|
+
function Gt(e, t) {
|
|
14
|
+
const n = Z, r = se, s = e.length === 0, u = t === void 0 ? r : t, o = s ? At : {
|
|
15
15
|
owned: null,
|
|
16
16
|
cleanups: null,
|
|
17
17
|
context: u ? u.context : null,
|
|
18
18
|
owner: u
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, l = s ? e : () => e(() => Ge(() => Oe(o)));
|
|
20
|
+
se = o, Z = null;
|
|
21
21
|
try {
|
|
22
|
-
return Pe(
|
|
22
|
+
return Pe(l, !0);
|
|
23
23
|
} finally {
|
|
24
|
-
|
|
24
|
+
Z = n, se = r;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
t = t ? Object.assign({},
|
|
29
|
-
const
|
|
27
|
+
function E(e, t) {
|
|
28
|
+
t = t ? Object.assign({}, Re, t) : Re;
|
|
29
|
+
const n = {
|
|
30
30
|
value: e,
|
|
31
31
|
observers: null,
|
|
32
32
|
observerSlots: null,
|
|
33
33
|
comparator: t.equals || void 0
|
|
34
|
-
},
|
|
35
|
-
return [
|
|
36
|
-
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
function
|
|
52
|
-
if (
|
|
53
|
-
const t =
|
|
54
|
-
|
|
34
|
+
}, r = (s) => (typeof s == "function" && (s = s(n.value)), Et(n, s));
|
|
35
|
+
return [wt.bind(n), r];
|
|
36
|
+
}
|
|
37
|
+
function $(e, t, n) {
|
|
38
|
+
const r = nt(e, t, !1, we);
|
|
39
|
+
Ie(r);
|
|
40
|
+
}
|
|
41
|
+
function Ht(e, t, n) {
|
|
42
|
+
vt = Yt;
|
|
43
|
+
const r = nt(e, t, !1, we);
|
|
44
|
+
r.user = !0, ve ? ve.push(r) : Ie(r);
|
|
45
|
+
}
|
|
46
|
+
function p(e, t, n) {
|
|
47
|
+
n = n ? Object.assign({}, Re, n) : Re;
|
|
48
|
+
const r = nt(e, t, !0, 0);
|
|
49
|
+
return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, Ie(r), wt.bind(r);
|
|
50
|
+
}
|
|
51
|
+
function Ge(e) {
|
|
52
|
+
if (Z === null) return e();
|
|
53
|
+
const t = Z;
|
|
54
|
+
Z = null;
|
|
55
55
|
try {
|
|
56
56
|
return e();
|
|
57
57
|
} finally {
|
|
58
|
-
|
|
58
|
+
Z = t;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
61
|
+
function tt(e) {
|
|
62
|
+
Ht(() => Ge(e));
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function wt() {
|
|
65
65
|
if (this.sources && this.state)
|
|
66
|
-
if (this.state ===
|
|
66
|
+
if (this.state === we) Ie(this);
|
|
67
67
|
else {
|
|
68
|
-
const e =
|
|
69
|
-
|
|
68
|
+
const e = ee;
|
|
69
|
+
ee = null, Pe(() => Ue(this), !1), ee = e;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
71
|
+
if (Z) {
|
|
72
72
|
const e = this.observers ? this.observers.length : 0;
|
|
73
|
-
|
|
73
|
+
Z.sources ? (Z.sources.push(this), Z.sourceSlots.push(e)) : (Z.sources = [this], Z.sourceSlots = [e]), this.observers ? (this.observers.push(Z), this.observerSlots.push(Z.sources.length - 1)) : (this.observers = [Z], this.observerSlots = [Z.sources.length - 1]);
|
|
74
74
|
}
|
|
75
75
|
return this.value;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
return (!e.comparator || !e.comparator(
|
|
77
|
+
function Et(e, t, n) {
|
|
78
|
+
let r = e.value;
|
|
79
|
+
return (!e.comparator || !e.comparator(r, t)) && (e.value = t, e.observers && e.observers.length && Pe(() => {
|
|
80
80
|
for (let s = 0; s < e.observers.length; s += 1) {
|
|
81
|
-
const u = e.observers[s],
|
|
82
|
-
|
|
81
|
+
const u = e.observers[s], o = He && He.running;
|
|
82
|
+
o && He.disposed.has(u), (o ? !u.tState : !u.state) && (u.pure ? ee.push(u) : ve.push(u), u.observers && yt(u)), o || (u.state = we);
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
85
|
-
throw
|
|
84
|
+
if (ee.length > 1e6)
|
|
85
|
+
throw ee = [], new Error();
|
|
86
86
|
}, !1)), t;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Ie(e) {
|
|
89
89
|
if (!e.fn) return;
|
|
90
90
|
Oe(e);
|
|
91
|
-
const t =
|
|
92
|
-
|
|
91
|
+
const t = Ke;
|
|
92
|
+
Wt(
|
|
93
93
|
e,
|
|
94
94
|
e.value,
|
|
95
95
|
t
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
let
|
|
100
|
-
const s =
|
|
101
|
-
|
|
98
|
+
function Wt(e, t, n) {
|
|
99
|
+
let r;
|
|
100
|
+
const s = se, u = Z;
|
|
101
|
+
Z = se = e;
|
|
102
102
|
try {
|
|
103
|
-
|
|
104
|
-
} catch (
|
|
105
|
-
return e.pure && (e.state =
|
|
103
|
+
r = e.fn(t);
|
|
104
|
+
} catch (o) {
|
|
105
|
+
return e.pure && (e.state = we, e.owned && e.owned.forEach(Oe), e.owned = null), e.updatedAt = n + 1, $t(o);
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
Z = u, se = s;
|
|
108
108
|
}
|
|
109
|
-
(!e.updatedAt || e.updatedAt <=
|
|
109
|
+
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Et(e, r) : e.value = r, e.updatedAt = n);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function nt(e, t, n, r = we, s) {
|
|
112
112
|
const u = {
|
|
113
113
|
fn: e,
|
|
114
|
-
state:
|
|
114
|
+
state: r,
|
|
115
115
|
updatedAt: null,
|
|
116
116
|
owned: null,
|
|
117
117
|
sources: null,
|
|
118
118
|
sourceSlots: null,
|
|
119
119
|
cleanups: null,
|
|
120
120
|
value: t,
|
|
121
|
-
owner:
|
|
122
|
-
context:
|
|
123
|
-
pure:
|
|
121
|
+
owner: se,
|
|
122
|
+
context: se ? se.context : null,
|
|
123
|
+
pure: n
|
|
124
124
|
};
|
|
125
|
-
return
|
|
125
|
+
return se === null || se !== At && (se.owned ? se.owned.push(u) : se.owned = [u]), u;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function qe(e) {
|
|
128
128
|
if (e.state === 0) return;
|
|
129
|
-
if (e.state ===
|
|
130
|
-
if (e.suspense &&
|
|
129
|
+
if (e.state === Le) return Ue(e);
|
|
130
|
+
if (e.suspense && Ge(e.suspense.inFallback)) return e.suspense.effects.push(e);
|
|
131
131
|
const t = [e];
|
|
132
|
-
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt <
|
|
132
|
+
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Ke); )
|
|
133
133
|
e.state && t.push(e);
|
|
134
|
-
for (let
|
|
135
|
-
if (e = t[
|
|
136
|
-
|
|
137
|
-
else if (e.state ===
|
|
138
|
-
const
|
|
139
|
-
|
|
134
|
+
for (let n = t.length - 1; n >= 0; n--)
|
|
135
|
+
if (e = t[n], e.state === we)
|
|
136
|
+
Ie(e);
|
|
137
|
+
else if (e.state === Le) {
|
|
138
|
+
const r = ee;
|
|
139
|
+
ee = null, Pe(() => Ue(e, t[0]), !1), ee = r;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
function Pe(e, t) {
|
|
143
|
-
if (
|
|
144
|
-
let
|
|
145
|
-
t || (
|
|
143
|
+
if (ee) return e();
|
|
144
|
+
let n = !1;
|
|
145
|
+
t || (ee = []), ve ? n = !0 : ve = [], Ke++;
|
|
146
146
|
try {
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
} catch (
|
|
150
|
-
|
|
147
|
+
const r = e();
|
|
148
|
+
return Zt(n), r;
|
|
149
|
+
} catch (r) {
|
|
150
|
+
n || (ve = null), ee = null, $t(r);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
155
|
-
const t =
|
|
156
|
-
|
|
153
|
+
function Zt(e) {
|
|
154
|
+
if (ee && (Ft(ee), ee = null), e) return;
|
|
155
|
+
const t = ve;
|
|
156
|
+
ve = null, t.length && Pe(() => vt(t), !1);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
for (let t = 0; t < e.length; t++)
|
|
158
|
+
function Ft(e) {
|
|
159
|
+
for (let t = 0; t < e.length; t++) qe(e[t]);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
let t,
|
|
161
|
+
function Yt(e) {
|
|
162
|
+
let t, n = 0;
|
|
163
163
|
for (t = 0; t < e.length; t++) {
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const r = e[t];
|
|
165
|
+
r.user ? e[n++] = r : qe(r);
|
|
166
166
|
}
|
|
167
|
-
for (t = 0; t <
|
|
167
|
+
for (t = 0; t < n; t++) qe(e[t]);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ue(e, t) {
|
|
170
170
|
e.state = 0;
|
|
171
|
-
for (let
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const s =
|
|
175
|
-
s ===
|
|
171
|
+
for (let n = 0; n < e.sources.length; n += 1) {
|
|
172
|
+
const r = e.sources[n];
|
|
173
|
+
if (r.sources) {
|
|
174
|
+
const s = r.state;
|
|
175
|
+
s === we ? r !== t && (!r.updatedAt || r.updatedAt < Ke) && qe(r) : s === Le && Ue(r, t);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function yt(e) {
|
|
180
180
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const n = e.observers[t];
|
|
182
|
+
n.state || (n.state = Le, n.pure ? ee.push(n) : ve.push(n), n.observers && yt(n));
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
function Oe(e) {
|
|
186
186
|
let t;
|
|
187
187
|
if (e.sources)
|
|
188
188
|
for (; e.sources.length; ) {
|
|
189
|
-
const
|
|
189
|
+
const n = e.sources.pop(), r = e.sourceSlots.pop(), s = n.observers;
|
|
190
190
|
if (s && s.length) {
|
|
191
|
-
const u = s.pop(),
|
|
192
|
-
|
|
191
|
+
const u = s.pop(), o = n.observerSlots.pop();
|
|
192
|
+
r < s.length && (u.sourceSlots[o] = r, s[r] = u, n.observerSlots[r] = o);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
if (e.tOwned) {
|
|
@@ -206,93 +206,93 @@ function Oe(e) {
|
|
|
206
206
|
}
|
|
207
207
|
e.state = 0;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Xt(e) {
|
|
210
210
|
return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
|
|
211
211
|
cause: e
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
throw
|
|
214
|
+
function $t(e, t = se) {
|
|
215
|
+
throw Xt(e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
let
|
|
219
|
-
for (;
|
|
220
|
-
if (t[
|
|
221
|
-
|
|
217
|
+
function Qt(e, t, n) {
|
|
218
|
+
let r = n.length, s = t.length, u = r, o = 0, l = 0, v = t[s - 1].nextSibling, B = null;
|
|
219
|
+
for (; o < s || l < u; ) {
|
|
220
|
+
if (t[o] === n[l]) {
|
|
221
|
+
o++, l++;
|
|
222
222
|
continue;
|
|
223
223
|
}
|
|
224
|
-
for (; t[s - 1] ===
|
|
224
|
+
for (; t[s - 1] === n[u - 1]; )
|
|
225
225
|
s--, u--;
|
|
226
|
-
if (s ===
|
|
227
|
-
const
|
|
228
|
-
for (;
|
|
229
|
-
} else if (u ===
|
|
230
|
-
for (;
|
|
231
|
-
(!
|
|
232
|
-
else if (t[
|
|
233
|
-
const
|
|
234
|
-
e.insertBefore(
|
|
226
|
+
if (s === o) {
|
|
227
|
+
const D = u < r ? l ? n[l - 1].nextSibling : n[u - l] : v;
|
|
228
|
+
for (; l < u; ) e.insertBefore(n[l++], D);
|
|
229
|
+
} else if (u === l)
|
|
230
|
+
for (; o < s; )
|
|
231
|
+
(!B || !B.has(t[o])) && t[o].remove(), o++;
|
|
232
|
+
else if (t[o] === n[u - 1] && n[l] === t[s - 1]) {
|
|
233
|
+
const D = t[--s].nextSibling;
|
|
234
|
+
e.insertBefore(n[l++], t[o++].nextSibling), e.insertBefore(n[--u], D), t[s] = n[u];
|
|
235
235
|
} else {
|
|
236
|
-
if (!
|
|
237
|
-
|
|
238
|
-
let
|
|
239
|
-
for (;
|
|
236
|
+
if (!B) {
|
|
237
|
+
B = /* @__PURE__ */ new Map();
|
|
238
|
+
let x = l;
|
|
239
|
+
for (; x < u; ) B.set(n[x], x++);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
if (
|
|
244
|
-
let
|
|
245
|
-
for (; ++
|
|
246
|
-
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
for (;
|
|
250
|
-
} else e.replaceChild(
|
|
251
|
-
} else
|
|
252
|
-
else t[
|
|
241
|
+
const D = B.get(t[o]);
|
|
242
|
+
if (D != null)
|
|
243
|
+
if (l < D && D < u) {
|
|
244
|
+
let x = o, te = 1, ue;
|
|
245
|
+
for (; ++x < s && x < u && !((ue = B.get(t[x])) == null || ue !== D + te); )
|
|
246
|
+
te++;
|
|
247
|
+
if (te > D - l) {
|
|
248
|
+
const ge = t[o];
|
|
249
|
+
for (; l < D; ) e.insertBefore(n[l++], ge);
|
|
250
|
+
} else e.replaceChild(n[l++], t[o++]);
|
|
251
|
+
} else o++;
|
|
252
|
+
else t[o++].remove();
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
256
|
+
const lt = "_$DX_DELEGATE";
|
|
257
|
+
function F(e, t, n, r) {
|
|
258
258
|
let s;
|
|
259
259
|
const u = () => {
|
|
260
|
-
const
|
|
261
|
-
return
|
|
262
|
-
},
|
|
263
|
-
return
|
|
260
|
+
const l = document.createElement("template");
|
|
261
|
+
return l.innerHTML = e, l.content.firstChild;
|
|
262
|
+
}, o = () => (s || (s = u())).cloneNode(!0);
|
|
263
|
+
return o.cloneNode = o, o;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
const
|
|
267
|
-
for (let
|
|
268
|
-
const u = e[
|
|
269
|
-
|
|
265
|
+
function rt(e, t = window.document) {
|
|
266
|
+
const n = t[lt] || (t[lt] = /* @__PURE__ */ new Set());
|
|
267
|
+
for (let r = 0, s = e.length; r < s; r++) {
|
|
268
|
+
const u = e[r];
|
|
269
|
+
n.has(u) || (n.add(u), t.addEventListener(u, en));
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
272
|
+
function ce(e, t, n) {
|
|
273
|
+
n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
275
|
+
function Bt(e, t, n) {
|
|
276
|
+
return Ge(() => e(t, n));
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
if (
|
|
280
|
-
|
|
278
|
+
function f(e, t, n, r) {
|
|
279
|
+
if (n !== void 0 && !r && (r = []), typeof t != "function") return Je(e, t, r, n);
|
|
280
|
+
$((s) => Je(e, t(), s, n), r);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function en(e) {
|
|
283
283
|
let t = e.target;
|
|
284
|
-
const
|
|
284
|
+
const n = `$$${e.type}`, r = e.target, s = e.currentTarget, u = (v) => Object.defineProperty(e, "target", {
|
|
285
285
|
configurable: !0,
|
|
286
|
-
value:
|
|
287
|
-
}),
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
286
|
+
value: v
|
|
287
|
+
}), o = () => {
|
|
288
|
+
const v = t[n];
|
|
289
|
+
if (v && !t.disabled) {
|
|
290
|
+
const B = t[`${n}Data`];
|
|
291
|
+
if (B !== void 0 ? v.call(t, B, e) : v.call(t, e), e.cancelBubble) return;
|
|
292
292
|
}
|
|
293
293
|
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && u(t.host), !0;
|
|
294
|
-
},
|
|
295
|
-
for (;
|
|
294
|
+
}, l = () => {
|
|
295
|
+
for (; o() && (t = t._$host || t.parentNode || t.host); ) ;
|
|
296
296
|
};
|
|
297
297
|
if (Object.defineProperty(e, "currentTarget", {
|
|
298
298
|
configurable: !0,
|
|
@@ -300,138 +300,138 @@ function Zt(e) {
|
|
|
300
300
|
return t || document;
|
|
301
301
|
}
|
|
302
302
|
}), e.composedPath) {
|
|
303
|
-
const
|
|
304
|
-
u(
|
|
305
|
-
for (let
|
|
303
|
+
const v = e.composedPath();
|
|
304
|
+
u(v[0]);
|
|
305
|
+
for (let B = 0; B < v.length - 2 && (t = v[B], !!o()); B++) {
|
|
306
306
|
if (t._$host) {
|
|
307
|
-
t = t._$host,
|
|
307
|
+
t = t._$host, l();
|
|
308
308
|
break;
|
|
309
309
|
}
|
|
310
310
|
if (t.parentNode === s)
|
|
311
311
|
break;
|
|
312
312
|
}
|
|
313
|
-
} else
|
|
314
|
-
u(
|
|
315
|
-
}
|
|
316
|
-
function
|
|
317
|
-
for (; typeof
|
|
318
|
-
if (t ===
|
|
319
|
-
const u = typeof t,
|
|
320
|
-
if (e =
|
|
321
|
-
if (u === "number" && (t = t.toString(), t ===
|
|
322
|
-
return
|
|
323
|
-
if (
|
|
324
|
-
let
|
|
325
|
-
|
|
313
|
+
} else l();
|
|
314
|
+
u(r);
|
|
315
|
+
}
|
|
316
|
+
function Je(e, t, n, r, s) {
|
|
317
|
+
for (; typeof n == "function"; ) n = n();
|
|
318
|
+
if (t === n) return n;
|
|
319
|
+
const u = typeof t, o = r !== void 0;
|
|
320
|
+
if (e = o && n[0] && n[0].parentNode || e, u === "string" || u === "number") {
|
|
321
|
+
if (u === "number" && (t = t.toString(), t === n))
|
|
322
|
+
return n;
|
|
323
|
+
if (o) {
|
|
324
|
+
let l = n[0];
|
|
325
|
+
l && l.nodeType === 3 ? l.data !== t && (l.data = t) : l = document.createTextNode(t), n = $e(e, n, r, l);
|
|
326
326
|
} else
|
|
327
|
-
|
|
327
|
+
n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
|
|
328
328
|
} else if (t == null || u === "boolean")
|
|
329
|
-
|
|
329
|
+
n = $e(e, n, r);
|
|
330
330
|
else {
|
|
331
331
|
if (u === "function")
|
|
332
|
-
return
|
|
333
|
-
let
|
|
334
|
-
for (; typeof
|
|
335
|
-
|
|
336
|
-
}), () =>
|
|
332
|
+
return $(() => {
|
|
333
|
+
let l = t();
|
|
334
|
+
for (; typeof l == "function"; ) l = l();
|
|
335
|
+
n = Je(e, l, n, r);
|
|
336
|
+
}), () => n;
|
|
337
337
|
if (Array.isArray(t)) {
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
return
|
|
341
|
-
if (
|
|
342
|
-
if (
|
|
343
|
-
} else
|
|
344
|
-
|
|
338
|
+
const l = [], v = n && Array.isArray(n);
|
|
339
|
+
if (Xe(l, t, n, s))
|
|
340
|
+
return $(() => n = Je(e, l, n, r, !0)), () => n;
|
|
341
|
+
if (l.length === 0) {
|
|
342
|
+
if (n = $e(e, n, r), o) return n;
|
|
343
|
+
} else v ? n.length === 0 ? ct(e, l, r) : Qt(e, n, l) : (n && $e(e), ct(e, l));
|
|
344
|
+
n = l;
|
|
345
345
|
} else if (t.nodeType) {
|
|
346
|
-
if (Array.isArray(
|
|
347
|
-
if (
|
|
348
|
-
|
|
349
|
-
} else
|
|
350
|
-
|
|
346
|
+
if (Array.isArray(n)) {
|
|
347
|
+
if (o) return n = $e(e, n, r, t);
|
|
348
|
+
$e(e, n, null, t);
|
|
349
|
+
} else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
|
|
350
|
+
n = t;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
return
|
|
353
|
+
return n;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function Xe(e, t, n, r) {
|
|
356
356
|
let s = !1;
|
|
357
|
-
for (let u = 0,
|
|
358
|
-
let
|
|
359
|
-
if (!(
|
|
360
|
-
e.push(
|
|
361
|
-
else if (Array.isArray(
|
|
362
|
-
s =
|
|
363
|
-
else if (
|
|
364
|
-
if (
|
|
365
|
-
for (; typeof
|
|
366
|
-
s =
|
|
357
|
+
for (let u = 0, o = t.length; u < o; u++) {
|
|
358
|
+
let l = t[u], v = n && n[e.length], B;
|
|
359
|
+
if (!(l == null || l === !0 || l === !1)) if ((B = typeof l) == "object" && l.nodeType)
|
|
360
|
+
e.push(l);
|
|
361
|
+
else if (Array.isArray(l))
|
|
362
|
+
s = Xe(e, l, v) || s;
|
|
363
|
+
else if (B === "function")
|
|
364
|
+
if (r) {
|
|
365
|
+
for (; typeof l == "function"; ) l = l();
|
|
366
|
+
s = Xe(
|
|
367
367
|
e,
|
|
368
|
-
Array.isArray(
|
|
369
|
-
Array.isArray(
|
|
368
|
+
Array.isArray(l) ? l : [l],
|
|
369
|
+
Array.isArray(v) ? v : [v]
|
|
370
370
|
) || s;
|
|
371
371
|
} else
|
|
372
|
-
e.push(
|
|
372
|
+
e.push(l), s = !0;
|
|
373
373
|
else {
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const D = String(l);
|
|
375
|
+
v && v.nodeType === 3 && v.data === D ? e.push(v) : e.push(document.createTextNode(D));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
return s;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
for (let
|
|
380
|
+
function ct(e, t, n = null) {
|
|
381
|
+
for (let r = 0, s = t.length; r < s; r++) e.insertBefore(t[r], n);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
if (
|
|
385
|
-
const s =
|
|
383
|
+
function $e(e, t, n, r) {
|
|
384
|
+
if (n === void 0) return e.textContent = "";
|
|
385
|
+
const s = r || document.createTextNode("");
|
|
386
386
|
if (t.length) {
|
|
387
387
|
let u = !1;
|
|
388
|
-
for (let
|
|
389
|
-
const
|
|
390
|
-
if (s !==
|
|
391
|
-
const
|
|
392
|
-
!u && !
|
|
388
|
+
for (let o = t.length - 1; o >= 0; o--) {
|
|
389
|
+
const l = t[o];
|
|
390
|
+
if (s !== l) {
|
|
391
|
+
const v = l.parentNode === e;
|
|
392
|
+
!u && !o ? v ? e.replaceChild(s, l) : e.insertBefore(s, n) : v && l.remove();
|
|
393
393
|
} else u = !0;
|
|
394
394
|
}
|
|
395
|
-
} else e.insertBefore(s,
|
|
395
|
+
} else e.insertBefore(s, n);
|
|
396
396
|
return [s];
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return Object.keys(e).reduce((
|
|
400
|
-
const s = e[
|
|
401
|
-
return r
|
|
398
|
+
function tn(e) {
|
|
399
|
+
return Object.keys(e).reduce((n, r) => {
|
|
400
|
+
const s = e[r];
|
|
401
|
+
return n[r] = Object.assign({}, s), xt(s.value) && !an(s.value) && !Array.isArray(s.value) && (n[r].value = Object.assign({}, s.value)), Array.isArray(s.value) && (n[r].value = s.value.slice(0)), n;
|
|
402
402
|
}, {});
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
return e ? Object.keys(e).reduce((
|
|
406
|
-
const s = e[
|
|
407
|
-
return r
|
|
404
|
+
function nn(e) {
|
|
405
|
+
return e ? Object.keys(e).reduce((n, r) => {
|
|
406
|
+
const s = e[r];
|
|
407
|
+
return n[r] = xt(s) && "value" in s ? s : {
|
|
408
408
|
value: s
|
|
409
|
-
}, r
|
|
409
|
+
}, n[r].attribute || (n[r].attribute = un(r)), n[r].parse = "parse" in n[r] ? n[r].parse : typeof n[r].value != "string", n;
|
|
410
410
|
}, {}) : {};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
return Object.keys(e).reduce((
|
|
412
|
+
function rn(e) {
|
|
413
|
+
return Object.keys(e).reduce((n, r) => (n[r] = e[r].value, n), {});
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
const
|
|
415
|
+
function sn(e, t) {
|
|
416
|
+
const n = tn(t);
|
|
417
417
|
return Object.keys(t).forEach((s) => {
|
|
418
|
-
const u =
|
|
419
|
-
|
|
418
|
+
const u = n[s], o = e.getAttribute(u.attribute), l = e[s];
|
|
419
|
+
o != null && (u.value = u.parse ? kt(o) : o), l != null && (u.value = Array.isArray(l) ? l.slice(0) : l), u.reflect && dt(e, u.attribute, u.value, !!u.parse), Object.defineProperty(e, s, {
|
|
420
420
|
get() {
|
|
421
421
|
return u.value;
|
|
422
422
|
},
|
|
423
|
-
set(
|
|
424
|
-
const
|
|
425
|
-
u.value =
|
|
426
|
-
for (let
|
|
427
|
-
this.__propertyChangedCallbacks[
|
|
423
|
+
set(v) {
|
|
424
|
+
const B = u.value;
|
|
425
|
+
u.value = v, u.reflect && dt(this, u.attribute, u.value, !!u.parse);
|
|
426
|
+
for (let D = 0, x = this.__propertyChangedCallbacks.length; D < x; D++)
|
|
427
|
+
this.__propertyChangedCallbacks[D](s, v, B);
|
|
428
428
|
},
|
|
429
429
|
enumerable: !0,
|
|
430
430
|
configurable: !0
|
|
431
431
|
});
|
|
432
|
-
}),
|
|
432
|
+
}), n;
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function kt(e) {
|
|
435
435
|
if (e)
|
|
436
436
|
try {
|
|
437
437
|
return JSON.parse(e);
|
|
@@ -439,45 +439,45 @@ function wt(e) {
|
|
|
439
439
|
return e;
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
function
|
|
443
|
-
if (
|
|
444
|
-
let s =
|
|
442
|
+
function dt(e, t, n, r) {
|
|
443
|
+
if (n == null || n === !1) return e.removeAttribute(t);
|
|
444
|
+
let s = r ? JSON.stringify(n) : n;
|
|
445
445
|
e.__updating[t] = !0, s === "true" && (s = ""), e.setAttribute(t, s), Promise.resolve().then(() => delete e.__updating[t]);
|
|
446
446
|
}
|
|
447
|
-
function
|
|
448
|
-
return e.replace(/\.?([A-Z]+)/g, (t,
|
|
447
|
+
function un(e) {
|
|
448
|
+
return e.replace(/\.?([A-Z]+)/g, (t, n) => "-" + n.toLowerCase()).replace("_", "-").replace(/^-/, "");
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function xt(e) {
|
|
451
451
|
return e != null && (typeof e == "object" || typeof e == "function");
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function an(e) {
|
|
454
454
|
return Object.prototype.toString.call(e) === "[object Function]";
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function on(e) {
|
|
457
457
|
return typeof e == "function" && e.toString().indexOf("class") === 0;
|
|
458
458
|
}
|
|
459
|
-
let
|
|
460
|
-
function
|
|
461
|
-
const
|
|
459
|
+
let We;
|
|
460
|
+
function ln(e, t) {
|
|
461
|
+
const n = Object.keys(t);
|
|
462
462
|
return class extends e {
|
|
463
463
|
static get observedAttributes() {
|
|
464
|
-
return
|
|
464
|
+
return n.map((s) => t[s].attribute);
|
|
465
465
|
}
|
|
466
466
|
constructor() {
|
|
467
467
|
super(), this.__initialized = !1, this.__released = !1, this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = {};
|
|
468
468
|
}
|
|
469
469
|
connectedCallback() {
|
|
470
470
|
if (this.__initialized) return;
|
|
471
|
-
this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props =
|
|
472
|
-
const s =
|
|
471
|
+
this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = sn(this, t);
|
|
472
|
+
const s = rn(this.props), u = this.Component, o = We;
|
|
473
473
|
try {
|
|
474
|
-
|
|
474
|
+
We = this, this.__initialized = !0, on(u) ? new u(s, {
|
|
475
475
|
element: this
|
|
476
476
|
}) : u(s, {
|
|
477
477
|
element: this
|
|
478
478
|
});
|
|
479
479
|
} finally {
|
|
480
|
-
|
|
480
|
+
We = o;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
async disconnectedCallback() {
|
|
@@ -487,15 +487,15 @@ function sr(e, t) {
|
|
|
487
487
|
for (; s = this.__releaseCallbacks.pop(); ) s(this);
|
|
488
488
|
delete this.__initialized, this.__released = !0;
|
|
489
489
|
}
|
|
490
|
-
attributeChangedCallback(s, u,
|
|
490
|
+
attributeChangedCallback(s, u, o) {
|
|
491
491
|
if (this.__initialized && !this.__updating[s] && (s = this.lookupProp(s), s in t)) {
|
|
492
|
-
if (
|
|
493
|
-
this[s] = t[s].parse ?
|
|
492
|
+
if (o == null && !this[s]) return;
|
|
493
|
+
this[s] = t[s].parse ? kt(o) : o;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
lookupProp(s) {
|
|
497
497
|
if (t)
|
|
498
|
-
return
|
|
498
|
+
return n.find((u) => s === u || s === t[u].attribute);
|
|
499
499
|
}
|
|
500
500
|
get renderRoot() {
|
|
501
501
|
return this.shadowRoot || this.attachShadow({
|
|
@@ -510,92 +510,92 @@ function sr(e, t) {
|
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function cn(e, t = {}, n = {}) {
|
|
514
514
|
const {
|
|
515
|
-
BaseElement:
|
|
515
|
+
BaseElement: r = HTMLElement,
|
|
516
516
|
extension: s,
|
|
517
517
|
customElements: u = window.customElements
|
|
518
|
-
} =
|
|
519
|
-
return (
|
|
518
|
+
} = n;
|
|
519
|
+
return (o) => {
|
|
520
520
|
if (!e) throw new Error("tag is required to register a Component");
|
|
521
|
-
let
|
|
522
|
-
return
|
|
521
|
+
let l = u.get(e);
|
|
522
|
+
return l ? (l.prototype.Component = o, l) : (l = ln(r, nn(t)), l.prototype.Component = o, l.prototype.registeredTag = e, u.define(e, l, s), l);
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
const t = Object.keys(e),
|
|
527
|
-
for (let
|
|
528
|
-
const [s, u] =
|
|
529
|
-
Object.defineProperty(
|
|
525
|
+
function dn(e) {
|
|
526
|
+
const t = Object.keys(e), n = {};
|
|
527
|
+
for (let r = 0; r < t.length; r++) {
|
|
528
|
+
const [s, u] = E(e[t[r]]);
|
|
529
|
+
Object.defineProperty(n, t[r], {
|
|
530
530
|
get: s,
|
|
531
|
-
set(
|
|
532
|
-
u(() =>
|
|
531
|
+
set(o) {
|
|
532
|
+
u(() => o);
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
return
|
|
536
|
+
return n;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function fn(e) {
|
|
539
539
|
if (e.assignedSlot && e.assignedSlot._$owner) return e.assignedSlot._$owner;
|
|
540
540
|
let t = e.parentNode;
|
|
541
541
|
for (; t && !t._$owner && !(t.assignedSlot && t.assignedSlot._$owner); )
|
|
542
542
|
t = t.parentNode;
|
|
543
543
|
return t && t.assignedSlot ? t.assignedSlot._$owner : e._$owner;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
return (t,
|
|
547
|
-
const { element:
|
|
548
|
-
return
|
|
549
|
-
const u =
|
|
550
|
-
|
|
551
|
-
|
|
545
|
+
function hn(e) {
|
|
546
|
+
return (t, n) => {
|
|
547
|
+
const { element: r } = n;
|
|
548
|
+
return Gt((s) => {
|
|
549
|
+
const u = dn(t);
|
|
550
|
+
r.addPropertyChangedCallback((l, v) => u[l] = v), r.addReleaseCallback(() => {
|
|
551
|
+
r.renderRoot.textContent = "", s();
|
|
552
552
|
});
|
|
553
|
-
const
|
|
554
|
-
return
|
|
555
|
-
},
|
|
553
|
+
const o = e(u, n);
|
|
554
|
+
return f(r.renderRoot, o);
|
|
555
|
+
}, fn(r));
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
return arguments.length === 2 && (
|
|
558
|
+
function st(e, t, n) {
|
|
559
|
+
return arguments.length === 2 && (n = t, t = {}), cn(e, t)(hn(n));
|
|
560
560
|
}
|
|
561
|
-
var
|
|
562
|
-
let
|
|
561
|
+
var Dn = "٠١٢٣٤٥٦٧٨٩", pn = "۰۱۲۳۴۵۶۷۸۹", gn = "൦൧൨൩൪൫൬൭൮൯", mn = "೦೧೨೩೪೫೬೭೮೯", bn = "໐໑໒໓໔໕໖໗໘໙", Cn = "୦୧୨୩୪୫୬୭୮୯", vn = "០១២៣៤៥៦៧៨៩", An = "߀߁߂߃߄߅߆߇߈߉", wn = "੦੧੨੩੪੫੬੭੮੯", En = "૦૧૨૩૪૫૬૭૮૯", Fn = "०१२३४५६७८९", yn = "၀၁၂၃၄၅၆၇၈၉", $n = "௦௧௨௩௪௫௬௭௮௯", Bn = "౦౧౨౩౪౫౬౭౮౯", kn = "๐๑๒๓๔๕๖๗๘๙", xn = "༠༡༢༣༤༥༦༧༨༩", ft = { ar: Dn, fa: pn, ml: gn, kn: mn, lo: bn, or: Cn, kh: vn, nqo: An, pa: wn, gu: En, hi: Fn, my: yn, ta: $n, te: Bn, th: kn, bo: xn }, Sn = ["ru"], _n = ["id"], Tn = ["id"], On = ["ady-cyrl"], In = ["aeb-arab"], Pn = ["sq"], zn = ["ru"], Nn = ["zh-hant"], Mn = ["es"], jn = ["hi"], Rn = ["es"], Ln = ["ar"], qn = ["ar"], Un = ["ar"], Jn = ["es"], Vn = ["fr"], Kn = ["ru"], Gn = ["fr", "es", "ru"], Hn = ["hi"], Wn = ["es"], Zn = ["fa"], Yn = ["ru"], Xn = ["id"], Qn = ["de"], er = ["bbc-latn"], tr = ["fa"], nr = ["fa"], rr = ["bho"], sr = ["en"], ur = ["id"], ir = ["fr"], ar = ["bn"], or = ["fa"], lr = ["fr"], cr = ["id"], dr = ["id"], fr = ["ru"], hr = ["oc"], Dr = ["nan", "zh-hant"], pr = ["ru"], gr = ["it"], mr = ["crh-latn"], br = ["sk"], Cr = ["pl"], vr = ["ru"], Ar = ["hsb", "de"], wr = ["ms"], Er = ["ne"], Fr = ["it"], yr = ["it"], $r = ["es"], Br = ["fr"], kr = ["fi"], xr = ["fr"], Sr = ["fr"], _r = ["de"], Tr = ["it"], Or = ["tr"], Ir = ["gan-hant", "zh-hant", "zh-hans"], Pr = ["fr"], zr = ["pt"], Nr = ["fa"], Mr = ["es"], jr = ["gom-deva"], Rr = ["id"], Lr = ["de"], qr = ["es"], Ur = ["zh-hant"], Jr = ["hif-latn"], Vr = ["de"], Kr = ["dsb", "de"], Gr = ["fr"], Hr = ["hy"], Wr = ["zh-cn", "zh-hans"], Zr = ["ru"], Yr = ["eo"], Xr = ["ike-cans"], Qr = ["en"], es = ["da"], ts = ["id"], ns = ["kk-latn", "kk-cyrl"], rs = ["fr"], ss = ["kbd-cyrl"], us = ["fr"], is = ["ur"], as = ["tr"], os = ["my"], ls = ["kk-cyrl"], cs = ["da"], ds = ["ru"], fs = ["ru"], hs = ["fi"], Ds = ["ks-arab"], ps = ["de"], gs = ["ku-latn"], ms = ["ru"], bs = ["ru"], Cs = ["es"], vs = ["de"], As = ["ru"], ws = ["ru", "az"], Es = ["nl"], Fs = ["it"], ys = ["et"], $s = ["fa"], Bs = ["it", "rm", "fur"], ks = ["pms", "eml", "lij", "vec", "it"], xs = ["fr"], Ss = ["fa"], _s = ["lv"], Ts = ["fa"], Os = ["zh-hant"], Is = ["tr"], Ps = ["id"], zs = ["hi"], Ns = ["myv", "ru"], Ms = ["fr"], js = ["mrj", "ru"], Rs = ["id"], Ls = ["my"], qs = ["ro"], Us = ["mhr", "ru"], Js = ["pt"], Vs = ["mdf", "ru"], Ks = ["fa"], Gs = ["es"], Hs = ["cdo", "zh-hant"], Ws = ["it"], Zs = ["nn"], Ys = ["de"], Xs = ["id"], Qs = ["nb"], eu = ["fr"], tu = ["ca", "fr"], nu = ["fi"], ru = ["ru"], su = ["fr"], uu = ["de"], iu = ["de"], au = ["de"], ou = ["en"], lu = ["it"], cu = ["el"], du = ["pt-br"], fu = ["qug", "es"], hu = ["qu", "es"], Du = ["it"], pu = ["ro"], gu = ["uk", "ru"], mu = ["ro"], bu = ["ruq-latn", "ro"], Cu = ["hi"], vu = ["ru"], Au = ["it"], wu = ["en"], Eu = ["it"], Fu = ["cbk", "fa"], yu = ["fr"], $u = ["fr"], Bu = ["lt"], ku = ["bs", "sr-el", "hr"], xu = ["fr"], Su = ["shy-latn"], _u = ["cs"], Tu = ["skr-arab"], Ou = ["de"], Iu = ["fi"], Pu = ["sr-ec"], zu = ["nl"], Nu = ["de"], Mu = ["ru"], ju = ["id"], Ru = ["pl"], Lu = ["zh-tw", "zh-hant", "zh-hans"], qu = ["zh-tw", "zh-hant", "zh-hans"], Uu = ["kn"], Ju = ["pt"], Vu = ["tg-cyrl"], Ku = ["zh-tw", "zh-hant", "zh-hans"], Gu = ["tt-cyrl", "ru"], Hu = ["fr"], Wu = ["ru"], Zu = ["ru"], Yu = ["ug-arab"], Xu = ["it"], Qu = ["et"], ei = ["nl"], ti = ["de"], ni = ["fi"], ri = ["et"], si = ["fr"], ui = ["fr"], ii = ["zh-hans"], ai = ["ru"], oi = ["ka"], li = ["he"], ci = ["zh-hans"], di = ["nl"], fi = ["kab"], hi = ["zh-hans"], St = { ab: Sn, abs: _n, ace: Tn, ady: On, aeb: In, "aeb-arab": ["ar"], aln: Pn, alt: zn, ami: Nn, an: Mn, anp: jn, arn: Rn, arq: Ln, ary: qn, arz: Un, ast: Jn, atj: Vn, av: Kn, avk: Gn, awa: Hn, ay: Wn, azb: Zn, ba: Yn, ban: Xn, "ban-bali": ["ban"], bar: Qn, bbc: er, "bbc-latn": ["id"], bcc: tr, "be-tarask": ["be"], bgn: nr, bh: rr, bi: sr, bjn: ur, bm: ir, bpy: ar, bqi: or, br: lr, btm: cr, bug: dr, bxr: fr, ca: hr, "cbk-zam": ["es"], cdo: Dr, ce: pr, co: gr, crh: mr, "crh-cyrl": ["ru"], cs: br, csb: Cr, cv: vr, "de-at": ["de"], "de-ch": ["de"], "de-formal": ["de"], dsb: Ar, dtp: wr, dty: Er, egl: Fr, eml: yr, "en-ca": ["en"], "en-gb": ["en"], "es-419": ["es"], "es-formal": ["es"], ext: $r, ff: Br, fit: kr, frc: xr, frp: Sr, frr: _r, fur: Tr, gag: Or, gan: Ir, "gan-hans": ["zh-hans"], "gan-hant": ["zh-hant", "zh-hans"], gcr: Pr, gl: zr, glk: Nr, gn: Mr, gom: jr, "gom-deva": ["hi"], gor: Rr, gsw: Lr, guc: qr, hak: Ur, hif: Jr, hrx: Vr, hsb: Kr, ht: Gr, "hu-formal": ["hu"], hyw: Hr, ii: Wr, inh: Zr, io: Yr, iu: Xr, jam: Qr, jut: es, jv: ts, kaa: ns, kab: rs, kbd: ss, kbp: us, khw: is, kiu: as, kjp: os, kk: ls, "kk-arab": ["kk-cyrl"], "kk-cn": ["kk-arab", "kk-cyrl"], "kk-kz": ["kk-cyrl"], "kk-latn": ["kk-cyrl"], "kk-tr": ["kk-latn", "kk-cyrl"], kl: cs, "ko-kp": ["ko"], koi: ds, krc: fs, krl: hs, ks: Ds, ksh: ps, ku: gs, "ku-arab": ["ckb"], kum: ms, kv: bs, lad: Cs, lb: vs, lbe: As, lez: ws, li: Es, lij: Fs, liv: ys, lki: $s, lld: Bs, lmo: ks, ln: xs, lrc: Ss, ltg: _s, luz: Ts, lzh: Os, lzz: Is, mad: Ps, mai: zs, "map-bms": ["jv", "id"], mdf: Ns, mg: Ms, mhr: js, min: Rs, mnw: Ls, mo: qs, mrj: Us, "ms-arab": ["ms"], mwl: Js, myv: Vs, mzn: Ks, nah: Gs, nan: Hs, nap: Ws, nb: Zs, nds: Ys, "nds-nl": ["nl"], nia: Xs, "nl-informal": ["nl"], nn: Qs, nrm: eu, oc: tu, olo: nu, os: ru, pcd: su, pdc: uu, pdt: iu, pfl: au, pih: ou, pms: lu, pnt: cu, pt: du, "pt-br": ["pt"], qu: fu, qug: hu, rgn: Du, rmy: pu, "roa-tara": ["it"], rue: gu, rup: mu, ruq: bu, "ruq-cyrl": ["mk"], "ruq-latn": ["ro"], sa: Cu, sah: vu, scn: Au, sco: wu, sdc: Eu, sdh: Fu, ses: yu, sg: $u, sgs: Bu, sh: ku, shi: xu, shy: Su, "shy-latn": ["fr"], sk: _u, skr: Tu, "skr-arab": ["ur", "pnb"], sli: Ou, smn: Iu, sr: Pu, srn: zu, stq: Nu, sty: Mu, su: ju, szl: Ru, szy: Lu, tay: qu, tcy: Uu, tet: Ju, tg: Vu, trv: Ku, tt: Gu, "tt-cyrl": ["ru"], ty: Hu, tyv: Wu, udm: Zu, ug: Yu, vec: Xu, vep: Qu, vls: ei, vmf: ti, vot: ni, vro: ri, wa: si, wo: ui, wuu: ii, xal: ai, xmf: oi, yi: li, za: ci, zea: di, zgh: fi, zh: hi, "zh-cn": ["zh-hans"], "zh-hant": ["zh-hans"], "zh-hk": ["zh-hant", "zh-hans"], "zh-mo": ["zh-hk", "zh-hant", "zh-hans"], "zh-my": ["zh-sg", "zh-hans"], "zh-sg": ["zh-hans"], "zh-tw": ["zh-hant", "zh-hans"] };
|
|
562
|
+
let ie = class {
|
|
563
563
|
constructor(e) {
|
|
564
564
|
this.locale = e;
|
|
565
565
|
}
|
|
566
566
|
convertPlural(e, t) {
|
|
567
|
-
const
|
|
567
|
+
const n = /\d+=/i;
|
|
568
568
|
if (!t || t.length === 0) return "";
|
|
569
569
|
for (let s = 0; s < t.length; s++) {
|
|
570
570
|
const u = t[s];
|
|
571
|
-
if (
|
|
571
|
+
if (n.test(u)) {
|
|
572
572
|
if (parseInt(u.slice(0, u.indexOf("=")), 10) === e) return u.slice(u.indexOf("=") + 1);
|
|
573
573
|
t[s] = void 0;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
t = t.filter((s) => !!s);
|
|
577
|
-
let
|
|
578
|
-
return
|
|
577
|
+
let r = this.getPluralForm(e, this.locale);
|
|
578
|
+
return r = Math.min(r, t.length - 1), t[r];
|
|
579
579
|
}
|
|
580
580
|
getPluralForm(e, t) {
|
|
581
|
-
const
|
|
582
|
-
return
|
|
581
|
+
const n = ["zero", "one", "two", "few", "many", "other"], r = new Intl.PluralRules(t), s = r.resolvedOptions().pluralCategories, u = r.select(e);
|
|
582
|
+
return n.filter((o) => s.includes(o)).indexOf(u);
|
|
583
583
|
}
|
|
584
584
|
convertNumber(e, t = !1) {
|
|
585
|
-
let
|
|
585
|
+
let n = this.digitTransformTable(this.locale), r = "";
|
|
586
586
|
if (t) {
|
|
587
|
-
if (parseFloat(e, 10) === e || !
|
|
587
|
+
if (parseFloat(e, 10) === e || !n) return e;
|
|
588
588
|
const s = [];
|
|
589
|
-
for (const
|
|
590
|
-
|
|
589
|
+
for (const o in n) s[n[o]] = o;
|
|
590
|
+
n = s;
|
|
591
591
|
const u = String(e);
|
|
592
|
-
for (let
|
|
593
|
-
return parseFloat(
|
|
592
|
+
for (let o = 0; o < u.length; o++) r += n[u[o]] || u[o];
|
|
593
|
+
return parseFloat(r, 10);
|
|
594
594
|
}
|
|
595
595
|
if (Intl.NumberFormat) {
|
|
596
596
|
let s;
|
|
597
|
-
const u = [
|
|
598
|
-
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ? s = [this.locale] : s = u,
|
|
597
|
+
const u = [...St[this.locale] || [], "en"];
|
|
598
|
+
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ? s = [this.locale] : s = u, r = new Intl.NumberFormat(s).format(e), r === "NaN" && (r = e), r;
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
convertGrammar(e) {
|
|
@@ -607,9 +607,9 @@ let ue = class {
|
|
|
607
607
|
return e === "male" ? t[0] : e === "female" ? t[1] : t.length === 3 ? t[2] : t[0];
|
|
608
608
|
}
|
|
609
609
|
digitTransformTable(e) {
|
|
610
|
-
return
|
|
610
|
+
return ft[e] ? ft[e].split("") : !1;
|
|
611
611
|
}
|
|
612
|
-
},
|
|
612
|
+
}, Di = class extends ie {
|
|
613
613
|
convertGrammar(e, t) {
|
|
614
614
|
switch (t) {
|
|
615
615
|
case "prefixed":
|
|
@@ -618,9 +618,9 @@ let ue = class {
|
|
|
618
618
|
}
|
|
619
619
|
return e;
|
|
620
620
|
}
|
|
621
|
-
},
|
|
622
|
-
convertGrammar(t,
|
|
623
|
-
switch (
|
|
621
|
+
}, pi = class extends ie {
|
|
622
|
+
convertGrammar(t, n) {
|
|
623
|
+
switch (n) {
|
|
624
624
|
case "instrumental":
|
|
625
625
|
t = "s " + t;
|
|
626
626
|
break;
|
|
@@ -630,7 +630,7 @@ let ue = class {
|
|
|
630
630
|
}
|
|
631
631
|
return t;
|
|
632
632
|
}
|
|
633
|
-
},
|
|
633
|
+
}, gi = class extends ie {
|
|
634
634
|
convertGrammar(e, t) {
|
|
635
635
|
switch (t) {
|
|
636
636
|
case "instrumental":
|
|
@@ -642,7 +642,7 @@ let ue = class {
|
|
|
642
642
|
}
|
|
643
643
|
return e;
|
|
644
644
|
}
|
|
645
|
-
},
|
|
645
|
+
}, mi = class extends ie {
|
|
646
646
|
convertGrammar(e, t) {
|
|
647
647
|
switch (t) {
|
|
648
648
|
case "instrumental":
|
|
@@ -654,40 +654,40 @@ let ue = class {
|
|
|
654
654
|
}
|
|
655
655
|
return e;
|
|
656
656
|
}
|
|
657
|
-
},
|
|
657
|
+
}, bi = class extends ie {
|
|
658
658
|
convertGrammar(e, t) {
|
|
659
|
-
let
|
|
660
|
-
const
|
|
661
|
-
switch (e.match(/wiki$/i) && (
|
|
659
|
+
let n = e.match(/[aou][^äöy]*$/i);
|
|
660
|
+
const r = e;
|
|
661
|
+
switch (e.match(/wiki$/i) && (n = !1), e.match(/[bcdfghjklmnpqrstvwxz]$/i) && (e += "i"), t) {
|
|
662
662
|
case "genitive":
|
|
663
663
|
e += "n";
|
|
664
664
|
break;
|
|
665
665
|
case "elative":
|
|
666
|
-
e +=
|
|
666
|
+
e += n ? "sta" : "stä";
|
|
667
667
|
break;
|
|
668
668
|
case "partitive":
|
|
669
|
-
e +=
|
|
669
|
+
e += n ? "a" : "ä";
|
|
670
670
|
break;
|
|
671
671
|
case "illative":
|
|
672
672
|
e += e.slice(-1) + "n";
|
|
673
673
|
break;
|
|
674
674
|
case "inessive":
|
|
675
|
-
e +=
|
|
675
|
+
e += n ? "ssa" : "ssä";
|
|
676
676
|
break;
|
|
677
677
|
default:
|
|
678
|
-
e =
|
|
678
|
+
e = r;
|
|
679
679
|
break;
|
|
680
680
|
}
|
|
681
681
|
return e;
|
|
682
682
|
}
|
|
683
|
-
},
|
|
683
|
+
}, Ci = class extends ie {
|
|
684
684
|
convertGrammar(e, t) {
|
|
685
685
|
return t === "genitive" && (e.slice(-1) === "ь" ? e = e.slice(0, -1) + "я" : e.slice(-2) === "ия" ? e = e.slice(0, -2) + "ии" : e.slice(-2) === "ка" ? e = e.slice(0, -2) + "ки" : e.slice(-2) === "ти" ? e = e.slice(0, -2) + "тей" : e.slice(-2) === "ды" ? e = e.slice(0, -2) + "дов" : e.slice(-3) === "ник" && (e = e.slice(0, -3) + "ника")), e;
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
|
-
class
|
|
689
|
-
convertGrammar(t,
|
|
690
|
-
switch (
|
|
688
|
+
class vi extends ie {
|
|
689
|
+
convertGrammar(t, n) {
|
|
690
|
+
switch (n) {
|
|
691
691
|
case "mestnik":
|
|
692
692
|
t = "o " + t;
|
|
693
693
|
break;
|
|
@@ -698,7 +698,7 @@ class gi extends ue {
|
|
|
698
698
|
return t;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
let
|
|
701
|
+
let Ai = class extends ie {
|
|
702
702
|
convertGrammar(e, t) {
|
|
703
703
|
switch (t) {
|
|
704
704
|
case "genitive":
|
|
@@ -714,12 +714,12 @@ let mi = class extends ue {
|
|
|
714
714
|
return e;
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
|
-
class
|
|
718
|
-
convertGrammar(t,
|
|
719
|
-
return
|
|
717
|
+
class wi extends ie {
|
|
718
|
+
convertGrammar(t, n) {
|
|
719
|
+
return n === "genitive" && (t.slice(-1) === "ա" ? t = t.slice(0, -1) + "այի" : t.slice(-1) === "ո" ? t = t.slice(0, -1) + "ոյի" : t.slice(-4) === "գիրք" ? t = t.slice(0, -4) + "գրքի" : t = t + "ի"), t;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
let
|
|
722
|
+
let Ei = class extends ie {
|
|
723
723
|
convertGrammar(e, t) {
|
|
724
724
|
if (t === "ainmlae") switch (e) {
|
|
725
725
|
case "an Domhnach":
|
|
@@ -746,7 +746,7 @@ let Ci = class extends ue {
|
|
|
746
746
|
}
|
|
747
747
|
return e;
|
|
748
748
|
}
|
|
749
|
-
},
|
|
749
|
+
}, Fi = class extends ie {
|
|
750
750
|
convertGrammar(e, t) {
|
|
751
751
|
switch (t) {
|
|
752
752
|
case "rol":
|
|
@@ -761,27 +761,27 @@ let Ci = class extends ue {
|
|
|
761
761
|
}
|
|
762
762
|
return e;
|
|
763
763
|
}
|
|
764
|
-
},
|
|
764
|
+
}, yi = class extends ie {
|
|
765
765
|
convertGrammar(e, t) {
|
|
766
|
-
let
|
|
767
|
-
switch (
|
|
766
|
+
let n, r, s, u;
|
|
767
|
+
switch (n = "мæ", r = "", s = "", u = "", e.match(/тæ$/i) ? (e = e.slice(0, -1), n = "æм") : e.match(/[аæеёиоыэюя]$/i) ? r = "й" : e.match(/у$/i) ? e.slice(-2, -1).match(/[аæеёиоыэюя]$/i) || (r = "й") : e.match(/[бвгджзйклмнопрстфхцчшщьъ]$/i) || (s = "-"), t) {
|
|
768
768
|
case "genitive":
|
|
769
|
-
u = s +
|
|
769
|
+
u = s + r + "ы";
|
|
770
770
|
break;
|
|
771
771
|
case "dative":
|
|
772
|
-
u = s +
|
|
772
|
+
u = s + r + "æн";
|
|
773
773
|
break;
|
|
774
774
|
case "allative":
|
|
775
|
-
u = s +
|
|
775
|
+
u = s + n;
|
|
776
776
|
break;
|
|
777
777
|
case "ablative":
|
|
778
|
-
|
|
778
|
+
r === "й" ? u = s + r + "æ" : u = s + r + "æй";
|
|
779
779
|
break;
|
|
780
780
|
case "superessive":
|
|
781
|
-
u = s +
|
|
781
|
+
u = s + r + "ыл";
|
|
782
782
|
break;
|
|
783
783
|
case "equative":
|
|
784
|
-
u = s +
|
|
784
|
+
u = s + r + "ау";
|
|
785
785
|
break;
|
|
786
786
|
case "comitative":
|
|
787
787
|
u = s + "имæ";
|
|
@@ -790,9 +790,9 @@ let Ci = class extends ue {
|
|
|
790
790
|
return e + u;
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
|
-
class
|
|
794
|
-
convertGrammar(t,
|
|
795
|
-
switch (
|
|
793
|
+
class $i extends ie {
|
|
794
|
+
convertGrammar(t, n) {
|
|
795
|
+
switch (n) {
|
|
796
796
|
case "genitive":
|
|
797
797
|
t.slice(-1) === "ь" ? t = t.slice(0, -1) + "я" : t.slice(-2) === "ія" ? t = t.slice(0, -2) + "ії" : t.slice(-2) === "ка" ? t = t.slice(0, -2) + "ки" : t.slice(-2) === "ти" ? t = t.slice(0, -2) + "тей" : t.slice(-2) === "ды" ? t = t.slice(0, -2) + "дов" : t.slice(-3) === "ник" && (t = t.slice(0, -3) + "ника");
|
|
798
798
|
break;
|
|
@@ -803,346 +803,346 @@ class Fi extends ue {
|
|
|
803
803
|
return t;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
var
|
|
807
|
-
const
|
|
808
|
-
let
|
|
806
|
+
var ht = { bs: pi, default: ie, dsb: gi, fi: bi, ga: Ei, he: Di, hsb: mi, hu: Fi, hy: wi, la: Ai, os: yi, ru: Ci, sl: vi, uk: $i };
|
|
807
|
+
const Bi = new RegExp("(?:([A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁːˑˠ-ˤˮͰ-ͳͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-҂Ҋ-ԯԱ-Ֆՙ-՟ա-և։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ঀংঃঅ-ঌএঐও-নপ-রলশ-হঽ-ীেৈোৌৎৗড়ঢ়য়-ৡ০-ৱ৴-৺ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ીૉોૌૐૠૡ૦-૰ૹଂଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽାୀେୈୋୌୗଡ଼ଢ଼ୟ-ୡ୦-୷ஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹாிுூெ-ைொ-ௌௐௗ௦-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౚౠౡ౦-౯౿ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊೋೕೖೞೠೡ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ീെ-ൈൊ-ൌൎൗൟ-ൡ൦-൵൹-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-෴ก-ะาำเ-ๆ๏-๛ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆ໐-໙ໜ-ໟༀ-༗༚-༴༶༸༾-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿚က-ာေးျြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃႄႇ-ႌႎ-ႜ႞-ჅჇჍა-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፼ᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙿᚁ-ᚚᚠ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះៈ។-៚ៜ០-៩᠐-᠙ᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰᤱᤳ-ᤸ᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧚ᨀ-ᨖᨙᨚ᨞-ᩕᩗᩡᩣᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-ᭋ᭐-᭪᭴-᭼ᮂ-ᮡᮦᮧ᮪ᮮ-ᯥᯧᯪ-ᯬᯮ᯲᯳᯼-ᰫᰴᰵ᰻-᱉ᱍ-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〮〯〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎ㆐-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿕ꀀ-ꒌꓐ-ꘌꘐ-ꘫꙀ-ꙮꚀ-ꚝꚠ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꞭꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꣽ꤀-ꤥ꤮-ꥆꥒ꥓꥟-ꥼꦃ-ꦲꦴꦵꦺꦻꦽ-꧍ꧏ-꧙꧞-ꧤꧦ-ꧾꨀ-ꨨꨯꨰꨳꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-ꩻꩽ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫫꫮ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭥꭰ-ꯤꯦꯧꯩ-꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]|\uD800[\uDC00-\uDC0B]|\uD800[\uDC0D-\uDC26]|\uD800[\uDC28-\uDC3A]|𐀼|𐀽|\uD800[\uDC3F-\uDC4D]|\uD800[\uDC50-\uDC5D]|\uD800[\uDC80-\uDCFA]|𐄀|𐄂|\uD800[\uDD07-\uDD33]|\uD800[\uDD37-\uDD3F]|\uD800[\uDDD0-\uDDFC]|\uD800[\uDE80-\uDE9C]|\uD800[\uDEA0-\uDED0]|\uD800[\uDF00-\uDF23]|\uD800[\uDF30-\uDF4A]|\uD800[\uDF50-\uDF75]|\uD800[\uDF80-\uDF9D]|\uD800[\uDF9F-\uDFC3]|\uD800[\uDFC8-\uDFD5]|\uD801[\uDC00-\uDC9D]|\uD801[\uDCA0-\uDCA9]|\uD801[\uDD00-\uDD27]|\uD801[\uDD30-\uDD63]|𐕯|\uD801[\uDE00-\uDF36]|\uD801[\uDF40-\uDF55]|\uD801[\uDF60-\uDF67]|𑀀|\uD804[\uDC02-\uDC37]|\uD804[\uDC47-\uDC4D]|\uD804[\uDC66-\uDC6F]|\uD804[\uDC82-\uDCB2]|𑂷|𑂸|\uD804[\uDCBB-\uDCC1]|\uD804[\uDCD0-\uDCE8]|\uD804[\uDCF0-\uDCF9]|\uD804[\uDD03-\uDD26]|𑄬|\uD804[\uDD36-\uDD43]|\uD804[\uDD50-\uDD72]|\uD804[\uDD74-\uDD76]|\uD804[\uDD82-\uDDB5]|\uD804[\uDDBF-\uDDC9]|𑇍|\uD804[\uDDD0-\uDDDF]|\uD804[\uDDE1-\uDDF4]|\uD804[\uDE00-\uDE11]|\uD804[\uDE13-\uDE2E]|𑈲|𑈳|𑈵|\uD804[\uDE38-\uDE3D]|\uD804[\uDE80-\uDE86]|𑊈|\uD804[\uDE8A-\uDE8D]|\uD804[\uDE8F-\uDE9D]|\uD804[\uDE9F-\uDEA9]|\uD804[\uDEB0-\uDEDE]|\uD804[\uDEE0-\uDEE2]|\uD804[\uDEF0-\uDEF9]|𑌂|𑌃|\uD804[\uDF05-\uDF0C]|𑌏|𑌐|\uD804[\uDF13-\uDF28]|\uD804[\uDF2A-\uDF30]|𑌲|𑌳|\uD804[\uDF35-\uDF39]|\uD804[\uDF3D-\uDF3F]|\uD804[\uDF41-\uDF44]|𑍇|𑍈|\uD804[\uDF4B-\uDF4D]|𑍐|𑍗|\uD804[\uDF5D-\uDF63]|\uD805[\uDC80-\uDCB2]|𑒹|\uD805[\uDCBB-\uDCBE]|𑓁|\uD805[\uDCC4-\uDCC7]|\uD805[\uDCD0-\uDCD9]|\uD805[\uDD80-\uDDB1]|\uD805[\uDDB8-\uDDBB]|𑖾|\uD805[\uDDC1-\uDDDB]|\uD805[\uDE00-\uDE32]|𑘻|𑘼|𑘾|\uD805[\uDE41-\uDE44]|\uD805[\uDE50-\uDE59]|\uD805[\uDE80-\uDEAA]|𑚬|𑚮|𑚯|𑚶|\uD805[\uDEC0-\uDEC9]|\uD805[\uDF00-\uDF19]|𑜠|𑜡|𑜦|\uD805[\uDF30-\uDF3F]|\uD806[\uDCA0-\uDCF2]|𑣿|\uD806[\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E]|\uD809[\uDC70-\uDC74]|\uD809[\uDC80-\uDD43]|\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38]|\uD81A[\uDE40-\uDE5E]|\uD81A[\uDE60-\uDE69]|𖩮|𖩯|\uD81A[\uDED0-\uDEED]|𖫵|\uD81A[\uDF00-\uDF2F]|\uD81A[\uDF37-\uDF45]|\uD81A[\uDF50-\uDF59]|\uD81A[\uDF5B-\uDF61]|\uD81A[\uDF63-\uDF77]|\uD81A[\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44]|\uD81B[\uDF50-\uDF7E]|\uD81B[\uDF93-\uDF9F]|𛀀|𛀁|\uD82F[\uDC00-\uDC6A]|\uD82F[\uDC70-\uDC7C]|\uD82F[\uDC80-\uDC88]|\uD82F[\uDC90-\uDC99]|𛲜|𛲟|\uD834[\uDC00-\uDCF5]|\uD834[\uDD00-\uDD26]|\uD834[\uDD29-\uDD66]|\uD834[\uDD6A-\uDD72]|𝆃|𝆄|\uD834[\uDD8C-\uDDA9]|\uD834[\uDDAE-\uDDE8]|\uD834[\uDF60-\uDF71]|\uD835[\uDC00-\uDC54]|\uD835[\uDC56-\uDC9C]|𝒞|𝒟|𝒢|𝒥|𝒦|\uD835[\uDCA9-\uDCAC]|\uD835[\uDCAE-\uDCB9]|𝒻|\uD835[\uDCBD-\uDCC3]|\uD835[\uDCC5-\uDD05]|\uD835[\uDD07-\uDD0A]|\uD835[\uDD0D-\uDD14]|\uD835[\uDD16-\uDD1C]|\uD835[\uDD1E-\uDD39]|\uD835[\uDD3B-\uDD3E]|\uD835[\uDD40-\uDD44]|𝕆|\uD835[\uDD4A-\uDD50]|\uD835[\uDD52-\uDEA5]|\uD835[\uDEA8-\uDEDA]|\uD835[\uDEDC-\uDF14]|\uD835[\uDF16-\uDF4E]|\uD835[\uDF50-\uDF88]|\uD835[\uDF8A-\uDFC2]|\uD835[\uDFC4-\uDFCB]|\uD836[\uDC00-\uDDFF]|\uD836[\uDE37-\uDE3A]|\uD836[\uDE6D-\uDE74]|\uD836[\uDE76-\uDE83]|\uD836[\uDE85-\uDE8B]|\uD83C[\uDD10-\uDD2E]|\uD83C[\uDD30-\uDD69]|\uD83C[\uDD70-\uDD9A]|\uD83C[\uDDE6-\uDE02]|\uD83C[\uDE10-\uDE3A]|\uD83C[\uDE40-\uDE48]|🉐|🉑|[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6]|\uD869[\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34]|\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD86E[\uDC20-\uDFFF]|[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|[\uDB80-\uDBBE][\uDC00-\uDFFF]|\uDBBF[\uDC00-\uDFFD]|[\uDBC0-\uDBFE][\uDC00-\uDFFF]|\uDBFF[\uDC00-\uDFFD])|([־׀׃׆-߀-ߪߴߵߺ-ࠕࠚࠤࠨ-ࡘ-࢟יִײַ-ﬨשׁ-ﭏ؈؋؍؛-ي٭-ٯٱ-ەۥۦۮۯۺ-ܐܒ-ܯ-ޥޱ-ࢠ-ﭐ-ﴽ﵀-﷏ﷰ-﷼﷾﷿ﹰ-]|\uD802[\uDC00-\uDD1E]|\uD802[\uDD20-\uDE00]||\uD802[\uDE07-\uDE0B]|\uD802[\uDE10-\uDE37]|\uD802[\uDE3B-\uDE3E]|\uD802[\uDE40-\uDEE4]|\uD802[\uDEE7-\uDF38]|\uD802[\uDF40-\uDFFF]|\uD803[\uDC00-\uDE5F]|\uD803[\uDE7F-\uDFFF]|\uD83A[\uDC00-\uDCCF]|\uD83A[\uDCD7-\uDFFF]|\uD83B[\uDC00-\uDDFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDF00-\uDFFF]|\uD83B[\uDE00-\uDEEF]|\uD83B[\uDEF2-\uDEFF]))");
|
|
808
|
+
let _t = class {
|
|
809
809
|
constructor(e) {
|
|
810
|
-
this.locale =
|
|
810
|
+
this.locale = Be(e), this.language = new (ht[this.locale] || ht.default)(this.locale);
|
|
811
811
|
}
|
|
812
812
|
emit(e, t) {
|
|
813
|
-
let
|
|
813
|
+
let n, r, s;
|
|
814
814
|
switch (typeof e) {
|
|
815
815
|
case "string":
|
|
816
816
|
case "number":
|
|
817
|
-
|
|
817
|
+
n = e;
|
|
818
818
|
break;
|
|
819
819
|
case "object":
|
|
820
|
-
if (
|
|
820
|
+
if (r = e.slice(1).map((u) => this.emit(u, t)), s = e[0].toLowerCase(), typeof this[s] == "function") n = this[s](r, t);
|
|
821
821
|
else throw new Error('unknown operation "' + s + '"');
|
|
822
822
|
break;
|
|
823
823
|
case "undefined":
|
|
824
|
-
|
|
824
|
+
n = "";
|
|
825
825
|
break;
|
|
826
826
|
default:
|
|
827
827
|
throw new Error("unexpected type in AST: " + typeof e);
|
|
828
828
|
}
|
|
829
|
-
return
|
|
829
|
+
return n;
|
|
830
830
|
}
|
|
831
831
|
concat(e) {
|
|
832
832
|
let t = "";
|
|
833
|
-
return e.forEach((
|
|
834
|
-
t +=
|
|
833
|
+
return e.forEach((n) => {
|
|
834
|
+
t += n;
|
|
835
835
|
}), t;
|
|
836
836
|
}
|
|
837
837
|
replace(e, t) {
|
|
838
|
-
const
|
|
839
|
-
return
|
|
838
|
+
const n = parseInt(e[0], 10);
|
|
839
|
+
return n < t.length ? t[n] : "$" + (n + 1);
|
|
840
840
|
}
|
|
841
841
|
plural(e) {
|
|
842
|
-
const t = parseFloat(this.language.convertNumber(e[0], 10)),
|
|
843
|
-
return
|
|
842
|
+
const t = parseFloat(this.language.convertNumber(e[0], 10)), n = e.slice(1);
|
|
843
|
+
return n.length ? this.language.convertPlural(t, n) : "";
|
|
844
844
|
}
|
|
845
845
|
gender(e) {
|
|
846
|
-
const t = e[0],
|
|
847
|
-
return this.language.gender(t,
|
|
846
|
+
const t = e[0], n = e.slice(1);
|
|
847
|
+
return this.language.gender(t, n);
|
|
848
848
|
}
|
|
849
849
|
grammar(e) {
|
|
850
|
-
const t = e[0],
|
|
851
|
-
return
|
|
850
|
+
const t = e[0], n = e[1];
|
|
851
|
+
return n && t && this.language.convertGrammar(n, t);
|
|
852
852
|
}
|
|
853
853
|
wikilink(e) {
|
|
854
|
-
let t,
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
return e.length === 1 ? t =
|
|
854
|
+
let t, n = e[0];
|
|
855
|
+
n.charAt(0) === ":" && (n = n.slice(1));
|
|
856
|
+
const r = `./${n}`;
|
|
857
|
+
return e.length === 1 ? t = n : t = e[1], `<a href="${r}" title="${n}">${t}</a>`;
|
|
858
858
|
}
|
|
859
859
|
extlink(e) {
|
|
860
860
|
if (e.length !== 2) throw new Error("Expected two items in the node");
|
|
861
861
|
return `<a href="${e[0]}">${e[1]}</a>`;
|
|
862
862
|
}
|
|
863
863
|
bidi(e) {
|
|
864
|
-
const t =
|
|
864
|
+
const t = ki(e[0]);
|
|
865
865
|
return t === "ltr" ? "" + e[0] + "" : t === "rtl" ? "" + e[0] + "" : e[0];
|
|
866
866
|
}
|
|
867
867
|
formatnum(e) {
|
|
868
|
-
const t = !!e[1] && e[1] === "R",
|
|
869
|
-
return typeof
|
|
868
|
+
const t = !!e[1] && e[1] === "R", n = e[0];
|
|
869
|
+
return typeof n == "string" || typeof n == "number" ? this.language.convertNumber(n, t) : n;
|
|
870
870
|
}
|
|
871
871
|
htmlattributes(e) {
|
|
872
872
|
const t = {};
|
|
873
|
-
for (let
|
|
873
|
+
for (let n = 0, r = e.length; n < r; n += 2) t[e[n]] = e[n + 1];
|
|
874
874
|
return t;
|
|
875
875
|
}
|
|
876
876
|
htmlelement(e) {
|
|
877
|
-
const t = e.shift(),
|
|
878
|
-
let
|
|
879
|
-
for (const
|
|
880
|
-
Array.isArray(
|
|
881
|
-
const u =
|
|
877
|
+
const t = e.shift(), n = e.shift();
|
|
878
|
+
let r = e, s = "";
|
|
879
|
+
for (const o in n) s += ` ${o}="${n[o]}"`;
|
|
880
|
+
Array.isArray(r) || (r = [r]);
|
|
881
|
+
const u = r.join("");
|
|
882
882
|
return `<${t}${s}>${u}</${t}>`;
|
|
883
883
|
}
|
|
884
884
|
};
|
|
885
|
-
function
|
|
885
|
+
function Be(e) {
|
|
886
886
|
return typeof e == "string" ? e.toLowerCase() : e;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
const t = e.match(
|
|
888
|
+
function ki(e) {
|
|
889
|
+
const t = e.match(Bi);
|
|
890
890
|
return t ? t[2] === void 0 ? "ltr" : "rtl" : null;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
let
|
|
894
|
-
function
|
|
892
|
+
function xi(e, { wikilinks: t = !1 } = {}) {
|
|
893
|
+
let n = 0;
|
|
894
|
+
function r(i) {
|
|
895
895
|
return () => {
|
|
896
|
-
for (let
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
896
|
+
for (let d = 0; d < i.length; d++) {
|
|
897
|
+
const y = i[d]();
|
|
898
|
+
if (y !== null) return y;
|
|
899
899
|
}
|
|
900
900
|
return null;
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
function s(
|
|
904
|
-
const
|
|
905
|
-
for (let
|
|
906
|
-
const
|
|
907
|
-
if (
|
|
908
|
-
|
|
903
|
+
function s(i) {
|
|
904
|
+
const d = n, y = [];
|
|
905
|
+
for (let A = 0; A < i.length; A++) {
|
|
906
|
+
const q = i[A]();
|
|
907
|
+
if (q === null) return n = d, null;
|
|
908
|
+
y.push(q);
|
|
909
909
|
}
|
|
910
|
-
return
|
|
910
|
+
return y;
|
|
911
911
|
}
|
|
912
|
-
function u(
|
|
912
|
+
function u(i, d) {
|
|
913
913
|
return () => {
|
|
914
|
-
const
|
|
915
|
-
let
|
|
916
|
-
for (;
|
|
917
|
-
return
|
|
914
|
+
const y = n, A = [];
|
|
915
|
+
let q = d();
|
|
916
|
+
for (; q !== null; ) A.push(q), q = d();
|
|
917
|
+
return A.length < i ? (n = y, null) : A;
|
|
918
918
|
};
|
|
919
919
|
}
|
|
920
|
-
function i
|
|
921
|
-
const
|
|
920
|
+
function o(i) {
|
|
921
|
+
const d = i.length;
|
|
922
922
|
return () => {
|
|
923
|
-
let
|
|
924
|
-
return e.slice(
|
|
923
|
+
let y = null;
|
|
924
|
+
return e.slice(n, n + d) === i && (y = i, n += d), y;
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function l(i) {
|
|
928
928
|
return () => {
|
|
929
|
-
const
|
|
930
|
-
return
|
|
929
|
+
const d = e.slice(n).match(i);
|
|
930
|
+
return d === null ? null : (n += d[0].length, d[0]);
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
const
|
|
934
|
-
function
|
|
933
|
+
const v = l(/^\s+/), B = o("|"), D = o(":"), x = o("\\"), te = l(/^./), ue = o("$"), ge = l(/^\d+/), z = o('"'), H = o("'"), W = l(t ? /^[^{}[\]$<\\]/ : /^[^{}$<\\]/), ne = l(t ? /^[^{}[\]$\\|]/ : /^[^{}$\\|]/), K = l(t ? /^[^{}[\]$\s]/ : /^[^{}$\s]/);
|
|
934
|
+
function Q(i, d) {
|
|
935
935
|
return () => {
|
|
936
|
-
const
|
|
937
|
-
return
|
|
936
|
+
const y = i();
|
|
937
|
+
return y === null ? null : d(y);
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
const
|
|
942
|
-
return
|
|
940
|
+
function U() {
|
|
941
|
+
const i = u(1, Y)();
|
|
942
|
+
return i === null ? null : i.join("");
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
const
|
|
946
|
-
return
|
|
944
|
+
function he() {
|
|
945
|
+
const i = u(1, be)();
|
|
946
|
+
return i === null ? null : i.join("");
|
|
947
947
|
}
|
|
948
|
-
const
|
|
948
|
+
const me = r([k, K]);
|
|
949
949
|
function De() {
|
|
950
|
-
const
|
|
951
|
-
return
|
|
950
|
+
const i = u(1, me)();
|
|
951
|
+
return i === null ? null : i.join("");
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
const
|
|
955
|
-
return
|
|
953
|
+
function k() {
|
|
954
|
+
const i = s([x, te]);
|
|
955
|
+
return i === null ? null : i[1];
|
|
956
956
|
}
|
|
957
|
-
const
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
return
|
|
957
|
+
const Y = r([k, ne]), be = r([k, W]);
|
|
958
|
+
function ae() {
|
|
959
|
+
const i = s([ue, ge]);
|
|
960
|
+
return i === null ? null : ["REPLACE", parseInt(i[1], 10) - 1];
|
|
961
961
|
}
|
|
962
|
-
const
|
|
963
|
-
return
|
|
962
|
+
const oe = Q(l(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/), function(i) {
|
|
963
|
+
return i.toString();
|
|
964
964
|
});
|
|
965
965
|
function b() {
|
|
966
|
-
const
|
|
967
|
-
if (
|
|
968
|
-
const
|
|
969
|
-
return
|
|
970
|
-
}
|
|
971
|
-
function Z() {
|
|
972
|
-
const l = s([ne, p, A]);
|
|
973
|
-
return l === null ? null : [l[0], l[2]];
|
|
974
|
-
}
|
|
975
|
-
function ge() {
|
|
976
|
-
const l = s([ne, p, w]);
|
|
977
|
-
return l === null ? null : [l[0], l[2]];
|
|
978
|
-
}
|
|
979
|
-
function we() {
|
|
980
|
-
const l = s([ne, p]);
|
|
981
|
-
return l === null ? null : [l[0], ""];
|
|
982
|
-
}
|
|
983
|
-
const ye = n([function() {
|
|
984
|
-
const l = s([n([Z, ge, we]), u(0, b)]);
|
|
985
|
-
return l === null ? null : l[0].concat(l[1]);
|
|
986
|
-
}, function() {
|
|
987
|
-
const l = s([ne, u(0, b)]);
|
|
988
|
-
return l === null ? null : [l[0]].concat(l[1]);
|
|
989
|
-
}]), Ce = i("{{"), Ae = i("}}"), _e = i("[["), Se = i("]]"), me = i("["), ve = i("]");
|
|
990
|
-
function Fe() {
|
|
991
|
-
const l = s([Ce, ye, Ae]);
|
|
992
|
-
return l === null ? null : l[1];
|
|
966
|
+
const i = s([B, u(0, G)]);
|
|
967
|
+
if (i === null) return null;
|
|
968
|
+
const d = i[1];
|
|
969
|
+
return d.length > 1 ? ["CONCAT"].concat(d) : d[0];
|
|
993
970
|
}
|
|
994
|
-
function
|
|
995
|
-
const
|
|
996
|
-
return
|
|
971
|
+
function pe() {
|
|
972
|
+
const i = s([oe, D, ae]);
|
|
973
|
+
return i === null ? null : [i[0], i[2]];
|
|
997
974
|
}
|
|
998
|
-
function
|
|
999
|
-
const
|
|
1000
|
-
return
|
|
975
|
+
function xe() {
|
|
976
|
+
const i = s([oe, D, G]);
|
|
977
|
+
return i === null ? null : [i[0], i[2]];
|
|
1001
978
|
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
979
|
+
function le() {
|
|
980
|
+
const i = s([oe, D]);
|
|
981
|
+
return i === null ? null : [i[0], ""];
|
|
982
|
+
}
|
|
983
|
+
const Fe = r([function() {
|
|
984
|
+
const i = s([r([pe, xe, le]), u(0, b)]);
|
|
985
|
+
return i === null ? null : i[0].concat(i[1]);
|
|
986
|
+
}, function() {
|
|
987
|
+
const i = s([oe, u(0, b)]);
|
|
988
|
+
return i === null ? null : [i[0]].concat(i[1]);
|
|
989
|
+
}]), Se = o("{{"), _e = o("}}"), Ee = o("[["), h = o("]]"), Ce = o("["), Ae = o("]");
|
|
990
|
+
function fe() {
|
|
991
|
+
const i = s([Se, Fe, _e]);
|
|
992
|
+
return i === null ? null : i[1];
|
|
993
|
+
}
|
|
994
|
+
function ye() {
|
|
995
|
+
const i = s([u(1, G), B, u(1, j)]);
|
|
996
|
+
return i === null ? null : [["CONCAT"].concat(i[0]), ["CONCAT"].concat(i[2])];
|
|
997
|
+
}
|
|
998
|
+
function Te() {
|
|
999
|
+
const i = s([u(1, G)]);
|
|
1000
|
+
return i === null ? null : [["CONCAT"].concat(i[0])];
|
|
1001
|
+
}
|
|
1002
|
+
const w = r([ye, Te]);
|
|
1003
|
+
function C() {
|
|
1004
|
+
let i = null;
|
|
1005
|
+
const d = s([Ee, w, h]);
|
|
1006
|
+
if (d !== null) {
|
|
1007
|
+
const y = d[1];
|
|
1008
|
+
i = ["WIKILINK"].concat(y);
|
|
1009
1009
|
}
|
|
1010
|
-
return
|
|
1011
|
-
}
|
|
1012
|
-
function
|
|
1013
|
-
let
|
|
1014
|
-
const
|
|
1015
|
-
return
|
|
1016
|
-
}
|
|
1017
|
-
const
|
|
1018
|
-
function
|
|
1019
|
-
if (
|
|
1020
|
-
const
|
|
1021
|
-
for (let
|
|
1022
|
-
const
|
|
1023
|
-
if (
|
|
1010
|
+
return i;
|
|
1011
|
+
}
|
|
1012
|
+
function _() {
|
|
1013
|
+
let i = null;
|
|
1014
|
+
const d = s([Ce, u(1, J), v, u(1, j), Ae]);
|
|
1015
|
+
return d !== null && (i = ["EXTLINK", d[1].length === 1 ? d[1][0] : ["CONCAT"].concat(d[1]), ["CONCAT"].concat(d[3])]), i;
|
|
1016
|
+
}
|
|
1017
|
+
const N = l(/^[A-Za-z]+/);
|
|
1018
|
+
function R(i, d, y, A = { allowedHtmlElements: ["b", "bdi", "del", "i", "ins", "u", "font", "big", "small", "sub", "sup", "h1", "h2", "h3", "h4", "h5", "h6", "cite", "code", "em", "s", "strike", "strong", "tt", "var", "div", "center", "blockquote", "ol", "ul", "dl", "table", "caption", "pre", "ruby", "rb", "rp", "rt", "rtc", "p", "span", "abbr", "dfn", "kbd", "samp", "data", "time", "mark", "li", "dt", "dd"], allowedHtmlCommonAttributes: ["id", "class", "style", "lang", "dir", "title", "aria-describedby", "aria-flowto", "aria-hidden", "aria-label", "aria-labelledby", "aria-owns", "role", "about", "property", "resource", "datatype", "typeof", "itemid", "itemprop", "itemref", "itemscope", "itemtype"], allowedHtmlAttributesByElement: {} }) {
|
|
1019
|
+
if (i = i.toLowerCase(), d = d.toLowerCase(), i !== d || A.allowedHtmlElements.indexOf(i) === -1) return !1;
|
|
1020
|
+
const q = /[\000-\010\013\016-\037\177]|expression|filter\s*:|accelerator\s*:|-o-link\s*:|-o-link-source\s*:|-o-replace\s*:|url\s*\(|image\s*\(|image-set\s*\(/i;
|
|
1021
|
+
for (let m = 0, c = y.length; m < c; m += 2) {
|
|
1022
|
+
const g = y[m];
|
|
1023
|
+
if (A.allowedHtmlCommonAttributes.indexOf(g) === -1 && (A.allowedHtmlAttributesByElement[i] || []).indexOf(g) === -1 || g === "style" && y[m + 1].search(q) !== -1) return !1;
|
|
1024
1024
|
}
|
|
1025
1025
|
return !0;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const
|
|
1029
|
-
return
|
|
1030
|
-
}
|
|
1031
|
-
function y() {
|
|
1032
|
-
const l = a(/^[^']*/), h = s([Q, l, Q]);
|
|
1033
|
-
return h === null ? null : h[1];
|
|
1027
|
+
function P() {
|
|
1028
|
+
const i = l(/^[^"]*/), d = s([z, i, z]);
|
|
1029
|
+
return d === null ? null : d[1];
|
|
1034
1030
|
}
|
|
1035
1031
|
function M() {
|
|
1036
|
-
const
|
|
1037
|
-
return
|
|
1032
|
+
const i = l(/^[^']*/), d = s([H, i, H]);
|
|
1033
|
+
return d === null ? null : d[1];
|
|
1038
1034
|
}
|
|
1039
|
-
function
|
|
1040
|
-
const l =
|
|
1041
|
-
return
|
|
1042
|
-
}
|
|
1043
|
-
function
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1035
|
+
function L() {
|
|
1036
|
+
const i = l(/^\s*=\s*/), d = s([v, N, i, r([P, M])]);
|
|
1037
|
+
return d === null ? null : [d[1], d[3]];
|
|
1038
|
+
}
|
|
1039
|
+
function T() {
|
|
1040
|
+
const i = u(0, L)();
|
|
1041
|
+
return Array.prototype.concat.apply(["HTMLATTRIBUTES"], i);
|
|
1042
|
+
}
|
|
1043
|
+
function X() {
|
|
1044
|
+
let i = null;
|
|
1045
|
+
const d = n, y = o("<"), A = l(/^\/?/), q = l(/^\s*>/), m = s([y, N, T, A, q]);
|
|
1046
|
+
if (m === null) return null;
|
|
1047
|
+
const c = n, g = m[1], O = u(0, j)(), ze = n, Ne = o("</"), it = s([Ne, N, q]);
|
|
1048
|
+
if (it === null) return ["CONCAT", e.slice(d, c)].concat(O);
|
|
1049
|
+
const Lt = n, qt = it[1], at = m[2], Ut = at.slice(1);
|
|
1050
|
+
if (R(g, qt, Ut)) i = ["HTMLELEMENT", g, at].concat(O);
|
|
1051
1051
|
else {
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1052
|
+
const ot = (Jt) => Jt.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1053
|
+
i = ["CONCAT", ot(e.slice(d, c))].concat(O, ot(e.slice(ze, Lt)));
|
|
1054
1054
|
}
|
|
1055
|
-
return
|
|
1055
|
+
return i;
|
|
1056
1056
|
}
|
|
1057
|
-
const
|
|
1058
|
-
function
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1057
|
+
const J = r([fe, ae, C, _, De]), j = r([fe, ae, C, _, X, he]), G = r([fe, ae, U]);
|
|
1058
|
+
function re() {
|
|
1059
|
+
const i = u(0, j)();
|
|
1060
|
+
return i === null ? null : ["CONCAT"].concat(i);
|
|
1061
1061
|
}
|
|
1062
|
-
const
|
|
1063
|
-
if (
|
|
1064
|
-
return
|
|
1062
|
+
const a = re();
|
|
1063
|
+
if (a === null || n !== e.length) throw new Error("Parse error at position " + n.toString() + " in input: " + e);
|
|
1064
|
+
return a;
|
|
1065
1065
|
}
|
|
1066
|
-
class
|
|
1067
|
-
constructor(t, { wikilinks:
|
|
1068
|
-
this.locale =
|
|
1066
|
+
class Dt {
|
|
1067
|
+
constructor(t, { wikilinks: n = !1 } = {}) {
|
|
1068
|
+
this.locale = Be(t), this.wikilinks = n, this.emitter = new _t(this.locale);
|
|
1069
1069
|
}
|
|
1070
|
-
parse(t,
|
|
1070
|
+
parse(t, n) {
|
|
1071
1071
|
if (t.includes("{{") || t.includes("<") || this.wikilinks && t.includes("[")) {
|
|
1072
|
-
const
|
|
1073
|
-
return this.emitter.emit(
|
|
1074
|
-
} else return this.simpleParse(t,
|
|
1072
|
+
const r = xi(t, { wikilinks: this.wikilinks });
|
|
1073
|
+
return this.emitter.emit(r, n);
|
|
1074
|
+
} else return this.simpleParse(t, n);
|
|
1075
1075
|
}
|
|
1076
|
-
simpleParse(t,
|
|
1077
|
-
return t.replace(/\$(\d+)/g, (
|
|
1076
|
+
simpleParse(t, n) {
|
|
1077
|
+
return t.replace(/\$(\d+)/g, (r, s) => {
|
|
1078
1078
|
const u = parseInt(s, 10) - 1;
|
|
1079
|
-
return
|
|
1079
|
+
return n[u] !== void 0 ? n[u] : "$" + s;
|
|
1080
1080
|
});
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
|
-
class
|
|
1083
|
+
class Si {
|
|
1084
1084
|
constructor() {
|
|
1085
1085
|
this.sourceMap = /* @__PURE__ */ new Map();
|
|
1086
1086
|
}
|
|
1087
|
-
load(t,
|
|
1087
|
+
load(t, n) {
|
|
1088
1088
|
if (typeof t != "object") throw new Error("Invalid message source. Must be an object");
|
|
1089
|
-
if (
|
|
1090
|
-
if (!/^[a-zA-Z0-9-]+$/.test(
|
|
1091
|
-
for (const
|
|
1092
|
-
if (typeof t[
|
|
1093
|
-
if (typeof t[
|
|
1089
|
+
if (n = Be(n), n) {
|
|
1090
|
+
if (!/^[a-zA-Z0-9-]+$/.test(n)) throw new Error(`Invalid locale ${n}`);
|
|
1091
|
+
for (const r in t) if (r.indexOf("@") !== 0) {
|
|
1092
|
+
if (typeof t[r] == "object") return this.load(t);
|
|
1093
|
+
if (typeof t[r] != "string") throw new Error(`Invalid message for message ${r} in ${n} locale.`);
|
|
1094
1094
|
break;
|
|
1095
1095
|
}
|
|
1096
|
-
this.sourceMap.has(
|
|
1097
|
-
} else for (
|
|
1096
|
+
this.sourceMap.has(n) ? this.sourceMap.set(n, Object.assign(this.sourceMap.get(n), t)) : this.sourceMap.set(n, t);
|
|
1097
|
+
} else for (n in t) this.load(t[n], n);
|
|
1098
1098
|
}
|
|
1099
|
-
getMessage(t,
|
|
1100
|
-
const
|
|
1101
|
-
return
|
|
1099
|
+
getMessage(t, n) {
|
|
1100
|
+
const r = this.sourceMap.get(Be(n));
|
|
1101
|
+
return r ? r[t] : null;
|
|
1102
1102
|
}
|
|
1103
1103
|
hasLocale(t) {
|
|
1104
1104
|
return this.sourceMap.has(t);
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
class
|
|
1108
|
-
constructor(t, { finalFallback:
|
|
1109
|
-
this.locale =
|
|
1107
|
+
class _i {
|
|
1108
|
+
constructor(t, { finalFallback: n = "en", messages: r = void 0, wikilinks: s = !1 } = {}) {
|
|
1109
|
+
this.locale = Be(t), this.parser = new Dt(this.locale, { wikilinks: s }), this.messageStore = new Si(), r && this.load(r, this.locale), this.finalFallback = n, this.wikilinks = s;
|
|
1110
1110
|
}
|
|
1111
|
-
load(t,
|
|
1112
|
-
return this.messageStore.load(t,
|
|
1111
|
+
load(t, n) {
|
|
1112
|
+
return this.messageStore.load(t, n || this.locale);
|
|
1113
1113
|
}
|
|
1114
|
-
i18n(t, ...
|
|
1115
|
-
return this.parser.parse(this.getMessage(t),
|
|
1114
|
+
i18n(t, ...n) {
|
|
1115
|
+
return this.parser.parse(this.getMessage(t), n);
|
|
1116
1116
|
}
|
|
1117
1117
|
setLocale(t) {
|
|
1118
|
-
this.locale =
|
|
1118
|
+
this.locale = Be(t), this.parser = new Dt(this.locale, { wikilinks: this.wikilinks });
|
|
1119
1119
|
}
|
|
1120
1120
|
getFallbackLocales() {
|
|
1121
|
-
return [
|
|
1121
|
+
return [...St[this.locale] || [], this.finalFallback];
|
|
1122
1122
|
}
|
|
1123
1123
|
getMessage(t) {
|
|
1124
|
-
let
|
|
1124
|
+
let n = this.locale, r = 0;
|
|
1125
1125
|
const s = this.getFallbackLocales(this.locale);
|
|
1126
|
-
for (;
|
|
1127
|
-
const u =
|
|
1128
|
-
let
|
|
1126
|
+
for (; n; ) {
|
|
1127
|
+
const u = n.split("-");
|
|
1128
|
+
let o = u.length;
|
|
1129
1129
|
do {
|
|
1130
|
-
const
|
|
1131
|
-
if (typeof
|
|
1132
|
-
|
|
1133
|
-
} while (
|
|
1134
|
-
|
|
1130
|
+
const l = u.slice(0, o).join("-"), v = this.messageStore.getMessage(t, l);
|
|
1131
|
+
if (typeof v == "string") return v;
|
|
1132
|
+
o--;
|
|
1133
|
+
} while (o);
|
|
1134
|
+
n = s[r], r++;
|
|
1135
1135
|
}
|
|
1136
1136
|
return t;
|
|
1137
1137
|
}
|
|
1138
|
-
registerParserPlugin(t,
|
|
1139
|
-
|
|
1138
|
+
registerParserPlugin(t, n) {
|
|
1139
|
+
_t.prototype[t] = n;
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1142
|
+
const Tt = {
|
|
1143
1143
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2024-01-08", locale: "en" },
|
|
1144
1144
|
"sa-login": "Login",
|
|
1145
|
-
"sa-username": "
|
|
1145
|
+
"sa-username": "Email",
|
|
1146
1146
|
"sa-password": "Password",
|
|
1147
1147
|
"sa-use-password": "Use Password",
|
|
1148
1148
|
"sa-code": "Code",
|
|
@@ -1153,8 +1153,8 @@ const kt = {
|
|
|
1153
1153
|
"sa-remember": "Remember me",
|
|
1154
1154
|
"sa-forgot": "Forgot your password?",
|
|
1155
1155
|
"sa-register": "Register",
|
|
1156
|
-
"sa-error.login": "Invalid
|
|
1157
|
-
"sa-error.register": "Invalid
|
|
1156
|
+
"sa-error.login": "Invalid email or password",
|
|
1157
|
+
"sa-error.register": "Invalid email or password",
|
|
1158
1158
|
"sa-error.unknown": "Unknown error",
|
|
1159
1159
|
"sa-account-settings": "Account Settings",
|
|
1160
1160
|
"sa-webauthn-security-keys": "Your passkeys",
|
|
@@ -1215,19 +1215,27 @@ const kt = {
|
|
|
1215
1215
|
"sa-social-github": "Continue with GitHub",
|
|
1216
1216
|
"sa-social-apple": "Continue with Apple",
|
|
1217
1217
|
"sa-social-oidc": "Continue with SSO",
|
|
1218
|
-
"sa-
|
|
1219
|
-
|
|
1218
|
+
"sa-loading": "Loading...",
|
|
1219
|
+
"sa-social-error": "Error starting social login",
|
|
1220
|
+
"sa-signup-mfa-title": "Verify Your Email",
|
|
1221
|
+
"sa-signup-verify-prompt": "A verification code has been sent to your email. Enter it below to activate multi-factor authentication.",
|
|
1222
|
+
"sa-signup-verify-error": "Invalid or expired verification code.",
|
|
1223
|
+
"sa-signup-webauthn-prompt": "Your account is secure! Optionally, add a passkey for faster and easier logins.",
|
|
1224
|
+
"sa-signup-webauthn-setup": "Set Up Passkey",
|
|
1225
|
+
"sa-signup-webauthn-done": "Skip for now",
|
|
1226
|
+
"sa-signup-webauthn-error": "Error setting up passkey. Please try again from your account settings."
|
|
1227
|
+
}, Ti = {
|
|
1220
1228
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "fr" },
|
|
1221
1229
|
"sa-login": "Connexion",
|
|
1222
|
-
"sa-username": "
|
|
1230
|
+
"sa-username": "Adresse e-mail",
|
|
1223
1231
|
"sa-password": "Mot de passe",
|
|
1224
1232
|
"sa-use-password": "Utiliser le mot de passe",
|
|
1225
1233
|
"sa-code": "code à deux facteurs",
|
|
1226
1234
|
"sa-remember": "Souviens-toi de moi",
|
|
1227
1235
|
"sa-forgot": "Mot de passe oublié?",
|
|
1228
1236
|
"sa-register": "S'inscrire",
|
|
1229
|
-
"sa-error.login": "
|
|
1230
|
-
"sa-error.register": "
|
|
1237
|
+
"sa-error.login": "E-mail ou mot de passe invalide",
|
|
1238
|
+
"sa-error.register": "E-mail ou mot de passe invalide",
|
|
1231
1239
|
"sa-error.unknown": "Erreur inconnue",
|
|
1232
1240
|
"sa-otp-required": "Un code à usage unique est requis.",
|
|
1233
1241
|
"sa-otp-choose": "Choisissez comment recevoir votre code :",
|
|
@@ -1260,19 +1268,27 @@ const kt = {
|
|
|
1260
1268
|
"sa-social-github": "Continuer avec GitHub",
|
|
1261
1269
|
"sa-social-apple": "Continuer avec Apple",
|
|
1262
1270
|
"sa-social-oidc": "Continuer avec SSO",
|
|
1263
|
-
"sa-
|
|
1264
|
-
|
|
1271
|
+
"sa-loading": "Chargement...",
|
|
1272
|
+
"sa-social-error": "Erreur lors de la connexion sociale",
|
|
1273
|
+
"sa-signup-mfa-title": "Vérifiez votre e-mail",
|
|
1274
|
+
"sa-signup-verify-prompt": "Un code de vérification a été envoyé à votre e-mail. Entrez-le ci-dessous pour activer l'authentification multi-facteurs.",
|
|
1275
|
+
"sa-signup-verify-error": "Code de vérification invalide ou expiré.",
|
|
1276
|
+
"sa-signup-webauthn-prompt": "Votre compte est sécurisé ! Ajoutez optionnellement une clé d'accès pour des connexions plus rapides.",
|
|
1277
|
+
"sa-signup-webauthn-setup": "Configurer la clé d'accès",
|
|
1278
|
+
"sa-signup-webauthn-done": "Ignorer pour l'instant",
|
|
1279
|
+
"sa-signup-webauthn-error": "Erreur lors de la configuration de la clé d'accès. Veuillez réessayer depuis les paramètres de votre compte."
|
|
1280
|
+
}, Oi = {
|
|
1265
1281
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "es" },
|
|
1266
1282
|
"sa-login": "Acceso",
|
|
1267
|
-
"sa-username": "
|
|
1283
|
+
"sa-username": "Correo electrónico",
|
|
1268
1284
|
"sa-password": "Clave",
|
|
1269
1285
|
"sa-use-password": "Usar contraseña",
|
|
1270
1286
|
"sa-code": "Código",
|
|
1271
1287
|
"sa-remember": "Acuérdate de mí",
|
|
1272
1288
|
"sa-forgot": "¿Olvidaste tu contraseña?",
|
|
1273
1289
|
"sa-register": "Registro",
|
|
1274
|
-
"sa-error.login": "
|
|
1275
|
-
"sa-error.register": "
|
|
1290
|
+
"sa-error.login": "Correo electrónico o contraseña inválidos",
|
|
1291
|
+
"sa-error.register": "Correo electrónico o contraseña inválidos",
|
|
1276
1292
|
"sa-error.unknown": "Error desconocido",
|
|
1277
1293
|
"sa-otp-required": "Se requiere un código de un solo uso.",
|
|
1278
1294
|
"sa-otp-choose": "Elige cómo recibir tu código:",
|
|
@@ -1303,19 +1319,27 @@ const kt = {
|
|
|
1303
1319
|
"sa-social-github": "Continuar con GitHub",
|
|
1304
1320
|
"sa-social-apple": "Continuar con Apple",
|
|
1305
1321
|
"sa-social-oidc": "Continuar con SSO",
|
|
1306
|
-
"sa-
|
|
1307
|
-
|
|
1322
|
+
"sa-loading": "Cargando...",
|
|
1323
|
+
"sa-social-error": "Error al iniciar sesión social",
|
|
1324
|
+
"sa-signup-mfa-title": "Verifica tu correo electrónico",
|
|
1325
|
+
"sa-signup-verify-prompt": "Se ha enviado un código de verificación a tu correo. Ingrésalo para activar la autenticación multifactor.",
|
|
1326
|
+
"sa-signup-verify-error": "Código de verificación inválido o expirado.",
|
|
1327
|
+
"sa-signup-webauthn-prompt": "¡Tu cuenta está protegida! Opcionalmente, agrega una clave de acceso para inicios de sesión más rápidos.",
|
|
1328
|
+
"sa-signup-webauthn-setup": "Configurar clave de acceso",
|
|
1329
|
+
"sa-signup-webauthn-done": "Omitir por ahora",
|
|
1330
|
+
"sa-signup-webauthn-error": "Error al configurar la clave de acceso. Intenta de nuevo desde la configuración de tu cuenta."
|
|
1331
|
+
}, Ii = {
|
|
1308
1332
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "ja" },
|
|
1309
1333
|
"sa-login": "ログイン",
|
|
1310
|
-
"sa-username": "
|
|
1334
|
+
"sa-username": "メールアドレス",
|
|
1311
1335
|
"sa-password": "パスワード",
|
|
1312
1336
|
"sa-use-password": "パスワードを使用する",
|
|
1313
1337
|
"sa-code": "コード",
|
|
1314
1338
|
"sa-remember": "私を覚えてますか",
|
|
1315
1339
|
"sa-forgot": "パスワードをお忘れですか?",
|
|
1316
1340
|
"sa-register": "登録",
|
|
1317
|
-
"sa-error.login": "
|
|
1318
|
-
"sa-error.register": "
|
|
1341
|
+
"sa-error.login": "メールアドレスかパスワードが無効",
|
|
1342
|
+
"sa-error.register": "メールアドレスかパスワードが無効",
|
|
1319
1343
|
"sa-error.unknown": "未知のエラー",
|
|
1320
1344
|
"sa-otp-required": "ワンタイムコードが必要です。",
|
|
1321
1345
|
"sa-otp-choose": "コードの受け取り方法を選択してください:",
|
|
@@ -1348,206 +1372,214 @@ const kt = {
|
|
|
1348
1372
|
"sa-social-github": "GitHubで続ける",
|
|
1349
1373
|
"sa-social-apple": "Appleで続ける",
|
|
1350
1374
|
"sa-social-oidc": "SSOで続ける",
|
|
1351
|
-
"sa-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1375
|
+
"sa-loading": "読み込み中...",
|
|
1376
|
+
"sa-social-error": "ソーシャルログイン開始エラー",
|
|
1377
|
+
"sa-signup-mfa-title": "メールを確認してください",
|
|
1378
|
+
"sa-signup-verify-prompt": "確認コードがメールに送信されました。多要素認証を有効にするために入力してください。",
|
|
1379
|
+
"sa-signup-verify-error": "無効または期限切れの確認コードです。",
|
|
1380
|
+
"sa-signup-webauthn-prompt": "アカウントが保護されました!パスキーを追加してより速く簡単にログインできます(任意)。",
|
|
1381
|
+
"sa-signup-webauthn-setup": "パスキーを設定",
|
|
1382
|
+
"sa-signup-webauthn-done": "今はスキップ",
|
|
1383
|
+
"sa-signup-webauthn-error": "パスキーの設定中にエラーが発生しました。アカウント設定から再試行してください。"
|
|
1384
|
+
}, Pi = {
|
|
1385
|
+
en: Tt,
|
|
1386
|
+
fr: Ti,
|
|
1387
|
+
es: Oi,
|
|
1388
|
+
ja: Ii
|
|
1357
1389
|
};
|
|
1358
|
-
function
|
|
1359
|
-
const t = new
|
|
1360
|
-
messages:
|
|
1390
|
+
function ut(e) {
|
|
1391
|
+
const t = new _i("en", {
|
|
1392
|
+
messages: Tt
|
|
1361
1393
|
});
|
|
1362
|
-
return e !== "en" && (t.load(
|
|
1394
|
+
return e !== "en" && (t.load(Pi[e], e), t.setLocale(e)), t;
|
|
1363
1395
|
}
|
|
1364
|
-
function
|
|
1365
|
-
const t = "==".slice(0, (4 - e.length % 4) % 4),
|
|
1366
|
-
for (let
|
|
1367
|
-
u[
|
|
1396
|
+
function Ot(e) {
|
|
1397
|
+
const t = "==".slice(0, (4 - e.length % 4) % 4), n = e.replace(/-/g, "+").replace(/_/g, "/") + t, r = atob(n), s = new ArrayBuffer(r.length), u = new Uint8Array(s);
|
|
1398
|
+
for (let o = 0; o < r.length; o++)
|
|
1399
|
+
u[o] = r.charCodeAt(o);
|
|
1368
1400
|
return s;
|
|
1369
1401
|
}
|
|
1370
|
-
function
|
|
1402
|
+
function It(e) {
|
|
1371
1403
|
const t = new Uint8Array(e);
|
|
1372
|
-
let
|
|
1404
|
+
let n = "";
|
|
1373
1405
|
for (const u of t)
|
|
1374
|
-
|
|
1375
|
-
return btoa(
|
|
1406
|
+
n += String.fromCharCode(u);
|
|
1407
|
+
return btoa(n).replace(/\+/g, "-").replace(
|
|
1376
1408
|
/\//g,
|
|
1377
1409
|
"_"
|
|
1378
1410
|
).replace(/=/g, "");
|
|
1379
1411
|
}
|
|
1380
|
-
var
|
|
1381
|
-
function
|
|
1382
|
-
if (t ===
|
|
1383
|
-
return
|
|
1384
|
-
if (t ===
|
|
1385
|
-
return e(
|
|
1412
|
+
var S = "copy", de = "convert";
|
|
1413
|
+
function ke(e, t, n) {
|
|
1414
|
+
if (t === S)
|
|
1415
|
+
return n;
|
|
1416
|
+
if (t === de)
|
|
1417
|
+
return e(n);
|
|
1386
1418
|
if (t instanceof Array)
|
|
1387
|
-
return
|
|
1419
|
+
return n.map((r) => ke(e, t[0], r));
|
|
1388
1420
|
if (t instanceof Object) {
|
|
1389
|
-
const
|
|
1421
|
+
const r = {};
|
|
1390
1422
|
for (const [s, u] of Object.entries(t)) {
|
|
1391
1423
|
if (u.derive) {
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1424
|
+
const o = u.derive(n);
|
|
1425
|
+
o !== void 0 && (n[s] = o);
|
|
1394
1426
|
}
|
|
1395
|
-
if (!(s in
|
|
1427
|
+
if (!(s in n)) {
|
|
1396
1428
|
if (u.required)
|
|
1397
1429
|
throw new Error(`Missing key: ${s}`);
|
|
1398
1430
|
continue;
|
|
1399
1431
|
}
|
|
1400
|
-
if (
|
|
1401
|
-
|
|
1432
|
+
if (n[s] == null) {
|
|
1433
|
+
r[s] = null;
|
|
1402
1434
|
continue;
|
|
1403
1435
|
}
|
|
1404
|
-
|
|
1436
|
+
r[s] = ke(
|
|
1405
1437
|
e,
|
|
1406
1438
|
u.schema,
|
|
1407
|
-
|
|
1439
|
+
n[s]
|
|
1408
1440
|
);
|
|
1409
1441
|
}
|
|
1410
|
-
return
|
|
1442
|
+
return r;
|
|
1411
1443
|
}
|
|
1412
1444
|
}
|
|
1413
|
-
function
|
|
1445
|
+
function Qe(e, t) {
|
|
1414
1446
|
return {
|
|
1415
1447
|
required: !0,
|
|
1416
1448
|
schema: e,
|
|
1417
1449
|
derive: t
|
|
1418
1450
|
};
|
|
1419
1451
|
}
|
|
1420
|
-
function
|
|
1452
|
+
function I(e) {
|
|
1421
1453
|
return {
|
|
1422
1454
|
required: !0,
|
|
1423
1455
|
schema: e
|
|
1424
1456
|
};
|
|
1425
1457
|
}
|
|
1426
|
-
function
|
|
1458
|
+
function V(e) {
|
|
1427
1459
|
return {
|
|
1428
1460
|
required: !1,
|
|
1429
1461
|
schema: e
|
|
1430
1462
|
};
|
|
1431
1463
|
}
|
|
1432
|
-
var
|
|
1433
|
-
type:
|
|
1434
|
-
id:
|
|
1435
|
-
transports:
|
|
1436
|
-
},
|
|
1437
|
-
appid:
|
|
1438
|
-
appidExclude:
|
|
1439
|
-
credProps:
|
|
1440
|
-
},
|
|
1441
|
-
appid:
|
|
1442
|
-
appidExclude:
|
|
1443
|
-
credProps:
|
|
1444
|
-
},
|
|
1445
|
-
publicKey:
|
|
1446
|
-
rp:
|
|
1447
|
-
user:
|
|
1448
|
-
id:
|
|
1449
|
-
name:
|
|
1450
|
-
displayName:
|
|
1464
|
+
var Pt = {
|
|
1465
|
+
type: I(S),
|
|
1466
|
+
id: I(de),
|
|
1467
|
+
transports: V(S)
|
|
1468
|
+
}, zt = {
|
|
1469
|
+
appid: V(S),
|
|
1470
|
+
appidExclude: V(S),
|
|
1471
|
+
credProps: V(S)
|
|
1472
|
+
}, Nt = {
|
|
1473
|
+
appid: V(S),
|
|
1474
|
+
appidExclude: V(S),
|
|
1475
|
+
credProps: V(S)
|
|
1476
|
+
}, zi = {
|
|
1477
|
+
publicKey: I({
|
|
1478
|
+
rp: I(S),
|
|
1479
|
+
user: I({
|
|
1480
|
+
id: I(de),
|
|
1481
|
+
name: I(S),
|
|
1482
|
+
displayName: I(S)
|
|
1451
1483
|
}),
|
|
1452
|
-
challenge:
|
|
1453
|
-
pubKeyCredParams:
|
|
1454
|
-
timeout:
|
|
1455
|
-
excludeCredentials:
|
|
1456
|
-
authenticatorSelection:
|
|
1457
|
-
attestation:
|
|
1458
|
-
extensions:
|
|
1484
|
+
challenge: I(de),
|
|
1485
|
+
pubKeyCredParams: I(S),
|
|
1486
|
+
timeout: V(S),
|
|
1487
|
+
excludeCredentials: V([Pt]),
|
|
1488
|
+
authenticatorSelection: V(S),
|
|
1489
|
+
attestation: V(S),
|
|
1490
|
+
extensions: V(zt)
|
|
1459
1491
|
}),
|
|
1460
|
-
signal:
|
|
1461
|
-
},
|
|
1462
|
-
type:
|
|
1463
|
-
id:
|
|
1464
|
-
rawId:
|
|
1465
|
-
authenticatorAttachment:
|
|
1466
|
-
response:
|
|
1467
|
-
clientDataJSON:
|
|
1468
|
-
attestationObject:
|
|
1469
|
-
transports:
|
|
1470
|
-
|
|
1492
|
+
signal: V(S)
|
|
1493
|
+
}, Ni = {
|
|
1494
|
+
type: I(S),
|
|
1495
|
+
id: I(S),
|
|
1496
|
+
rawId: I(de),
|
|
1497
|
+
authenticatorAttachment: V(S),
|
|
1498
|
+
response: I({
|
|
1499
|
+
clientDataJSON: I(de),
|
|
1500
|
+
attestationObject: I(de),
|
|
1501
|
+
transports: Qe(
|
|
1502
|
+
S,
|
|
1471
1503
|
(e) => {
|
|
1472
1504
|
var t;
|
|
1473
1505
|
return ((t = e.getTransports) == null ? void 0 : t.call(e)) || [];
|
|
1474
1506
|
}
|
|
1475
1507
|
)
|
|
1476
1508
|
}),
|
|
1477
|
-
clientExtensionResults:
|
|
1478
|
-
|
|
1509
|
+
clientExtensionResults: Qe(
|
|
1510
|
+
Nt,
|
|
1479
1511
|
(e) => e.getClientExtensionResults()
|
|
1480
1512
|
)
|
|
1481
|
-
},
|
|
1482
|
-
mediation:
|
|
1483
|
-
publicKey:
|
|
1484
|
-
challenge:
|
|
1485
|
-
timeout:
|
|
1486
|
-
rpId:
|
|
1487
|
-
allowCredentials:
|
|
1488
|
-
userVerification:
|
|
1489
|
-
extensions:
|
|
1513
|
+
}, Mi = {
|
|
1514
|
+
mediation: V(S),
|
|
1515
|
+
publicKey: I({
|
|
1516
|
+
challenge: I(de),
|
|
1517
|
+
timeout: V(S),
|
|
1518
|
+
rpId: V(S),
|
|
1519
|
+
allowCredentials: V([Pt]),
|
|
1520
|
+
userVerification: V(S),
|
|
1521
|
+
extensions: V(zt)
|
|
1490
1522
|
}),
|
|
1491
|
-
signal:
|
|
1492
|
-
},
|
|
1493
|
-
type:
|
|
1494
|
-
id:
|
|
1495
|
-
rawId:
|
|
1496
|
-
authenticatorAttachment:
|
|
1497
|
-
response:
|
|
1498
|
-
clientDataJSON:
|
|
1499
|
-
authenticatorData:
|
|
1500
|
-
signature:
|
|
1501
|
-
userHandle:
|
|
1523
|
+
signal: V(S)
|
|
1524
|
+
}, ji = {
|
|
1525
|
+
type: I(S),
|
|
1526
|
+
id: I(S),
|
|
1527
|
+
rawId: I(de),
|
|
1528
|
+
authenticatorAttachment: V(S),
|
|
1529
|
+
response: I({
|
|
1530
|
+
clientDataJSON: I(de),
|
|
1531
|
+
authenticatorData: I(de),
|
|
1532
|
+
signature: I(de),
|
|
1533
|
+
userHandle: I(de)
|
|
1502
1534
|
}),
|
|
1503
|
-
clientExtensionResults:
|
|
1504
|
-
|
|
1535
|
+
clientExtensionResults: Qe(
|
|
1536
|
+
Nt,
|
|
1505
1537
|
(e) => e.getClientExtensionResults()
|
|
1506
1538
|
)
|
|
1507
1539
|
};
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1540
|
+
function Mt(e) {
|
|
1541
|
+
return ke(Ot, zi, e);
|
|
1510
1542
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return
|
|
1513
|
-
|
|
1514
|
-
|
|
1543
|
+
function Ri(e) {
|
|
1544
|
+
return ke(
|
|
1545
|
+
It,
|
|
1546
|
+
Ni,
|
|
1515
1547
|
e
|
|
1516
1548
|
);
|
|
1517
1549
|
}
|
|
1518
|
-
function
|
|
1519
|
-
return
|
|
1550
|
+
function Li(e) {
|
|
1551
|
+
return ke(Ot, Mi, e);
|
|
1520
1552
|
}
|
|
1521
|
-
function
|
|
1522
|
-
return
|
|
1523
|
-
|
|
1524
|
-
|
|
1553
|
+
function qi(e) {
|
|
1554
|
+
return ke(
|
|
1555
|
+
It,
|
|
1556
|
+
ji,
|
|
1525
1557
|
e
|
|
1526
1558
|
);
|
|
1527
1559
|
}
|
|
1528
|
-
async function
|
|
1560
|
+
async function jt(e) {
|
|
1529
1561
|
const t = await navigator.credentials.create(
|
|
1530
1562
|
e
|
|
1531
1563
|
);
|
|
1532
|
-
return t.toJSON = () =>
|
|
1564
|
+
return t.toJSON = () => Ri(t), t;
|
|
1533
1565
|
}
|
|
1534
|
-
async function
|
|
1566
|
+
async function Ui(e) {
|
|
1535
1567
|
const t = await navigator.credentials.get(
|
|
1536
1568
|
e
|
|
1537
1569
|
);
|
|
1538
|
-
return t.toJSON = () =>
|
|
1570
|
+
return t.toJSON = () => qi(t), t;
|
|
1539
1571
|
}
|
|
1540
|
-
function
|
|
1572
|
+
function et(e) {
|
|
1541
1573
|
this.message = e;
|
|
1542
1574
|
}
|
|
1543
|
-
|
|
1544
|
-
var
|
|
1575
|
+
et.prototype = new Error(), et.prototype.name = "InvalidCharacterError";
|
|
1576
|
+
var pt = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
|
|
1545
1577
|
var t = String(e).replace(/=+$/, "");
|
|
1546
|
-
if (t.length % 4 == 1) throw new
|
|
1547
|
-
for (var
|
|
1548
|
-
return
|
|
1578
|
+
if (t.length % 4 == 1) throw new et("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
1579
|
+
for (var n, r, s = 0, u = 0, o = ""; r = t.charAt(u++); ~r && (n = s % 4 ? 64 * n + r : r, s++ % 4) ? o += String.fromCharCode(255 & n >> (-2 * s & 6)) : 0) r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
|
|
1580
|
+
return o;
|
|
1549
1581
|
};
|
|
1550
|
-
function
|
|
1582
|
+
function Ji(e) {
|
|
1551
1583
|
var t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1552
1584
|
switch (t.length % 4) {
|
|
1553
1585
|
case 0:
|
|
@@ -1562,51 +1594,51 @@ function qi(e) {
|
|
|
1562
1594
|
throw "Illegal base64url string!";
|
|
1563
1595
|
}
|
|
1564
1596
|
try {
|
|
1565
|
-
return function(
|
|
1566
|
-
return decodeURIComponent(
|
|
1597
|
+
return function(n) {
|
|
1598
|
+
return decodeURIComponent(pt(n).replace(/(.)/g, function(r, s) {
|
|
1567
1599
|
var u = s.charCodeAt(0).toString(16).toUpperCase();
|
|
1568
1600
|
return u.length < 2 && (u = "0" + u), "%" + u;
|
|
1569
1601
|
}));
|
|
1570
1602
|
}(t);
|
|
1571
1603
|
} catch {
|
|
1572
|
-
return
|
|
1604
|
+
return pt(t);
|
|
1573
1605
|
}
|
|
1574
1606
|
}
|
|
1575
|
-
function
|
|
1607
|
+
function Ve(e) {
|
|
1576
1608
|
this.message = e;
|
|
1577
1609
|
}
|
|
1578
|
-
function
|
|
1579
|
-
if (typeof e != "string") throw new
|
|
1580
|
-
var
|
|
1610
|
+
function Vi(e, t) {
|
|
1611
|
+
if (typeof e != "string") throw new Ve("Invalid token specified");
|
|
1612
|
+
var n = (t = t || {}).header === !0 ? 0 : 1;
|
|
1581
1613
|
try {
|
|
1582
|
-
return JSON.parse(
|
|
1583
|
-
} catch (
|
|
1584
|
-
throw new
|
|
1614
|
+
return JSON.parse(Ji(e.split(".")[n]));
|
|
1615
|
+
} catch (r) {
|
|
1616
|
+
throw new Ve("Invalid token specified: " + r.message);
|
|
1585
1617
|
}
|
|
1586
1618
|
}
|
|
1587
|
-
|
|
1588
|
-
const
|
|
1589
|
-
function
|
|
1590
|
-
const e = localStorage.getItem(
|
|
1619
|
+
Ve.prototype = new Error(), Ve.prototype.name = "InvalidTokenError";
|
|
1620
|
+
const je = "spartan-token";
|
|
1621
|
+
function Rt() {
|
|
1622
|
+
const e = localStorage.getItem(je);
|
|
1591
1623
|
let t = null;
|
|
1592
1624
|
if (e)
|
|
1593
1625
|
try {
|
|
1594
|
-
if (t =
|
|
1626
|
+
if (t = Vi(e), t.exp > Gi())
|
|
1595
1627
|
return t;
|
|
1596
|
-
localStorage.removeItem(
|
|
1597
|
-
} catch (
|
|
1598
|
-
console.error("Error decoding token",
|
|
1628
|
+
localStorage.removeItem(je);
|
|
1629
|
+
} catch (n) {
|
|
1630
|
+
console.error("Error decoding token", n), localStorage.removeItem(je);
|
|
1599
1631
|
}
|
|
1600
1632
|
return null;
|
|
1601
1633
|
}
|
|
1602
|
-
function
|
|
1603
|
-
const e = localStorage.getItem(
|
|
1634
|
+
function Ki() {
|
|
1635
|
+
const e = localStorage.getItem(je);
|
|
1604
1636
|
return e || null;
|
|
1605
1637
|
}
|
|
1606
|
-
function
|
|
1638
|
+
function Gi() {
|
|
1607
1639
|
return Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3);
|
|
1608
1640
|
}
|
|
1609
|
-
var
|
|
1641
|
+
var Hi = /* @__PURE__ */ F(`<form class=login-frame><style>.login-frame {
|
|
1610
1642
|
display: flex;
|
|
1611
1643
|
flex-direction: column;
|
|
1612
1644
|
justify-content: center;
|
|
@@ -1641,6 +1673,11 @@ var Gi = /* @__PURE__ */ B(`<form class=login-frame><style>.login-frame {
|
|
|
1641
1673
|
border-radius: 10px;
|
|
1642
1674
|
}
|
|
1643
1675
|
|
|
1676
|
+
.login-frame button:disabled {
|
|
1677
|
+
opacity: 0.6;
|
|
1678
|
+
cursor: not-allowed;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1644
1681
|
.login-frame select {
|
|
1645
1682
|
background-color: #ffffff;
|
|
1646
1683
|
border: 1px solid #ccc;
|
|
@@ -1712,8 +1749,8 @@ var Gi = /* @__PURE__ */ B(`<form class=login-frame><style>.login-frame {
|
|
|
1712
1749
|
opacity: 0.6;
|
|
1713
1750
|
cursor: not-allowed;
|
|
1714
1751
|
}
|
|
1715
|
-
</style><style></style><h1></h1><input type=text
|
|
1716
|
-
const
|
|
1752
|
+
</style><style></style><h1></h1><input type=text>`), Wi = /* @__PURE__ */ F("<span class=error-message>"), Ze = /* @__PURE__ */ F("<span>"), gt = /* @__PURE__ */ F("<input type=password>"), Ye = /* @__PURE__ */ F("<p>"), Zi = /* @__PURE__ */ F("<select>"), Yi = /* @__PURE__ */ F("<option> (<!>)"), Xi = /* @__PURE__ */ F("<input type=text>"), mt = /* @__PURE__ */ F("<input type=text autocomplete=one-time-code>"), Qi = /* @__PURE__ */ F("<input type=password autocomplete=new-password>"), ea = /* @__PURE__ */ F("<span class=checkbox-wrapper><input type=checkbox><span> "), ta = /* @__PURE__ */ F("<button type=submit>"), na = /* @__PURE__ */ F("<button type=button>"), Me = /* @__PURE__ */ F("<a class=centered-text href=#>"), ra = /* @__PURE__ */ F("<div class=social-divider><span>"), sa = /* @__PURE__ */ F("<button type=button class=social-btn>"), ua = /* @__PURE__ */ F('<svg width=18 height=18 viewBox="0 0 18 18"xmlns=http://www.w3.org/2000/svg><path d="M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908c1.702-1.567 2.684-3.875 2.684-6.615z"fill=#4285F4></path><path d="M9 18c2.43 0 4.467-.806 5.956-2.184l-2.908-2.258c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332C2.438 15.983 5.482 18 9 18z"fill=#34A853></path><path d="M3.964 10.707c-.18-.54-.282-1.117-.282-1.707s.102-1.167.282-1.707V4.961H.957C.347 6.175 0 7.548 0 9s.348 2.825.957 4.039l3.007-2.332z"fill=#FBBC05></path><path d="M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0 5.482 0 2.438 2.017.957 4.961L3.964 7.293C4.672 5.166 6.656 3.58 9 3.58z"fill=#EA4335>'), ia = /* @__PURE__ */ F('<svg width=18 height=18 viewBox="0 0 16 16"xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"fill=currentColor>'), aa = /* @__PURE__ */ F('<svg width=18 height=18 viewBox="20 16 16 19"xmlns=http://www.w3.org/2000/svg><path d="M28.2226562,20.3846154 C29.0546875,20.3846154 30.0976562,19.8048315 30.71875,19.0317864 C31.28125,18.3312142 31.6914062,17.352829 31.6914062,16.3744437 C31.6914062,16.2415766 31.6796875,16.1087095 31.65625,16 C30.7304687,16.0362365 29.6171875,16.640178 28.9492187,17.4494596 C28.421875,18.06548 27.9414062,19.0317864 27.9414062,20.0222505 C27.9414062,20.1671964 27.9648438,20.3121424 27.9765625,20.3604577 C28.0351562,20.3725366 28.1289062,20.3846154 28.2226562,20.3846154 Z M25.2929688,35 C26.4296875,35 26.9335938,34.214876 28.3515625,34.214876 C29.7929688,34.214876 30.109375,34.9758423 31.375,34.9758423 C32.6171875,34.9758423 33.4492188,33.792117 34.234375,32.6325493 C35.1132812,31.3038779 35.4765625,29.9993643 35.5,29.9389701 C35.4179688,29.9148125 33.0390625,28.9122695 33.0390625,26.0979021 C33.0390625,23.6579784 34.9140625,22.5588048 35.0195312,22.474253 C33.7773438,20.6382708 31.890625,20.5899555 31.375,20.5899555 C29.9804688,20.5899555 28.84375,21.4596313 28.1289062,21.4596313 C27.3554688,21.4596313 26.3359375,20.6382708 25.1289062,20.6382708 C22.8320312,20.6382708 20.5,22.5950413 20.5,26.2911634 C20.5,28.5861411 21.3671875,31.013986 22.4335938,32.5842339 C23.3476562,33.9129053 24.1445312,35 25.2929688,35 Z"fill=currentColor fill-rule=nonzero>'), oa = /* @__PURE__ */ F('<svg width=18 height=18 viewBox="0 0 24 24"xmlns=http://www.w3.org/2000/svg><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 4a3 3 0 110 6 3 3 0 010-6zm0 14c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08s5.97 1.09 6 3.08c-1.29 1.94-3.5 3.22-6 3.22z"fill=currentColor>');
|
|
1753
|
+
const la = {
|
|
1717
1754
|
domain: "http://127.0.0.1:11000",
|
|
1718
1755
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
1719
1756
|
// defaults to the admin sector
|
|
@@ -1722,27 +1759,27 @@ const aa = {
|
|
|
1722
1759
|
locale: "en",
|
|
1723
1760
|
redirect: ""
|
|
1724
1761
|
};
|
|
1725
|
-
|
|
1726
|
-
const [t,
|
|
1727
|
-
let
|
|
1762
|
+
st("spartan-login", la, (e) => {
|
|
1763
|
+
const [t, n] = E((e.startMode || "password").toLowerCase()), [r, s] = E(""), [u, o] = E(""), [l, v] = E(""), [B, D] = E(""), [x] = E(e.redirect), [te, ue] = E(!1), [ge, z] = E(!1), [H, W] = E(!1), [ne, K] = E(""), [Q, U] = E(""), [he, me] = E([]), [De, k] = E(""), [Y, be] = E([]), [ae, oe] = E(""), [b, pe] = E(!1), [xe, le] = E(!1), [Fe, Se] = E(""), [_e, Ee] = E(""), h = ut(e.locale);
|
|
1764
|
+
let Ce, Ae;
|
|
1728
1765
|
try {
|
|
1729
|
-
|
|
1766
|
+
Ae = e.styles;
|
|
1730
1767
|
} catch {
|
|
1731
|
-
|
|
1768
|
+
Ae = "";
|
|
1732
1769
|
}
|
|
1733
|
-
console.log(
|
|
1734
|
-
const
|
|
1735
|
-
if (
|
|
1770
|
+
console.log(Ae), tt(async () => {
|
|
1771
|
+
const a = new URLSearchParams(window.location.search);
|
|
1772
|
+
if (a.get("error")) {
|
|
1736
1773
|
history.replaceState({}, "", window.location.pathname);
|
|
1737
|
-
const
|
|
1738
|
-
|
|
1774
|
+
const A = a.get("error_description");
|
|
1775
|
+
D(A || h.i18n("sa-social-error")), fe(), ye();
|
|
1739
1776
|
return;
|
|
1740
1777
|
}
|
|
1741
|
-
const
|
|
1742
|
-
if (
|
|
1778
|
+
const d = a.get("code");
|
|
1779
|
+
if (d) {
|
|
1743
1780
|
history.replaceState({}, "", window.location.pathname);
|
|
1744
1781
|
try {
|
|
1745
|
-
const
|
|
1782
|
+
const A = await fetch(`${e.domain}/api/v1/oauth/exchange`, {
|
|
1746
1783
|
method: "POST",
|
|
1747
1784
|
mode: "cors",
|
|
1748
1785
|
cache: "no-cache",
|
|
@@ -1750,30 +1787,30 @@ tt("spartan-login", aa, (e) => {
|
|
|
1750
1787
|
"Content-Type": "application/json"
|
|
1751
1788
|
},
|
|
1752
1789
|
body: JSON.stringify({
|
|
1753
|
-
code:
|
|
1790
|
+
code: d
|
|
1754
1791
|
})
|
|
1755
1792
|
});
|
|
1756
|
-
if (!
|
|
1757
|
-
const
|
|
1758
|
-
localStorage.setItem("spartan-token",
|
|
1793
|
+
if (!A.ok) throw new Error(h.i18n("sa-social-error"));
|
|
1794
|
+
const q = await A.json();
|
|
1795
|
+
localStorage.setItem("spartan-token", q.token), Ce.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login", {
|
|
1759
1796
|
bubbles: !0,
|
|
1760
1797
|
cancelable: !0,
|
|
1761
1798
|
detail: {
|
|
1762
|
-
token:
|
|
1799
|
+
token: q.token
|
|
1763
1800
|
}
|
|
1764
1801
|
})), e.redirect !== "" && (window.location.href = e.redirect);
|
|
1765
|
-
} catch (
|
|
1766
|
-
|
|
1802
|
+
} catch (A) {
|
|
1803
|
+
D(A.message || h.i18n("sa-social-error"));
|
|
1767
1804
|
}
|
|
1768
1805
|
return;
|
|
1769
1806
|
}
|
|
1770
|
-
if (
|
|
1807
|
+
if (Rt() && e.redirect !== "" && window.location.pathname !== e.redirect) {
|
|
1771
1808
|
window.location.href = e.redirect;
|
|
1772
1809
|
return;
|
|
1773
1810
|
}
|
|
1774
|
-
|
|
1811
|
+
fe(), ye();
|
|
1775
1812
|
});
|
|
1776
|
-
function
|
|
1813
|
+
function fe() {
|
|
1777
1814
|
fetch(`${e.domain}/api/v1/sectors/${e.sector}/publicsettings`, {
|
|
1778
1815
|
method: "GET",
|
|
1779
1816
|
mode: "cors",
|
|
@@ -1781,14 +1818,14 @@ tt("spartan-login", aa, (e) => {
|
|
|
1781
1818
|
headers: {
|
|
1782
1819
|
"Content-Type": "application/json"
|
|
1783
1820
|
}
|
|
1784
|
-
}).then((
|
|
1785
|
-
if (
|
|
1786
|
-
return
|
|
1821
|
+
}).then((a) => {
|
|
1822
|
+
if (a.ok)
|
|
1823
|
+
return a.json();
|
|
1787
1824
|
throw new Error("Network response was not ok.");
|
|
1788
|
-
}).then((
|
|
1789
|
-
console.log(
|
|
1790
|
-
}).catch((
|
|
1791
|
-
console.log(
|
|
1825
|
+
}).then((a) => {
|
|
1826
|
+
console.log(a), ue(a.SelfSignUpAllowed), le(a.MFARequired || !1);
|
|
1827
|
+
}).catch((a) => {
|
|
1828
|
+
console.log(a), D(a.message);
|
|
1792
1829
|
});
|
|
1793
1830
|
}
|
|
1794
1831
|
function ye() {
|
|
@@ -1796,20 +1833,63 @@ tt("spartan-login", aa, (e) => {
|
|
|
1796
1833
|
method: "GET",
|
|
1797
1834
|
mode: "cors",
|
|
1798
1835
|
cache: "no-cache"
|
|
1799
|
-
}).then((
|
|
1800
|
-
if (
|
|
1836
|
+
}).then((a) => {
|
|
1837
|
+
if (a.ok) return a.json();
|
|
1801
1838
|
throw new Error("Failed to load social providers");
|
|
1802
|
-
}).then((
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1839
|
+
}).then((a) => {
|
|
1840
|
+
const i = (a.providers || []).filter((d) => d.enabled);
|
|
1841
|
+
be(i);
|
|
1805
1842
|
}).catch(() => {
|
|
1806
1843
|
});
|
|
1807
1844
|
}
|
|
1808
|
-
function
|
|
1809
|
-
if (
|
|
1810
|
-
|
|
1811
|
-
const
|
|
1812
|
-
fetch(`${e.domain}/api/v1/oauth/${
|
|
1845
|
+
function Te(a) {
|
|
1846
|
+
if (ae()) return;
|
|
1847
|
+
oe(a), D("");
|
|
1848
|
+
const i = window.location.origin + window.location.pathname;
|
|
1849
|
+
fetch(`${e.domain}/api/v1/oauth/${a}/initiate`, {
|
|
1850
|
+
method: "POST",
|
|
1851
|
+
mode: "cors",
|
|
1852
|
+
cache: "no-cache",
|
|
1853
|
+
headers: {
|
|
1854
|
+
"Content-Type": "application/json"
|
|
1855
|
+
},
|
|
1856
|
+
body: JSON.stringify({
|
|
1857
|
+
sectorID: e.sector,
|
|
1858
|
+
redirectURI: i
|
|
1859
|
+
})
|
|
1860
|
+
}).then((d) => {
|
|
1861
|
+
if (d.ok) return d.json();
|
|
1862
|
+
throw new Error(h.i18n("sa-social-error"));
|
|
1863
|
+
}).then((d) => {
|
|
1864
|
+
window.location.href = d.authURL;
|
|
1865
|
+
}).catch((d) => {
|
|
1866
|
+
oe(""), D(d.message);
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
function w(a, i) {
|
|
1870
|
+
return D(""), Ee(i), fetch(`${e.domain}/api/v1/signup/mfa/begin`, {
|
|
1871
|
+
method: "POST",
|
|
1872
|
+
mode: "cors",
|
|
1873
|
+
cache: "no-cache",
|
|
1874
|
+
headers: {
|
|
1875
|
+
"Content-Type": "application/json"
|
|
1876
|
+
},
|
|
1877
|
+
body: JSON.stringify({
|
|
1878
|
+
email: a,
|
|
1879
|
+
sectorID: e.sector,
|
|
1880
|
+
transactionId: i
|
|
1881
|
+
})
|
|
1882
|
+
}).then((d) => {
|
|
1883
|
+
if (!d.ok)
|
|
1884
|
+
throw new Error(h.i18n("sa-signup-verify-error"));
|
|
1885
|
+
}).then(() => {
|
|
1886
|
+
n("signup-verify");
|
|
1887
|
+
}).catch((d) => {
|
|
1888
|
+
D(d.message);
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
function C() {
|
|
1892
|
+
return D(""), fetch(`${e.domain}/api/v1/signup/mfa/verify`, {
|
|
1813
1893
|
method: "POST",
|
|
1814
1894
|
mode: "cors",
|
|
1815
1895
|
cache: "no-cache",
|
|
@@ -1817,169 +1897,225 @@ tt("spartan-login", aa, (e) => {
|
|
|
1817
1897
|
"Content-Type": "application/json"
|
|
1818
1898
|
},
|
|
1819
1899
|
body: JSON.stringify({
|
|
1900
|
+
email: r(),
|
|
1901
|
+
code: l().toUpperCase().trim(),
|
|
1820
1902
|
sectorID: e.sector,
|
|
1821
|
-
|
|
1903
|
+
transactionId: _e()
|
|
1822
1904
|
})
|
|
1823
|
-
}).then((
|
|
1824
|
-
if (
|
|
1825
|
-
throw new Error(
|
|
1826
|
-
}).then((
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1905
|
+
}).then((a) => {
|
|
1906
|
+
if (a.ok) return a.json();
|
|
1907
|
+
throw a.status === 400 ? new Error(h.i18n("sa-signup-verify-error")) : new Error(h.i18n("sa-signup-verify-error"));
|
|
1908
|
+
}).then((a) => {
|
|
1909
|
+
Se(a.token), localStorage.setItem("spartan-token", a.token), Ce.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login", {
|
|
1910
|
+
bubbles: !0,
|
|
1911
|
+
cancelable: !0,
|
|
1912
|
+
detail: {
|
|
1913
|
+
token: a.token
|
|
1914
|
+
}
|
|
1915
|
+
})), v(""), n("signup-webauthn");
|
|
1916
|
+
}).catch((a) => {
|
|
1917
|
+
D(a.message);
|
|
1830
1918
|
});
|
|
1831
1919
|
}
|
|
1832
|
-
function
|
|
1833
|
-
|
|
1920
|
+
function _() {
|
|
1921
|
+
b() || (pe(!0), D(""), fetch(`${e.domain}/api/v1/webauthn/registration/begin`, {
|
|
1922
|
+
method: "POST",
|
|
1923
|
+
mode: "cors",
|
|
1924
|
+
cache: "no-cache",
|
|
1925
|
+
headers: {
|
|
1926
|
+
"Content-Type": "application/json",
|
|
1927
|
+
Authorization: `bearer ${Fe()}`
|
|
1928
|
+
},
|
|
1929
|
+
body: JSON.stringify({
|
|
1930
|
+
keyName: "Default",
|
|
1931
|
+
sectorID: e.sector
|
|
1932
|
+
})
|
|
1933
|
+
}).then((a) => {
|
|
1934
|
+
if (!a.ok) throw new Error(h.i18n("sa-signup-webauthn-error"));
|
|
1935
|
+
return a.json();
|
|
1936
|
+
}).then((a) => {
|
|
1937
|
+
const i = Mt(a.Options);
|
|
1938
|
+
return jt(i).then((d) => {
|
|
1939
|
+
let y = JSON.parse(JSON.stringify(d));
|
|
1940
|
+
return y.transactionID = a.TransactionID, y;
|
|
1941
|
+
});
|
|
1942
|
+
}).then((a) => fetch(`${e.domain}/api/v1/webauthn/registration/finish`, {
|
|
1943
|
+
method: "POST",
|
|
1944
|
+
mode: "cors",
|
|
1945
|
+
cache: "no-cache",
|
|
1946
|
+
headers: {
|
|
1947
|
+
"Content-Type": "application/json",
|
|
1948
|
+
Authorization: `bearer ${Fe()}`
|
|
1949
|
+
},
|
|
1950
|
+
body: JSON.stringify(a)
|
|
1951
|
+
})).then((a) => {
|
|
1952
|
+
if (!a.ok) throw new Error(h.i18n("sa-signup-webauthn-error"));
|
|
1953
|
+
N();
|
|
1954
|
+
}).catch((a) => {
|
|
1955
|
+
D((a == null ? void 0 : a.message) || String(a));
|
|
1956
|
+
}).finally(() => {
|
|
1957
|
+
pe(!1);
|
|
1958
|
+
}));
|
|
1959
|
+
}
|
|
1960
|
+
function N() {
|
|
1961
|
+
n(e.startMode), e.redirect !== "" && (window.location.href = e.redirect);
|
|
1834
1962
|
}
|
|
1835
|
-
function
|
|
1836
|
-
|
|
1963
|
+
function R() {
|
|
1964
|
+
return console.log("login"), D(""), t() === "password" ? L() : t() === "webauthn" ? M() : t() === "otp-pick" ? J(De()) : t() === "otp" ? j() : t() === "reset-email" ? G() : t() === "reset-code" ? re() : Promise.resolve();
|
|
1965
|
+
}
|
|
1966
|
+
function P() {
|
|
1967
|
+
return console.log("signup"), D(""), z(!1), fetch(`${e.domain}/api/v1/users`, {
|
|
1837
1968
|
method: "POST",
|
|
1838
1969
|
mode: "cors",
|
|
1839
1970
|
cache: "no-cache",
|
|
1840
1971
|
body: JSON.stringify({
|
|
1841
|
-
username:
|
|
1972
|
+
username: r(),
|
|
1842
1973
|
password: u(),
|
|
1843
1974
|
sectorID: e.sector
|
|
1844
1975
|
})
|
|
1845
|
-
}).then((
|
|
1846
|
-
if (
|
|
1847
|
-
return
|
|
1848
|
-
throw new Error(
|
|
1849
|
-
}).then((
|
|
1850
|
-
console.log(
|
|
1851
|
-
|
|
1852
|
-
|
|
1976
|
+
}).then((a) => {
|
|
1977
|
+
if (a.ok)
|
|
1978
|
+
return a.json();
|
|
1979
|
+
throw new Error(h.i18n("sa-error-creating-user"));
|
|
1980
|
+
}).then((a) => {
|
|
1981
|
+
if (console.log(a), xe())
|
|
1982
|
+
return w(r(), a.enrollmentTransactionId || "");
|
|
1983
|
+
z(!0), n(e.startMode);
|
|
1984
|
+
}).catch((a) => {
|
|
1985
|
+
z(!1), D(a.message), console.log(a);
|
|
1853
1986
|
});
|
|
1854
1987
|
}
|
|
1855
|
-
function
|
|
1856
|
-
console.log("webauthnLogin"), fetch(`${e.domain}/api/v1/login/webauthn/begin`, {
|
|
1988
|
+
function M() {
|
|
1989
|
+
return console.log("webauthnLogin"), fetch(`${e.domain}/api/v1/login/webauthn/begin`, {
|
|
1857
1990
|
method: "POST",
|
|
1858
1991
|
mode: "cors",
|
|
1859
1992
|
cache: "no-cache",
|
|
1860
1993
|
body: JSON.stringify({
|
|
1861
|
-
username:
|
|
1994
|
+
username: r(),
|
|
1862
1995
|
sectorID: e.sector
|
|
1863
1996
|
})
|
|
1864
|
-
}).then((
|
|
1865
|
-
if (
|
|
1866
|
-
return
|
|
1867
|
-
throw
|
|
1868
|
-
}).then((
|
|
1869
|
-
console.log(
|
|
1870
|
-
const
|
|
1871
|
-
return console.log("Parsed WebAuthn request options:",
|
|
1872
|
-
const
|
|
1873
|
-
let
|
|
1874
|
-
return
|
|
1997
|
+
}).then((a) => {
|
|
1998
|
+
if (a.ok)
|
|
1999
|
+
return a.json();
|
|
2000
|
+
throw a.status === 401 ? (n("password"), D(h.i18n("webauthn-not-enrolled")), new Error(h.i18n("webauthn-not-enrolled"))) : new Error(`${a.status} ${a.statusText}: Network response was not ok.`);
|
|
2001
|
+
}).then((a) => {
|
|
2002
|
+
console.log(a);
|
|
2003
|
+
const i = Li(a.CredentialAssertion);
|
|
2004
|
+
return console.log("Parsed WebAuthn request options:", i), Ui(i).then((d) => {
|
|
2005
|
+
const y = JSON.stringify(d);
|
|
2006
|
+
let A = JSON.parse(y);
|
|
2007
|
+
return A.transactionID = a.TransactionID, A;
|
|
1875
2008
|
});
|
|
1876
|
-
}).then((
|
|
2009
|
+
}).then((a) => fetch(`${e.domain}/api/v1/login/webauthn/finish`, {
|
|
1877
2010
|
method: "POST",
|
|
1878
2011
|
mode: "cors",
|
|
1879
2012
|
cache: "no-cache",
|
|
1880
|
-
body: JSON.stringify(
|
|
1881
|
-
})).then(
|
|
1882
|
-
|
|
2013
|
+
body: JSON.stringify(a)
|
|
2014
|
+
})).then(T).catch((a) => {
|
|
2015
|
+
D(a.message), console.log(a);
|
|
1883
2016
|
});
|
|
1884
2017
|
}
|
|
1885
|
-
function
|
|
1886
|
-
console.log("password login"), fetch(e.domain + "/api/v1/login/password", {
|
|
2018
|
+
function L() {
|
|
2019
|
+
return console.log("password login"), fetch(e.domain + "/api/v1/login/password", {
|
|
1887
2020
|
method: "post",
|
|
1888
2021
|
mode: "cors",
|
|
1889
2022
|
cache: "no-cache",
|
|
1890
2023
|
body: JSON.stringify({
|
|
1891
|
-
username:
|
|
2024
|
+
username: r(),
|
|
1892
2025
|
password: u(),
|
|
1893
2026
|
sectorID: e.sector
|
|
1894
2027
|
})
|
|
1895
|
-
}).then(
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
2028
|
+
}).then(T);
|
|
2029
|
+
}
|
|
2030
|
+
function T(a) {
|
|
2031
|
+
return Promise.resolve(a).then((i) => {
|
|
2032
|
+
if (i.ok)
|
|
2033
|
+
return i.json();
|
|
2034
|
+
throw i;
|
|
2035
|
+
}).then((i) => {
|
|
2036
|
+
if (console.log(i), localStorage.setItem("spartan-txid", i.transactionID), !i.token) {
|
|
2037
|
+
if (i.challengeType === "email_enrollment")
|
|
2038
|
+
return w(r(), i.transactionID || "");
|
|
2039
|
+
if (i.challengeType.indexOf("otp") !== -1)
|
|
2040
|
+
return X();
|
|
2041
|
+
i.challengeType.indexOf("webauthn") !== -1 ? (n("webauthn"), D(h.i18n("sa-webauthn-required"))) : D(h.i18n("sa-unknown-challenge"));
|
|
1906
2042
|
return;
|
|
1907
2043
|
}
|
|
1908
|
-
localStorage.setItem("spartan-token",
|
|
1909
|
-
const
|
|
2044
|
+
localStorage.setItem("spartan-token", i.token);
|
|
2045
|
+
const d = new CustomEvent("spartan-login", {
|
|
1910
2046
|
bubbles: !0,
|
|
1911
2047
|
cancelable: !0,
|
|
1912
2048
|
detail: {
|
|
1913
|
-
token:
|
|
1914
|
-
transactionID:
|
|
2049
|
+
token: i.token,
|
|
2050
|
+
transactionID: i.transactionID
|
|
1915
2051
|
}
|
|
1916
2052
|
});
|
|
1917
|
-
|
|
1918
|
-
}).catch((
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
const o = localStorage.getItem("spartan-txid") || "";
|
|
1928
|
-
fetch(e.domain + `/api/v1/otp/${encodeURIComponent(n())}?transactionID=${encodeURIComponent(o)}§orID=${encodeURIComponent(e.sector)}`, {
|
|
2053
|
+
Ce.getRootNode().host.dispatchEvent(d), x() !== "" && (window.location.href = x());
|
|
2054
|
+
}).catch((i) => i.json().then((d) => {
|
|
2055
|
+
console.log(d.message), D(d.message);
|
|
2056
|
+
}).catch((d) => {
|
|
2057
|
+
console.log(d);
|
|
2058
|
+
}));
|
|
2059
|
+
}
|
|
2060
|
+
function X() {
|
|
2061
|
+
const a = localStorage.getItem("spartan-txid") || "";
|
|
2062
|
+
return fetch(e.domain + `/api/v1/otp/${encodeURIComponent(r())}?transactionID=${encodeURIComponent(a)}§orID=${encodeURIComponent(e.sector)}`, {
|
|
1929
2063
|
method: "get",
|
|
1930
2064
|
mode: "cors",
|
|
1931
2065
|
cache: "no-cache"
|
|
1932
|
-
}).then((
|
|
1933
|
-
if (
|
|
1934
|
-
return
|
|
1935
|
-
throw new Error(
|
|
1936
|
-
}).then((
|
|
1937
|
-
const
|
|
1938
|
-
if (
|
|
1939
|
-
|
|
2066
|
+
}).then((i) => {
|
|
2067
|
+
if (i.ok)
|
|
2068
|
+
return i.json();
|
|
2069
|
+
throw new Error(h.i18n("error-otp-list"));
|
|
2070
|
+
}).then((i) => {
|
|
2071
|
+
const d = i.registrations || [];
|
|
2072
|
+
if (d.length === 0) {
|
|
2073
|
+
D(h.i18n("sa-otp-no-registrations"));
|
|
1940
2074
|
return;
|
|
1941
2075
|
}
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
2076
|
+
if (d.length === 1)
|
|
2077
|
+
return J(d[0].ID || "");
|
|
2078
|
+
me(d), k(d[0].ID || ""), n("otp-pick"), D("");
|
|
2079
|
+
}).catch((i) => {
|
|
2080
|
+
D(i.message), console.log(i);
|
|
1945
2081
|
});
|
|
1946
2082
|
}
|
|
1947
|
-
function
|
|
1948
|
-
console.log("begin OTP, registrationID:",
|
|
2083
|
+
function J(a) {
|
|
2084
|
+
return console.log("begin OTP, registrationID:", a), fetch(e.domain + "/api/v1/login/otp/begin", {
|
|
1949
2085
|
method: "post",
|
|
1950
2086
|
mode: "cors",
|
|
1951
2087
|
cache: "no-cache",
|
|
1952
2088
|
body: JSON.stringify({
|
|
1953
|
-
username:
|
|
2089
|
+
username: r(),
|
|
1954
2090
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
1955
|
-
registrationID:
|
|
2091
|
+
registrationID: a,
|
|
1956
2092
|
sectorID: e.sector
|
|
1957
2093
|
})
|
|
1958
|
-
}).then((
|
|
1959
|
-
if (
|
|
1960
|
-
return
|
|
1961
|
-
throw new Error(`${
|
|
1962
|
-
}).then((
|
|
1963
|
-
console.log(
|
|
1964
|
-
}).catch((
|
|
1965
|
-
|
|
2094
|
+
}).then((i) => {
|
|
2095
|
+
if (i.ok)
|
|
2096
|
+
return i.json();
|
|
2097
|
+
throw new Error(`${i.status} ${i.statusText}`);
|
|
2098
|
+
}).then((i) => {
|
|
2099
|
+
console.log(i), i.transactionID && localStorage.setItem("spartan-txid", i.transactionID), v(""), D(""), n("otp");
|
|
2100
|
+
}).catch((i) => {
|
|
2101
|
+
D(i.message), console.log(i);
|
|
1966
2102
|
});
|
|
1967
2103
|
}
|
|
1968
|
-
function
|
|
1969
|
-
console.log("OTP login submit"), fetch(e.domain + "/api/v1/login/otp", {
|
|
2104
|
+
function j() {
|
|
2105
|
+
return console.log("OTP login submit"), fetch(e.domain + "/api/v1/login/otp", {
|
|
1970
2106
|
method: "post",
|
|
1971
2107
|
mode: "cors",
|
|
1972
2108
|
cache: "no-cache",
|
|
1973
2109
|
body: JSON.stringify({
|
|
1974
|
-
username:
|
|
1975
|
-
password:
|
|
2110
|
+
username: r(),
|
|
2111
|
+
password: l(),
|
|
1976
2112
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
1977
2113
|
sectorID: e.sector
|
|
1978
2114
|
})
|
|
1979
|
-
}).then(
|
|
2115
|
+
}).then(T);
|
|
1980
2116
|
}
|
|
1981
|
-
function
|
|
1982
|
-
console.log("begin password reset"),
|
|
2117
|
+
function G() {
|
|
2118
|
+
return console.log("begin password reset"), D(""), W(!1), fetch(`${e.domain}/api/v1/password/reset/begin`, {
|
|
1983
2119
|
method: "POST",
|
|
1984
2120
|
mode: "cors",
|
|
1985
2121
|
cache: "no-cache",
|
|
@@ -1987,21 +2123,21 @@ tt("spartan-login", aa, (e) => {
|
|
|
1987
2123
|
"Content-Type": "application/json"
|
|
1988
2124
|
},
|
|
1989
2125
|
body: JSON.stringify({
|
|
1990
|
-
email:
|
|
2126
|
+
email: r(),
|
|
1991
2127
|
sectorID: e.sector
|
|
1992
2128
|
})
|
|
1993
|
-
}).then((
|
|
1994
|
-
if (
|
|
1995
|
-
return
|
|
1996
|
-
throw new Error(
|
|
1997
|
-
}).then((
|
|
1998
|
-
console.log(
|
|
1999
|
-
}).catch((
|
|
2000
|
-
|
|
2129
|
+
}).then((a) => {
|
|
2130
|
+
if (a.ok)
|
|
2131
|
+
return a.json();
|
|
2132
|
+
throw new Error(h.i18n("sa-reset-error"));
|
|
2133
|
+
}).then((a) => {
|
|
2134
|
+
console.log(a), D(h.i18n("sa-reset-email-sent")), K(""), U(""), n("reset-code");
|
|
2135
|
+
}).catch((a) => {
|
|
2136
|
+
D(a.message), console.log(a);
|
|
2001
2137
|
});
|
|
2002
2138
|
}
|
|
2003
|
-
function
|
|
2004
|
-
console.log("complete password reset"),
|
|
2139
|
+
function re() {
|
|
2140
|
+
return console.log("complete password reset"), D(""), fetch(`${e.domain}/api/v1/password/reset/complete`, {
|
|
2005
2141
|
method: "POST",
|
|
2006
2142
|
mode: "cors",
|
|
2007
2143
|
cache: "no-cache",
|
|
@@ -2009,142 +2145,176 @@ tt("spartan-login", aa, (e) => {
|
|
|
2009
2145
|
"Content-Type": "application/json"
|
|
2010
2146
|
},
|
|
2011
2147
|
body: JSON.stringify({
|
|
2012
|
-
email:
|
|
2013
|
-
code:
|
|
2014
|
-
newPassword:
|
|
2148
|
+
email: r(),
|
|
2149
|
+
code: ne().toUpperCase().trim(),
|
|
2150
|
+
newPassword: Q(),
|
|
2015
2151
|
sectorID: e.sector
|
|
2016
2152
|
})
|
|
2017
|
-
}).then((
|
|
2018
|
-
if (
|
|
2019
|
-
return
|
|
2020
|
-
throw
|
|
2021
|
-
}).then((
|
|
2022
|
-
console.log(
|
|
2023
|
-
}).catch((
|
|
2024
|
-
|
|
2153
|
+
}).then((a) => {
|
|
2154
|
+
if (a.ok)
|
|
2155
|
+
return a.json();
|
|
2156
|
+
throw a.status === 400 ? new Error(h.i18n("sa-reset-error-code")) : new Error(h.i18n("sa-reset-error"));
|
|
2157
|
+
}).then((a) => {
|
|
2158
|
+
console.log(a), W(!0), K(""), U(""), o(""), n(e.startMode);
|
|
2159
|
+
}).catch((a) => {
|
|
2160
|
+
D(a.message), console.log(a);
|
|
2025
2161
|
});
|
|
2026
2162
|
}
|
|
2027
2163
|
return (() => {
|
|
2028
|
-
var
|
|
2029
|
-
return typeof
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2164
|
+
var a = Hi(), i = a.firstChild, d = i.nextSibling, y = d.nextSibling, A = y.nextSibling, q = Ce;
|
|
2165
|
+
return typeof q == "function" ? Bt(q, a) : Ce = a, a.addEventListener("submit", (m) => {
|
|
2166
|
+
if (m.preventDefault(), b()) return;
|
|
2167
|
+
pe(!0), (t() === "sign-up" ? P() : t() === "signup-verify" ? C() : R()).finally(() => pe(!1));
|
|
2168
|
+
}), f(d, Ae), f(y, (() => {
|
|
2169
|
+
var m = p(() => t() === "reset-email" || t() === "reset-code");
|
|
2170
|
+
return () => m() ? h.i18n("sa-reset-password") : p(() => t() === "signup-verify" || t() === "signup-webauthn")() ? h.i18n("sa-signup-mfa-title") : h.i18n("sa-login");
|
|
2171
|
+
})()), f(a, B && (() => {
|
|
2172
|
+
var m = Wi();
|
|
2173
|
+
return f(m, B), m;
|
|
2174
|
+
})(), A), f(a, (() => {
|
|
2175
|
+
var m = p(() => !!ge());
|
|
2039
2176
|
return () => m() && (() => {
|
|
2040
|
-
var c =
|
|
2041
|
-
return
|
|
2177
|
+
var c = Ze();
|
|
2178
|
+
return f(c, () => h.i18n("sa-signup-complete")), c;
|
|
2042
2179
|
})();
|
|
2043
|
-
})(),
|
|
2044
|
-
var m =
|
|
2180
|
+
})(), A), f(a, (() => {
|
|
2181
|
+
var m = p(() => !!H());
|
|
2045
2182
|
return () => m() && (() => {
|
|
2046
|
-
var c =
|
|
2047
|
-
return
|
|
2183
|
+
var c = Ze();
|
|
2184
|
+
return f(c, () => h.i18n("sa-reset-success")), c;
|
|
2048
2185
|
})();
|
|
2049
|
-
})(),
|
|
2050
|
-
var m =
|
|
2051
|
-
return () => m() && [
|
|
2052
|
-
var c =
|
|
2053
|
-
return c.$$input = (g) =>
|
|
2054
|
-
})()),
|
|
2055
|
-
var c =
|
|
2056
|
-
return
|
|
2186
|
+
})(), A), A.$$input = (m) => s(m.currentTarget.value), f(a, (() => {
|
|
2187
|
+
var m = p(() => t() !== "sign-up" && t() !== "signup-verify" && t() !== "signup-webauthn");
|
|
2188
|
+
return () => m() && [p(() => p(() => t() === "password")() && (() => {
|
|
2189
|
+
var c = gt();
|
|
2190
|
+
return c.$$input = (g) => o(g.currentTarget.value), $(() => ce(c, "placeholder", h.i18n("sa-password"))), $(() => c.value = u()), c;
|
|
2191
|
+
})()), p(() => p(() => t() === "webauthn")() && Ze()), p(() => p(() => t() === "otp-pick")() && [(() => {
|
|
2192
|
+
var c = Ye();
|
|
2193
|
+
return f(c, () => h.i18n("sa-otp-choose")), c;
|
|
2057
2194
|
})(), (() => {
|
|
2058
|
-
var c =
|
|
2059
|
-
return c.addEventListener("change", (g) =>
|
|
2060
|
-
var
|
|
2061
|
-
return
|
|
2062
|
-
})())),
|
|
2063
|
-
})()]),
|
|
2064
|
-
var c = Yi();
|
|
2065
|
-
return c.$$input = (g) => F(g.currentTarget.value), O(() => oe(c, "placeholder", b.i18n("sa-code"))), O(() => c.value = a()), c;
|
|
2066
|
-
})()), C(() => C(() => t() === "reset-code")() && [(() => {
|
|
2195
|
+
var c = Zi();
|
|
2196
|
+
return c.addEventListener("change", (g) => k(g.currentTarget.value)), f(c, () => he().map((g) => (() => {
|
|
2197
|
+
var O = Yi(), ze = O.firstChild, Ne = ze.nextSibling;
|
|
2198
|
+
return Ne.nextSibling, f(O, () => g.DisplayName || g.ID, ze), f(O, () => g.Type, Ne), $(() => O.value = g.ID), O;
|
|
2199
|
+
})())), $(() => c.value = De()), c;
|
|
2200
|
+
})()]), p(() => p(() => t() === "otp")() && (() => {
|
|
2067
2201
|
var c = Xi();
|
|
2068
|
-
return c.$$input = (g) =>
|
|
2202
|
+
return c.$$input = (g) => v(g.currentTarget.value), $(() => ce(c, "placeholder", h.i18n("sa-code"))), $(() => c.value = l()), c;
|
|
2203
|
+
})()), p(() => p(() => t() === "reset-code")() && [(() => {
|
|
2204
|
+
var c = mt();
|
|
2205
|
+
return c.$$input = (g) => K(g.currentTarget.value), $(() => ce(c, "placeholder", h.i18n("sa-reset-code"))), $(() => c.value = ne()), c;
|
|
2069
2206
|
})(), (() => {
|
|
2070
2207
|
var c = Qi();
|
|
2071
|
-
return c.$$input = (g) =>
|
|
2072
|
-
})()]),
|
|
2073
|
-
var c = ea(), g = c.firstChild,
|
|
2074
|
-
return
|
|
2208
|
+
return c.$$input = (g) => U(g.currentTarget.value), $(() => ce(c, "placeholder", h.i18n("sa-new-password"))), $(() => c.value = Q()), c;
|
|
2209
|
+
})()]), p(() => p(() => t() === "password" || t() === "webauthn")() && (() => {
|
|
2210
|
+
var c = ea(), g = c.firstChild, O = g.nextSibling;
|
|
2211
|
+
return O.firstChild, c.$$click = () => n(t() === "password" ? "webauthn" : "password"), f(O, () => h.i18n("sa-use-password"), null), $(() => g.checked = t() === "password"), c;
|
|
2075
2212
|
})())];
|
|
2076
|
-
})(),
|
|
2077
|
-
var m =
|
|
2213
|
+
})(), null), f(a, (() => {
|
|
2214
|
+
var m = p(() => t() === "sign-up");
|
|
2215
|
+
return () => m() && (() => {
|
|
2216
|
+
var c = gt();
|
|
2217
|
+
return c.$$input = (g) => o(g.currentTarget.value), $(() => ce(c, "placeholder", h.i18n("sa-password"))), $(() => c.value = u()), c;
|
|
2218
|
+
})();
|
|
2219
|
+
})(), null), f(a, (() => {
|
|
2220
|
+
var m = p(() => t() === "signup-verify");
|
|
2221
|
+
return () => m() && [(() => {
|
|
2222
|
+
var c = Ye();
|
|
2223
|
+
return f(c, () => h.i18n("sa-signup-verify-prompt")), c;
|
|
2224
|
+
})(), (() => {
|
|
2225
|
+
var c = mt();
|
|
2226
|
+
return c.$$input = (g) => v(g.currentTarget.value), $(() => ce(c, "placeholder", h.i18n("sa-code"))), $(() => c.value = l()), c;
|
|
2227
|
+
})()];
|
|
2228
|
+
})(), null), f(a, (() => {
|
|
2229
|
+
var m = p(() => t() === "signup-webauthn");
|
|
2230
|
+
return () => m() && (() => {
|
|
2231
|
+
var c = Ye();
|
|
2232
|
+
return f(c, () => h.i18n("sa-signup-webauthn-prompt")), c;
|
|
2233
|
+
})();
|
|
2234
|
+
})(), null), f(a, (() => {
|
|
2235
|
+
var m = p(() => t() !== "signup-webauthn");
|
|
2078
2236
|
return () => m() && (() => {
|
|
2079
|
-
var c =
|
|
2080
|
-
return
|
|
2237
|
+
var c = ta();
|
|
2238
|
+
return f(c, (() => {
|
|
2239
|
+
var g = p(() => !!b());
|
|
2240
|
+
return () => g() ? h.i18n("sa-loading") : p(() => t() === "sign-up")() ? h.i18n("sa-signup") : p(() => t() === "otp-pick")() ? h.i18n("sa-otp-send-code") : p(() => t() === "otp")() ? h.i18n("sa-otp-verify") : p(() => t() === "reset-email")() ? h.i18n("sa-otp-send-code") : p(() => t() === "reset-code")() ? h.i18n("sa-reset-submit") : p(() => t() === "signup-verify")() ? h.i18n("sa-otp-verify") : h.i18n("sa-login");
|
|
2241
|
+
})()), $(() => c.disabled = b()), c;
|
|
2081
2242
|
})();
|
|
2082
|
-
})(),
|
|
2083
|
-
var m =
|
|
2084
|
-
return () => m()
|
|
2085
|
-
|
|
2086
|
-
|
|
2243
|
+
})(), null), f(a, (() => {
|
|
2244
|
+
var m = p(() => t() === "signup-webauthn");
|
|
2245
|
+
return () => m() && [(() => {
|
|
2246
|
+
var c = na();
|
|
2247
|
+
return c.$$click = () => _(), f(c, (() => {
|
|
2248
|
+
var g = p(() => !!b());
|
|
2249
|
+
return () => g() ? h.i18n("sa-loading") : h.i18n("sa-signup-webauthn-setup");
|
|
2250
|
+
})()), $(() => c.disabled = b()), c;
|
|
2251
|
+
})(), (() => {
|
|
2252
|
+
var c = Me();
|
|
2253
|
+
return c.$$click = () => N(), f(c, () => h.i18n("sa-signup-webauthn-done")), c;
|
|
2254
|
+
})()];
|
|
2255
|
+
})(), null), f(a, (() => {
|
|
2256
|
+
var m = p(() => t() === "password");
|
|
2087
2257
|
return () => m() && (() => {
|
|
2088
|
-
var c =
|
|
2258
|
+
var c = Me();
|
|
2089
2259
|
return c.$$click = () => {
|
|
2090
|
-
|
|
2091
|
-
},
|
|
2260
|
+
D(""), W(!1), n("reset-email");
|
|
2261
|
+
}, f(c, () => h.i18n("sa-forgot-password")), c;
|
|
2092
2262
|
})();
|
|
2093
|
-
})(), null),
|
|
2094
|
-
var m =
|
|
2263
|
+
})(), null), f(a, (() => {
|
|
2264
|
+
var m = p(() => t() === "reset-email" || t() === "reset-code");
|
|
2095
2265
|
return () => m() && (() => {
|
|
2096
|
-
var c =
|
|
2266
|
+
var c = Me();
|
|
2097
2267
|
return c.$$click = () => {
|
|
2098
|
-
|
|
2099
|
-
},
|
|
2268
|
+
D(""), K(""), U(""), n(e.startMode);
|
|
2269
|
+
}, f(c, () => h.i18n("sa-back")), c;
|
|
2100
2270
|
})();
|
|
2101
|
-
})(), null),
|
|
2102
|
-
var m =
|
|
2271
|
+
})(), null), f(a, (() => {
|
|
2272
|
+
var m = p(() => !!(te() && t() !== "reset-email" && t() !== "reset-code" && t() !== "signup-verify" && t() !== "signup-webauthn"));
|
|
2103
2273
|
return () => m() && (() => {
|
|
2104
|
-
var c =
|
|
2105
|
-
return c.$$click = () => t() === "sign-up" ?
|
|
2106
|
-
var g =
|
|
2107
|
-
return () => g() ?
|
|
2274
|
+
var c = Me();
|
|
2275
|
+
return c.$$click = () => t() === "sign-up" ? n(e.startMode) : n("sign-up"), f(c, (() => {
|
|
2276
|
+
var g = p(() => t() === "sign-up");
|
|
2277
|
+
return () => g() ? h.i18n("sa-back") : h.i18n("sa-signup");
|
|
2108
2278
|
})()), c;
|
|
2109
2279
|
})();
|
|
2110
|
-
})(), null),
|
|
2111
|
-
var m =
|
|
2280
|
+
})(), null), f(a, (() => {
|
|
2281
|
+
var m = p(() => Y().length > 0 && (t() === "password" || t() === "webauthn" || t() === "sign-up"));
|
|
2112
2282
|
return () => m() && [(() => {
|
|
2113
|
-
var c =
|
|
2114
|
-
return
|
|
2115
|
-
})(),
|
|
2116
|
-
var g =
|
|
2117
|
-
return g.$$click = () =>
|
|
2118
|
-
var
|
|
2119
|
-
return () =>
|
|
2120
|
-
})(), null),
|
|
2121
|
-
var
|
|
2122
|
-
return () =>
|
|
2123
|
-
})(), null),
|
|
2124
|
-
var
|
|
2125
|
-
return () =>
|
|
2283
|
+
var c = ra(), g = c.firstChild;
|
|
2284
|
+
return f(g, () => h.i18n("sa-or")), c;
|
|
2285
|
+
})(), p(() => Y().map((c) => (() => {
|
|
2286
|
+
var g = sa();
|
|
2287
|
+
return g.$$click = () => Te(c.provider), f(g, (() => {
|
|
2288
|
+
var O = p(() => c.provider === "google");
|
|
2289
|
+
return () => O() && ua();
|
|
2290
|
+
})(), null), f(g, (() => {
|
|
2291
|
+
var O = p(() => c.provider === "github");
|
|
2292
|
+
return () => O() && ia();
|
|
2293
|
+
})(), null), f(g, (() => {
|
|
2294
|
+
var O = p(() => c.provider === "apple");
|
|
2295
|
+
return () => O() && // <svg width="18" height="18" viewBox="0 0 814 1000" xmlns="http://www.w3.org/2000/svg">
|
|
2126
2296
|
// <path d="M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76 0-103.7 40.8-165.9 40.8s-105-57.8-155.5-127.4C46 790.7 0 663 0 541.8c0-207.8 134.4-317.3 266.5-317.3 100.3 0 183.4 67.7 244.6 67.7 57.3 0 147.4-71.6 260.1-71.6zm-174.5-92.5c-50.9 67-123.1 110.6-195.7 110.6-8.3 0-16.6-.8-24.8-2.5 1.7-63.2 43.3-131.2 94.1-179.3 52.7-49.9 132.7-85.3 207.3-87.5 1.6 8.8 2.4 17.7 2.4 26.7 0 61.6-28.4 127-83.3 131.9z" fill="currentColor"/>
|
|
2127
2297
|
// </svg>
|
|
2128
|
-
|
|
2129
|
-
})(), null),
|
|
2130
|
-
var
|
|
2131
|
-
return () =>
|
|
2132
|
-
})(), null),
|
|
2133
|
-
var
|
|
2134
|
-
return () =>
|
|
2135
|
-
})(), null),
|
|
2298
|
+
aa();
|
|
2299
|
+
})(), null), f(g, (() => {
|
|
2300
|
+
var O = p(() => c.provider === "oidc");
|
|
2301
|
+
return () => O() && oa();
|
|
2302
|
+
})(), null), f(g, (() => {
|
|
2303
|
+
var O = p(() => c.provider === "google");
|
|
2304
|
+
return () => O() ? h.i18n("sa-social-google") : p(() => c.provider === "github")() ? h.i18n("sa-social-github") : p(() => c.provider === "apple")() ? h.i18n("sa-social-apple") : h.i18n("sa-social-oidc");
|
|
2305
|
+
})(), null), $(() => g.disabled = !!ae()), g;
|
|
2136
2306
|
})()))];
|
|
2137
|
-
})(), null),
|
|
2138
|
-
var c =
|
|
2139
|
-
return c !== m.e &&
|
|
2307
|
+
})(), null), $((m) => {
|
|
2308
|
+
var c = h.i18n("sa-username"), g = t() === "otp" || t() === "otp-pick" || t() === "reset-code" || t() === "signup-verify" || t() === "signup-webauthn";
|
|
2309
|
+
return c !== m.e && ce(A, "placeholder", m.e = c), g !== m.t && (A.disabled = m.t = g), m;
|
|
2140
2310
|
}, {
|
|
2141
2311
|
e: void 0,
|
|
2142
2312
|
t: void 0
|
|
2143
|
-
}),
|
|
2313
|
+
}), $(() => A.value = r()), a;
|
|
2144
2314
|
})();
|
|
2145
2315
|
});
|
|
2146
|
-
|
|
2147
|
-
var
|
|
2316
|
+
rt(["input", "click"]);
|
|
2317
|
+
var ca = /* @__PURE__ */ F(`<div class=container><style>.container {
|
|
2148
2318
|
background-color: #ffffff;
|
|
2149
2319
|
border-radius: 10px;
|
|
2150
2320
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
@@ -2212,6 +2382,11 @@ var oa = /* @__PURE__ */ B(`<div class=container><style>.container {
|
|
|
2212
2382
|
cursor: pointer;
|
|
2213
2383
|
}
|
|
2214
2384
|
|
|
2385
|
+
.btn:disabled {
|
|
2386
|
+
opacity: 0.6;
|
|
2387
|
+
cursor: not-allowed;
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2215
2390
|
.btn.add {
|
|
2216
2391
|
background-color: #007bff;
|
|
2217
2392
|
color: #ffffff;
|
|
@@ -2317,8 +2492,8 @@ var oa = /* @__PURE__ */ B(`<div class=container><style>.container {
|
|
|
2317
2492
|
.modal-content .btn.verify:hover {
|
|
2318
2493
|
background-color: #0056b3;
|
|
2319
2494
|
}
|
|
2320
|
-
</style><style></style><h1 class=header>`),
|
|
2321
|
-
const
|
|
2495
|
+
</style><style></style><h1 class=header>`), bt = /* @__PURE__ */ F("<span class=error-message>"), da = /* @__PURE__ */ F("<div class=section><h2></h2><div class=security-keys>"), fa = /* @__PURE__ */ F('<div class=key-item><span></span><button class="btn remove">'), Ct = /* @__PURE__ */ F("<span>"), ha = /* @__PURE__ */ F("<div class=section><div class=security-keys>"), Da = /* @__PURE__ */ F('<button class="btn add">+ '), pa = /* @__PURE__ */ F('<div class=add-key-form><div class=add-key-item><label for=keyName style=display:none;></label><input id=keyName type=text><button class="btn remove"></button><button class="btn add">'), ga = /* @__PURE__ */ F("<div class=section><h2></h2><table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>"), ma = /* @__PURE__ */ F('<tr class=mfa-list-item><td></td><td></td><td><button class="btn remove">'), ba = /* @__PURE__ */ F('<span> <button class="btn validate">'), Ca = /* @__PURE__ */ F('<div class=section><div class=mfa-manage><button class="btn add">+ '), va = /* @__PURE__ */ F('<div class=section><h2></h2><div class=mfa-manage><div class=mfa-item><label for=email></label><input id=email type=text><button class="btn add"></button></div><div class=mfa-item><label for=phone></label><input id=phone type=text><button class="btn add"></button></div><div class=mfa-item><button class="btn remove">'), Aa = /* @__PURE__ */ F('<div class=modal id=mfaModal><div class=modal-content><span class=close id=closeModal>×</span><h2>MFA Verification</h2><p>Please enter the verification code sent to your email or phone:</p><input type=text id=mfaCode placeholder="Enter verification code"><button class="btn verify"id=verifyMfa>Verify');
|
|
2496
|
+
const wa = {
|
|
2322
2497
|
domain: "http://127.0.0.1:11000",
|
|
2323
2498
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2324
2499
|
// defaults to the admin sector
|
|
@@ -2328,283 +2503,291 @@ const Aa = {
|
|
|
2328
2503
|
redirect: "/",
|
|
2329
2504
|
redirectOnUnauthenticated: !0
|
|
2330
2505
|
};
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
const [t,
|
|
2334
|
-
let
|
|
2506
|
+
st("spartan-account-settings", wa, (e) => {
|
|
2507
|
+
E(""), E("");
|
|
2508
|
+
const [t, n] = E(""), [r, s] = E(""), [u, o] = E(""), [l] = E(e.showWebAuthn), [v, B] = E(!1), [D, x] = E(!1), [te, ue] = E(!1), [ge, z] = E(!1), [H, W] = E(!1), [ne, K] = E([]), [Q, U] = E([]), [he, me] = E(""), [De, k] = E(""), [Y, be] = E(""), [ae, oe] = E(""), b = ut(e.locale);
|
|
2509
|
+
let pe;
|
|
2335
2510
|
try {
|
|
2336
|
-
|
|
2511
|
+
pe = e.styles;
|
|
2337
2512
|
} catch {
|
|
2338
|
-
|
|
2513
|
+
pe = "";
|
|
2339
2514
|
}
|
|
2340
|
-
|
|
2341
|
-
if (
|
|
2342
|
-
|
|
2515
|
+
tt(async () => {
|
|
2516
|
+
if (Rt())
|
|
2517
|
+
x(!0), s("");
|
|
2343
2518
|
else {
|
|
2344
2519
|
if (e.redirectOnUnauthenticated) {
|
|
2345
2520
|
window.location.href = e.redirect;
|
|
2346
2521
|
return;
|
|
2347
2522
|
}
|
|
2348
|
-
|
|
2523
|
+
x(!1), s(b.i18n("not-authenticated"));
|
|
2349
2524
|
}
|
|
2350
|
-
|
|
2351
|
-
console.log(
|
|
2352
|
-
}), await
|
|
2353
|
-
|
|
2525
|
+
xe().then((C) => {
|
|
2526
|
+
console.log(C);
|
|
2527
|
+
}), await Ee(), fe().then((C) => {
|
|
2528
|
+
U(C.registrations);
|
|
2354
2529
|
});
|
|
2355
2530
|
});
|
|
2356
|
-
async function
|
|
2357
|
-
return await (await fetch(`${e.domain}/api/v1/users/self`,
|
|
2531
|
+
async function xe() {
|
|
2532
|
+
return await (await fetch(`${e.domain}/api/v1/users/self`, le("get"))).json();
|
|
2358
2533
|
}
|
|
2359
|
-
function
|
|
2534
|
+
function le(w = "get") {
|
|
2360
2535
|
return {
|
|
2361
|
-
method:
|
|
2536
|
+
method: w,
|
|
2362
2537
|
mode: "cors",
|
|
2363
2538
|
cache: "no-cache",
|
|
2364
2539
|
headers: {
|
|
2365
2540
|
"Content-Type": "application",
|
|
2366
|
-
Authorization: `bearer ${
|
|
2541
|
+
Authorization: `bearer ${Ki()}`
|
|
2367
2542
|
}
|
|
2368
2543
|
};
|
|
2369
2544
|
}
|
|
2370
|
-
function
|
|
2371
|
-
|
|
2372
|
-
|
|
2545
|
+
function Fe() {
|
|
2546
|
+
if (H()) return;
|
|
2547
|
+
W(!0);
|
|
2548
|
+
let w = le("post");
|
|
2549
|
+
w.body = JSON.stringify({
|
|
2373
2550
|
keyName: t(),
|
|
2374
2551
|
sectorID: e.sector
|
|
2375
|
-
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`,
|
|
2376
|
-
if (
|
|
2377
|
-
return
|
|
2378
|
-
throw
|
|
2379
|
-
}).then((
|
|
2380
|
-
|
|
2381
|
-
s(
|
|
2382
|
-
}) : s(
|
|
2552
|
+
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`, w).then((C) => {
|
|
2553
|
+
if (C.status === 200)
|
|
2554
|
+
return C.json();
|
|
2555
|
+
throw C;
|
|
2556
|
+
}).then((C) => (console.log(C), Se(C))).catch((C) => {
|
|
2557
|
+
C.json ? C.json().then((_) => {
|
|
2558
|
+
s(_.message);
|
|
2559
|
+
}) : s(C);
|
|
2560
|
+
}).finally(() => {
|
|
2561
|
+
W(!1);
|
|
2383
2562
|
});
|
|
2384
2563
|
}
|
|
2385
|
-
async function
|
|
2564
|
+
async function Se(w) {
|
|
2386
2565
|
try {
|
|
2387
|
-
const
|
|
2388
|
-
console.log("Parsed WebAuthn creation options:",
|
|
2389
|
-
const
|
|
2390
|
-
let
|
|
2391
|
-
|
|
2392
|
-
let
|
|
2393
|
-
|
|
2394
|
-
const
|
|
2395
|
-
if (
|
|
2396
|
-
const
|
|
2397
|
-
s(
|
|
2566
|
+
const C = Mt(w.Options);
|
|
2567
|
+
console.log("Parsed WebAuthn creation options:", C);
|
|
2568
|
+
const _ = await jt(C), N = JSON.stringify(_);
|
|
2569
|
+
let R = JSON.parse(N);
|
|
2570
|
+
R.transactionID = w.TransactionID;
|
|
2571
|
+
let P = le("post");
|
|
2572
|
+
P.body = JSON.stringify(R);
|
|
2573
|
+
const M = await fetch(`${e.domain}/api/v1/webauthn/registration/finish`, P);
|
|
2574
|
+
if (M.status !== 200) {
|
|
2575
|
+
const L = await M.json();
|
|
2576
|
+
s(L.message);
|
|
2398
2577
|
return;
|
|
2399
2578
|
}
|
|
2400
|
-
|
|
2401
|
-
} catch (
|
|
2402
|
-
console.error("WebAuthn registration error:",
|
|
2579
|
+
B(!1), n(""), Ee();
|
|
2580
|
+
} catch (C) {
|
|
2581
|
+
console.error("WebAuthn registration error:", C), s((C == null ? void 0 : C.message) || String(C));
|
|
2403
2582
|
}
|
|
2404
2583
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
let
|
|
2407
|
-
|
|
2408
|
-
ID:
|
|
2584
|
+
async function _e(w) {
|
|
2585
|
+
let C = le("delete");
|
|
2586
|
+
C.body = JSON.stringify({
|
|
2587
|
+
ID: w
|
|
2409
2588
|
});
|
|
2410
2589
|
try {
|
|
2411
|
-
if ((await fetch(`${e.domain}/api/v1/webauthn/${
|
|
2412
|
-
s(
|
|
2590
|
+
if ((await fetch(`${e.domain}/api/v1/webauthn/${w}`, C)).status !== 200) {
|
|
2591
|
+
s(b.i18n("error-webauthn-remove"));
|
|
2413
2592
|
return;
|
|
2414
2593
|
}
|
|
2415
|
-
|
|
2416
|
-
} catch (
|
|
2417
|
-
console.error(
|
|
2594
|
+
Ee();
|
|
2595
|
+
} catch (_) {
|
|
2596
|
+
console.error(_), s(b.i18n("error-webauthn-remove"));
|
|
2418
2597
|
return;
|
|
2419
2598
|
}
|
|
2420
2599
|
}
|
|
2421
|
-
async function
|
|
2422
|
-
let
|
|
2600
|
+
async function Ee() {
|
|
2601
|
+
let w = le("get");
|
|
2423
2602
|
try {
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2426
|
-
} catch (
|
|
2427
|
-
console.error(
|
|
2603
|
+
const _ = await (await fetch(`${e.domain}/api/v1/webauthn/registration/list`, w)).json();
|
|
2604
|
+
K(_.registrations || []);
|
|
2605
|
+
} catch (C) {
|
|
2606
|
+
console.error(C), K([]);
|
|
2428
2607
|
}
|
|
2429
2608
|
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2609
|
+
function h(w, C) {
|
|
2610
|
+
H() || (W(!0), Ce(w, C).then((_) => {
|
|
2611
|
+
if (_)
|
|
2612
|
+
return fe().then((N) => {
|
|
2613
|
+
U(N.registrations), me(_.transactionID), z(!0);
|
|
2614
|
+
});
|
|
2615
|
+
}).finally(() => {
|
|
2616
|
+
W(!1);
|
|
2617
|
+
}));
|
|
2618
|
+
}
|
|
2619
|
+
function Ce(w, C) {
|
|
2620
|
+
let _ = le("post");
|
|
2621
|
+
return _.body = JSON.stringify({
|
|
2622
|
+
destination: w,
|
|
2623
|
+
OTPType: Te(C),
|
|
2441
2624
|
sectorID: e.sector
|
|
2442
|
-
})
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
if (L.status !== 200) {
|
|
2446
|
-
s(A.i18n("error-otp-verification"));
|
|
2625
|
+
}), fetch(`${e.domain}/api/v1/otp/begin`, _).then((N) => {
|
|
2626
|
+
if (N.status !== 200) {
|
|
2627
|
+
s(b.i18n("error-otp-verification"));
|
|
2447
2628
|
return;
|
|
2448
2629
|
}
|
|
2449
|
-
return
|
|
2450
|
-
}
|
|
2451
|
-
console.error(
|
|
2452
|
-
return;
|
|
2453
|
-
}
|
|
2454
|
-
}
|
|
2455
|
-
async function Se(E, v) {
|
|
2456
|
-
let P = Z("post");
|
|
2457
|
-
P.body = JSON.stringify({
|
|
2458
|
-
transactionID: E,
|
|
2459
|
-
password: v
|
|
2630
|
+
return N.json();
|
|
2631
|
+
}).catch((N) => {
|
|
2632
|
+
console.error(N), s(b.i18n("error-otp-registration"));
|
|
2460
2633
|
});
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2634
|
+
}
|
|
2635
|
+
function Ae(w, C) {
|
|
2636
|
+
if (H()) return;
|
|
2637
|
+
W(!0);
|
|
2638
|
+
let _ = le("post");
|
|
2639
|
+
_.body = JSON.stringify({
|
|
2640
|
+
transactionID: w,
|
|
2641
|
+
password: C
|
|
2642
|
+
}), fetch(`${e.domain}/api/v1/otp/finish`, _).then((N) => {
|
|
2643
|
+
if (N.status !== 200) {
|
|
2644
|
+
o(b.i18n("error-otp-verification"));
|
|
2465
2645
|
return;
|
|
2466
2646
|
}
|
|
2467
|
-
return
|
|
2468
|
-
|
|
2469
|
-
}),
|
|
2470
|
-
}
|
|
2471
|
-
console.error(
|
|
2472
|
-
|
|
2473
|
-
|
|
2647
|
+
return z(!1), k(""), ue(!1), oe(""), be(""), fe().then((R) => {
|
|
2648
|
+
U(R.registrations);
|
|
2649
|
+
}), N.json();
|
|
2650
|
+
}).catch((N) => {
|
|
2651
|
+
console.error(N), o(b.i18n("error-otp-registration"));
|
|
2652
|
+
}).finally(() => {
|
|
2653
|
+
W(!1);
|
|
2654
|
+
});
|
|
2474
2655
|
}
|
|
2475
|
-
async function
|
|
2476
|
-
let
|
|
2656
|
+
async function fe() {
|
|
2657
|
+
let w = le("get");
|
|
2477
2658
|
try {
|
|
2478
|
-
return await (await fetch(`${e.domain}/api/v1/otp/list`,
|
|
2479
|
-
} catch (
|
|
2480
|
-
console.error(
|
|
2659
|
+
return await (await fetch(`${e.domain}/api/v1/otp/list`, w)).json();
|
|
2660
|
+
} catch (C) {
|
|
2661
|
+
console.error(C), s(b.i18n("error-otp-list"));
|
|
2481
2662
|
return;
|
|
2482
2663
|
}
|
|
2483
2664
|
}
|
|
2484
|
-
async function
|
|
2485
|
-
let
|
|
2486
|
-
|
|
2487
|
-
ID:
|
|
2665
|
+
async function ye(w) {
|
|
2666
|
+
let C = le("delete");
|
|
2667
|
+
C.body = JSON.stringify({
|
|
2668
|
+
ID: w
|
|
2488
2669
|
});
|
|
2489
2670
|
try {
|
|
2490
|
-
if ((await fetch(`${e.domain}/api/v1/otp/${
|
|
2491
|
-
s(
|
|
2671
|
+
if ((await fetch(`${e.domain}/api/v1/otp/${w}`, C)).status !== 200) {
|
|
2672
|
+
s(b.i18n("error-otp-remove"));
|
|
2492
2673
|
return;
|
|
2493
2674
|
}
|
|
2494
|
-
|
|
2495
|
-
|
|
2675
|
+
fe().then((N) => {
|
|
2676
|
+
U(N.registrations);
|
|
2496
2677
|
});
|
|
2497
|
-
} catch (
|
|
2498
|
-
console.error(
|
|
2678
|
+
} catch (_) {
|
|
2679
|
+
console.error(_), s(b.i18n("error-otp-remove"));
|
|
2499
2680
|
return;
|
|
2500
2681
|
}
|
|
2501
2682
|
}
|
|
2502
|
-
function
|
|
2503
|
-
return
|
|
2683
|
+
function Te(w) {
|
|
2684
|
+
return w === "EMAIL" ? 2 : 1;
|
|
2504
2685
|
}
|
|
2505
2686
|
return (() => {
|
|
2506
|
-
var
|
|
2507
|
-
return
|
|
2508
|
-
var
|
|
2509
|
-
return
|
|
2510
|
-
})(), null),
|
|
2511
|
-
var
|
|
2512
|
-
return () =>
|
|
2513
|
-
var
|
|
2514
|
-
return
|
|
2515
|
-
var
|
|
2516
|
-
return
|
|
2517
|
-
confirm(
|
|
2518
|
-
},
|
|
2519
|
-
})()), null),
|
|
2520
|
-
var
|
|
2521
|
-
return () =>
|
|
2522
|
-
var
|
|
2523
|
-
return
|
|
2687
|
+
var w = ca(), C = w.firstChild, _ = C.nextSibling, N = _.nextSibling;
|
|
2688
|
+
return f(_, pe), f(N, () => b.i18n("sa-account-settings")), f(w, r && (() => {
|
|
2689
|
+
var R = bt();
|
|
2690
|
+
return f(R, r), R;
|
|
2691
|
+
})(), null), f(w, (() => {
|
|
2692
|
+
var R = p(() => !!(l() && ne().length));
|
|
2693
|
+
return () => R() && (() => {
|
|
2694
|
+
var P = da(), M = P.firstChild, L = M.nextSibling;
|
|
2695
|
+
return f(M, () => b.i18n("sa-webauthn-security-keys")), f(L, () => ne().map((T) => (() => {
|
|
2696
|
+
var X = fa(), J = X.firstChild, j = J.nextSibling;
|
|
2697
|
+
return f(J, () => T.keyName), j.$$click = () => {
|
|
2698
|
+
confirm(b.i18n("sa-confirm-delete-key")) && _e(T.keyName);
|
|
2699
|
+
}, f(j, () => b.i18n("sa-remove")), X;
|
|
2700
|
+
})()), null), f(L, (() => {
|
|
2701
|
+
var T = p(() => ne().length <= 0);
|
|
2702
|
+
return () => T() && (() => {
|
|
2703
|
+
var X = Ct();
|
|
2704
|
+
return f(X, () => b.i18n("sa-no-security-keys")), X;
|
|
2524
2705
|
})();
|
|
2525
|
-
})(), null),
|
|
2706
|
+
})(), null), P;
|
|
2526
2707
|
})();
|
|
2527
|
-
})(), null),
|
|
2528
|
-
var
|
|
2529
|
-
return () =>
|
|
2530
|
-
var
|
|
2531
|
-
return
|
|
2532
|
-
var
|
|
2533
|
-
return () =>
|
|
2534
|
-
var
|
|
2535
|
-
return
|
|
2708
|
+
})(), null), f(w, (() => {
|
|
2709
|
+
var R = p(() => !!l());
|
|
2710
|
+
return () => R() && (() => {
|
|
2711
|
+
var P = ha(), M = P.firstChild;
|
|
2712
|
+
return f(M, (() => {
|
|
2713
|
+
var L = p(() => !v());
|
|
2714
|
+
return () => L() && (() => {
|
|
2715
|
+
var T = Da();
|
|
2716
|
+
return T.firstChild, T.$$click = () => B(!0), f(T, () => b.i18n("sa-add-security-key"), null), T;
|
|
2536
2717
|
})();
|
|
2537
|
-
})(), null),
|
|
2538
|
-
var
|
|
2539
|
-
return () =>
|
|
2540
|
-
var
|
|
2541
|
-
return
|
|
2542
|
-
var
|
|
2543
|
-
return
|
|
2718
|
+
})(), null), f(M, (() => {
|
|
2719
|
+
var L = p(() => !!v());
|
|
2720
|
+
return () => L() && (() => {
|
|
2721
|
+
var T = pa(), X = T.firstChild, J = X.firstChild, j = J.nextSibling, G = j.nextSibling, re = G.nextSibling;
|
|
2722
|
+
return f(J, () => b.i18n("sa-webauthn-key-name")), j.$$input = (a) => n(a.currentTarget.value), G.$$click = () => B(!1), f(G, () => b.i18n("sa-cancel")), re.$$click = () => t() !== "" && Fe(), f(re, () => b.i18n("sa-register")), $((a) => {
|
|
2723
|
+
var i = b.i18n("sa-webauthn-key-name"), d = t() === "" || H();
|
|
2724
|
+
return i !== a.e && ce(j, "placeholder", a.e = i), d !== a.t && (re.disabled = a.t = d), a;
|
|
2544
2725
|
}, {
|
|
2545
2726
|
e: void 0,
|
|
2546
2727
|
t: void 0
|
|
2547
|
-
}),
|
|
2728
|
+
}), $(() => j.value = t()), T;
|
|
2548
2729
|
})();
|
|
2549
|
-
})(), null),
|
|
2730
|
+
})(), null), P;
|
|
2550
2731
|
})();
|
|
2551
|
-
})(), null),
|
|
2552
|
-
var
|
|
2553
|
-
return () =>
|
|
2554
|
-
var
|
|
2555
|
-
return
|
|
2556
|
-
var
|
|
2557
|
-
return d
|
|
2558
|
-
var
|
|
2559
|
-
return () =>
|
|
2560
|
-
var
|
|
2561
|
-
return
|
|
2732
|
+
})(), null), f(w, (() => {
|
|
2733
|
+
var R = p(() => Q().length > 0);
|
|
2734
|
+
return () => R() && (() => {
|
|
2735
|
+
var P = ga(), M = P.firstChild, L = M.nextSibling, T = L.firstChild, X = T.firstChild, J = X.firstChild, j = J.nextSibling, G = j.nextSibling, re = T.nextSibling;
|
|
2736
|
+
return f(M, () => b.i18n("sa-mfa")), f(J, () => b.i18n("sa-mfa-destination")), f(j, () => b.i18n("sa-mfa-validated")), f(G, () => b.i18n("sa-mfa-action")), f(re, () => Q().map((a) => (() => {
|
|
2737
|
+
var i = ma(), d = i.firstChild, y = d.nextSibling, A = y.nextSibling, q = A.firstChild;
|
|
2738
|
+
return f(d, () => a.DisplayName), f(y, (() => {
|
|
2739
|
+
var m = p(() => !!a.Validated);
|
|
2740
|
+
return () => m() ? (() => {
|
|
2741
|
+
var c = Ct();
|
|
2742
|
+
return f(c, () => b.i18n("sa-yes")), c;
|
|
2562
2743
|
})() : (() => {
|
|
2563
|
-
var
|
|
2564
|
-
return
|
|
2565
|
-
|
|
2566
|
-
},
|
|
2744
|
+
var c = ba(), g = c.firstChild, O = g.nextSibling;
|
|
2745
|
+
return f(c, () => b.i18n("sa-no"), g), O.$$click = () => {
|
|
2746
|
+
h(a.DisplayName, a.Type === "email" ? "EMAIL" : "SMS");
|
|
2747
|
+
}, f(O, () => b.i18n("sa-validate")), $(() => O.disabled = H()), c;
|
|
2567
2748
|
})();
|
|
2568
|
-
})()),
|
|
2569
|
-
confirm(
|
|
2570
|
-
},
|
|
2571
|
-
})())),
|
|
2749
|
+
})()), q.$$click = () => {
|
|
2750
|
+
confirm(b.i18n("sa-confirm-delete-key")) && ye(a.ID);
|
|
2751
|
+
}, f(q, () => b.i18n("sa-remove")), $(() => ce(d, "title", a.DisplayName)), i;
|
|
2752
|
+
})())), P;
|
|
2572
2753
|
})();
|
|
2573
|
-
})(), null),
|
|
2574
|
-
var
|
|
2575
|
-
return () =>
|
|
2576
|
-
var
|
|
2577
|
-
return
|
|
2754
|
+
})(), null), f(w, (() => {
|
|
2755
|
+
var R = p(() => !te());
|
|
2756
|
+
return () => R() && (() => {
|
|
2757
|
+
var P = Ca(), M = P.firstChild, L = M.firstChild;
|
|
2758
|
+
return L.firstChild, L.$$click = () => ue(!0), f(L, () => b.i18n("sa-register-mfa"), null), P;
|
|
2578
2759
|
})();
|
|
2579
|
-
})(), null),
|
|
2580
|
-
var
|
|
2581
|
-
return () =>
|
|
2582
|
-
var
|
|
2583
|
-
return
|
|
2584
|
-
var
|
|
2585
|
-
return
|
|
2760
|
+
})(), null), f(w, (() => {
|
|
2761
|
+
var R = p(() => !!te());
|
|
2762
|
+
return () => R() && (() => {
|
|
2763
|
+
var P = va(), M = P.firstChild, L = M.nextSibling, T = L.firstChild, X = T.firstChild, J = X.nextSibling, j = J.nextSibling, G = T.nextSibling, re = G.firstChild, a = re.nextSibling, i = a.nextSibling, d = G.nextSibling, y = d.firstChild;
|
|
2764
|
+
return f(M, () => b.i18n("sa-add-mfa")), f(X, () => b.i18n("sa-email")), J.$$input = (A) => be(A.currentTarget.value), j.$$click = () => h(Y(), "EMAIL"), f(j, () => b.i18n("sa-add-email")), f(re, () => b.i18n("sa-phone")), a.$$input = (A) => oe(A.currentTarget.value), i.$$click = () => h(ae(), "SMS"), f(i, () => b.i18n("sa-add-sms")), y.$$click = () => ue(!1), f(y, () => b.i18n("sa-cancel")), $((A) => {
|
|
2765
|
+
var q = b.i18n("sa-email"), m = H(), c = b.i18n("sa-phone"), g = H();
|
|
2766
|
+
return q !== A.e && ce(J, "placeholder", A.e = q), m !== A.t && (j.disabled = A.t = m), c !== A.a && ce(a, "placeholder", A.a = c), g !== A.o && (i.disabled = A.o = g), A;
|
|
2586
2767
|
}, {
|
|
2587
2768
|
e: void 0,
|
|
2588
|
-
t: void 0
|
|
2589
|
-
|
|
2769
|
+
t: void 0,
|
|
2770
|
+
a: void 0,
|
|
2771
|
+
o: void 0
|
|
2772
|
+
}), $(() => J.value = Y()), $(() => a.value = ae()), P;
|
|
2590
2773
|
})();
|
|
2591
|
-
})(), null),
|
|
2592
|
-
var
|
|
2593
|
-
return () =>
|
|
2594
|
-
var
|
|
2595
|
-
return
|
|
2596
|
-
var
|
|
2597
|
-
return () =>
|
|
2598
|
-
var
|
|
2599
|
-
return
|
|
2774
|
+
})(), null), f(w, (() => {
|
|
2775
|
+
var R = p(() => !!ge());
|
|
2776
|
+
return () => R() && (() => {
|
|
2777
|
+
var P = Aa(), M = P.firstChild, L = M.firstChild, T = L.nextSibling, X = T.nextSibling, J = X.nextSibling, j = J.nextSibling;
|
|
2778
|
+
return P.$$click = () => z(!1), M.$$click = (G) => G.stopPropagation(), L.$$click = () => z(!1), f(M, (() => {
|
|
2779
|
+
var G = p(() => !!u());
|
|
2780
|
+
return () => G() && (() => {
|
|
2781
|
+
var re = bt();
|
|
2782
|
+
return f(re, u), re;
|
|
2600
2783
|
})();
|
|
2601
|
-
})(),
|
|
2784
|
+
})(), X), J.$$input = (G) => k(G.currentTarget.value), j.$$click = () => Ae(he(), De()), $(() => j.disabled = H()), $(() => J.value = De()), P;
|
|
2602
2785
|
})();
|
|
2603
|
-
})(), null),
|
|
2786
|
+
})(), null), w;
|
|
2604
2787
|
})();
|
|
2605
2788
|
});
|
|
2606
|
-
|
|
2607
|
-
var
|
|
2789
|
+
rt(["click", "input"]);
|
|
2790
|
+
var Ea = /* @__PURE__ */ F(`<form class=invite-frame><style>.invite-frame {
|
|
2608
2791
|
display: flex;
|
|
2609
2792
|
flex-direction: column;
|
|
2610
2793
|
justify-content: center;
|
|
@@ -2664,8 +2847,8 @@ var va = /* @__PURE__ */ B(`<form class=invite-frame><style>.invite-frame {
|
|
|
2664
2847
|
margin-bottom: 10px;
|
|
2665
2848
|
display: block;
|
|
2666
2849
|
}
|
|
2667
|
-
</style><style></style><h1></h1><input type=text autocomplete=one-time-code required><span class=hint></span><input type=password autocomplete=new-password required minlength=8><span class=hint></span><button type=submit>`), Fa = /* @__PURE__ */
|
|
2668
|
-
const
|
|
2850
|
+
</style><style></style><h1></h1><input type=text autocomplete=one-time-code required><span class=hint></span><input type=password autocomplete=new-password required minlength=8><span class=hint></span><button type=submit>`), Fa = /* @__PURE__ */ F("<span class=info-message>"), ya = /* @__PURE__ */ F("<span class=error-message>"), $a = /* @__PURE__ */ F("<span class=success-message>");
|
|
2851
|
+
const Ba = {
|
|
2669
2852
|
domain: "http://127.0.0.1:11000",
|
|
2670
2853
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2671
2854
|
// defaults to the admin sector
|
|
@@ -2678,36 +2861,36 @@ const ya = {
|
|
|
2678
2861
|
redirect: ""
|
|
2679
2862
|
// where to redirect after successful completion
|
|
2680
2863
|
};
|
|
2681
|
-
|
|
2682
|
-
const [t,
|
|
2683
|
-
let
|
|
2864
|
+
st("spartan-invite", Ba, (e) => {
|
|
2865
|
+
const [t, n] = E(""), [r, s] = E(""), [u, o] = E(""), [l, v] = E(""), [B, D] = E(!1), x = ut(e.locale);
|
|
2866
|
+
let te, ue;
|
|
2684
2867
|
try {
|
|
2685
|
-
|
|
2868
|
+
ue = e.styles;
|
|
2686
2869
|
} catch {
|
|
2687
|
-
|
|
2870
|
+
ue = "";
|
|
2688
2871
|
}
|
|
2689
|
-
|
|
2690
|
-
e.sub || new URLSearchParams(window.location.search).get("sub") ||
|
|
2691
|
-
const
|
|
2692
|
-
|
|
2872
|
+
tt(async () => {
|
|
2873
|
+
e.sub || new URLSearchParams(window.location.search).get("sub") || o("Missing invitation information. Please use the link from your invite email.");
|
|
2874
|
+
const H = new URLSearchParams(window.location.hash.replace("#", "")).get("otp");
|
|
2875
|
+
H && n(H);
|
|
2693
2876
|
});
|
|
2694
|
-
async function
|
|
2695
|
-
var
|
|
2696
|
-
if (
|
|
2697
|
-
|
|
2877
|
+
async function ge(z) {
|
|
2878
|
+
var ne, K;
|
|
2879
|
+
if (z.preventDefault(), o(""), v(""), D(!0), !t() || t().trim().length === 0) {
|
|
2880
|
+
o("Please enter your verification code"), D(!1);
|
|
2698
2881
|
return;
|
|
2699
2882
|
}
|
|
2700
|
-
if (!
|
|
2701
|
-
|
|
2883
|
+
if (!r() || r().length < 8) {
|
|
2884
|
+
o("Password must be at least 8 characters"), D(!1);
|
|
2702
2885
|
return;
|
|
2703
2886
|
}
|
|
2704
|
-
const
|
|
2887
|
+
const H = new URLSearchParams(window.location.search), W = e.sub || H.get("sub") || "";
|
|
2705
2888
|
if (!W) {
|
|
2706
|
-
|
|
2889
|
+
o("Missing invitation information"), D(!1);
|
|
2707
2890
|
return;
|
|
2708
2891
|
}
|
|
2709
2892
|
try {
|
|
2710
|
-
const
|
|
2893
|
+
const Q = await fetch(`${e.domain}/api/v1/users/invite/complete`, {
|
|
2711
2894
|
method: "POST",
|
|
2712
2895
|
mode: "cors",
|
|
2713
2896
|
cache: "no-cache",
|
|
@@ -2717,14 +2900,14 @@ tt("spartan-invite", ya, (e) => {
|
|
|
2717
2900
|
body: JSON.stringify({
|
|
2718
2901
|
sub: W,
|
|
2719
2902
|
otp: t().toUpperCase().trim(),
|
|
2720
|
-
password:
|
|
2903
|
+
password: r(),
|
|
2721
2904
|
sectorID: e.sector
|
|
2722
2905
|
})
|
|
2723
2906
|
});
|
|
2724
|
-
if (
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2727
|
-
const
|
|
2907
|
+
if (Q.ok) {
|
|
2908
|
+
const U = await Q.json();
|
|
2909
|
+
v(x.i18n("sa-invite-success"));
|
|
2910
|
+
const he = new CustomEvent("spartan-invite-complete", {
|
|
2728
2911
|
bubbles: !0,
|
|
2729
2912
|
cancelable: !0,
|
|
2730
2913
|
detail: {
|
|
@@ -2732,50 +2915,50 @@ tt("spartan-invite", ya, (e) => {
|
|
|
2732
2915
|
success: !0
|
|
2733
2916
|
}
|
|
2734
2917
|
});
|
|
2735
|
-
|
|
2918
|
+
te && te.getRootNode().host.dispatchEvent(he), setTimeout(() => {
|
|
2736
2919
|
e.redirect && e.redirect !== "" && (window.location.href = e.redirect);
|
|
2737
2920
|
}, 2e3);
|
|
2738
2921
|
} else {
|
|
2739
|
-
const
|
|
2740
|
-
|
|
2922
|
+
const U = await Q.json().catch(() => ({}));
|
|
2923
|
+
Q.status === 400 || (ne = U.message) != null && ne.includes("invalid OTP") ? o(x.i18n("sa-invite-error-otp")) : Q.status === 504 || (K = U.message) != null && K.includes("expired") ? o(x.i18n("sa-invite-error-expired")) : o(U.message || x.i18n("sa-invite-error-generic")), D(!1);
|
|
2741
2924
|
}
|
|
2742
|
-
} catch (
|
|
2743
|
-
console.error("Error completing invite:",
|
|
2925
|
+
} catch (Q) {
|
|
2926
|
+
console.error("Error completing invite:", Q), o(x.i18n("sa-invite-error-generic")), D(!1);
|
|
2744
2927
|
}
|
|
2745
2928
|
}
|
|
2746
2929
|
return (() => {
|
|
2747
|
-
var
|
|
2748
|
-
return typeof De == "function" ?
|
|
2749
|
-
var
|
|
2750
|
-
return () =>
|
|
2751
|
-
var
|
|
2752
|
-
return
|
|
2930
|
+
var z = Ea(), H = z.firstChild, W = H.nextSibling, ne = W.nextSibling, K = ne.nextSibling, Q = K.nextSibling, U = Q.nextSibling, he = U.nextSibling, me = he.nextSibling, De = te;
|
|
2931
|
+
return typeof De == "function" ? Bt(De, z) : te = z, z.addEventListener("submit", ge), f(W, ue), f(ne, () => x.i18n("sa-complete-invite")), f(z, (() => {
|
|
2932
|
+
var k = p(() => !!e.email);
|
|
2933
|
+
return () => k() && (() => {
|
|
2934
|
+
var Y = Fa();
|
|
2935
|
+
return f(Y, () => e.email), Y;
|
|
2753
2936
|
})();
|
|
2754
|
-
})(),
|
|
2755
|
-
var
|
|
2756
|
-
return () =>
|
|
2757
|
-
var
|
|
2758
|
-
return
|
|
2937
|
+
})(), K), f(z, (() => {
|
|
2938
|
+
var k = p(() => !!u());
|
|
2939
|
+
return () => k() && (() => {
|
|
2940
|
+
var Y = ya();
|
|
2941
|
+
return f(Y, u), Y;
|
|
2759
2942
|
})();
|
|
2760
|
-
})(),
|
|
2761
|
-
var
|
|
2762
|
-
return () =>
|
|
2763
|
-
var
|
|
2764
|
-
return
|
|
2943
|
+
})(), K), f(z, (() => {
|
|
2944
|
+
var k = p(() => !!l());
|
|
2945
|
+
return () => k() && (() => {
|
|
2946
|
+
var Y = $a();
|
|
2947
|
+
return f(Y, l), Y;
|
|
2765
2948
|
})();
|
|
2766
|
-
})(),
|
|
2767
|
-
var
|
|
2768
|
-
return () =>
|
|
2769
|
-
})()),
|
|
2770
|
-
var
|
|
2771
|
-
return
|
|
2949
|
+
})(), K), K.$$input = (k) => n(k.currentTarget.value), f(Q, () => x.i18n("sa-invite-otp-hint")), U.$$input = (k) => s(k.currentTarget.value), f(he, () => x.i18n("sa-invite-password-hint")), f(me, (() => {
|
|
2950
|
+
var k = p(() => !!B());
|
|
2951
|
+
return () => k() ? x.i18n("sa-invite-completing") : x.i18n("sa-invite-submit");
|
|
2952
|
+
})()), $((k) => {
|
|
2953
|
+
var Y = x.i18n("sa-invite-otp"), be = B() || l() !== "", ae = x.i18n("sa-invite-password"), oe = B() || l() !== "", b = B() || l() !== "";
|
|
2954
|
+
return Y !== k.e && ce(K, "placeholder", k.e = Y), be !== k.t && (K.disabled = k.t = be), ae !== k.a && ce(U, "placeholder", k.a = ae), oe !== k.o && (U.disabled = k.o = oe), b !== k.i && (me.disabled = k.i = b), k;
|
|
2772
2955
|
}, {
|
|
2773
2956
|
e: void 0,
|
|
2774
2957
|
t: void 0,
|
|
2775
2958
|
a: void 0,
|
|
2776
2959
|
o: void 0,
|
|
2777
2960
|
i: void 0
|
|
2778
|
-
}),
|
|
2961
|
+
}), $(() => K.value = t()), $(() => U.value = r()), z;
|
|
2779
2962
|
})();
|
|
2780
2963
|
});
|
|
2781
|
-
|
|
2964
|
+
rt(["input"]);
|