@wral/report-it 0.1.2 → 0.1.4
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/README.md +40 -1
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +1290 -1111
- package/dist/index.mjs +94 -80
- package/dist/{wral-code-input-CC2ZCxcs.js → wral-code-input-DCemMj53.js} +650 -471
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var gn = /* @__PURE__ */ (function() {
|
|
2
2
|
function n(t) {
|
|
3
3
|
var r = t || {}, i = r.ValidationData, s = r.Username, o = r.Password, l = r.AuthParameters, h = r.ClientMetadata;
|
|
4
4
|
this.validationData = i || {}, this.authParameters = l || {}, this.clientMetadata = h || {}, this.username = s, this.password = o;
|
|
@@ -16,7 +16,7 @@ var hn = /* @__PURE__ */ (function() {
|
|
|
16
16
|
return this.clientMetadata;
|
|
17
17
|
}, n;
|
|
18
18
|
})();
|
|
19
|
-
function
|
|
19
|
+
function It(n) {
|
|
20
20
|
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
21
21
|
var e = n.default;
|
|
22
22
|
if (typeof e == "function") {
|
|
@@ -40,94 +40,94 @@ function Ut(n) {
|
|
|
40
40
|
});
|
|
41
41
|
}), t;
|
|
42
42
|
}
|
|
43
|
-
var rt = {},
|
|
44
|
-
function
|
|
45
|
-
if (
|
|
46
|
-
|
|
43
|
+
var rt = {}, we = {}, Yt;
|
|
44
|
+
function mn() {
|
|
45
|
+
if (Yt) return we;
|
|
46
|
+
Yt = 1, we.byteLength = l, we.toByteArray = d, we.fromByteArray = y;
|
|
47
47
|
for (var n = [], e = [], t = typeof Uint8Array < "u" ? Uint8Array : Array, r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, s = r.length; i < s; ++i)
|
|
48
48
|
n[i] = r[i], e[r.charCodeAt(i)] = i;
|
|
49
49
|
e[45] = 62, e[95] = 63;
|
|
50
|
-
function o(
|
|
51
|
-
var b =
|
|
50
|
+
function o(v) {
|
|
51
|
+
var b = v.length;
|
|
52
52
|
if (b % 4 > 0)
|
|
53
53
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
54
|
-
var _ =
|
|
54
|
+
var _ = v.indexOf("=");
|
|
55
55
|
_ === -1 && (_ = b);
|
|
56
|
-
var
|
|
57
|
-
return [_,
|
|
56
|
+
var C = _ === b ? 0 : 4 - _ % 4;
|
|
57
|
+
return [_, C];
|
|
58
58
|
}
|
|
59
|
-
function l(
|
|
60
|
-
var b = o(
|
|
61
|
-
return (_ +
|
|
59
|
+
function l(v) {
|
|
60
|
+
var b = o(v), _ = b[0], C = b[1];
|
|
61
|
+
return (_ + C) * 3 / 4 - C;
|
|
62
62
|
}
|
|
63
|
-
function h(
|
|
63
|
+
function h(v, b, _) {
|
|
64
64
|
return (b + _) * 3 / 4 - _;
|
|
65
65
|
}
|
|
66
|
-
function d(
|
|
67
|
-
var b, _ = o(
|
|
66
|
+
function d(v) {
|
|
67
|
+
var b, _ = o(v), C = _[0], E = _[1], T = new t(h(v, C, E)), P = 0, B = E > 0 ? C - 4 : C, F;
|
|
68
68
|
for (F = 0; F < B; F += 4)
|
|
69
|
-
b = e[
|
|
70
|
-
return
|
|
69
|
+
b = e[v.charCodeAt(F)] << 18 | e[v.charCodeAt(F + 1)] << 12 | e[v.charCodeAt(F + 2)] << 6 | e[v.charCodeAt(F + 3)], T[P++] = b >> 16 & 255, T[P++] = b >> 8 & 255, T[P++] = b & 255;
|
|
70
|
+
return E === 2 && (b = e[v.charCodeAt(F)] << 2 | e[v.charCodeAt(F + 1)] >> 4, T[P++] = b & 255), E === 1 && (b = e[v.charCodeAt(F)] << 10 | e[v.charCodeAt(F + 1)] << 4 | e[v.charCodeAt(F + 2)] >> 2, T[P++] = b >> 8 & 255, T[P++] = b & 255), T;
|
|
71
71
|
}
|
|
72
|
-
function p(
|
|
73
|
-
return n[
|
|
72
|
+
function p(v) {
|
|
73
|
+
return n[v >> 18 & 63] + n[v >> 12 & 63] + n[v >> 6 & 63] + n[v & 63];
|
|
74
74
|
}
|
|
75
|
-
function m(
|
|
76
|
-
for (var
|
|
77
|
-
|
|
78
|
-
return
|
|
75
|
+
function m(v, b, _) {
|
|
76
|
+
for (var C, E = [], T = b; T < _; T += 3)
|
|
77
|
+
C = (v[T] << 16 & 16711680) + (v[T + 1] << 8 & 65280) + (v[T + 2] & 255), E.push(p(C));
|
|
78
|
+
return E.join("");
|
|
79
79
|
}
|
|
80
|
-
function v
|
|
81
|
-
for (var b, _ =
|
|
82
|
-
|
|
83
|
-
return
|
|
80
|
+
function y(v) {
|
|
81
|
+
for (var b, _ = v.length, C = _ % 3, E = [], T = 16383, P = 0, B = _ - C; P < B; P += T)
|
|
82
|
+
E.push(m(v, P, P + T > B ? B : P + T));
|
|
83
|
+
return C === 1 ? (b = v[_ - 1], E.push(
|
|
84
84
|
n[b >> 2] + n[b << 4 & 63] + "=="
|
|
85
|
-
)) :
|
|
85
|
+
)) : C === 2 && (b = (v[_ - 2] << 8) + v[_ - 1], E.push(
|
|
86
86
|
n[b >> 10] + n[b >> 4 & 63] + n[b << 2 & 63] + "="
|
|
87
|
-
)),
|
|
87
|
+
)), E.join("");
|
|
88
88
|
}
|
|
89
|
-
return
|
|
89
|
+
return we;
|
|
90
90
|
}
|
|
91
91
|
var Ke = {};
|
|
92
|
-
var
|
|
93
|
-
function
|
|
94
|
-
return
|
|
95
|
-
var s, o, l = i * 8 - r - 1, h = (1 << l) - 1, d = h >> 1, p = -7, m = t ? i - 1 : 0,
|
|
96
|
-
for (m +=
|
|
92
|
+
var Gt;
|
|
93
|
+
function yn() {
|
|
94
|
+
return Gt || (Gt = 1, Ke.read = function(n, e, t, r, i) {
|
|
95
|
+
var s, o, l = i * 8 - r - 1, h = (1 << l) - 1, d = h >> 1, p = -7, m = t ? i - 1 : 0, y = t ? -1 : 1, v = n[e + m];
|
|
96
|
+
for (m += y, s = v & (1 << -p) - 1, v >>= -p, p += l; p > 0; s = s * 256 + n[e + m], m += y, p -= 8)
|
|
97
97
|
;
|
|
98
|
-
for (o = s & (1 << -p) - 1, s >>= -p, p += r; p > 0; o = o * 256 + n[e + m], m +=
|
|
98
|
+
for (o = s & (1 << -p) - 1, s >>= -p, p += r; p > 0; o = o * 256 + n[e + m], m += y, p -= 8)
|
|
99
99
|
;
|
|
100
100
|
if (s === 0)
|
|
101
101
|
s = 1 - d;
|
|
102
102
|
else {
|
|
103
103
|
if (s === h)
|
|
104
|
-
return o ? NaN : (
|
|
104
|
+
return o ? NaN : (v ? -1 : 1) * (1 / 0);
|
|
105
105
|
o = o + Math.pow(2, r), s = s - d;
|
|
106
106
|
}
|
|
107
|
-
return (
|
|
107
|
+
return (v ? -1 : 1) * o * Math.pow(2, s - r);
|
|
108
108
|
}, Ke.write = function(n, e, t, r, i, s) {
|
|
109
|
-
var o, l, h, d = s * 8 - i - 1, p = (1 << d) - 1, m = p >> 1,
|
|
110
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, o = p) : (o = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -o)) < 1 && (o--, h *= 2), o + m >= 1 ? e +=
|
|
109
|
+
var o, l, h, d = s * 8 - i - 1, p = (1 << d) - 1, m = p >> 1, y = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, v = r ? 0 : s - 1, b = r ? 1 : -1, _ = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
110
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (l = isNaN(e) ? 1 : 0, o = p) : (o = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -o)) < 1 && (o--, h *= 2), o + m >= 1 ? e += y / h : e += y * Math.pow(2, 1 - m), e * h >= 2 && (o++, h /= 2), o + m >= p ? (l = 0, o = p) : o + m >= 1 ? (l = (e * h - 1) * Math.pow(2, i), o = o + m) : (l = e * Math.pow(2, m - 1) * Math.pow(2, i), o = 0)); i >= 8; n[t + v] = l & 255, v += b, l /= 256, i -= 8)
|
|
111
111
|
;
|
|
112
|
-
for (o = o << i | l, d += i; d > 0; n[t +
|
|
112
|
+
for (o = o << i | l, d += i; d > 0; n[t + v] = o & 255, v += b, o /= 256, d -= 8)
|
|
113
113
|
;
|
|
114
|
-
n[t +
|
|
114
|
+
n[t + v - b] |= _ * 128;
|
|
115
115
|
}), Ke;
|
|
116
116
|
}
|
|
117
|
-
var nt,
|
|
118
|
-
function
|
|
119
|
-
if (
|
|
120
|
-
|
|
117
|
+
var nt, Jt;
|
|
118
|
+
function vn() {
|
|
119
|
+
if (Jt) return nt;
|
|
120
|
+
Jt = 1;
|
|
121
121
|
var n = {}.toString;
|
|
122
122
|
return nt = Array.isArray || function(e) {
|
|
123
123
|
return n.call(e) == "[object Array]";
|
|
124
124
|
}, nt;
|
|
125
125
|
}
|
|
126
|
-
var
|
|
127
|
-
function
|
|
128
|
-
return
|
|
129
|
-
var e =
|
|
130
|
-
n.Buffer = l, n.SlowBuffer =
|
|
126
|
+
var Zt;
|
|
127
|
+
function wn() {
|
|
128
|
+
return Zt || (Zt = 1, (function(n) {
|
|
129
|
+
var e = mn(), t = yn(), r = vn();
|
|
130
|
+
n.Buffer = l, n.SlowBuffer = E, n.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = globalThis.TYPED_ARRAY_SUPPORT !== void 0 ? globalThis.TYPED_ARRAY_SUPPORT : i(), n.kMaxLength = s();
|
|
131
131
|
function i() {
|
|
132
132
|
try {
|
|
133
133
|
var c = new Uint8Array(1);
|
|
@@ -166,7 +166,7 @@ function gn() {
|
|
|
166
166
|
function h(c, a, u, f) {
|
|
167
167
|
if (typeof a == "number")
|
|
168
168
|
throw new TypeError('"value" argument must not be a number');
|
|
169
|
-
return typeof ArrayBuffer < "u" && a instanceof ArrayBuffer ? b(c, a, u, f) : typeof a == "string" ?
|
|
169
|
+
return typeof ArrayBuffer < "u" && a instanceof ArrayBuffer ? b(c, a, u, f) : typeof a == "string" ? y(c, a, u) : _(c, a);
|
|
170
170
|
}
|
|
171
171
|
l.from = function(c, a, u) {
|
|
172
172
|
return h(null, c, a, u);
|
|
@@ -187,7 +187,7 @@ function gn() {
|
|
|
187
187
|
return p(null, c, a, u);
|
|
188
188
|
};
|
|
189
189
|
function m(c, a) {
|
|
190
|
-
if (d(a), c = o(c, a < 0 ? 0 :
|
|
190
|
+
if (d(a), c = o(c, a < 0 ? 0 : C(a) | 0), !l.TYPED_ARRAY_SUPPORT)
|
|
191
191
|
for (var u = 0; u < a; ++u)
|
|
192
192
|
c[u] = 0;
|
|
193
193
|
return c;
|
|
@@ -197,16 +197,16 @@ function gn() {
|
|
|
197
197
|
}, l.allocUnsafeSlow = function(c) {
|
|
198
198
|
return m(null, c);
|
|
199
199
|
};
|
|
200
|
-
function
|
|
200
|
+
function y(c, a, u) {
|
|
201
201
|
if ((typeof u != "string" || u === "") && (u = "utf8"), !l.isEncoding(u))
|
|
202
202
|
throw new TypeError('"encoding" must be a valid string encoding');
|
|
203
|
-
var f =
|
|
203
|
+
var f = T(a, u) | 0;
|
|
204
204
|
c = o(c, f);
|
|
205
205
|
var g = c.write(a, u);
|
|
206
206
|
return g !== f && (c = c.slice(0, g)), c;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
var u = a.length < 0 ? 0 :
|
|
208
|
+
function v(c, a) {
|
|
209
|
+
var u = a.length < 0 ? 0 : C(a.length) | 0;
|
|
210
210
|
c = o(c, u);
|
|
211
211
|
for (var f = 0; f < u; f += 1)
|
|
212
212
|
c[f] = a[f] & 255;
|
|
@@ -217,27 +217,27 @@ function gn() {
|
|
|
217
217
|
throw new RangeError("'offset' is out of bounds");
|
|
218
218
|
if (a.byteLength < u + (f || 0))
|
|
219
219
|
throw new RangeError("'length' is out of bounds");
|
|
220
|
-
return u === void 0 && f === void 0 ? a = new Uint8Array(a) : f === void 0 ? a = new Uint8Array(a, u) : a = new Uint8Array(a, u, f), l.TYPED_ARRAY_SUPPORT ? (c = a, c.__proto__ = l.prototype) : c =
|
|
220
|
+
return u === void 0 && f === void 0 ? a = new Uint8Array(a) : f === void 0 ? a = new Uint8Array(a, u) : a = new Uint8Array(a, u, f), l.TYPED_ARRAY_SUPPORT ? (c = a, c.__proto__ = l.prototype) : c = v(c, a), c;
|
|
221
221
|
}
|
|
222
222
|
function _(c, a) {
|
|
223
223
|
if (l.isBuffer(a)) {
|
|
224
|
-
var u =
|
|
224
|
+
var u = C(a.length) | 0;
|
|
225
225
|
return c = o(c, u), c.length === 0 || a.copy(c, 0, 0, u), c;
|
|
226
226
|
}
|
|
227
227
|
if (a) {
|
|
228
228
|
if (typeof ArrayBuffer < "u" && a.buffer instanceof ArrayBuffer || "length" in a)
|
|
229
|
-
return typeof a.length != "number" ||
|
|
229
|
+
return typeof a.length != "number" || pn(a.length) ? o(c, 0) : v(c, a);
|
|
230
230
|
if (a.type === "Buffer" && r(a.data))
|
|
231
|
-
return
|
|
231
|
+
return v(c, a.data);
|
|
232
232
|
}
|
|
233
233
|
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function C(c) {
|
|
236
236
|
if (c >= s())
|
|
237
237
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s().toString(16) + " bytes");
|
|
238
238
|
return c | 0;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function E(c) {
|
|
241
241
|
return +c != c && (c = 0), l.alloc(+c);
|
|
242
242
|
}
|
|
243
243
|
l.isBuffer = function(a) {
|
|
@@ -287,7 +287,7 @@ function gn() {
|
|
|
287
287
|
}
|
|
288
288
|
return g;
|
|
289
289
|
};
|
|
290
|
-
function
|
|
290
|
+
function T(c, a) {
|
|
291
291
|
if (l.isBuffer(c))
|
|
292
292
|
return c.length;
|
|
293
293
|
if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(c) || c instanceof ArrayBuffer))
|
|
@@ -313,13 +313,13 @@ function gn() {
|
|
|
313
313
|
case "hex":
|
|
314
314
|
return u >>> 1;
|
|
315
315
|
case "base64":
|
|
316
|
-
return
|
|
316
|
+
return Ht(c).length;
|
|
317
317
|
default:
|
|
318
318
|
if (f) return Ne(c).length;
|
|
319
319
|
a = ("" + a).toLowerCase(), f = !0;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
l.byteLength =
|
|
322
|
+
l.byteLength = T;
|
|
323
323
|
function P(c, a, u) {
|
|
324
324
|
var f = !1;
|
|
325
325
|
if ((a === void 0 || a < 0) && (a = 0), a > this.length || ((u === void 0 || u > this.length) && (u = this.length), u <= 0) || (u >>>= 0, a >>>= 0, u <= a))
|
|
@@ -327,22 +327,22 @@ function gn() {
|
|
|
327
327
|
for (c || (c = "utf8"); ; )
|
|
328
328
|
switch (c) {
|
|
329
329
|
case "hex":
|
|
330
|
-
return
|
|
330
|
+
return on(this, a, u);
|
|
331
331
|
case "utf8":
|
|
332
332
|
case "utf-8":
|
|
333
333
|
return ve(this, a, u);
|
|
334
334
|
case "ascii":
|
|
335
|
-
return
|
|
335
|
+
return nn(this, a, u);
|
|
336
336
|
case "latin1":
|
|
337
337
|
case "binary":
|
|
338
|
-
return
|
|
338
|
+
return sn(this, a, u);
|
|
339
339
|
case "base64":
|
|
340
340
|
return le(this, a, u);
|
|
341
341
|
case "ucs2":
|
|
342
342
|
case "ucs-2":
|
|
343
343
|
case "utf16le":
|
|
344
344
|
case "utf-16le":
|
|
345
|
-
return
|
|
345
|
+
return an(this, a, u);
|
|
346
346
|
default:
|
|
347
347
|
if (f) throw new TypeError("Unknown encoding: " + c);
|
|
348
348
|
c = (c + "").toLowerCase(), f = !0;
|
|
@@ -395,9 +395,9 @@ function gn() {
|
|
|
395
395
|
if (u >= f)
|
|
396
396
|
return 1;
|
|
397
397
|
if (u >>>= 0, f >>>= 0, g >>>= 0, w >>>= 0, this === a) return 0;
|
|
398
|
-
for (var S = w - g, I = f - u, D = Math.min(S, I),
|
|
399
|
-
if (
|
|
400
|
-
S =
|
|
398
|
+
for (var S = w - g, I = f - u, D = Math.min(S, I), R = this.slice(g, w), O = a.slice(u, f), $ = 0; $ < D; ++$)
|
|
399
|
+
if (R[$] !== O[$]) {
|
|
400
|
+
S = R[$], I = O[$];
|
|
401
401
|
break;
|
|
402
402
|
}
|
|
403
403
|
return S < I ? -1 : I < S ? 1 : 0;
|
|
@@ -423,25 +423,25 @@ function gn() {
|
|
|
423
423
|
return -1;
|
|
424
424
|
w = 2, S /= 2, I /= 2, u /= 2;
|
|
425
425
|
}
|
|
426
|
-
function D(
|
|
427
|
-
return w === 1 ?
|
|
426
|
+
function D(zt, Wt) {
|
|
427
|
+
return w === 1 ? zt[Wt] : zt.readUInt16BE(Wt * w);
|
|
428
428
|
}
|
|
429
|
-
var
|
|
429
|
+
var R;
|
|
430
430
|
if (g) {
|
|
431
431
|
var O = -1;
|
|
432
|
-
for (
|
|
433
|
-
if (D(c,
|
|
434
|
-
if (O === -1 && (O =
|
|
432
|
+
for (R = u; R < S; R++)
|
|
433
|
+
if (D(c, R) === D(a, O === -1 ? 0 : R - O)) {
|
|
434
|
+
if (O === -1 && (O = R), R - O + 1 === I) return O * w;
|
|
435
435
|
} else
|
|
436
|
-
O !== -1 && (
|
|
436
|
+
O !== -1 && (R -= R - O), O = -1;
|
|
437
437
|
} else
|
|
438
|
-
for (u + I > S && (u = S - I),
|
|
438
|
+
for (u + I > S && (u = S - I), R = u; R >= 0; R--) {
|
|
439
439
|
for (var $ = !0, Le = 0; Le < I; Le++)
|
|
440
|
-
if (D(c,
|
|
440
|
+
if (D(c, R + Le) !== D(a, Le)) {
|
|
441
441
|
$ = !1;
|
|
442
442
|
break;
|
|
443
443
|
}
|
|
444
|
-
if ($) return
|
|
444
|
+
if ($) return R;
|
|
445
445
|
}
|
|
446
446
|
return -1;
|
|
447
447
|
}
|
|
@@ -452,7 +452,7 @@ function gn() {
|
|
|
452
452
|
}, l.prototype.lastIndexOf = function(a, u, f) {
|
|
453
453
|
return F(this, a, u, f, !1);
|
|
454
454
|
};
|
|
455
|
-
function
|
|
455
|
+
function me(c, a, u, f) {
|
|
456
456
|
u = Number(u) || 0;
|
|
457
457
|
var g = c.length - u;
|
|
458
458
|
f ? (f = Number(f), f > g && (f = g)) : f = g;
|
|
@@ -469,17 +469,17 @@ function gn() {
|
|
|
469
469
|
function G(c, a, u, f) {
|
|
470
470
|
return qe(Ne(a, c.length - u), c, u, f);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
return qe(
|
|
472
|
+
function j(c, a, u, f) {
|
|
473
|
+
return qe(fn(a), c, u, f);
|
|
474
474
|
}
|
|
475
475
|
function Q(c, a, u, f) {
|
|
476
|
-
return
|
|
476
|
+
return j(c, a, u, f);
|
|
477
477
|
}
|
|
478
478
|
function ue(c, a, u, f) {
|
|
479
|
-
return qe(
|
|
479
|
+
return qe(Ht(a), c, u, f);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
return qe(
|
|
481
|
+
function ye(c, a, u, f) {
|
|
482
|
+
return qe(dn(a, c.length - u), c, u, f);
|
|
483
483
|
}
|
|
484
484
|
l.prototype.write = function(a, u, f, g) {
|
|
485
485
|
if (u === void 0)
|
|
@@ -499,12 +499,12 @@ function gn() {
|
|
|
499
499
|
for (var S = !1; ; )
|
|
500
500
|
switch (g) {
|
|
501
501
|
case "hex":
|
|
502
|
-
return
|
|
502
|
+
return me(this, a, u, f);
|
|
503
503
|
case "utf8":
|
|
504
504
|
case "utf-8":
|
|
505
505
|
return G(this, a, u, f);
|
|
506
506
|
case "ascii":
|
|
507
|
-
return
|
|
507
|
+
return j(this, a, u, f);
|
|
508
508
|
case "latin1":
|
|
509
509
|
case "binary":
|
|
510
510
|
return Q(this, a, u, f);
|
|
@@ -514,7 +514,7 @@ function gn() {
|
|
|
514
514
|
case "ucs-2":
|
|
515
515
|
case "utf16le":
|
|
516
516
|
case "utf-16le":
|
|
517
|
-
return
|
|
517
|
+
return ye(this, a, u, f);
|
|
518
518
|
default:
|
|
519
519
|
if (S) throw new TypeError("Unknown encoding: " + g);
|
|
520
520
|
g = ("" + g).toLowerCase(), S = !0;
|
|
@@ -533,7 +533,7 @@ function gn() {
|
|
|
533
533
|
for (var f = [], g = a; g < u; ) {
|
|
534
534
|
var w = c[g], S = null, I = w > 239 ? 4 : w > 223 ? 3 : w > 191 ? 2 : 1;
|
|
535
535
|
if (g + I <= u) {
|
|
536
|
-
var D,
|
|
536
|
+
var D, R, O, $;
|
|
537
537
|
switch (I) {
|
|
538
538
|
case 1:
|
|
539
539
|
w < 128 && (S = w);
|
|
@@ -542,10 +542,10 @@ function gn() {
|
|
|
542
542
|
D = c[g + 1], (D & 192) === 128 && ($ = (w & 31) << 6 | D & 63, $ > 127 && (S = $));
|
|
543
543
|
break;
|
|
544
544
|
case 3:
|
|
545
|
-
D = c[g + 1],
|
|
545
|
+
D = c[g + 1], R = c[g + 2], (D & 192) === 128 && (R & 192) === 128 && ($ = (w & 15) << 12 | (D & 63) << 6 | R & 63, $ > 2047 && ($ < 55296 || $ > 57343) && (S = $));
|
|
546
546
|
break;
|
|
547
547
|
case 4:
|
|
548
|
-
D = c[g + 1],
|
|
548
|
+
D = c[g + 1], R = c[g + 2], O = c[g + 3], (D & 192) === 128 && (R & 192) === 128 && (O & 192) === 128 && ($ = (w & 15) << 18 | (D & 63) << 12 | (R & 63) << 6 | O & 63, $ > 65535 && $ < 1114112 && (S = $));
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
S === null ? (S = 65533, I = 1) : S > 65535 && (S -= 65536, f.push(S >>> 10 & 1023 | 55296), S = 56320 | S & 1023), f.push(S), g += I;
|
|
@@ -564,28 +564,28 @@ function gn() {
|
|
|
564
564
|
);
|
|
565
565
|
return u;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function nn(c, a, u) {
|
|
568
568
|
var f = "";
|
|
569
569
|
u = Math.min(c.length, u);
|
|
570
570
|
for (var g = a; g < u; ++g)
|
|
571
571
|
f += String.fromCharCode(c[g] & 127);
|
|
572
572
|
return f;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function sn(c, a, u) {
|
|
575
575
|
var f = "";
|
|
576
576
|
u = Math.min(c.length, u);
|
|
577
577
|
for (var g = a; g < u; ++g)
|
|
578
578
|
f += String.fromCharCode(c[g]);
|
|
579
579
|
return f;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function on(c, a, u) {
|
|
582
582
|
var f = c.length;
|
|
583
583
|
(!a || a < 0) && (a = 0), (!u || u < 0 || u > f) && (u = f);
|
|
584
584
|
for (var g = "", w = a; w < u; ++w)
|
|
585
|
-
g +=
|
|
585
|
+
g += hn(c[w]);
|
|
586
586
|
return g;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function an(c, a, u) {
|
|
589
589
|
for (var f = c.slice(a, u), g = "", w = 0; w < f.length; w += 2)
|
|
590
590
|
g += String.fromCharCode(f[w] + f[w + 1] * 256);
|
|
591
591
|
return g;
|
|
@@ -735,25 +735,25 @@ function gn() {
|
|
|
735
735
|
}, l.prototype.writeInt32BE = function(a, u, f) {
|
|
736
736
|
return a = +a, u = u | 0, f || L(this, a, u, 4, 2147483647, -2147483648), a < 0 && (a = 4294967295 + a + 1), l.TYPED_ARRAY_SUPPORT ? (this[u] = a >>> 24, this[u + 1] = a >>> 16, this[u + 2] = a >>> 8, this[u + 3] = a & 255) : Oe(this, a, u, !1), u + 4;
|
|
737
737
|
};
|
|
738
|
-
function
|
|
738
|
+
function Kt(c, a, u, f, g, w) {
|
|
739
739
|
if (u + f > c.length) throw new RangeError("Index out of range");
|
|
740
740
|
if (u < 0) throw new RangeError("Index out of range");
|
|
741
741
|
}
|
|
742
|
-
function
|
|
743
|
-
return g ||
|
|
742
|
+
function jt(c, a, u, f, g) {
|
|
743
|
+
return g || Kt(c, a, u, 4), t.write(c, a, u, f, 23, 4), u + 4;
|
|
744
744
|
}
|
|
745
745
|
l.prototype.writeFloatLE = function(a, u, f) {
|
|
746
|
-
return
|
|
746
|
+
return jt(this, a, u, !0, f);
|
|
747
747
|
}, l.prototype.writeFloatBE = function(a, u, f) {
|
|
748
|
-
return
|
|
748
|
+
return jt(this, a, u, !1, f);
|
|
749
749
|
};
|
|
750
|
-
function
|
|
751
|
-
return g ||
|
|
750
|
+
function Vt(c, a, u, f, g) {
|
|
751
|
+
return g || Kt(c, a, u, 8), t.write(c, a, u, f, 52, 8), u + 8;
|
|
752
752
|
}
|
|
753
753
|
l.prototype.writeDoubleLE = function(a, u, f) {
|
|
754
|
-
return
|
|
754
|
+
return Vt(this, a, u, !0, f);
|
|
755
755
|
}, l.prototype.writeDoubleBE = function(a, u, f) {
|
|
756
|
-
return
|
|
756
|
+
return Vt(this, a, u, !1, f);
|
|
757
757
|
}, l.prototype.copy = function(a, u, f, g) {
|
|
758
758
|
if (f || (f = 0), !g && g !== 0 && (g = this.length), u >= a.length && (u = a.length), u || (u = 0), g > 0 && g < f && (g = f), g === f || a.length === 0 || this.length === 0) return 0;
|
|
759
759
|
if (u < 0)
|
|
@@ -802,17 +802,17 @@ function gn() {
|
|
|
802
802
|
}
|
|
803
803
|
return this;
|
|
804
804
|
};
|
|
805
|
-
var
|
|
806
|
-
function
|
|
807
|
-
if (c =
|
|
805
|
+
var un = /[^+\/0-9A-Za-z-_]/g;
|
|
806
|
+
function ln(c) {
|
|
807
|
+
if (c = cn(c).replace(un, ""), c.length < 2) return "";
|
|
808
808
|
for (; c.length % 4 !== 0; )
|
|
809
809
|
c = c + "=";
|
|
810
810
|
return c;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function cn(c) {
|
|
813
813
|
return c.trim ? c.trim() : c.replace(/^\s+|\s+$/g, "");
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function hn(c) {
|
|
816
816
|
return c < 16 ? "0" + c.toString(16) : c.toString(16);
|
|
817
817
|
}
|
|
818
818
|
function Ne(c, a) {
|
|
@@ -865,30 +865,30 @@ function gn() {
|
|
|
865
865
|
}
|
|
866
866
|
return w;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function fn(c) {
|
|
869
869
|
for (var a = [], u = 0; u < c.length; ++u)
|
|
870
870
|
a.push(c.charCodeAt(u) & 255);
|
|
871
871
|
return a;
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function dn(c, a) {
|
|
874
874
|
for (var u, f, g, w = [], S = 0; S < c.length && !((a -= 2) < 0); ++S)
|
|
875
875
|
u = c.charCodeAt(S), f = u >> 8, g = u % 256, w.push(g), w.push(f);
|
|
876
876
|
return w;
|
|
877
877
|
}
|
|
878
|
-
function
|
|
879
|
-
return e.toByteArray(
|
|
878
|
+
function Ht(c) {
|
|
879
|
+
return e.toByteArray(ln(c));
|
|
880
880
|
}
|
|
881
881
|
function qe(c, a, u, f) {
|
|
882
882
|
for (var g = 0; g < f && !(g + u >= a.length || g >= c.length); ++g)
|
|
883
883
|
a[g + u] = c[g];
|
|
884
884
|
return g;
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function pn(c) {
|
|
887
887
|
return c !== c;
|
|
888
888
|
}
|
|
889
889
|
})(rt)), rt;
|
|
890
890
|
}
|
|
891
|
-
var
|
|
891
|
+
var k = wn(), W;
|
|
892
892
|
typeof window < "u" && window.crypto && (W = window.crypto);
|
|
893
893
|
!W && typeof window < "u" && window.msCrypto && (W = window.msCrypto);
|
|
894
894
|
!W && typeof globalThis < "u" && globalThis.crypto && (W = globalThis.crypto);
|
|
@@ -897,7 +897,7 @@ if (!W && typeof require == "function")
|
|
|
897
897
|
W = require("crypto");
|
|
898
898
|
} catch {
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function bn() {
|
|
901
901
|
if (W) {
|
|
902
902
|
if (typeof W.getRandomValues == "function")
|
|
903
903
|
try {
|
|
@@ -912,50 +912,50 @@ function mn() {
|
|
|
912
912
|
}
|
|
913
913
|
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function Sn(n) {
|
|
916
916
|
for (var e = n.words, t = n.sigBytes, r = [], i = 0; i < t; i++) {
|
|
917
917
|
var s = e[i >>> 2] >>> 24 - i % 4 * 8 & 255;
|
|
918
918
|
r.push((s >>> 4).toString(16)), r.push((s & 15).toString(16));
|
|
919
919
|
}
|
|
920
920
|
return r.join("");
|
|
921
921
|
}
|
|
922
|
-
var
|
|
922
|
+
var Pr = /* @__PURE__ */ (function() {
|
|
923
923
|
function n(t, r) {
|
|
924
924
|
t = this.words = t || [], r != null ? this.sigBytes = r : this.sigBytes = t.length * 4;
|
|
925
925
|
}
|
|
926
926
|
var e = n.prototype;
|
|
927
927
|
return e.random = function(r) {
|
|
928
928
|
for (var i = [], s = 0; s < r; s += 4)
|
|
929
|
-
i.push(
|
|
929
|
+
i.push(bn());
|
|
930
930
|
return new n(i, r);
|
|
931
931
|
}, e.toString = function() {
|
|
932
|
-
return
|
|
932
|
+
return Sn(this);
|
|
933
933
|
}, n;
|
|
934
934
|
})(), it = {};
|
|
935
|
-
var
|
|
936
|
-
return
|
|
935
|
+
var dt = function(n, e) {
|
|
936
|
+
return dt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
|
|
937
937
|
t.__proto__ = r;
|
|
938
938
|
} || function(t, r) {
|
|
939
939
|
for (var i in r) r.hasOwnProperty(i) && (t[i] = r[i]);
|
|
940
|
-
},
|
|
940
|
+
}, dt(n, e);
|
|
941
941
|
};
|
|
942
|
-
function
|
|
943
|
-
|
|
942
|
+
function _n(n, e) {
|
|
943
|
+
dt(n, e);
|
|
944
944
|
function t() {
|
|
945
945
|
this.constructor = n;
|
|
946
946
|
}
|
|
947
947
|
n.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
|
|
948
948
|
}
|
|
949
|
-
var
|
|
950
|
-
return
|
|
949
|
+
var pt = function() {
|
|
950
|
+
return pt = Object.assign || function(e) {
|
|
951
951
|
for (var t, r = 1, i = arguments.length; r < i; r++) {
|
|
952
952
|
t = arguments[r];
|
|
953
953
|
for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]);
|
|
954
954
|
}
|
|
955
955
|
return e;
|
|
956
|
-
},
|
|
956
|
+
}, pt.apply(this, arguments);
|
|
957
957
|
};
|
|
958
|
-
function
|
|
958
|
+
function An(n, e) {
|
|
959
959
|
var t = {};
|
|
960
960
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
|
|
961
961
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -963,21 +963,21 @@ function wn(n, e) {
|
|
|
963
963
|
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[i]) && (t[r[i]] = n[r[i]]);
|
|
964
964
|
return t;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function xn(n, e, t, r) {
|
|
967
967
|
var i = arguments.length, s = i < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
968
968
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(n, e, t, r);
|
|
969
969
|
else for (var l = n.length - 1; l >= 0; l--) (o = n[l]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, t, s) : o(e, t)) || s);
|
|
970
970
|
return i > 3 && s && Object.defineProperty(e, t, s), s;
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function Cn(n, e) {
|
|
973
973
|
return function(t, r) {
|
|
974
974
|
e(t, r, n);
|
|
975
975
|
};
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function En(n, e) {
|
|
978
978
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(n, e);
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Un(n, e, t, r) {
|
|
981
981
|
function i(s) {
|
|
982
982
|
return s instanceof t ? s : new t(function(o) {
|
|
983
983
|
o(s);
|
|
@@ -1004,7 +1004,7 @@ function An(n, e, t, r) {
|
|
|
1004
1004
|
d((r = r.apply(n, e || [])).next());
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function Tn(n, e) {
|
|
1008
1008
|
var t = { label: 0, sent: function() {
|
|
1009
1009
|
if (s[0] & 1) throw s[1];
|
|
1010
1010
|
return s[1];
|
|
@@ -1064,13 +1064,13 @@ function Cn(n, e) {
|
|
|
1064
1064
|
return { value: d[0] ? d[1] : void 0, done: !0 };
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function In(n, e, t, r) {
|
|
1068
1068
|
r === void 0 && (r = t), n[r] = e[t];
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Dn(n, e) {
|
|
1071
1071
|
for (var t in n) t !== "default" && !e.hasOwnProperty(t) && (e[t] = n[t]);
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function gt(n) {
|
|
1074
1074
|
var e = typeof Symbol == "function" && Symbol.iterator, t = e && n[e], r = 0;
|
|
1075
1075
|
if (t) return t.call(n);
|
|
1076
1076
|
if (n && typeof n.length == "number") return {
|
|
@@ -1080,7 +1080,7 @@ function dt(n) {
|
|
|
1080
1080
|
};
|
|
1081
1081
|
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Fr(n, e) {
|
|
1084
1084
|
var t = typeof Symbol == "function" && n[Symbol.iterator];
|
|
1085
1085
|
if (!t) return n;
|
|
1086
1086
|
var r = t.call(n), i, s = [], o;
|
|
@@ -1097,55 +1097,55 @@ function Rr(n, e) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
return s;
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function kn() {
|
|
1101
1101
|
for (var n = [], e = 0; e < arguments.length; e++)
|
|
1102
|
-
n = n.concat(
|
|
1102
|
+
n = n.concat(Fr(arguments[e]));
|
|
1103
1103
|
return n;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function Rn() {
|
|
1106
1106
|
for (var n = 0, e = 0, t = arguments.length; e < t; e++) n += arguments[e].length;
|
|
1107
1107
|
for (var r = Array(n), i = 0, e = 0; e < t; e++)
|
|
1108
1108
|
for (var s = arguments[e], o = 0, l = s.length; o < l; o++, i++)
|
|
1109
1109
|
r[i] = s[o];
|
|
1110
1110
|
return r;
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1113
|
-
return this instanceof
|
|
1112
|
+
function ke(n) {
|
|
1113
|
+
return this instanceof ke ? (this.v = n, this) : new ke(n);
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function $n(n, e, t) {
|
|
1116
1116
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1117
1117
|
var r = t.apply(n, e || []), i, s = [];
|
|
1118
1118
|
return i = {}, o("next"), o("throw"), o("return"), i[Symbol.asyncIterator] = function() {
|
|
1119
1119
|
return this;
|
|
1120
1120
|
}, i;
|
|
1121
|
-
function o(
|
|
1122
|
-
r[
|
|
1121
|
+
function o(y) {
|
|
1122
|
+
r[y] && (i[y] = function(v) {
|
|
1123
1123
|
return new Promise(function(b, _) {
|
|
1124
|
-
s.push([
|
|
1124
|
+
s.push([y, v, b, _]) > 1 || l(y, v);
|
|
1125
1125
|
});
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
1128
|
-
function l(
|
|
1128
|
+
function l(y, v) {
|
|
1129
1129
|
try {
|
|
1130
|
-
h(r[
|
|
1130
|
+
h(r[y](v));
|
|
1131
1131
|
} catch (b) {
|
|
1132
1132
|
m(s[0][3], b);
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
function h(
|
|
1136
|
-
|
|
1135
|
+
function h(y) {
|
|
1136
|
+
y.value instanceof ke ? Promise.resolve(y.value.v).then(d, p) : m(s[0][2], y);
|
|
1137
1137
|
}
|
|
1138
|
-
function d(
|
|
1139
|
-
l("next",
|
|
1138
|
+
function d(y) {
|
|
1139
|
+
l("next", y);
|
|
1140
1140
|
}
|
|
1141
|
-
function p(
|
|
1142
|
-
l("throw",
|
|
1141
|
+
function p(y) {
|
|
1142
|
+
l("throw", y);
|
|
1143
1143
|
}
|
|
1144
|
-
function m(
|
|
1145
|
-
v
|
|
1144
|
+
function m(y, v) {
|
|
1145
|
+
y(v), s.shift(), s.length && l(s[0][0], s[0][1]);
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function Pn(n) {
|
|
1149
1149
|
var e, t;
|
|
1150
1150
|
return e = {}, r("next"), r("throw", function(i) {
|
|
1151
1151
|
throw i;
|
|
@@ -1154,14 +1154,14 @@ function Dn(n) {
|
|
|
1154
1154
|
}, e;
|
|
1155
1155
|
function r(i, s) {
|
|
1156
1156
|
e[i] = n[i] ? function(o) {
|
|
1157
|
-
return (t = !t) ? { value:
|
|
1157
|
+
return (t = !t) ? { value: ke(n[i](o)), done: i === "return" } : s ? s(o) : o;
|
|
1158
1158
|
} : s;
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function Fn(n) {
|
|
1162
1162
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1163
1163
|
var e = n[Symbol.asyncIterator], t;
|
|
1164
|
-
return e ? e.call(n) : (n = typeof
|
|
1164
|
+
return e ? e.call(n) : (n = typeof gt == "function" ? gt(n) : n[Symbol.iterator](), t = {}, r("next"), r("throw"), r("return"), t[Symbol.asyncIterator] = function() {
|
|
1165
1165
|
return this;
|
|
1166
1166
|
}, t);
|
|
1167
1167
|
function r(s) {
|
|
@@ -1177,60 +1177,60 @@ function Rn(n) {
|
|
|
1177
1177
|
}, o);
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function Bn(n, e) {
|
|
1181
1181
|
return Object.defineProperty ? Object.defineProperty(n, "raw", { value: e }) : n.raw = e, n;
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1183
|
+
function Mn(n) {
|
|
1184
1184
|
if (n && n.__esModule) return n;
|
|
1185
1185
|
var e = {};
|
|
1186
1186
|
if (n != null)
|
|
1187
1187
|
for (var t in n) Object.hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
1188
1188
|
return e.default = n, e;
|
|
1189
1189
|
}
|
|
1190
|
-
function
|
|
1190
|
+
function On(n) {
|
|
1191
1191
|
return n && n.__esModule ? n : { default: n };
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1193
|
+
function Nn(n, e) {
|
|
1194
1194
|
if (!e.has(n))
|
|
1195
1195
|
throw new TypeError("attempted to get private field on non-instance");
|
|
1196
1196
|
return e.get(n);
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function qn(n, e, t) {
|
|
1199
1199
|
if (!e.has(n))
|
|
1200
1200
|
throw new TypeError("attempted to set private field on non-instance");
|
|
1201
1201
|
return e.set(n, t), t;
|
|
1202
1202
|
}
|
|
1203
|
-
const
|
|
1203
|
+
const Ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1204
1204
|
__proto__: null,
|
|
1205
1205
|
get __assign() {
|
|
1206
|
-
return
|
|
1206
|
+
return pt;
|
|
1207
1207
|
},
|
|
1208
|
-
__asyncDelegator:
|
|
1209
|
-
__asyncGenerator:
|
|
1210
|
-
__asyncValues:
|
|
1211
|
-
__await:
|
|
1212
|
-
__awaiter:
|
|
1213
|
-
__classPrivateFieldGet:
|
|
1214
|
-
__classPrivateFieldSet:
|
|
1215
|
-
__createBinding:
|
|
1216
|
-
__decorate:
|
|
1217
|
-
__exportStar:
|
|
1218
|
-
__extends:
|
|
1219
|
-
__generator:
|
|
1220
|
-
__importDefault:
|
|
1221
|
-
__importStar:
|
|
1222
|
-
__makeTemplateObject:
|
|
1223
|
-
__metadata:
|
|
1224
|
-
__param:
|
|
1225
|
-
__read:
|
|
1226
|
-
__rest:
|
|
1227
|
-
__spread:
|
|
1228
|
-
__spreadArrays:
|
|
1229
|
-
__values:
|
|
1230
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1231
|
-
var
|
|
1232
|
-
function
|
|
1233
|
-
return
|
|
1208
|
+
__asyncDelegator: Pn,
|
|
1209
|
+
__asyncGenerator: $n,
|
|
1210
|
+
__asyncValues: Fn,
|
|
1211
|
+
__await: ke,
|
|
1212
|
+
__awaiter: Un,
|
|
1213
|
+
__classPrivateFieldGet: Nn,
|
|
1214
|
+
__classPrivateFieldSet: qn,
|
|
1215
|
+
__createBinding: In,
|
|
1216
|
+
__decorate: xn,
|
|
1217
|
+
__exportStar: Dn,
|
|
1218
|
+
__extends: _n,
|
|
1219
|
+
__generator: Tn,
|
|
1220
|
+
__importDefault: On,
|
|
1221
|
+
__importStar: Mn,
|
|
1222
|
+
__makeTemplateObject: Bn,
|
|
1223
|
+
__metadata: En,
|
|
1224
|
+
__param: Cn,
|
|
1225
|
+
__read: Fr,
|
|
1226
|
+
__rest: An,
|
|
1227
|
+
__spread: kn,
|
|
1228
|
+
__spreadArrays: Rn,
|
|
1229
|
+
__values: gt
|
|
1230
|
+
}, Symbol.toStringTag, { value: "Module" })), Br = /* @__PURE__ */ It(Ln);
|
|
1231
|
+
var be = {}, V = {}, Xt;
|
|
1232
|
+
function Mr() {
|
|
1233
|
+
return Xt || (Xt = 1, Object.defineProperty(V, "__esModule", { value: !0 }), V.MAX_HASHABLE_LENGTH = V.INIT = V.KEY = V.DIGEST_LENGTH = V.BLOCK_SIZE = void 0, V.BLOCK_SIZE = 64, V.DIGEST_LENGTH = 32, V.KEY = new Uint32Array([
|
|
1234
1234
|
1116352408,
|
|
1235
1235
|
1899447441,
|
|
1236
1236
|
3049323471,
|
|
@@ -1306,11 +1306,11 @@ function $r() {
|
|
|
1306
1306
|
1541459225
|
|
1307
1307
|
], V.MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1), V;
|
|
1308
1308
|
}
|
|
1309
|
-
var
|
|
1310
|
-
function
|
|
1311
|
-
if (
|
|
1312
|
-
|
|
1313
|
-
var n =
|
|
1309
|
+
var Se = {}, Qt;
|
|
1310
|
+
function Kn() {
|
|
1311
|
+
if (Qt) return Se;
|
|
1312
|
+
Qt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.RawSha256 = void 0;
|
|
1313
|
+
var n = Mr(), e = (
|
|
1314
1314
|
/** @class */
|
|
1315
1315
|
(function() {
|
|
1316
1316
|
function t() {
|
|
@@ -1340,26 +1340,26 @@ function On() {
|
|
|
1340
1340
|
l[o * 4] = this.state[o] >>> 24 & 255, l[o * 4 + 1] = this.state[o] >>> 16 & 255, l[o * 4 + 2] = this.state[o] >>> 8 & 255, l[o * 4 + 3] = this.state[o] >>> 0 & 255;
|
|
1341
1341
|
return l;
|
|
1342
1342
|
}, t.prototype.hashBuffer = function() {
|
|
1343
|
-
for (var r = this, i = r.buffer, s = r.state, o = s[0], l = s[1], h = s[2], d = s[3], p = s[4], m = s[5],
|
|
1343
|
+
for (var r = this, i = r.buffer, s = r.state, o = s[0], l = s[1], h = s[2], d = s[3], p = s[4], m = s[5], y = s[6], v = s[7], b = 0; b < n.BLOCK_SIZE; b++) {
|
|
1344
1344
|
if (b < 16)
|
|
1345
1345
|
this.temp[b] = (i[b * 4] & 255) << 24 | (i[b * 4 + 1] & 255) << 16 | (i[b * 4 + 2] & 255) << 8 | i[b * 4 + 3] & 255;
|
|
1346
1346
|
else {
|
|
1347
|
-
var _ = this.temp[b - 2],
|
|
1347
|
+
var _ = this.temp[b - 2], C = (_ >>> 17 | _ << 15) ^ (_ >>> 19 | _ << 13) ^ _ >>> 10;
|
|
1348
1348
|
_ = this.temp[b - 15];
|
|
1349
|
-
var
|
|
1350
|
-
this.temp[b] = (
|
|
1349
|
+
var E = (_ >>> 7 | _ << 25) ^ (_ >>> 18 | _ << 14) ^ _ >>> 3;
|
|
1350
|
+
this.temp[b] = (C + this.temp[b - 7] | 0) + (E + this.temp[b - 16] | 0);
|
|
1351
1351
|
}
|
|
1352
|
-
var
|
|
1353
|
-
|
|
1352
|
+
var T = (((p >>> 6 | p << 26) ^ (p >>> 11 | p << 21) ^ (p >>> 25 | p << 7)) + (p & m ^ ~p & y) | 0) + (v + (n.KEY[b] + this.temp[b] | 0) | 0) | 0, P = ((o >>> 2 | o << 30) ^ (o >>> 13 | o << 19) ^ (o >>> 22 | o << 10)) + (o & l ^ o & h ^ l & h) | 0;
|
|
1353
|
+
v = y, y = m, m = p, p = d + T | 0, d = h, h = l, l = o, o = T + P | 0;
|
|
1354
1354
|
}
|
|
1355
|
-
s[0] += o, s[1] += l, s[2] += h, s[3] += d, s[4] += p, s[5] += m, s[6] +=
|
|
1355
|
+
s[0] += o, s[1] += l, s[2] += h, s[3] += d, s[4] += p, s[5] += m, s[6] += y, s[7] += v;
|
|
1356
1356
|
}, t;
|
|
1357
1357
|
})()
|
|
1358
1358
|
);
|
|
1359
|
-
return
|
|
1359
|
+
return Se.RawSha256 = e, Se;
|
|
1360
1360
|
}
|
|
1361
|
-
var st = {},
|
|
1362
|
-
const
|
|
1361
|
+
var st = {}, _e = {};
|
|
1362
|
+
const jn = (n) => {
|
|
1363
1363
|
const e = [];
|
|
1364
1364
|
for (let t = 0, r = n.length; t < r; t++) {
|
|
1365
1365
|
const i = n.charCodeAt(t);
|
|
@@ -1374,7 +1374,7 @@ const Nn = (n) => {
|
|
|
1374
1374
|
e.push(i >> 12 | 224, i >> 6 & 63 | 128, i & 63 | 128);
|
|
1375
1375
|
}
|
|
1376
1376
|
return Uint8Array.from(e);
|
|
1377
|
-
},
|
|
1377
|
+
}, Vn = (n) => {
|
|
1378
1378
|
let e = "";
|
|
1379
1379
|
for (let t = 0, r = n.length; t < r; t++) {
|
|
1380
1380
|
const i = n[t];
|
|
@@ -1391,42 +1391,42 @@ const Nn = (n) => {
|
|
|
1391
1391
|
}
|
|
1392
1392
|
return e;
|
|
1393
1393
|
};
|
|
1394
|
-
function
|
|
1394
|
+
function Hn(n) {
|
|
1395
1395
|
return new TextEncoder().encode(n);
|
|
1396
1396
|
}
|
|
1397
|
-
function
|
|
1397
|
+
function zn(n) {
|
|
1398
1398
|
return new TextDecoder("utf-8").decode(n);
|
|
1399
1399
|
}
|
|
1400
|
-
const
|
|
1400
|
+
const Wn = (n) => typeof TextEncoder == "function" ? Hn(n) : jn(n), Yn = (n) => typeof TextDecoder == "function" ? zn(n) : Vn(n), Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1401
1401
|
__proto__: null,
|
|
1402
|
-
fromUtf8:
|
|
1403
|
-
toUtf8:
|
|
1404
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1405
|
-
var
|
|
1406
|
-
function
|
|
1407
|
-
if (
|
|
1408
|
-
|
|
1409
|
-
var n =
|
|
1402
|
+
fromUtf8: Wn,
|
|
1403
|
+
toUtf8: Yn
|
|
1404
|
+
}, Symbol.toStringTag, { value: "Module" })), Jn = /* @__PURE__ */ It(Gn);
|
|
1405
|
+
var er;
|
|
1406
|
+
function Zn() {
|
|
1407
|
+
if (er) return _e;
|
|
1408
|
+
er = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.convertToBuffer = void 0;
|
|
1409
|
+
var n = Jn, e = typeof Buffer < "u" && Buffer.from ? function(r) {
|
|
1410
1410
|
return Buffer.from(r, "utf8");
|
|
1411
1411
|
} : n.fromUtf8;
|
|
1412
1412
|
function t(r) {
|
|
1413
1413
|
return r instanceof Uint8Array ? r : typeof r == "string" ? e(r) : ArrayBuffer.isView(r) ? new Uint8Array(r.buffer, r.byteOffset, r.byteLength / Uint8Array.BYTES_PER_ELEMENT) : new Uint8Array(r);
|
|
1414
1414
|
}
|
|
1415
|
-
return
|
|
1415
|
+
return _e.convertToBuffer = t, _e;
|
|
1416
1416
|
}
|
|
1417
|
-
var
|
|
1418
|
-
function
|
|
1419
|
-
if (
|
|
1420
|
-
|
|
1417
|
+
var Ae = {}, tr;
|
|
1418
|
+
function Xn() {
|
|
1419
|
+
if (tr) return Ae;
|
|
1420
|
+
tr = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.isEmptyData = void 0;
|
|
1421
1421
|
function n(e) {
|
|
1422
1422
|
return typeof e == "string" ? e.length === 0 : e.byteLength === 0;
|
|
1423
1423
|
}
|
|
1424
|
-
return
|
|
1424
|
+
return Ae.isEmptyData = n, Ae;
|
|
1425
1425
|
}
|
|
1426
|
-
var
|
|
1427
|
-
function
|
|
1428
|
-
if (
|
|
1429
|
-
|
|
1426
|
+
var xe = {}, rr;
|
|
1427
|
+
function Qn() {
|
|
1428
|
+
if (rr) return xe;
|
|
1429
|
+
rr = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.numToUint8 = void 0;
|
|
1430
1430
|
function n(e) {
|
|
1431
1431
|
return new Uint8Array([
|
|
1432
1432
|
(e & 4278190080) >> 24,
|
|
@@ -1435,12 +1435,12 @@ function Gn() {
|
|
|
1435
1435
|
e & 255
|
|
1436
1436
|
]);
|
|
1437
1437
|
}
|
|
1438
|
-
return
|
|
1438
|
+
return xe.numToUint8 = n, xe;
|
|
1439
1439
|
}
|
|
1440
|
-
var Ce = {},
|
|
1441
|
-
function
|
|
1442
|
-
if (
|
|
1443
|
-
|
|
1440
|
+
var Ce = {}, nr;
|
|
1441
|
+
function ei() {
|
|
1442
|
+
if (nr) return Ce;
|
|
1443
|
+
nr = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.uint32ArrayFrom = void 0;
|
|
1444
1444
|
function n(e) {
|
|
1445
1445
|
if (!Array.from) {
|
|
1446
1446
|
for (var t = new Uint32Array(e.length), r = 0; r < e.length; )
|
|
@@ -1451,33 +1451,33 @@ function Jn() {
|
|
|
1451
1451
|
}
|
|
1452
1452
|
return Ce.uint32ArrayFrom = n, Ce;
|
|
1453
1453
|
}
|
|
1454
|
-
var
|
|
1455
|
-
function
|
|
1456
|
-
return
|
|
1454
|
+
var ir;
|
|
1455
|
+
function ti() {
|
|
1456
|
+
return ir || (ir = 1, (function(n) {
|
|
1457
1457
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.uint32ArrayFrom = n.numToUint8 = n.isEmptyData = n.convertToBuffer = void 0;
|
|
1458
|
-
var e =
|
|
1458
|
+
var e = Zn();
|
|
1459
1459
|
Object.defineProperty(n, "convertToBuffer", { enumerable: !0, get: function() {
|
|
1460
1460
|
return e.convertToBuffer;
|
|
1461
1461
|
} });
|
|
1462
|
-
var t =
|
|
1462
|
+
var t = Xn();
|
|
1463
1463
|
Object.defineProperty(n, "isEmptyData", { enumerable: !0, get: function() {
|
|
1464
1464
|
return t.isEmptyData;
|
|
1465
1465
|
} });
|
|
1466
|
-
var r =
|
|
1466
|
+
var r = Qn();
|
|
1467
1467
|
Object.defineProperty(n, "numToUint8", { enumerable: !0, get: function() {
|
|
1468
1468
|
return r.numToUint8;
|
|
1469
1469
|
} });
|
|
1470
|
-
var i =
|
|
1470
|
+
var i = ei();
|
|
1471
1471
|
Object.defineProperty(n, "uint32ArrayFrom", { enumerable: !0, get: function() {
|
|
1472
1472
|
return i.uint32ArrayFrom;
|
|
1473
1473
|
} });
|
|
1474
1474
|
})(st)), st;
|
|
1475
1475
|
}
|
|
1476
|
-
var
|
|
1477
|
-
function
|
|
1478
|
-
if (
|
|
1479
|
-
|
|
1480
|
-
var n =
|
|
1476
|
+
var sr;
|
|
1477
|
+
function ri() {
|
|
1478
|
+
if (sr) return be;
|
|
1479
|
+
sr = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.Sha256 = void 0;
|
|
1480
|
+
var n = Br, e = Mr(), t = Kn(), r = ti(), i = (
|
|
1481
1481
|
/** @class */
|
|
1482
1482
|
(function() {
|
|
1483
1483
|
function o(l) {
|
|
@@ -1512,7 +1512,7 @@ function Xn() {
|
|
|
1512
1512
|
}, o;
|
|
1513
1513
|
})()
|
|
1514
1514
|
);
|
|
1515
|
-
|
|
1515
|
+
be.Sha256 = i;
|
|
1516
1516
|
function s(o) {
|
|
1517
1517
|
var l = (0, r.convertToBuffer)(o);
|
|
1518
1518
|
if (l.byteLength > e.BLOCK_SIZE) {
|
|
@@ -1522,80 +1522,80 @@ function Xn() {
|
|
|
1522
1522
|
var d = new Uint8Array(e.BLOCK_SIZE);
|
|
1523
1523
|
return d.set(l), d;
|
|
1524
1524
|
}
|
|
1525
|
-
return
|
|
1525
|
+
return be;
|
|
1526
1526
|
}
|
|
1527
|
-
var
|
|
1528
|
-
function
|
|
1529
|
-
return
|
|
1527
|
+
var or;
|
|
1528
|
+
function ni() {
|
|
1529
|
+
return or || (or = 1, (function(n) {
|
|
1530
1530
|
Object.defineProperty(n, "__esModule", { value: !0 });
|
|
1531
|
-
var e =
|
|
1532
|
-
(0, e.__exportStar)(
|
|
1531
|
+
var e = Br;
|
|
1532
|
+
(0, e.__exportStar)(ri(), n);
|
|
1533
1533
|
})(it)), it;
|
|
1534
1534
|
}
|
|
1535
|
-
var Ie =
|
|
1535
|
+
var Ie = ni();
|
|
1536
1536
|
function A(n, e) {
|
|
1537
1537
|
n != null && this.fromString(n, e);
|
|
1538
1538
|
}
|
|
1539
1539
|
function q() {
|
|
1540
1540
|
return new A(null);
|
|
1541
1541
|
}
|
|
1542
|
-
var Z,
|
|
1543
|
-
function
|
|
1542
|
+
var Z, ii = 244837814094590, ar = (ii & 16777215) == 15715070;
|
|
1543
|
+
function si(n, e, t, r, i, s) {
|
|
1544
1544
|
for (; --s >= 0; ) {
|
|
1545
1545
|
var o = e * this[n++] + t[r] + i;
|
|
1546
1546
|
i = Math.floor(o / 67108864), t[r++] = o & 67108863;
|
|
1547
1547
|
}
|
|
1548
1548
|
return i;
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1550
|
+
function oi(n, e, t, r, i, s) {
|
|
1551
1551
|
for (var o = e & 32767, l = e >> 15; --s >= 0; ) {
|
|
1552
1552
|
var h = this[n] & 32767, d = this[n++] >> 15, p = l * h + d * o;
|
|
1553
1553
|
h = o * h + ((p & 32767) << 15) + t[r] + (i & 1073741823), i = (h >>> 30) + (p >>> 15) + l * d + (i >>> 30), t[r++] = h & 1073741823;
|
|
1554
1554
|
}
|
|
1555
1555
|
return i;
|
|
1556
1556
|
}
|
|
1557
|
-
function
|
|
1557
|
+
function ai(n, e, t, r, i, s) {
|
|
1558
1558
|
for (var o = e & 16383, l = e >> 14; --s >= 0; ) {
|
|
1559
1559
|
var h = this[n] & 16383, d = this[n++] >> 14, p = l * h + d * o;
|
|
1560
1560
|
h = o * h + ((p & 16383) << 14) + t[r] + i, i = (h >> 28) + (p >> 14) + l * d, t[r++] = h & 268435455;
|
|
1561
1561
|
}
|
|
1562
1562
|
return i;
|
|
1563
1563
|
}
|
|
1564
|
-
var
|
|
1565
|
-
|
|
1564
|
+
var ur = typeof navigator < "u";
|
|
1565
|
+
ur && ar && navigator.appName == "Microsoft Internet Explorer" ? (A.prototype.am = oi, Z = 30) : ur && ar && navigator.appName != "Netscape" ? (A.prototype.am = si, Z = 26) : (A.prototype.am = ai, Z = 28);
|
|
1566
1566
|
A.prototype.DB = Z;
|
|
1567
1567
|
A.prototype.DM = (1 << Z) - 1;
|
|
1568
1568
|
A.prototype.DV = 1 << Z;
|
|
1569
|
-
var
|
|
1570
|
-
A.prototype.FV = Math.pow(2,
|
|
1571
|
-
A.prototype.F1 =
|
|
1572
|
-
A.prototype.F2 = 2 * Z -
|
|
1573
|
-
var
|
|
1574
|
-
|
|
1575
|
-
for (Y = 0; Y <= 9; ++Y) Xe[
|
|
1576
|
-
|
|
1577
|
-
for (Y = 10; Y < 36; ++Y) Xe[
|
|
1578
|
-
|
|
1579
|
-
for (Y = 10; Y < 36; ++Y) Xe[
|
|
1580
|
-
function
|
|
1581
|
-
return
|
|
1582
|
-
}
|
|
1583
|
-
function
|
|
1569
|
+
var Dt = 52;
|
|
1570
|
+
A.prototype.FV = Math.pow(2, Dt);
|
|
1571
|
+
A.prototype.F1 = Dt - Z;
|
|
1572
|
+
A.prototype.F2 = 2 * Z - Dt;
|
|
1573
|
+
var ui = "0123456789abcdefghijklmnopqrstuvwxyz", Xe = new Array(), pe, Y;
|
|
1574
|
+
pe = 48;
|
|
1575
|
+
for (Y = 0; Y <= 9; ++Y) Xe[pe++] = Y;
|
|
1576
|
+
pe = 97;
|
|
1577
|
+
for (Y = 10; Y < 36; ++Y) Xe[pe++] = Y;
|
|
1578
|
+
pe = 65;
|
|
1579
|
+
for (Y = 10; Y < 36; ++Y) Xe[pe++] = Y;
|
|
1580
|
+
function lr(n) {
|
|
1581
|
+
return ui.charAt(n);
|
|
1582
|
+
}
|
|
1583
|
+
function li(n, e) {
|
|
1584
1584
|
var t = Xe[n.charCodeAt(e)];
|
|
1585
1585
|
return t ?? -1;
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1587
|
+
function ci(n) {
|
|
1588
1588
|
for (var e = this.t - 1; e >= 0; --e) n[e] = this[e];
|
|
1589
1589
|
n.t = this.t, n.s = this.s;
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function hi(n) {
|
|
1592
1592
|
this.t = 1, this.s = n < 0 ? -1 : 0, n > 0 ? this[0] = n : n < -1 ? this[0] = n + this.DV : this.t = 0;
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function kt(n) {
|
|
1595
1595
|
var e = q();
|
|
1596
1596
|
return e.fromInt(n), e;
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function fi(n, e) {
|
|
1599
1599
|
var t;
|
|
1600
1600
|
if (e == 16) t = 4;
|
|
1601
1601
|
else if (e == 8) t = 3;
|
|
@@ -1605,7 +1605,7 @@ function ui(n, e) {
|
|
|
1605
1605
|
else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");
|
|
1606
1606
|
this.t = 0, this.s = 0;
|
|
1607
1607
|
for (var r = n.length, i = !1, s = 0; --r >= 0; ) {
|
|
1608
|
-
var o =
|
|
1608
|
+
var o = li(n, r);
|
|
1609
1609
|
if (o < 0) {
|
|
1610
1610
|
n.charAt(r) == "-" && (i = !0);
|
|
1611
1611
|
continue;
|
|
@@ -1614,10 +1614,10 @@ function ui(n, e) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
this.clamp(), i && A.ZERO.subTo(this, this);
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function di() {
|
|
1618
1618
|
for (var n = this.s & this.DM; this.t > 0 && this[this.t - 1] == n; ) --this.t;
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1620
|
+
function pi(n) {
|
|
1621
1621
|
if (this.s < 0) return "-" + this.negate().toString(n);
|
|
1622
1622
|
var e;
|
|
1623
1623
|
if (n == 16) e = 4;
|
|
@@ -1628,18 +1628,18 @@ function ci(n) {
|
|
|
1628
1628
|
else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");
|
|
1629
1629
|
var t = (1 << e) - 1, r, i = !1, s = "", o = this.t, l = this.DB - o * this.DB % e;
|
|
1630
1630
|
if (o-- > 0)
|
|
1631
|
-
for (l < this.DB && (r = this[o] >> l) > 0 && (i = !0, s =
|
|
1632
|
-
l < e ? (r = (this[o] & (1 << l) - 1) << e - l, r |= this[--o] >> (l += this.DB - e)) : (r = this[o] >> (l -= e) & t, l <= 0 && (l += this.DB, --o)), r > 0 && (i = !0), i && (s +=
|
|
1631
|
+
for (l < this.DB && (r = this[o] >> l) > 0 && (i = !0, s = lr(r)); o >= 0; )
|
|
1632
|
+
l < e ? (r = (this[o] & (1 << l) - 1) << e - l, r |= this[--o] >> (l += this.DB - e)) : (r = this[o] >> (l -= e) & t, l <= 0 && (l += this.DB, --o)), r > 0 && (i = !0), i && (s += lr(r));
|
|
1633
1633
|
return i ? s : "0";
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function gi() {
|
|
1636
1636
|
var n = q();
|
|
1637
1637
|
return A.ZERO.subTo(this, n), n;
|
|
1638
1638
|
}
|
|
1639
|
-
function
|
|
1639
|
+
function mi() {
|
|
1640
1640
|
return this.s < 0 ? this.negate() : this;
|
|
1641
1641
|
}
|
|
1642
|
-
function
|
|
1642
|
+
function yi(n) {
|
|
1643
1643
|
var e = this.s - n.s;
|
|
1644
1644
|
if (e != 0) return e;
|
|
1645
1645
|
var t = this.t;
|
|
@@ -1647,31 +1647,31 @@ function di(n) {
|
|
|
1647
1647
|
for (; --t >= 0; ) if ((e = this[t] - n[t]) != 0) return e;
|
|
1648
1648
|
return 0;
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1650
|
+
function Rt(n) {
|
|
1651
1651
|
var e = 1, t;
|
|
1652
1652
|
return (t = n >>> 16) != 0 && (n = t, e += 16), (t = n >> 8) != 0 && (n = t, e += 8), (t = n >> 4) != 0 && (n = t, e += 4), (t = n >> 2) != 0 && (n = t, e += 2), (t = n >> 1) != 0 && (n = t, e += 1), e;
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1655
|
-
return this.t <= 0 ? 0 : this.DB * (this.t - 1) +
|
|
1654
|
+
function vi() {
|
|
1655
|
+
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + Rt(this[this.t - 1] ^ this.s & this.DM);
|
|
1656
1656
|
}
|
|
1657
|
-
function
|
|
1657
|
+
function wi(n, e) {
|
|
1658
1658
|
var t;
|
|
1659
1659
|
for (t = this.t - 1; t >= 0; --t) e[t + n] = this[t];
|
|
1660
1660
|
for (t = n - 1; t >= 0; --t) e[t] = 0;
|
|
1661
1661
|
e.t = this.t + n, e.s = this.s;
|
|
1662
1662
|
}
|
|
1663
|
-
function
|
|
1663
|
+
function bi(n, e) {
|
|
1664
1664
|
for (var t = n; t < this.t; ++t) e[t - n] = this[t];
|
|
1665
1665
|
e.t = Math.max(this.t - n, 0), e.s = this.s;
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1667
|
+
function Si(n, e) {
|
|
1668
1668
|
var t = n % this.DB, r = this.DB - t, i = (1 << r) - 1, s = Math.floor(n / this.DB), o = this.s << t & this.DM, l;
|
|
1669
1669
|
for (l = this.t - 1; l >= 0; --l)
|
|
1670
1670
|
e[l + s + 1] = this[l] >> r | o, o = (this[l] & i) << t;
|
|
1671
1671
|
for (l = s - 1; l >= 0; --l) e[l] = 0;
|
|
1672
1672
|
e[s] = o, e.t = this.t + s + 1, e.s = this.s, e.clamp();
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function _i(n, e) {
|
|
1675
1675
|
e.s = this.s;
|
|
1676
1676
|
var t = Math.floor(n / this.DB);
|
|
1677
1677
|
if (t >= this.t) {
|
|
@@ -1684,7 +1684,7 @@ function yi(n, e) {
|
|
|
1684
1684
|
e[o - t - 1] |= (this[o] & s) << i, e[o - t] = this[o] >> r;
|
|
1685
1685
|
r > 0 && (e[this.t - t - 1] |= (this.s & s) << i), e.t = this.t - t, e.clamp();
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1687
|
+
function Ai(n, e) {
|
|
1688
1688
|
for (var t = 0, r = 0, i = Math.min(n.t, this.t); t < i; )
|
|
1689
1689
|
r += this[t] - n[t], e[t++] = r & this.DM, r >>= this.DB;
|
|
1690
1690
|
if (n.t < this.t) {
|
|
@@ -1698,13 +1698,13 @@ function wi(n, e) {
|
|
|
1698
1698
|
}
|
|
1699
1699
|
e.s = r < 0 ? -1 : 0, r < -1 ? e[t++] = this.DV + r : r > 0 && (e[t++] = r), e.t = t, e.clamp();
|
|
1700
1700
|
}
|
|
1701
|
-
function
|
|
1701
|
+
function xi(n, e) {
|
|
1702
1702
|
var t = this.abs(), r = n.abs(), i = t.t;
|
|
1703
1703
|
for (e.t = i + r.t; --i >= 0; ) e[i] = 0;
|
|
1704
1704
|
for (i = 0; i < r.t; ++i) e[i + t.t] = t.am(0, r[i], e, i, 0, t.t);
|
|
1705
1705
|
e.s = 0, e.clamp(), this.s != n.s && A.ZERO.subTo(e, e);
|
|
1706
1706
|
}
|
|
1707
|
-
function
|
|
1707
|
+
function Ci(n) {
|
|
1708
1708
|
for (var e = this.abs(), t = n.t = 2 * e.t; --t >= 0; ) n[t] = 0;
|
|
1709
1709
|
for (t = 0; t < e.t - 1; ++t) {
|
|
1710
1710
|
var r = e.am(t, e[t], n, 2 * t, 0, 1);
|
|
@@ -1712,7 +1712,7 @@ function Si(n) {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
n.t > 0 && (n[n.t - 1] += e.am(t, e[t], n, 2 * t, 0, 1)), n.s = 0, n.clamp();
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function Ei(n, e, t) {
|
|
1716
1716
|
var r = n.abs();
|
|
1717
1717
|
if (!(r.t <= 0)) {
|
|
1718
1718
|
var i = this.abs();
|
|
@@ -1721,36 +1721,36 @@ function _i(n, e, t) {
|
|
|
1721
1721
|
return;
|
|
1722
1722
|
}
|
|
1723
1723
|
t == null && (t = q());
|
|
1724
|
-
var s = q(), o = this.s, l = n.s, h = this.DB -
|
|
1724
|
+
var s = q(), o = this.s, l = n.s, h = this.DB - Rt(r[r.t - 1]);
|
|
1725
1725
|
h > 0 ? (r.lShiftTo(h, s), i.lShiftTo(h, t)) : (r.copyTo(s), i.copyTo(t));
|
|
1726
1726
|
var d = s.t, p = s[d - 1];
|
|
1727
1727
|
if (p != 0) {
|
|
1728
|
-
var m = p * (1 << this.F1) + (d > 1 ? s[d - 2] >> this.F2 : 0),
|
|
1729
|
-
for (s.dlShiftTo(
|
|
1730
|
-
for (; --
|
|
1731
|
-
var
|
|
1732
|
-
if ((t[_] += s.am(0,
|
|
1733
|
-
for (s.dlShiftTo(
|
|
1728
|
+
var m = p * (1 << this.F1) + (d > 1 ? s[d - 2] >> this.F2 : 0), y = this.FV / m, v = (1 << this.F1) / m, b = 1 << this.F2, _ = t.t, C = _ - d, E = e ?? q();
|
|
1729
|
+
for (s.dlShiftTo(C, E), t.compareTo(E) >= 0 && (t[t.t++] = 1, t.subTo(E, t)), A.ONE.dlShiftTo(d, E), E.subTo(s, s); s.t < d; ) s[s.t++] = 0;
|
|
1730
|
+
for (; --C >= 0; ) {
|
|
1731
|
+
var T = t[--_] == p ? this.DM : Math.floor(t[_] * y + (t[_ - 1] + b) * v);
|
|
1732
|
+
if ((t[_] += s.am(0, T, t, C, 0, d)) < T)
|
|
1733
|
+
for (s.dlShiftTo(C, E), t.subTo(E, t); t[_] < --T; ) t.subTo(E, t);
|
|
1734
1734
|
}
|
|
1735
1735
|
e != null && (t.drShiftTo(d, e), o != l && A.ZERO.subTo(e, e)), t.t = d, t.clamp(), h > 0 && t.rShiftTo(h, t), o < 0 && A.ZERO.subTo(t, t);
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
1738
|
}
|
|
1739
|
-
function
|
|
1739
|
+
function Ui(n) {
|
|
1740
1740
|
var e = q();
|
|
1741
1741
|
return this.abs().divRemTo(n, null, e), this.s < 0 && e.compareTo(A.ZERO) > 0 && n.subTo(e, e), e;
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function Ti() {
|
|
1744
1744
|
if (this.t < 1) return 0;
|
|
1745
1745
|
var n = this[0];
|
|
1746
1746
|
if ((n & 1) == 0) return 0;
|
|
1747
1747
|
var e = n & 3;
|
|
1748
1748
|
return e = e * (2 - (n & 15) * e) & 15, e = e * (2 - (n & 255) * e) & 255, e = e * (2 - ((n & 65535) * e & 65535)) & 65535, e = e * (2 - n * e % this.DV) % this.DV, e > 0 ? this.DV - e : -e;
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function Ii(n) {
|
|
1751
1751
|
return this.compareTo(n) == 0;
|
|
1752
1752
|
}
|
|
1753
|
-
function
|
|
1753
|
+
function Di(n, e) {
|
|
1754
1754
|
for (var t = 0, r = 0, i = Math.min(n.t, this.t); t < i; )
|
|
1755
1755
|
r += this[t] + n[t], e[t++] = r & this.DM, r >>= this.DB;
|
|
1756
1756
|
if (n.t < this.t) {
|
|
@@ -1764,34 +1764,34 @@ function Ei(n, e) {
|
|
|
1764
1764
|
}
|
|
1765
1765
|
e.s = r < 0 ? -1 : 0, r > 0 ? e[t++] = r : r < -1 && (e[t++] = this.DV + r), e.t = t, e.clamp();
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1767
|
+
function ki(n) {
|
|
1768
1768
|
var e = q();
|
|
1769
1769
|
return this.addTo(n, e), e;
|
|
1770
1770
|
}
|
|
1771
|
-
function
|
|
1771
|
+
function Ri(n) {
|
|
1772
1772
|
var e = q();
|
|
1773
1773
|
return this.subTo(n, e), e;
|
|
1774
1774
|
}
|
|
1775
|
-
function
|
|
1775
|
+
function $i(n) {
|
|
1776
1776
|
var e = q();
|
|
1777
1777
|
return this.multiplyTo(n, e), e;
|
|
1778
1778
|
}
|
|
1779
|
-
function
|
|
1779
|
+
function Pi(n) {
|
|
1780
1780
|
var e = q();
|
|
1781
1781
|
return this.divRemTo(n, e, null), e;
|
|
1782
1782
|
}
|
|
1783
|
-
function
|
|
1783
|
+
function ge(n) {
|
|
1784
1784
|
this.m = n, this.mp = n.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << n.DB - 15) - 1, this.mt2 = 2 * n.t;
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1786
|
+
function Fi(n) {
|
|
1787
1787
|
var e = q();
|
|
1788
1788
|
return n.abs().dlShiftTo(this.m.t, e), e.divRemTo(this.m, null, e), n.s < 0 && e.compareTo(A.ZERO) > 0 && this.m.subTo(e, e), e;
|
|
1789
1789
|
}
|
|
1790
|
-
function
|
|
1790
|
+
function Bi(n) {
|
|
1791
1791
|
var e = q();
|
|
1792
1792
|
return n.copyTo(e), this.reduce(e), e;
|
|
1793
1793
|
}
|
|
1794
|
-
function
|
|
1794
|
+
function Mi(n) {
|
|
1795
1795
|
for (; n.t <= this.mt2; )
|
|
1796
1796
|
n[n.t++] = 0;
|
|
1797
1797
|
for (var e = 0; e < this.m.t; ++e) {
|
|
@@ -1801,19 +1801,19 @@ function $i(n) {
|
|
|
1801
1801
|
}
|
|
1802
1802
|
n.clamp(), n.drShiftTo(this.m.t, n), n.compareTo(this.m) >= 0 && n.subTo(this.m, n);
|
|
1803
1803
|
}
|
|
1804
|
-
function
|
|
1804
|
+
function Oi(n, e) {
|
|
1805
1805
|
n.squareTo(e), this.reduce(e);
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function Ni(n, e, t) {
|
|
1808
1808
|
n.multiplyTo(e, t), this.reduce(t);
|
|
1809
1809
|
}
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
function
|
|
1816
|
-
var r = n.bitLength(), i, s =
|
|
1810
|
+
ge.prototype.convert = Fi;
|
|
1811
|
+
ge.prototype.revert = Bi;
|
|
1812
|
+
ge.prototype.reduce = Mi;
|
|
1813
|
+
ge.prototype.mulTo = Ni;
|
|
1814
|
+
ge.prototype.sqrTo = Oi;
|
|
1815
|
+
function qi(n, e, t) {
|
|
1816
|
+
var r = n.bitLength(), i, s = kt(1), o = new ge(e);
|
|
1817
1817
|
if (r <= 0) return s;
|
|
1818
1818
|
r < 18 ? i = 1 : r < 48 ? i = 3 : r < 144 ? i = 4 : r < 768 ? i = 5 : i = 6;
|
|
1819
1819
|
var l = new Array(), h = 3, d = i - 1, p = (1 << i) - 1;
|
|
@@ -1822,58 +1822,58 @@ function Bi(n, e, t) {
|
|
|
1822
1822
|
for (o.sqrTo(l[1], m); h <= p; )
|
|
1823
1823
|
l[h] = q(), o.mulTo(m, l[h - 2], l[h]), h += 2;
|
|
1824
1824
|
}
|
|
1825
|
-
var
|
|
1826
|
-
for (r =
|
|
1827
|
-
for (r >= d ?
|
|
1828
|
-
|
|
1829
|
-
if ((r -= h) < 0 && (r += this.DB, --
|
|
1830
|
-
l[
|
|
1825
|
+
var y = n.t - 1, v, b = !0, _ = q(), C;
|
|
1826
|
+
for (r = Rt(n[y]) - 1; y >= 0; ) {
|
|
1827
|
+
for (r >= d ? v = n[y] >> r - d & p : (v = (n[y] & (1 << r + 1) - 1) << d - r, y > 0 && (v |= n[y - 1] >> this.DB + r - d)), h = i; (v & 1) == 0; )
|
|
1828
|
+
v >>= 1, --h;
|
|
1829
|
+
if ((r -= h) < 0 && (r += this.DB, --y), b)
|
|
1830
|
+
l[v].copyTo(s), b = !1;
|
|
1831
1831
|
else {
|
|
1832
1832
|
for (; h > 1; )
|
|
1833
1833
|
o.sqrTo(s, _), o.sqrTo(_, s), h -= 2;
|
|
1834
|
-
h > 0 ? o.sqrTo(s, _) : (
|
|
1835
|
-
}
|
|
1836
|
-
for (;
|
|
1837
|
-
o.sqrTo(s, _),
|
|
1838
|
-
}
|
|
1839
|
-
var
|
|
1840
|
-
return t(null,
|
|
1841
|
-
}
|
|
1842
|
-
A.prototype.copyTo =
|
|
1843
|
-
A.prototype.fromInt =
|
|
1844
|
-
A.prototype.fromString =
|
|
1845
|
-
A.prototype.clamp =
|
|
1846
|
-
A.prototype.dlShiftTo =
|
|
1847
|
-
A.prototype.drShiftTo =
|
|
1848
|
-
A.prototype.lShiftTo =
|
|
1849
|
-
A.prototype.rShiftTo =
|
|
1850
|
-
A.prototype.subTo =
|
|
1851
|
-
A.prototype.multiplyTo =
|
|
1852
|
-
A.prototype.squareTo =
|
|
1853
|
-
A.prototype.divRemTo =
|
|
1854
|
-
A.prototype.invDigit =
|
|
1855
|
-
A.prototype.addTo =
|
|
1856
|
-
A.prototype.toString =
|
|
1857
|
-
A.prototype.negate =
|
|
1858
|
-
A.prototype.abs =
|
|
1859
|
-
A.prototype.compareTo =
|
|
1860
|
-
A.prototype.bitLength =
|
|
1861
|
-
A.prototype.mod =
|
|
1862
|
-
A.prototype.equals =
|
|
1863
|
-
A.prototype.add =
|
|
1864
|
-
A.prototype.subtract =
|
|
1865
|
-
A.prototype.multiply =
|
|
1866
|
-
A.prototype.divide =
|
|
1867
|
-
A.prototype.modPow =
|
|
1868
|
-
A.ZERO =
|
|
1869
|
-
A.ONE =
|
|
1834
|
+
h > 0 ? o.sqrTo(s, _) : (C = s, s = _, _ = C), o.mulTo(_, l[v], s);
|
|
1835
|
+
}
|
|
1836
|
+
for (; y >= 0 && (n[y] & 1 << r) == 0; )
|
|
1837
|
+
o.sqrTo(s, _), C = s, s = _, _ = C, --r < 0 && (r = this.DB - 1, --y);
|
|
1838
|
+
}
|
|
1839
|
+
var E = o.revert(s);
|
|
1840
|
+
return t(null, E), E;
|
|
1841
|
+
}
|
|
1842
|
+
A.prototype.copyTo = ci;
|
|
1843
|
+
A.prototype.fromInt = hi;
|
|
1844
|
+
A.prototype.fromString = fi;
|
|
1845
|
+
A.prototype.clamp = di;
|
|
1846
|
+
A.prototype.dlShiftTo = wi;
|
|
1847
|
+
A.prototype.drShiftTo = bi;
|
|
1848
|
+
A.prototype.lShiftTo = Si;
|
|
1849
|
+
A.prototype.rShiftTo = _i;
|
|
1850
|
+
A.prototype.subTo = Ai;
|
|
1851
|
+
A.prototype.multiplyTo = xi;
|
|
1852
|
+
A.prototype.squareTo = Ci;
|
|
1853
|
+
A.prototype.divRemTo = Ei;
|
|
1854
|
+
A.prototype.invDigit = Ti;
|
|
1855
|
+
A.prototype.addTo = Di;
|
|
1856
|
+
A.prototype.toString = pi;
|
|
1857
|
+
A.prototype.negate = gi;
|
|
1858
|
+
A.prototype.abs = mi;
|
|
1859
|
+
A.prototype.compareTo = yi;
|
|
1860
|
+
A.prototype.bitLength = vi;
|
|
1861
|
+
A.prototype.mod = Ui;
|
|
1862
|
+
A.prototype.equals = Ii;
|
|
1863
|
+
A.prototype.add = ki;
|
|
1864
|
+
A.prototype.subtract = Ri;
|
|
1865
|
+
A.prototype.multiply = $i;
|
|
1866
|
+
A.prototype.divide = Pi;
|
|
1867
|
+
A.prototype.modPow = qi;
|
|
1868
|
+
A.ZERO = kt(0);
|
|
1869
|
+
A.ONE = kt(1);
|
|
1870
1870
|
function ot(n) {
|
|
1871
|
-
return
|
|
1871
|
+
return k.Buffer.from(new Pr().random(n).toString(), "hex");
|
|
1872
1872
|
}
|
|
1873
|
-
var
|
|
1873
|
+
var Li = /^[89a-f]/i, Ki = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF", ji = "userAttributes.", ne = /* @__PURE__ */ (function() {
|
|
1874
1874
|
function n(t) {
|
|
1875
|
-
this.N = new A(
|
|
1876
|
-
}), this.infoBits =
|
|
1875
|
+
this.N = new A(Ki, 16), this.g = new A("2", 16), this.k = new A(this.hexHash("" + this.padHex(this.N) + this.padHex(this.g)), 16), this.smallAValue = this.generateRandomSmallA(), this.getLargeAValue(function() {
|
|
1876
|
+
}), this.infoBits = k.Buffer.from("Caldera Derived Key", "utf8"), this.poolName = t;
|
|
1877
1877
|
}
|
|
1878
1878
|
var e = n.prototype;
|
|
1879
1879
|
return e.getSmallAValue = function() {
|
|
@@ -1913,12 +1913,12 @@ var Mi = /^[89a-f]/i, Oi = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD12902
|
|
|
1913
1913
|
}, e.hash = function(r) {
|
|
1914
1914
|
var i = new Ie.Sha256();
|
|
1915
1915
|
i.update(r);
|
|
1916
|
-
var s = i.digestSync(), o =
|
|
1916
|
+
var s = i.digestSync(), o = k.Buffer.from(s).toString("hex");
|
|
1917
1917
|
return new Array(64 - o.length).join("0") + o;
|
|
1918
1918
|
}, e.hexHash = function(r) {
|
|
1919
|
-
return this.hash(
|
|
1919
|
+
return this.hash(k.Buffer.from(r, "hex"));
|
|
1920
1920
|
}, e.computehkdf = function(r, i) {
|
|
1921
|
-
var s =
|
|
1921
|
+
var s = k.Buffer.concat([this.infoBits, k.Buffer.from("", "utf8")]), o = new Ie.Sha256(i);
|
|
1922
1922
|
o.update(r);
|
|
1923
1923
|
var l = o.digestSync(), h = new Ie.Sha256(l);
|
|
1924
1924
|
h.update(s);
|
|
@@ -1931,9 +1931,9 @@ var Mi = /^[89a-f]/i, Oi = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD12902
|
|
|
1931
1931
|
if (this.UValue = this.calculateU(this.largeAValue, s), this.UValue.equals(A.ZERO))
|
|
1932
1932
|
throw new Error("U cannot be zero.");
|
|
1933
1933
|
var d = "" + this.poolName + r + ":" + i, p = this.hash(d), m = new A(this.hexHash(this.padHex(o) + p), 16);
|
|
1934
|
-
this.calculateS(m, s, function(
|
|
1935
|
-
|
|
1936
|
-
var b = h.computehkdf(
|
|
1934
|
+
this.calculateS(m, s, function(y, v) {
|
|
1935
|
+
y && l(y, null);
|
|
1936
|
+
var b = h.computehkdf(k.Buffer.from(h.padHex(v), "hex"), k.Buffer.from(h.padHex(h.UValue), "hex"));
|
|
1937
1937
|
l(null, b);
|
|
1938
1938
|
});
|
|
1939
1939
|
}, e.calculateS = function(r, i, s) {
|
|
@@ -1946,12 +1946,12 @@ var Mi = /^[89a-f]/i, Oi = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD12902
|
|
|
1946
1946
|
});
|
|
1947
1947
|
});
|
|
1948
1948
|
}, e.getNewPasswordRequiredChallengeUserAttributePrefix = function() {
|
|
1949
|
-
return
|
|
1949
|
+
return ji;
|
|
1950
1950
|
}, e.padHex = function(r) {
|
|
1951
1951
|
if (!(r instanceof A))
|
|
1952
1952
|
throw new Error("Not a BigInteger");
|
|
1953
1953
|
var i = r.compareTo(A.ZERO) < 0, s = r.abs().toString(16);
|
|
1954
|
-
if (s = s.length % 2 !== 0 ? "0" + s : s, s =
|
|
1954
|
+
if (s = s.length % 2 !== 0 ? "0" + s : s, s = Li.test(s) ? "00" + s : s, i) {
|
|
1955
1955
|
var o = s.split("").map(function(h) {
|
|
1956
1956
|
var d = ~parseInt(h, 16) & 15;
|
|
1957
1957
|
return "0123456789ABCDEF".charAt(d);
|
|
@@ -1961,7 +1961,7 @@ var Mi = /^[89a-f]/i, Oi = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD12902
|
|
|
1961
1961
|
return s;
|
|
1962
1962
|
}, n;
|
|
1963
1963
|
})();
|
|
1964
|
-
var
|
|
1964
|
+
var Or = /* @__PURE__ */ (function() {
|
|
1965
1965
|
function n(t) {
|
|
1966
1966
|
this.jwtToken = t || "", this.payload = this.decodePayload();
|
|
1967
1967
|
}
|
|
@@ -1975,43 +1975,43 @@ var Pr = /* @__PURE__ */ (function() {
|
|
|
1975
1975
|
}, e.decodePayload = function() {
|
|
1976
1976
|
var r = this.jwtToken.split(".")[1];
|
|
1977
1977
|
try {
|
|
1978
|
-
return JSON.parse(
|
|
1978
|
+
return JSON.parse(k.Buffer.from(r, "base64").toString("utf8"));
|
|
1979
1979
|
} catch {
|
|
1980
1980
|
return {};
|
|
1981
1981
|
}
|
|
1982
1982
|
}, n;
|
|
1983
1983
|
})();
|
|
1984
|
-
function
|
|
1985
|
-
n.prototype = Object.create(e.prototype), n.prototype.constructor = n,
|
|
1984
|
+
function Vi(n, e) {
|
|
1985
|
+
n.prototype = Object.create(e.prototype), n.prototype.constructor = n, mt(n, e);
|
|
1986
1986
|
}
|
|
1987
|
-
function
|
|
1988
|
-
return
|
|
1987
|
+
function mt(n, e) {
|
|
1988
|
+
return mt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
|
|
1989
1989
|
return t.__proto__ = r, t;
|
|
1990
|
-
},
|
|
1990
|
+
}, mt(n, e);
|
|
1991
1991
|
}
|
|
1992
|
-
var
|
|
1992
|
+
var yt = /* @__PURE__ */ (function(n) {
|
|
1993
1993
|
function e(t) {
|
|
1994
1994
|
var r = t === void 0 ? {} : t, i = r.AccessToken;
|
|
1995
1995
|
return n.call(this, i || "") || this;
|
|
1996
1996
|
}
|
|
1997
|
-
return
|
|
1998
|
-
})(
|
|
1999
|
-
function
|
|
2000
|
-
n.prototype = Object.create(e.prototype), n.prototype.constructor = n,
|
|
1997
|
+
return Vi(e, n), e;
|
|
1998
|
+
})(Or);
|
|
1999
|
+
function Hi(n, e) {
|
|
2000
|
+
n.prototype = Object.create(e.prototype), n.prototype.constructor = n, vt(n, e);
|
|
2001
2001
|
}
|
|
2002
|
-
function
|
|
2003
|
-
return
|
|
2002
|
+
function vt(n, e) {
|
|
2003
|
+
return vt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
|
|
2004
2004
|
return t.__proto__ = r, t;
|
|
2005
|
-
},
|
|
2005
|
+
}, vt(n, e);
|
|
2006
2006
|
}
|
|
2007
|
-
var
|
|
2007
|
+
var wt = /* @__PURE__ */ (function(n) {
|
|
2008
2008
|
function e(t) {
|
|
2009
2009
|
var r = t === void 0 ? {} : t, i = r.IdToken;
|
|
2010
2010
|
return n.call(this, i || "") || this;
|
|
2011
2011
|
}
|
|
2012
|
-
return
|
|
2013
|
-
})(
|
|
2014
|
-
var
|
|
2012
|
+
return Hi(e, n), e;
|
|
2013
|
+
})(Or);
|
|
2014
|
+
var bt = /* @__PURE__ */ (function() {
|
|
2015
2015
|
function n(t) {
|
|
2016
2016
|
var r = t === void 0 ? {} : t, i = r.RefreshToken;
|
|
2017
2017
|
this.token = i || "";
|
|
@@ -2020,14 +2020,14 @@ var yt = /* @__PURE__ */ (function() {
|
|
|
2020
2020
|
return e.getToken = function() {
|
|
2021
2021
|
return this.token;
|
|
2022
2022
|
}, n;
|
|
2023
|
-
})(),
|
|
2024
|
-
var
|
|
2025
|
-
userAgent:
|
|
2023
|
+
})(), zi = "5.0.4";
|
|
2024
|
+
var Wi = "aws-amplify/" + zi, Nr = {
|
|
2025
|
+
userAgent: Wi,
|
|
2026
2026
|
isReactNative: typeof navigator < "u" && navigator.product === "ReactNative"
|
|
2027
|
-
},
|
|
2028
|
-
return
|
|
2027
|
+
}, Yi = function() {
|
|
2028
|
+
return Nr.userAgent;
|
|
2029
2029
|
};
|
|
2030
|
-
var
|
|
2030
|
+
var St = /* @__PURE__ */ (function() {
|
|
2031
2031
|
function n(t) {
|
|
2032
2032
|
var r = t === void 0 ? {} : t, i = r.IdToken, s = r.RefreshToken, o = r.AccessToken, l = r.ClockDrift;
|
|
2033
2033
|
if (o == null || i == null)
|
|
@@ -2051,12 +2051,12 @@ var wt = /* @__PURE__ */ (function() {
|
|
|
2051
2051
|
return i < this.accessToken.getExpiration() && i < this.idToken.getExpiration();
|
|
2052
2052
|
}, n;
|
|
2053
2053
|
})();
|
|
2054
|
-
var
|
|
2054
|
+
var Gi = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], Ji = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], _t = /* @__PURE__ */ (function() {
|
|
2055
2055
|
function n() {
|
|
2056
2056
|
}
|
|
2057
2057
|
var e = n.prototype;
|
|
2058
2058
|
return e.getNowString = function() {
|
|
2059
|
-
var r = /* @__PURE__ */ new Date(), i =
|
|
2059
|
+
var r = /* @__PURE__ */ new Date(), i = Ji[r.getUTCDay()], s = Gi[r.getUTCMonth()], o = r.getUTCDate(), l = r.getUTCHours();
|
|
2060
2060
|
l < 10 && (l = "0" + l);
|
|
2061
2061
|
var h = r.getUTCMinutes();
|
|
2062
2062
|
h < 10 && (h = "0" + h);
|
|
@@ -2066,7 +2066,7 @@ var Hi = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
|
|
|
2066
2066
|
return m;
|
|
2067
2067
|
}, n;
|
|
2068
2068
|
})();
|
|
2069
|
-
var
|
|
2069
|
+
var qr = /* @__PURE__ */ (function() {
|
|
2070
2070
|
function n(t) {
|
|
2071
2071
|
var r = t === void 0 ? {} : t, i = r.Name, s = r.Value;
|
|
2072
2072
|
this.Name = i || "", this.Value = s || "";
|
|
@@ -2089,7 +2089,7 @@ var Br = /* @__PURE__ */ (function() {
|
|
|
2089
2089
|
};
|
|
2090
2090
|
}, n;
|
|
2091
2091
|
})();
|
|
2092
|
-
var te = {},
|
|
2092
|
+
var te = {}, Zi = /* @__PURE__ */ (function() {
|
|
2093
2093
|
function n() {
|
|
2094
2094
|
}
|
|
2095
2095
|
return n.setItem = function(t, r) {
|
|
@@ -2101,12 +2101,12 @@ var te = {}, Wi = /* @__PURE__ */ (function() {
|
|
|
2101
2101
|
}, n.clear = function() {
|
|
2102
2102
|
return te = {}, te;
|
|
2103
2103
|
}, n;
|
|
2104
|
-
})(),
|
|
2104
|
+
})(), Lr = /* @__PURE__ */ (function() {
|
|
2105
2105
|
function n() {
|
|
2106
2106
|
try {
|
|
2107
2107
|
this.storageWindow = window.localStorage, this.storageWindow.setItem("aws.cognito.test-ls", 1), this.storageWindow.removeItem("aws.cognito.test-ls");
|
|
2108
2108
|
} catch {
|
|
2109
|
-
this.storageWindow =
|
|
2109
|
+
this.storageWindow = Zi;
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
2112
|
var e = n.prototype;
|
|
@@ -2114,11 +2114,11 @@ var te = {}, Wi = /* @__PURE__ */ (function() {
|
|
|
2114
2114
|
return this.storageWindow;
|
|
2115
2115
|
}, n;
|
|
2116
2116
|
})();
|
|
2117
|
-
var
|
|
2117
|
+
var Xi = typeof navigator < "u", cr = Xi ? Nr.isReactNative ? "react-native" : navigator.userAgent : "nodejs", At = /* @__PURE__ */ (function() {
|
|
2118
2118
|
function n(t) {
|
|
2119
2119
|
if (t == null || t.Username == null || t.Pool == null)
|
|
2120
2120
|
throw new Error("Username and Pool information are required.");
|
|
2121
|
-
this.username = t.Username || "", this.pool = t.Pool, this.Session = null, this.client = t.Pool.client, this.signInUserSession = null, this.authenticationFlowType = "USER_SRP_AUTH", this.storage = t.Storage || new
|
|
2121
|
+
this.username = t.Username || "", this.pool = t.Pool, this.Session = null, this.client = t.Pool.client, this.signInUserSession = null, this.authenticationFlowType = "USER_SRP_AUTH", this.storage = t.Storage || new Lr().getStorage(), this.keyPrefix = "CognitoIdentityServiceProvider." + this.pool.getClientId(), this.userDataKey = this.keyPrefix + "." + this.username + ".userData";
|
|
2122
2122
|
}
|
|
2123
2123
|
var e = n.prototype;
|
|
2124
2124
|
return e.setSignInUserSession = function(r) {
|
|
@@ -2143,44 +2143,44 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2143
2143
|
this.getUserContextData() && (h.UserContextData = this.getUserContextData()), this.client.request("InitiateAuth", h, function(d, p) {
|
|
2144
2144
|
if (d)
|
|
2145
2145
|
return i.onFailure(d);
|
|
2146
|
-
var m = p.ChallengeName,
|
|
2147
|
-
return m === "CUSTOM_CHALLENGE" ? (s.Session = p.Session, i.customChallenge(
|
|
2146
|
+
var m = p.ChallengeName, y = p.ChallengeParameters;
|
|
2147
|
+
return m === "CUSTOM_CHALLENGE" ? (s.Session = p.Session, i.customChallenge(y)) : (s.signInUserSession = s.getCognitoUserSession(p.AuthenticationResult), s.cacheTokens(), i.onSuccess(s.signInUserSession));
|
|
2148
2148
|
});
|
|
2149
2149
|
}, e.authenticateUser = function(r, i) {
|
|
2150
2150
|
return this.authenticationFlowType === "USER_PASSWORD_AUTH" ? this.authenticateUserPlainUsernamePassword(r, i) : this.authenticationFlowType === "USER_SRP_AUTH" || this.authenticationFlowType === "CUSTOM_AUTH" ? this.authenticateUserDefaultAuth(r, i) : i.onFailure(new Error("Authentication flow type is invalid."));
|
|
2151
2151
|
}, e.authenticateUserDefaultAuth = function(r, i) {
|
|
2152
|
-
var s = this, o = new ne(this.pool.getUserPoolName()), l = new
|
|
2153
|
-
this.deviceKey != null && (p.DEVICE_KEY = this.deviceKey), p.USERNAME = this.username, o.getLargeAValue(function(m,
|
|
2154
|
-
m && i.onFailure(m), p.SRP_A =
|
|
2155
|
-
var
|
|
2152
|
+
var s = this, o = new ne(this.pool.getUserPoolName()), l = new _t(), h, d, p = {};
|
|
2153
|
+
this.deviceKey != null && (p.DEVICE_KEY = this.deviceKey), p.USERNAME = this.username, o.getLargeAValue(function(m, y) {
|
|
2154
|
+
m && i.onFailure(m), p.SRP_A = y.toString(16), s.authenticationFlowType === "CUSTOM_AUTH" && (p.CHALLENGE_NAME = "SRP_A");
|
|
2155
|
+
var v = Object.keys(r.getValidationData()).length !== 0 ? r.getValidationData() : r.getClientMetadata(), b = {
|
|
2156
2156
|
AuthFlow: s.authenticationFlowType,
|
|
2157
2157
|
ClientId: s.pool.getClientId(),
|
|
2158
2158
|
AuthParameters: p,
|
|
2159
|
-
ClientMetadata:
|
|
2159
|
+
ClientMetadata: v
|
|
2160
2160
|
};
|
|
2161
|
-
s.getUserContextData(s.username) && (b.UserContextData = s.getUserContextData(s.username)), s.client.request("InitiateAuth", b, function(_,
|
|
2161
|
+
s.getUserContextData(s.username) && (b.UserContextData = s.getUserContextData(s.username)), s.client.request("InitiateAuth", b, function(_, C) {
|
|
2162
2162
|
if (_)
|
|
2163
2163
|
return i.onFailure(_);
|
|
2164
|
-
var
|
|
2165
|
-
s.username =
|
|
2166
|
-
|
|
2167
|
-
var B = l.getNowString(), F =
|
|
2164
|
+
var E = C.ChallengeParameters;
|
|
2165
|
+
s.username = E.USER_ID_FOR_SRP, s.userDataKey = s.keyPrefix + "." + s.username + ".userData", h = new A(E.SRP_B, 16), d = new A(E.SALT, 16), s.getCachedDeviceKeyAndPassword(), o.getPasswordAuthenticationKey(s.username, r.getPassword(), h, d, function(T, P) {
|
|
2166
|
+
T && i.onFailure(T);
|
|
2167
|
+
var B = l.getNowString(), F = k.Buffer.concat([k.Buffer.from(s.pool.getUserPoolName(), "utf8"), k.Buffer.from(s.username, "utf8"), k.Buffer.from(E.SECRET_BLOCK, "base64"), k.Buffer.from(B, "utf8")]), X = new Ie.Sha256(P);
|
|
2168
2168
|
X.update(F);
|
|
2169
|
-
var
|
|
2170
|
-
|
|
2169
|
+
var me = X.digestSync(), G = k.Buffer.from(me).toString("base64"), j = {};
|
|
2170
|
+
j.USERNAME = s.username, j.PASSWORD_CLAIM_SECRET_BLOCK = E.SECRET_BLOCK, j.TIMESTAMP = B, j.PASSWORD_CLAIM_SIGNATURE = G, s.deviceKey != null && (j.DEVICE_KEY = s.deviceKey);
|
|
2171
2171
|
var Q = function(le, ve) {
|
|
2172
2172
|
return s.client.request("RespondToAuthChallenge", le, function(ee, tt) {
|
|
2173
|
-
return ee && ee.code === "ResourceNotFoundException" && ee.message.toLowerCase().indexOf("device") !== -1 ? (
|
|
2173
|
+
return ee && ee.code === "ResourceNotFoundException" && ee.message.toLowerCase().indexOf("device") !== -1 ? (j.DEVICE_KEY = null, s.deviceKey = null, s.randomPassword = null, s.deviceGroupKey = null, s.clearCachedDeviceKeyAndPassword(), Q(le, ve)) : ve(ee, tt);
|
|
2174
2174
|
});
|
|
2175
2175
|
}, ue = {
|
|
2176
2176
|
ChallengeName: "PASSWORD_VERIFIER",
|
|
2177
2177
|
ClientId: s.pool.getClientId(),
|
|
2178
|
-
ChallengeResponses:
|
|
2179
|
-
Session:
|
|
2180
|
-
ClientMetadata:
|
|
2178
|
+
ChallengeResponses: j,
|
|
2179
|
+
Session: C.Session,
|
|
2180
|
+
ClientMetadata: v
|
|
2181
2181
|
};
|
|
2182
|
-
s.getUserContextData() && (ue.UserContextData = s.getUserContextData()), Q(ue, function(
|
|
2183
|
-
return
|
|
2182
|
+
s.getUserContextData() && (ue.UserContextData = s.getUserContextData()), Q(ue, function(ye, le) {
|
|
2183
|
+
return ye ? i.onFailure(ye) : s.authenticateUserInternal(le, o, i);
|
|
2184
2184
|
});
|
|
2185
2185
|
});
|
|
2186
2186
|
});
|
|
@@ -2216,10 +2216,10 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2216
2216
|
return this.Session = r.Session, s.customChallenge(h);
|
|
2217
2217
|
if (l === "NEW_PASSWORD_REQUIRED") {
|
|
2218
2218
|
this.Session = r.Session;
|
|
2219
|
-
var d = null, p = null, m = [],
|
|
2219
|
+
var d = null, p = null, m = [], y = i.getNewPasswordRequiredChallengeUserAttributePrefix();
|
|
2220
2220
|
if (h && (d = JSON.parse(r.ChallengeParameters.userAttributes), p = JSON.parse(r.ChallengeParameters.requiredAttributes)), p)
|
|
2221
|
-
for (var
|
|
2222
|
-
m[
|
|
2221
|
+
for (var v = 0; v < p.length; v++)
|
|
2222
|
+
m[v] = p[v].substr(y.length);
|
|
2223
2223
|
return s.newPasswordRequired(d, m);
|
|
2224
2224
|
}
|
|
2225
2225
|
if (l === "DEVICE_SRP_AUTH") {
|
|
@@ -2233,17 +2233,17 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2233
2233
|
i.generateHashDevice(r.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, r.AuthenticationResult.NewDeviceMetadata.DeviceKey, function(_) {
|
|
2234
2234
|
if (_)
|
|
2235
2235
|
return s.onFailure(_);
|
|
2236
|
-
var
|
|
2237
|
-
Salt:
|
|
2238
|
-
PasswordVerifier:
|
|
2236
|
+
var C = {
|
|
2237
|
+
Salt: k.Buffer.from(i.getSaltDevices(), "hex").toString("base64"),
|
|
2238
|
+
PasswordVerifier: k.Buffer.from(i.getVerifierDevices(), "hex").toString("base64")
|
|
2239
2239
|
};
|
|
2240
|
-
o.verifierDevices =
|
|
2240
|
+
o.verifierDevices = C.PasswordVerifier, o.deviceGroupKey = b.DeviceGroupKey, o.randomPassword = i.getRandomPassword(), o.client.request("ConfirmDevice", {
|
|
2241
2241
|
DeviceKey: b.DeviceKey,
|
|
2242
2242
|
AccessToken: o.signInUserSession.getAccessToken().getJwtToken(),
|
|
2243
|
-
DeviceSecretVerifierConfig:
|
|
2244
|
-
DeviceName:
|
|
2245
|
-
}, function(
|
|
2246
|
-
return
|
|
2243
|
+
DeviceSecretVerifierConfig: C,
|
|
2244
|
+
DeviceName: cr
|
|
2245
|
+
}, function(E, T) {
|
|
2246
|
+
return E ? s.onFailure(E) : (o.deviceKey = r.AuthenticationResult.NewDeviceMetadata.DeviceKey, o.cacheDeviceKeyAndPassword(), T.UserConfirmationNecessary === !0 ? s.onSuccess(o.signInUserSession, T.UserConfirmationNecessary) : s.onSuccess(o.signInUserSession));
|
|
2247
2247
|
});
|
|
2248
2248
|
});
|
|
2249
2249
|
}, e.completeNewPasswordChallenge = function(r, i, s, o) {
|
|
@@ -2251,8 +2251,8 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2251
2251
|
if (!r)
|
|
2252
2252
|
return s.onFailure(new Error("New password is required."));
|
|
2253
2253
|
var h = new ne(this.pool.getUserPoolName()), d = h.getNewPasswordRequiredChallengeUserAttributePrefix(), p = {};
|
|
2254
|
-
i && Object.keys(i).forEach(function(
|
|
2255
|
-
p[d +
|
|
2254
|
+
i && Object.keys(i).forEach(function(y) {
|
|
2255
|
+
p[d + y] = i[y];
|
|
2256
2256
|
}), p.NEW_PASSWORD = r, p.USERNAME = this.username;
|
|
2257
2257
|
var m = {
|
|
2258
2258
|
ChallengeName: "NEW_PASSWORD_REQUIRED",
|
|
@@ -2261,11 +2261,11 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2261
2261
|
Session: this.Session,
|
|
2262
2262
|
ClientMetadata: o
|
|
2263
2263
|
};
|
|
2264
|
-
this.getUserContextData() && (m.UserContextData = this.getUserContextData()), this.client.request("RespondToAuthChallenge", m, function(
|
|
2265
|
-
return
|
|
2264
|
+
this.getUserContextData() && (m.UserContextData = this.getUserContextData()), this.client.request("RespondToAuthChallenge", m, function(y, v) {
|
|
2265
|
+
return y ? s.onFailure(y) : l.authenticateUserInternal(v, h, s);
|
|
2266
2266
|
});
|
|
2267
2267
|
}, e.getDeviceResponse = function(r, i) {
|
|
2268
|
-
var s = this, o = new ne(this.deviceGroupKey), l = new
|
|
2268
|
+
var s = this, o = new ne(this.deviceGroupKey), l = new _t(), h = {};
|
|
2269
2269
|
h.USERNAME = this.username, h.DEVICE_KEY = this.deviceKey, o.getLargeAValue(function(d, p) {
|
|
2270
2270
|
d && r.onFailure(d), h.SRP_A = p.toString(16);
|
|
2271
2271
|
var m = {
|
|
@@ -2275,24 +2275,24 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2275
2275
|
ClientMetadata: i,
|
|
2276
2276
|
Session: s.Session
|
|
2277
2277
|
};
|
|
2278
|
-
s.getUserContextData() && (m.UserContextData = s.getUserContextData()), s.client.request("RespondToAuthChallenge", m, function(
|
|
2279
|
-
if (
|
|
2280
|
-
return r.onFailure(
|
|
2281
|
-
var b =
|
|
2282
|
-
o.getPasswordAuthenticationKey(s.deviceKey, s.randomPassword, _,
|
|
2283
|
-
if (
|
|
2284
|
-
return r.onFailure(
|
|
2285
|
-
var P = l.getNowString(), B =
|
|
2278
|
+
s.getUserContextData() && (m.UserContextData = s.getUserContextData()), s.client.request("RespondToAuthChallenge", m, function(y, v) {
|
|
2279
|
+
if (y)
|
|
2280
|
+
return r.onFailure(y);
|
|
2281
|
+
var b = v.ChallengeParameters, _ = new A(b.SRP_B, 16), C = new A(b.SALT, 16);
|
|
2282
|
+
o.getPasswordAuthenticationKey(s.deviceKey, s.randomPassword, _, C, function(E, T) {
|
|
2283
|
+
if (E)
|
|
2284
|
+
return r.onFailure(E);
|
|
2285
|
+
var P = l.getNowString(), B = k.Buffer.concat([k.Buffer.from(s.deviceGroupKey, "utf8"), k.Buffer.from(s.deviceKey, "utf8"), k.Buffer.from(b.SECRET_BLOCK, "base64"), k.Buffer.from(P, "utf8")]), F = new Ie.Sha256(T);
|
|
2286
2286
|
F.update(B);
|
|
2287
|
-
var X = F.digestSync(),
|
|
2288
|
-
G.USERNAME = s.username, G.PASSWORD_CLAIM_SECRET_BLOCK = b.SECRET_BLOCK, G.TIMESTAMP = P, G.PASSWORD_CLAIM_SIGNATURE =
|
|
2289
|
-
var
|
|
2287
|
+
var X = F.digestSync(), me = k.Buffer.from(X).toString("base64"), G = {};
|
|
2288
|
+
G.USERNAME = s.username, G.PASSWORD_CLAIM_SECRET_BLOCK = b.SECRET_BLOCK, G.TIMESTAMP = P, G.PASSWORD_CLAIM_SIGNATURE = me, G.DEVICE_KEY = s.deviceKey;
|
|
2289
|
+
var j = {
|
|
2290
2290
|
ChallengeName: "DEVICE_PASSWORD_VERIFIER",
|
|
2291
2291
|
ClientId: s.pool.getClientId(),
|
|
2292
2292
|
ChallengeResponses: G,
|
|
2293
|
-
Session:
|
|
2293
|
+
Session: v.Session
|
|
2294
2294
|
};
|
|
2295
|
-
s.getUserContextData() && (
|
|
2295
|
+
s.getUserContextData() && (j.UserContextData = s.getUserContextData()), s.client.request("RespondToAuthChallenge", j, function(Q, ue) {
|
|
2296
2296
|
return Q ? r.onFailure(Q) : (s.signInUserSession = s.getCognitoUserSession(ue.AuthenticationResult), s.cacheTokens(), r.onSuccess(s.signInUserSession));
|
|
2297
2297
|
});
|
|
2298
2298
|
});
|
|
@@ -2336,31 +2336,31 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2336
2336
|
Session: this.Session,
|
|
2337
2337
|
ClientMetadata: o
|
|
2338
2338
|
};
|
|
2339
|
-
this.getUserContextData() && (p.UserContextData = this.getUserContextData()), this.client.request("RespondToAuthChallenge", p, function(m,
|
|
2339
|
+
this.getUserContextData() && (p.UserContextData = this.getUserContextData()), this.client.request("RespondToAuthChallenge", p, function(m, y) {
|
|
2340
2340
|
if (m)
|
|
2341
2341
|
return i.onFailure(m);
|
|
2342
|
-
var
|
|
2343
|
-
if (
|
|
2342
|
+
var v = y.ChallengeName;
|
|
2343
|
+
if (v === "DEVICE_SRP_AUTH") {
|
|
2344
2344
|
l.getDeviceResponse(i);
|
|
2345
2345
|
return;
|
|
2346
2346
|
}
|
|
2347
|
-
if (l.signInUserSession = l.getCognitoUserSession(
|
|
2347
|
+
if (l.signInUserSession = l.getCognitoUserSession(y.AuthenticationResult), l.cacheTokens(), y.AuthenticationResult.NewDeviceMetadata == null)
|
|
2348
2348
|
return i.onSuccess(l.signInUserSession);
|
|
2349
2349
|
var b = new ne(l.pool.getUserPoolName());
|
|
2350
|
-
b.generateHashDevice(
|
|
2350
|
+
b.generateHashDevice(y.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, y.AuthenticationResult.NewDeviceMetadata.DeviceKey, function(_) {
|
|
2351
2351
|
if (_)
|
|
2352
2352
|
return i.onFailure(_);
|
|
2353
|
-
var
|
|
2354
|
-
Salt:
|
|
2355
|
-
PasswordVerifier:
|
|
2353
|
+
var C = {
|
|
2354
|
+
Salt: k.Buffer.from(b.getSaltDevices(), "hex").toString("base64"),
|
|
2355
|
+
PasswordVerifier: k.Buffer.from(b.getVerifierDevices(), "hex").toString("base64")
|
|
2356
2356
|
};
|
|
2357
|
-
l.verifierDevices =
|
|
2358
|
-
DeviceKey:
|
|
2357
|
+
l.verifierDevices = C.PasswordVerifier, l.deviceGroupKey = y.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, l.randomPassword = b.getRandomPassword(), l.client.request("ConfirmDevice", {
|
|
2358
|
+
DeviceKey: y.AuthenticationResult.NewDeviceMetadata.DeviceKey,
|
|
2359
2359
|
AccessToken: l.signInUserSession.getAccessToken().getJwtToken(),
|
|
2360
|
-
DeviceSecretVerifierConfig:
|
|
2361
|
-
DeviceName:
|
|
2362
|
-
}, function(
|
|
2363
|
-
return
|
|
2360
|
+
DeviceSecretVerifierConfig: C,
|
|
2361
|
+
DeviceName: cr
|
|
2362
|
+
}, function(E, T) {
|
|
2363
|
+
return E ? i.onFailure(E) : (l.deviceKey = y.AuthenticationResult.NewDeviceMetadata.DeviceKey, l.cacheDeviceKeyAndPassword(), T.UserConfirmationNecessary === !0 ? i.onSuccess(l.signInUserSession, T.UserConfirmationNecessary) : i.onSuccess(l.signInUserSession));
|
|
2364
2364
|
});
|
|
2365
2365
|
});
|
|
2366
2366
|
});
|
|
@@ -2445,7 +2445,7 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2445
2445
|
var h = {
|
|
2446
2446
|
Name: s.UserAttributes[l].Name,
|
|
2447
2447
|
Value: s.UserAttributes[l].Value
|
|
2448
|
-
}, d = new
|
|
2448
|
+
}, d = new qr(h);
|
|
2449
2449
|
o.push(d);
|
|
2450
2450
|
}
|
|
2451
2451
|
return r(null, o);
|
|
@@ -2537,23 +2537,23 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2537
2537
|
return r(null, this.signInUserSession);
|
|
2538
2538
|
var s = "CognitoIdentityServiceProvider." + this.pool.getClientId() + "." + this.username, o = s + ".idToken", l = s + ".accessToken", h = s + ".refreshToken", d = s + ".clockDrift";
|
|
2539
2539
|
if (this.storage.getItem(o)) {
|
|
2540
|
-
var p = new
|
|
2540
|
+
var p = new wt({
|
|
2541
2541
|
IdToken: this.storage.getItem(o)
|
|
2542
|
-
}), m = new
|
|
2542
|
+
}), m = new yt({
|
|
2543
2543
|
AccessToken: this.storage.getItem(l)
|
|
2544
|
-
}),
|
|
2544
|
+
}), y = new bt({
|
|
2545
2545
|
RefreshToken: this.storage.getItem(h)
|
|
2546
|
-
}),
|
|
2546
|
+
}), v = parseInt(this.storage.getItem(d), 0) || 0, b = {
|
|
2547
2547
|
IdToken: p,
|
|
2548
2548
|
AccessToken: m,
|
|
2549
|
-
RefreshToken:
|
|
2550
|
-
ClockDrift:
|
|
2551
|
-
}, _ = new
|
|
2549
|
+
RefreshToken: y,
|
|
2550
|
+
ClockDrift: v
|
|
2551
|
+
}, _ = new St(b);
|
|
2552
2552
|
if (_.isValid())
|
|
2553
2553
|
return this.signInUserSession = _, r(null, this.signInUserSession);
|
|
2554
|
-
if (!
|
|
2554
|
+
if (!y.getToken())
|
|
2555
2555
|
return r(new Error("Cannot retrieve a new session. Please authenticate."), null);
|
|
2556
|
-
this.refreshSession(
|
|
2556
|
+
this.refreshSession(y, r, i.clientMetadata);
|
|
2557
2557
|
} else
|
|
2558
2558
|
r(new Error("Local storage is missing an ID Token, Please authenticate"), null);
|
|
2559
2559
|
}, e.refreshSession = function(r, i, s) {
|
|
@@ -2565,15 +2565,15 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2565
2565
|
var m = d + "." + this.username + ".deviceKey";
|
|
2566
2566
|
this.deviceKey = this.storage.getItem(m), h.DEVICE_KEY = this.deviceKey;
|
|
2567
2567
|
}
|
|
2568
|
-
var
|
|
2568
|
+
var y = {
|
|
2569
2569
|
ClientId: this.pool.getClientId(),
|
|
2570
2570
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
|
2571
2571
|
AuthParameters: h,
|
|
2572
2572
|
ClientMetadata: s
|
|
2573
2573
|
};
|
|
2574
|
-
this.getUserContextData() && (
|
|
2575
|
-
if (
|
|
2576
|
-
return
|
|
2574
|
+
this.getUserContextData() && (y.UserContextData = this.getUserContextData()), this.client.requestWithRetry("InitiateAuth", y, function(v, b) {
|
|
2575
|
+
if (v)
|
|
2576
|
+
return v.code === "NotAuthorizedException" && o.clearCachedUser(), l(v, null);
|
|
2577
2577
|
if (b) {
|
|
2578
2578
|
var _ = b.AuthenticationResult;
|
|
2579
2579
|
return Object.prototype.hasOwnProperty.call(_, "RefreshToken") || (_.RefreshToken = r.getToken()), o.signInUserSession = o.getCognitoUserSession(_), o.cacheTokens(), l(null, o.signInUserSession);
|
|
@@ -2601,12 +2601,12 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2601
2601
|
var r = "CognitoIdentityServiceProvider." + this.pool.getClientId(), i = r + "." + this.username + ".idToken", s = r + "." + this.username + ".accessToken", o = r + "." + this.username + ".refreshToken", l = r + ".LastAuthUser", h = r + "." + this.username + ".clockDrift";
|
|
2602
2602
|
this.storage.removeItem(i), this.storage.removeItem(s), this.storage.removeItem(o), this.storage.removeItem(l), this.storage.removeItem(h);
|
|
2603
2603
|
}, e.getCognitoUserSession = function(r) {
|
|
2604
|
-
var i = new
|
|
2604
|
+
var i = new wt(r), s = new yt(r), o = new bt(r), l = {
|
|
2605
2605
|
IdToken: i,
|
|
2606
2606
|
AccessToken: s,
|
|
2607
2607
|
RefreshToken: o
|
|
2608
2608
|
};
|
|
2609
|
-
return new
|
|
2609
|
+
return new St(l);
|
|
2610
2610
|
}, e.forgotPassword = function(r, i) {
|
|
2611
2611
|
var s = {
|
|
2612
2612
|
ClientId: this.pool.getClientId(),
|
|
@@ -2819,13 +2819,13 @@ var Yi = typeof navigator < "u", ur = Yi ? Fr.isReactNative ? "react-native" : n
|
|
|
2819
2819
|
ChallengeResponses: d,
|
|
2820
2820
|
Session: o.Session
|
|
2821
2821
|
};
|
|
2822
|
-
o.getUserContextData() && (p.UserContextData = o.getUserContextData()), o.client.request("RespondToAuthChallenge", p, function(m,
|
|
2823
|
-
return m ? s.onFailure(m) : (o.signInUserSession = o.getCognitoUserSession(
|
|
2822
|
+
o.getUserContextData() && (p.UserContextData = o.getUserContextData()), o.client.request("RespondToAuthChallenge", p, function(m, y) {
|
|
2823
|
+
return m ? s.onFailure(m) : (o.signInUserSession = o.getCognitoUserSession(y.AuthenticationResult), o.cacheTokens(), s.onSuccess(o.signInUserSession));
|
|
2824
2824
|
});
|
|
2825
2825
|
});
|
|
2826
2826
|
}, n;
|
|
2827
2827
|
})();
|
|
2828
|
-
function
|
|
2828
|
+
function Qi(n, e) {
|
|
2829
2829
|
return e = e || {}, new Promise(function(t, r) {
|
|
2830
2830
|
var i = new XMLHttpRequest(), s = [], o = [], l = {}, h = function() {
|
|
2831
2831
|
return { ok: (i.status / 100 | 0) == 2, statusText: i.statusText, status: i.status, url: i.responseURL, text: function() {
|
|
@@ -2845,90 +2845,90 @@ function Gi(n, e) {
|
|
|
2845
2845
|
} } };
|
|
2846
2846
|
};
|
|
2847
2847
|
for (var d in i.open(e.method || "get", n, !0), i.onload = function() {
|
|
2848
|
-
i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(p, m,
|
|
2849
|
-
s.push(m = m.toLowerCase()), o.push([m,
|
|
2848
|
+
i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(p, m, y) {
|
|
2849
|
+
s.push(m = m.toLowerCase()), o.push([m, y]), l[m] = l[m] ? l[m] + "," + y : y;
|
|
2850
2850
|
}), t(h());
|
|
2851
2851
|
}, i.onerror = r, i.withCredentials = e.credentials == "include", e.headers) i.setRequestHeader(d, e.headers[d]);
|
|
2852
2852
|
i.send(e.body || null);
|
|
2853
2853
|
});
|
|
2854
2854
|
}
|
|
2855
|
-
const
|
|
2855
|
+
const es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2856
2856
|
__proto__: null,
|
|
2857
|
-
default:
|
|
2858
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2859
|
-
var at,
|
|
2860
|
-
function
|
|
2861
|
-
return
|
|
2862
|
-
}
|
|
2863
|
-
|
|
2864
|
-
function
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
|
-
var
|
|
2868
|
-
e && (
|
|
2869
|
-
},
|
|
2870
|
-
var t =
|
|
2857
|
+
default: Qi
|
|
2858
|
+
}, Symbol.toStringTag, { value: "Module" })), hr = /* @__PURE__ */ It(es);
|
|
2859
|
+
var at, fr;
|
|
2860
|
+
function ts() {
|
|
2861
|
+
return fr || (fr = 1, at = self.fetch || (self.fetch = hr.default || hr)), at;
|
|
2862
|
+
}
|
|
2863
|
+
ts();
|
|
2864
|
+
function H() {
|
|
2865
|
+
}
|
|
2866
|
+
H.prototype.userAgent = Yi();
|
|
2867
|
+
var rs = function(e) {
|
|
2868
|
+
e && (H.prototype.userAgent && !H.prototype.userAgent.includes(e) && (H.prototype.userAgent = H.prototype.userAgent.concat(" ", e)), (!H.prototype.userAgent || H.prototype.userAgent === "") && (H.prototype.userAgent = e));
|
|
2869
|
+
}, ns = function(e) {
|
|
2870
|
+
var t = H.category ? " " + H.category : "", r = H.framework ? " framework/" + H.framework : "", i = "" + H.prototype.userAgent + t + r;
|
|
2871
2871
|
return i;
|
|
2872
2872
|
};
|
|
2873
|
-
function
|
|
2874
|
-
n.prototype = Object.create(e.prototype), n.prototype.constructor = n,
|
|
2873
|
+
function is(n, e) {
|
|
2874
|
+
n.prototype = Object.create(e.prototype), n.prototype.constructor = n, Re(n, e);
|
|
2875
2875
|
}
|
|
2876
|
-
function
|
|
2876
|
+
function xt(n) {
|
|
2877
2877
|
var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
2878
|
-
return
|
|
2879
|
-
if (r === null || !
|
|
2878
|
+
return xt = function(r) {
|
|
2879
|
+
if (r === null || !os(r)) return r;
|
|
2880
2880
|
if (typeof r != "function") throw new TypeError("Super expression must either be null or a function");
|
|
2881
2881
|
if (e !== void 0) {
|
|
2882
2882
|
if (e.has(r)) return e.get(r);
|
|
2883
2883
|
e.set(r, i);
|
|
2884
2884
|
}
|
|
2885
2885
|
function i() {
|
|
2886
|
-
return
|
|
2886
|
+
return ss(r, arguments, Ct(this).constructor);
|
|
2887
2887
|
}
|
|
2888
|
-
return i.prototype = Object.create(r.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }),
|
|
2889
|
-
},
|
|
2888
|
+
return i.prototype = Object.create(r.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), Re(i, r);
|
|
2889
|
+
}, xt(n);
|
|
2890
2890
|
}
|
|
2891
|
-
function
|
|
2892
|
-
if (
|
|
2891
|
+
function ss(n, e, t) {
|
|
2892
|
+
if (Kr()) return Reflect.construct.apply(null, arguments);
|
|
2893
2893
|
var r = [null];
|
|
2894
2894
|
r.push.apply(r, e);
|
|
2895
2895
|
var i = new (n.bind.apply(n, r))();
|
|
2896
|
-
return t &&
|
|
2896
|
+
return t && Re(i, t.prototype), i;
|
|
2897
2897
|
}
|
|
2898
|
-
function
|
|
2898
|
+
function Kr() {
|
|
2899
2899
|
try {
|
|
2900
2900
|
var n = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2901
2901
|
}));
|
|
2902
2902
|
} catch {
|
|
2903
2903
|
}
|
|
2904
|
-
return (
|
|
2904
|
+
return (Kr = function() {
|
|
2905
2905
|
return !!n;
|
|
2906
2906
|
})();
|
|
2907
2907
|
}
|
|
2908
|
-
function
|
|
2908
|
+
function os(n) {
|
|
2909
2909
|
try {
|
|
2910
2910
|
return Function.toString.call(n).indexOf("[native code]") !== -1;
|
|
2911
2911
|
} catch {
|
|
2912
2912
|
return typeof n == "function";
|
|
2913
2913
|
}
|
|
2914
2914
|
}
|
|
2915
|
-
function
|
|
2916
|
-
return
|
|
2915
|
+
function Re(n, e) {
|
|
2916
|
+
return Re = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, r) {
|
|
2917
2917
|
return t.__proto__ = r, t;
|
|
2918
|
-
},
|
|
2918
|
+
}, Re(n, e);
|
|
2919
2919
|
}
|
|
2920
|
-
function
|
|
2921
|
-
return
|
|
2920
|
+
function Ct(n) {
|
|
2921
|
+
return Ct = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
2922
2922
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
2923
|
-
},
|
|
2923
|
+
}, Ct(n);
|
|
2924
2924
|
}
|
|
2925
|
-
var
|
|
2925
|
+
var as = /* @__PURE__ */ (function(n) {
|
|
2926
2926
|
function e(t, r, i, s) {
|
|
2927
2927
|
var o;
|
|
2928
2928
|
return o = n.call(this, t) || this, o.code = r, o.name = i, o.statusCode = s, o;
|
|
2929
2929
|
}
|
|
2930
|
-
return
|
|
2931
|
-
})(/* @__PURE__ */
|
|
2930
|
+
return is(e, n), e;
|
|
2931
|
+
})(/* @__PURE__ */ xt(Error)), us = /* @__PURE__ */ (function() {
|
|
2932
2932
|
function n(t, r, i) {
|
|
2933
2933
|
this.endpoint = r || "https://cognito-idp." + t + ".amazonaws.com/";
|
|
2934
2934
|
var s = i || {}, o = s.credentials;
|
|
@@ -2941,15 +2941,15 @@ var ns = /* @__PURE__ */ (function(n) {
|
|
|
2941
2941
|
var s = this;
|
|
2942
2942
|
return new Promise(function(o, l) {
|
|
2943
2943
|
s.request(r, i, function(h, d) {
|
|
2944
|
-
h ? l(new
|
|
2944
|
+
h ? l(new as(h.message, h.code, h.name, h.statusCode)) : o(d);
|
|
2945
2945
|
});
|
|
2946
2946
|
});
|
|
2947
2947
|
}, e.requestWithRetry = function(r, i, s) {
|
|
2948
2948
|
var o = this, l = 5 * 1e3;
|
|
2949
|
-
|
|
2949
|
+
hs(function(h) {
|
|
2950
2950
|
return new Promise(function(d, p) {
|
|
2951
|
-
o.request(r, h, function(m,
|
|
2952
|
-
m ? p(m) : d(
|
|
2951
|
+
o.request(r, h, function(m, y) {
|
|
2952
|
+
m ? p(m) : d(y);
|
|
2953
2953
|
});
|
|
2954
2954
|
});
|
|
2955
2955
|
}, [i], l).then(function(h) {
|
|
@@ -2961,7 +2961,7 @@ var ns = /* @__PURE__ */ (function(n) {
|
|
|
2961
2961
|
var o = {
|
|
2962
2962
|
"Content-Type": "application/x-amz-json-1.1",
|
|
2963
2963
|
"X-Amz-Target": "AWSCognitoIdentityProviderService." + r,
|
|
2964
|
-
"X-Amz-User-Agent":
|
|
2964
|
+
"X-Amz-User-Agent": ns(),
|
|
2965
2965
|
"Cache-Control": "no-store"
|
|
2966
2966
|
}, l = Object.assign({}, this.fetchOptions, {
|
|
2967
2967
|
headers: o,
|
|
@@ -2993,48 +2993,48 @@ var ns = /* @__PURE__ */ (function(n) {
|
|
|
2993
2993
|
return s(d);
|
|
2994
2994
|
});
|
|
2995
2995
|
}, n;
|
|
2996
|
-
})(),
|
|
2996
|
+
})(), je = {
|
|
2997
2997
|
debug: function() {
|
|
2998
2998
|
}
|
|
2999
|
-
},
|
|
2999
|
+
}, ls = function(e) {
|
|
3000
3000
|
var t = "nonRetryable";
|
|
3001
3001
|
return e && e[t];
|
|
3002
3002
|
};
|
|
3003
|
-
function
|
|
3003
|
+
function jr(n, e, t, r) {
|
|
3004
3004
|
if (r === void 0 && (r = 1), typeof n != "function")
|
|
3005
3005
|
throw Error("functionToRetry must be a function");
|
|
3006
|
-
return
|
|
3007
|
-
if (
|
|
3008
|
-
throw
|
|
3006
|
+
return je.debug(n.name + " attempt #" + r + " with args: " + JSON.stringify(e)), n.apply(void 0, e).catch(function(i) {
|
|
3007
|
+
if (je.debug("error on " + n.name, i), ls(i))
|
|
3008
|
+
throw je.debug(n.name + " non retryable error", i), i;
|
|
3009
3009
|
var s = t(r, e, i);
|
|
3010
|
-
if (
|
|
3010
|
+
if (je.debug(n.name + " retrying in " + s + " ms"), s !== !1)
|
|
3011
3011
|
return new Promise(function(o) {
|
|
3012
3012
|
return setTimeout(o, s);
|
|
3013
3013
|
}).then(function() {
|
|
3014
|
-
return
|
|
3014
|
+
return jr(n, e, t, r + 1);
|
|
3015
3015
|
});
|
|
3016
3016
|
throw i;
|
|
3017
3017
|
});
|
|
3018
3018
|
}
|
|
3019
|
-
function
|
|
3019
|
+
function cs(n) {
|
|
3020
3020
|
var e = 100, t = 100;
|
|
3021
3021
|
return function(r) {
|
|
3022
3022
|
var i = Math.pow(2, r) * e + t * Math.random();
|
|
3023
3023
|
return i > n ? !1 : i;
|
|
3024
3024
|
};
|
|
3025
3025
|
}
|
|
3026
|
-
function
|
|
3027
|
-
return
|
|
3026
|
+
function hs(n, e, t) {
|
|
3027
|
+
return jr(n, e, cs(t));
|
|
3028
3028
|
}
|
|
3029
|
-
var
|
|
3029
|
+
var fs = 55, ds = /* @__PURE__ */ (function() {
|
|
3030
3030
|
function n(t, r) {
|
|
3031
3031
|
var i = t || {}, s = i.UserPoolId, o = i.ClientId, l = i.endpoint, h = i.fetchOptions, d = i.AdvancedSecurityDataCollectionFlag;
|
|
3032
3032
|
if (!s || !o)
|
|
3033
3033
|
throw new Error("Both UserPoolId and ClientId are required.");
|
|
3034
|
-
if (s.length >
|
|
3034
|
+
if (s.length > fs || !/^[\w-]+_[0-9a-zA-Z]+$/.test(s))
|
|
3035
3035
|
throw new Error("Invalid UserPoolId format.");
|
|
3036
3036
|
var p = s.split("_")[0];
|
|
3037
|
-
this.userPoolId = s, this.clientId = o, this.client = new
|
|
3037
|
+
this.userPoolId = s, this.clientId = o, this.client = new us(p, l, h), this.advancedSecurityDataCollectionFlag = d !== !1, this.storage = t.Storage || new Lr().getStorage(), r && (this.wrapRefreshSessionCallback = r);
|
|
3038
3038
|
}
|
|
3039
3039
|
var e = n.prototype;
|
|
3040
3040
|
return e.getUserPoolId = function() {
|
|
@@ -3052,18 +3052,18 @@ var us = 55, ls = /* @__PURE__ */ (function() {
|
|
|
3052
3052
|
ValidationData: o,
|
|
3053
3053
|
ClientMetadata: h
|
|
3054
3054
|
};
|
|
3055
|
-
this.getUserContextData(r) && (p.UserContextData = this.getUserContextData(r)), this.client.request("SignUp", p, function(m,
|
|
3055
|
+
this.getUserContextData(r) && (p.UserContextData = this.getUserContextData(r)), this.client.request("SignUp", p, function(m, y) {
|
|
3056
3056
|
if (m)
|
|
3057
3057
|
return l(m, null);
|
|
3058
|
-
var
|
|
3058
|
+
var v = {
|
|
3059
3059
|
Username: r,
|
|
3060
3060
|
Pool: d,
|
|
3061
3061
|
Storage: d.storage
|
|
3062
3062
|
}, b = {
|
|
3063
|
-
user: new
|
|
3064
|
-
userConfirmed:
|
|
3065
|
-
userSub:
|
|
3066
|
-
codeDeliveryDetails:
|
|
3063
|
+
user: new At(v),
|
|
3064
|
+
userConfirmed: y.UserConfirmed,
|
|
3065
|
+
userSub: y.UserSub,
|
|
3066
|
+
codeDeliveryDetails: y.CodeDeliveryDetails
|
|
3067
3067
|
};
|
|
3068
3068
|
return l(null, b);
|
|
3069
3069
|
});
|
|
@@ -3075,7 +3075,7 @@ var us = 55, ls = /* @__PURE__ */ (function() {
|
|
|
3075
3075
|
Pool: this,
|
|
3076
3076
|
Storage: this.storage
|
|
3077
3077
|
};
|
|
3078
|
-
return new
|
|
3078
|
+
return new At(s);
|
|
3079
3079
|
}
|
|
3080
3080
|
return null;
|
|
3081
3081
|
}, e.getUserContextData = function(r) {
|
|
@@ -3094,7 +3094,7 @@ var us = 55, ls = /* @__PURE__ */ (function() {
|
|
|
3094
3094
|
}
|
|
3095
3095
|
}, n;
|
|
3096
3096
|
})();
|
|
3097
|
-
function
|
|
3097
|
+
function Ve(n) {
|
|
3098
3098
|
for (var e = 1; e < arguments.length; e++) {
|
|
3099
3099
|
var t = arguments[e];
|
|
3100
3100
|
for (var r in t)
|
|
@@ -3102,7 +3102,7 @@ function je(n) {
|
|
|
3102
3102
|
}
|
|
3103
3103
|
return n;
|
|
3104
3104
|
}
|
|
3105
|
-
var
|
|
3105
|
+
var ps = {
|
|
3106
3106
|
read: function(n) {
|
|
3107
3107
|
return n[0] === '"' && (n = n.slice(1, -1)), n.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
3108
3108
|
},
|
|
@@ -3113,10 +3113,10 @@ var cs = {
|
|
|
3113
3113
|
);
|
|
3114
3114
|
}
|
|
3115
3115
|
};
|
|
3116
|
-
function
|
|
3116
|
+
function Et(n, e) {
|
|
3117
3117
|
function t(i, s, o) {
|
|
3118
3118
|
if (!(typeof document > "u")) {
|
|
3119
|
-
o =
|
|
3119
|
+
o = Ve({}, e, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
3120
3120
|
var l = "";
|
|
3121
3121
|
for (var h in o)
|
|
3122
3122
|
o[h] && (l += "; " + h, o[h] !== !0 && (l += "=" + o[h].split(";")[0]));
|
|
@@ -3145,16 +3145,16 @@ function Ct(n, e) {
|
|
|
3145
3145
|
t(
|
|
3146
3146
|
i,
|
|
3147
3147
|
"",
|
|
3148
|
-
|
|
3148
|
+
Ve({}, s, {
|
|
3149
3149
|
expires: -1
|
|
3150
3150
|
})
|
|
3151
3151
|
);
|
|
3152
3152
|
},
|
|
3153
3153
|
withAttributes: function(i) {
|
|
3154
|
-
return
|
|
3154
|
+
return Et(this.converter, Ve({}, this.attributes, i));
|
|
3155
3155
|
},
|
|
3156
3156
|
withConverter: function(i) {
|
|
3157
|
-
return
|
|
3157
|
+
return Et(Ve({}, this.converter, i), this.attributes);
|
|
3158
3158
|
}
|
|
3159
3159
|
},
|
|
3160
3160
|
{
|
|
@@ -3163,7 +3163,7 @@ function Ct(n, e) {
|
|
|
3163
3163
|
}
|
|
3164
3164
|
);
|
|
3165
3165
|
}
|
|
3166
|
-
var
|
|
3166
|
+
var Ee = Et(ps, { path: "/" }), gs = /* @__PURE__ */ (function() {
|
|
3167
3167
|
function n(t) {
|
|
3168
3168
|
if (t === void 0 && (t = {}), t.domain && (this.domain = t.domain), t.path ? this.path = t.path : this.path = "/", Object.prototype.hasOwnProperty.call(t, "expires") ? this.expires = t.expires : this.expires = 365, Object.prototype.hasOwnProperty.call(t, "secure") ? this.secure = t.secure : this.secure = !0, Object.prototype.hasOwnProperty.call(t, "sameSite")) {
|
|
3169
3169
|
if (!["strict", "lax", "none"].includes(t.sameSite))
|
|
@@ -3182,9 +3182,9 @@ var xe = Ct(cs, { path: "/" }), hs = /* @__PURE__ */ (function() {
|
|
|
3182
3182
|
domain: this.domain,
|
|
3183
3183
|
secure: this.secure
|
|
3184
3184
|
};
|
|
3185
|
-
return this.sameSite && (s.sameSite = this.sameSite),
|
|
3185
|
+
return this.sameSite && (s.sameSite = this.sameSite), Ee.set(r, i, s), Ee.get(r);
|
|
3186
3186
|
}, e.getItem = function(r) {
|
|
3187
|
-
var i =
|
|
3187
|
+
var i = Ee.get(r);
|
|
3188
3188
|
return i ?? null;
|
|
3189
3189
|
}, e.removeItem = function(r) {
|
|
3190
3190
|
var i = {
|
|
@@ -3193,41 +3193,41 @@ var xe = Ct(cs, { path: "/" }), hs = /* @__PURE__ */ (function() {
|
|
|
3193
3193
|
domain: this.domain,
|
|
3194
3194
|
secure: this.secure
|
|
3195
3195
|
};
|
|
3196
|
-
return this.sameSite && (i.sameSite = this.sameSite),
|
|
3196
|
+
return this.sameSite && (i.sameSite = this.sameSite), Ee.remove(r, i);
|
|
3197
3197
|
}, e.clear = function() {
|
|
3198
|
-
for (var r =
|
|
3198
|
+
for (var r = Ee.get(), i = Object.keys(r).length, s = 0; s < i; ++s)
|
|
3199
3199
|
this.removeItem(Object.keys(r)[s]);
|
|
3200
3200
|
return {};
|
|
3201
3201
|
}, n;
|
|
3202
3202
|
})();
|
|
3203
|
-
const
|
|
3203
|
+
const ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3204
3204
|
__proto__: null,
|
|
3205
|
-
AuthenticationDetails:
|
|
3205
|
+
AuthenticationDetails: gn,
|
|
3206
3206
|
AuthenticationHelper: ne,
|
|
3207
|
-
CognitoAccessToken:
|
|
3208
|
-
CognitoIdToken:
|
|
3209
|
-
CognitoRefreshToken:
|
|
3210
|
-
CognitoUser:
|
|
3211
|
-
CognitoUserAttribute:
|
|
3212
|
-
CognitoUserPool:
|
|
3213
|
-
CognitoUserSession:
|
|
3214
|
-
CookieStorage:
|
|
3215
|
-
DateHelper:
|
|
3216
|
-
WordArray:
|
|
3217
|
-
appendToCognitoUserAgent:
|
|
3207
|
+
CognitoAccessToken: yt,
|
|
3208
|
+
CognitoIdToken: wt,
|
|
3209
|
+
CognitoRefreshToken: bt,
|
|
3210
|
+
CognitoUser: At,
|
|
3211
|
+
CognitoUserAttribute: qr,
|
|
3212
|
+
CognitoUserPool: ds,
|
|
3213
|
+
CognitoUserSession: St,
|
|
3214
|
+
CookieStorage: gs,
|
|
3215
|
+
DateHelper: _t,
|
|
3216
|
+
WordArray: Pr,
|
|
3217
|
+
appendToCognitoUserAgent: rs
|
|
3218
3218
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3219
|
-
const ze = globalThis,
|
|
3220
|
-
let
|
|
3219
|
+
const ze = globalThis, $t = ze.ShadowRoot && (ze.ShadyCSS === void 0 || ze.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Pt = /* @__PURE__ */ Symbol(), dr = /* @__PURE__ */ new WeakMap();
|
|
3220
|
+
let Vr = class {
|
|
3221
3221
|
constructor(e, t, r) {
|
|
3222
|
-
if (this._$cssResult$ = !0, r !==
|
|
3222
|
+
if (this._$cssResult$ = !0, r !== Pt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
3223
3223
|
this.cssText = e, this.t = t;
|
|
3224
3224
|
}
|
|
3225
3225
|
get styleSheet() {
|
|
3226
3226
|
let e = this.o;
|
|
3227
3227
|
const t = this.t;
|
|
3228
|
-
if (
|
|
3228
|
+
if ($t && e === void 0) {
|
|
3229
3229
|
const r = t !== void 0 && t.length === 1;
|
|
3230
|
-
r && (e =
|
|
3230
|
+
r && (e = dr.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && dr.set(t, e));
|
|
3231
3231
|
}
|
|
3232
3232
|
return e;
|
|
3233
3233
|
}
|
|
@@ -3235,28 +3235,28 @@ let qr = class {
|
|
|
3235
3235
|
return this.cssText;
|
|
3236
3236
|
}
|
|
3237
3237
|
};
|
|
3238
|
-
const
|
|
3238
|
+
const ys = (n) => new Vr(typeof n == "string" ? n : n + "", void 0, Pt), z = (n, ...e) => {
|
|
3239
3239
|
const t = n.length === 1 ? n[0] : e.reduce((r, i, s) => r + ((o) => {
|
|
3240
3240
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
3241
3241
|
if (typeof o == "number") return o;
|
|
3242
3242
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
3243
3243
|
})(i) + n[s + 1], n[0]);
|
|
3244
|
-
return new
|
|
3245
|
-
},
|
|
3246
|
-
if (
|
|
3244
|
+
return new Vr(t, n, Pt);
|
|
3245
|
+
}, vs = (n, e) => {
|
|
3246
|
+
if ($t) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
3247
3247
|
else for (const t of e) {
|
|
3248
3248
|
const r = document.createElement("style"), i = ze.litNonce;
|
|
3249
3249
|
i !== void 0 && r.setAttribute("nonce", i), r.textContent = t.cssText, n.appendChild(r);
|
|
3250
3250
|
}
|
|
3251
|
-
},
|
|
3251
|
+
}, pr = $t ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
3252
3252
|
let t = "";
|
|
3253
3253
|
for (const r of e.cssRules) t += r.cssText;
|
|
3254
|
-
return
|
|
3254
|
+
return ys(t);
|
|
3255
3255
|
})(n) : n;
|
|
3256
|
-
const { is:
|
|
3256
|
+
const { is: ws, defineProperty: bs, getOwnPropertyDescriptor: Ss, getOwnPropertyNames: _s, getOwnPropertySymbols: As, getPrototypeOf: xs } = Object, Qe = globalThis, gr = Qe.trustedTypes, Cs = gr ? gr.emptyScript : "", Es = Qe.reactiveElementPolyfillSupport, De = (n, e) => n, Ut = { toAttribute(n, e) {
|
|
3257
3257
|
switch (e) {
|
|
3258
3258
|
case Boolean:
|
|
3259
|
-
n = n ?
|
|
3259
|
+
n = n ? Cs : null;
|
|
3260
3260
|
break;
|
|
3261
3261
|
case Object:
|
|
3262
3262
|
case Array:
|
|
@@ -3281,23 +3281,23 @@ const { is: gs, defineProperty: ms, getOwnPropertyDescriptor: vs, getOwnProperty
|
|
|
3281
3281
|
}
|
|
3282
3282
|
}
|
|
3283
3283
|
return t;
|
|
3284
|
-
} },
|
|
3284
|
+
} }, Hr = (n, e) => !ws(n, e), mr = { attribute: !0, type: String, converter: Ut, reflect: !1, useDefault: !1, hasChanged: Hr };
|
|
3285
3285
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), Qe.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
3286
|
-
let
|
|
3286
|
+
let he = class extends HTMLElement {
|
|
3287
3287
|
static addInitializer(e) {
|
|
3288
3288
|
this._$Ei(), (this.l ??= []).push(e);
|
|
3289
3289
|
}
|
|
3290
3290
|
static get observedAttributes() {
|
|
3291
3291
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
3292
3292
|
}
|
|
3293
|
-
static createProperty(e, t =
|
|
3293
|
+
static createProperty(e, t = mr) {
|
|
3294
3294
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
3295
3295
|
const r = /* @__PURE__ */ Symbol(), i = this.getPropertyDescriptor(e, r, t);
|
|
3296
|
-
i !== void 0 &&
|
|
3296
|
+
i !== void 0 && bs(this.prototype, e, i);
|
|
3297
3297
|
}
|
|
3298
3298
|
}
|
|
3299
3299
|
static getPropertyDescriptor(e, t, r) {
|
|
3300
|
-
const { get: i, set: s } =
|
|
3300
|
+
const { get: i, set: s } = Ss(this.prototype, e) ?? { get() {
|
|
3301
3301
|
return this[t];
|
|
3302
3302
|
}, set(o) {
|
|
3303
3303
|
this[t] = o;
|
|
@@ -3308,17 +3308,17 @@ let ce = class extends HTMLElement {
|
|
|
3308
3308
|
}, configurable: !0, enumerable: !0 };
|
|
3309
3309
|
}
|
|
3310
3310
|
static getPropertyOptions(e) {
|
|
3311
|
-
return this.elementProperties.get(e) ??
|
|
3311
|
+
return this.elementProperties.get(e) ?? mr;
|
|
3312
3312
|
}
|
|
3313
3313
|
static _$Ei() {
|
|
3314
3314
|
if (this.hasOwnProperty(De("elementProperties"))) return;
|
|
3315
|
-
const e =
|
|
3315
|
+
const e = xs(this);
|
|
3316
3316
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
3317
3317
|
}
|
|
3318
3318
|
static finalize() {
|
|
3319
3319
|
if (this.hasOwnProperty(De("finalized"))) return;
|
|
3320
3320
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(De("properties"))) {
|
|
3321
|
-
const t = this.properties, r = [...
|
|
3321
|
+
const t = this.properties, r = [..._s(t), ...As(t)];
|
|
3322
3322
|
for (const i of r) this.createProperty(i, t[i]);
|
|
3323
3323
|
}
|
|
3324
3324
|
const e = this[Symbol.metadata];
|
|
@@ -3337,8 +3337,8 @@ let ce = class extends HTMLElement {
|
|
|
3337
3337
|
const t = [];
|
|
3338
3338
|
if (Array.isArray(e)) {
|
|
3339
3339
|
const r = new Set(e.flat(1 / 0).reverse());
|
|
3340
|
-
for (const i of r) t.unshift(
|
|
3341
|
-
} else e !== void 0 && t.push(
|
|
3340
|
+
for (const i of r) t.unshift(pr(i));
|
|
3341
|
+
} else e !== void 0 && t.push(pr(e));
|
|
3342
3342
|
return t;
|
|
3343
3343
|
}
|
|
3344
3344
|
static _$Eu(e, t) {
|
|
@@ -3364,7 +3364,7 @@ let ce = class extends HTMLElement {
|
|
|
3364
3364
|
}
|
|
3365
3365
|
createRenderRoot() {
|
|
3366
3366
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
3367
|
-
return
|
|
3367
|
+
return vs(e, this.constructor.elementStyles), e;
|
|
3368
3368
|
}
|
|
3369
3369
|
connectedCallback() {
|
|
3370
3370
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
@@ -3380,14 +3380,14 @@ let ce = class extends HTMLElement {
|
|
|
3380
3380
|
_$ET(e, t) {
|
|
3381
3381
|
const r = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, r);
|
|
3382
3382
|
if (i !== void 0 && r.reflect === !0) {
|
|
3383
|
-
const s = (r.converter?.toAttribute !== void 0 ? r.converter :
|
|
3383
|
+
const s = (r.converter?.toAttribute !== void 0 ? r.converter : Ut).toAttribute(t, r.type);
|
|
3384
3384
|
this._$Em = e, s == null ? this.removeAttribute(i) : this.setAttribute(i, s), this._$Em = null;
|
|
3385
3385
|
}
|
|
3386
3386
|
}
|
|
3387
3387
|
_$AK(e, t) {
|
|
3388
3388
|
const r = this.constructor, i = r._$Eh.get(e);
|
|
3389
3389
|
if (i !== void 0 && this._$Em !== i) {
|
|
3390
|
-
const s = r.getPropertyOptions(i), o = typeof s.converter == "function" ? { fromAttribute: s.converter } : s.converter?.fromAttribute !== void 0 ? s.converter :
|
|
3390
|
+
const s = r.getPropertyOptions(i), o = typeof s.converter == "function" ? { fromAttribute: s.converter } : s.converter?.fromAttribute !== void 0 ? s.converter : Ut;
|
|
3391
3391
|
this._$Em = i;
|
|
3392
3392
|
const l = o.fromAttribute(t, s.type);
|
|
3393
3393
|
this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null;
|
|
@@ -3396,7 +3396,7 @@ let ce = class extends HTMLElement {
|
|
|
3396
3396
|
requestUpdate(e, t, r, i = !1, s) {
|
|
3397
3397
|
if (e !== void 0) {
|
|
3398
3398
|
const o = this.constructor;
|
|
3399
|
-
if (i === !1 && (s = this[e]), r ??= o.getPropertyOptions(e), !((r.hasChanged ??
|
|
3399
|
+
if (i === !1 && (s = this[e]), r ??= o.getPropertyOptions(e), !((r.hasChanged ?? Hr)(s, t) || r.useDefault && r.reflect && s === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, r)))) return;
|
|
3400
3400
|
this.C(e, t, r);
|
|
3401
3401
|
}
|
|
3402
3402
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -3464,51 +3464,51 @@ let ce = class extends HTMLElement {
|
|
|
3464
3464
|
firstUpdated(e) {
|
|
3465
3465
|
}
|
|
3466
3466
|
};
|
|
3467
|
-
|
|
3468
|
-
const
|
|
3469
|
-
\f\r]`,
|
|
3470
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
3471
|
-
function
|
|
3472
|
-
if (!
|
|
3473
|
-
return
|
|
3474
|
-
}
|
|
3475
|
-
const
|
|
3467
|
+
he.elementStyles = [], he.shadowRootOptions = { mode: "open" }, he[De("elementProperties")] = /* @__PURE__ */ new Map(), he[De("finalized")] = /* @__PURE__ */ new Map(), Es?.({ ReactiveElement: he }), (Qe.reactiveElementVersions ??= []).push("2.1.2");
|
|
3468
|
+
const Ft = globalThis, yr = (n) => n, Ye = Ft.trustedTypes, vr = Ye ? Ye.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, zr = "$lit$", J = `lit$${Math.random().toFixed(9).slice(2)}$`, Wr = "?" + J, Us = `<${Wr}>`, oe = document, $e = () => oe.createComment(""), Pe = (n) => n === null || typeof n != "object" && typeof n != "function", Bt = Array.isArray, Ts = (n) => Bt(n) || typeof n?.[Symbol.iterator] == "function", ut = `[
|
|
3469
|
+
\f\r]`, Ue = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, wr = /-->/g, br = />/g, re = RegExp(`>|${ut}(?:([^\\s"'>=/]+)(${ut}*=${ut}*(?:[^
|
|
3470
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Sr = /'/g, _r = /"/g, Yr = /^(?:script|style|textarea|title)$/i, Is = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), x = Is(1), fe = /* @__PURE__ */ Symbol.for("lit-noChange"), U = /* @__PURE__ */ Symbol.for("lit-nothing"), Ar = /* @__PURE__ */ new WeakMap(), ie = oe.createTreeWalker(oe, 129);
|
|
3471
|
+
function Gr(n, e) {
|
|
3472
|
+
if (!Bt(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
3473
|
+
return vr !== void 0 ? vr.createHTML(e) : e;
|
|
3474
|
+
}
|
|
3475
|
+
const Ds = (n, e) => {
|
|
3476
3476
|
const t = n.length - 1, r = [];
|
|
3477
|
-
let i, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o =
|
|
3477
|
+
let i, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = Ue;
|
|
3478
3478
|
for (let l = 0; l < t; l++) {
|
|
3479
3479
|
const h = n[l];
|
|
3480
|
-
let d, p, m = -1,
|
|
3481
|
-
for (;
|
|
3482
|
-
const
|
|
3483
|
-
s += o ===
|
|
3480
|
+
let d, p, m = -1, y = 0;
|
|
3481
|
+
for (; y < h.length && (o.lastIndex = y, p = o.exec(h), p !== null); ) y = o.lastIndex, o === Ue ? p[1] === "!--" ? o = wr : p[1] !== void 0 ? o = br : p[2] !== void 0 ? (Yr.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = re) : p[3] !== void 0 && (o = re) : o === re ? p[0] === ">" ? (o = i ?? Ue, m = -1) : p[1] === void 0 ? m = -2 : (m = o.lastIndex - p[2].length, d = p[1], o = p[3] === void 0 ? re : p[3] === '"' ? _r : Sr) : o === _r || o === Sr ? o = re : o === wr || o === br ? o = Ue : (o = re, i = void 0);
|
|
3482
|
+
const v = o === re && n[l + 1].startsWith("/>") ? " " : "";
|
|
3483
|
+
s += o === Ue ? h + Us : m >= 0 ? (r.push(d), h.slice(0, m) + zr + h.slice(m) + J + v) : h + J + (m === -2 ? l : v);
|
|
3484
3484
|
}
|
|
3485
|
-
return [
|
|
3485
|
+
return [Gr(n, s + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
|
|
3486
3486
|
};
|
|
3487
3487
|
class Fe {
|
|
3488
3488
|
constructor({ strings: e, _$litType$: t }, r) {
|
|
3489
3489
|
let i;
|
|
3490
3490
|
this.parts = [];
|
|
3491
3491
|
let s = 0, o = 0;
|
|
3492
|
-
const l = e.length - 1, h = this.parts, [d, p] =
|
|
3492
|
+
const l = e.length - 1, h = this.parts, [d, p] = Ds(e, t);
|
|
3493
3493
|
if (this.el = Fe.createElement(d, r), ie.currentNode = this.el.content, t === 2 || t === 3) {
|
|
3494
3494
|
const m = this.el.content.firstChild;
|
|
3495
3495
|
m.replaceWith(...m.childNodes);
|
|
3496
3496
|
}
|
|
3497
3497
|
for (; (i = ie.nextNode()) !== null && h.length < l; ) {
|
|
3498
3498
|
if (i.nodeType === 1) {
|
|
3499
|
-
if (i.hasAttributes()) for (const m of i.getAttributeNames()) if (m.endsWith(
|
|
3500
|
-
const
|
|
3501
|
-
h.push({ type: 1, index: s, name: b[2], strings:
|
|
3499
|
+
if (i.hasAttributes()) for (const m of i.getAttributeNames()) if (m.endsWith(zr)) {
|
|
3500
|
+
const y = p[o++], v = i.getAttribute(m).split(J), b = /([.?@])?(.*)/.exec(y);
|
|
3501
|
+
h.push({ type: 1, index: s, name: b[2], strings: v, ctor: b[1] === "." ? Rs : b[1] === "?" ? $s : b[1] === "@" ? Ps : et }), i.removeAttribute(m);
|
|
3502
3502
|
} else m.startsWith(J) && (h.push({ type: 6, index: s }), i.removeAttribute(m));
|
|
3503
|
-
if (
|
|
3504
|
-
const m = i.textContent.split(J),
|
|
3505
|
-
if (
|
|
3503
|
+
if (Yr.test(i.tagName)) {
|
|
3504
|
+
const m = i.textContent.split(J), y = m.length - 1;
|
|
3505
|
+
if (y > 0) {
|
|
3506
3506
|
i.textContent = Ye ? Ye.emptyScript : "";
|
|
3507
|
-
for (let
|
|
3508
|
-
i.append(m[
|
|
3507
|
+
for (let v = 0; v < y; v++) i.append(m[v], $e()), ie.nextNode(), h.push({ type: 2, index: ++s });
|
|
3508
|
+
i.append(m[y], $e());
|
|
3509
3509
|
}
|
|
3510
3510
|
}
|
|
3511
|
-
} else if (i.nodeType === 8) if (i.data ===
|
|
3511
|
+
} else if (i.nodeType === 8) if (i.data === Wr) h.push({ type: 2, index: s });
|
|
3512
3512
|
else {
|
|
3513
3513
|
let m = -1;
|
|
3514
3514
|
for (; (m = i.data.indexOf(J, m + 1)) !== -1; ) h.push({ type: 7, index: s }), m += J.length - 1;
|
|
@@ -3521,13 +3521,13 @@ class Fe {
|
|
|
3521
3521
|
return r.innerHTML = e, r;
|
|
3522
3522
|
}
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3525
|
-
if (e ===
|
|
3524
|
+
function de(n, e, t = n, r) {
|
|
3525
|
+
if (e === fe) return e;
|
|
3526
3526
|
let i = r !== void 0 ? t._$Co?.[r] : t._$Cl;
|
|
3527
3527
|
const s = Pe(e) ? void 0 : e._$litDirective$;
|
|
3528
|
-
return i?.constructor !== s && (i?._$AO?.(!1), s === void 0 ? i = void 0 : (i = new s(n), i._$AT(n, t, r)), r !== void 0 ? (t._$Co ??= [])[r] = i : t._$Cl = i), i !== void 0 && (e =
|
|
3528
|
+
return i?.constructor !== s && (i?._$AO?.(!1), s === void 0 ? i = void 0 : (i = new s(n), i._$AT(n, t, r)), r !== void 0 ? (t._$Co ??= [])[r] = i : t._$Cl = i), i !== void 0 && (e = de(n, i._$AS(n, e.values), i, r)), e;
|
|
3529
3529
|
}
|
|
3530
|
-
class
|
|
3530
|
+
class ks {
|
|
3531
3531
|
constructor(e, t) {
|
|
3532
3532
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
3533
3533
|
}
|
|
@@ -3544,7 +3544,7 @@ class Us {
|
|
|
3544
3544
|
for (; h !== void 0; ) {
|
|
3545
3545
|
if (o === h.index) {
|
|
3546
3546
|
let d;
|
|
3547
|
-
h.type === 2 ? d = new Be(s, s.nextSibling, this, e) : h.type === 1 ? d = new h.ctor(s, h.name, h.strings, this, e) : h.type === 6 && (d = new
|
|
3547
|
+
h.type === 2 ? d = new Be(s, s.nextSibling, this, e) : h.type === 1 ? d = new h.ctor(s, h.name, h.strings, this, e) : h.type === 6 && (d = new Fs(s, this, e)), this._$AV.push(d), h = r[++l];
|
|
3548
3548
|
}
|
|
3549
3549
|
o !== h?.index && (s = ie.nextNode(), o++);
|
|
3550
3550
|
}
|
|
@@ -3560,7 +3560,7 @@ class Be {
|
|
|
3560
3560
|
return this._$AM?._$AU ?? this._$Cv;
|
|
3561
3561
|
}
|
|
3562
3562
|
constructor(e, t, r, i) {
|
|
3563
|
-
this.type = 2, this._$AH =
|
|
3563
|
+
this.type = 2, this._$AH = U, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
3564
3564
|
}
|
|
3565
3565
|
get parentNode() {
|
|
3566
3566
|
let e = this._$AA.parentNode;
|
|
@@ -3574,7 +3574,7 @@ class Be {
|
|
|
3574
3574
|
return this._$AB;
|
|
3575
3575
|
}
|
|
3576
3576
|
_$AI(e, t = this) {
|
|
3577
|
-
e =
|
|
3577
|
+
e = de(this, e, t), Pe(e) ? e === U || e == null || e === "" ? (this._$AH !== U && this._$AR(), this._$AH = U) : e !== this._$AH && e !== fe && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ts(e) ? this.k(e) : this._(e);
|
|
3578
3578
|
}
|
|
3579
3579
|
O(e) {
|
|
3580
3580
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -3583,22 +3583,22 @@ class Be {
|
|
|
3583
3583
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
3584
3584
|
}
|
|
3585
3585
|
_(e) {
|
|
3586
|
-
this._$AH !==
|
|
3586
|
+
this._$AH !== U && Pe(this._$AH) ? this._$AA.nextSibling.data = e : this.T(oe.createTextNode(e)), this._$AH = e;
|
|
3587
3587
|
}
|
|
3588
3588
|
$(e) {
|
|
3589
|
-
const { values: t, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = Fe.createElement(
|
|
3589
|
+
const { values: t, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = Fe.createElement(Gr(r.h, r.h[0]), this.options)), r);
|
|
3590
3590
|
if (this._$AH?._$AD === i) this._$AH.p(t);
|
|
3591
3591
|
else {
|
|
3592
|
-
const s = new
|
|
3592
|
+
const s = new ks(i, this), o = s.u(this.options);
|
|
3593
3593
|
s.p(t), this.T(o), this._$AH = s;
|
|
3594
3594
|
}
|
|
3595
3595
|
}
|
|
3596
3596
|
_$AC(e) {
|
|
3597
|
-
let t =
|
|
3598
|
-
return t === void 0 &&
|
|
3597
|
+
let t = Ar.get(e.strings);
|
|
3598
|
+
return t === void 0 && Ar.set(e.strings, t = new Fe(e)), t;
|
|
3599
3599
|
}
|
|
3600
3600
|
k(e) {
|
|
3601
|
-
|
|
3601
|
+
Bt(this._$AH) || (this._$AH = [], this._$AR());
|
|
3602
3602
|
const t = this._$AH;
|
|
3603
3603
|
let r, i = 0;
|
|
3604
3604
|
for (const s of e) i === t.length ? t.push(r = new Be(this.O($e()), this.O($e()), this, this.options)) : r = t[i], r._$AI(s), i++;
|
|
@@ -3606,8 +3606,8 @@ class Be {
|
|
|
3606
3606
|
}
|
|
3607
3607
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
3608
3608
|
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
3609
|
-
const r =
|
|
3610
|
-
|
|
3609
|
+
const r = yr(e).nextSibling;
|
|
3610
|
+
yr(e).remove(), e = r;
|
|
3611
3611
|
}
|
|
3612
3612
|
}
|
|
3613
3613
|
setConnected(e) {
|
|
@@ -3622,53 +3622,53 @@ class et {
|
|
|
3622
3622
|
return this._$AM._$AU;
|
|
3623
3623
|
}
|
|
3624
3624
|
constructor(e, t, r, i, s) {
|
|
3625
|
-
this.type = 1, this._$AH =
|
|
3625
|
+
this.type = 1, this._$AH = U, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = s, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = U;
|
|
3626
3626
|
}
|
|
3627
3627
|
_$AI(e, t = this, r, i) {
|
|
3628
3628
|
const s = this.strings;
|
|
3629
3629
|
let o = !1;
|
|
3630
|
-
if (s === void 0) e =
|
|
3630
|
+
if (s === void 0) e = de(this, e, t, 0), o = !Pe(e) || e !== this._$AH && e !== fe, o && (this._$AH = e);
|
|
3631
3631
|
else {
|
|
3632
3632
|
const l = e;
|
|
3633
3633
|
let h, d;
|
|
3634
|
-
for (e = s[0], h = 0; h < s.length - 1; h++) d =
|
|
3634
|
+
for (e = s[0], h = 0; h < s.length - 1; h++) d = de(this, l[r + h], t, h), d === fe && (d = this._$AH[h]), o ||= !Pe(d) || d !== this._$AH[h], d === U ? e = U : e !== U && (e += (d ?? "") + s[h + 1]), this._$AH[h] = d;
|
|
3635
3635
|
}
|
|
3636
3636
|
o && !i && this.j(e);
|
|
3637
3637
|
}
|
|
3638
3638
|
j(e) {
|
|
3639
|
-
e ===
|
|
3639
|
+
e === U ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
3640
3640
|
}
|
|
3641
3641
|
}
|
|
3642
|
-
class
|
|
3642
|
+
class Rs extends et {
|
|
3643
3643
|
constructor() {
|
|
3644
3644
|
super(...arguments), this.type = 3;
|
|
3645
3645
|
}
|
|
3646
3646
|
j(e) {
|
|
3647
|
-
this.element[this.name] = e ===
|
|
3647
|
+
this.element[this.name] = e === U ? void 0 : e;
|
|
3648
3648
|
}
|
|
3649
3649
|
}
|
|
3650
|
-
class
|
|
3650
|
+
class $s extends et {
|
|
3651
3651
|
constructor() {
|
|
3652
3652
|
super(...arguments), this.type = 4;
|
|
3653
3653
|
}
|
|
3654
3654
|
j(e) {
|
|
3655
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
3655
|
+
this.element.toggleAttribute(this.name, !!e && e !== U);
|
|
3656
3656
|
}
|
|
3657
3657
|
}
|
|
3658
|
-
class
|
|
3658
|
+
class Ps extends et {
|
|
3659
3659
|
constructor(e, t, r, i, s) {
|
|
3660
3660
|
super(e, t, r, i, s), this.type = 5;
|
|
3661
3661
|
}
|
|
3662
3662
|
_$AI(e, t = this) {
|
|
3663
|
-
if ((e =
|
|
3664
|
-
const r = this._$AH, i = e ===
|
|
3663
|
+
if ((e = de(this, e, t, 0) ?? U) === fe) return;
|
|
3664
|
+
const r = this._$AH, i = e === U && r !== U || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, s = e !== U && (r === U || i);
|
|
3665
3665
|
i && this.element.removeEventListener(this.name, this, r), s && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
3666
3666
|
}
|
|
3667
3667
|
handleEvent(e) {
|
|
3668
3668
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
3669
3669
|
}
|
|
3670
3670
|
}
|
|
3671
|
-
class
|
|
3671
|
+
class Fs {
|
|
3672
3672
|
constructor(e, t, r) {
|
|
3673
3673
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = r;
|
|
3674
3674
|
}
|
|
@@ -3676,12 +3676,12 @@ class Rs {
|
|
|
3676
3676
|
return this._$AM._$AU;
|
|
3677
3677
|
}
|
|
3678
3678
|
_$AI(e) {
|
|
3679
|
-
|
|
3679
|
+
de(this, e);
|
|
3680
3680
|
}
|
|
3681
3681
|
}
|
|
3682
|
-
const
|
|
3683
|
-
|
|
3684
|
-
const
|
|
3682
|
+
const Bs = Ft.litHtmlPolyfillSupport;
|
|
3683
|
+
Bs?.(Fe, Be), (Ft.litHtmlVersions ??= []).push("3.3.3");
|
|
3684
|
+
const Ms = (n, e, t) => {
|
|
3685
3685
|
const r = t?.renderBefore ?? e;
|
|
3686
3686
|
let i = r._$litPart$;
|
|
3687
3687
|
if (i === void 0) {
|
|
@@ -3690,8 +3690,8 @@ const $s = (n, e, t) => {
|
|
|
3690
3690
|
}
|
|
3691
3691
|
return i._$AI(n), i;
|
|
3692
3692
|
};
|
|
3693
|
-
const
|
|
3694
|
-
class se extends
|
|
3693
|
+
const Mt = globalThis;
|
|
3694
|
+
class se extends he {
|
|
3695
3695
|
constructor() {
|
|
3696
3696
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
3697
3697
|
}
|
|
@@ -3701,7 +3701,7 @@ class se extends ce {
|
|
|
3701
3701
|
}
|
|
3702
3702
|
update(e) {
|
|
3703
3703
|
const t = this.render();
|
|
3704
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
3704
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ms(t, this.renderRoot, this.renderOptions);
|
|
3705
3705
|
}
|
|
3706
3706
|
connectedCallback() {
|
|
3707
3707
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -3710,14 +3710,14 @@ class se extends ce {
|
|
|
3710
3710
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
3711
3711
|
}
|
|
3712
3712
|
render() {
|
|
3713
|
-
return
|
|
3713
|
+
return fe;
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
|
-
se._$litElement$ = !0, se.finalized = !0,
|
|
3717
|
-
const
|
|
3718
|
-
|
|
3719
|
-
(
|
|
3720
|
-
const
|
|
3716
|
+
se._$litElement$ = !0, se.finalized = !0, Mt.litElementHydrateSupport?.({ LitElement: se });
|
|
3717
|
+
const Os = Mt.litElementPolyfillSupport;
|
|
3718
|
+
Os?.({ LitElement: se });
|
|
3719
|
+
(Mt.litElementVersions ??= []).push("4.2.2");
|
|
3720
|
+
const Ns = z`
|
|
3721
3721
|
:host {
|
|
3722
3722
|
display: block;
|
|
3723
3723
|
box-sizing: border-box;
|
|
@@ -3741,7 +3741,7 @@ const Fs = H`
|
|
|
3741
3741
|
position: absolute; width: 1px; height: 1px; overflow: hidden;
|
|
3742
3742
|
clip: rect(0 0 0 0); white-space: nowrap;
|
|
3743
3743
|
}
|
|
3744
|
-
`,
|
|
3744
|
+
`, qs = z`
|
|
3745
3745
|
@keyframes pop-in {
|
|
3746
3746
|
0% { opacity: 0; transform: translateY(16px) scale(0.95); }
|
|
3747
3747
|
100% { opacity: 1; transform: translateY(0) scale(1); }
|
|
@@ -3772,7 +3772,7 @@ const Fs = H`
|
|
|
3772
3772
|
animation: none !important;
|
|
3773
3773
|
}
|
|
3774
3774
|
}
|
|
3775
|
-
`,
|
|
3775
|
+
`, Ls = z`
|
|
3776
3776
|
.msg { max-width: 85%; padding: 12px 16px; border-radius: 14px; font-size: 15px; }
|
|
3777
3777
|
.msg.bot {
|
|
3778
3778
|
background: var(--wral-semantic-surface-default, #FFFFFF);
|
|
@@ -3794,7 +3794,7 @@ const Fs = H`
|
|
|
3794
3794
|
.msg .sub { display: block; font-size: 13px; color: var(--wral-semantic-fg-muted, #64748B); margin-top: 4px; }
|
|
3795
3795
|
.msg.user .sub { color: rgba(255, 255, 255, 0.75); }
|
|
3796
3796
|
.msg.error { border-left: 3px solid var(--wral-base-red-on-light, #D1232A); }
|
|
3797
|
-
`,
|
|
3797
|
+
`, Ks = z`
|
|
3798
3798
|
.options { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 92%; padding: 2px 0 6px; }
|
|
3799
3799
|
.chip {
|
|
3800
3800
|
font-family: var(--wral-base-font-ui, 'IBM Plex Sans Condensed', sans-serif);
|
|
@@ -3808,7 +3808,7 @@ const Fs = H`
|
|
|
3808
3808
|
.chip:hover { background: var(--wral-base-secondary-1, #2594E3); color: #FFFFFF; }
|
|
3809
3809
|
.chip:focus-visible { outline: 2px solid var(--wral-base-secondary-1, #2594E3); outline-offset: 2px; }
|
|
3810
3810
|
.chip:active { transform: scale(0.97); }
|
|
3811
|
-
`,
|
|
3811
|
+
`, js = z`
|
|
3812
3812
|
.form-card {
|
|
3813
3813
|
align-self: stretch;
|
|
3814
3814
|
background: var(--wral-semantic-surface-default, #FFFFFF);
|
|
@@ -3873,7 +3873,7 @@ const Fs = H`
|
|
|
3873
3873
|
.btn-ghost:hover { border-color: var(--wral-base-secondary-1, #2594E3); }
|
|
3874
3874
|
.btn-ghost:active { transform: scale(0.97); }
|
|
3875
3875
|
.btn-ghost:focus-visible { outline: 2px solid var(--wral-base-secondary-1, #2594E3); outline-offset: 2px; }
|
|
3876
|
-
`,
|
|
3876
|
+
`, Vs = z`
|
|
3877
3877
|
.login-card { padding: 28px 26px; }
|
|
3878
3878
|
.login-card h2 {
|
|
3879
3879
|
font-family: var(--wral-base-font-display, 'IBM Plex Sans Condensed', sans-serif);
|
|
@@ -3919,13 +3919,48 @@ const Fs = H`
|
|
|
3919
3919
|
.login-why ul { margin: 0; padding-left: 20px; font-size: 14px; color: var(--color-gray-6, #565454); }
|
|
3920
3920
|
.login-why li { margin-bottom: 4px; line-height: 1.5; }
|
|
3921
3921
|
.login-why a { color: var(--color-secondary, #2594E3); font-weight: 600; text-decoration: underline; }
|
|
3922
|
-
.login-
|
|
3923
|
-
border-top: 1px solid var(--color-gray-2, #E7E5E4); margin: 16px
|
|
3924
|
-
|
|
3922
|
+
.login-alt {
|
|
3923
|
+
border-top: 1px solid var(--color-gray-2, #E7E5E4); margin-top: 16px; padding-top: 12px;
|
|
3924
|
+
}
|
|
3925
|
+
.login-alt > summary {
|
|
3926
|
+
display: flex; align-items: center; gap: 7px;
|
|
3927
|
+
font-size: 14px; font-weight: 600;
|
|
3928
|
+
color: var(--color-gray-5, #6C6C6C);
|
|
3929
|
+
padding: 3px 0; cursor: pointer; list-style: none;
|
|
3930
|
+
}
|
|
3931
|
+
.login-alt > summary::-webkit-details-marker { display: none; }
|
|
3932
|
+
.login-alt > summary::before {
|
|
3933
|
+
content: ''; flex-shrink: 0; padding: 2.5px;
|
|
3934
|
+
border: solid currentColor; border-width: 0 1.5px 1.5px 0;
|
|
3935
|
+
transform: rotate(-45deg); transition: transform 150ms;
|
|
3936
|
+
}
|
|
3937
|
+
.login-alt[open] > summary::before { transform: rotate(45deg); }
|
|
3938
|
+
.login-alt > summary:hover { color: var(--color-gray-8, #263238); }
|
|
3939
|
+
.login-alt > summary:focus-visible { outline: 2px solid var(--color-secondary, #2594E3); outline-offset: 2px; }
|
|
3940
|
+
.login-alt .alt-body {
|
|
3941
|
+
font-size: 13.5px; color: var(--color-gray-6, #565454);
|
|
3942
|
+
line-height: 1.55; padding: 6px 0 2px;
|
|
3943
|
+
}
|
|
3944
|
+
.login-alt .alt-row { margin: 0 0 10px; }
|
|
3945
|
+
.login-alt .alt-row:last-child { margin-bottom: 0; }
|
|
3946
|
+
.login-alt a, .login-alt .alt-link {
|
|
3947
|
+
color: var(--color-primary-dark, #00144A); font-weight: 600;
|
|
3948
|
+
text-decoration: underline;
|
|
3925
3949
|
}
|
|
3926
|
-
.login-
|
|
3927
|
-
.login-
|
|
3928
|
-
|
|
3950
|
+
.login-alt a { text-decoration: none; white-space: nowrap; }
|
|
3951
|
+
.login-alt a:hover { text-decoration: underline; }
|
|
3952
|
+
.login-alt .alt-link {
|
|
3953
|
+
background: none; border: none; padding: 0; cursor: pointer;
|
|
3954
|
+
font-family: inherit; font-size: inherit;
|
|
3955
|
+
}
|
|
3956
|
+
.login-alt .alt-link:focus-visible { outline: 2px solid var(--color-secondary, #2594E3); outline-offset: 2px; }
|
|
3957
|
+
.anon-costs { margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: var(--color-gray-6, #565454); }
|
|
3958
|
+
.anon-costs li { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 9px; line-height: 1.5; }
|
|
3959
|
+
.anon-costs li:last-child { margin-bottom: 0; }
|
|
3960
|
+
.anon-costs .x { flex-shrink: 0; font-weight: 700; color: var(--wral-base-red-on-light, #D1232A); }
|
|
3961
|
+
.anon-actions { display: flex; flex-direction: column; gap: 10px; }
|
|
3962
|
+
.anon-actions .btn-ghost { width: 100%; }
|
|
3963
|
+
`, Hs = z`
|
|
3929
3964
|
.review-list { margin: 0; padding: 0; list-style: none; font-size: 14px; }
|
|
3930
3965
|
.review-list li {
|
|
3931
3966
|
display: grid; grid-template-columns: 130px 1fr; gap: 10px;
|
|
@@ -3957,7 +3992,7 @@ const Fs = H`
|
|
|
3957
3992
|
color: var(--wral-base-primary-1, #001D68);
|
|
3958
3993
|
}
|
|
3959
3994
|
@media (max-width: 540px) { .review-list li { grid-template-columns: 1fr; gap: 2px; } }
|
|
3960
|
-
`,
|
|
3995
|
+
`, zs = z`
|
|
3961
3996
|
.upload-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
|
|
3962
3997
|
.upload-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3963
3998
|
.upload-row .state { font-size: 12px; color: var(--wral-semantic-fg-subtle, #64748B); }
|
|
@@ -3973,7 +4008,7 @@ const Fs = H`
|
|
|
3973
4008
|
border-radius: 999px; padding: 3px 12px; cursor: pointer;
|
|
3974
4009
|
}
|
|
3975
4010
|
.retry-chip:focus-visible { outline: 2px solid var(--wral-base-secondary-1, #2594E3); outline-offset: 2px; }
|
|
3976
|
-
`,
|
|
4011
|
+
`, Ws = z`
|
|
3977
4012
|
.confirm-card {
|
|
3978
4013
|
align-self: stretch;
|
|
3979
4014
|
background: var(--wral-base-primary-1, #001D68);
|
|
@@ -4023,7 +4058,7 @@ const Fs = H`
|
|
|
4023
4058
|
.c-again:hover { background: rgba(255, 255, 255, 0.12); }
|
|
4024
4059
|
.c-again:focus-visible { outline: 2px solid var(--wral-base-secondary-2, #50A9E8); outline-offset: 2px; }
|
|
4025
4060
|
.c-again:active { transform: scale(0.97); }
|
|
4026
|
-
`,
|
|
4061
|
+
`, Ys = z`
|
|
4027
4062
|
.journey {
|
|
4028
4063
|
align-self: stretch;
|
|
4029
4064
|
background: var(--wral-semantic-surface-default, #FFFFFF);
|
|
@@ -4064,7 +4099,7 @@ const Fs = H`
|
|
|
4064
4099
|
color: var(--wral-base-primary-1, #001D68); margin-bottom: 2px;
|
|
4065
4100
|
}
|
|
4066
4101
|
.j-body .j-d { font-size: 13.5px; color: var(--wral-semantic-fg-muted, #475569); line-height: 1.55; }
|
|
4067
|
-
`,
|
|
4102
|
+
`, Gs = z`
|
|
4068
4103
|
.bottom-bar {
|
|
4069
4104
|
position: sticky; bottom: 0; z-index: 20;
|
|
4070
4105
|
background: var(--wral-semantic-surface-default, #FFFFFF);
|
|
@@ -4077,32 +4112,32 @@ const Fs = H`
|
|
|
4077
4112
|
}
|
|
4078
4113
|
.bottom-bar .note { margin-left: auto; font-size: 12px; color: var(--wral-semantic-fg-subtle, #64748B); }
|
|
4079
4114
|
@media (max-width: 540px) { .bottom-bar .note { display: none; } }
|
|
4080
|
-
`,
|
|
4081
|
-
function
|
|
4082
|
-
return
|
|
4115
|
+
`, Js = [Ns, qs, Ls, Ks, js, Vs, Hs, zs, Ws, Ys, Gs];
|
|
4116
|
+
function K(n, e, { noAnim: t = !1, error: r = !1 } = {}) {
|
|
4117
|
+
return x`
|
|
4083
4118
|
<div class="msg bot ${t ? "no-anim" : ""} ${r ? "error" : ""}">
|
|
4084
4119
|
<span class="lead">${n}</span>
|
|
4085
|
-
${e ?
|
|
4120
|
+
${e ? x`<span class="sub">${e}</span>` : U}
|
|
4086
4121
|
</div>
|
|
4087
4122
|
`;
|
|
4088
4123
|
}
|
|
4089
4124
|
function He(n, { noAnim: e = !1 } = {}) {
|
|
4090
|
-
return
|
|
4125
|
+
return x`<div class="msg user ${e ? "no-anim" : ""}">${n}</div>`;
|
|
4091
4126
|
}
|
|
4092
4127
|
function lt() {
|
|
4093
|
-
return
|
|
4128
|
+
return x`<div class="msg bot typing"><span></span><span></span><span></span></div>`;
|
|
4094
4129
|
}
|
|
4095
|
-
function
|
|
4096
|
-
return n ?
|
|
4130
|
+
function Zs(n) {
|
|
4131
|
+
return n ? x`<span class="flag-pill ${n}">${n === "urgent" ? "Urgent" : "Moderate"}</span>` : U;
|
|
4097
4132
|
}
|
|
4098
|
-
function
|
|
4099
|
-
return
|
|
4133
|
+
function Xs() {
|
|
4134
|
+
return x`
|
|
4100
4135
|
<svg viewBox="0 0 24 24" fill="none" stroke="#FFFFFF" stroke-width="3"
|
|
4101
4136
|
stroke-linecap="round" stroke-linejoin="round" width="20" height="20"
|
|
4102
4137
|
aria-hidden="true"><path d="M20 6L9 17l-5-5"/></svg>
|
|
4103
4138
|
`;
|
|
4104
4139
|
}
|
|
4105
|
-
const
|
|
4140
|
+
const Qs = (n = {}) => ({
|
|
4106
4141
|
userPoolId: n.userPoolId || "us-east-1_5Hz6i23GR",
|
|
4107
4142
|
clientId: n.clientId || "835efrp61536otaeun4ob6iqn",
|
|
4108
4143
|
region: n.region || "us-east-1",
|
|
@@ -4120,20 +4155,20 @@ const Gs = (n = {}) => ({
|
|
|
4120
4155
|
} catch {
|
|
4121
4156
|
return null;
|
|
4122
4157
|
}
|
|
4123
|
-
},
|
|
4158
|
+
}, eo = () => {
|
|
4124
4159
|
const n = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789", e = "!@#$%^&*";
|
|
4125
4160
|
return [...Array(12)].map(() => n.charAt(Math.floor(Math.random() * n.length))).join("") + "Aa1" + e.charAt(Math.floor(Math.random() * e.length));
|
|
4126
|
-
},
|
|
4161
|
+
}, Ot = (n) => new AmazonCognitoIdentity.CognitoUserPool({
|
|
4127
4162
|
UserPoolId: n.userPoolId,
|
|
4128
4163
|
ClientId: n.clientId
|
|
4129
|
-
}),
|
|
4164
|
+
}), Nt = (n, e) => new AmazonCognitoIdentity.CognitoUser({
|
|
4130
4165
|
Username: n.toLowerCase().trim(),
|
|
4131
4166
|
Pool: e
|
|
4132
4167
|
}), Je = (n) => ({
|
|
4133
4168
|
idToken: n.getIdToken().getJwtToken(),
|
|
4134
4169
|
accessToken: n.getAccessToken().getJwtToken(),
|
|
4135
4170
|
refreshToken: n.getRefreshToken().getToken()
|
|
4136
|
-
}),
|
|
4171
|
+
}), Jr = () => ({
|
|
4137
4172
|
get: (n) => localStorage.getItem(n),
|
|
4138
4173
|
set: (n, e) => localStorage.setItem(n, e),
|
|
4139
4174
|
remove: (n) => localStorage.removeItem(n),
|
|
@@ -4142,7 +4177,7 @@ const Gs = (n = {}) => ({
|
|
|
4142
4177
|
n.set(N.idToken, e.idToken), n.set(N.accessToken, e.accessToken), n.set(N.refreshToken, e.refreshToken);
|
|
4143
4178
|
const r = t(e.idToken), i = r?.exp ? (r.exp * 1e3).toString() : (Date.now() + 3600 * 1e3).toString();
|
|
4144
4179
|
n.set(N.idTokenExpiry, i), n.set(N.userEmail, r?.email || ""), n.set(N.userId, r?.sub || "");
|
|
4145
|
-
},
|
|
4180
|
+
}, to = (n, e, t) => new Promise((r) => {
|
|
4146
4181
|
const i = t();
|
|
4147
4182
|
e.signUp(
|
|
4148
4183
|
n,
|
|
@@ -4157,27 +4192,27 @@ const Gs = (n = {}) => ({
|
|
|
4157
4192
|
r({ exists: !1, result: o });
|
|
4158
4193
|
}
|
|
4159
4194
|
);
|
|
4160
|
-
}),
|
|
4195
|
+
}), ro = async (n, e, t, r, i, s, o, l, h) => {
|
|
4161
4196
|
const d = e.toLowerCase().trim(), p = r(n);
|
|
4162
|
-
await i(d, p,
|
|
4197
|
+
await i(d, p, eo);
|
|
4163
4198
|
const m = s(d, p);
|
|
4164
|
-
return m.setAuthenticationFlowType("CUSTOM_AUTH"), new Promise((
|
|
4199
|
+
return m.setAuthenticationFlowType("CUSTOM_AUTH"), new Promise((y, v) => {
|
|
4165
4200
|
m.initiateAuth(new AmazonCognitoIdentity.AuthenticationDetails({
|
|
4166
4201
|
Username: d
|
|
4167
4202
|
}), {
|
|
4168
4203
|
onSuccess: (b) => {
|
|
4169
4204
|
const _ = o(b);
|
|
4170
|
-
l(t, _, h),
|
|
4205
|
+
l(t, _, h), y({ success: !0, authenticated: !0, cognitoUser: m });
|
|
4171
4206
|
},
|
|
4172
4207
|
onFailure: (b) => {
|
|
4173
|
-
console.error("[sendCode] initiateAuth failed:", b),
|
|
4208
|
+
console.error("[sendCode] initiateAuth failed:", b), v(b);
|
|
4174
4209
|
},
|
|
4175
4210
|
customChallenge: () => {
|
|
4176
|
-
console.log("[sendCode] Custom challenge issued - code sent to email"),
|
|
4211
|
+
console.log("[sendCode] Custom challenge issued - code sent to email"), y({ success: !0, challengeRequired: !0, cognitoUser: m });
|
|
4177
4212
|
}
|
|
4178
4213
|
});
|
|
4179
4214
|
});
|
|
4180
|
-
},
|
|
4215
|
+
}, no = (n, e, t, r, i, s) => new Promise((o, l) => {
|
|
4181
4216
|
n.sendCustomChallengeAnswer(e, {
|
|
4182
4217
|
onSuccess: (h) => {
|
|
4183
4218
|
const d = r(h);
|
|
@@ -4186,7 +4221,7 @@ const Gs = (n = {}) => ({
|
|
|
4186
4221
|
onFailure: l,
|
|
4187
4222
|
customChallenge: () => l(new Error("Invalid code"))
|
|
4188
4223
|
});
|
|
4189
|
-
}),
|
|
4224
|
+
}), Zr = async (n, e, t, r, i, s, o) => {
|
|
4190
4225
|
const l = e.get(N.refreshToken);
|
|
4191
4226
|
if (!l) return null;
|
|
4192
4227
|
const h = e.get(N.userEmail);
|
|
@@ -4194,22 +4229,22 @@ const Gs = (n = {}) => ({
|
|
|
4194
4229
|
const d = t(n), p = r(h, d), m = new AmazonCognitoIdentity.CognitoRefreshToken({
|
|
4195
4230
|
RefreshToken: l
|
|
4196
4231
|
});
|
|
4197
|
-
return new Promise((
|
|
4198
|
-
p.refreshSession(m, (
|
|
4199
|
-
if (
|
|
4200
|
-
return e.clear(),
|
|
4232
|
+
return new Promise((y) => {
|
|
4233
|
+
p.refreshSession(m, (v, b) => {
|
|
4234
|
+
if (v)
|
|
4235
|
+
return e.clear(), y(null);
|
|
4201
4236
|
const _ = i(b);
|
|
4202
|
-
s(e, _, o),
|
|
4237
|
+
s(e, _, o), y(_.accessToken);
|
|
4203
4238
|
});
|
|
4204
4239
|
});
|
|
4205
|
-
},
|
|
4240
|
+
}, io = async (n, e) => {
|
|
4206
4241
|
let t = e.get(N.accessToken);
|
|
4207
4242
|
if (!t) {
|
|
4208
|
-
const r = await
|
|
4243
|
+
const r = await Zr(
|
|
4209
4244
|
n,
|
|
4210
4245
|
e,
|
|
4211
|
-
|
|
4212
|
-
|
|
4246
|
+
Ot,
|
|
4247
|
+
Nt,
|
|
4213
4248
|
Je,
|
|
4214
4249
|
Ze,
|
|
4215
4250
|
Ge
|
|
@@ -4222,110 +4257,137 @@ const Gs = (n = {}) => ({
|
|
|
4222
4257
|
"Content-Type": "application/json"
|
|
4223
4258
|
};
|
|
4224
4259
|
};
|
|
4225
|
-
let ct = null,
|
|
4226
|
-
function
|
|
4227
|
-
return ct || (ct =
|
|
4260
|
+
let ct = null, xr = null;
|
|
4261
|
+
function qt() {
|
|
4262
|
+
return ct || (ct = Qs(window.authConfig || {}), xr = Jr()), { config: ct, storage: xr };
|
|
4228
4263
|
}
|
|
4229
|
-
async function
|
|
4230
|
-
const { config: n, storage: e } =
|
|
4231
|
-
return
|
|
4264
|
+
async function Xr() {
|
|
4265
|
+
const { config: n, storage: e } = qt();
|
|
4266
|
+
return Zr(
|
|
4232
4267
|
n,
|
|
4233
4268
|
e,
|
|
4234
|
-
|
|
4235
|
-
|
|
4269
|
+
Ot,
|
|
4270
|
+
Nt,
|
|
4236
4271
|
Je,
|
|
4237
4272
|
Ze,
|
|
4238
4273
|
Ge
|
|
4239
4274
|
);
|
|
4240
4275
|
}
|
|
4241
|
-
async function
|
|
4242
|
-
const { storage: n } =
|
|
4243
|
-
return e && t && Date.now() < Number(t) ? !0 : !!await
|
|
4276
|
+
async function so() {
|
|
4277
|
+
const { storage: n } = qt(), e = n.get(N.accessToken), t = n.get(N.idTokenExpiry);
|
|
4278
|
+
return e && t && Date.now() < Number(t) ? !0 : !!await Xr();
|
|
4244
4279
|
}
|
|
4245
|
-
|
|
4280
|
+
const oo = 15e3;
|
|
4281
|
+
class ce extends Error {
|
|
4246
4282
|
constructor(e, t) {
|
|
4247
4283
|
super(`api-forms request failed with status ${e}`), this.status = e, this.body = t;
|
|
4248
4284
|
}
|
|
4249
4285
|
}
|
|
4250
|
-
|
|
4286
|
+
const Cr = Object.freeze({ enabled: !1, humanCheck: null });
|
|
4287
|
+
function ao({
|
|
4251
4288
|
baseUrl: n,
|
|
4252
4289
|
fetchFn: e = (...i) => fetch(...i),
|
|
4253
4290
|
xhrFactory: t = () => new XMLHttpRequest(),
|
|
4254
4291
|
getAuthHeaders: r
|
|
4255
4292
|
}) {
|
|
4256
4293
|
const i = String(n || "").replace(/\/+$/, "");
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4294
|
+
let s = Cr, o = null;
|
|
4295
|
+
async function l(h, { method: d = "GET", body: p, auth: m = !1, timeoutMs: y } = {}) {
|
|
4296
|
+
const v = { Accept: "application/json" };
|
|
4297
|
+
m && Object.assign(v, o ? { Authorization: `Bearer ${o}` } : await r()), p !== void 0 && (v["Content-Type"] = "application/json");
|
|
4298
|
+
let b;
|
|
4261
4299
|
try {
|
|
4262
|
-
|
|
4263
|
-
method:
|
|
4264
|
-
headers:
|
|
4265
|
-
...
|
|
4300
|
+
b = await e(`${i}${h}`, {
|
|
4301
|
+
method: d,
|
|
4302
|
+
headers: v,
|
|
4303
|
+
...y ? { signal: AbortSignal.timeout(y) } : {},
|
|
4304
|
+
...p !== void 0 ? { body: JSON.stringify(p) } : {}
|
|
4266
4305
|
});
|
|
4267
|
-
} catch (
|
|
4268
|
-
throw Object.assign(new
|
|
4306
|
+
} catch (C) {
|
|
4307
|
+
throw Object.assign(new ce(0, null), { cause: C });
|
|
4269
4308
|
}
|
|
4270
|
-
let
|
|
4309
|
+
let _ = null;
|
|
4271
4310
|
try {
|
|
4272
|
-
|
|
4311
|
+
_ = await b.json();
|
|
4273
4312
|
} catch {
|
|
4274
4313
|
}
|
|
4275
|
-
if (!
|
|
4276
|
-
throw new
|
|
4277
|
-
return
|
|
4314
|
+
if (!b.ok)
|
|
4315
|
+
throw new ce(b.status, _);
|
|
4316
|
+
return _;
|
|
4278
4317
|
}
|
|
4279
4318
|
return {
|
|
4280
4319
|
/** @returns {Promise<Array>} published form documents */
|
|
4281
4320
|
listForms: async () => {
|
|
4282
|
-
const
|
|
4283
|
-
return (
|
|
4321
|
+
const h = await l("/v1/forms", { timeoutMs: oo });
|
|
4322
|
+
return s = h?.anonymous?.enabled === !0 ? { enabled: !0, humanCheck: h.anonymous.humanCheck || null } : Cr, (h?.forms || []).filter((d) => d?.formId && d?.start && Array.isArray(d?.nodes));
|
|
4323
|
+
},
|
|
4324
|
+
/**
|
|
4325
|
+
* What the server advertised on the last listForms.
|
|
4326
|
+
* @returns {{enabled: boolean, humanCheck: {provider, siteKey}|null}}
|
|
4327
|
+
*/
|
|
4328
|
+
anonymousCapability: () => s,
|
|
4329
|
+
/**
|
|
4330
|
+
* Mint a submission-scoped anonymous session; subsequent auth-bearing
|
|
4331
|
+
* calls present it until endAnonSession(). Unauthenticated by design.
|
|
4332
|
+
* @returns {Promise<{expiresIn: number}>}
|
|
4333
|
+
*/
|
|
4334
|
+
createAnonSession: async ({ formId: h, requestId: d, humanToken: p }) => {
|
|
4335
|
+
const m = await l("/v1/anon/sessions", {
|
|
4336
|
+
method: "POST",
|
|
4337
|
+
body: { formId: h, requestId: d, ...p ? { humanToken: p } : {} }
|
|
4338
|
+
});
|
|
4339
|
+
if (o = m?.token || null, !o)
|
|
4340
|
+
throw new ce(502, { message: "The anonymous session had no token" });
|
|
4341
|
+
return { expiresIn: m.expiresIn };
|
|
4342
|
+
},
|
|
4343
|
+
/** Drop the anonymous session so identity headers apply again. */
|
|
4344
|
+
endAnonSession: () => {
|
|
4345
|
+
o = null;
|
|
4284
4346
|
},
|
|
4285
4347
|
/** @returns {Promise<Array<{assetId,url,method,expires,assetUrl}>>} */
|
|
4286
|
-
createUploads: async (
|
|
4287
|
-
const { uploads:
|
|
4288
|
-
return
|
|
4348
|
+
createUploads: async (h) => {
|
|
4349
|
+
const { uploads: d } = await l("/v1/uploads", { method: "POST", body: h, auth: !0 });
|
|
4350
|
+
return d || [];
|
|
4289
4351
|
},
|
|
4290
4352
|
/**
|
|
4291
4353
|
* PUT one file to its presigned URL. XHR (not fetch) so upload
|
|
4292
4354
|
* progress is observable. Resolves on 2xx; rejects with
|
|
4293
4355
|
* ApiError(status) otherwise. Returns { promise, abort }.
|
|
4294
4356
|
*/
|
|
4295
|
-
uploadFile: ({ url:
|
|
4357
|
+
uploadFile: ({ url: h, file: d, contentType: p, onProgress: m = () => {
|
|
4296
4358
|
} }) => {
|
|
4297
|
-
const
|
|
4298
|
-
return { promise: new Promise((
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
}),
|
|
4302
|
-
|
|
4303
|
-
},
|
|
4304
|
-
}), abort: () =>
|
|
4359
|
+
const y = t();
|
|
4360
|
+
return { promise: new Promise((b, _) => {
|
|
4361
|
+
y.open("PUT", h), y.setRequestHeader("Content-Type", p || d.type), y.upload && (y.upload.onprogress = (C) => {
|
|
4362
|
+
m({ loaded: C.loaded, total: C.total || d.size });
|
|
4363
|
+
}), y.onload = () => {
|
|
4364
|
+
y.status >= 200 && y.status < 300 ? b({ status: y.status }) : _(new ce(y.status, null));
|
|
4365
|
+
}, y.onerror = () => _(new ce(0, null)), y.onabort = () => _(new ce(0, { aborted: !0 })), y.send(d);
|
|
4366
|
+
}), abort: () => y.abort() };
|
|
4305
4367
|
},
|
|
4306
4368
|
/** @returns {Promise<{requestId,reference,confirmation,routing}>} */
|
|
4307
|
-
putRequest: async (
|
|
4369
|
+
putRequest: async (h, d) => await l(`/v1/requests/${h}`, { method: "PUT", body: d, auth: !0 })
|
|
4308
4370
|
};
|
|
4309
4371
|
}
|
|
4310
|
-
function
|
|
4311
|
-
const { config: n, storage: e } =
|
|
4372
|
+
function uo() {
|
|
4373
|
+
const { config: n, storage: e } = qt();
|
|
4312
4374
|
let t = null;
|
|
4313
4375
|
return {
|
|
4314
|
-
isAuthenticated: () =>
|
|
4376
|
+
isAuthenticated: () => so(),
|
|
4315
4377
|
signedInEmail: () => e.get(N.userEmail) || null,
|
|
4316
|
-
getAuthHeaders: () =>
|
|
4378
|
+
getAuthHeaders: () => io(n, e),
|
|
4317
4379
|
/**
|
|
4318
4380
|
* Email step. Keeps the challenge user in memory for verifyCode.
|
|
4319
4381
|
* @returns {{challengeRequired?: boolean, authenticated?: boolean}}
|
|
4320
4382
|
*/
|
|
4321
4383
|
sendCode: async (r) => {
|
|
4322
|
-
const i = await
|
|
4384
|
+
const i = await ro(
|
|
4323
4385
|
n,
|
|
4324
4386
|
r,
|
|
4325
4387
|
e,
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4388
|
+
Ot,
|
|
4389
|
+
to,
|
|
4390
|
+
Nt,
|
|
4329
4391
|
Je,
|
|
4330
4392
|
Ze,
|
|
4331
4393
|
Ge
|
|
@@ -4343,7 +4405,7 @@ function no() {
|
|
|
4343
4405
|
if (!t)
|
|
4344
4406
|
throw new Error("Please enter your email again to get a new code.");
|
|
4345
4407
|
try {
|
|
4346
|
-
await
|
|
4408
|
+
await no(
|
|
4347
4409
|
t,
|
|
4348
4410
|
r,
|
|
4349
4411
|
e,
|
|
@@ -4354,11 +4416,11 @@ function no() {
|
|
|
4354
4416
|
} catch {
|
|
4355
4417
|
throw new Error("Invalid or expired code. Please request a new one and try again.");
|
|
4356
4418
|
}
|
|
4357
|
-
return await
|
|
4419
|
+
return await Xr(), { success: !0 };
|
|
4358
4420
|
},
|
|
4359
4421
|
/** Local sign-out only ("use a different email"). */
|
|
4360
4422
|
signOut: () => {
|
|
4361
|
-
t = null,
|
|
4423
|
+
t = null, Jr().clear();
|
|
4362
4424
|
},
|
|
4363
4425
|
/**
|
|
4364
4426
|
* Detect a login completed in ANOTHER tab (the storage event
|
|
@@ -4372,14 +4434,14 @@ function no() {
|
|
|
4372
4434
|
}
|
|
4373
4435
|
};
|
|
4374
4436
|
}
|
|
4375
|
-
function
|
|
4376
|
-
const e =
|
|
4377
|
-
return { ...
|
|
4437
|
+
function lo({ baseUrl: n }) {
|
|
4438
|
+
const e = uo();
|
|
4439
|
+
return { ...ao({ baseUrl: n, getAuthHeaders: e.getAuthHeaders }), ...e };
|
|
4378
4440
|
}
|
|
4379
4441
|
function ae(n, e) {
|
|
4380
4442
|
return (n?.nodes || []).find((t) => t.id === e);
|
|
4381
4443
|
}
|
|
4382
|
-
function
|
|
4444
|
+
function Qr(n, e = []) {
|
|
4383
4445
|
const t = [];
|
|
4384
4446
|
let r = n?.start;
|
|
4385
4447
|
for (const s of e) {
|
|
@@ -4400,9 +4462,9 @@ function Gr(n, e = []) {
|
|
|
4400
4462
|
r = o.next;
|
|
4401
4463
|
}
|
|
4402
4464
|
const i = ae(n, r);
|
|
4403
|
-
return i ? { nodeId: r, node: i, flags:
|
|
4465
|
+
return i ? { nodeId: r, node: i, flags: tn(t), error: null } : { nodeId: null, node: null, flags: t, error: { step: null, reason: `unknown node: ${r}` } };
|
|
4404
4466
|
}
|
|
4405
|
-
function
|
|
4467
|
+
function co(n, e = []) {
|
|
4406
4468
|
const t = [];
|
|
4407
4469
|
for (const r of e) {
|
|
4408
4470
|
if (r.kind !== "collect") continue;
|
|
@@ -4411,46 +4473,46 @@ function so(n, e = []) {
|
|
|
4411
4473
|
}
|
|
4412
4474
|
return t;
|
|
4413
4475
|
}
|
|
4414
|
-
function
|
|
4476
|
+
function ho(n = []) {
|
|
4415
4477
|
const e = {};
|
|
4416
4478
|
for (const t of n)
|
|
4417
4479
|
t.kind === "collect" && Object.assign(e, t.values || {});
|
|
4418
4480
|
return e;
|
|
4419
4481
|
}
|
|
4420
|
-
function
|
|
4482
|
+
function fo(n = []) {
|
|
4421
4483
|
return n.filter((e) => e.kind === "choice").map((e) => `${e.nodeId}:${e.optionId}`);
|
|
4422
4484
|
}
|
|
4423
|
-
function
|
|
4485
|
+
function en(n, e = []) {
|
|
4424
4486
|
const t = [];
|
|
4425
4487
|
for (const r of e) {
|
|
4426
4488
|
if (r.kind !== "choice") continue;
|
|
4427
4489
|
const s = (ae(n, r.nodeId)?.options || []).find((o) => o.id === r.optionId);
|
|
4428
4490
|
t.push(...s?.flags || []);
|
|
4429
4491
|
}
|
|
4430
|
-
return
|
|
4492
|
+
return tn(t);
|
|
4431
4493
|
}
|
|
4432
|
-
function
|
|
4494
|
+
function po(n = []) {
|
|
4433
4495
|
return n.includes("urgent") ? "urgent" : n.includes("moderate") ? "moderate" : null;
|
|
4434
4496
|
}
|
|
4435
|
-
function
|
|
4497
|
+
function tn(n) {
|
|
4436
4498
|
return [...new Set(n)];
|
|
4437
4499
|
}
|
|
4438
|
-
const
|
|
4500
|
+
const go = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/, Er = {
|
|
4439
4501
|
text: 500,
|
|
4440
4502
|
textarea: 5e3,
|
|
4441
4503
|
url: 2048
|
|
4442
4504
|
};
|
|
4443
|
-
function
|
|
4444
|
-
if (e == null || e === "" || n.kind === "location" &&
|
|
4505
|
+
function mo(n, e) {
|
|
4506
|
+
if (e == null || e === "" || n.kind === "location" && yo(e))
|
|
4445
4507
|
return n.required ? `Please fill in: ${n.label.toLowerCase()}.` : null;
|
|
4446
4508
|
switch (n.kind) {
|
|
4447
4509
|
case "text":
|
|
4448
4510
|
case "textarea": {
|
|
4449
|
-
const r = n.maxLength ||
|
|
4511
|
+
const r = n.maxLength || Er[n.kind];
|
|
4450
4512
|
return typeof e != "string" ? `Please enter text for ${n.label.toLowerCase()}.` : e.length > r ? `Please keep ${n.label.toLowerCase()} under ${r} characters.` : null;
|
|
4451
4513
|
}
|
|
4452
4514
|
case "url": {
|
|
4453
|
-
if (typeof e != "string" || e.length >
|
|
4515
|
+
if (typeof e != "string" || e.length > Er.url)
|
|
4454
4516
|
return "Please enter a valid link.";
|
|
4455
4517
|
try {
|
|
4456
4518
|
return new URL(e), null;
|
|
@@ -4459,35 +4521,35 @@ function co(n, e) {
|
|
|
4459
4521
|
}
|
|
4460
4522
|
}
|
|
4461
4523
|
case "datetime":
|
|
4462
|
-
return
|
|
4524
|
+
return go.test(String(e)) ? null : "Please pick a date and time.";
|
|
4463
4525
|
case "select":
|
|
4464
4526
|
return (n.options || []).map((i) => i.id).includes(e) ? null : `Please choose one of the options for ${n.label.toLowerCase()}.`;
|
|
4465
4527
|
case "consent":
|
|
4466
4528
|
return e === !0 ? null : "Please confirm the rights statement so we can use what you send.";
|
|
4467
4529
|
case "location":
|
|
4468
|
-
return
|
|
4530
|
+
return vo(n, e);
|
|
4469
4531
|
case "media":
|
|
4470
4532
|
return null;
|
|
4471
4533
|
default:
|
|
4472
4534
|
return `Unsupported field: ${n.kind}`;
|
|
4473
4535
|
}
|
|
4474
4536
|
}
|
|
4475
|
-
function
|
|
4537
|
+
function yo(n) {
|
|
4476
4538
|
return n == null ? !0 : typeof n != "object" ? !1 : !n.county && !n.where && !(Array.isArray(n.gps) && n.gps.length);
|
|
4477
4539
|
}
|
|
4478
|
-
function
|
|
4540
|
+
function vo(n, e) {
|
|
4479
4541
|
return typeof e != "object" || Array.isArray(e) ? "Please tell us where this was." : e.county !== void 0 && (typeof e.county != "string" || e.county.length > 100) ? "Please choose a county." : e.where !== void 0 && (typeof e.where != "string" || e.where.length > 500) ? "Please shorten the location description." : e.gps !== void 0 && !(Array.isArray(e.gps) && e.gps.length === 2 && e.gps.every((r) => typeof r == "number" && Number.isFinite(r))) ? "Location coordinates look wrong; try re-sharing your location." : n.required && !e.county && !e.where ? `Please fill in: ${n.label.toLowerCase()}.` : null;
|
|
4480
4542
|
}
|
|
4481
|
-
function
|
|
4543
|
+
function Ur(n, e = {}) {
|
|
4482
4544
|
const t = {};
|
|
4483
4545
|
for (const r of n) {
|
|
4484
4546
|
if (r.kind === "media") continue;
|
|
4485
|
-
const i =
|
|
4547
|
+
const i = mo(r, e[r.key]);
|
|
4486
4548
|
i && (t[r.key] = i);
|
|
4487
4549
|
}
|
|
4488
4550
|
return { ok: Object.keys(t).length === 0, errors: t };
|
|
4489
4551
|
}
|
|
4490
|
-
function
|
|
4552
|
+
function Tt(n = [], e = {}, { required: t = !1 } = {}) {
|
|
4491
4553
|
const {
|
|
4492
4554
|
maxFiles: r = 5,
|
|
4493
4555
|
maxFileBytes: i = 512 * 1024 * 1024,
|
|
@@ -4508,15 +4570,15 @@ function Et(n = [], e = {}, { required: t = !1 } = {}) {
|
|
|
4508
4570
|
});
|
|
4509
4571
|
}), { ok: o.length === 0, errors: o };
|
|
4510
4572
|
}
|
|
4511
|
-
function
|
|
4573
|
+
function Tr({ formId: n, requestId: e, files: t }) {
|
|
4512
4574
|
return {
|
|
4513
4575
|
formId: n,
|
|
4514
4576
|
requestId: e,
|
|
4515
4577
|
files: t.map((r) => ({ contentType: r.type, size: r.size }))
|
|
4516
4578
|
};
|
|
4517
4579
|
}
|
|
4518
|
-
function
|
|
4519
|
-
const r =
|
|
4580
|
+
function wo({ form: n, steps: e, media: t = [] }) {
|
|
4581
|
+
const r = co(n, e), i = ho(e), s = {};
|
|
4520
4582
|
for (const o of r) {
|
|
4521
4583
|
if (o.kind === "media") continue;
|
|
4522
4584
|
const l = i[o.key];
|
|
@@ -4532,12 +4594,12 @@ function po({ form: n, steps: e, media: t = [] }) {
|
|
|
4532
4594
|
return {
|
|
4533
4595
|
formId: n.formId,
|
|
4534
4596
|
flowVersion: n.flowVersion,
|
|
4535
|
-
path:
|
|
4597
|
+
path: fo(e),
|
|
4536
4598
|
answers: s,
|
|
4537
4599
|
media: t.map(({ assetId: o, type: l }) => ({ assetId: o, type: l }))
|
|
4538
4600
|
};
|
|
4539
4601
|
}
|
|
4540
|
-
function
|
|
4602
|
+
function Ir(n, e) {
|
|
4541
4603
|
if (n === 429)
|
|
4542
4604
|
return {
|
|
4543
4605
|
kind: "throttled",
|
|
@@ -4575,15 +4637,15 @@ function go(n, e) {
|
|
|
4575
4637
|
message: "Something went wrong on our end; please try again."
|
|
4576
4638
|
};
|
|
4577
4639
|
}
|
|
4578
|
-
const
|
|
4579
|
-
function
|
|
4640
|
+
const bo = 34, So = 44;
|
|
4641
|
+
function Dr(n, e) {
|
|
4580
4642
|
const t = String(n);
|
|
4581
4643
|
return t.length > e ? `${t.slice(0, e)}…` : t;
|
|
4582
4644
|
}
|
|
4583
|
-
function
|
|
4645
|
+
function _o(n) {
|
|
4584
4646
|
return !n || typeof n != "object" ? "" : [n.county, n.where].filter(Boolean).join(", ");
|
|
4585
4647
|
}
|
|
4586
|
-
function
|
|
4648
|
+
function Ao(n, e = {}, t = []) {
|
|
4587
4649
|
const r = [];
|
|
4588
4650
|
for (const i of n) {
|
|
4589
4651
|
if (i.kind === "consent") continue;
|
|
@@ -4591,21 +4653,21 @@ function wo(n, e = {}, t = []) {
|
|
|
4591
4653
|
t.length && r.push(`${t.length} ${t.length === 1 ? "file" : "files"}`);
|
|
4592
4654
|
continue;
|
|
4593
4655
|
}
|
|
4594
|
-
const s = i.kind === "location" ?
|
|
4595
|
-
s == null || s === "" || (i.kind === "textarea" ? r.push(`"${
|
|
4656
|
+
const s = i.kind === "location" ? _o(e[i.key]) : e[i.key];
|
|
4657
|
+
s == null || s === "" || (i.kind === "textarea" ? r.push(`"${Dr(s, So)}"`) : r.push(Dr(s, bo)));
|
|
4596
4658
|
}
|
|
4597
4659
|
return r.join(" · ") || "Details provided";
|
|
4598
4660
|
}
|
|
4599
|
-
function
|
|
4661
|
+
function xo(n, e = [], t = null) {
|
|
4600
4662
|
const r = [];
|
|
4601
4663
|
for (const s of e) {
|
|
4602
4664
|
const o = ae(n, s.nodeId);
|
|
4603
|
-
s.kind === "choice" && o && r.push({ k: (o.prompt || "").replace(/\?$/, ""), v: s.label || s.optionId }), s.kind === "collect" && r.push({ k: "Details", v: s.summary || "Details provided" }), s.kind === "gate" && (s.email || t) && r.push({ k: "Verified email", v: s.email || t });
|
|
4665
|
+
s.kind === "choice" && o && r.push({ k: (o.prompt || "").replace(/\?$/, ""), v: s.label || s.optionId }), s.kind === "collect" && r.push({ k: "Details", v: s.summary || "Details provided" }), s.kind === "gate" && (s.anonymous ? r.push({ k: "Contact", v: "Anonymous — we will have no way to reach you" }) : (s.email || t) && r.push({ k: "Verified email", v: s.email || t }));
|
|
4604
4666
|
}
|
|
4605
|
-
const i =
|
|
4667
|
+
const i = po(en(n, e));
|
|
4606
4668
|
return i && r.push({ k: "Priority", v: i === "urgent" ? "Urgent" : "Moderate", pill: i }), r;
|
|
4607
4669
|
}
|
|
4608
|
-
function
|
|
4670
|
+
function Co(n, e = []) {
|
|
4609
4671
|
const t = n?.confirmation || {};
|
|
4610
4672
|
return {
|
|
4611
4673
|
title: t.title || "Report received.",
|
|
@@ -4613,12 +4675,12 @@ function So(n, e = []) {
|
|
|
4613
4675
|
urgentNote: e.includes("urgent") ? t.urgentNote : void 0
|
|
4614
4676
|
};
|
|
4615
4677
|
}
|
|
4616
|
-
function
|
|
4678
|
+
function Eo(n, e) {
|
|
4617
4679
|
const t = e === "failed" ? " The notification is queued for a delivery retry." : "";
|
|
4618
4680
|
return n?.startsWith("studio+email:") ? `Sent to the Studio review queue; the desk is emailed.${t}` : n?.startsWith("studio:") ? "Sent to the Studio review queue." : n?.startsWith("jsm:") ? `A ticket is opened for tech support with your details as fields, not prose.${t}` : n?.startsWith("email:") ? `Emailed to the owning desk with a link to your report.${t}` : "Routed to the right team.";
|
|
4619
4681
|
}
|
|
4620
|
-
function
|
|
4621
|
-
const
|
|
4682
|
+
function Uo({ routing: n = {}, flags: e = [], reference: t = "", anonymous: r = !1 }) {
|
|
4683
|
+
const i = e.includes("urgent");
|
|
4622
4684
|
return [
|
|
4623
4685
|
{
|
|
4624
4686
|
title: "Received",
|
|
@@ -4626,12 +4688,12 @@ function Ao({ routing: n = {}, flags: e = [], reference: t = "" }) {
|
|
|
4626
4688
|
},
|
|
4627
4689
|
{
|
|
4628
4690
|
title: "Routed",
|
|
4629
|
-
body:
|
|
4630
|
-
pill:
|
|
4691
|
+
body: Eo(n.destination, n.state),
|
|
4692
|
+
pill: i ? "Urgent · pinned first" : void 0
|
|
4631
4693
|
},
|
|
4632
4694
|
{
|
|
4633
4695
|
title: "Reviewed",
|
|
4634
|
-
body: "An editor reviews it in the Report It queue: accept and promote with your credit, reject, or re-route."
|
|
4696
|
+
body: r ? "An editor reviews it in the Report It queue: accept and promote it uncredited, reject, or re-route." : "An editor reviews it in the Report It queue: accept and promote with your credit, reject, or re-route."
|
|
4635
4697
|
},
|
|
4636
4698
|
{
|
|
4637
4699
|
title: "Monitored",
|
|
@@ -4643,30 +4705,30 @@ function Ao({ routing: n = {}, flags: e = [], reference: t = "" }) {
|
|
|
4643
4705
|
}
|
|
4644
4706
|
];
|
|
4645
4707
|
}
|
|
4646
|
-
const
|
|
4647
|
-
function
|
|
4708
|
+
const Lt = "wral-report-it:draft:v1", rn = 1;
|
|
4709
|
+
function To(n, e) {
|
|
4648
4710
|
try {
|
|
4649
|
-
n.setItem(
|
|
4711
|
+
n.setItem(Lt, JSON.stringify({ ...e, v: rn, savedAt: Date.now() }));
|
|
4650
4712
|
} catch {
|
|
4651
4713
|
}
|
|
4652
4714
|
}
|
|
4653
|
-
function
|
|
4715
|
+
function Io(n) {
|
|
4654
4716
|
try {
|
|
4655
|
-
const e = n.getItem(
|
|
4717
|
+
const e = n.getItem(Lt);
|
|
4656
4718
|
if (!e) return null;
|
|
4657
4719
|
const t = JSON.parse(e);
|
|
4658
|
-
return t?.v !==
|
|
4720
|
+
return t?.v !== rn ? null : t;
|
|
4659
4721
|
} catch {
|
|
4660
4722
|
return null;
|
|
4661
4723
|
}
|
|
4662
4724
|
}
|
|
4663
|
-
function
|
|
4725
|
+
function kr(n) {
|
|
4664
4726
|
try {
|
|
4665
|
-
n.removeItem(
|
|
4727
|
+
n.removeItem(Lt);
|
|
4666
4728
|
} catch {
|
|
4667
4729
|
}
|
|
4668
4730
|
}
|
|
4669
|
-
function
|
|
4731
|
+
function Do({ apiOrigin: n, form: e, steps: t, requestId: r = null, mediaMeta: i = {} }) {
|
|
4670
4732
|
return {
|
|
4671
4733
|
apiOrigin: n,
|
|
4672
4734
|
formId: e.formId,
|
|
@@ -4676,13 +4738,13 @@ function Eo({ apiOrigin: n, form: e, steps: t, requestId: r = null, mediaMeta: i
|
|
|
4676
4738
|
media: i
|
|
4677
4739
|
};
|
|
4678
4740
|
}
|
|
4679
|
-
function
|
|
4741
|
+
function ko(n, e, { apiOrigin: t } = {}) {
|
|
4680
4742
|
if (!n) return { status: "discarded" };
|
|
4681
4743
|
if (t && n.apiOrigin && n.apiOrigin !== t)
|
|
4682
4744
|
return { status: "discarded" };
|
|
4683
4745
|
const r = (e || []).find((o) => o.formId === n.formId);
|
|
4684
4746
|
if (!r) return { status: "discarded" };
|
|
4685
|
-
const { error: i } =
|
|
4747
|
+
const { error: i } = Qr(r, n.steps || []);
|
|
4686
4748
|
if (i) return { status: "discarded" };
|
|
4687
4749
|
const s = {};
|
|
4688
4750
|
for (const [o, l] of Object.entries(n.media || {}))
|
|
@@ -4715,7 +4777,7 @@ function We(n = []) {
|
|
|
4715
4777
|
error: null
|
|
4716
4778
|
};
|
|
4717
4779
|
}
|
|
4718
|
-
function
|
|
4780
|
+
function Ro(n, e) {
|
|
4719
4781
|
switch (e.type) {
|
|
4720
4782
|
case "START":
|
|
4721
4783
|
return { ...n, stage: n.files.length ? "minting" : "requesting", error: null };
|
|
@@ -4742,7 +4804,7 @@ function To(n, e) {
|
|
|
4742
4804
|
}));
|
|
4743
4805
|
case "FILE_DONE": {
|
|
4744
4806
|
const t = Te(n, e.i, (r) => ({ ...r, status: "done", progress: 1 }));
|
|
4745
|
-
return
|
|
4807
|
+
return $o(t);
|
|
4746
4808
|
}
|
|
4747
4809
|
case "FILE_FAIL":
|
|
4748
4810
|
return { ...Te(n, e.i, (r) => ({
|
|
@@ -4783,14 +4845,14 @@ function Te(n, e, t) {
|
|
|
4783
4845
|
const r = n.files.map((i, s) => s === e ? t(i) : i);
|
|
4784
4846
|
return { ...n, files: r };
|
|
4785
4847
|
}
|
|
4786
|
-
function
|
|
4848
|
+
function $o(n) {
|
|
4787
4849
|
const e = n.files.every((r) => r.status === "done"), t = n.files.some((r) => r.status === "failed");
|
|
4788
4850
|
return e ? { ...n, stage: "requesting" } : t ? { ...n, stage: "uploading-error" } : n;
|
|
4789
4851
|
}
|
|
4790
|
-
function
|
|
4852
|
+
function Rr(n) {
|
|
4791
4853
|
return n.files.map((e, t) => ({ ...e, i: t })).filter((e) => e.status === "failed");
|
|
4792
4854
|
}
|
|
4793
|
-
const
|
|
4855
|
+
const Po = [
|
|
4794
4856
|
"Wake",
|
|
4795
4857
|
"Durham",
|
|
4796
4858
|
"Orange",
|
|
@@ -4807,14 +4869,18 @@ const Do = [
|
|
|
4807
4869
|
"Moore",
|
|
4808
4870
|
"Sampson",
|
|
4809
4871
|
"Other / outside the area"
|
|
4810
|
-
],
|
|
4811
|
-
|
|
4872
|
+
], $r = "(919) 821-8600", Fo = "https://www.wral.com/my-wral/", Bo = Object.freeze([
|
|
4873
|
+
"We cannot come back to you for the detail that often turns a tip into a story.",
|
|
4874
|
+
"We cannot credit you if we use your photos or video.",
|
|
4875
|
+
"If you lose your reference number, we cannot look it up for you."
|
|
4876
|
+
]);
|
|
4877
|
+
function Mo(n) {
|
|
4812
4878
|
const e = String(n).replace(/\D/g, "");
|
|
4813
4879
|
return `tel:+1${e.length === 11 && e.startsWith("1") ? e.slice(1) : e}`;
|
|
4814
4880
|
}
|
|
4815
|
-
const
|
|
4816
|
-
class
|
|
4817
|
-
static styles =
|
|
4881
|
+
const Oo = "https://api.wral.com/forms", No = 480, qo = 2, ht = "Welcome to Report It. What would you like to send us?", ft = "A few quick questions route your report to the right team.", Lo = 2500;
|
|
4882
|
+
class Ko extends se {
|
|
4883
|
+
static styles = Js;
|
|
4818
4884
|
static properties = {
|
|
4819
4885
|
api: { type: String },
|
|
4820
4886
|
_phase: { state: !0 },
|
|
@@ -4822,6 +4888,7 @@ class Bo extends se {
|
|
|
4822
4888
|
_form: { state: !0 },
|
|
4823
4889
|
_steps: { state: !0 },
|
|
4824
4890
|
_typing: { state: !0 },
|
|
4891
|
+
_loadingSlow: { state: !0 },
|
|
4825
4892
|
_cardValues: { state: !0 },
|
|
4826
4893
|
_fieldErrors: { state: !0 },
|
|
4827
4894
|
_gate: { state: !0 },
|
|
@@ -4830,41 +4897,43 @@ class Bo extends se {
|
|
|
4830
4897
|
_notice: { state: !0 },
|
|
4831
4898
|
_result: { state: !0 }
|
|
4832
4899
|
};
|
|
4833
|
-
#
|
|
4834
|
-
#
|
|
4900
|
+
#u = null;
|
|
4901
|
+
#o = null;
|
|
4835
4902
|
#h = null;
|
|
4836
4903
|
#t = null;
|
|
4837
4904
|
#r = {};
|
|
4838
4905
|
#n = {};
|
|
4839
4906
|
#i = /* @__PURE__ */ new Map();
|
|
4840
|
-
#
|
|
4841
|
-
#
|
|
4842
|
-
#
|
|
4907
|
+
#v = null;
|
|
4908
|
+
#f = null;
|
|
4909
|
+
#w = !1;
|
|
4910
|
+
#l = null;
|
|
4911
|
+
#E = 0;
|
|
4843
4912
|
constructor() {
|
|
4844
|
-
super(), this.api =
|
|
4913
|
+
super(), this.api = Oo, this._phase = "loading", this._forms = [], this._form = null, this._steps = [], this._typing = !1, this._loadingSlow = !1, this._cardValues = {}, this._fieldErrors = {}, this._gate = { stage: null, email: "", error: "", loading: !1 }, this._submit = We([]), this._banner = null, this._notice = null, this._result = null;
|
|
4845
4914
|
}
|
|
4846
4915
|
get client() {
|
|
4847
|
-
return this.#
|
|
4916
|
+
return this.#u ? this.#u : ((!this.#o || this.#h !== this.api) && (this.#o = lo({ baseUrl: this.api }), this.#h = this.api), this.#o);
|
|
4848
4917
|
}
|
|
4849
4918
|
set client(e) {
|
|
4850
|
-
this.#
|
|
4919
|
+
this.#u = e || null, this.isConnected && this.#b();
|
|
4851
4920
|
}
|
|
4852
4921
|
connectedCallback() {
|
|
4853
|
-
super.connectedCallback(), this.#
|
|
4922
|
+
super.connectedCallback(), this.#b();
|
|
4854
4923
|
}
|
|
4855
4924
|
disconnectedCallback() {
|
|
4856
|
-
super.disconnectedCallback(), clearTimeout(this.#
|
|
4925
|
+
super.disconnectedCallback(), clearTimeout(this.#v), clearTimeout(this.#f), this.#l?.();
|
|
4857
4926
|
for (const { abort: e } of this.#i.values()) e?.();
|
|
4858
4927
|
this.#i.clear();
|
|
4859
4928
|
}
|
|
4860
|
-
get #
|
|
4929
|
+
get #P() {
|
|
4861
4930
|
try {
|
|
4862
4931
|
return matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4863
4932
|
} catch {
|
|
4864
4933
|
return !0;
|
|
4865
4934
|
}
|
|
4866
4935
|
}
|
|
4867
|
-
get #
|
|
4936
|
+
get #d() {
|
|
4868
4937
|
try {
|
|
4869
4938
|
return sessionStorage;
|
|
4870
4939
|
} catch {
|
|
@@ -4873,28 +4942,49 @@ class Bo extends se {
|
|
|
4873
4942
|
} };
|
|
4874
4943
|
}
|
|
4875
4944
|
}
|
|
4945
|
+
/*
|
|
4946
|
+
* The anonymous route is offered only where it can actually complete.
|
|
4947
|
+
* The server is the authority: GET /v1/forms says whether anonymous
|
|
4948
|
+
* submission is enabled on this deployment, and a form whose desk needs
|
|
4949
|
+
* a way to reach the viewer opts out with allowAnonymous: false.
|
|
4950
|
+
*/
|
|
4951
|
+
get #F() {
|
|
4952
|
+
return this.client.anonymousCapability?.().enabled === !0 && this._form?.allowAnonymous !== !1;
|
|
4953
|
+
}
|
|
4954
|
+
/* Derived from the gate step, so a reload restores the choice. */
|
|
4955
|
+
get #p() {
|
|
4956
|
+
return this._steps.some((e) => e.kind === "gate" && e.anonymous === !0);
|
|
4957
|
+
}
|
|
4876
4958
|
// ── Loading + draft restore ─────────────────────────────────────
|
|
4877
|
-
async #
|
|
4878
|
-
|
|
4959
|
+
async #b() {
|
|
4960
|
+
const e = ++this.#E, t = () => e === this.#E;
|
|
4961
|
+
this._phase = "loading", this._banner = null, this._loadingSlow = !1, clearTimeout(this.#f), this.#f = setTimeout(() => {
|
|
4962
|
+
this._loadingSlow = !0;
|
|
4963
|
+
}, Lo);
|
|
4964
|
+
let r;
|
|
4879
4965
|
try {
|
|
4880
|
-
|
|
4966
|
+
r = await this.client.listForms();
|
|
4881
4967
|
} catch {
|
|
4882
|
-
this._phase = "load-error";
|
|
4968
|
+
t() && (this._phase = "load-error");
|
|
4883
4969
|
return;
|
|
4970
|
+
} finally {
|
|
4971
|
+
t() && (clearTimeout(this.#f), this._loadingSlow = !1);
|
|
4884
4972
|
}
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4973
|
+
if (!t()) return;
|
|
4974
|
+
this._forms = r;
|
|
4975
|
+
const i = ko(Io(this.#d), this._forms, { apiOrigin: this.api });
|
|
4976
|
+
if (i.status === "ok" || i.status === "review-required") {
|
|
4977
|
+
this._form = i.form, this._steps = i.steps, this.#t = i.requestId, this.#n = i.lostMedia || {}, i.status === "review-required" ? this._notice = "This form changed since your last visit — please review your answers." : Object.keys(this.#n).length && (this._notice = "Welcome back — your answers were saved, but attachments need to be re-attached."), this.#a({ animate: !1 });
|
|
4888
4978
|
return;
|
|
4889
4979
|
}
|
|
4890
4980
|
this._phase = "pick";
|
|
4891
4981
|
}
|
|
4892
|
-
#
|
|
4982
|
+
#c() {
|
|
4893
4983
|
if (!this._form) return;
|
|
4894
4984
|
const e = {};
|
|
4895
4985
|
for (const [t, r] of Object.entries(this.#r))
|
|
4896
4986
|
r.length && (e[t] = r.map(({ name: i, type: s, size: o }) => ({ name: i, type: s, size: o })));
|
|
4897
|
-
|
|
4987
|
+
To(this.#d, Do({
|
|
4898
4988
|
apiOrigin: this.api,
|
|
4899
4989
|
form: this._form,
|
|
4900
4990
|
steps: this._steps,
|
|
@@ -4903,45 +4993,45 @@ class Bo extends se {
|
|
|
4903
4993
|
}));
|
|
4904
4994
|
}
|
|
4905
4995
|
// ── Walk mechanics ──────────────────────────────────────────────
|
|
4906
|
-
#
|
|
4907
|
-
this._phase = "walk", this._cardValues = {}, this._fieldErrors = {}, this._gate = { stage: null, email: "", error: "", loading: !1 }, e && !this.#
|
|
4996
|
+
#a({ animate: e = !0 } = {}) {
|
|
4997
|
+
this._phase = "walk", this._cardValues = {}, this._fieldErrors = {}, this._gate = { stage: null, email: "", error: "", loading: !1 }, e && !this.#P ? (this._typing = !0, clearTimeout(this.#v), this.#v = setTimeout(() => {
|
|
4908
4998
|
this._typing = !1;
|
|
4909
|
-
},
|
|
4999
|
+
}, No)) : this._typing = !1;
|
|
4910
5000
|
}
|
|
4911
|
-
get #
|
|
4912
|
-
return this._form ?
|
|
5001
|
+
get #S() {
|
|
5002
|
+
return this._form ? Qr(this._form, this._steps) : { node: null };
|
|
4913
5003
|
}
|
|
4914
|
-
#
|
|
4915
|
-
this._form = e, this._steps = [], this.#t = null, this.#r = {}, this.#n = {}, this._notice = null, this.#
|
|
5004
|
+
#B(e) {
|
|
5005
|
+
this._form = e, this._steps = [], this.#t = null, this.#r = {}, this.#n = {}, this._notice = null, this.#c(), this.#a();
|
|
4916
5006
|
}
|
|
4917
|
-
#
|
|
4918
|
-
this._steps = [...this._steps, e], this.#
|
|
5007
|
+
#g(e) {
|
|
5008
|
+
this._steps = [...this._steps, e], this.#c(), this.#a();
|
|
4919
5009
|
}
|
|
4920
|
-
#
|
|
5010
|
+
#M() {
|
|
4921
5011
|
if (this._phase === "done" || this._phase === "submitting") return;
|
|
4922
5012
|
if (this._phase === "review") {
|
|
4923
|
-
this.#
|
|
5013
|
+
this.#a({ animate: !1 });
|
|
4924
5014
|
return;
|
|
4925
5015
|
}
|
|
4926
5016
|
if (!this._steps.length) {
|
|
4927
|
-
this.#
|
|
5017
|
+
this.#_();
|
|
4928
5018
|
return;
|
|
4929
5019
|
}
|
|
4930
5020
|
const e = this._steps.at(-1);
|
|
4931
|
-
this._steps = this._steps.slice(0, -1), e.kind === "collect" && (this._cardValues = { ...e.values }), this.#
|
|
5021
|
+
this._steps = this._steps.slice(0, -1), e.kind === "collect" && (this._cardValues = { ...e.values }), this.#c(), this.#a({ animate: !1 });
|
|
4932
5022
|
}
|
|
4933
|
-
#
|
|
4934
|
-
this._form = null, this._steps = [], this.#t = null, this.#r = {}, this.#n = {}, this._result = null, this._banner = null, this._notice = null, this._submit = We([]),
|
|
5023
|
+
#_() {
|
|
5024
|
+
this.client.endAnonSession?.(), this._form = null, this._steps = [], this.#t = null, this.#r = {}, this.#n = {}, this._result = null, this._banner = null, this._notice = null, this._submit = We([]), kr(this.#d), this._phase = "pick";
|
|
4935
5025
|
}
|
|
4936
5026
|
// ── Collect card ────────────────────────────────────────────────
|
|
4937
|
-
#
|
|
5027
|
+
#A(e, t) {
|
|
4938
5028
|
this._cardValues = { ...this._cardValues, [e]: t };
|
|
4939
5029
|
}
|
|
4940
|
-
|
|
4941
|
-
const t = e.fields || [], { ok: r, errors: i } =
|
|
5030
|
+
#O(e) {
|
|
5031
|
+
const t = e.fields || [], { ok: r, errors: i } = Ur(t, this._cardValues), s = t.find((h) => h.kind === "media");
|
|
4942
5032
|
let o = !0;
|
|
4943
5033
|
if (s) {
|
|
4944
|
-
const h = this.#r[e.id] || [], d =
|
|
5034
|
+
const h = this.#r[e.id] || [], d = Tt(h, this._form.budget, {
|
|
4945
5035
|
required: !!s.required
|
|
4946
5036
|
});
|
|
4947
5037
|
d.ok ? h.length && (this.#n = { ...this.#n, [e.id]: [] }) : (o = !1, i[s.key] = d.errors[0].message);
|
|
@@ -4951,29 +5041,29 @@ class Bo extends se {
|
|
|
4951
5041
|
return;
|
|
4952
5042
|
}
|
|
4953
5043
|
const l = this.#r[e.id] || [];
|
|
4954
|
-
this.#
|
|
5044
|
+
this.#g({
|
|
4955
5045
|
nodeId: e.id,
|
|
4956
5046
|
kind: "collect",
|
|
4957
5047
|
values: { ...this._cardValues },
|
|
4958
|
-
summary:
|
|
5048
|
+
summary: Ao(t, this._cardValues, l)
|
|
4959
5049
|
});
|
|
4960
5050
|
}
|
|
4961
5051
|
// ── Gate ────────────────────────────────────────────────────────
|
|
4962
|
-
async #
|
|
4963
|
-
if (!(this._gate.stage || this.#
|
|
4964
|
-
this.#
|
|
5052
|
+
async #U() {
|
|
5053
|
+
if (!(this._gate.stage || this.#w)) {
|
|
5054
|
+
this.#w = !0;
|
|
4965
5055
|
try {
|
|
4966
5056
|
const e = await this.client.isAuthenticated();
|
|
4967
5057
|
this._gate = e ? { stage: "signedin", email: this.client.signedInEmail?.() || "", error: "", loading: !1 } : { stage: "email", email: "", error: "", loading: !1 };
|
|
4968
5058
|
} finally {
|
|
4969
|
-
this.#
|
|
5059
|
+
this.#w = !1;
|
|
4970
5060
|
}
|
|
4971
|
-
this._gate.stage === "email" && this.client.onCrossTabLogin && !this.#
|
|
4972
|
-
this.#
|
|
5061
|
+
this._gate.stage === "email" && this.client.onCrossTabLogin && !this.#l && (this.#l = this.client.onCrossTabLogin(() => {
|
|
5062
|
+
this.#l?.(), this.#l = null, this._gate = { stage: null, email: "", error: "", loading: !1 }, this.#U();
|
|
4973
5063
|
}));
|
|
4974
5064
|
}
|
|
4975
5065
|
}
|
|
4976
|
-
async #
|
|
5066
|
+
async #x() {
|
|
4977
5067
|
const e = this._gate.email.trim();
|
|
4978
5068
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
|
|
4979
5069
|
this._gate = { ...this._gate, error: "Please enter a valid email address." };
|
|
@@ -4991,10 +5081,10 @@ class Bo extends se {
|
|
|
4991
5081
|
};
|
|
4992
5082
|
}
|
|
4993
5083
|
}
|
|
4994
|
-
async #
|
|
5084
|
+
async #T(e) {
|
|
4995
5085
|
this._gate = { ...this._gate, error: "", loading: !0 };
|
|
4996
5086
|
try {
|
|
4997
|
-
await this.client.verifyCode(e), this.#
|
|
5087
|
+
await this.client.verifyCode(e), this.#I(this._gate.email);
|
|
4998
5088
|
} catch (t) {
|
|
4999
5089
|
this._gate = {
|
|
5000
5090
|
...this._gate,
|
|
@@ -5003,19 +5093,53 @@ class Bo extends se {
|
|
|
5003
5093
|
};
|
|
5004
5094
|
}
|
|
5005
5095
|
}
|
|
5006
|
-
#
|
|
5096
|
+
#I(e) {
|
|
5007
5097
|
if (this._gate = { stage: null, email: "", error: "", loading: !1 }, this._submit.stage === "auth") {
|
|
5008
|
-
this.#e({ type: "AUTH_OK" }), this._phase = "submitting", this.#
|
|
5098
|
+
this.#e({ type: "AUTH_OK" }), this._phase = "submitting", this.#s();
|
|
5009
5099
|
return;
|
|
5010
5100
|
}
|
|
5011
|
-
const { node: t } = this.#
|
|
5012
|
-
t?.type === "gate" && this.#
|
|
5101
|
+
const { node: t } = this.#S;
|
|
5102
|
+
t?.type === "gate" && this.#g({ nodeId: t.id, kind: "gate", email: e });
|
|
5013
5103
|
}
|
|
5014
|
-
#
|
|
5104
|
+
#N() {
|
|
5015
5105
|
this.client.signOut?.(), this._gate = { stage: "email", email: "", error: "", loading: !1 };
|
|
5016
5106
|
}
|
|
5107
|
+
// ── Anonymous route ─────────────────────────────────────────────
|
|
5108
|
+
#q() {
|
|
5109
|
+
this._gate = { ...this._gate, stage: "anon-confirm", error: "" };
|
|
5110
|
+
}
|
|
5111
|
+
#L() {
|
|
5112
|
+
this._gate = { ...this._gate, stage: "email", error: "" };
|
|
5113
|
+
}
|
|
5114
|
+
/*
|
|
5115
|
+
* Records the choice only. The session is minted at submit, against
|
|
5116
|
+
* the requestId, so an abandoned form leaves nothing behind.
|
|
5117
|
+
*/
|
|
5118
|
+
#K() {
|
|
5119
|
+
const { node: e } = this.#S;
|
|
5120
|
+
e?.type === "gate" && (this._gate = { stage: null, email: "", error: "", loading: !1 }, this.#g({ nodeId: e.id, kind: "gate", anonymous: !0 }));
|
|
5121
|
+
}
|
|
5122
|
+
async #D() {
|
|
5123
|
+
try {
|
|
5124
|
+
return await this.client.createAnonSession({
|
|
5125
|
+
formId: this._form.formId,
|
|
5126
|
+
requestId: this.#t
|
|
5127
|
+
}), !0;
|
|
5128
|
+
} catch (e) {
|
|
5129
|
+
return this._banner = Ir(e?.status ?? 0, e?.body ?? null), !1;
|
|
5130
|
+
}
|
|
5131
|
+
}
|
|
5132
|
+
/* An anonymous session outliving the upload run re-mints in place; there
|
|
5133
|
+
* is no identity to send back to the sign-in card. */
|
|
5134
|
+
async #j() {
|
|
5135
|
+
if (await this.#D()) {
|
|
5136
|
+
this.#e({ type: "AUTH_OK" }), this._phase = "submitting", this.#s();
|
|
5137
|
+
return;
|
|
5138
|
+
}
|
|
5139
|
+
this.#e({ type: "REQUEST_FAIL", error: this._banner });
|
|
5140
|
+
}
|
|
5017
5141
|
// ── Submit pipeline ─────────────────────────────────────────────
|
|
5018
|
-
get #
|
|
5142
|
+
get #m() {
|
|
5019
5143
|
const e = [];
|
|
5020
5144
|
for (const t of this._steps)
|
|
5021
5145
|
if (t.kind === "collect")
|
|
@@ -5024,58 +5148,66 @@ class Bo extends se {
|
|
|
5024
5148
|
return e;
|
|
5025
5149
|
}
|
|
5026
5150
|
#e(e) {
|
|
5027
|
-
this._submit =
|
|
5151
|
+
this._submit = Ro(this._submit, e);
|
|
5028
5152
|
}
|
|
5029
|
-
async #
|
|
5153
|
+
async #V() {
|
|
5030
5154
|
this._banner = null;
|
|
5031
5155
|
for (let e = 0; e < this._steps.length; e++) {
|
|
5032
5156
|
const t = this._steps[e];
|
|
5033
5157
|
if (t.kind !== "collect") continue;
|
|
5034
|
-
const r = ae(this._form, t.nodeId), { ok: i, errors: s } =
|
|
5158
|
+
const r = ae(this._form, t.nodeId), { ok: i, errors: s } = Ur(r?.fields || [], t.values), o = (r?.fields || []).find((h) => h.kind === "media");
|
|
5035
5159
|
let l = !0;
|
|
5036
5160
|
if (o) {
|
|
5037
|
-
const h = this.#r[t.nodeId] || [], d =
|
|
5161
|
+
const h = this.#r[t.nodeId] || [], d = Tt(h, this._form.budget, {
|
|
5038
5162
|
required: !!o.required
|
|
5039
5163
|
});
|
|
5040
5164
|
d.ok || (l = !1, s[o.key] = d.errors[0].message);
|
|
5041
5165
|
}
|
|
5042
5166
|
if (!i || !l) {
|
|
5043
|
-
this._steps = this._steps.slice(0, e), this._cardValues = { ...t.values }, this._fieldErrors = s, this.#
|
|
5167
|
+
this._steps = this._steps.slice(0, e), this._cardValues = { ...t.values }, this._fieldErrors = s, this.#c(), this.#a({ animate: !1 });
|
|
5044
5168
|
return;
|
|
5045
5169
|
}
|
|
5046
5170
|
}
|
|
5047
|
-
if (this.#t = this.#t || crypto.randomUUID(), this.#
|
|
5171
|
+
if (this.#t = this.#t || crypto.randomUUID(), this.#c(), this.#p) {
|
|
5172
|
+
if (!await this.#D()) return;
|
|
5173
|
+
} else
|
|
5174
|
+
this.client.endAnonSession?.();
|
|
5175
|
+
if (this._submit = We(this.#m), this._phase = "submitting", this.#p) {
|
|
5176
|
+
this.#e({ type: "START" }), this.#s();
|
|
5177
|
+
return;
|
|
5178
|
+
}
|
|
5179
|
+
if (!await this.client.isAuthenticated()) {
|
|
5048
5180
|
this.#e({ type: "START" }), this.#e({ type: "AUTH_REQUIRED" }), this._gate = { stage: "email", email: "", error: "", loading: !1 };
|
|
5049
5181
|
return;
|
|
5050
5182
|
}
|
|
5051
|
-
this.#e({ type: "START" }), this.#
|
|
5183
|
+
this.#e({ type: "START" }), this.#s();
|
|
5052
5184
|
}
|
|
5053
|
-
async #
|
|
5185
|
+
async #s() {
|
|
5054
5186
|
const e = this._submit.stage;
|
|
5055
|
-
if (e === "minting") return this.#
|
|
5056
|
-
if (e === "uploading") return this.#
|
|
5057
|
-
if (e === "requesting") return this.#
|
|
5187
|
+
if (e === "minting") return this.#H();
|
|
5188
|
+
if (e === "uploading") return this.#k();
|
|
5189
|
+
if (e === "requesting") return this.#Y();
|
|
5058
5190
|
}
|
|
5059
|
-
async #
|
|
5191
|
+
async #H() {
|
|
5060
5192
|
try {
|
|
5061
|
-
const e = await this.client.createUploads(
|
|
5193
|
+
const e = await this.client.createUploads(Tr({
|
|
5062
5194
|
formId: this._form.formId,
|
|
5063
5195
|
requestId: this.#t,
|
|
5064
|
-
files: this.#
|
|
5196
|
+
files: this.#m
|
|
5065
5197
|
}));
|
|
5066
|
-
this.#e({ type: "MINTED", uploads: e }), this.#
|
|
5198
|
+
this.#e({ type: "MINTED", uploads: e }), this.#s();
|
|
5067
5199
|
} catch (e) {
|
|
5068
|
-
this.#
|
|
5200
|
+
this.#C(e);
|
|
5069
5201
|
}
|
|
5070
5202
|
}
|
|
5071
|
-
#
|
|
5203
|
+
#k() {
|
|
5072
5204
|
const e = this._submit.files, t = this.#i.size;
|
|
5073
5205
|
let r = 0;
|
|
5074
|
-
for (let i = 0; i < e.length && t + r <
|
|
5075
|
-
e[i].status !== "uploading" || this.#i.has(i) || (r += 1, this.#
|
|
5206
|
+
for (let i = 0; i < e.length && t + r < qo; i++)
|
|
5207
|
+
e[i].status !== "uploading" || this.#i.has(i) || (r += 1, this.#z(i));
|
|
5076
5208
|
}
|
|
5077
|
-
#
|
|
5078
|
-
const t = this._submit.files[e], r = this.#
|
|
5209
|
+
#z(e) {
|
|
5210
|
+
const t = this._submit.files[e], r = this.#m[e], { promise: i, abort: s } = this.client.uploadFile({
|
|
5079
5211
|
url: t.url,
|
|
5080
5212
|
file: r,
|
|
5081
5213
|
contentType: t.type,
|
|
@@ -5084,7 +5216,7 @@ class Bo extends se {
|
|
|
5084
5216
|
}
|
|
5085
5217
|
});
|
|
5086
5218
|
this.#i.set(e, { abort: s }), i.then(() => {
|
|
5087
|
-
this.#i.delete(e), this.#e({ type: "FILE_DONE", i: e }), this.#
|
|
5219
|
+
this.#i.delete(e), this.#e({ type: "FILE_DONE", i: e }), this.#s();
|
|
5088
5220
|
}).catch((o) => {
|
|
5089
5221
|
this.#i.delete(e), this.#e({
|
|
5090
5222
|
type: "FILE_FAIL",
|
|
@@ -5093,48 +5225,52 @@ class Bo extends se {
|
|
|
5093
5225
|
});
|
|
5094
5226
|
});
|
|
5095
5227
|
}
|
|
5096
|
-
async #
|
|
5228
|
+
async #W(e) {
|
|
5097
5229
|
if (this._submit.files[e].error === "expired")
|
|
5098
5230
|
try {
|
|
5099
|
-
const [r] = await this.client.createUploads(
|
|
5231
|
+
const [r] = await this.client.createUploads(Tr({
|
|
5100
5232
|
formId: this._form.formId,
|
|
5101
5233
|
requestId: this.#t,
|
|
5102
|
-
files: [this.#
|
|
5234
|
+
files: [this.#m[e]]
|
|
5103
5235
|
}));
|
|
5104
5236
|
this.#e({ type: "REMINT_FILE", i: e, upload: r });
|
|
5105
5237
|
} catch (r) {
|
|
5106
|
-
this.#
|
|
5238
|
+
this.#C(r);
|
|
5107
5239
|
return;
|
|
5108
5240
|
}
|
|
5109
5241
|
else
|
|
5110
5242
|
this.#e({ type: "RETRY_FILE", i: e });
|
|
5111
|
-
this.#
|
|
5243
|
+
this.#k();
|
|
5112
5244
|
}
|
|
5113
|
-
async #
|
|
5245
|
+
async #Y() {
|
|
5114
5246
|
try {
|
|
5115
|
-
const e = this._submit.files.map(({ assetId: r, type: i }) => ({ assetId: r, type: i })), t = await this.client.putRequest(this.#t,
|
|
5247
|
+
const e = this._submit.files.map(({ assetId: r, type: i }) => ({ assetId: r, type: i })), t = await this.client.putRequest(this.#t, wo({
|
|
5116
5248
|
form: this._form,
|
|
5117
5249
|
steps: this._steps,
|
|
5118
5250
|
media: e
|
|
5119
5251
|
}));
|
|
5120
|
-
this.#e({ type: "REQUEST_OK", result: t }), this._result = t,
|
|
5252
|
+
this.#e({ type: "REQUEST_OK", result: t }), this._result = t, kr(this.#d), this.client.endAnonSession?.(), this._phase = "done";
|
|
5121
5253
|
} catch (e) {
|
|
5122
|
-
this.#
|
|
5254
|
+
this.#C(e);
|
|
5123
5255
|
}
|
|
5124
5256
|
}
|
|
5125
|
-
#
|
|
5126
|
-
const t =
|
|
5257
|
+
#C(e) {
|
|
5258
|
+
const t = Ir(e?.status ?? 0, e?.body ?? null);
|
|
5127
5259
|
if (t.kind === "auth") {
|
|
5128
|
-
this.#e({ type: "AUTH_REQUIRED" }), this
|
|
5260
|
+
if (this.#e({ type: "AUTH_REQUIRED" }), this.#p) {
|
|
5261
|
+
this.#j();
|
|
5262
|
+
return;
|
|
5263
|
+
}
|
|
5264
|
+
this._gate = { stage: "email", email: "", error: "", loading: !1 };
|
|
5129
5265
|
return;
|
|
5130
5266
|
}
|
|
5131
5267
|
if (t.kind === "stale") {
|
|
5132
|
-
this._banner = t, this.#e({ type: "REQUEST_FAIL", error: t }), this.#
|
|
5268
|
+
this._banner = t, this.#e({ type: "REQUEST_FAIL", error: t }), this.#G();
|
|
5133
5269
|
return;
|
|
5134
5270
|
}
|
|
5135
5271
|
this._banner = t, this.#e({ type: "REQUEST_FAIL", error: t });
|
|
5136
5272
|
}
|
|
5137
|
-
async #
|
|
5273
|
+
async #G() {
|
|
5138
5274
|
try {
|
|
5139
5275
|
this._forms = await this.client.listForms();
|
|
5140
5276
|
const e = this._forms.find((t) => t.formId === this._form.formId);
|
|
@@ -5142,86 +5278,84 @@ class Bo extends se {
|
|
|
5142
5278
|
} catch {
|
|
5143
5279
|
}
|
|
5144
5280
|
}
|
|
5145
|
-
#
|
|
5146
|
-
this._banner = null, this.#e({ type: "REQUEST_START" }), this.#
|
|
5281
|
+
#J() {
|
|
5282
|
+
this._banner = null, this.#e({ type: "REQUEST_START" }), this.#s();
|
|
5147
5283
|
}
|
|
5148
5284
|
// ── Render ──────────────────────────────────────────────────────
|
|
5149
5285
|
render() {
|
|
5150
|
-
return
|
|
5286
|
+
return x`
|
|
5151
5287
|
<div class="chat" aria-live="polite">
|
|
5152
|
-
${this.#
|
|
5288
|
+
${this.#Z()}
|
|
5153
5289
|
</div>
|
|
5154
|
-
${this.#
|
|
5290
|
+
${this.#ce()}
|
|
5155
5291
|
`;
|
|
5156
5292
|
}
|
|
5157
|
-
#
|
|
5293
|
+
#Z() {
|
|
5158
5294
|
switch (this._phase) {
|
|
5159
5295
|
case "loading":
|
|
5160
|
-
return
|
|
5296
|
+
return x`${K(ht, this._loadingSlow ? "Loading the form list…" : ft)}
|
|
5297
|
+
${lt()}`;
|
|
5161
5298
|
case "load-error":
|
|
5162
|
-
return
|
|
5163
|
-
${
|
|
5299
|
+
return x`
|
|
5300
|
+
${K("We could not load the forms.", "Check your connection and try again.", { error: !0 })}
|
|
5164
5301
|
<div class="options">
|
|
5165
|
-
<button type="button" class="chip" @click=${() => this.#
|
|
5302
|
+
<button type="button" class="chip" @click=${() => this.#b()}>Try again</button>
|
|
5166
5303
|
</div>
|
|
5167
5304
|
`;
|
|
5168
5305
|
case "pick":
|
|
5169
|
-
return this.#
|
|
5306
|
+
return this.#X();
|
|
5170
5307
|
case "walk":
|
|
5171
|
-
return
|
|
5308
|
+
return x`${this.#y()}${this._typing ? lt() : this.#Q()}`;
|
|
5172
5309
|
case "review":
|
|
5173
|
-
return
|
|
5310
|
+
return x`${this.#y()}${this.#$()}`;
|
|
5174
5311
|
case "submitting":
|
|
5175
|
-
return
|
|
5312
|
+
return x`${this.#y()}${this.#ue()}`;
|
|
5176
5313
|
case "done":
|
|
5177
|
-
return
|
|
5314
|
+
return x`${this.#y()}${this.#le()}`;
|
|
5178
5315
|
default:
|
|
5179
|
-
return
|
|
5316
|
+
return U;
|
|
5180
5317
|
}
|
|
5181
5318
|
}
|
|
5182
|
-
#
|
|
5319
|
+
#X() {
|
|
5183
5320
|
const e = this._forms;
|
|
5184
|
-
return
|
|
5185
|
-
${
|
|
5186
|
-
"Welcome to Report It. What would you like to send us?",
|
|
5187
|
-
"A few quick questions route your report to the right team."
|
|
5188
|
-
)}
|
|
5321
|
+
return x`
|
|
5322
|
+
${K(ht, ft, { noAnim: !0 })}
|
|
5189
5323
|
<div class="options" role="group" aria-label="What would you like to send us?">
|
|
5190
|
-
${e.map((t, r) =>
|
|
5324
|
+
${e.map((t, r) => x`
|
|
5191
5325
|
<button type="button" class="chip" style="animation-delay: ${60 + r * 50}ms"
|
|
5192
|
-
@click=${() => this.#
|
|
5326
|
+
@click=${() => this.#B(t)}>${t.title}</button>
|
|
5193
5327
|
`)}
|
|
5194
5328
|
</div>
|
|
5195
5329
|
`;
|
|
5196
5330
|
}
|
|
5197
|
-
#
|
|
5331
|
+
#y() {
|
|
5198
5332
|
const e = [];
|
|
5199
|
-
this._form && (e.push(
|
|
5200
|
-
"Welcome to Report It. What would you like to send us?",
|
|
5201
|
-
"A few quick questions route your report to the right team.",
|
|
5202
|
-
{ noAnim: !0 }
|
|
5203
|
-
)), e.push(He(this._form.title, { noAnim: !0 }))), this._notice && e.push(z(this._notice, "", { noAnim: !0 }));
|
|
5333
|
+
this._form && (e.push(K(ht, ft, { noAnim: !0 })), e.push(He(this._form.title, { noAnim: !0 }))), this._notice && e.push(K(this._notice, "", { noAnim: !0 }));
|
|
5204
5334
|
for (const t of this._steps) {
|
|
5205
5335
|
const r = ae(this._form, t.nodeId);
|
|
5206
|
-
r?.prompt && e.push(
|
|
5336
|
+
r?.prompt && e.push(K(r.prompt, r.help, { noAnim: !0 })), r?.type === "gate" && e.push(t.anonymous ? K(
|
|
5337
|
+
"Last step: how can we reach you?",
|
|
5338
|
+
"You chose to send this anonymously.",
|
|
5339
|
+
{ noAnim: !0 }
|
|
5340
|
+
) : K(
|
|
5207
5341
|
"Last step: verify your email so we can follow up.",
|
|
5208
5342
|
"One address, one code. No password needed.",
|
|
5209
5343
|
{ noAnim: !0 }
|
|
5210
|
-
)), t.kind === "choice" && e.push(He(t.label || t.optionId, { noAnim: !0 })), t.kind === "collect" && e.push(He(t.summary || "Details provided", { noAnim: !0 })), t.kind === "gate" && e.push(He(t.email, { noAnim: !0 }));
|
|
5344
|
+
)), t.kind === "choice" && e.push(He(t.label || t.optionId, { noAnim: !0 })), t.kind === "collect" && e.push(He(t.summary || "Details provided", { noAnim: !0 })), t.kind === "gate" && e.push(He(t.anonymous ? "Send anonymously" : t.email, { noAnim: !0 }));
|
|
5211
5345
|
}
|
|
5212
5346
|
return e;
|
|
5213
5347
|
}
|
|
5214
|
-
#
|
|
5215
|
-
const { node: e, error: t } = this.#
|
|
5216
|
-
return t || !e ?
|
|
5348
|
+
#Q() {
|
|
5349
|
+
const { node: e, error: t } = this.#S;
|
|
5350
|
+
return t || !e ? K("Something went sideways with this form.", "Please start over.", { error: !0 }) : e.type === "choice" ? this.#ee(e) : e.type === "collect" ? this.#te(e) : e.type === "gate" ? this.#R(e) : e.type === "redirect" ? this.#ae(e) : e.type === "terminal" ? this.#$() : U;
|
|
5217
5351
|
}
|
|
5218
|
-
#
|
|
5219
|
-
return
|
|
5220
|
-
${
|
|
5352
|
+
#ee(e) {
|
|
5353
|
+
return x`
|
|
5354
|
+
${K(e.prompt, e.help)}
|
|
5221
5355
|
<div class="options" role="group" aria-label=${e.prompt || "Choose one"}>
|
|
5222
|
-
${(e.options || []).map((t, r) =>
|
|
5356
|
+
${(e.options || []).map((t, r) => x`
|
|
5223
5357
|
<button type="button" class="chip" style="animation-delay: ${60 + r * 50}ms"
|
|
5224
|
-
@click=${() => this.#
|
|
5358
|
+
@click=${() => this.#g({
|
|
5225
5359
|
nodeId: e.id,
|
|
5226
5360
|
kind: "choice",
|
|
5227
5361
|
optionId: t.id,
|
|
@@ -5231,61 +5365,61 @@ class Bo extends se {
|
|
|
5231
5365
|
</div>
|
|
5232
5366
|
`;
|
|
5233
5367
|
}
|
|
5234
|
-
#
|
|
5368
|
+
#te(e) {
|
|
5235
5369
|
const t = e.fields || [];
|
|
5236
|
-
return
|
|
5237
|
-
${
|
|
5370
|
+
return x`
|
|
5371
|
+
${K(e.prompt, e.help)}
|
|
5238
5372
|
<div class="form-card">
|
|
5239
|
-
${t.map((r) => this.#
|
|
5240
|
-
<button type="button" class="btn-primary" @click=${() => this
|
|
5373
|
+
${t.map((r) => this.#re(e, r))}
|
|
5374
|
+
<button type="button" class="btn-primary" @click=${() => this.#O(e)}>
|
|
5241
5375
|
Continue
|
|
5242
5376
|
</button>
|
|
5243
5377
|
</div>
|
|
5244
5378
|
`;
|
|
5245
5379
|
}
|
|
5246
|
-
#
|
|
5247
|
-
const r = this._cardValues[t.key], i = this._fieldErrors[t.key], s = !t.required && t.kind !== "consent" ?
|
|
5380
|
+
#re(e, t) {
|
|
5381
|
+
const r = this._cardValues[t.key], i = this._fieldErrors[t.key], s = !t.required && t.kind !== "consent" ? x` <span class="opt">optional</span>` : U, o = t.kind === "consent" ? U : x`
|
|
5248
5382
|
<label for="f-${t.key}">${t.label}${s}</label>
|
|
5249
5383
|
`;
|
|
5250
|
-
return
|
|
5384
|
+
return x`
|
|
5251
5385
|
<div class="field">
|
|
5252
5386
|
${o}
|
|
5253
|
-
${this.#
|
|
5254
|
-
${i ?
|
|
5387
|
+
${this.#ne(e, t, r)}
|
|
5388
|
+
${i ? x`<div class="err" role="alert">${i}</div>` : U}
|
|
5255
5389
|
</div>
|
|
5256
5390
|
`;
|
|
5257
5391
|
}
|
|
5258
|
-
#
|
|
5259
|
-
const i = (s) => (o) => this.#
|
|
5392
|
+
#ne(e, t, r) {
|
|
5393
|
+
const i = (s) => (o) => this.#A(s, o.target.value);
|
|
5260
5394
|
switch (t.kind) {
|
|
5261
5395
|
case "text":
|
|
5262
|
-
return
|
|
5396
|
+
return x`<input type="text" id="f-${t.key}" .value=${r || ""}
|
|
5263
5397
|
placeholder=${t.placeholder || ""} @input=${i(t.key)}>`;
|
|
5264
5398
|
case "url":
|
|
5265
|
-
return
|
|
5399
|
+
return x`<input type="url" id="f-${t.key}" .value=${r || ""}
|
|
5266
5400
|
placeholder=${t.placeholder || ""} @input=${i(t.key)}>`;
|
|
5267
5401
|
case "textarea":
|
|
5268
|
-
return
|
|
5402
|
+
return x`<textarea id="f-${t.key}" .value=${r || ""}
|
|
5269
5403
|
placeholder=${t.placeholder || ""} @input=${i(t.key)}></textarea>`;
|
|
5270
5404
|
case "datetime":
|
|
5271
|
-
return
|
|
5405
|
+
return x`<input type="datetime-local" id="f-${t.key}" .value=${r || ""}
|
|
5272
5406
|
@input=${i(t.key)}>`;
|
|
5273
5407
|
case "select":
|
|
5274
|
-
return
|
|
5408
|
+
return x`
|
|
5275
5409
|
<select id="f-${t.key}" @change=${i(t.key)}>
|
|
5276
5410
|
<option value="">Choose one</option>
|
|
5277
|
-
${(t.options || []).map((s) =>
|
|
5411
|
+
${(t.options || []).map((s) => x`
|
|
5278
5412
|
<option value=${s.id} ?selected=${r === s.id}>${s.label}</option>
|
|
5279
5413
|
`)}
|
|
5280
5414
|
</select>
|
|
5281
5415
|
`;
|
|
5282
5416
|
case "location":
|
|
5283
|
-
return this.#
|
|
5417
|
+
return this.#ie(t, r || {});
|
|
5284
5418
|
case "consent":
|
|
5285
|
-
return
|
|
5419
|
+
return x`
|
|
5286
5420
|
<div class="consent-row">
|
|
5287
5421
|
<input type="checkbox" id="f-${t.key}" .checked=${r === !0}
|
|
5288
|
-
@change=${(s) => this.#
|
|
5422
|
+
@change=${(s) => this.#A(t.key, s.target.checked)}>
|
|
5289
5423
|
<label for="f-${t.key}" style="all: unset; cursor: pointer;">
|
|
5290
5424
|
I took or own this material and give WRAL permission to use it
|
|
5291
5425
|
on air and online with credit to me.
|
|
@@ -5293,7 +5427,7 @@ class Bo extends se {
|
|
|
5293
5427
|
</div>
|
|
5294
5428
|
`;
|
|
5295
5429
|
case "media":
|
|
5296
|
-
return
|
|
5430
|
+
return x`
|
|
5297
5431
|
<wral-report-media
|
|
5298
5432
|
.files=${this.#r[e.id] || []}
|
|
5299
5433
|
.lostMeta=${this.#n[e.id] || []}
|
|
@@ -5305,16 +5439,16 @@ class Bo extends se {
|
|
|
5305
5439
|
}}></wral-report-media>
|
|
5306
5440
|
`;
|
|
5307
5441
|
default:
|
|
5308
|
-
return
|
|
5442
|
+
return U;
|
|
5309
5443
|
}
|
|
5310
5444
|
}
|
|
5311
|
-
#
|
|
5312
|
-
const r = e.counties ||
|
|
5313
|
-
return
|
|
5445
|
+
#ie(e, t) {
|
|
5446
|
+
const r = e.counties || Po, i = (s) => this.#A(e.key, { ...t, ...s });
|
|
5447
|
+
return x`
|
|
5314
5448
|
<select id="f-${e.key}" aria-label="County"
|
|
5315
5449
|
@change=${(s) => i({ county: s.target.value || void 0 })}>
|
|
5316
5450
|
<option value="">Choose a county</option>
|
|
5317
|
-
${r.map((s) =>
|
|
5451
|
+
${r.map((s) => x`
|
|
5318
5452
|
<option value=${s} ?selected=${t.county === s}>${s}</option>
|
|
5319
5453
|
`)}
|
|
5320
5454
|
</select>
|
|
@@ -5325,24 +5459,24 @@ class Bo extends se {
|
|
|
5325
5459
|
@input=${(s) => i({ where: s.target.value || void 0 })}>
|
|
5326
5460
|
`;
|
|
5327
5461
|
}
|
|
5328
|
-
#
|
|
5329
|
-
this.#
|
|
5330
|
-
const t = this._gate, r =
|
|
5462
|
+
#R(e) {
|
|
5463
|
+
this.#U();
|
|
5464
|
+
const t = this._gate, r = K(
|
|
5331
5465
|
"Last step: verify your email so we can follow up.",
|
|
5332
5466
|
"One address, one code. No password needed."
|
|
5333
5467
|
);
|
|
5334
|
-
return t.stage ? t.stage === "signedin" ?
|
|
5468
|
+
return t.stage ? t.stage === "signedin" ? x`
|
|
5335
5469
|
${r}
|
|
5336
5470
|
<div class="form-card">
|
|
5337
5471
|
<p style="margin: 0 0 12px; font-size: 14.5px;">
|
|
5338
5472
|
You are signed in as <strong>${t.email || "your My WRAL account"}</strong> on this device.
|
|
5339
5473
|
</p>
|
|
5340
5474
|
<button type="button" class="btn-primary"
|
|
5341
|
-
@click=${() => this.#
|
|
5475
|
+
@click=${() => this.#I(t.email)}>Continue</button>
|
|
5342
5476
|
<button type="button" class="btn-ghost"
|
|
5343
|
-
@click=${() => this.#
|
|
5477
|
+
@click=${() => this.#N()}>Use a different email</button>
|
|
5344
5478
|
</div>
|
|
5345
|
-
` : t.stage === "email" ?
|
|
5479
|
+
` : t.stage === "email" ? x`
|
|
5346
5480
|
${r}
|
|
5347
5481
|
<div class="form-card login-card">
|
|
5348
5482
|
<h2>Sign in or create account</h2>
|
|
@@ -5357,12 +5491,12 @@ class Bo extends se {
|
|
|
5357
5491
|
this._gate = { ...t, email: i.target.value };
|
|
5358
5492
|
}}
|
|
5359
5493
|
@keydown=${(i) => {
|
|
5360
|
-
i.key === "Enter" && this.#
|
|
5494
|
+
i.key === "Enter" && this.#x();
|
|
5361
5495
|
}}>
|
|
5362
5496
|
</div>
|
|
5363
|
-
${t.error ?
|
|
5497
|
+
${t.error ? x`<div class="err" role="alert">${t.error}</div>` : U}
|
|
5364
5498
|
<button type="button" class="login-btn" ?disabled=${t.loading}
|
|
5365
|
-
@click=${() => this.#
|
|
5499
|
+
@click=${() => this.#x()}>
|
|
5366
5500
|
${t.loading ? "Sending…" : "Continue with email"}
|
|
5367
5501
|
</button>
|
|
5368
5502
|
<div class="login-why">
|
|
@@ -5371,15 +5505,12 @@ class Bo extends se {
|
|
|
5371
5505
|
<li>We can follow up on your report</li>
|
|
5372
5506
|
<li>Your contact information fills in automatically next time</li>
|
|
5373
5507
|
<li>You are credited by name when we use your photos or video</li>
|
|
5374
|
-
<li><a href=${
|
|
5508
|
+
<li><a href=${Fo} target="_blank" rel="noopener">All other My WRAL account benefits</a></li>
|
|
5375
5509
|
</ul>
|
|
5376
5510
|
</div>
|
|
5377
|
-
|
|
5378
|
-
Want to remain anonymous? Call us at
|
|
5379
|
-
<a href=${ko(Ir)}>${Ir}</a>.
|
|
5380
|
-
</p>
|
|
5511
|
+
${this._submit.stage === "auth" ? U : this.#se()}
|
|
5381
5512
|
</div>
|
|
5382
|
-
` :
|
|
5513
|
+
` : t.stage === "anon-confirm" ? this.#oe(r) : x`
|
|
5383
5514
|
${r}
|
|
5384
5515
|
<div class="form-card login-card">
|
|
5385
5516
|
<h2>Enter verification code</h2>
|
|
@@ -5393,27 +5524,71 @@ class Bo extends se {
|
|
|
5393
5524
|
<div class="field">
|
|
5394
5525
|
<label>Verification code</label>
|
|
5395
5526
|
<wral-code-input
|
|
5396
|
-
@code-complete=${(i) => this.#
|
|
5527
|
+
@code-complete=${(i) => this.#T(i.detail?.code ?? i.detail?.value ?? i.target.value)}>
|
|
5397
5528
|
</wral-code-input>
|
|
5398
5529
|
</div>
|
|
5399
|
-
${t.error ?
|
|
5530
|
+
${t.error ? x`<div class="err" role="alert">${t.error}</div>` : U}
|
|
5400
5531
|
<button type="button" class="login-btn" ?disabled=${t.loading}
|
|
5401
5532
|
@click=${() => {
|
|
5402
5533
|
const i = this.renderRoot.querySelector("wral-code-input");
|
|
5403
|
-
this.#
|
|
5534
|
+
this.#T(i?.value || "");
|
|
5404
5535
|
}}>
|
|
5405
5536
|
${t.loading ? "Checking…" : "Sign in"}
|
|
5406
5537
|
</button>
|
|
5407
5538
|
<p class="login-help">
|
|
5408
5539
|
Didn’t receive a code? Check your spam folder or
|
|
5409
|
-
<button type="button" @click=${() => this.#
|
|
5540
|
+
<button type="button" @click=${() => this.#x()}>resend a new code</button>.
|
|
5410
5541
|
</p>
|
|
5411
5542
|
</div>
|
|
5412
|
-
` :
|
|
5543
|
+
` : x`${r}${lt()}`;
|
|
5544
|
+
}
|
|
5545
|
+
/* Collapsed by default: findable for whoever needs it, never the
|
|
5546
|
+
* first thing a viewer reaches for. */
|
|
5547
|
+
#se() {
|
|
5548
|
+
return x`
|
|
5549
|
+
<details class="login-alt">
|
|
5550
|
+
<summary>Other ways to send this</summary>
|
|
5551
|
+
<div class="alt-body">
|
|
5552
|
+
<p class="alt-row">
|
|
5553
|
+
Call the newsroom desk at
|
|
5554
|
+
<a href=${Mo($r)}>${$r}</a>.
|
|
5555
|
+
</p>
|
|
5556
|
+
${this.#F ? x`
|
|
5557
|
+
<p class="alt-row">
|
|
5558
|
+
<button type="button" class="alt-link"
|
|
5559
|
+
@click=${() => this.#q()}>Send this anonymously</button>
|
|
5560
|
+
— no follow-up, and no credit if we use your photos or video.
|
|
5561
|
+
</p>
|
|
5562
|
+
` : U}
|
|
5563
|
+
</div>
|
|
5564
|
+
</details>
|
|
5565
|
+
`;
|
|
5413
5566
|
}
|
|
5414
|
-
#
|
|
5567
|
+
#oe(e) {
|
|
5568
|
+
return x`
|
|
5569
|
+
${e}
|
|
5570
|
+
<div class="form-card login-card">
|
|
5571
|
+
<h2>Before you send anonymously</h2>
|
|
5572
|
+
<p class="login-sub">
|
|
5573
|
+
You can send this report without an account. Here is what it costs you.
|
|
5574
|
+
</p>
|
|
5575
|
+
<ul class="anon-costs">
|
|
5576
|
+
${Bo.map((t) => x`
|
|
5577
|
+
<li><span class="x" aria-hidden="true">✕</span><span>${t}</span></li>
|
|
5578
|
+
`)}
|
|
5579
|
+
</ul>
|
|
5580
|
+
<div class="anon-actions">
|
|
5581
|
+
<button type="button" class="login-btn"
|
|
5582
|
+
@click=${() => this.#L()}>Sign in instead</button>
|
|
5583
|
+
<button type="button" class="btn-ghost"
|
|
5584
|
+
@click=${() => this.#K()}>Continue anonymously</button>
|
|
5585
|
+
</div>
|
|
5586
|
+
</div>
|
|
5587
|
+
`;
|
|
5588
|
+
}
|
|
5589
|
+
#ae(e) {
|
|
5415
5590
|
const t = e.redirect || {};
|
|
5416
|
-
return
|
|
5591
|
+
return x`
|
|
5417
5592
|
<div class="form-card">
|
|
5418
5593
|
<p style="margin: 0 0 6px; font-weight: 600; font-size: 16px;
|
|
5419
5594
|
color: var(--wral-base-primary-1, #001D68);
|
|
@@ -5430,30 +5605,33 @@ class Bo extends se {
|
|
|
5430
5605
|
</div>
|
|
5431
5606
|
`;
|
|
5432
5607
|
}
|
|
5433
|
-
|
|
5434
|
-
const e =
|
|
5435
|
-
return
|
|
5436
|
-
${
|
|
5608
|
+
#$() {
|
|
5609
|
+
const e = xo(this._form, this._steps);
|
|
5610
|
+
return x`
|
|
5611
|
+
${K("Here is what you are sending.", "Check it over, then submit.")}
|
|
5437
5612
|
<div class="form-card">
|
|
5438
5613
|
<ul class="review-list">
|
|
5439
|
-
${e.map((t) =>
|
|
5614
|
+
${e.map((t) => x`
|
|
5440
5615
|
<li>
|
|
5441
5616
|
<span class="k">${t.k}</span>
|
|
5442
|
-
<span>${t.pill ?
|
|
5617
|
+
<span>${t.pill ? Zs(t.pill) : t.v}</span>
|
|
5443
5618
|
</li>
|
|
5444
5619
|
`)}
|
|
5445
5620
|
</ul>
|
|
5621
|
+
${this._banner ? x`
|
|
5622
|
+
<div class="err" role="alert" style="margin-top: 12px;">${this._banner.message}</div>
|
|
5623
|
+
` : U}
|
|
5446
5624
|
<div style="margin-top: 16px;">
|
|
5447
|
-
<button type="button" class="btn-primary" @click=${() => this.#
|
|
5625
|
+
<button type="button" class="btn-primary" @click=${() => this.#V()}>
|
|
5448
5626
|
Submit report
|
|
5449
5627
|
</button>
|
|
5450
5628
|
</div>
|
|
5451
5629
|
</div>
|
|
5452
5630
|
`;
|
|
5453
5631
|
}
|
|
5454
|
-
#
|
|
5632
|
+
#ue() {
|
|
5455
5633
|
const e = this._submit;
|
|
5456
|
-
if (e.stage === "auth") return this.#
|
|
5634
|
+
if (e.stage === "auth") return this.#R({ id: null, type: "gate" });
|
|
5457
5635
|
const t = {
|
|
5458
5636
|
minting: "Preparing your uploads…",
|
|
5459
5637
|
uploading: "Uploading your files…",
|
|
@@ -5461,10 +5639,10 @@ class Bo extends se {
|
|
|
5461
5639
|
requesting: "Sending your report…",
|
|
5462
5640
|
"requesting-error": this._banner?.message || "We could not send your report."
|
|
5463
5641
|
}[e.stage] || "Working…";
|
|
5464
|
-
return
|
|
5465
|
-
${
|
|
5642
|
+
return x`
|
|
5643
|
+
${K("Submitting your report.", t)}
|
|
5466
5644
|
<div class="form-card">
|
|
5467
|
-
${e.files.map((r, i) =>
|
|
5645
|
+
${e.files.map((r, i) => x`
|
|
5468
5646
|
<div class="upload-row">
|
|
5469
5647
|
<span class="name">${r.name}</span>
|
|
5470
5648
|
<div class="upload-bar" role="progressbar"
|
|
@@ -5475,62 +5653,63 @@ class Bo extends se {
|
|
|
5475
5653
|
<span class="state ${r.status === "failed" ? "failed" : ""}">
|
|
5476
5654
|
${r.status === "done" ? "Done" : r.status === "failed" ? "Failed" : "Uploading"}
|
|
5477
5655
|
</span>
|
|
5478
|
-
${r.status === "failed" ?
|
|
5479
|
-
<button type="button" class="retry-chip" @click=${() => this.#
|
|
5656
|
+
${r.status === "failed" ? x`
|
|
5657
|
+
<button type="button" class="retry-chip" @click=${() => this.#W(i)}>
|
|
5480
5658
|
Retry
|
|
5481
5659
|
</button>
|
|
5482
|
-
` :
|
|
5660
|
+
` : U}
|
|
5483
5661
|
</div>
|
|
5484
5662
|
`)}
|
|
5485
|
-
${e.stage === "requesting-error" ?
|
|
5663
|
+
${e.stage === "requesting-error" ? x`
|
|
5486
5664
|
<div class="err" role="alert">${this._banner?.message || ""}</div>
|
|
5487
|
-
${this._banner?.retryAfter ?
|
|
5665
|
+
${this._banner?.retryAfter ? x`
|
|
5488
5666
|
<div class="file-note">You can try again in about
|
|
5489
5667
|
${Math.ceil(this._banner.retryAfter / 60)} minutes.</div>
|
|
5490
|
-
` :
|
|
5668
|
+
` : U}
|
|
5491
5669
|
<button type="button" class="btn-primary" style="margin-top: 8px;"
|
|
5492
|
-
@click=${() => this.#
|
|
5493
|
-
` :
|
|
5494
|
-
${
|
|
5670
|
+
@click=${() => this.#J()}>Try again</button>
|
|
5671
|
+
` : U}
|
|
5672
|
+
${Rr(e).length && e.stage === "uploading-error" ? x`
|
|
5495
5673
|
<div class="err" role="alert">Retry the failed
|
|
5496
|
-
${
|
|
5497
|
-
` :
|
|
5674
|
+
${Rr(e).length === 1 ? "file" : "files"} to continue.</div>
|
|
5675
|
+
` : U}
|
|
5498
5676
|
</div>
|
|
5499
5677
|
`;
|
|
5500
5678
|
}
|
|
5501
|
-
#
|
|
5502
|
-
const e =
|
|
5679
|
+
#le() {
|
|
5680
|
+
const e = en(this._form, this._steps), t = Co(this._result, e), r = Uo({
|
|
5503
5681
|
routing: this._result?.routing || {},
|
|
5504
5682
|
flags: e,
|
|
5505
|
-
reference: this._result?.reference || ""
|
|
5683
|
+
reference: this._result?.reference || "",
|
|
5684
|
+
anonymous: this.#p
|
|
5506
5685
|
});
|
|
5507
|
-
return
|
|
5686
|
+
return x`
|
|
5508
5687
|
<div class="confirm-card">
|
|
5509
5688
|
<div class="c-head">
|
|
5510
|
-
<div class="c-check">${
|
|
5689
|
+
<div class="c-check">${Xs()}</div>
|
|
5511
5690
|
<div>
|
|
5512
5691
|
<div class="eyebrow">Report received</div>
|
|
5513
5692
|
<h2>${t.title}</h2>
|
|
5514
5693
|
</div>
|
|
5515
5694
|
</div>
|
|
5516
5695
|
<p>${t.body}</p>
|
|
5517
|
-
${t.urgentNote ?
|
|
5696
|
+
${t.urgentNote ? x`<p>${t.urgentNote}</p>` : U}
|
|
5518
5697
|
<div class="refs">
|
|
5519
5698
|
<span class="ref"><span class="rk">Reference</span>${this._result?.reference || ""}</span>
|
|
5520
5699
|
</div>
|
|
5521
|
-
<button type="button" class="c-again" @click=${() => this.#
|
|
5700
|
+
<button type="button" class="c-again" @click=${() => this.#_()}>
|
|
5522
5701
|
Start a new report
|
|
5523
5702
|
</button>
|
|
5524
5703
|
</div>
|
|
5525
5704
|
<div class="journey">
|
|
5526
5705
|
<div class="j-eyebrow">Behind the scenes</div>
|
|
5527
5706
|
<div class="j-title">What happens to your report now</div>
|
|
5528
|
-
${r.map((i, s) =>
|
|
5707
|
+
${r.map((i, s) => x`
|
|
5529
5708
|
<div class="j-step">
|
|
5530
5709
|
<div class="j-dot">${s + 1}</div>
|
|
5531
5710
|
<div class="j-body">
|
|
5532
5711
|
<div class="j-t">${i.title}
|
|
5533
|
-
${i.pill ?
|
|
5712
|
+
${i.pill ? x` <span class="flag-pill urgent">${i.pill}</span>` : U}
|
|
5534
5713
|
</div>
|
|
5535
5714
|
<div class="j-d">${i.body}</div>
|
|
5536
5715
|
</div>
|
|
@@ -5539,15 +5718,15 @@ class Bo extends se {
|
|
|
5539
5718
|
</div>
|
|
5540
5719
|
`;
|
|
5541
5720
|
}
|
|
5542
|
-
#
|
|
5721
|
+
#ce() {
|
|
5543
5722
|
const e = this._phase === "submitting" || this._phase === "done" || this._phase === "loading" || this._phase === "load-error";
|
|
5544
|
-
return
|
|
5723
|
+
return x`
|
|
5545
5724
|
<div class="bottom-bar">
|
|
5546
5725
|
<div class="inner">
|
|
5547
5726
|
<button type="button" class="btn-ghost" ?disabled=${e || this._phase === "pick"}
|
|
5548
|
-
@click=${() => this.#
|
|
5727
|
+
@click=${() => this.#M()}>← Back</button>
|
|
5549
5728
|
<button type="button" class="btn-ghost" ?disabled=${this._phase === "submitting"}
|
|
5550
|
-
@click=${() => this.#
|
|
5729
|
+
@click=${() => this.#_()}>Start over</button>
|
|
5551
5730
|
<span class="note">Your report goes to a person on the right desk.</span>
|
|
5552
5731
|
</div>
|
|
5553
5732
|
</div>
|
|
@@ -5557,7 +5736,7 @@ class Bo extends se {
|
|
|
5557
5736
|
this.renderRoot?.querySelector(".chat")?.lastElementChild?.scrollIntoView?.({ block: "nearest" });
|
|
5558
5737
|
}
|
|
5559
5738
|
}
|
|
5560
|
-
class
|
|
5739
|
+
class jo extends se {
|
|
5561
5740
|
static properties = {
|
|
5562
5741
|
files: { attribute: !1 },
|
|
5563
5742
|
lostMeta: { attribute: !1 },
|
|
@@ -5565,7 +5744,7 @@ class Mo extends se {
|
|
|
5565
5744
|
required: { type: Boolean },
|
|
5566
5745
|
label: { type: String }
|
|
5567
5746
|
};
|
|
5568
|
-
static styles =
|
|
5747
|
+
static styles = z`
|
|
5569
5748
|
:host { display: block; }
|
|
5570
5749
|
input[type=file] { font-family: inherit; font-size: 14px; }
|
|
5571
5750
|
.file-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
|
|
@@ -5587,10 +5766,10 @@ class Mo extends se {
|
|
|
5587
5766
|
constructor() {
|
|
5588
5767
|
super(), this.files = [], this.lostMeta = [], this.budget = {}, this.required = !1, this.label = "Photos or video";
|
|
5589
5768
|
}
|
|
5590
|
-
get #
|
|
5769
|
+
get #u() {
|
|
5591
5770
|
return (this.budget?.allowedTypes || []).join(",");
|
|
5592
5771
|
}
|
|
5593
|
-
#
|
|
5772
|
+
#o(e) {
|
|
5594
5773
|
this.dispatchEvent(new CustomEvent("files-changed", {
|
|
5595
5774
|
detail: { files: e },
|
|
5596
5775
|
bubbles: !0,
|
|
@@ -5599,52 +5778,52 @@ class Mo extends se {
|
|
|
5599
5778
|
}
|
|
5600
5779
|
#h(e) {
|
|
5601
5780
|
const t = [...e.target.files || []];
|
|
5602
|
-
this.#
|
|
5781
|
+
this.#o([...this.files || [], ...t]), e.target.value = "";
|
|
5603
5782
|
}
|
|
5604
5783
|
#t(e) {
|
|
5605
5784
|
const t = [...this.files];
|
|
5606
|
-
t.splice(e, 1), this.#
|
|
5785
|
+
t.splice(e, 1), this.#o(t);
|
|
5607
5786
|
}
|
|
5608
5787
|
render() {
|
|
5609
|
-
const e = this.files || [], { errors: t } =
|
|
5610
|
-
return
|
|
5788
|
+
const e = this.files || [], { errors: t } = Tt(e, this.budget, { required: !1 });
|
|
5789
|
+
return x`
|
|
5611
5790
|
<input type="file" multiple
|
|
5612
|
-
accept=${this.#
|
|
5791
|
+
accept=${this.#u || U}
|
|
5613
5792
|
aria-label=${this.label}
|
|
5614
5793
|
@change=${this.#h}>
|
|
5615
|
-
${e.length ?
|
|
5794
|
+
${e.length ? x`
|
|
5616
5795
|
<ul class="file-list">
|
|
5617
|
-
${e.map((r, i) =>
|
|
5796
|
+
${e.map((r, i) => x`
|
|
5618
5797
|
<li>
|
|
5619
5798
|
<span>${r.name}</span>
|
|
5620
|
-
<span class="size">${
|
|
5799
|
+
<span class="size">${Vo(r.size)}</span>
|
|
5621
5800
|
<button type="button" class="remove"
|
|
5622
5801
|
aria-label="Remove ${r.name}"
|
|
5623
5802
|
@click=${() => this.#t(i)}>✕</button>
|
|
5624
5803
|
</li>
|
|
5625
5804
|
`)}
|
|
5626
5805
|
</ul>
|
|
5627
|
-
` :
|
|
5628
|
-
${(this.lostMeta || []).length ?
|
|
5806
|
+
` : U}
|
|
5807
|
+
${(this.lostMeta || []).length ? x`
|
|
5629
5808
|
<div class="lost">
|
|
5630
5809
|
Please re-attach your ${this.lostMeta.length === 1 ? "file" : "files"}
|
|
5631
5810
|
(${this.lostMeta.map((r) => r.name).join(", ")}) —
|
|
5632
5811
|
attachments can't be saved between visits.
|
|
5633
5812
|
</div>
|
|
5634
|
-
` :
|
|
5635
|
-
${t.map((r) =>
|
|
5813
|
+
` : U}
|
|
5814
|
+
${t.map((r) => x`<div class="err">${r.message}</div>`)}
|
|
5636
5815
|
`;
|
|
5637
5816
|
}
|
|
5638
5817
|
}
|
|
5639
|
-
function
|
|
5818
|
+
function Vo(n) {
|
|
5640
5819
|
return Number.isFinite(n) ? n >= 1024 * 1024 ? `${(n / (1024 * 1024)).toFixed(1)} MB` : n >= 1024 ? `${Math.round(n / 1024)} KB` : `${n} B` : "";
|
|
5641
5820
|
}
|
|
5642
|
-
const
|
|
5821
|
+
const Ho = (n, e, t, r) => {
|
|
5643
5822
|
const i = e.target.value.replace(/\D/g, "").slice(-1), s = [...t];
|
|
5644
5823
|
s[n] = i;
|
|
5645
5824
|
const o = s.join(""), l = s.every((h) => h !== "");
|
|
5646
5825
|
return r("code-change", { value: o, complete: l }), i && l && r("code-complete", { value: o }), s;
|
|
5647
|
-
},
|
|
5826
|
+
}, zo = (n, e, t, r) => {
|
|
5648
5827
|
if (e.key === "Backspace") {
|
|
5649
5828
|
const i = [...t];
|
|
5650
5829
|
!i[n] && n > 0 ? i[n - 1] = "" : i[n] && (i[n] = "");
|
|
@@ -5652,7 +5831,7 @@ const No = (n, e, t, r) => {
|
|
|
5652
5831
|
return r("code-change", { value: s, complete: !1 }), i;
|
|
5653
5832
|
}
|
|
5654
5833
|
return t;
|
|
5655
|
-
},
|
|
5834
|
+
}, Wo = (n, e, t) => {
|
|
5656
5835
|
n.preventDefault();
|
|
5657
5836
|
const r = n.clipboardData.getData("text").replace(/\D/g, "").slice(0, 6);
|
|
5658
5837
|
if (r.length === 0) return e;
|
|
@@ -5662,13 +5841,13 @@ const No = (n, e, t, r) => {
|
|
|
5662
5841
|
const s = i.join(""), o = i.every((l) => l !== "");
|
|
5663
5842
|
return t("code-change", { value: s, complete: o }), r.length === 6 && t("code-complete", { value: s }), i;
|
|
5664
5843
|
};
|
|
5665
|
-
class
|
|
5844
|
+
class Yo extends se {
|
|
5666
5845
|
static formAssociated = !0;
|
|
5667
5846
|
static properties = {
|
|
5668
5847
|
_values: { type: Array, state: !0 },
|
|
5669
5848
|
disabled: { type: Boolean, reflect: !0 }
|
|
5670
5849
|
};
|
|
5671
|
-
static styles =
|
|
5850
|
+
static styles = z`
|
|
5672
5851
|
:host {
|
|
5673
5852
|
display: block;
|
|
5674
5853
|
width: 100%;
|
|
@@ -5767,7 +5946,7 @@ class Ko extends se {
|
|
|
5767
5946
|
this.getInputs()[e]?.focus();
|
|
5768
5947
|
}
|
|
5769
5948
|
inputHandler(e, t) {
|
|
5770
|
-
this._values =
|
|
5949
|
+
this._values = Ho(
|
|
5771
5950
|
e,
|
|
5772
5951
|
t,
|
|
5773
5952
|
this._values,
|
|
@@ -5777,7 +5956,7 @@ class Ko extends se {
|
|
|
5777
5956
|
keydownHandler(e, t) {
|
|
5778
5957
|
if (t.key === "Backspace") {
|
|
5779
5958
|
const r = !this._values[e];
|
|
5780
|
-
this._values =
|
|
5959
|
+
this._values = zo(
|
|
5781
5960
|
e,
|
|
5782
5961
|
t,
|
|
5783
5962
|
this._values,
|
|
@@ -5786,12 +5965,12 @@ class Ko extends se {
|
|
|
5786
5965
|
}
|
|
5787
5966
|
}
|
|
5788
5967
|
pasteHandler(e) {
|
|
5789
|
-
this._values =
|
|
5968
|
+
this._values = Wo(e, this._values, this.dispatchCustomEvent.bind(this));
|
|
5790
5969
|
}
|
|
5791
5970
|
render() {
|
|
5792
|
-
return
|
|
5971
|
+
return x`
|
|
5793
5972
|
<div class="code-inputs">
|
|
5794
|
-
${[0, 1, 2, 3, 4, 5].map((e) =>
|
|
5973
|
+
${[0, 1, 2, 3, 4, 5].map((e) => x`
|
|
5795
5974
|
<input
|
|
5796
5975
|
type = "text"
|
|
5797
5976
|
inputmode = "numeric"
|
|
@@ -5810,19 +5989,19 @@ class Ko extends se {
|
|
|
5810
5989
|
`;
|
|
5811
5990
|
}
|
|
5812
5991
|
}
|
|
5813
|
-
typeof window < "u" && !window.AmazonCognitoIdentity && (window.AmazonCognitoIdentity =
|
|
5814
|
-
const
|
|
5815
|
-
"wral-report-it":
|
|
5816
|
-
"wral-report-media":
|
|
5817
|
-
"wral-code-input":
|
|
5992
|
+
typeof window < "u" && !window.AmazonCognitoIdentity && (window.AmazonCognitoIdentity = ms);
|
|
5993
|
+
const Go = {
|
|
5994
|
+
"wral-report-it": Ko,
|
|
5995
|
+
"wral-report-media": jo,
|
|
5996
|
+
"wral-code-input": Yo
|
|
5818
5997
|
};
|
|
5819
|
-
function
|
|
5998
|
+
function Jo() {
|
|
5820
5999
|
const n = globalThis?.customElements;
|
|
5821
6000
|
if (n)
|
|
5822
|
-
for (const [e, t] of Object.entries(
|
|
6001
|
+
for (const [e, t] of Object.entries(Go))
|
|
5823
6002
|
n.get(e) || n.define(e, t);
|
|
5824
6003
|
}
|
|
5825
|
-
typeof window < "u" && globalThis.customElements &&
|
|
6004
|
+
typeof window < "u" && globalThis.customElements && Jo();
|
|
5826
6005
|
export {
|
|
5827
|
-
|
|
6006
|
+
Jo as defineAll
|
|
5828
6007
|
};
|