@masonitestudios/spartanauth-widgets 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sa-widgets.mjs +1355 -1189
- package/dist/sa-widgets.umd.js +45 -4
- package/package.json +1 -1
package/dist/sa-widgets.mjs
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
const
|
|
2
|
-
equals:
|
|
1
|
+
const Lt = (e, t) => e === t, ze = {
|
|
2
|
+
equals: Lt
|
|
3
3
|
};
|
|
4
4
|
let gt = At;
|
|
5
|
-
const
|
|
5
|
+
const be = 1, Ne = 2, mt = {
|
|
6
6
|
owned: null,
|
|
7
7
|
cleanups: null,
|
|
8
8
|
context: null,
|
|
9
9
|
owner: null
|
|
10
10
|
};
|
|
11
|
-
var
|
|
12
|
-
let Ke = null,
|
|
11
|
+
var ee = null;
|
|
12
|
+
let Ke = null, qt = null, U = null, Y = null, pe = null, qe = 0;
|
|
13
13
|
function Ut(e, t) {
|
|
14
|
-
const
|
|
14
|
+
const r = U, n = ee, s = e.length === 0, u = t === void 0 ? n : t, i = s ? mt : {
|
|
15
15
|
owned: null,
|
|
16
16
|
cleanups: null,
|
|
17
|
-
context:
|
|
18
|
-
owner:
|
|
19
|
-
},
|
|
20
|
-
|
|
17
|
+
context: u ? u.context : null,
|
|
18
|
+
owner: u
|
|
19
|
+
}, a = s ? e : () => e(() => Ue(() => Oe(i)));
|
|
20
|
+
ee = i, U = null;
|
|
21
21
|
try {
|
|
22
|
-
return
|
|
22
|
+
return Pe(a, !0);
|
|
23
23
|
} finally {
|
|
24
|
-
|
|
24
|
+
U = r, ee = n;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
t = t ? Object.assign({},
|
|
29
|
-
const
|
|
27
|
+
function $(e, t) {
|
|
28
|
+
t = t ? Object.assign({}, ze, t) : ze;
|
|
29
|
+
const r = {
|
|
30
30
|
value: e,
|
|
31
31
|
observers: null,
|
|
32
32
|
observerSlots: null,
|
|
33
33
|
comparator: t.equals || void 0
|
|
34
|
-
},
|
|
35
|
-
return [bt.bind(
|
|
34
|
+
}, n = (s) => (typeof s == "function" && (s = s(r.value)), Ct(r, s));
|
|
35
|
+
return [bt.bind(r), n];
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
|
|
37
|
+
function O(e, t, r) {
|
|
38
|
+
const n = Qe(e, t, !1, be);
|
|
39
|
+
Te(n);
|
|
40
40
|
}
|
|
41
|
-
function Jt(e, t,
|
|
42
|
-
gt =
|
|
43
|
-
const
|
|
44
|
-
|
|
41
|
+
function Jt(e, t, r) {
|
|
42
|
+
gt = Vt;
|
|
43
|
+
const n = Qe(e, t, !1, be);
|
|
44
|
+
n.user = !0, pe ? pe.push(n) : Te(n);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
return
|
|
46
|
+
function C(e, t, r) {
|
|
47
|
+
r = r ? Object.assign({}, ze, r) : ze;
|
|
48
|
+
const n = Qe(e, t, !0, 0);
|
|
49
|
+
return n.observers = null, n.observerSlots = null, n.comparator = r.equals || void 0, Te(n), bt.bind(n);
|
|
50
50
|
}
|
|
51
51
|
function Ue(e) {
|
|
52
|
-
if (
|
|
53
|
-
const t =
|
|
54
|
-
|
|
52
|
+
if (U === null) return e();
|
|
53
|
+
const t = U;
|
|
54
|
+
U = null;
|
|
55
55
|
try {
|
|
56
56
|
return e();
|
|
57
57
|
} finally {
|
|
58
|
-
|
|
58
|
+
U = t;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function Xe(e) {
|
|
@@ -63,141 +63,141 @@ function Xe(e) {
|
|
|
63
63
|
}
|
|
64
64
|
function bt() {
|
|
65
65
|
if (this.sources && this.state)
|
|
66
|
-
if (this.state ===
|
|
66
|
+
if (this.state === be) Te(this);
|
|
67
67
|
else {
|
|
68
|
-
const e =
|
|
69
|
-
|
|
68
|
+
const e = Y;
|
|
69
|
+
Y = null, Pe(() => je(this), !1), Y = e;
|
|
70
70
|
}
|
|
71
|
-
if (
|
|
71
|
+
if (U) {
|
|
72
72
|
const e = this.observers ? this.observers.length : 0;
|
|
73
|
-
|
|
73
|
+
U.sources ? (U.sources.push(this), U.sourceSlots.push(e)) : (U.sources = [this], U.sourceSlots = [e]), this.observers ? (this.observers.push(U), this.observerSlots.push(U.sources.length - 1)) : (this.observers = [U], this.observerSlots = [U.sources.length - 1]);
|
|
74
74
|
}
|
|
75
75
|
return this.value;
|
|
76
76
|
}
|
|
77
|
-
function Ct(e, t,
|
|
78
|
-
let
|
|
79
|
-
return (!e.comparator || !e.comparator(
|
|
80
|
-
for (let
|
|
81
|
-
const
|
|
82
|
-
|
|
77
|
+
function Ct(e, t, r) {
|
|
78
|
+
let n = e.value;
|
|
79
|
+
return (!e.comparator || !e.comparator(n, t)) && (e.value = t, e.observers && e.observers.length && Pe(() => {
|
|
80
|
+
for (let s = 0; s < e.observers.length; s += 1) {
|
|
81
|
+
const u = e.observers[s], i = Ke && Ke.running;
|
|
82
|
+
i && Ke.disposed.has(u), (i ? !u.tState : !u.state) && (u.pure ? Y.push(u) : pe.push(u), u.observers && vt(u)), i || (u.state = be);
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
85
|
-
throw
|
|
84
|
+
if (Y.length > 1e6)
|
|
85
|
+
throw Y = [], new Error();
|
|
86
86
|
}, !1)), t;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Te(e) {
|
|
89
89
|
if (!e.fn) return;
|
|
90
|
-
|
|
91
|
-
const t =
|
|
90
|
+
Oe(e);
|
|
91
|
+
const t = qe;
|
|
92
92
|
Kt(
|
|
93
93
|
e,
|
|
94
94
|
e.value,
|
|
95
95
|
t
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
|
-
function Kt(e, t,
|
|
99
|
-
let
|
|
100
|
-
const
|
|
101
|
-
|
|
98
|
+
function Kt(e, t, r) {
|
|
99
|
+
let n;
|
|
100
|
+
const s = ee, u = U;
|
|
101
|
+
U = ee = e;
|
|
102
102
|
try {
|
|
103
|
-
|
|
104
|
-
} catch (
|
|
105
|
-
return e.pure && (e.state =
|
|
103
|
+
n = e.fn(t);
|
|
104
|
+
} catch (i) {
|
|
105
|
+
return e.pure && (e.state = be, e.owned && e.owned.forEach(Oe), e.owned = null), e.updatedAt = r + 1, Ft(i);
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
U = u, ee = s;
|
|
108
108
|
}
|
|
109
|
-
(!e.updatedAt || e.updatedAt <=
|
|
109
|
+
(!e.updatedAt || e.updatedAt <= r) && (e.updatedAt != null && "observers" in e ? Ct(e, n) : e.value = n, e.updatedAt = r);
|
|
110
110
|
}
|
|
111
|
-
function Qe(e, t,
|
|
112
|
-
const
|
|
111
|
+
function Qe(e, t, r, n = be, s) {
|
|
112
|
+
const u = {
|
|
113
113
|
fn: e,
|
|
114
|
-
state:
|
|
114
|
+
state: n,
|
|
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: ee,
|
|
122
|
+
context: ee ? ee.context : null,
|
|
123
|
+
pure: r
|
|
124
124
|
};
|
|
125
|
-
return
|
|
125
|
+
return ee === null || ee !== mt && (ee.owned ? ee.owned.push(u) : ee.owned = [u]), u;
|
|
126
126
|
}
|
|
127
127
|
function Me(e) {
|
|
128
128
|
if (e.state === 0) return;
|
|
129
|
-
if (e.state ===
|
|
129
|
+
if (e.state === Ne) return je(e);
|
|
130
130
|
if (e.suspense && Ue(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 < qe); )
|
|
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 r = t.length - 1; r >= 0; r--)
|
|
135
|
+
if (e = t[r], e.state === be)
|
|
136
|
+
Te(e);
|
|
137
|
+
else if (e.state === Ne) {
|
|
138
|
+
const n = Y;
|
|
139
|
+
Y = null, Pe(() => je(e, t[0]), !1), Y = n;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
if (
|
|
144
|
-
let
|
|
145
|
-
t || (
|
|
142
|
+
function Pe(e, t) {
|
|
143
|
+
if (Y) return e();
|
|
144
|
+
let r = !1;
|
|
145
|
+
t || (Y = []), pe ? r = !0 : pe = [], qe++;
|
|
146
146
|
try {
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
} catch (
|
|
150
|
-
|
|
147
|
+
const n = e();
|
|
148
|
+
return Gt(r), n;
|
|
149
|
+
} catch (n) {
|
|
150
|
+
r || (pe = null), Y = null, Ft(n);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
155
|
-
const t =
|
|
156
|
-
|
|
153
|
+
function Gt(e) {
|
|
154
|
+
if (Y && (At(Y), Y = null), e) return;
|
|
155
|
+
const t = pe;
|
|
156
|
+
pe = null, t.length && Pe(() => gt(t), !1);
|
|
157
157
|
}
|
|
158
158
|
function At(e) {
|
|
159
159
|
for (let t = 0; t < e.length; t++) Me(e[t]);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
let t,
|
|
161
|
+
function Vt(e) {
|
|
162
|
+
let t, r = 0;
|
|
163
163
|
for (t = 0; t < e.length; t++) {
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const n = e[t];
|
|
165
|
+
n.user ? e[r++] = n : Me(n);
|
|
166
166
|
}
|
|
167
|
-
for (t = 0; t <
|
|
167
|
+
for (t = 0; t < r; t++) Me(e[t]);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function je(e, t) {
|
|
170
170
|
e.state = 0;
|
|
171
|
-
for (let
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
|
|
171
|
+
for (let r = 0; r < e.sources.length; r += 1) {
|
|
172
|
+
const n = e.sources[r];
|
|
173
|
+
if (n.sources) {
|
|
174
|
+
const s = n.state;
|
|
175
|
+
s === be ? n !== t && (!n.updatedAt || n.updatedAt < qe) && Me(n) : s === Ne && je(n, t);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function vt(e) {
|
|
180
180
|
for (let t = 0; t < e.observers.length; t += 1) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const r = e.observers[t];
|
|
182
|
+
r.state || (r.state = Ne, r.pure ? Y.push(r) : pe.push(r), r.observers && vt(r));
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Oe(e) {
|
|
186
186
|
let t;
|
|
187
187
|
if (e.sources)
|
|
188
188
|
for (; e.sources.length; ) {
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
191
|
-
const
|
|
192
|
-
|
|
189
|
+
const r = e.sources.pop(), n = e.sourceSlots.pop(), s = r.observers;
|
|
190
|
+
if (s && s.length) {
|
|
191
|
+
const u = s.pop(), i = r.observerSlots.pop();
|
|
192
|
+
n < s.length && (u.sourceSlots[i] = n, s[n] = u, r.observerSlots[n] = i);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
if (e.tOwned) {
|
|
196
|
-
for (t = e.tOwned.length - 1; t >= 0; t--)
|
|
196
|
+
for (t = e.tOwned.length - 1; t >= 0; t--) Oe(e.tOwned[t]);
|
|
197
197
|
delete e.tOwned;
|
|
198
198
|
}
|
|
199
199
|
if (e.owned) {
|
|
200
|
-
for (t = e.owned.length - 1; t >= 0; t--)
|
|
200
|
+
for (t = e.owned.length - 1; t >= 0; t--) Oe(e.owned[t]);
|
|
201
201
|
e.owned = null;
|
|
202
202
|
}
|
|
203
203
|
if (e.cleanups) {
|
|
@@ -206,93 +206,93 @@ function Te(e) {
|
|
|
206
206
|
}
|
|
207
207
|
e.state = 0;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Ht(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 Ft(e, t = ee) {
|
|
215
|
+
throw Ht(e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
let
|
|
219
|
-
for (;
|
|
220
|
-
if (t[
|
|
221
|
-
|
|
217
|
+
function Wt(e, t, r) {
|
|
218
|
+
let n = r.length, s = t.length, u = n, i = 0, a = 0, F = t[s - 1].nextSibling, k = null;
|
|
219
|
+
for (; i < s || a < u; ) {
|
|
220
|
+
if (t[i] === r[a]) {
|
|
221
|
+
i++, a++;
|
|
222
222
|
continue;
|
|
223
223
|
}
|
|
224
|
-
for (; t[
|
|
225
|
-
|
|
226
|
-
if (
|
|
227
|
-
const p =
|
|
228
|
-
for (;
|
|
229
|
-
} else if (
|
|
230
|
-
for (;
|
|
231
|
-
(!
|
|
232
|
-
else if (t[
|
|
233
|
-
const p = t[--
|
|
234
|
-
e.insertBefore(
|
|
224
|
+
for (; t[s - 1] === r[u - 1]; )
|
|
225
|
+
s--, u--;
|
|
226
|
+
if (s === i) {
|
|
227
|
+
const p = u < n ? a ? r[a - 1].nextSibling : r[u - a] : F;
|
|
228
|
+
for (; a < u; ) e.insertBefore(r[a++], p);
|
|
229
|
+
} else if (u === a)
|
|
230
|
+
for (; i < s; )
|
|
231
|
+
(!k || !k.has(t[i])) && t[i].remove(), i++;
|
|
232
|
+
else if (t[i] === r[u - 1] && r[a] === t[s - 1]) {
|
|
233
|
+
const p = t[--s].nextSibling;
|
|
234
|
+
e.insertBefore(r[a++], t[i++].nextSibling), e.insertBefore(r[--u], p), t[s] = r[u];
|
|
235
235
|
} else {
|
|
236
|
-
if (!
|
|
237
|
-
|
|
238
|
-
let S =
|
|
239
|
-
for (; S <
|
|
236
|
+
if (!k) {
|
|
237
|
+
k = /* @__PURE__ */ new Map();
|
|
238
|
+
let S = a;
|
|
239
|
+
for (; S < u; ) k.set(r[S], S++);
|
|
240
240
|
}
|
|
241
|
-
const p =
|
|
241
|
+
const p = k.get(t[i]);
|
|
242
242
|
if (p != null)
|
|
243
|
-
if (
|
|
244
|
-
let S =
|
|
245
|
-
for (; ++S <
|
|
246
|
-
|
|
247
|
-
if (
|
|
248
|
-
const
|
|
249
|
-
for (;
|
|
250
|
-
} else e.replaceChild(
|
|
251
|
-
} else
|
|
252
|
-
else t[
|
|
243
|
+
if (a < p && p < u) {
|
|
244
|
+
let S = i, X = 1, te;
|
|
245
|
+
for (; ++S < s && S < u && !((te = k.get(t[S])) == null || te !== p + X); )
|
|
246
|
+
X++;
|
|
247
|
+
if (X > p - a) {
|
|
248
|
+
const he = t[i];
|
|
249
|
+
for (; a < p; ) e.insertBefore(r[a++], he);
|
|
250
|
+
} else e.replaceChild(r[a++], t[i++]);
|
|
251
|
+
} else i++;
|
|
252
|
+
else t[i++].remove();
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
258
|
-
let
|
|
259
|
-
const
|
|
260
|
-
const
|
|
261
|
-
return
|
|
262
|
-
},
|
|
263
|
-
return
|
|
256
|
+
const it = "_$DX_DELEGATE";
|
|
257
|
+
function B(e, t, r, n) {
|
|
258
|
+
let s;
|
|
259
|
+
const u = () => {
|
|
260
|
+
const a = document.createElement("template");
|
|
261
|
+
return a.innerHTML = e, a.content.firstChild;
|
|
262
|
+
}, i = () => (s || (s = u())).cloneNode(!0);
|
|
263
|
+
return i.cloneNode = i, i;
|
|
264
264
|
}
|
|
265
265
|
function et(e, t = window.document) {
|
|
266
|
-
const
|
|
267
|
-
for (let
|
|
268
|
-
const
|
|
269
|
-
|
|
266
|
+
const r = t[it] || (t[it] = /* @__PURE__ */ new Set());
|
|
267
|
+
for (let n = 0, s = e.length; n < s; n++) {
|
|
268
|
+
const u = e[n];
|
|
269
|
+
r.has(u) || (r.add(u), t.addEventListener(u, Zt));
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
|
|
272
|
+
function oe(e, t, r) {
|
|
273
|
+
r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
return Ue(() => e(t,
|
|
275
|
+
function Et(e, t, r) {
|
|
276
|
+
return Ue(() => e(t, r));
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
if (
|
|
280
|
-
|
|
278
|
+
function d(e, t, r, n) {
|
|
279
|
+
if (r !== void 0 && !n && (n = []), typeof t != "function") return Re(e, t, n, r);
|
|
280
|
+
O((s) => Re(e, t(), s, r), n);
|
|
281
281
|
}
|
|
282
282
|
function Zt(e) {
|
|
283
283
|
let t = e.target;
|
|
284
|
-
const
|
|
284
|
+
const r = `$$${e.type}`, n = e.target, s = e.currentTarget, u = (F) => Object.defineProperty(e, "target", {
|
|
285
285
|
configurable: !0,
|
|
286
|
-
value:
|
|
287
|
-
}),
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
286
|
+
value: F
|
|
287
|
+
}), i = () => {
|
|
288
|
+
const F = t[r];
|
|
289
|
+
if (F && !t.disabled) {
|
|
290
|
+
const k = t[`${r}Data`];
|
|
291
|
+
if (k !== void 0 ? F.call(t, k, e) : F.call(t, e), e.cancelBubble) return;
|
|
292
292
|
}
|
|
293
|
-
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) &&
|
|
294
|
-
},
|
|
295
|
-
for (;
|
|
293
|
+
return t.host && typeof t.host != "string" && !t.host._$host && t.contains(e.target) && u(t.host), !0;
|
|
294
|
+
}, a = () => {
|
|
295
|
+
for (; i() && (t = t._$host || t.parentNode || t.host); ) ;
|
|
296
296
|
};
|
|
297
297
|
if (Object.defineProperty(e, "currentTarget", {
|
|
298
298
|
configurable: !0,
|
|
@@ -300,136 +300,136 @@ function Zt(e) {
|
|
|
300
300
|
return t || document;
|
|
301
301
|
}
|
|
302
302
|
}), e.composedPath) {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
for (let
|
|
303
|
+
const F = e.composedPath();
|
|
304
|
+
u(F[0]);
|
|
305
|
+
for (let k = 0; k < F.length - 2 && (t = F[k], !!i()); k++) {
|
|
306
306
|
if (t._$host) {
|
|
307
|
-
t = t._$host,
|
|
307
|
+
t = t._$host, a();
|
|
308
308
|
break;
|
|
309
309
|
}
|
|
310
|
-
if (t.parentNode ===
|
|
310
|
+
if (t.parentNode === s)
|
|
311
311
|
break;
|
|
312
312
|
}
|
|
313
|
-
} else
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
function
|
|
317
|
-
for (; typeof
|
|
318
|
-
if (t ===
|
|
319
|
-
const
|
|
320
|
-
if (e =
|
|
321
|
-
if (
|
|
322
|
-
return
|
|
323
|
-
if (
|
|
324
|
-
let
|
|
325
|
-
|
|
313
|
+
} else a();
|
|
314
|
+
u(n);
|
|
315
|
+
}
|
|
316
|
+
function Re(e, t, r, n, s) {
|
|
317
|
+
for (; typeof r == "function"; ) r = r();
|
|
318
|
+
if (t === r) return r;
|
|
319
|
+
const u = typeof t, i = n !== void 0;
|
|
320
|
+
if (e = i && r[0] && r[0].parentNode || e, u === "string" || u === "number") {
|
|
321
|
+
if (u === "number" && (t = t.toString(), t === r))
|
|
322
|
+
return r;
|
|
323
|
+
if (i) {
|
|
324
|
+
let a = r[0];
|
|
325
|
+
a && a.nodeType === 3 ? a.data !== t && (a.data = t) : a = document.createTextNode(t), r = Be(e, r, n, a);
|
|
326
326
|
} else
|
|
327
|
-
|
|
328
|
-
} else if (t == null ||
|
|
329
|
-
|
|
327
|
+
r !== "" && typeof r == "string" ? r = e.firstChild.data = t : r = e.textContent = t;
|
|
328
|
+
} else if (t == null || u === "boolean")
|
|
329
|
+
r = Be(e, r, n);
|
|
330
330
|
else {
|
|
331
|
-
if (
|
|
332
|
-
return
|
|
333
|
-
let
|
|
334
|
-
for (; typeof
|
|
335
|
-
|
|
336
|
-
}), () =>
|
|
331
|
+
if (u === "function")
|
|
332
|
+
return O(() => {
|
|
333
|
+
let a = t();
|
|
334
|
+
for (; typeof a == "function"; ) a = a();
|
|
335
|
+
r = Re(e, a, r, n);
|
|
336
|
+
}), () => r;
|
|
337
337
|
if (Array.isArray(t)) {
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
return
|
|
341
|
-
if (
|
|
342
|
-
if (
|
|
343
|
-
} else
|
|
344
|
-
|
|
338
|
+
const a = [], F = r && Array.isArray(r);
|
|
339
|
+
if (We(a, t, r, s))
|
|
340
|
+
return O(() => r = Re(e, a, r, n, !0)), () => r;
|
|
341
|
+
if (a.length === 0) {
|
|
342
|
+
if (r = Be(e, r, n), i) return r;
|
|
343
|
+
} else F ? r.length === 0 ? at(e, a, n) : Wt(e, r, a) : (r && Be(e), at(e, a));
|
|
344
|
+
r = a;
|
|
345
345
|
} else if (t.nodeType) {
|
|
346
|
-
if (Array.isArray(
|
|
347
|
-
if (
|
|
348
|
-
|
|
349
|
-
} else
|
|
350
|
-
|
|
346
|
+
if (Array.isArray(r)) {
|
|
347
|
+
if (i) return r = Be(e, r, n, t);
|
|
348
|
+
Be(e, r, null, t);
|
|
349
|
+
} else r == null || r === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
|
|
350
|
+
r = t;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
return
|
|
354
|
-
}
|
|
355
|
-
function
|
|
356
|
-
let
|
|
357
|
-
for (let
|
|
358
|
-
let
|
|
359
|
-
if (!(
|
|
360
|
-
e.push(
|
|
361
|
-
else if (Array.isArray(
|
|
362
|
-
|
|
363
|
-
else if (
|
|
364
|
-
if (
|
|
365
|
-
for (; typeof
|
|
366
|
-
|
|
353
|
+
return r;
|
|
354
|
+
}
|
|
355
|
+
function We(e, t, r, n) {
|
|
356
|
+
let s = !1;
|
|
357
|
+
for (let u = 0, i = t.length; u < i; u++) {
|
|
358
|
+
let a = t[u], F = r && r[e.length], k;
|
|
359
|
+
if (!(a == null || a === !0 || a === !1)) if ((k = typeof a) == "object" && a.nodeType)
|
|
360
|
+
e.push(a);
|
|
361
|
+
else if (Array.isArray(a))
|
|
362
|
+
s = We(e, a, F) || s;
|
|
363
|
+
else if (k === "function")
|
|
364
|
+
if (n) {
|
|
365
|
+
for (; typeof a == "function"; ) a = a();
|
|
366
|
+
s = We(
|
|
367
367
|
e,
|
|
368
|
-
Array.isArray(
|
|
369
|
-
Array.isArray(
|
|
370
|
-
) ||
|
|
368
|
+
Array.isArray(a) ? a : [a],
|
|
369
|
+
Array.isArray(F) ? F : [F]
|
|
370
|
+
) || s;
|
|
371
371
|
} else
|
|
372
|
-
e.push(
|
|
372
|
+
e.push(a), s = !0;
|
|
373
373
|
else {
|
|
374
|
-
const p = String(
|
|
375
|
-
|
|
374
|
+
const p = String(a);
|
|
375
|
+
F && F.nodeType === 3 && F.data === p ? e.push(F) : e.push(document.createTextNode(p));
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
return
|
|
378
|
+
return s;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
for (let
|
|
380
|
+
function at(e, t, r = null) {
|
|
381
|
+
for (let n = 0, s = t.length; n < s; n++) e.insertBefore(t[n], r);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
if (
|
|
385
|
-
const
|
|
383
|
+
function Be(e, t, r, n) {
|
|
384
|
+
if (r === void 0) return e.textContent = "";
|
|
385
|
+
const s = n || document.createTextNode("");
|
|
386
386
|
if (t.length) {
|
|
387
|
-
let
|
|
388
|
-
for (let
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
const
|
|
392
|
-
!
|
|
393
|
-
} else
|
|
387
|
+
let u = !1;
|
|
388
|
+
for (let i = t.length - 1; i >= 0; i--) {
|
|
389
|
+
const a = t[i];
|
|
390
|
+
if (s !== a) {
|
|
391
|
+
const F = a.parentNode === e;
|
|
392
|
+
!u && !i ? F ? e.replaceChild(s, a) : e.insertBefore(s, r) : F && a.remove();
|
|
393
|
+
} else u = !0;
|
|
394
394
|
}
|
|
395
|
-
} else e.insertBefore(
|
|
396
|
-
return [
|
|
395
|
+
} else e.insertBefore(s, r);
|
|
396
|
+
return [s];
|
|
397
397
|
}
|
|
398
398
|
function Yt(e) {
|
|
399
|
-
return Object.keys(e).reduce((
|
|
400
|
-
const
|
|
401
|
-
return n
|
|
399
|
+
return Object.keys(e).reduce((r, n) => {
|
|
400
|
+
const s = e[n];
|
|
401
|
+
return r[n] = Object.assign({}, s), yt(s.value) && !rr(s.value) && !Array.isArray(s.value) && (r[n].value = Object.assign({}, s.value)), Array.isArray(s.value) && (r[n].value = s.value.slice(0)), r;
|
|
402
402
|
}, {});
|
|
403
403
|
}
|
|
404
404
|
function Xt(e) {
|
|
405
|
-
return e ? Object.keys(e).reduce((
|
|
406
|
-
const
|
|
407
|
-
return n
|
|
408
|
-
value:
|
|
409
|
-
}, n
|
|
405
|
+
return e ? Object.keys(e).reduce((r, n) => {
|
|
406
|
+
const s = e[n];
|
|
407
|
+
return r[n] = yt(s) && "value" in s ? s : {
|
|
408
|
+
value: s
|
|
409
|
+
}, r[n].attribute || (r[n].attribute = tr(n)), r[n].parse = "parse" in r[n] ? r[n].parse : typeof r[n].value != "string", r;
|
|
410
410
|
}, {}) : {};
|
|
411
411
|
}
|
|
412
412
|
function Qt(e) {
|
|
413
|
-
return Object.keys(e).reduce((
|
|
413
|
+
return Object.keys(e).reduce((r, n) => (r[n] = e[n].value, r), {});
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
const
|
|
417
|
-
return Object.keys(t).forEach((
|
|
418
|
-
const
|
|
419
|
-
|
|
415
|
+
function er(e, t) {
|
|
416
|
+
const r = Yt(t);
|
|
417
|
+
return Object.keys(t).forEach((s) => {
|
|
418
|
+
const u = r[s], i = e.getAttribute(u.attribute), a = e[s];
|
|
419
|
+
i != null && (u.value = u.parse ? wt(i) : i), a != null && (u.value = Array.isArray(a) ? a.slice(0) : a), u.reflect && ot(e, u.attribute, u.value, !!u.parse), Object.defineProperty(e, s, {
|
|
420
420
|
get() {
|
|
421
|
-
return
|
|
421
|
+
return u.value;
|
|
422
422
|
},
|
|
423
|
-
set(
|
|
424
|
-
const
|
|
425
|
-
|
|
423
|
+
set(F) {
|
|
424
|
+
const k = u.value;
|
|
425
|
+
u.value = F, u.reflect && ot(this, u.attribute, u.value, !!u.parse);
|
|
426
426
|
for (let p = 0, S = this.__propertyChangedCallbacks.length; p < S; p++)
|
|
427
|
-
this.__propertyChangedCallbacks[p](
|
|
427
|
+
this.__propertyChangedCallbacks[p](s, F, k);
|
|
428
428
|
},
|
|
429
429
|
enumerable: !0,
|
|
430
430
|
configurable: !0
|
|
431
431
|
});
|
|
432
|
-
}),
|
|
432
|
+
}), r;
|
|
433
433
|
}
|
|
434
434
|
function wt(e) {
|
|
435
435
|
if (e)
|
|
@@ -439,163 +439,163 @@ function wt(e) {
|
|
|
439
439
|
return e;
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
function ot(e, t,
|
|
443
|
-
if (
|
|
444
|
-
let
|
|
445
|
-
e.__updating[t] = !0,
|
|
442
|
+
function ot(e, t, r, n) {
|
|
443
|
+
if (r == null || r === !1) return e.removeAttribute(t);
|
|
444
|
+
let s = n ? JSON.stringify(r) : r;
|
|
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 tr(e) {
|
|
448
|
+
return e.replace(/\.?([A-Z]+)/g, (t, r) => "-" + r.toLowerCase()).replace("_", "-").replace(/^-/, "");
|
|
449
449
|
}
|
|
450
450
|
function yt(e) {
|
|
451
451
|
return e != null && (typeof e == "object" || typeof e == "function");
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function rr(e) {
|
|
454
454
|
return Object.prototype.toString.call(e) === "[object Function]";
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function nr(e) {
|
|
457
457
|
return typeof e == "function" && e.toString().indexOf("class") === 0;
|
|
458
458
|
}
|
|
459
|
-
let
|
|
460
|
-
function
|
|
461
|
-
const
|
|
459
|
+
let Ge;
|
|
460
|
+
function sr(e, t) {
|
|
461
|
+
const r = Object.keys(t);
|
|
462
462
|
return class extends e {
|
|
463
463
|
static get observedAttributes() {
|
|
464
|
-
return
|
|
464
|
+
return r.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
|
|
471
|
+
this.__releaseCallbacks = [], this.__propertyChangedCallbacks = [], this.__updating = {}, this.props = er(this, t);
|
|
472
|
+
const s = Qt(this.props), u = this.Component, i = Ge;
|
|
473
473
|
try {
|
|
474
|
-
|
|
474
|
+
Ge = this, this.__initialized = !0, nr(u) ? new u(s, {
|
|
475
475
|
element: this
|
|
476
|
-
}) : s
|
|
476
|
+
}) : u(s, {
|
|
477
477
|
element: this
|
|
478
478
|
});
|
|
479
479
|
} finally {
|
|
480
|
-
|
|
480
|
+
Ge = i;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
async disconnectedCallback() {
|
|
484
484
|
if (await Promise.resolve(), this.isConnected) return;
|
|
485
485
|
this.__propertyChangedCallbacks.length = 0;
|
|
486
|
-
let
|
|
487
|
-
for (;
|
|
486
|
+
let s = null;
|
|
487
|
+
for (; s = this.__releaseCallbacks.pop(); ) s(this);
|
|
488
488
|
delete this.__initialized, this.__released = !0;
|
|
489
489
|
}
|
|
490
|
-
attributeChangedCallback(
|
|
491
|
-
if (this.__initialized && !this.__updating[
|
|
492
|
-
if (
|
|
493
|
-
this[
|
|
490
|
+
attributeChangedCallback(s, u, i) {
|
|
491
|
+
if (this.__initialized && !this.__updating[s] && (s = this.lookupProp(s), s in t)) {
|
|
492
|
+
if (i == null && !this[s]) return;
|
|
493
|
+
this[s] = t[s].parse ? wt(i) : i;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
lookupProp(
|
|
496
|
+
lookupProp(s) {
|
|
497
497
|
if (t)
|
|
498
|
-
return
|
|
498
|
+
return r.find((u) => s === u || s === t[u].attribute);
|
|
499
499
|
}
|
|
500
500
|
get renderRoot() {
|
|
501
501
|
return this.shadowRoot || this.attachShadow({
|
|
502
502
|
mode: "open"
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
|
-
addReleaseCallback(
|
|
506
|
-
this.__releaseCallbacks.push(
|
|
505
|
+
addReleaseCallback(s) {
|
|
506
|
+
this.__releaseCallbacks.push(s);
|
|
507
507
|
}
|
|
508
|
-
addPropertyChangedCallback(
|
|
509
|
-
this.__propertyChangedCallbacks.push(
|
|
508
|
+
addPropertyChangedCallback(s) {
|
|
509
|
+
this.__propertyChangedCallbacks.push(s);
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function ur(e, t = {}, r = {}) {
|
|
514
514
|
const {
|
|
515
|
-
BaseElement:
|
|
516
|
-
extension:
|
|
517
|
-
customElements:
|
|
518
|
-
} =
|
|
519
|
-
return (
|
|
515
|
+
BaseElement: n = HTMLElement,
|
|
516
|
+
extension: s,
|
|
517
|
+
customElements: u = window.customElements
|
|
518
|
+
} = r;
|
|
519
|
+
return (i) => {
|
|
520
520
|
if (!e) throw new Error("tag is required to register a Component");
|
|
521
|
-
let
|
|
522
|
-
return
|
|
521
|
+
let a = u.get(e);
|
|
522
|
+
return a ? (a.prototype.Component = i, a) : (a = sr(n, Xt(t)), a.prototype.Component = i, a.prototype.registeredTag = e, u.define(e, a, s), a);
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
const t = Object.keys(e),
|
|
527
|
-
for (let
|
|
528
|
-
const [
|
|
529
|
-
Object.defineProperty(
|
|
530
|
-
get:
|
|
531
|
-
set(
|
|
532
|
-
|
|
525
|
+
function ir(e) {
|
|
526
|
+
const t = Object.keys(e), r = {};
|
|
527
|
+
for (let n = 0; n < t.length; n++) {
|
|
528
|
+
const [s, u] = $(e[t[n]]);
|
|
529
|
+
Object.defineProperty(r, t[n], {
|
|
530
|
+
get: s,
|
|
531
|
+
set(i) {
|
|
532
|
+
u(() => i);
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
|
-
return
|
|
536
|
+
return r;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function ar(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 Ut((
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
545
|
+
function or(e) {
|
|
546
|
+
return (t, r) => {
|
|
547
|
+
const { element: n } = r;
|
|
548
|
+
return Ut((s) => {
|
|
549
|
+
const u = ir(t);
|
|
550
|
+
n.addPropertyChangedCallback((a, F) => u[a] = F), n.addReleaseCallback(() => {
|
|
551
|
+
n.renderRoot.textContent = "", s();
|
|
552
552
|
});
|
|
553
|
-
const
|
|
554
|
-
return
|
|
555
|
-
},
|
|
553
|
+
const i = e(u, r);
|
|
554
|
+
return d(n.renderRoot, i);
|
|
555
|
+
}, ar(n));
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function tt(e, t,
|
|
559
|
-
return arguments.length === 2 && (
|
|
558
|
+
function tt(e, t, r) {
|
|
559
|
+
return arguments.length === 2 && (r = t, t = {}), ur(e, t)(or(r));
|
|
560
560
|
}
|
|
561
|
-
var
|
|
562
|
-
let
|
|
561
|
+
var lr = "٠١٢٣٤٥٦٧٨٩", cr = "۰۱۲۳۴۵۶۷۸۹", dr = "൦൧൨൩൪൫൬൭൮൯", Dr = "೦೧೨೩೪೫೬೭೮೯", hr = "໐໑໒໓໔໕໖໗໘໙", fr = "୦୧୨୩୪୫୬୭୮୯", pr = "០១២៣៤៥៦៧៨៩", gr = "߀߁߂߃߄߅߆߇߈߉", mr = "੦੧੨੩੪੫੬੭੮੯", br = "૦૧૨૩૪૫૬૭૮૯", Cr = "०१२३४५६७८९", Ar = "၀၁၂၃၄၅၆၇၈၉", vr = "௦௧௨௩௪௫௬௭௮௯", Fr = "౦౧౨౩౪౫౬౭౮౯", Er = "๐๑๒๓๔๕๖๗๘๙", wr = "༠༡༢༣༤༥༦༧༨༩", lt = { ar: lr, fa: cr, ml: dr, kn: Dr, lo: hr, or: fr, kh: pr, nqo: gr, pa: mr, gu: br, hi: Cr, my: Ar, ta: vr, te: Fr, th: Er, bo: wr }, yr = ["ru"], $r = ["id"], Br = ["id"], kr = ["ady-cyrl"], xr = ["aeb-arab"], _r = ["sq"], Sr = ["ru"], Or = ["zh-hant"], Tr = ["es"], Pr = ["hi"], Ir = ["es"], zr = ["ar"], Nr = ["ar"], Mr = ["ar"], jr = ["es"], Rr = ["fr"], Lr = ["ru"], qr = ["fr", "es", "ru"], Ur = ["hi"], Jr = ["es"], Kr = ["fa"], Gr = ["ru"], Vr = ["id"], Hr = ["de"], Wr = ["bbc-latn"], Zr = ["fa"], Yr = ["fa"], Xr = ["bho"], Qr = ["en"], en = ["id"], tn = ["fr"], rn = ["bn"], nn = ["fa"], sn = ["fr"], un = ["id"], an = ["id"], on = ["ru"], ln = ["oc"], cn = ["nan", "zh-hant"], dn = ["ru"], Dn = ["it"], hn = ["crh-latn"], fn = ["sk"], pn = ["pl"], gn = ["ru"], mn = ["hsb", "de"], bn = ["ms"], Cn = ["ne"], An = ["it"], vn = ["it"], Fn = ["es"], En = ["fr"], wn = ["fi"], yn = ["fr"], $n = ["fr"], Bn = ["de"], kn = ["it"], xn = ["tr"], _n = ["gan-hant", "zh-hant", "zh-hans"], Sn = ["fr"], On = ["pt"], Tn = ["fa"], Pn = ["es"], In = ["gom-deva"], zn = ["id"], Nn = ["de"], Mn = ["es"], jn = ["zh-hant"], Rn = ["hif-latn"], Ln = ["de"], qn = ["dsb", "de"], Un = ["fr"], Jn = ["hy"], Kn = ["zh-cn", "zh-hans"], Gn = ["ru"], Vn = ["eo"], Hn = ["ike-cans"], Wn = ["en"], Zn = ["da"], Yn = ["id"], Xn = ["kk-latn", "kk-cyrl"], Qn = ["fr"], es = ["kbd-cyrl"], ts = ["fr"], rs = ["ur"], ns = ["tr"], ss = ["my"], us = ["kk-cyrl"], is = ["da"], as = ["ru"], os = ["ru"], ls = ["fi"], cs = ["ks-arab"], ds = ["de"], Ds = ["ku-latn"], hs = ["ru"], fs = ["ru"], ps = ["es"], gs = ["de"], ms = ["ru"], bs = ["ru", "az"], Cs = ["nl"], As = ["it"], vs = ["et"], Fs = ["fa"], Es = ["it", "rm", "fur"], ws = ["pms", "eml", "lij", "vec", "it"], ys = ["fr"], $s = ["fa"], Bs = ["lv"], ks = ["fa"], xs = ["zh-hant"], _s = ["tr"], Ss = ["id"], Os = ["hi"], Ts = ["myv", "ru"], Ps = ["fr"], Is = ["mrj", "ru"], zs = ["id"], Ns = ["my"], Ms = ["ro"], js = ["mhr", "ru"], Rs = ["pt"], Ls = ["mdf", "ru"], qs = ["fa"], Us = ["es"], Js = ["cdo", "zh-hant"], Ks = ["it"], Gs = ["nn"], Vs = ["de"], Hs = ["id"], Ws = ["nb"], Zs = ["fr"], Ys = ["ca", "fr"], Xs = ["fi"], Qs = ["ru"], eu = ["fr"], tu = ["de"], ru = ["de"], nu = ["de"], su = ["en"], uu = ["it"], iu = ["el"], au = ["pt-br"], ou = ["qug", "es"], lu = ["qu", "es"], cu = ["it"], du = ["ro"], Du = ["uk", "ru"], hu = ["ro"], fu = ["ruq-latn", "ro"], pu = ["hi"], gu = ["ru"], mu = ["it"], bu = ["en"], Cu = ["it"], Au = ["cbk", "fa"], vu = ["fr"], Fu = ["fr"], Eu = ["lt"], wu = ["bs", "sr-el", "hr"], yu = ["fr"], $u = ["shy-latn"], Bu = ["cs"], ku = ["skr-arab"], xu = ["de"], _u = ["fi"], Su = ["sr-ec"], Ou = ["nl"], Tu = ["de"], Pu = ["ru"], Iu = ["id"], zu = ["pl"], Nu = ["zh-tw", "zh-hant", "zh-hans"], Mu = ["zh-tw", "zh-hant", "zh-hans"], ju = ["kn"], Ru = ["pt"], Lu = ["tg-cyrl"], qu = ["zh-tw", "zh-hant", "zh-hans"], Uu = ["tt-cyrl", "ru"], Ju = ["fr"], Ku = ["ru"], Gu = ["ru"], Vu = ["ug-arab"], Hu = ["it"], Wu = ["et"], Zu = ["nl"], Yu = ["de"], Xu = ["fi"], Qu = ["et"], ei = ["fr"], ti = ["fr"], ri = ["zh-hans"], ni = ["ru"], si = ["ka"], ui = ["he"], ii = ["zh-hans"], ai = ["nl"], oi = ["kab"], li = ["zh-hans"], $t = { ab: yr, abs: $r, ace: Br, ady: kr, aeb: xr, "aeb-arab": ["ar"], aln: _r, alt: Sr, ami: Or, an: Tr, anp: Pr, arn: Ir, arq: zr, ary: Nr, arz: Mr, ast: jr, atj: Rr, av: Lr, avk: qr, awa: Ur, ay: Jr, azb: Kr, ba: Gr, ban: Vr, "ban-bali": ["ban"], bar: Hr, bbc: Wr, "bbc-latn": ["id"], bcc: Zr, "be-tarask": ["be"], bgn: Yr, bh: Xr, bi: Qr, bjn: en, bm: tn, bpy: rn, bqi: nn, br: sn, btm: un, bug: an, bxr: on, ca: ln, "cbk-zam": ["es"], cdo: cn, ce: dn, co: Dn, crh: hn, "crh-cyrl": ["ru"], cs: fn, csb: pn, cv: gn, "de-at": ["de"], "de-ch": ["de"], "de-formal": ["de"], dsb: mn, dtp: bn, dty: Cn, egl: An, eml: vn, "en-ca": ["en"], "en-gb": ["en"], "es-419": ["es"], "es-formal": ["es"], ext: Fn, ff: En, fit: wn, frc: yn, frp: $n, frr: Bn, fur: kn, gag: xn, gan: _n, "gan-hans": ["zh-hans"], "gan-hant": ["zh-hant", "zh-hans"], gcr: Sn, gl: On, glk: Tn, gn: Pn, gom: In, "gom-deva": ["hi"], gor: zn, gsw: Nn, guc: Mn, hak: jn, hif: Rn, hrx: Ln, hsb: qn, ht: Un, "hu-formal": ["hu"], hyw: Jn, ii: Kn, inh: Gn, io: Vn, iu: Hn, jam: Wn, jut: Zn, jv: Yn, kaa: Xn, kab: Qn, kbd: es, kbp: ts, khw: rs, kiu: ns, kjp: ss, kk: us, "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: is, "ko-kp": ["ko"], koi: as, krc: os, krl: ls, ks: cs, ksh: ds, ku: Ds, "ku-arab": ["ckb"], kum: hs, kv: fs, lad: ps, lb: gs, lbe: ms, lez: bs, li: Cs, lij: As, liv: vs, lki: Fs, lld: Es, lmo: ws, ln: ys, lrc: $s, ltg: Bs, luz: ks, lzh: xs, lzz: _s, mad: Ss, mai: Os, "map-bms": ["jv", "id"], mdf: Ts, mg: Ps, mhr: Is, min: zs, mnw: Ns, mo: Ms, mrj: js, "ms-arab": ["ms"], mwl: Rs, myv: Ls, mzn: qs, nah: Us, nan: Js, nap: Ks, nb: Gs, nds: Vs, "nds-nl": ["nl"], nia: Hs, "nl-informal": ["nl"], nn: Ws, nrm: Zs, oc: Ys, olo: Xs, os: Qs, pcd: eu, pdc: tu, pdt: ru, pfl: nu, pih: su, pms: uu, pnt: iu, pt: au, "pt-br": ["pt"], qu: ou, qug: lu, rgn: cu, rmy: du, "roa-tara": ["it"], rue: Du, rup: hu, ruq: fu, "ruq-cyrl": ["mk"], "ruq-latn": ["ro"], sa: pu, sah: gu, scn: mu, sco: bu, sdc: Cu, sdh: Au, ses: vu, sg: Fu, sgs: Eu, sh: wu, shi: yu, shy: $u, "shy-latn": ["fr"], sk: Bu, skr: ku, "skr-arab": ["ur", "pnb"], sli: xu, smn: _u, sr: Su, srn: Ou, stq: Tu, sty: Pu, su: Iu, szl: zu, szy: Nu, tay: Mu, tcy: ju, tet: Ru, tg: Lu, trv: qu, tt: Uu, "tt-cyrl": ["ru"], ty: Ju, tyv: Ku, udm: Gu, ug: Vu, vec: Hu, vep: Wu, vls: Zu, vmf: Yu, vot: Xu, vro: Qu, wa: ei, wo: ti, wuu: ri, xal: ni, xmf: si, yi: ui, za: ii, zea: ai, zgh: oi, zh: li, "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 ue = class {
|
|
563
563
|
constructor(e) {
|
|
564
564
|
this.locale = e;
|
|
565
565
|
}
|
|
566
566
|
convertPlural(e, t) {
|
|
567
|
-
const
|
|
567
|
+
const r = /\d+=/i;
|
|
568
568
|
if (!t || t.length === 0) return "";
|
|
569
|
-
for (let
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
572
|
-
if (parseInt(
|
|
573
|
-
t[
|
|
569
|
+
for (let s = 0; s < t.length; s++) {
|
|
570
|
+
const u = t[s];
|
|
571
|
+
if (r.test(u)) {
|
|
572
|
+
if (parseInt(u.slice(0, u.indexOf("=")), 10) === e) return u.slice(u.indexOf("=") + 1);
|
|
573
|
+
t[s] = void 0;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
t = t.filter((
|
|
577
|
-
let
|
|
578
|
-
return
|
|
576
|
+
t = t.filter((s) => !!s);
|
|
577
|
+
let n = this.getPluralForm(e, this.locale);
|
|
578
|
+
return n = Math.min(n, t.length - 1), t[n];
|
|
579
579
|
}
|
|
580
580
|
getPluralForm(e, t) {
|
|
581
|
-
const
|
|
582
|
-
return
|
|
581
|
+
const r = ["zero", "one", "two", "few", "many", "other"], n = new Intl.PluralRules(t), s = n.resolvedOptions().pluralCategories, u = n.select(e);
|
|
582
|
+
return r.filter((i) => s.includes(i)).indexOf(u);
|
|
583
583
|
}
|
|
584
584
|
convertNumber(e, t = !1) {
|
|
585
|
-
let
|
|
585
|
+
let r = this.digitTransformTable(this.locale), n = "";
|
|
586
586
|
if (t) {
|
|
587
|
-
if (parseFloat(e, 10) === e || !
|
|
588
|
-
const
|
|
589
|
-
for (const
|
|
590
|
-
|
|
591
|
-
const
|
|
592
|
-
for (let
|
|
593
|
-
return parseFloat(
|
|
587
|
+
if (parseFloat(e, 10) === e || !r) return e;
|
|
588
|
+
const s = [];
|
|
589
|
+
for (const i in r) s[r[i]] = i;
|
|
590
|
+
r = s;
|
|
591
|
+
const u = String(e);
|
|
592
|
+
for (let i = 0; i < u.length; i++) n += r[u[i]] || u[i];
|
|
593
|
+
return parseFloat(n, 10);
|
|
594
594
|
}
|
|
595
595
|
if (Intl.NumberFormat) {
|
|
596
|
-
let
|
|
597
|
-
const
|
|
598
|
-
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ?
|
|
596
|
+
let s;
|
|
597
|
+
const u = [...$t[this.locale] || [], "en"];
|
|
598
|
+
return Intl.NumberFormat.supportedLocalesOf(this.locale).length ? s = [this.locale] : s = u, n = new Intl.NumberFormat(s).format(e), n === "NaN" && (n = e), n;
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
convertGrammar(e) {
|
|
@@ -609,7 +609,7 @@ let se = class {
|
|
|
609
609
|
digitTransformTable(e) {
|
|
610
610
|
return lt[e] ? lt[e].split("") : !1;
|
|
611
611
|
}
|
|
612
|
-
},
|
|
612
|
+
}, ci = class extends ue {
|
|
613
613
|
convertGrammar(e, t) {
|
|
614
614
|
switch (t) {
|
|
615
615
|
case "prefixed":
|
|
@@ -618,9 +618,9 @@ let se = class {
|
|
|
618
618
|
}
|
|
619
619
|
return e;
|
|
620
620
|
}
|
|
621
|
-
},
|
|
622
|
-
convertGrammar(t,
|
|
623
|
-
switch (
|
|
621
|
+
}, di = class extends ue {
|
|
622
|
+
convertGrammar(t, r) {
|
|
623
|
+
switch (r) {
|
|
624
624
|
case "instrumental":
|
|
625
625
|
t = "s " + t;
|
|
626
626
|
break;
|
|
@@ -630,7 +630,7 @@ let se = class {
|
|
|
630
630
|
}
|
|
631
631
|
return t;
|
|
632
632
|
}
|
|
633
|
-
},
|
|
633
|
+
}, Di = class extends ue {
|
|
634
634
|
convertGrammar(e, t) {
|
|
635
635
|
switch (t) {
|
|
636
636
|
case "instrumental":
|
|
@@ -642,7 +642,7 @@ let se = class {
|
|
|
642
642
|
}
|
|
643
643
|
return e;
|
|
644
644
|
}
|
|
645
|
-
},
|
|
645
|
+
}, hi = class extends ue {
|
|
646
646
|
convertGrammar(e, t) {
|
|
647
647
|
switch (t) {
|
|
648
648
|
case "instrumental":
|
|
@@ -654,40 +654,40 @@ let se = class {
|
|
|
654
654
|
}
|
|
655
655
|
return e;
|
|
656
656
|
}
|
|
657
|
-
},
|
|
657
|
+
}, fi = class extends ue {
|
|
658
658
|
convertGrammar(e, t) {
|
|
659
|
-
let
|
|
660
|
-
const
|
|
661
|
-
switch (e.match(/wiki$/i) && (
|
|
659
|
+
let r = e.match(/[aou][^äöy]*$/i);
|
|
660
|
+
const n = e;
|
|
661
|
+
switch (e.match(/wiki$/i) && (r = !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 += r ? "sta" : "stä";
|
|
667
667
|
break;
|
|
668
668
|
case "partitive":
|
|
669
|
-
e +=
|
|
669
|
+
e += r ? "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 += r ? "ssa" : "ssä";
|
|
676
676
|
break;
|
|
677
677
|
default:
|
|
678
|
-
e =
|
|
678
|
+
e = n;
|
|
679
679
|
break;
|
|
680
680
|
}
|
|
681
681
|
return e;
|
|
682
682
|
}
|
|
683
|
-
},
|
|
683
|
+
}, pi = class extends ue {
|
|
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 gi extends ue {
|
|
689
|
+
convertGrammar(t, r) {
|
|
690
|
+
switch (r) {
|
|
691
691
|
case "mestnik":
|
|
692
692
|
t = "o " + t;
|
|
693
693
|
break;
|
|
@@ -698,7 +698,7 @@ class ga extends se {
|
|
|
698
698
|
return t;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
-
let
|
|
701
|
+
let mi = class extends ue {
|
|
702
702
|
convertGrammar(e, t) {
|
|
703
703
|
switch (t) {
|
|
704
704
|
case "genitive":
|
|
@@ -714,12 +714,12 @@ let ma = class extends se {
|
|
|
714
714
|
return e;
|
|
715
715
|
}
|
|
716
716
|
};
|
|
717
|
-
class
|
|
718
|
-
convertGrammar(t,
|
|
719
|
-
return
|
|
717
|
+
class bi extends ue {
|
|
718
|
+
convertGrammar(t, r) {
|
|
719
|
+
return r === "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 Ci = class extends ue {
|
|
723
723
|
convertGrammar(e, t) {
|
|
724
724
|
if (t === "ainmlae") switch (e) {
|
|
725
725
|
case "an Domhnach":
|
|
@@ -746,7 +746,7 @@ let Ca = class extends se {
|
|
|
746
746
|
}
|
|
747
747
|
return e;
|
|
748
748
|
}
|
|
749
|
-
},
|
|
749
|
+
}, Ai = class extends ue {
|
|
750
750
|
convertGrammar(e, t) {
|
|
751
751
|
switch (t) {
|
|
752
752
|
case "rol":
|
|
@@ -761,38 +761,38 @@ let Ca = class extends se {
|
|
|
761
761
|
}
|
|
762
762
|
return e;
|
|
763
763
|
}
|
|
764
|
-
},
|
|
764
|
+
}, vi = class extends ue {
|
|
765
765
|
convertGrammar(e, t) {
|
|
766
|
-
let n,
|
|
767
|
-
switch (
|
|
766
|
+
let r, n, s, u;
|
|
767
|
+
switch (r = "мæ", n = "", s = "", u = "", e.match(/тæ$/i) ? (e = e.slice(0, -1), r = "æм") : e.match(/[аæеёиоыэюя]$/i) ? n = "й" : e.match(/у$/i) ? e.slice(-2, -1).match(/[аæеёиоыэюя]$/i) || (n = "й") : e.match(/[бвгджзйклмнопрстфхцчшщьъ]$/i) || (s = "-"), t) {
|
|
768
768
|
case "genitive":
|
|
769
|
-
|
|
769
|
+
u = s + n + "ы";
|
|
770
770
|
break;
|
|
771
771
|
case "dative":
|
|
772
|
-
|
|
772
|
+
u = s + n + "æн";
|
|
773
773
|
break;
|
|
774
774
|
case "allative":
|
|
775
|
-
|
|
775
|
+
u = s + r;
|
|
776
776
|
break;
|
|
777
777
|
case "ablative":
|
|
778
|
-
|
|
778
|
+
n === "й" ? u = s + n + "æ" : u = s + n + "æй";
|
|
779
779
|
break;
|
|
780
780
|
case "superessive":
|
|
781
|
-
|
|
781
|
+
u = s + n + "ыл";
|
|
782
782
|
break;
|
|
783
783
|
case "equative":
|
|
784
|
-
|
|
784
|
+
u = s + n + "ау";
|
|
785
785
|
break;
|
|
786
786
|
case "comitative":
|
|
787
|
-
|
|
787
|
+
u = s + "имæ";
|
|
788
788
|
break;
|
|
789
789
|
}
|
|
790
|
-
return e +
|
|
790
|
+
return e + u;
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
|
-
class
|
|
794
|
-
convertGrammar(t,
|
|
795
|
-
switch (
|
|
793
|
+
class Fi extends ue {
|
|
794
|
+
convertGrammar(t, r) {
|
|
795
|
+
switch (r) {
|
|
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,340 +803,340 @@ class Ea extends se {
|
|
|
803
803
|
return t;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
|
-
var ct = { bs:
|
|
807
|
-
const
|
|
808
|
-
let
|
|
806
|
+
var ct = { bs: di, default: ue, dsb: Di, fi, ga: Ci, he: ci, hsb: hi, hu: Ai, hy: bi, la: mi, os: vi, ru: pi, sl: gi, uk: Fi };
|
|
807
|
+
const Ei = 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 Bt = class {
|
|
809
809
|
constructor(e) {
|
|
810
|
-
this.locale =
|
|
810
|
+
this.locale = ke(e), this.language = new (ct[this.locale] || ct.default)(this.locale);
|
|
811
811
|
}
|
|
812
812
|
emit(e, t) {
|
|
813
|
-
let
|
|
813
|
+
let r, n, s;
|
|
814
814
|
switch (typeof e) {
|
|
815
815
|
case "string":
|
|
816
816
|
case "number":
|
|
817
|
-
|
|
817
|
+
r = e;
|
|
818
818
|
break;
|
|
819
819
|
case "object":
|
|
820
|
-
if (
|
|
821
|
-
else throw new Error('unknown operation "' +
|
|
820
|
+
if (n = e.slice(1).map((u) => this.emit(u, t)), s = e[0].toLowerCase(), typeof this[s] == "function") r = this[s](n, t);
|
|
821
|
+
else throw new Error('unknown operation "' + s + '"');
|
|
822
822
|
break;
|
|
823
823
|
case "undefined":
|
|
824
|
-
|
|
824
|
+
r = "";
|
|
825
825
|
break;
|
|
826
826
|
default:
|
|
827
827
|
throw new Error("unexpected type in AST: " + typeof e);
|
|
828
828
|
}
|
|
829
|
-
return
|
|
829
|
+
return r;
|
|
830
830
|
}
|
|
831
831
|
concat(e) {
|
|
832
832
|
let t = "";
|
|
833
|
-
return e.forEach((
|
|
834
|
-
t +=
|
|
833
|
+
return e.forEach((r) => {
|
|
834
|
+
t += r;
|
|
835
835
|
}), t;
|
|
836
836
|
}
|
|
837
837
|
replace(e, t) {
|
|
838
|
-
const
|
|
839
|
-
return
|
|
838
|
+
const r = parseInt(e[0], 10);
|
|
839
|
+
return r < t.length ? t[r] : "$" + (r + 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)), r = e.slice(1);
|
|
843
|
+
return r.length ? this.language.convertPlural(t, r) : "";
|
|
844
844
|
}
|
|
845
845
|
gender(e) {
|
|
846
|
-
const t = e[0],
|
|
847
|
-
return this.language.gender(t,
|
|
846
|
+
const t = e[0], r = e.slice(1);
|
|
847
|
+
return this.language.gender(t, r);
|
|
848
848
|
}
|
|
849
849
|
grammar(e) {
|
|
850
|
-
const t = e[0],
|
|
851
|
-
return
|
|
850
|
+
const t = e[0], r = e[1];
|
|
851
|
+
return r && t && this.language.convertGrammar(r, t);
|
|
852
852
|
}
|
|
853
853
|
wikilink(e) {
|
|
854
|
-
let t,
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
return e.length === 1 ? t =
|
|
854
|
+
let t, r = e[0];
|
|
855
|
+
r.charAt(0) === ":" && (r = r.slice(1));
|
|
856
|
+
const n = `./${r}`;
|
|
857
|
+
return e.length === 1 ? t = r : t = e[1], `<a href="${n}" title="${r}">${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 = wi(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", r = e[0];
|
|
869
|
+
return typeof r == "string" || typeof r == "number" ? this.language.convertNumber(r, t) : r;
|
|
870
870
|
}
|
|
871
871
|
htmlattributes(e) {
|
|
872
872
|
const t = {};
|
|
873
|
-
for (let
|
|
873
|
+
for (let r = 0, n = e.length; r < n; r += 2) t[e[r]] = e[r + 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
|
|
882
|
-
return `<${t}${
|
|
877
|
+
const t = e.shift(), r = e.shift();
|
|
878
|
+
let n = e, s = "";
|
|
879
|
+
for (const i in r) s += ` ${i}="${r[i]}"`;
|
|
880
|
+
Array.isArray(n) || (n = [n]);
|
|
881
|
+
const u = n.join("");
|
|
882
|
+
return `<${t}${s}>${u}</${t}>`;
|
|
883
883
|
}
|
|
884
884
|
};
|
|
885
|
-
function
|
|
885
|
+
function ke(e) {
|
|
886
886
|
return typeof e == "string" ? e.toLowerCase() : e;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
const t = e.match(
|
|
888
|
+
function wi(e) {
|
|
889
|
+
const t = e.match(Ei);
|
|
890
890
|
return t ? t[2] === void 0 ? "ltr" : "rtl" : null;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
let
|
|
894
|
-
function
|
|
892
|
+
function yi(e, { wikilinks: t = !1 } = {}) {
|
|
893
|
+
let r = 0;
|
|
894
|
+
function n(l) {
|
|
895
895
|
return () => {
|
|
896
|
-
for (let
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
896
|
+
for (let h = 0; h < l.length; h++) {
|
|
897
|
+
const I = l[h]();
|
|
898
|
+
if (I !== null) return I;
|
|
899
899
|
}
|
|
900
900
|
return null;
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
function
|
|
904
|
-
const
|
|
905
|
-
for (let
|
|
906
|
-
const
|
|
907
|
-
if (
|
|
908
|
-
|
|
903
|
+
function s(l) {
|
|
904
|
+
const h = r, I = [];
|
|
905
|
+
for (let G = 0; G < l.length; G++) {
|
|
906
|
+
const V = l[G]();
|
|
907
|
+
if (V === null) return r = h, null;
|
|
908
|
+
I.push(V);
|
|
909
909
|
}
|
|
910
|
-
return
|
|
910
|
+
return I;
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function u(l, h) {
|
|
913
913
|
return () => {
|
|
914
|
-
const
|
|
915
|
-
let
|
|
916
|
-
for (;
|
|
917
|
-
return
|
|
914
|
+
const I = r, G = [];
|
|
915
|
+
let V = h();
|
|
916
|
+
for (; V !== null; ) G.push(V), V = h();
|
|
917
|
+
return G.length < l ? (r = I, null) : G;
|
|
918
918
|
};
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
const
|
|
920
|
+
function i(l) {
|
|
921
|
+
const h = l.length;
|
|
922
922
|
return () => {
|
|
923
|
-
let
|
|
924
|
-
return e.slice(
|
|
923
|
+
let I = null;
|
|
924
|
+
return e.slice(r, r + h) === l && (I = l, r += h), I;
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function a(l) {
|
|
928
928
|
return () => {
|
|
929
|
-
const
|
|
930
|
-
return
|
|
929
|
+
const h = e.slice(r).match(l);
|
|
930
|
+
return h === null ? null : (r += h[0].length, h[0]);
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
const
|
|
934
|
-
function
|
|
933
|
+
const F = a(/^\s+/), k = i("|"), p = i(":"), S = i("\\"), X = a(/^./), te = i("$"), he = a(/^\d+/), N = i('"'), Q = i("'"), W = a(t ? /^[^{}[\]$<\\]/ : /^[^{}$<\\]/), re = a(t ? /^[^{}[\]$\\|]/ : /^[^{}$\\|]/), j = a(t ? /^[^{}[\]$\s]/ : /^[^{}$\s]/);
|
|
934
|
+
function H(l, h) {
|
|
935
935
|
return () => {
|
|
936
|
-
const
|
|
937
|
-
return
|
|
936
|
+
const I = l();
|
|
937
|
+
return I === null ? null : h(I);
|
|
938
938
|
};
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
const
|
|
942
|
-
return
|
|
940
|
+
function J() {
|
|
941
|
+
const l = u(1, K)();
|
|
942
|
+
return l === null ? null : l.join("");
|
|
943
943
|
}
|
|
944
|
-
function
|
|
945
|
-
const
|
|
946
|
-
return
|
|
944
|
+
function le() {
|
|
945
|
+
const l = u(1, fe)();
|
|
946
|
+
return l === null ? null : l.join("");
|
|
947
947
|
}
|
|
948
|
-
const
|
|
949
|
-
function
|
|
950
|
-
const
|
|
951
|
-
return
|
|
948
|
+
const de = n([_, j]);
|
|
949
|
+
function De() {
|
|
950
|
+
const l = u(1, de)();
|
|
951
|
+
return l === null ? null : l.join("");
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
const
|
|
955
|
-
return
|
|
953
|
+
function _() {
|
|
954
|
+
const l = s([S, X]);
|
|
955
|
+
return l === null ? null : l[1];
|
|
956
956
|
}
|
|
957
|
-
const
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
return
|
|
957
|
+
const K = n([_, re]), fe = n([_, W]);
|
|
958
|
+
function A() {
|
|
959
|
+
const l = s([te, he]);
|
|
960
|
+
return l === null ? null : ["REPLACE", parseInt(l[1], 10) - 1];
|
|
961
961
|
}
|
|
962
|
-
const
|
|
963
|
-
return
|
|
962
|
+
const ne = H(a(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/), function(l) {
|
|
963
|
+
return l.toString();
|
|
964
964
|
});
|
|
965
|
-
function
|
|
966
|
-
const
|
|
967
|
-
if (
|
|
968
|
-
const
|
|
969
|
-
return
|
|
970
|
-
}
|
|
971
|
-
function
|
|
972
|
-
const
|
|
973
|
-
return
|
|
974
|
-
}
|
|
975
|
-
function
|
|
976
|
-
const
|
|
977
|
-
return
|
|
978
|
-
}
|
|
979
|
-
function
|
|
980
|
-
const
|
|
981
|
-
return
|
|
982
|
-
}
|
|
983
|
-
const
|
|
984
|
-
const
|
|
985
|
-
return
|
|
965
|
+
function b() {
|
|
966
|
+
const l = s([k, u(0, w)]);
|
|
967
|
+
if (l === null) return null;
|
|
968
|
+
const h = l[1];
|
|
969
|
+
return h.length > 1 ? ["CONCAT"].concat(h) : h[0];
|
|
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
986
|
}, function() {
|
|
987
|
-
const
|
|
988
|
-
return
|
|
989
|
-
}]),
|
|
990
|
-
function
|
|
991
|
-
const
|
|
992
|
-
return
|
|
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];
|
|
993
993
|
}
|
|
994
994
|
function E() {
|
|
995
|
-
const
|
|
996
|
-
return
|
|
995
|
+
const l = s([u(1, w), k, u(1, g)]);
|
|
996
|
+
return l === null ? null : [["CONCAT"].concat(l[0]), ["CONCAT"].concat(l[2])];
|
|
997
997
|
}
|
|
998
|
-
function D() {
|
|
999
|
-
const o = u([s(1, Z)]);
|
|
1000
|
-
return o === null ? null : [["CONCAT"].concat(o[0])];
|
|
1001
|
-
}
|
|
1002
|
-
const f = r([E, D]);
|
|
1003
998
|
function v() {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
999
|
+
const l = s([u(1, w)]);
|
|
1000
|
+
return l === null ? null : [["CONCAT"].concat(l[0])];
|
|
1001
|
+
}
|
|
1002
|
+
const P = n([E, v]);
|
|
1003
|
+
function L() {
|
|
1004
|
+
let l = null;
|
|
1005
|
+
const h = s([_e, P, Se]);
|
|
1006
|
+
if (h !== null) {
|
|
1007
|
+
const I = h[1];
|
|
1008
|
+
l = ["WIKILINK"].concat(I);
|
|
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 l;
|
|
1011
|
+
}
|
|
1012
|
+
function o() {
|
|
1013
|
+
let l = null;
|
|
1014
|
+
const h = s([me, u(1, c), F, u(1, g), ve]);
|
|
1015
|
+
return h !== null && (l = ["EXTLINK", h[1].length === 1 ? h[1][0] : ["CONCAT"].concat(h[1]), ["CONCAT"].concat(h[3])]), l;
|
|
1016
|
+
}
|
|
1017
|
+
const D = a(/^[A-Za-z]+/);
|
|
1018
|
+
function f(l, h, I, G = { 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 (l = l.toLowerCase(), h = h.toLowerCase(), l !== h || G.allowedHtmlElements.indexOf(l) === -1) return !1;
|
|
1020
|
+
const V = /[\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 ce = 0, Ee = I.length; ce < Ee; ce += 2) {
|
|
1022
|
+
const $e = I[ce];
|
|
1023
|
+
if (G.allowedHtmlCommonAttributes.indexOf($e) === -1 && (G.allowedHtmlAttributesByElement[l] || []).indexOf($e) === -1 || $e === "style" && I[ce + 1].search(V) !== -1) return !1;
|
|
1024
1024
|
}
|
|
1025
1025
|
return !0;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const
|
|
1029
|
-
return
|
|
1027
|
+
function x() {
|
|
1028
|
+
const l = a(/^[^"]*/), h = s([N, l, N]);
|
|
1029
|
+
return h === null ? null : h[1];
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
1034
|
-
}
|
|
1035
|
-
function
|
|
1036
|
-
const
|
|
1037
|
-
return
|
|
1038
|
-
}
|
|
1039
|
-
function
|
|
1040
|
-
const
|
|
1041
|
-
return Array.prototype.concat.apply(["HTMLATTRIBUTES"],
|
|
1042
|
-
}
|
|
1043
|
-
function
|
|
1044
|
-
let
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
const
|
|
1048
|
-
if (
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1031
|
+
function y() {
|
|
1032
|
+
const l = a(/^[^']*/), h = s([Q, l, Q]);
|
|
1033
|
+
return h === null ? null : h[1];
|
|
1034
|
+
}
|
|
1035
|
+
function M() {
|
|
1036
|
+
const l = a(/^\s*=\s*/), h = s([F, D, l, n([x, y])]);
|
|
1037
|
+
return h === null ? null : [h[1], h[3]];
|
|
1038
|
+
}
|
|
1039
|
+
function R() {
|
|
1040
|
+
const l = u(0, M)();
|
|
1041
|
+
return Array.prototype.concat.apply(["HTMLATTRIBUTES"], l);
|
|
1042
|
+
}
|
|
1043
|
+
function m() {
|
|
1044
|
+
let l = null;
|
|
1045
|
+
const h = r, I = i("<"), G = a(/^\/?/), V = a(/^\s*>/), ce = s([I, D, R, G, V]);
|
|
1046
|
+
if (ce === null) return null;
|
|
1047
|
+
const Ee = r, $e = ce[1], Je = u(0, g)(), It = r, zt = i("</"), nt = s([zt, D, V]);
|
|
1048
|
+
if (nt === null) return ["CONCAT", e.slice(h, Ee)].concat(Je);
|
|
1049
|
+
const Nt = r, Mt = nt[1], st = ce[2], jt = st.slice(1);
|
|
1050
|
+
if (f($e, Mt, jt)) l = ["HTMLELEMENT", $e, st].concat(Je);
|
|
1051
1051
|
else {
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1052
|
+
const ut = (Rt) => Rt.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1053
|
+
l = ["CONCAT", ut(e.slice(h, Ee))].concat(Je, ut(e.slice(It, Nt)));
|
|
1054
1054
|
}
|
|
1055
|
-
return
|
|
1055
|
+
return l;
|
|
1056
1056
|
}
|
|
1057
|
-
const
|
|
1058
|
-
function
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1057
|
+
const c = n([Fe, A, L, o, De]), g = n([Fe, A, L, o, m, le]), w = n([Fe, A, J]);
|
|
1058
|
+
function ie() {
|
|
1059
|
+
const l = u(0, g)();
|
|
1060
|
+
return l === null ? null : ["CONCAT"].concat(l);
|
|
1061
1061
|
}
|
|
1062
|
-
const
|
|
1063
|
-
if (
|
|
1064
|
-
return
|
|
1062
|
+
const se = ie();
|
|
1063
|
+
if (se === null || r !== e.length) throw new Error("Parse error at position " + r.toString() + " in input: " + e);
|
|
1064
|
+
return se;
|
|
1065
1065
|
}
|
|
1066
1066
|
class dt {
|
|
1067
|
-
constructor(t, { wikilinks:
|
|
1068
|
-
this.locale =
|
|
1067
|
+
constructor(t, { wikilinks: r = !1 } = {}) {
|
|
1068
|
+
this.locale = ke(t), this.wikilinks = r, this.emitter = new Bt(this.locale);
|
|
1069
1069
|
}
|
|
1070
|
-
parse(t,
|
|
1070
|
+
parse(t, r) {
|
|
1071
1071
|
if (t.includes("{{") || t.includes("<") || this.wikilinks && t.includes("[")) {
|
|
1072
|
-
const
|
|
1073
|
-
return this.emitter.emit(
|
|
1074
|
-
} else return this.simpleParse(t,
|
|
1075
|
-
}
|
|
1076
|
-
simpleParse(t,
|
|
1077
|
-
return t.replace(/\$(\d+)/g, (
|
|
1078
|
-
const
|
|
1079
|
-
return
|
|
1072
|
+
const n = yi(t, { wikilinks: this.wikilinks });
|
|
1073
|
+
return this.emitter.emit(n, r);
|
|
1074
|
+
} else return this.simpleParse(t, r);
|
|
1075
|
+
}
|
|
1076
|
+
simpleParse(t, r) {
|
|
1077
|
+
return t.replace(/\$(\d+)/g, (n, s) => {
|
|
1078
|
+
const u = parseInt(s, 10) - 1;
|
|
1079
|
+
return r[u] !== void 0 ? r[u] : "$" + s;
|
|
1080
1080
|
});
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
|
-
class
|
|
1083
|
+
class $i {
|
|
1084
1084
|
constructor() {
|
|
1085
1085
|
this.sourceMap = /* @__PURE__ */ new Map();
|
|
1086
1086
|
}
|
|
1087
|
-
load(t,
|
|
1087
|
+
load(t, r) {
|
|
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 (r = ke(r), r) {
|
|
1090
|
+
if (!/^[a-zA-Z0-9-]+$/.test(r)) throw new Error(`Invalid locale ${r}`);
|
|
1091
|
+
for (const n in t) if (n.indexOf("@") !== 0) {
|
|
1092
|
+
if (typeof t[n] == "object") return this.load(t);
|
|
1093
|
+
if (typeof t[n] != "string") throw new Error(`Invalid message for message ${n} in ${r} locale.`);
|
|
1094
1094
|
break;
|
|
1095
1095
|
}
|
|
1096
|
-
this.sourceMap.has(
|
|
1097
|
-
} else for (
|
|
1096
|
+
this.sourceMap.has(r) ? this.sourceMap.set(r, Object.assign(this.sourceMap.get(r), t)) : this.sourceMap.set(r, t);
|
|
1097
|
+
} else for (r in t) this.load(t[r], r);
|
|
1098
1098
|
}
|
|
1099
|
-
getMessage(t,
|
|
1100
|
-
const
|
|
1101
|
-
return
|
|
1099
|
+
getMessage(t, r) {
|
|
1100
|
+
const n = this.sourceMap.get(ke(r));
|
|
1101
|
+
return n ? n[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 Bi {
|
|
1108
|
+
constructor(t, { finalFallback: r = "en", messages: n = void 0, wikilinks: s = !1 } = {}) {
|
|
1109
|
+
this.locale = ke(t), this.parser = new dt(this.locale, { wikilinks: s }), this.messageStore = new $i(), n && this.load(n, this.locale), this.finalFallback = r, this.wikilinks = s;
|
|
1110
1110
|
}
|
|
1111
|
-
load(t,
|
|
1112
|
-
return this.messageStore.load(t,
|
|
1111
|
+
load(t, r) {
|
|
1112
|
+
return this.messageStore.load(t, r || this.locale);
|
|
1113
1113
|
}
|
|
1114
|
-
i18n(t, ...
|
|
1115
|
-
return this.parser.parse(this.getMessage(t),
|
|
1114
|
+
i18n(t, ...r) {
|
|
1115
|
+
return this.parser.parse(this.getMessage(t), r);
|
|
1116
1116
|
}
|
|
1117
1117
|
setLocale(t) {
|
|
1118
|
-
this.locale =
|
|
1118
|
+
this.locale = ke(t), this.parser = new dt(this.locale, { wikilinks: this.wikilinks });
|
|
1119
1119
|
}
|
|
1120
1120
|
getFallbackLocales() {
|
|
1121
|
-
return [
|
|
1121
|
+
return [...$t[this.locale] || [], this.finalFallback];
|
|
1122
1122
|
}
|
|
1123
1123
|
getMessage(t) {
|
|
1124
|
-
let
|
|
1125
|
-
const
|
|
1126
|
-
for (;
|
|
1127
|
-
const
|
|
1128
|
-
let
|
|
1124
|
+
let r = this.locale, n = 0;
|
|
1125
|
+
const s = this.getFallbackLocales(this.locale);
|
|
1126
|
+
for (; r; ) {
|
|
1127
|
+
const u = r.split("-");
|
|
1128
|
+
let i = u.length;
|
|
1129
1129
|
do {
|
|
1130
|
-
const
|
|
1131
|
-
if (typeof
|
|
1132
|
-
|
|
1133
|
-
} while (
|
|
1134
|
-
|
|
1130
|
+
const a = u.slice(0, i).join("-"), F = this.messageStore.getMessage(t, a);
|
|
1131
|
+
if (typeof F == "string") return F;
|
|
1132
|
+
i--;
|
|
1133
|
+
} while (i);
|
|
1134
|
+
r = s[n], n++;
|
|
1135
1135
|
}
|
|
1136
1136
|
return t;
|
|
1137
1137
|
}
|
|
1138
|
-
registerParserPlugin(t,
|
|
1139
|
-
|
|
1138
|
+
registerParserPlugin(t, r) {
|
|
1139
|
+
Bt.prototype[t] = r;
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
1142
|
const kt = {
|
|
@@ -1209,8 +1209,14 @@ const kt = {
|
|
|
1209
1209
|
"sa-reset-submit": "Reset Password",
|
|
1210
1210
|
"sa-reset-success": "Password reset successfully! You can now log in.",
|
|
1211
1211
|
"sa-reset-error": "Unable to reset password. Please try again.",
|
|
1212
|
-
"sa-reset-error-code": "Invalid or expired reset code"
|
|
1213
|
-
|
|
1212
|
+
"sa-reset-error-code": "Invalid or expired reset code",
|
|
1213
|
+
"sa-or": "Or",
|
|
1214
|
+
"sa-social-google": "Continue with Google",
|
|
1215
|
+
"sa-social-github": "Continue with GitHub",
|
|
1216
|
+
"sa-social-apple": "Continue with Apple",
|
|
1217
|
+
"sa-social-oidc": "Continue with SSO",
|
|
1218
|
+
"sa-social-error": "Error starting social login"
|
|
1219
|
+
}, ki = {
|
|
1214
1220
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "fr" },
|
|
1215
1221
|
"sa-login": "Connexion",
|
|
1216
1222
|
"sa-username": "Nom d'utilisateur",
|
|
@@ -1248,8 +1254,14 @@ const kt = {
|
|
|
1248
1254
|
"sa-reset-submit": "Réinitialiser le mot de passe",
|
|
1249
1255
|
"sa-reset-success": "Mot de passe réinitialisé avec succès ! Vous pouvez maintenant vous connecter.",
|
|
1250
1256
|
"sa-reset-error": "Impossible de réinitialiser le mot de passe. Veuillez réessayer.",
|
|
1251
|
-
"sa-reset-error-code": "Code de réinitialisation invalide ou expiré"
|
|
1252
|
-
|
|
1257
|
+
"sa-reset-error-code": "Code de réinitialisation invalide ou expiré",
|
|
1258
|
+
"sa-or": "Ou",
|
|
1259
|
+
"sa-social-google": "Continuer avec Google",
|
|
1260
|
+
"sa-social-github": "Continuer avec GitHub",
|
|
1261
|
+
"sa-social-apple": "Continuer avec Apple",
|
|
1262
|
+
"sa-social-oidc": "Continuer avec SSO",
|
|
1263
|
+
"sa-social-error": "Erreur lors de la connexion sociale"
|
|
1264
|
+
}, xi = {
|
|
1253
1265
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "es" },
|
|
1254
1266
|
"sa-login": "Acceso",
|
|
1255
1267
|
"sa-username": "Nombre de usuario",
|
|
@@ -1285,8 +1297,14 @@ const kt = {
|
|
|
1285
1297
|
"sa-reset-submit": "Restablecer contraseña",
|
|
1286
1298
|
"sa-reset-success": "¡Contraseña restablecida con éxito! Ya puedes iniciar sesión.",
|
|
1287
1299
|
"sa-reset-error": "No se pudo restablecer la contraseña. Por favor intenta de nuevo.",
|
|
1288
|
-
"sa-reset-error-code": "Código de restablecimiento inválido o expirado"
|
|
1289
|
-
|
|
1300
|
+
"sa-reset-error-code": "Código de restablecimiento inválido o expirado",
|
|
1301
|
+
"sa-or": "O",
|
|
1302
|
+
"sa-social-google": "Continuar con Google",
|
|
1303
|
+
"sa-social-github": "Continuar con GitHub",
|
|
1304
|
+
"sa-social-apple": "Continuar con Apple",
|
|
1305
|
+
"sa-social-oidc": "Continuar con SSO",
|
|
1306
|
+
"sa-social-error": "Error al iniciar sesión social"
|
|
1307
|
+
}, _i = {
|
|
1290
1308
|
"@metadata": { authors: ["Mason Payne"], "last-updated": "2022-05-28", locale: "ja" },
|
|
1291
1309
|
"sa-login": "ログイン",
|
|
1292
1310
|
"sa-username": "ユーザー名",
|
|
@@ -1324,66 +1342,72 @@ const kt = {
|
|
|
1324
1342
|
"sa-reset-submit": "パスワードをリセット",
|
|
1325
1343
|
"sa-reset-success": "パスワードが正常にリセットされました!ログインできます。",
|
|
1326
1344
|
"sa-reset-error": "パスワードをリセットできませんでした。もう一度お試しください。",
|
|
1327
|
-
"sa-reset-error-code": "無効または期限切れのリセットコード"
|
|
1328
|
-
|
|
1345
|
+
"sa-reset-error-code": "無効または期限切れのリセットコード",
|
|
1346
|
+
"sa-or": "または",
|
|
1347
|
+
"sa-social-google": "Googleで続ける",
|
|
1348
|
+
"sa-social-github": "GitHubで続ける",
|
|
1349
|
+
"sa-social-apple": "Appleで続ける",
|
|
1350
|
+
"sa-social-oidc": "SSOで続ける",
|
|
1351
|
+
"sa-social-error": "ソーシャルログイン開始エラー"
|
|
1352
|
+
}, Si = {
|
|
1329
1353
|
en: kt,
|
|
1330
|
-
fr:
|
|
1331
|
-
es:
|
|
1332
|
-
ja:
|
|
1354
|
+
fr: ki,
|
|
1355
|
+
es: xi,
|
|
1356
|
+
ja: _i
|
|
1333
1357
|
};
|
|
1334
|
-
function
|
|
1335
|
-
const t = new
|
|
1358
|
+
function rt(e) {
|
|
1359
|
+
const t = new Bi("en", {
|
|
1336
1360
|
messages: kt
|
|
1337
1361
|
});
|
|
1338
|
-
return e !== "en" && (t.load(
|
|
1362
|
+
return e !== "en" && (t.load(Si[e], e), t.setLocale(e)), t;
|
|
1339
1363
|
}
|
|
1340
1364
|
function xt(e) {
|
|
1341
|
-
const t = "==".slice(0, (4 - e.length % 4) % 4),
|
|
1342
|
-
for (let
|
|
1343
|
-
|
|
1344
|
-
return
|
|
1365
|
+
const t = "==".slice(0, (4 - e.length % 4) % 4), r = e.replace(/-/g, "+").replace(/_/g, "/") + t, n = atob(r), s = new ArrayBuffer(n.length), u = new Uint8Array(s);
|
|
1366
|
+
for (let i = 0; i < n.length; i++)
|
|
1367
|
+
u[i] = n.charCodeAt(i);
|
|
1368
|
+
return s;
|
|
1345
1369
|
}
|
|
1346
1370
|
function _t(e) {
|
|
1347
1371
|
const t = new Uint8Array(e);
|
|
1348
|
-
let
|
|
1349
|
-
for (const
|
|
1350
|
-
|
|
1351
|
-
return btoa(
|
|
1372
|
+
let r = "";
|
|
1373
|
+
for (const u of t)
|
|
1374
|
+
r += String.fromCharCode(u);
|
|
1375
|
+
return btoa(r).replace(/\+/g, "-").replace(
|
|
1352
1376
|
/\//g,
|
|
1353
1377
|
"_"
|
|
1354
1378
|
).replace(/=/g, "");
|
|
1355
1379
|
}
|
|
1356
|
-
var
|
|
1357
|
-
function
|
|
1358
|
-
if (t ===
|
|
1359
|
-
return
|
|
1360
|
-
if (t ===
|
|
1361
|
-
return e(
|
|
1380
|
+
var T = "copy", ae = "convert";
|
|
1381
|
+
function xe(e, t, r) {
|
|
1382
|
+
if (t === T)
|
|
1383
|
+
return r;
|
|
1384
|
+
if (t === ae)
|
|
1385
|
+
return e(r);
|
|
1362
1386
|
if (t instanceof Array)
|
|
1363
|
-
return
|
|
1387
|
+
return r.map((n) => xe(e, t[0], n));
|
|
1364
1388
|
if (t instanceof Object) {
|
|
1365
|
-
const
|
|
1366
|
-
for (const [
|
|
1367
|
-
if (
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1389
|
+
const n = {};
|
|
1390
|
+
for (const [s, u] of Object.entries(t)) {
|
|
1391
|
+
if (u.derive) {
|
|
1392
|
+
const i = u.derive(r);
|
|
1393
|
+
i !== void 0 && (r[s] = i);
|
|
1370
1394
|
}
|
|
1371
|
-
if (!(
|
|
1372
|
-
if (
|
|
1373
|
-
throw new Error(`Missing key: ${
|
|
1395
|
+
if (!(s in r)) {
|
|
1396
|
+
if (u.required)
|
|
1397
|
+
throw new Error(`Missing key: ${s}`);
|
|
1374
1398
|
continue;
|
|
1375
1399
|
}
|
|
1376
|
-
if (
|
|
1377
|
-
|
|
1400
|
+
if (r[s] == null) {
|
|
1401
|
+
n[s] = null;
|
|
1378
1402
|
continue;
|
|
1379
1403
|
}
|
|
1380
|
-
|
|
1404
|
+
n[s] = xe(
|
|
1381
1405
|
e,
|
|
1382
|
-
|
|
1383
|
-
|
|
1406
|
+
u.schema,
|
|
1407
|
+
r[s]
|
|
1384
1408
|
);
|
|
1385
1409
|
}
|
|
1386
|
-
return
|
|
1410
|
+
return n;
|
|
1387
1411
|
}
|
|
1388
1412
|
}
|
|
1389
1413
|
function Ze(e, t) {
|
|
@@ -1393,57 +1417,57 @@ function Ze(e, t) {
|
|
|
1393
1417
|
derive: t
|
|
1394
1418
|
};
|
|
1395
1419
|
}
|
|
1396
|
-
function
|
|
1420
|
+
function z(e) {
|
|
1397
1421
|
return {
|
|
1398
1422
|
required: !0,
|
|
1399
1423
|
schema: e
|
|
1400
1424
|
};
|
|
1401
1425
|
}
|
|
1402
|
-
function
|
|
1426
|
+
function q(e) {
|
|
1403
1427
|
return {
|
|
1404
1428
|
required: !1,
|
|
1405
1429
|
schema: e
|
|
1406
1430
|
};
|
|
1407
1431
|
}
|
|
1408
1432
|
var St = {
|
|
1409
|
-
type:
|
|
1410
|
-
id:
|
|
1411
|
-
transports:
|
|
1412
|
-
}, Tt = {
|
|
1413
|
-
appid: M(_),
|
|
1414
|
-
appidExclude: M(_),
|
|
1415
|
-
credProps: M(_)
|
|
1433
|
+
type: z(T),
|
|
1434
|
+
id: z(ae),
|
|
1435
|
+
transports: q(T)
|
|
1416
1436
|
}, Ot = {
|
|
1417
|
-
appid:
|
|
1418
|
-
appidExclude:
|
|
1419
|
-
credProps:
|
|
1420
|
-
},
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1437
|
+
appid: q(T),
|
|
1438
|
+
appidExclude: q(T),
|
|
1439
|
+
credProps: q(T)
|
|
1440
|
+
}, Tt = {
|
|
1441
|
+
appid: q(T),
|
|
1442
|
+
appidExclude: q(T),
|
|
1443
|
+
credProps: q(T)
|
|
1444
|
+
}, Oi = {
|
|
1445
|
+
publicKey: z({
|
|
1446
|
+
rp: z(T),
|
|
1447
|
+
user: z({
|
|
1448
|
+
id: z(ae),
|
|
1449
|
+
name: z(T),
|
|
1450
|
+
displayName: z(T)
|
|
1427
1451
|
}),
|
|
1428
|
-
challenge:
|
|
1429
|
-
pubKeyCredParams:
|
|
1430
|
-
timeout:
|
|
1431
|
-
excludeCredentials:
|
|
1432
|
-
authenticatorSelection:
|
|
1433
|
-
attestation:
|
|
1434
|
-
extensions:
|
|
1452
|
+
challenge: z(ae),
|
|
1453
|
+
pubKeyCredParams: z(T),
|
|
1454
|
+
timeout: q(T),
|
|
1455
|
+
excludeCredentials: q([St]),
|
|
1456
|
+
authenticatorSelection: q(T),
|
|
1457
|
+
attestation: q(T),
|
|
1458
|
+
extensions: q(Ot)
|
|
1435
1459
|
}),
|
|
1436
|
-
signal:
|
|
1437
|
-
},
|
|
1438
|
-
type:
|
|
1439
|
-
id:
|
|
1440
|
-
rawId:
|
|
1441
|
-
authenticatorAttachment:
|
|
1442
|
-
response:
|
|
1443
|
-
clientDataJSON:
|
|
1444
|
-
attestationObject:
|
|
1460
|
+
signal: q(T)
|
|
1461
|
+
}, Ti = {
|
|
1462
|
+
type: z(T),
|
|
1463
|
+
id: z(T),
|
|
1464
|
+
rawId: z(ae),
|
|
1465
|
+
authenticatorAttachment: q(T),
|
|
1466
|
+
response: z({
|
|
1467
|
+
clientDataJSON: z(ae),
|
|
1468
|
+
attestationObject: z(ae),
|
|
1445
1469
|
transports: Ze(
|
|
1446
|
-
|
|
1470
|
+
T,
|
|
1447
1471
|
(e) => {
|
|
1448
1472
|
var t;
|
|
1449
1473
|
return ((t = e.getTransports) == null ? void 0 : t.call(e)) || [];
|
|
@@ -1451,67 +1475,67 @@ var St = {
|
|
|
1451
1475
|
)
|
|
1452
1476
|
}),
|
|
1453
1477
|
clientExtensionResults: Ze(
|
|
1454
|
-
|
|
1478
|
+
Tt,
|
|
1455
1479
|
(e) => e.getClientExtensionResults()
|
|
1456
1480
|
)
|
|
1457
|
-
},
|
|
1458
|
-
mediation:
|
|
1459
|
-
publicKey:
|
|
1460
|
-
challenge:
|
|
1461
|
-
timeout:
|
|
1462
|
-
rpId:
|
|
1463
|
-
allowCredentials:
|
|
1464
|
-
userVerification:
|
|
1465
|
-
extensions:
|
|
1481
|
+
}, Pi = {
|
|
1482
|
+
mediation: q(T),
|
|
1483
|
+
publicKey: z({
|
|
1484
|
+
challenge: z(ae),
|
|
1485
|
+
timeout: q(T),
|
|
1486
|
+
rpId: q(T),
|
|
1487
|
+
allowCredentials: q([St]),
|
|
1488
|
+
userVerification: q(T),
|
|
1489
|
+
extensions: q(Ot)
|
|
1466
1490
|
}),
|
|
1467
|
-
signal:
|
|
1468
|
-
},
|
|
1469
|
-
type:
|
|
1470
|
-
id:
|
|
1471
|
-
rawId:
|
|
1472
|
-
authenticatorAttachment:
|
|
1473
|
-
response:
|
|
1474
|
-
clientDataJSON:
|
|
1475
|
-
authenticatorData:
|
|
1476
|
-
signature:
|
|
1477
|
-
userHandle:
|
|
1491
|
+
signal: q(T)
|
|
1492
|
+
}, Ii = {
|
|
1493
|
+
type: z(T),
|
|
1494
|
+
id: z(T),
|
|
1495
|
+
rawId: z(ae),
|
|
1496
|
+
authenticatorAttachment: q(T),
|
|
1497
|
+
response: z({
|
|
1498
|
+
clientDataJSON: z(ae),
|
|
1499
|
+
authenticatorData: z(ae),
|
|
1500
|
+
signature: z(ae),
|
|
1501
|
+
userHandle: z(ae)
|
|
1478
1502
|
}),
|
|
1479
1503
|
clientExtensionResults: Ze(
|
|
1480
|
-
|
|
1504
|
+
Tt,
|
|
1481
1505
|
(e) => e.getClientExtensionResults()
|
|
1482
1506
|
)
|
|
1483
1507
|
};
|
|
1484
|
-
function
|
|
1485
|
-
return
|
|
1508
|
+
function zi(e) {
|
|
1509
|
+
return xe(xt, Oi, e);
|
|
1486
1510
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return
|
|
1511
|
+
function Ni(e) {
|
|
1512
|
+
return xe(
|
|
1489
1513
|
_t,
|
|
1490
|
-
|
|
1514
|
+
Ti,
|
|
1491
1515
|
e
|
|
1492
1516
|
);
|
|
1493
1517
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return
|
|
1518
|
+
function Mi(e) {
|
|
1519
|
+
return xe(xt, Pi, e);
|
|
1496
1520
|
}
|
|
1497
|
-
function
|
|
1498
|
-
return
|
|
1521
|
+
function ji(e) {
|
|
1522
|
+
return xe(
|
|
1499
1523
|
_t,
|
|
1500
|
-
|
|
1524
|
+
Ii,
|
|
1501
1525
|
e
|
|
1502
1526
|
);
|
|
1503
1527
|
}
|
|
1504
|
-
async function
|
|
1528
|
+
async function Ri(e) {
|
|
1505
1529
|
const t = await navigator.credentials.create(
|
|
1506
1530
|
e
|
|
1507
1531
|
);
|
|
1508
|
-
return t.toJSON = () =>
|
|
1532
|
+
return t.toJSON = () => Ni(t), t;
|
|
1509
1533
|
}
|
|
1510
|
-
async function
|
|
1534
|
+
async function Li(e) {
|
|
1511
1535
|
const t = await navigator.credentials.get(
|
|
1512
1536
|
e
|
|
1513
1537
|
);
|
|
1514
|
-
return t.toJSON = () =>
|
|
1538
|
+
return t.toJSON = () => ji(t), t;
|
|
1515
1539
|
}
|
|
1516
1540
|
function Ye(e) {
|
|
1517
1541
|
this.message = e;
|
|
@@ -1520,10 +1544,10 @@ Ye.prototype = new Error(), Ye.prototype.name = "InvalidCharacterError";
|
|
|
1520
1544
|
var Dt = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
|
|
1521
1545
|
var t = String(e).replace(/=+$/, "");
|
|
1522
1546
|
if (t.length % 4 == 1) throw new Ye("'atob' failed: The string to be decoded is not correctly encoded.");
|
|
1523
|
-
for (var
|
|
1524
|
-
return
|
|
1547
|
+
for (var r, n, s = 0, u = 0, i = ""; n = t.charAt(u++); ~n && (r = s % 4 ? 64 * r + n : n, s++ % 4) ? i += String.fromCharCode(255 & r >> (-2 * s & 6)) : 0) n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);
|
|
1548
|
+
return i;
|
|
1525
1549
|
};
|
|
1526
|
-
function
|
|
1550
|
+
function qi(e) {
|
|
1527
1551
|
var t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1528
1552
|
switch (t.length % 4) {
|
|
1529
1553
|
case 0:
|
|
@@ -1538,51 +1562,51 @@ function La(e) {
|
|
|
1538
1562
|
throw "Illegal base64url string!";
|
|
1539
1563
|
}
|
|
1540
1564
|
try {
|
|
1541
|
-
return function(
|
|
1542
|
-
return decodeURIComponent(Dt(
|
|
1543
|
-
var
|
|
1544
|
-
return
|
|
1565
|
+
return function(r) {
|
|
1566
|
+
return decodeURIComponent(Dt(r).replace(/(.)/g, function(n, s) {
|
|
1567
|
+
var u = s.charCodeAt(0).toString(16).toUpperCase();
|
|
1568
|
+
return u.length < 2 && (u = "0" + u), "%" + u;
|
|
1545
1569
|
}));
|
|
1546
1570
|
}(t);
|
|
1547
1571
|
} catch {
|
|
1548
1572
|
return Dt(t);
|
|
1549
1573
|
}
|
|
1550
1574
|
}
|
|
1551
|
-
function
|
|
1575
|
+
function Le(e) {
|
|
1552
1576
|
this.message = e;
|
|
1553
1577
|
}
|
|
1554
|
-
function
|
|
1555
|
-
if (typeof e != "string") throw new
|
|
1556
|
-
var
|
|
1578
|
+
function Ui(e, t) {
|
|
1579
|
+
if (typeof e != "string") throw new Le("Invalid token specified");
|
|
1580
|
+
var r = (t = t || {}).header === !0 ? 0 : 1;
|
|
1557
1581
|
try {
|
|
1558
|
-
return JSON.parse(
|
|
1559
|
-
} catch (
|
|
1560
|
-
throw new
|
|
1582
|
+
return JSON.parse(qi(e.split(".")[r]));
|
|
1583
|
+
} catch (n) {
|
|
1584
|
+
throw new Le("Invalid token specified: " + n.message);
|
|
1561
1585
|
}
|
|
1562
1586
|
}
|
|
1563
|
-
|
|
1564
|
-
const
|
|
1565
|
-
function
|
|
1566
|
-
const e = localStorage.getItem(
|
|
1587
|
+
Le.prototype = new Error(), Le.prototype.name = "InvalidTokenError";
|
|
1588
|
+
const Ie = "spartan-token";
|
|
1589
|
+
function Pt() {
|
|
1590
|
+
const e = localStorage.getItem(Ie);
|
|
1567
1591
|
let t = null;
|
|
1568
1592
|
if (e)
|
|
1569
1593
|
try {
|
|
1570
|
-
if (t =
|
|
1594
|
+
if (t = Ui(e), t.exp > Ki())
|
|
1571
1595
|
return t;
|
|
1572
|
-
localStorage.removeItem(
|
|
1573
|
-
} catch (
|
|
1574
|
-
console.error("Error decoding token",
|
|
1596
|
+
localStorage.removeItem(Ie);
|
|
1597
|
+
} catch (r) {
|
|
1598
|
+
console.error("Error decoding token", r), localStorage.removeItem(Ie);
|
|
1575
1599
|
}
|
|
1576
1600
|
return null;
|
|
1577
1601
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const e = localStorage.getItem(
|
|
1602
|
+
function Ji() {
|
|
1603
|
+
const e = localStorage.getItem(Ie);
|
|
1580
1604
|
return e || null;
|
|
1581
1605
|
}
|
|
1582
|
-
function
|
|
1606
|
+
function Ki() {
|
|
1583
1607
|
return Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3);
|
|
1584
1608
|
}
|
|
1585
|
-
var
|
|
1609
|
+
var Gi = /* @__PURE__ */ B(`<form class=login-frame><style>.login-frame {
|
|
1586
1610
|
display: flex;
|
|
1587
1611
|
flex-direction: column;
|
|
1588
1612
|
justify-content: center;
|
|
@@ -1647,8 +1671,49 @@ var Va = /* @__PURE__ */ x(`<form class=login-frame><style>.login-frame {
|
|
|
1647
1671
|
.centered-text {
|
|
1648
1672
|
text-align: center;
|
|
1649
1673
|
}
|
|
1650
|
-
|
|
1651
|
-
|
|
1674
|
+
|
|
1675
|
+
.social-divider {
|
|
1676
|
+
display: flex;
|
|
1677
|
+
align-items: center;
|
|
1678
|
+
margin: 20px 0 4px 0;
|
|
1679
|
+
color: #888;
|
|
1680
|
+
font-size: 0.85em;
|
|
1681
|
+
}
|
|
1682
|
+
.social-divider::before, .social-divider::after {
|
|
1683
|
+
content: '';
|
|
1684
|
+
flex: 1;
|
|
1685
|
+
border-bottom: 1px solid #ccc;
|
|
1686
|
+
}
|
|
1687
|
+
.social-divider span {
|
|
1688
|
+
margin: 0 10px;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
.social-btn {
|
|
1692
|
+
display: flex;
|
|
1693
|
+
align-items: center;
|
|
1694
|
+
justify-content: center;
|
|
1695
|
+
gap: 10px;
|
|
1696
|
+
margin: 8px 0 0 0;
|
|
1697
|
+
padding: 10px;
|
|
1698
|
+
width: 100%;
|
|
1699
|
+
border: 1px solid #ccc;
|
|
1700
|
+
border-radius: 10px;
|
|
1701
|
+
background: #fff;
|
|
1702
|
+
cursor: pointer;
|
|
1703
|
+
font-size: inherit;
|
|
1704
|
+
font-family: inherit;
|
|
1705
|
+
box-sizing: border-box;
|
|
1706
|
+
color: #333;
|
|
1707
|
+
}
|
|
1708
|
+
.social-btn:hover:not(:disabled) {
|
|
1709
|
+
background-color: #f5f5f5;
|
|
1710
|
+
}
|
|
1711
|
+
.social-btn:disabled {
|
|
1712
|
+
opacity: 0.6;
|
|
1713
|
+
cursor: not-allowed;
|
|
1714
|
+
}
|
|
1715
|
+
</style><style></style><h1></h1><input type=text><button type=submit>`), Vi = /* @__PURE__ */ B("<span class=error-message>"), Ve = /* @__PURE__ */ B("<span>"), ht = /* @__PURE__ */ B("<input type=password>"), Hi = /* @__PURE__ */ B("<p>"), Wi = /* @__PURE__ */ B("<select>"), Zi = /* @__PURE__ */ B("<option> (<!>)"), Yi = /* @__PURE__ */ B("<input type=text>"), Xi = /* @__PURE__ */ B("<input type=text autocomplete=one-time-code>"), Qi = /* @__PURE__ */ B("<input type=password autocomplete=new-password>"), ea = /* @__PURE__ */ B("<span class=checkbox-wrapper><input type=checkbox><span> "), He = /* @__PURE__ */ B("<a class=centered-text href=#>"), ta = /* @__PURE__ */ B("<div class=social-divider><span>"), ra = /* @__PURE__ */ B("<button type=button class=social-btn>"), na = /* @__PURE__ */ B('<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>'), sa = /* @__PURE__ */ B('<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>'), ua = /* @__PURE__ */ B('<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>'), ia = /* @__PURE__ */ B('<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>');
|
|
1716
|
+
const aa = {
|
|
1652
1717
|
domain: "http://127.0.0.1:11000",
|
|
1653
1718
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
1654
1719
|
// defaults to the admin sector
|
|
@@ -1657,22 +1722,58 @@ const ti = {
|
|
|
1657
1722
|
locale: "en",
|
|
1658
1723
|
redirect: ""
|
|
1659
1724
|
};
|
|
1660
|
-
tt("spartan-login",
|
|
1661
|
-
const [t,
|
|
1662
|
-
let
|
|
1725
|
+
tt("spartan-login", aa, (e) => {
|
|
1726
|
+
const [t, r] = $((e.startMode || "password").toLowerCase()), [n, s] = $(""), [u, i] = $(""), [a, F] = $(""), [k, p] = $(""), [S] = $(e.redirect), [X, te] = $(!1), [he, N] = $(!1), [Q, W] = $(!1), [re, j] = $(""), [H, J] = $(""), [le, de] = $([]), [De, _] = $(""), [K, fe] = $([]), [A, ne] = $(""), b = rt(e.locale);
|
|
1727
|
+
let Z, ge;
|
|
1663
1728
|
try {
|
|
1664
|
-
|
|
1729
|
+
ge = e.styles;
|
|
1665
1730
|
} catch {
|
|
1666
|
-
|
|
1667
|
-
}
|
|
1668
|
-
console.log(
|
|
1669
|
-
|
|
1731
|
+
ge = "";
|
|
1732
|
+
}
|
|
1733
|
+
console.log(ge), Xe(async () => {
|
|
1734
|
+
const o = new URLSearchParams(window.location.search);
|
|
1735
|
+
if (o.get("error")) {
|
|
1736
|
+
history.replaceState({}, "", window.location.pathname);
|
|
1737
|
+
const y = o.get("error_description");
|
|
1738
|
+
p(y || b.i18n("sa-social-error")), we(), ye();
|
|
1739
|
+
return;
|
|
1740
|
+
}
|
|
1741
|
+
const f = o.get("code");
|
|
1742
|
+
if (f) {
|
|
1743
|
+
history.replaceState({}, "", window.location.pathname);
|
|
1744
|
+
try {
|
|
1745
|
+
const y = await fetch(`${e.domain}/api/v1/oauth/exchange`, {
|
|
1746
|
+
method: "POST",
|
|
1747
|
+
mode: "cors",
|
|
1748
|
+
cache: "no-cache",
|
|
1749
|
+
headers: {
|
|
1750
|
+
"Content-Type": "application/json"
|
|
1751
|
+
},
|
|
1752
|
+
body: JSON.stringify({
|
|
1753
|
+
code: f
|
|
1754
|
+
})
|
|
1755
|
+
});
|
|
1756
|
+
if (!y.ok) throw new Error(b.i18n("sa-social-error"));
|
|
1757
|
+
const M = await y.json();
|
|
1758
|
+
localStorage.setItem("spartan-token", M.token), Z.getRootNode().host.dispatchEvent(new CustomEvent("spartan-login", {
|
|
1759
|
+
bubbles: !0,
|
|
1760
|
+
cancelable: !0,
|
|
1761
|
+
detail: {
|
|
1762
|
+
token: M.token
|
|
1763
|
+
}
|
|
1764
|
+
})), e.redirect !== "" && (window.location.href = e.redirect);
|
|
1765
|
+
} catch (y) {
|
|
1766
|
+
p(y.message || b.i18n("sa-social-error"));
|
|
1767
|
+
}
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
if (Pt() && e.redirect !== "" && window.location.pathname !== e.redirect) {
|
|
1670
1771
|
window.location.href = e.redirect;
|
|
1671
1772
|
return;
|
|
1672
1773
|
}
|
|
1673
|
-
|
|
1774
|
+
we(), ye();
|
|
1674
1775
|
});
|
|
1675
|
-
function
|
|
1776
|
+
function we() {
|
|
1676
1777
|
fetch(`${e.domain}/api/v1/sectors/${e.sector}/publicsettings`, {
|
|
1677
1778
|
method: "GET",
|
|
1678
1779
|
mode: "cors",
|
|
@@ -1680,167 +1781,205 @@ tt("spartan-login", ti, (e) => {
|
|
|
1680
1781
|
headers: {
|
|
1681
1782
|
"Content-Type": "application/json"
|
|
1682
1783
|
}
|
|
1683
|
-
}).then((
|
|
1684
|
-
if (
|
|
1685
|
-
return
|
|
1784
|
+
}).then((o) => {
|
|
1785
|
+
if (o.ok)
|
|
1786
|
+
return o.json();
|
|
1686
1787
|
throw new Error("Network response was not ok.");
|
|
1687
|
-
}).then((
|
|
1688
|
-
console.log(
|
|
1689
|
-
}).catch((
|
|
1690
|
-
console.log(
|
|
1788
|
+
}).then((o) => {
|
|
1789
|
+
console.log(o), te(o.SelfSignUpAllowed);
|
|
1790
|
+
}).catch((o) => {
|
|
1791
|
+
console.log(o), p(o.message);
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
function ye() {
|
|
1795
|
+
fetch(`${e.domain}/api/v1/sectors/${e.sector}/oauth/providers`, {
|
|
1796
|
+
method: "GET",
|
|
1797
|
+
mode: "cors",
|
|
1798
|
+
cache: "no-cache"
|
|
1799
|
+
}).then((o) => {
|
|
1800
|
+
if (o.ok) return o.json();
|
|
1801
|
+
throw new Error("Failed to load social providers");
|
|
1802
|
+
}).then((o) => {
|
|
1803
|
+
const D = (o.providers || []).filter((f) => f.enabled);
|
|
1804
|
+
fe(D);
|
|
1805
|
+
}).catch(() => {
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
function Ce(o) {
|
|
1809
|
+
if (A()) return;
|
|
1810
|
+
ne(o), p("");
|
|
1811
|
+
const D = window.location.origin + window.location.pathname;
|
|
1812
|
+
fetch(`${e.domain}/api/v1/oauth/${o}/initiate`, {
|
|
1813
|
+
method: "POST",
|
|
1814
|
+
mode: "cors",
|
|
1815
|
+
cache: "no-cache",
|
|
1816
|
+
headers: {
|
|
1817
|
+
"Content-Type": "application/json"
|
|
1818
|
+
},
|
|
1819
|
+
body: JSON.stringify({
|
|
1820
|
+
sectorID: e.sector,
|
|
1821
|
+
redirectURI: D
|
|
1822
|
+
})
|
|
1823
|
+
}).then((f) => {
|
|
1824
|
+
if (f.ok) return f.json();
|
|
1825
|
+
throw new Error(b.i18n("sa-social-error"));
|
|
1826
|
+
}).then((f) => {
|
|
1827
|
+
window.location.href = f.authURL;
|
|
1828
|
+
}).catch((f) => {
|
|
1829
|
+
ne(""), p(f.message);
|
|
1691
1830
|
});
|
|
1692
1831
|
}
|
|
1693
|
-
function
|
|
1694
|
-
|
|
1832
|
+
function Ae(o) {
|
|
1833
|
+
o.preventDefault(), console.log("login"), p(""), t() === "password" ? me() : t() === "webauthn" ? Se() : t() === "otp-pick" ? E(De()) : t() === "otp" ? v() : t() === "reset-email" ? P() : t() === "reset-code" && L();
|
|
1695
1834
|
}
|
|
1696
|
-
function
|
|
1697
|
-
|
|
1835
|
+
function _e(o) {
|
|
1836
|
+
o.preventDefault(), console.log("signup"), p(""), N(!1), fetch(`${e.domain}/api/v1/users`, {
|
|
1698
1837
|
method: "POST",
|
|
1699
1838
|
mode: "cors",
|
|
1700
1839
|
cache: "no-cache",
|
|
1701
1840
|
body: JSON.stringify({
|
|
1702
|
-
username:
|
|
1703
|
-
password:
|
|
1841
|
+
username: n(),
|
|
1842
|
+
password: u(),
|
|
1704
1843
|
sectorID: e.sector
|
|
1705
1844
|
})
|
|
1706
|
-
}).then((
|
|
1707
|
-
if (
|
|
1708
|
-
return
|
|
1709
|
-
throw new Error(
|
|
1710
|
-
}).then((
|
|
1711
|
-
console.log(
|
|
1712
|
-
}).catch((
|
|
1713
|
-
|
|
1845
|
+
}).then((D) => {
|
|
1846
|
+
if (D.ok)
|
|
1847
|
+
return D.json();
|
|
1848
|
+
throw new Error(b.i18n("sa-error-creating-user"));
|
|
1849
|
+
}).then((D) => {
|
|
1850
|
+
console.log(D), N(!0), r(e.startMode);
|
|
1851
|
+
}).catch((D) => {
|
|
1852
|
+
N(!1), p(D.message), console.log(D);
|
|
1714
1853
|
});
|
|
1715
1854
|
}
|
|
1716
|
-
function
|
|
1855
|
+
function Se() {
|
|
1717
1856
|
console.log("webauthnLogin"), fetch(`${e.domain}/api/v1/login/webauthn/begin`, {
|
|
1718
1857
|
method: "POST",
|
|
1719
1858
|
mode: "cors",
|
|
1720
1859
|
cache: "no-cache",
|
|
1721
1860
|
body: JSON.stringify({
|
|
1722
|
-
username:
|
|
1861
|
+
username: n(),
|
|
1723
1862
|
sectorID: e.sector
|
|
1724
1863
|
})
|
|
1725
|
-
}).then((
|
|
1726
|
-
if (
|
|
1727
|
-
return
|
|
1728
|
-
throw
|
|
1729
|
-
}).then((
|
|
1730
|
-
console.log(
|
|
1731
|
-
const
|
|
1732
|
-
return console.log("Parsed WebAuthn request options:",
|
|
1733
|
-
const
|
|
1734
|
-
let
|
|
1735
|
-
return
|
|
1864
|
+
}).then((o) => {
|
|
1865
|
+
if (o.ok)
|
|
1866
|
+
return o.json();
|
|
1867
|
+
throw o.status === 401 ? (r("password"), p(b.i18n("webauthn-not-enrolled")), new Error(b.i18n("webauthn-not-enrolled"))) : new Error(`${o.status} ${o.statusText}: Network response was not ok.`);
|
|
1868
|
+
}).then((o) => {
|
|
1869
|
+
console.log(o);
|
|
1870
|
+
const D = Mi(o.CredentialAssertion);
|
|
1871
|
+
return console.log("Parsed WebAuthn request options:", D), Li(D).then((f) => {
|
|
1872
|
+
const x = JSON.stringify(f);
|
|
1873
|
+
let y = JSON.parse(x);
|
|
1874
|
+
return y.transactionID = o.TransactionID, y;
|
|
1736
1875
|
});
|
|
1737
|
-
}).then((
|
|
1876
|
+
}).then((o) => fetch(`${e.domain}/api/v1/login/webauthn/finish`, {
|
|
1738
1877
|
method: "POST",
|
|
1739
1878
|
mode: "cors",
|
|
1740
1879
|
cache: "no-cache",
|
|
1741
|
-
body: JSON.stringify(
|
|
1742
|
-
})).then(
|
|
1743
|
-
p(
|
|
1880
|
+
body: JSON.stringify(o)
|
|
1881
|
+
})).then(ve).catch((o) => {
|
|
1882
|
+
p(o.message), console.log(o);
|
|
1744
1883
|
});
|
|
1745
1884
|
}
|
|
1746
|
-
function
|
|
1885
|
+
function me() {
|
|
1747
1886
|
console.log("password login"), fetch(e.domain + "/api/v1/login/password", {
|
|
1748
1887
|
method: "post",
|
|
1749
1888
|
mode: "cors",
|
|
1750
1889
|
cache: "no-cache",
|
|
1751
1890
|
body: JSON.stringify({
|
|
1752
|
-
username:
|
|
1753
|
-
password:
|
|
1891
|
+
username: n(),
|
|
1892
|
+
password: u(),
|
|
1754
1893
|
sectorID: e.sector
|
|
1755
1894
|
})
|
|
1756
|
-
}).then(
|
|
1895
|
+
}).then(ve);
|
|
1757
1896
|
}
|
|
1758
|
-
async function
|
|
1759
|
-
let
|
|
1760
|
-
return
|
|
1761
|
-
if (
|
|
1762
|
-
return
|
|
1897
|
+
async function ve(o) {
|
|
1898
|
+
let D = Promise.resolve(o);
|
|
1899
|
+
return D.then((f) => {
|
|
1900
|
+
if (o.ok)
|
|
1901
|
+
return o.json();
|
|
1763
1902
|
throw new Error("Network response was not ok.");
|
|
1764
|
-
}).then((
|
|
1765
|
-
if (console.log(
|
|
1766
|
-
|
|
1903
|
+
}).then((f) => {
|
|
1904
|
+
if (console.log(f), localStorage.setItem("spartan-txid", f.transactionID), !f.token) {
|
|
1905
|
+
f.challengeType.indexOf("otp") !== -1 ? Fe() : f.challengeType.indexOf("webauthn") !== -1 ? (r("webauthn"), p(b.i18n("sa-webauthn-required"))) : p(b.i18n("sa-unknown-challenge"));
|
|
1767
1906
|
return;
|
|
1768
1907
|
}
|
|
1769
|
-
localStorage.setItem("spartan-token",
|
|
1770
|
-
const
|
|
1908
|
+
localStorage.setItem("spartan-token", f.token);
|
|
1909
|
+
const x = new CustomEvent("spartan-login", {
|
|
1771
1910
|
bubbles: !0,
|
|
1772
1911
|
cancelable: !0,
|
|
1773
1912
|
detail: {
|
|
1774
|
-
token:
|
|
1775
|
-
transactionID:
|
|
1913
|
+
token: f.token,
|
|
1914
|
+
transactionID: f.transactionID
|
|
1776
1915
|
}
|
|
1777
1916
|
});
|
|
1778
|
-
|
|
1779
|
-
}).catch((
|
|
1780
|
-
|
|
1781
|
-
console.log(
|
|
1782
|
-
}).catch((
|
|
1783
|
-
console.log(
|
|
1784
|
-
}), console.log(
|
|
1785
|
-
}),
|
|
1786
|
-
}
|
|
1787
|
-
function
|
|
1788
|
-
const
|
|
1789
|
-
fetch(e.domain + `/api/v1/otp/${encodeURIComponent(
|
|
1917
|
+
Z.getRootNode().host.dispatchEvent(x), S() !== "" && (window.location.href = S());
|
|
1918
|
+
}).catch((f) => {
|
|
1919
|
+
f.json().then((x) => {
|
|
1920
|
+
console.log(x.message), p(x.message);
|
|
1921
|
+
}).catch((x) => {
|
|
1922
|
+
console.log(x);
|
|
1923
|
+
}), console.log(f);
|
|
1924
|
+
}), D;
|
|
1925
|
+
}
|
|
1926
|
+
function Fe() {
|
|
1927
|
+
const o = localStorage.getItem("spartan-txid") || "";
|
|
1928
|
+
fetch(e.domain + `/api/v1/otp/${encodeURIComponent(n())}?transactionID=${encodeURIComponent(o)}§orID=${encodeURIComponent(e.sector)}`, {
|
|
1790
1929
|
method: "get",
|
|
1791
1930
|
mode: "cors",
|
|
1792
1931
|
cache: "no-cache"
|
|
1793
|
-
}).then((
|
|
1794
|
-
if (
|
|
1795
|
-
return
|
|
1796
|
-
throw new Error(
|
|
1797
|
-
}).then((
|
|
1798
|
-
const
|
|
1799
|
-
if (
|
|
1800
|
-
p(
|
|
1932
|
+
}).then((D) => {
|
|
1933
|
+
if (D.ok)
|
|
1934
|
+
return D.json();
|
|
1935
|
+
throw new Error(b.i18n("error-otp-list"));
|
|
1936
|
+
}).then((D) => {
|
|
1937
|
+
const f = D.registrations || [];
|
|
1938
|
+
if (f.length === 0) {
|
|
1939
|
+
p(b.i18n("sa-otp-no-registrations"));
|
|
1801
1940
|
return;
|
|
1802
1941
|
}
|
|
1803
|
-
|
|
1804
|
-
}).catch((
|
|
1805
|
-
p(
|
|
1942
|
+
f.length === 1 ? E(f[0].ID || "") : (de(f), _(f[0].ID || ""), r("otp-pick"), p(""));
|
|
1943
|
+
}).catch((D) => {
|
|
1944
|
+
p(D.message), console.log(D);
|
|
1806
1945
|
});
|
|
1807
1946
|
}
|
|
1808
|
-
function
|
|
1809
|
-
console.log("begin OTP, registrationID:",
|
|
1947
|
+
function E(o) {
|
|
1948
|
+
console.log("begin OTP, registrationID:", o), fetch(e.domain + "/api/v1/login/otp/begin", {
|
|
1810
1949
|
method: "post",
|
|
1811
1950
|
mode: "cors",
|
|
1812
1951
|
cache: "no-cache",
|
|
1813
1952
|
body: JSON.stringify({
|
|
1814
|
-
username:
|
|
1953
|
+
username: n(),
|
|
1815
1954
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
1816
|
-
registrationID:
|
|
1955
|
+
registrationID: o,
|
|
1817
1956
|
sectorID: e.sector
|
|
1818
1957
|
})
|
|
1819
|
-
}).then((
|
|
1820
|
-
if (
|
|
1821
|
-
return
|
|
1822
|
-
throw new Error(`${
|
|
1823
|
-
}).then((
|
|
1824
|
-
console.log(
|
|
1825
|
-
}).catch((
|
|
1826
|
-
p(
|
|
1958
|
+
}).then((D) => {
|
|
1959
|
+
if (D.ok)
|
|
1960
|
+
return D.json();
|
|
1961
|
+
throw new Error(`${D.status} ${D.statusText}`);
|
|
1962
|
+
}).then((D) => {
|
|
1963
|
+
console.log(D), D.transactionID && localStorage.setItem("spartan-txid", D.transactionID), F(""), p(""), r("otp");
|
|
1964
|
+
}).catch((D) => {
|
|
1965
|
+
p(D.message), console.log(D);
|
|
1827
1966
|
});
|
|
1828
1967
|
}
|
|
1829
|
-
function
|
|
1968
|
+
function v() {
|
|
1830
1969
|
console.log("OTP login submit"), fetch(e.domain + "/api/v1/login/otp", {
|
|
1831
1970
|
method: "post",
|
|
1832
1971
|
mode: "cors",
|
|
1833
1972
|
cache: "no-cache",
|
|
1834
1973
|
body: JSON.stringify({
|
|
1835
|
-
username:
|
|
1836
|
-
password:
|
|
1974
|
+
username: n(),
|
|
1975
|
+
password: a(),
|
|
1837
1976
|
transactionID: localStorage.getItem("spartan-txid"),
|
|
1838
1977
|
sectorID: e.sector
|
|
1839
1978
|
})
|
|
1840
|
-
}).then(
|
|
1979
|
+
}).then(ve);
|
|
1841
1980
|
}
|
|
1842
|
-
function
|
|
1843
|
-
console.log("begin password reset"), p(""),
|
|
1981
|
+
function P() {
|
|
1982
|
+
console.log("begin password reset"), p(""), W(!1), fetch(`${e.domain}/api/v1/password/reset/begin`, {
|
|
1844
1983
|
method: "POST",
|
|
1845
1984
|
mode: "cors",
|
|
1846
1985
|
cache: "no-cache",
|
|
@@ -1848,20 +1987,20 @@ tt("spartan-login", ti, (e) => {
|
|
|
1848
1987
|
"Content-Type": "application/json"
|
|
1849
1988
|
},
|
|
1850
1989
|
body: JSON.stringify({
|
|
1851
|
-
email:
|
|
1990
|
+
email: n(),
|
|
1852
1991
|
sectorID: e.sector
|
|
1853
1992
|
})
|
|
1854
|
-
}).then((
|
|
1855
|
-
if (
|
|
1856
|
-
return
|
|
1857
|
-
throw new Error(
|
|
1858
|
-
}).then((
|
|
1859
|
-
console.log(
|
|
1860
|
-
}).catch((
|
|
1861
|
-
p(
|
|
1993
|
+
}).then((o) => {
|
|
1994
|
+
if (o.ok)
|
|
1995
|
+
return o.json();
|
|
1996
|
+
throw new Error(b.i18n("sa-reset-error"));
|
|
1997
|
+
}).then((o) => {
|
|
1998
|
+
console.log(o), p(b.i18n("sa-reset-email-sent")), j(""), J(""), r("reset-code");
|
|
1999
|
+
}).catch((o) => {
|
|
2000
|
+
p(o.message), console.log(o);
|
|
1862
2001
|
});
|
|
1863
2002
|
}
|
|
1864
|
-
function
|
|
2003
|
+
function L() {
|
|
1865
2004
|
console.log("complete password reset"), p(""), fetch(`${e.domain}/api/v1/password/reset/complete`, {
|
|
1866
2005
|
method: "POST",
|
|
1867
2006
|
mode: "cors",
|
|
@@ -1870,115 +2009,142 @@ tt("spartan-login", ti, (e) => {
|
|
|
1870
2009
|
"Content-Type": "application/json"
|
|
1871
2010
|
},
|
|
1872
2011
|
body: JSON.stringify({
|
|
1873
|
-
email:
|
|
1874
|
-
code:
|
|
1875
|
-
newPassword:
|
|
2012
|
+
email: n(),
|
|
2013
|
+
code: re().toUpperCase().trim(),
|
|
2014
|
+
newPassword: H(),
|
|
1876
2015
|
sectorID: e.sector
|
|
1877
2016
|
})
|
|
1878
|
-
}).then((
|
|
1879
|
-
if (
|
|
1880
|
-
return
|
|
1881
|
-
throw
|
|
1882
|
-
}).then((
|
|
1883
|
-
console.log(
|
|
1884
|
-
}).catch((
|
|
1885
|
-
p(
|
|
2017
|
+
}).then((o) => {
|
|
2018
|
+
if (o.ok)
|
|
2019
|
+
return o.json();
|
|
2020
|
+
throw o.status === 400 ? new Error(b.i18n("sa-reset-error-code")) : new Error(b.i18n("sa-reset-error"));
|
|
2021
|
+
}).then((o) => {
|
|
2022
|
+
console.log(o), W(!0), j(""), J(""), i(""), r(e.startMode);
|
|
2023
|
+
}).catch((o) => {
|
|
2024
|
+
p(o.message), console.log(o);
|
|
1886
2025
|
});
|
|
1887
2026
|
}
|
|
1888
2027
|
return (() => {
|
|
1889
|
-
var
|
|
1890
|
-
return typeof
|
|
1891
|
-
t() === "sign-up" ?
|
|
1892
|
-
}),
|
|
1893
|
-
var
|
|
1894
|
-
return () =>
|
|
1895
|
-
})()),
|
|
1896
|
-
var
|
|
1897
|
-
return
|
|
1898
|
-
})(),
|
|
1899
|
-
var
|
|
1900
|
-
return () =>
|
|
1901
|
-
var
|
|
1902
|
-
return c
|
|
2028
|
+
var o = Gi(), D = o.firstChild, f = D.nextSibling, x = f.nextSibling, y = x.nextSibling, M = y.nextSibling, R = Z;
|
|
2029
|
+
return typeof R == "function" ? Et(R, o) : Z = o, o.addEventListener("submit", (m) => {
|
|
2030
|
+
t() === "sign-up" ? _e(m) : Ae(m);
|
|
2031
|
+
}), d(f, ge), d(x, (() => {
|
|
2032
|
+
var m = C(() => t() === "reset-email" || t() === "reset-code");
|
|
2033
|
+
return () => m() ? b.i18n("sa-reset-password") : b.i18n("sa-login");
|
|
2034
|
+
})()), d(o, k && (() => {
|
|
2035
|
+
var m = Vi();
|
|
2036
|
+
return d(m, k), m;
|
|
2037
|
+
})(), y), d(o, (() => {
|
|
2038
|
+
var m = C(() => !!he());
|
|
2039
|
+
return () => m() && (() => {
|
|
2040
|
+
var c = Ve();
|
|
2041
|
+
return d(c, () => b.i18n("sa-signup-complete")), c;
|
|
1903
2042
|
})();
|
|
1904
|
-
})(),
|
|
1905
|
-
var
|
|
1906
|
-
return () =>
|
|
1907
|
-
var
|
|
1908
|
-
return c
|
|
2043
|
+
})(), y), d(o, (() => {
|
|
2044
|
+
var m = C(() => !!Q());
|
|
2045
|
+
return () => m() && (() => {
|
|
2046
|
+
var c = Ve();
|
|
2047
|
+
return d(c, () => b.i18n("sa-reset-success")), c;
|
|
1909
2048
|
})();
|
|
1910
|
-
})(),
|
|
1911
|
-
var
|
|
1912
|
-
return () =>
|
|
1913
|
-
var
|
|
1914
|
-
return
|
|
1915
|
-
})()),
|
|
1916
|
-
var
|
|
1917
|
-
return c
|
|
2049
|
+
})(), y), y.$$input = (m) => s(m.currentTarget.value), d(o, (() => {
|
|
2050
|
+
var m = C(() => t() !== "sign-up");
|
|
2051
|
+
return () => m() && [C(() => C(() => t() === "password")() && (() => {
|
|
2052
|
+
var c = ht();
|
|
2053
|
+
return c.$$input = (g) => i(g.currentTarget.value), O(() => oe(c, "placeholder", b.i18n("sa-password"))), O(() => c.value = u()), c;
|
|
2054
|
+
})()), C(() => C(() => t() === "webauthn")() && Ve()), C(() => C(() => t() === "otp-pick")() && [(() => {
|
|
2055
|
+
var c = Hi();
|
|
2056
|
+
return d(c, () => b.i18n("sa-otp-choose")), c;
|
|
1918
2057
|
})(), (() => {
|
|
1919
|
-
var
|
|
1920
|
-
return
|
|
1921
|
-
var
|
|
1922
|
-
return
|
|
1923
|
-
})())),
|
|
1924
|
-
})()]),
|
|
1925
|
-
var
|
|
1926
|
-
return
|
|
1927
|
-
})()),
|
|
1928
|
-
var
|
|
1929
|
-
return
|
|
2058
|
+
var c = Wi();
|
|
2059
|
+
return c.addEventListener("change", (g) => _(g.currentTarget.value)), d(c, () => le().map((g) => (() => {
|
|
2060
|
+
var w = Zi(), ie = w.firstChild, se = ie.nextSibling;
|
|
2061
|
+
return se.nextSibling, d(w, () => g.DisplayName || g.ID, ie), d(w, () => g.Type, se), O(() => w.value = g.ID), w;
|
|
2062
|
+
})())), O(() => c.value = De()), c;
|
|
2063
|
+
})()]), C(() => C(() => t() === "otp")() && (() => {
|
|
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")() && [(() => {
|
|
2067
|
+
var c = Xi();
|
|
2068
|
+
return c.$$input = (g) => j(g.currentTarget.value), O(() => oe(c, "placeholder", b.i18n("sa-reset-code"))), O(() => c.value = re()), c;
|
|
1930
2069
|
})(), (() => {
|
|
1931
|
-
var
|
|
1932
|
-
return
|
|
1933
|
-
})()]),
|
|
1934
|
-
var
|
|
1935
|
-
return
|
|
2070
|
+
var c = Qi();
|
|
2071
|
+
return c.$$input = (g) => J(g.currentTarget.value), O(() => oe(c, "placeholder", b.i18n("sa-new-password"))), O(() => c.value = H()), c;
|
|
2072
|
+
})()]), C(() => C(() => t() === "password" || t() === "webauthn")() && (() => {
|
|
2073
|
+
var c = ea(), g = c.firstChild, w = g.nextSibling;
|
|
2074
|
+
return w.firstChild, c.$$click = () => r(t() === "password" ? "webauthn" : "password"), d(w, () => b.i18n("sa-use-password"), null), O(() => g.checked = t() === "password"), c;
|
|
1936
2075
|
})())];
|
|
1937
|
-
})(),
|
|
1938
|
-
var
|
|
1939
|
-
return () =>
|
|
1940
|
-
var
|
|
1941
|
-
return
|
|
2076
|
+
})(), M), d(o, (() => {
|
|
2077
|
+
var m = C(() => t() === "sign-up");
|
|
2078
|
+
return () => m() && (() => {
|
|
2079
|
+
var c = ht();
|
|
2080
|
+
return c.$$input = (g) => i(g.currentTarget.value), O(() => oe(c, "placeholder", b.i18n("sa-password"))), O(() => c.value = u()), c;
|
|
1942
2081
|
})();
|
|
1943
|
-
})(),
|
|
1944
|
-
var
|
|
1945
|
-
return () =>
|
|
1946
|
-
})()),
|
|
1947
|
-
var
|
|
1948
|
-
return () =>
|
|
1949
|
-
var
|
|
1950
|
-
return
|
|
1951
|
-
p(""),
|
|
1952
|
-
}, c
|
|
2082
|
+
})(), M), d(M, (() => {
|
|
2083
|
+
var m = C(() => t() === "sign-up");
|
|
2084
|
+
return () => m() ? b.i18n("sa-signup") : C(() => t() === "otp-pick")() ? b.i18n("sa-otp-send-code") : C(() => t() === "otp")() ? b.i18n("sa-otp-verify") : C(() => t() === "reset-email")() ? b.i18n("sa-otp-send-code") : C(() => t() === "reset-code")() ? b.i18n("sa-reset-submit") : b.i18n("sa-login");
|
|
2085
|
+
})()), d(o, (() => {
|
|
2086
|
+
var m = C(() => t() === "password");
|
|
2087
|
+
return () => m() && (() => {
|
|
2088
|
+
var c = He();
|
|
2089
|
+
return c.$$click = () => {
|
|
2090
|
+
p(""), W(!1), r("reset-email");
|
|
2091
|
+
}, d(c, () => b.i18n("sa-forgot-password")), c;
|
|
1953
2092
|
})();
|
|
1954
|
-
})(), null),
|
|
1955
|
-
var
|
|
1956
|
-
return () =>
|
|
1957
|
-
var
|
|
1958
|
-
return
|
|
1959
|
-
p(""),
|
|
1960
|
-
}, c
|
|
2093
|
+
})(), null), d(o, (() => {
|
|
2094
|
+
var m = C(() => t() === "reset-email" || t() === "reset-code");
|
|
2095
|
+
return () => m() && (() => {
|
|
2096
|
+
var c = He();
|
|
2097
|
+
return c.$$click = () => {
|
|
2098
|
+
p(""), j(""), J(""), r(e.startMode);
|
|
2099
|
+
}, d(c, () => b.i18n("sa-back")), c;
|
|
1961
2100
|
})();
|
|
1962
|
-
})(), null),
|
|
1963
|
-
var
|
|
1964
|
-
return () =>
|
|
1965
|
-
var
|
|
1966
|
-
return
|
|
1967
|
-
var
|
|
1968
|
-
return () =>
|
|
1969
|
-
})()),
|
|
2101
|
+
})(), null), d(o, (() => {
|
|
2102
|
+
var m = C(() => !!(X() && t() !== "reset-email" && t() !== "reset-code"));
|
|
2103
|
+
return () => m() && (() => {
|
|
2104
|
+
var c = He();
|
|
2105
|
+
return c.$$click = () => t() === "sign-up" ? r(e.startMode) : r("sign-up"), d(c, (() => {
|
|
2106
|
+
var g = C(() => t() === "sign-up");
|
|
2107
|
+
return () => g() ? b.i18n("sa-back") : b.i18n("sa-signup");
|
|
2108
|
+
})()), c;
|
|
1970
2109
|
})();
|
|
1971
|
-
})(), null),
|
|
1972
|
-
var
|
|
1973
|
-
return
|
|
2110
|
+
})(), null), d(o, (() => {
|
|
2111
|
+
var m = C(() => K().length > 0 && (t() === "password" || t() === "webauthn" || t() === "sign-up"));
|
|
2112
|
+
return () => m() && [(() => {
|
|
2113
|
+
var c = ta(), g = c.firstChild;
|
|
2114
|
+
return d(g, () => b.i18n("sa-or")), c;
|
|
2115
|
+
})(), C(() => K().map((c) => (() => {
|
|
2116
|
+
var g = ra();
|
|
2117
|
+
return g.$$click = () => Ce(c.provider), d(g, (() => {
|
|
2118
|
+
var w = C(() => c.provider === "google");
|
|
2119
|
+
return () => w() && na();
|
|
2120
|
+
})(), null), d(g, (() => {
|
|
2121
|
+
var w = C(() => c.provider === "github");
|
|
2122
|
+
return () => w() && sa();
|
|
2123
|
+
})(), null), d(g, (() => {
|
|
2124
|
+
var w = C(() => c.provider === "apple");
|
|
2125
|
+
return () => w() && // <svg width="18" height="18" viewBox="0 0 814 1000" xmlns="http://www.w3.org/2000/svg">
|
|
2126
|
+
// <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
|
+
// </svg>
|
|
2128
|
+
ua();
|
|
2129
|
+
})(), null), d(g, (() => {
|
|
2130
|
+
var w = C(() => c.provider === "oidc");
|
|
2131
|
+
return () => w() && ia();
|
|
2132
|
+
})(), null), d(g, (() => {
|
|
2133
|
+
var w = C(() => c.provider === "google");
|
|
2134
|
+
return () => w() ? b.i18n("sa-social-google") : C(() => c.provider === "github")() ? b.i18n("sa-social-github") : C(() => c.provider === "apple")() ? b.i18n("sa-social-apple") : b.i18n("sa-social-oidc");
|
|
2135
|
+
})(), null), O(() => g.disabled = !!A()), g;
|
|
2136
|
+
})()))];
|
|
2137
|
+
})(), null), O((m) => {
|
|
2138
|
+
var c = b.i18n("sa-username"), g = t() === "otp" || t() === "otp-pick" || t() === "reset-code";
|
|
2139
|
+
return c !== m.e && oe(y, "placeholder", m.e = c), g !== m.t && (y.disabled = m.t = g), m;
|
|
1974
2140
|
}, {
|
|
1975
2141
|
e: void 0,
|
|
1976
2142
|
t: void 0
|
|
1977
|
-
}),
|
|
2143
|
+
}), O(() => y.value = n()), o;
|
|
1978
2144
|
})();
|
|
1979
2145
|
});
|
|
1980
2146
|
et(["input", "click"]);
|
|
1981
|
-
var
|
|
2147
|
+
var oa = /* @__PURE__ */ B(`<div class=container><style>.container {
|
|
1982
2148
|
background-color: #ffffff;
|
|
1983
2149
|
border-radius: 10px;
|
|
1984
2150
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
@@ -2151,8 +2317,8 @@ var ni = /* @__PURE__ */ x(`<div class=container><style>.container {
|
|
|
2151
2317
|
.modal-content .btn.verify:hover {
|
|
2152
2318
|
background-color: #0056b3;
|
|
2153
2319
|
}
|
|
2154
|
-
</style><style></style><h1 class=header>`),
|
|
2155
|
-
const
|
|
2320
|
+
</style><style></style><h1 class=header>`), ft = /* @__PURE__ */ B("<span class=error-message>"), la = /* @__PURE__ */ B("<div class=section><h2></h2><div class=security-keys>"), ca = /* @__PURE__ */ B('<div class=key-item><span></span><button class="btn remove">'), pt = /* @__PURE__ */ B("<span>"), da = /* @__PURE__ */ B("<div class=section><div class=security-keys>"), Da = /* @__PURE__ */ B('<button class="btn add">+ '), ha = /* @__PURE__ */ B('<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">'), fa = /* @__PURE__ */ B("<div class=section><h2></h2><table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>"), pa = /* @__PURE__ */ B('<tr class=mfa-list-item><td></td><td></td><td><button class="btn remove">'), ga = /* @__PURE__ */ B('<span> <button class="btn validate">'), ma = /* @__PURE__ */ B('<div class=section><div class=mfa-manage><button class="btn add">+ '), ba = /* @__PURE__ */ B('<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">'), Ca = /* @__PURE__ */ B('<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');
|
|
2321
|
+
const Aa = {
|
|
2156
2322
|
domain: "http://127.0.0.1:11000",
|
|
2157
2323
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2158
2324
|
// defaults to the admin sector
|
|
@@ -2162,283 +2328,283 @@ const hi = {
|
|
|
2162
2328
|
redirect: "/",
|
|
2163
2329
|
redirectOnUnauthenticated: !0
|
|
2164
2330
|
};
|
|
2165
|
-
tt("spartan-account-settings",
|
|
2166
|
-
|
|
2167
|
-
const [t,
|
|
2168
|
-
let
|
|
2331
|
+
tt("spartan-account-settings", Aa, (e) => {
|
|
2332
|
+
$(""), $("");
|
|
2333
|
+
const [t, r] = $(""), [n, s] = $(""), [u, i] = $(""), [a] = $(e.showWebAuthn), [F, k] = $(!1), [p, S] = $(!1), [X, te] = $(!1), [he, N] = $(!1), [Q, W] = $([]), [re, j] = $([]), [H, J] = $(""), [le, de] = $(""), [De, _] = $(""), [K, fe] = $(""), A = rt(e.locale);
|
|
2334
|
+
let ne;
|
|
2169
2335
|
try {
|
|
2170
|
-
|
|
2336
|
+
ne = e.styles;
|
|
2171
2337
|
} catch {
|
|
2172
|
-
|
|
2338
|
+
ne = "";
|
|
2173
2339
|
}
|
|
2174
2340
|
Xe(async () => {
|
|
2175
|
-
if (
|
|
2176
|
-
|
|
2341
|
+
if (Pt())
|
|
2342
|
+
S(!0), s("");
|
|
2177
2343
|
else {
|
|
2178
2344
|
if (e.redirectOnUnauthenticated) {
|
|
2179
2345
|
window.location.href = e.redirect;
|
|
2180
2346
|
return;
|
|
2181
2347
|
}
|
|
2182
|
-
|
|
2348
|
+
S(!1), s(A.i18n("not-authenticated"));
|
|
2183
2349
|
}
|
|
2184
|
-
|
|
2185
|
-
console.log(
|
|
2186
|
-
}), await
|
|
2187
|
-
|
|
2350
|
+
b().then((v) => {
|
|
2351
|
+
console.log(v);
|
|
2352
|
+
}), await Ce(), me().then((v) => {
|
|
2353
|
+
j(v.registrations);
|
|
2188
2354
|
});
|
|
2189
2355
|
});
|
|
2190
|
-
async function
|
|
2191
|
-
return await (await fetch(`${e.domain}/api/v1/users/self`,
|
|
2356
|
+
async function b() {
|
|
2357
|
+
return await (await fetch(`${e.domain}/api/v1/users/self`, Z("get"))).json();
|
|
2192
2358
|
}
|
|
2193
|
-
function
|
|
2359
|
+
function Z(E = "get") {
|
|
2194
2360
|
return {
|
|
2195
|
-
method:
|
|
2361
|
+
method: E,
|
|
2196
2362
|
mode: "cors",
|
|
2197
2363
|
cache: "no-cache",
|
|
2198
2364
|
headers: {
|
|
2199
2365
|
"Content-Type": "application",
|
|
2200
|
-
Authorization: `bearer ${
|
|
2366
|
+
Authorization: `bearer ${Ji()}`
|
|
2201
2367
|
}
|
|
2202
2368
|
};
|
|
2203
2369
|
}
|
|
2204
|
-
function
|
|
2205
|
-
let
|
|
2206
|
-
|
|
2370
|
+
function ge() {
|
|
2371
|
+
let E = Z("post");
|
|
2372
|
+
E.body = JSON.stringify({
|
|
2207
2373
|
keyName: t(),
|
|
2208
2374
|
sectorID: e.sector
|
|
2209
|
-
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`,
|
|
2210
|
-
if (
|
|
2211
|
-
return
|
|
2212
|
-
throw
|
|
2213
|
-
}).then((
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
}) :
|
|
2375
|
+
}), fetch(`${e.domain}/api/v1/webauthn/registration/begin`, E).then((v) => {
|
|
2376
|
+
if (v.status === 200)
|
|
2377
|
+
return v.json();
|
|
2378
|
+
throw v;
|
|
2379
|
+
}).then((v) => (console.log(v), we(v))).catch((v) => {
|
|
2380
|
+
v.json ? v.json().then((P) => {
|
|
2381
|
+
s(P.message);
|
|
2382
|
+
}) : s(v);
|
|
2217
2383
|
});
|
|
2218
2384
|
}
|
|
2219
|
-
async function
|
|
2385
|
+
async function we(E) {
|
|
2220
2386
|
try {
|
|
2221
|
-
const
|
|
2222
|
-
console.log("Parsed WebAuthn creation options:",
|
|
2223
|
-
const
|
|
2224
|
-
let
|
|
2225
|
-
|
|
2226
|
-
let
|
|
2227
|
-
|
|
2228
|
-
const
|
|
2229
|
-
if (
|
|
2230
|
-
const
|
|
2231
|
-
|
|
2387
|
+
const v = zi(E.Options);
|
|
2388
|
+
console.log("Parsed WebAuthn creation options:", v);
|
|
2389
|
+
const P = await Ri(v), L = JSON.stringify(P);
|
|
2390
|
+
let o = JSON.parse(L);
|
|
2391
|
+
o.transactionID = E.TransactionID;
|
|
2392
|
+
let D = Z("post");
|
|
2393
|
+
D.body = JSON.stringify(o);
|
|
2394
|
+
const f = await fetch(`${e.domain}/api/v1/webauthn/registration/finish`, D);
|
|
2395
|
+
if (f.status !== 200) {
|
|
2396
|
+
const x = await f.json();
|
|
2397
|
+
s(x.message);
|
|
2232
2398
|
return;
|
|
2233
2399
|
}
|
|
2234
|
-
|
|
2235
|
-
} catch (
|
|
2236
|
-
console.error("WebAuthn registration error:",
|
|
2400
|
+
k(!1), r(""), Ce();
|
|
2401
|
+
} catch (v) {
|
|
2402
|
+
console.error("WebAuthn registration error:", v), s((v == null ? void 0 : v.message) || String(v));
|
|
2237
2403
|
}
|
|
2238
2404
|
}
|
|
2239
|
-
async function
|
|
2240
|
-
let
|
|
2241
|
-
|
|
2242
|
-
ID:
|
|
2405
|
+
async function ye(E) {
|
|
2406
|
+
let v = Z("delete");
|
|
2407
|
+
v.body = JSON.stringify({
|
|
2408
|
+
ID: E
|
|
2243
2409
|
});
|
|
2244
2410
|
try {
|
|
2245
|
-
if ((await fetch(`${e.domain}/api/v1/webauthn/${
|
|
2246
|
-
|
|
2411
|
+
if ((await fetch(`${e.domain}/api/v1/webauthn/${E}`, v)).status !== 200) {
|
|
2412
|
+
s(A.i18n("error-webauthn-remove"));
|
|
2247
2413
|
return;
|
|
2248
2414
|
}
|
|
2249
|
-
|
|
2250
|
-
} catch (
|
|
2251
|
-
console.error(
|
|
2415
|
+
Ce();
|
|
2416
|
+
} catch (P) {
|
|
2417
|
+
console.error(P), s(A.i18n("error-webauthn-remove"));
|
|
2252
2418
|
return;
|
|
2253
2419
|
}
|
|
2254
2420
|
}
|
|
2255
|
-
async function
|
|
2256
|
-
let
|
|
2421
|
+
async function Ce() {
|
|
2422
|
+
let E = Z("get");
|
|
2257
2423
|
try {
|
|
2258
|
-
const
|
|
2259
|
-
|
|
2260
|
-
} catch (
|
|
2261
|
-
console.error(
|
|
2424
|
+
const P = await (await fetch(`${e.domain}/api/v1/webauthn/registration/list`, E)).json();
|
|
2425
|
+
W(P.registrations || []);
|
|
2426
|
+
} catch (v) {
|
|
2427
|
+
console.error(v), W([]);
|
|
2262
2428
|
}
|
|
2263
2429
|
}
|
|
2264
|
-
async function
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
}),
|
|
2269
|
-
}
|
|
2270
|
-
async function _e(
|
|
2271
|
-
let
|
|
2272
|
-
|
|
2273
|
-
destination:
|
|
2274
|
-
OTPType:
|
|
2430
|
+
async function Ae(E, v) {
|
|
2431
|
+
const P = await _e(E, v);
|
|
2432
|
+
P && (me().then((L) => {
|
|
2433
|
+
j(L.registrations);
|
|
2434
|
+
}), J(P.transactionID), N(!0));
|
|
2435
|
+
}
|
|
2436
|
+
async function _e(E, v) {
|
|
2437
|
+
let P = Z("post");
|
|
2438
|
+
P.body = JSON.stringify({
|
|
2439
|
+
destination: E,
|
|
2440
|
+
OTPType: Fe(v),
|
|
2275
2441
|
sectorID: e.sector
|
|
2276
2442
|
});
|
|
2277
2443
|
try {
|
|
2278
|
-
const
|
|
2279
|
-
if (
|
|
2280
|
-
|
|
2444
|
+
const L = await fetch(`${e.domain}/api/v1/otp/begin`, P);
|
|
2445
|
+
if (L.status !== 200) {
|
|
2446
|
+
s(A.i18n("error-otp-verification"));
|
|
2281
2447
|
return;
|
|
2282
2448
|
}
|
|
2283
|
-
return await
|
|
2284
|
-
} catch (
|
|
2285
|
-
console.error(
|
|
2449
|
+
return await L.json();
|
|
2450
|
+
} catch (L) {
|
|
2451
|
+
console.error(L), s(A.i18n("error-otp-registration"));
|
|
2286
2452
|
return;
|
|
2287
2453
|
}
|
|
2288
2454
|
}
|
|
2289
|
-
async function Se(
|
|
2290
|
-
let
|
|
2291
|
-
|
|
2292
|
-
transactionID:
|
|
2293
|
-
password:
|
|
2455
|
+
async function Se(E, v) {
|
|
2456
|
+
let P = Z("post");
|
|
2457
|
+
P.body = JSON.stringify({
|
|
2458
|
+
transactionID: E,
|
|
2459
|
+
password: v
|
|
2294
2460
|
});
|
|
2295
2461
|
try {
|
|
2296
|
-
const
|
|
2297
|
-
if (
|
|
2298
|
-
|
|
2462
|
+
const L = await fetch(`${e.domain}/api/v1/otp/finish`, P);
|
|
2463
|
+
if (L.status !== 200) {
|
|
2464
|
+
i(A.i18n("error-otp-verification"));
|
|
2299
2465
|
return;
|
|
2300
2466
|
}
|
|
2301
|
-
return
|
|
2302
|
-
|
|
2303
|
-
}), await
|
|
2304
|
-
} catch (
|
|
2305
|
-
console.error(
|
|
2467
|
+
return N(!1), de(""), te(!1), fe(""), _(""), me().then((o) => {
|
|
2468
|
+
j(o.registrations);
|
|
2469
|
+
}), await L.json();
|
|
2470
|
+
} catch (L) {
|
|
2471
|
+
console.error(L), i(A.i18n("error-otp-registration"));
|
|
2306
2472
|
return;
|
|
2307
2473
|
}
|
|
2308
2474
|
}
|
|
2309
|
-
async function
|
|
2310
|
-
let
|
|
2475
|
+
async function me() {
|
|
2476
|
+
let E = Z("get");
|
|
2311
2477
|
try {
|
|
2312
|
-
return await (await fetch(`${e.domain}/api/v1/otp/list`,
|
|
2313
|
-
} catch (
|
|
2314
|
-
console.error(
|
|
2478
|
+
return await (await fetch(`${e.domain}/api/v1/otp/list`, E)).json();
|
|
2479
|
+
} catch (v) {
|
|
2480
|
+
console.error(v), s(A.i18n("error-otp-list"));
|
|
2315
2481
|
return;
|
|
2316
2482
|
}
|
|
2317
2483
|
}
|
|
2318
|
-
async function
|
|
2319
|
-
let
|
|
2320
|
-
|
|
2321
|
-
ID:
|
|
2484
|
+
async function ve(E) {
|
|
2485
|
+
let v = Z("delete");
|
|
2486
|
+
v.body = JSON.stringify({
|
|
2487
|
+
ID: E
|
|
2322
2488
|
});
|
|
2323
2489
|
try {
|
|
2324
|
-
if ((await fetch(`${e.domain}/api/v1/otp/${
|
|
2325
|
-
|
|
2490
|
+
if ((await fetch(`${e.domain}/api/v1/otp/${E}`, v)).status !== 200) {
|
|
2491
|
+
s(A.i18n("error-otp-remove"));
|
|
2326
2492
|
return;
|
|
2327
2493
|
}
|
|
2328
|
-
|
|
2329
|
-
|
|
2494
|
+
me().then((L) => {
|
|
2495
|
+
j(L.registrations);
|
|
2330
2496
|
});
|
|
2331
|
-
} catch (
|
|
2332
|
-
console.error(
|
|
2497
|
+
} catch (P) {
|
|
2498
|
+
console.error(P), s(A.i18n("error-otp-remove"));
|
|
2333
2499
|
return;
|
|
2334
2500
|
}
|
|
2335
2501
|
}
|
|
2336
|
-
function E
|
|
2337
|
-
return
|
|
2502
|
+
function Fe(E) {
|
|
2503
|
+
return E === "EMAIL" ? 2 : 1;
|
|
2338
2504
|
}
|
|
2339
2505
|
return (() => {
|
|
2340
|
-
var
|
|
2341
|
-
return
|
|
2342
|
-
var
|
|
2343
|
-
return
|
|
2344
|
-
})(), null),
|
|
2345
|
-
var
|
|
2346
|
-
return () =>
|
|
2347
|
-
var
|
|
2348
|
-
return
|
|
2349
|
-
var
|
|
2350
|
-
return
|
|
2351
|
-
confirm(
|
|
2352
|
-
},
|
|
2353
|
-
})()), null),
|
|
2354
|
-
var
|
|
2355
|
-
return () =>
|
|
2356
|
-
var
|
|
2357
|
-
return
|
|
2506
|
+
var E = oa(), v = E.firstChild, P = v.nextSibling, L = P.nextSibling;
|
|
2507
|
+
return d(P, ne), d(L, () => A.i18n("sa-account-settings")), d(E, n && (() => {
|
|
2508
|
+
var o = ft();
|
|
2509
|
+
return d(o, n), o;
|
|
2510
|
+
})(), null), d(E, (() => {
|
|
2511
|
+
var o = C(() => !!(a() && Q().length));
|
|
2512
|
+
return () => o() && (() => {
|
|
2513
|
+
var D = la(), f = D.firstChild, x = f.nextSibling;
|
|
2514
|
+
return d(f, () => A.i18n("sa-webauthn-security-keys")), d(x, () => Q().map((y) => (() => {
|
|
2515
|
+
var M = ca(), R = M.firstChild, m = R.nextSibling;
|
|
2516
|
+
return d(R, () => y.keyName), m.$$click = () => {
|
|
2517
|
+
confirm(A.i18n("sa-confirm-delete-key")) && ye(y.keyName);
|
|
2518
|
+
}, d(m, () => A.i18n("sa-remove")), M;
|
|
2519
|
+
})()), null), d(x, (() => {
|
|
2520
|
+
var y = C(() => Q().length <= 0);
|
|
2521
|
+
return () => y() && (() => {
|
|
2522
|
+
var M = pt();
|
|
2523
|
+
return d(M, () => A.i18n("sa-no-security-keys")), M;
|
|
2358
2524
|
})();
|
|
2359
|
-
})(), null),
|
|
2525
|
+
})(), null), D;
|
|
2360
2526
|
})();
|
|
2361
|
-
})(), null),
|
|
2362
|
-
var
|
|
2363
|
-
return () =>
|
|
2364
|
-
var
|
|
2365
|
-
return
|
|
2366
|
-
var
|
|
2367
|
-
return () =>
|
|
2368
|
-
var
|
|
2369
|
-
return
|
|
2527
|
+
})(), null), d(E, (() => {
|
|
2528
|
+
var o = C(() => !!a());
|
|
2529
|
+
return () => o() && (() => {
|
|
2530
|
+
var D = da(), f = D.firstChild;
|
|
2531
|
+
return d(f, (() => {
|
|
2532
|
+
var x = C(() => !F());
|
|
2533
|
+
return () => x() && (() => {
|
|
2534
|
+
var y = Da();
|
|
2535
|
+
return y.firstChild, y.$$click = () => k(!0), d(y, () => A.i18n("sa-add-security-key"), null), y;
|
|
2370
2536
|
})();
|
|
2371
|
-
})(), null),
|
|
2372
|
-
var
|
|
2373
|
-
return () =>
|
|
2374
|
-
var
|
|
2375
|
-
return
|
|
2376
|
-
var
|
|
2377
|
-
return
|
|
2537
|
+
})(), null), d(f, (() => {
|
|
2538
|
+
var x = C(() => !!F());
|
|
2539
|
+
return () => x() && (() => {
|
|
2540
|
+
var y = ha(), M = y.firstChild, R = M.firstChild, m = R.nextSibling, c = m.nextSibling, g = c.nextSibling;
|
|
2541
|
+
return d(R, () => A.i18n("sa-webauthn-key-name")), m.$$input = (w) => r(w.currentTarget.value), c.$$click = () => k(!1), d(c, () => A.i18n("sa-cancel")), g.$$click = () => t() !== "" && ge(), d(g, () => A.i18n("sa-register")), O((w) => {
|
|
2542
|
+
var ie = A.i18n("sa-webauthn-key-name"), se = t() === "";
|
|
2543
|
+
return ie !== w.e && oe(m, "placeholder", w.e = ie), se !== w.t && (g.disabled = w.t = se), w;
|
|
2378
2544
|
}, {
|
|
2379
2545
|
e: void 0,
|
|
2380
2546
|
t: void 0
|
|
2381
|
-
}),
|
|
2547
|
+
}), O(() => m.value = t()), y;
|
|
2382
2548
|
})();
|
|
2383
|
-
})(), null),
|
|
2549
|
+
})(), null), D;
|
|
2384
2550
|
})();
|
|
2385
|
-
})(), null),
|
|
2386
|
-
var
|
|
2387
|
-
return () =>
|
|
2388
|
-
var
|
|
2389
|
-
return
|
|
2390
|
-
var
|
|
2391
|
-
return
|
|
2392
|
-
var
|
|
2393
|
-
return () =>
|
|
2394
|
-
var
|
|
2395
|
-
return
|
|
2551
|
+
})(), null), d(E, (() => {
|
|
2552
|
+
var o = C(() => re().length > 0);
|
|
2553
|
+
return () => o() && (() => {
|
|
2554
|
+
var D = fa(), f = D.firstChild, x = f.nextSibling, y = x.firstChild, M = y.firstChild, R = M.firstChild, m = R.nextSibling, c = m.nextSibling, g = y.nextSibling;
|
|
2555
|
+
return d(f, () => A.i18n("sa-mfa")), d(R, () => A.i18n("sa-mfa-destination")), d(m, () => A.i18n("sa-mfa-validated")), d(c, () => A.i18n("sa-mfa-action")), d(g, () => re().map((w) => (() => {
|
|
2556
|
+
var ie = pa(), se = ie.firstChild, l = se.nextSibling, h = l.nextSibling, I = h.firstChild;
|
|
2557
|
+
return d(se, () => w.DisplayName), d(l, (() => {
|
|
2558
|
+
var G = C(() => !!w.Validated);
|
|
2559
|
+
return () => G() ? (() => {
|
|
2560
|
+
var V = pt();
|
|
2561
|
+
return d(V, () => A.i18n("sa-yes")), V;
|
|
2396
2562
|
})() : (() => {
|
|
2397
|
-
var
|
|
2398
|
-
return
|
|
2399
|
-
|
|
2400
|
-
},
|
|
2563
|
+
var V = ga(), ce = V.firstChild, Ee = ce.nextSibling;
|
|
2564
|
+
return d(V, () => A.i18n("sa-no"), ce), Ee.$$click = () => {
|
|
2565
|
+
Ae(w.DisplayName, w.Type === "email" ? "EMAIL" : "SMS");
|
|
2566
|
+
}, d(Ee, () => A.i18n("sa-validate")), V;
|
|
2401
2567
|
})();
|
|
2402
|
-
})()),
|
|
2403
|
-
confirm(
|
|
2404
|
-
},
|
|
2405
|
-
})())),
|
|
2568
|
+
})()), I.$$click = () => {
|
|
2569
|
+
confirm(A.i18n("sa-confirm-delete-key")) && ve(w.ID);
|
|
2570
|
+
}, d(I, () => A.i18n("sa-remove")), O(() => oe(se, "title", w.DisplayName)), ie;
|
|
2571
|
+
})())), D;
|
|
2406
2572
|
})();
|
|
2407
|
-
})(), null),
|
|
2408
|
-
var
|
|
2409
|
-
return () =>
|
|
2410
|
-
var
|
|
2411
|
-
return
|
|
2573
|
+
})(), null), d(E, (() => {
|
|
2574
|
+
var o = C(() => !X());
|
|
2575
|
+
return () => o() && (() => {
|
|
2576
|
+
var D = ma(), f = D.firstChild, x = f.firstChild;
|
|
2577
|
+
return x.firstChild, x.$$click = () => te(!0), d(x, () => A.i18n("sa-register-mfa"), null), D;
|
|
2412
2578
|
})();
|
|
2413
|
-
})(), null),
|
|
2414
|
-
var
|
|
2415
|
-
return () =>
|
|
2416
|
-
var
|
|
2417
|
-
return
|
|
2418
|
-
var
|
|
2419
|
-
return
|
|
2579
|
+
})(), null), d(E, (() => {
|
|
2580
|
+
var o = C(() => !!X());
|
|
2581
|
+
return () => o() && (() => {
|
|
2582
|
+
var D = ba(), f = D.firstChild, x = f.nextSibling, y = x.firstChild, M = y.firstChild, R = M.nextSibling, m = R.nextSibling, c = y.nextSibling, g = c.firstChild, w = g.nextSibling, ie = w.nextSibling, se = c.nextSibling, l = se.firstChild;
|
|
2583
|
+
return d(f, () => A.i18n("sa-add-mfa")), d(M, () => A.i18n("sa-email")), R.$$input = (h) => _(h.currentTarget.value), m.$$click = () => Ae(De(), "EMAIL"), d(m, () => A.i18n("sa-add-email")), d(g, () => A.i18n("sa-phone")), w.$$input = (h) => fe(h.currentTarget.value), ie.$$click = () => Ae(K(), "SMS"), d(ie, () => A.i18n("sa-add-sms")), l.$$click = () => te(!1), d(l, () => A.i18n("sa-cancel")), O((h) => {
|
|
2584
|
+
var I = A.i18n("sa-email"), G = A.i18n("sa-phone");
|
|
2585
|
+
return I !== h.e && oe(R, "placeholder", h.e = I), G !== h.t && oe(w, "placeholder", h.t = G), h;
|
|
2420
2586
|
}, {
|
|
2421
2587
|
e: void 0,
|
|
2422
2588
|
t: void 0
|
|
2423
|
-
}),
|
|
2589
|
+
}), O(() => R.value = De()), O(() => w.value = K()), D;
|
|
2424
2590
|
})();
|
|
2425
|
-
})(), null),
|
|
2426
|
-
var
|
|
2427
|
-
return () =>
|
|
2428
|
-
var
|
|
2429
|
-
return
|
|
2430
|
-
var
|
|
2431
|
-
return () =>
|
|
2432
|
-
var
|
|
2433
|
-
return
|
|
2591
|
+
})(), null), d(E, (() => {
|
|
2592
|
+
var o = C(() => !!he());
|
|
2593
|
+
return () => o() && (() => {
|
|
2594
|
+
var D = Ca(), f = D.firstChild, x = f.firstChild, y = x.nextSibling, M = y.nextSibling, R = M.nextSibling, m = R.nextSibling;
|
|
2595
|
+
return D.$$click = () => N(!1), f.$$click = (c) => c.stopPropagation(), x.$$click = () => N(!1), d(f, (() => {
|
|
2596
|
+
var c = C(() => !!u());
|
|
2597
|
+
return () => c() && (() => {
|
|
2598
|
+
var g = ft();
|
|
2599
|
+
return d(g, u), g;
|
|
2434
2600
|
})();
|
|
2435
|
-
})(),
|
|
2601
|
+
})(), M), R.$$input = (c) => de(c.currentTarget.value), m.$$click = () => Se(H(), le()), O(() => R.value = le()), D;
|
|
2436
2602
|
})();
|
|
2437
|
-
})(), null),
|
|
2603
|
+
})(), null), E;
|
|
2438
2604
|
})();
|
|
2439
2605
|
});
|
|
2440
2606
|
et(["click", "input"]);
|
|
2441
|
-
var
|
|
2607
|
+
var va = /* @__PURE__ */ B(`<form class=invite-frame><style>.invite-frame {
|
|
2442
2608
|
display: flex;
|
|
2443
2609
|
flex-direction: column;
|
|
2444
2610
|
justify-content: center;
|
|
@@ -2498,8 +2664,8 @@ var pi = /* @__PURE__ */ x(`<form class=invite-frame><style>.invite-frame {
|
|
|
2498
2664
|
margin-bottom: 10px;
|
|
2499
2665
|
display: block;
|
|
2500
2666
|
}
|
|
2501
|
-
</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>`),
|
|
2502
|
-
const
|
|
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__ */ B("<span class=info-message>"), Ea = /* @__PURE__ */ B("<span class=error-message>"), wa = /* @__PURE__ */ B("<span class=success-message>");
|
|
2668
|
+
const ya = {
|
|
2503
2669
|
domain: "http://127.0.0.1:11000",
|
|
2504
2670
|
sector: "0ad5c3e5-0186-4557-8b32-4b36f247bf09",
|
|
2505
2671
|
// defaults to the admin sector
|
|
@@ -2512,36 +2678,36 @@ const Ci = {
|
|
|
2512
2678
|
redirect: ""
|
|
2513
2679
|
// where to redirect after successful completion
|
|
2514
2680
|
};
|
|
2515
|
-
tt("spartan-invite",
|
|
2516
|
-
const [t,
|
|
2517
|
-
let
|
|
2681
|
+
tt("spartan-invite", ya, (e) => {
|
|
2682
|
+
const [t, r] = $(""), [n, s] = $(""), [u, i] = $(""), [a, F] = $(""), [k, p] = $(!1), S = rt(e.locale);
|
|
2683
|
+
let X, te;
|
|
2518
2684
|
try {
|
|
2519
|
-
|
|
2685
|
+
te = e.styles;
|
|
2520
2686
|
} catch {
|
|
2521
|
-
|
|
2687
|
+
te = "";
|
|
2522
2688
|
}
|
|
2523
2689
|
Xe(async () => {
|
|
2524
|
-
e.sub || new URLSearchParams(window.location.search).get("sub") ||
|
|
2525
|
-
const
|
|
2526
|
-
|
|
2690
|
+
e.sub || new URLSearchParams(window.location.search).get("sub") || i("Missing invitation information. Please use the link from your invite email.");
|
|
2691
|
+
const Q = new URLSearchParams(window.location.hash.replace("#", "")).get("otp");
|
|
2692
|
+
Q && r(Q);
|
|
2527
2693
|
});
|
|
2528
|
-
async function
|
|
2529
|
-
var
|
|
2530
|
-
if (
|
|
2531
|
-
|
|
2694
|
+
async function he(N) {
|
|
2695
|
+
var re, j;
|
|
2696
|
+
if (N.preventDefault(), i(""), F(""), p(!0), !t() || t().trim().length === 0) {
|
|
2697
|
+
i("Please enter your verification code"), p(!1);
|
|
2532
2698
|
return;
|
|
2533
2699
|
}
|
|
2534
|
-
if (!
|
|
2535
|
-
|
|
2700
|
+
if (!n() || n().length < 8) {
|
|
2701
|
+
i("Password must be at least 8 characters"), p(!1);
|
|
2536
2702
|
return;
|
|
2537
2703
|
}
|
|
2538
|
-
const
|
|
2539
|
-
if (!
|
|
2540
|
-
|
|
2704
|
+
const Q = new URLSearchParams(window.location.search), W = e.sub || Q.get("sub") || "";
|
|
2705
|
+
if (!W) {
|
|
2706
|
+
i("Missing invitation information"), p(!1);
|
|
2541
2707
|
return;
|
|
2542
2708
|
}
|
|
2543
2709
|
try {
|
|
2544
|
-
const
|
|
2710
|
+
const H = await fetch(`${e.domain}/api/v1/users/invite/complete`, {
|
|
2545
2711
|
method: "POST",
|
|
2546
2712
|
mode: "cors",
|
|
2547
2713
|
cache: "no-cache",
|
|
@@ -2549,67 +2715,67 @@ tt("spartan-invite", Ci, (e) => {
|
|
|
2549
2715
|
"Content-Type": "application/json"
|
|
2550
2716
|
},
|
|
2551
2717
|
body: JSON.stringify({
|
|
2552
|
-
sub:
|
|
2718
|
+
sub: W,
|
|
2553
2719
|
otp: t().toUpperCase().trim(),
|
|
2554
|
-
password:
|
|
2720
|
+
password: n(),
|
|
2555
2721
|
sectorID: e.sector
|
|
2556
2722
|
})
|
|
2557
2723
|
});
|
|
2558
|
-
if (
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
const
|
|
2724
|
+
if (H.ok) {
|
|
2725
|
+
const J = await H.json();
|
|
2726
|
+
F(S.i18n("sa-invite-success"));
|
|
2727
|
+
const le = new CustomEvent("spartan-invite-complete", {
|
|
2562
2728
|
bubbles: !0,
|
|
2563
2729
|
cancelable: !0,
|
|
2564
2730
|
detail: {
|
|
2565
|
-
sub:
|
|
2731
|
+
sub: W,
|
|
2566
2732
|
success: !0
|
|
2567
2733
|
}
|
|
2568
2734
|
});
|
|
2569
|
-
|
|
2735
|
+
X && X.getRootNode().host.dispatchEvent(le), setTimeout(() => {
|
|
2570
2736
|
e.redirect && e.redirect !== "" && (window.location.href = e.redirect);
|
|
2571
2737
|
}, 2e3);
|
|
2572
2738
|
} else {
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2739
|
+
const J = await H.json().catch(() => ({}));
|
|
2740
|
+
H.status === 400 || (re = J.message) != null && re.includes("invalid OTP") ? i(S.i18n("sa-invite-error-otp")) : H.status === 504 || (j = J.message) != null && j.includes("expired") ? i(S.i18n("sa-invite-error-expired")) : i(J.message || S.i18n("sa-invite-error-generic")), p(!1);
|
|
2575
2741
|
}
|
|
2576
|
-
} catch (
|
|
2577
|
-
console.error("Error completing invite:",
|
|
2742
|
+
} catch (H) {
|
|
2743
|
+
console.error("Error completing invite:", H), i(S.i18n("sa-invite-error-generic")), p(!1);
|
|
2578
2744
|
}
|
|
2579
2745
|
}
|
|
2580
2746
|
return (() => {
|
|
2581
|
-
var
|
|
2582
|
-
return typeof
|
|
2583
|
-
var
|
|
2584
|
-
return () =>
|
|
2585
|
-
var
|
|
2586
|
-
return
|
|
2747
|
+
var N = va(), Q = N.firstChild, W = Q.nextSibling, re = W.nextSibling, j = re.nextSibling, H = j.nextSibling, J = H.nextSibling, le = J.nextSibling, de = le.nextSibling, De = X;
|
|
2748
|
+
return typeof De == "function" ? Et(De, N) : X = N, N.addEventListener("submit", he), d(W, te), d(re, () => S.i18n("sa-complete-invite")), d(N, (() => {
|
|
2749
|
+
var _ = C(() => !!e.email);
|
|
2750
|
+
return () => _() && (() => {
|
|
2751
|
+
var K = Fa();
|
|
2752
|
+
return d(K, () => e.email), K;
|
|
2587
2753
|
})();
|
|
2588
|
-
})(),
|
|
2589
|
-
var
|
|
2590
|
-
return () =>
|
|
2591
|
-
var
|
|
2592
|
-
return
|
|
2754
|
+
})(), j), d(N, (() => {
|
|
2755
|
+
var _ = C(() => !!u());
|
|
2756
|
+
return () => _() && (() => {
|
|
2757
|
+
var K = Ea();
|
|
2758
|
+
return d(K, u), K;
|
|
2593
2759
|
})();
|
|
2594
|
-
})(),
|
|
2595
|
-
var
|
|
2596
|
-
return () =>
|
|
2597
|
-
var
|
|
2598
|
-
return
|
|
2760
|
+
})(), j), d(N, (() => {
|
|
2761
|
+
var _ = C(() => !!a());
|
|
2762
|
+
return () => _() && (() => {
|
|
2763
|
+
var K = wa();
|
|
2764
|
+
return d(K, a), K;
|
|
2599
2765
|
})();
|
|
2600
|
-
})(),
|
|
2601
|
-
var
|
|
2602
|
-
return () =>
|
|
2603
|
-
})()),
|
|
2604
|
-
var
|
|
2605
|
-
return
|
|
2766
|
+
})(), j), j.$$input = (_) => r(_.currentTarget.value), d(H, () => S.i18n("sa-invite-otp-hint")), J.$$input = (_) => s(_.currentTarget.value), d(le, () => S.i18n("sa-invite-password-hint")), d(de, (() => {
|
|
2767
|
+
var _ = C(() => !!k());
|
|
2768
|
+
return () => _() ? S.i18n("sa-invite-completing") : S.i18n("sa-invite-submit");
|
|
2769
|
+
})()), O((_) => {
|
|
2770
|
+
var K = S.i18n("sa-invite-otp"), fe = k() || a() !== "", A = S.i18n("sa-invite-password"), ne = k() || a() !== "", b = k() || a() !== "";
|
|
2771
|
+
return K !== _.e && oe(j, "placeholder", _.e = K), fe !== _.t && (j.disabled = _.t = fe), A !== _.a && oe(J, "placeholder", _.a = A), ne !== _.o && (J.disabled = _.o = ne), b !== _.i && (de.disabled = _.i = b), _;
|
|
2606
2772
|
}, {
|
|
2607
2773
|
e: void 0,
|
|
2608
2774
|
t: void 0,
|
|
2609
2775
|
a: void 0,
|
|
2610
2776
|
o: void 0,
|
|
2611
2777
|
i: void 0
|
|
2612
|
-
}),
|
|
2778
|
+
}), O(() => j.value = t()), O(() => J.value = n()), N;
|
|
2613
2779
|
})();
|
|
2614
2780
|
});
|
|
2615
2781
|
et(["input"]);
|