@prosopo/procaptcha-bundle 3.0.12 → 3.1.6
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/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +17 -7
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +2 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
- package/CHANGELOG.md +374 -0
- package/dist/bundle/{ProcaptchaWidget-48FxVPQd.js → ProcaptchaWidget-CJ-4hVS1.js} +25 -25
- package/dist/bundle/{ProcaptchaWidget-B2BzhXLv.js → ProcaptchaWidget-Cw3s7cGX.js} +290 -268
- package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
- package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +1002 -0
- package/dist/bundle/{captchaRenderer-DdOlOCKw.js → captchaRenderer-s4QuLEen.js} +23 -22
- package/dist/bundle/{commonChunk-HCVkoCqn.js → commonChunk-BjvuHlB1.js} +62 -68
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-D7qvHZDV.js → emotion-element-c39617d8.browser.esm-BNNnmykm.js} +343 -345
- package/dist/bundle/index-BuQg3Zno.js +1884 -0
- package/dist/bundle/{index-DyYmvHVN.js → index-DIdd2cUz.js} +1 -1
- package/dist/bundle/{index-C00_J7av.js → index-IgqrmVIs.js} +61 -59
- package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
- package/dist/bundle/procaptcha.bundle.js +2 -2
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/dist/bundle/{utilChunk-sqstc6C5.js → utilChunk-DPr6oTOj.js} +22 -22
- package/dist/bundle/{utilCryptoChunk-qm-BM2eT.js → utilCryptoChunk-D6ZLkbFV.js} +176 -167
- package/dist/bundle/{web2Chunk-DCsWA5PR.js → web2Chunk-CNoojUDK.js} +1083 -983
- package/dist/bundle/web3Chunk-BlYvY4Ea.js +525 -0
- package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-aEfPZzrp.js} +3 -3
- package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
- package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
- package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
- package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
- package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
- package/dist/cjs/util/widgetFactory.cjs +7 -2
- package/dist/util/captcha/captchaComponentProvider.js +3 -2
- package/dist/util/captcha/captchaRenderer.js +4 -3
- package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
- package/dist/util/captcha/components/imageCaptcha.js +1 -1
- package/dist/util/captcha/components/powCaptcha.js +1 -1
- package/dist/util/widgetFactory.js +7 -2
- package/package.json +25 -26
- package/stats.html +1 -1
- package/vite.test.config.ts +3 -2
- package/dist/bundle/captchaComponentProvider-B7Vxx339.js +0 -968
- package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
- package/dist/bundle/nobleChunk-Qozzkbsq.js +0 -3648
- package/dist/bundle/web3Chunk-B8txCqUJ.js +0 -517
|
@@ -3,13 +3,13 @@ var Ee = (r) => {
|
|
|
3
3
|
};
|
|
4
4
|
var xe = (r, e, t) => e.has(r) || Ee("Cannot " + t);
|
|
5
5
|
var k = (r, e, t) => (xe(r, e, "read from private field"), t ? t.call(r) : e.get(r)), W = (r, e, t) => e.has(r) ? Ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), J = (r, e, t, n) => (xe(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t);
|
|
6
|
-
import { b as Ae, s as
|
|
7
|
-
import { u as h, a as
|
|
8
|
-
import { B as
|
|
6
|
+
import { b as Ae, s as zr, r as U, a as Te, n as y, c as D, R as g, u as he, i as _e, d as S, e as ze, m as Cr, f as Hr, g as Lr, k as Or, h as Fr, p as Mr, j as qr, l as Vr } from "./nobleChunk-Bbltwf44.js";
|
|
7
|
+
import { u as h, a as Kr, b as I, s as V, i as Ce, c as He, x as Yr, o as Wr, d as Z, e as C, f as Jr, g as Zr, h as Gr, j as Xr, k as Qr, l as et, m as rt, n as Ue, p as tt, q as nt } from "./utilChunk-DPr6oTOj.js";
|
|
8
|
+
import { B as ot } from "./bnChunk-DRlDxTFg.js";
|
|
9
9
|
function fe(r) {
|
|
10
10
|
return r instanceof Uint8Array || ArrayBuffer.isView(r) && r.constructor.name === "Uint8Array";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function st(r, ...e) {
|
|
13
13
|
if (!fe(r))
|
|
14
14
|
throw new Error("Uint8Array expected");
|
|
15
15
|
if (e.length > 0 && !e.includes(r.length))
|
|
@@ -35,17 +35,17 @@ function F(r, e) {
|
|
|
35
35
|
if (!Le(!0, e))
|
|
36
36
|
throw new Error(`${r}: array of strings expected`);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Oe(r, e) {
|
|
39
39
|
if (!Le(!1, e))
|
|
40
40
|
throw new Error(`${r}: array of numbers expected`);
|
|
41
41
|
}
|
|
42
42
|
// @__NO_SIDE_EFFECTS__
|
|
43
|
-
function
|
|
43
|
+
function Fe(...r) {
|
|
44
44
|
const e = (s) => s, t = (s, i) => (a) => s(i(a)), n = r.map((s) => s.encode).reduceRight(t, e), o = r.map((s) => s.decode).reduce(t, e);
|
|
45
45
|
return { encode: n, decode: o };
|
|
46
46
|
}
|
|
47
47
|
// @__NO_SIDE_EFFECTS__
|
|
48
|
-
function
|
|
48
|
+
function Me(r) {
|
|
49
49
|
const e = typeof r == "string" ? r.split("") : r, t = e.length;
|
|
50
50
|
F("alphabet", e);
|
|
51
51
|
const n = new Map(e.map((o, s) => [o, s]));
|
|
@@ -65,14 +65,14 @@ function Fe(r) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
// @__NO_SIDE_EFFECTS__
|
|
68
|
-
function
|
|
68
|
+
function qe(r = "") {
|
|
69
69
|
return P("join", r), {
|
|
70
70
|
encode: (e) => (F("join.decode", e), e.join(r)),
|
|
71
71
|
decode: (e) => (P("join.decode", e), e.split(r))
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
// @__NO_SIDE_EFFECTS__
|
|
75
|
-
function
|
|
75
|
+
function at(r, e = "=") {
|
|
76
76
|
return T(r), P("padding", e), {
|
|
77
77
|
encode(t) {
|
|
78
78
|
for (F("padding.encode", t); t.length * r % 8; )
|
|
@@ -126,7 +126,7 @@ function Se(r, e, t) {
|
|
|
126
126
|
o.push(0);
|
|
127
127
|
return o.reverse();
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const Ve = (r, e) => e === 0 ? r : Ve(e, r % e), M = /* @__NO_SIDE_EFFECTS__ */ (r, e) => r + (e - Ve(r, e)), G = /* @__PURE__ */ (() => {
|
|
130
130
|
let r = [];
|
|
131
131
|
for (let e = 0; e < 40; e++)
|
|
132
132
|
r.push(2 ** e);
|
|
@@ -160,7 +160,7 @@ function Be(r, e, t, n) {
|
|
|
160
160
|
return n && s > 0 && l.push(o >>> 0), l;
|
|
161
161
|
}
|
|
162
162
|
// @__NO_SIDE_EFFECTS__
|
|
163
|
-
function
|
|
163
|
+
function it(r) {
|
|
164
164
|
T(r);
|
|
165
165
|
const e = 2 ** 8;
|
|
166
166
|
return {
|
|
@@ -169,11 +169,11 @@ function at(r) {
|
|
|
169
169
|
throw new Error("radix.encode input should be Uint8Array");
|
|
170
170
|
return Se(Array.from(t), e, r);
|
|
171
171
|
},
|
|
172
|
-
decode: (t) => (
|
|
172
|
+
decode: (t) => (Oe("radix.decode", t), Uint8Array.from(Se(t, r, e)))
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
// @__NO_SIDE_EFFECTS__
|
|
176
|
-
function
|
|
176
|
+
function ct(r, e = !1) {
|
|
177
177
|
if (T(r), r <= 0 || r > 32)
|
|
178
178
|
throw new Error("radix2: bits should be in (0..32]");
|
|
179
179
|
if (/* @__PURE__ */ M(8, r) > 32 || /* @__PURE__ */ M(r, 8) > 32)
|
|
@@ -184,33 +184,33 @@ function it(r, e = !1) {
|
|
|
184
184
|
throw new Error("radix2.encode input should be Uint8Array");
|
|
185
185
|
return Be(Array.from(t), 8, r, !e);
|
|
186
186
|
},
|
|
187
|
-
decode: (t) => (
|
|
187
|
+
decode: (t) => (Oe("radix2.decode", t), Uint8Array.from(Be(t, r, 8, e)))
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
const
|
|
190
|
+
const lt = typeof Uint8Array.from([]).toBase64 == "function" && typeof Uint8Array.fromBase64 == "function", ut = (r, e) => {
|
|
191
191
|
P("base64", r);
|
|
192
192
|
const t = /^[A-Za-z0-9=+/]+$/, n = "base64";
|
|
193
193
|
if (r.length > 0 && !t.test(r))
|
|
194
194
|
throw new Error("invalid base64");
|
|
195
195
|
return Uint8Array.fromBase64(r, { alphabet: n, lastChunkHandling: "strict" });
|
|
196
|
-
},
|
|
196
|
+
}, dt = lt ? {
|
|
197
197
|
encode(r) {
|
|
198
|
-
return
|
|
198
|
+
return st(r), r.toBase64();
|
|
199
199
|
},
|
|
200
200
|
decode(r) {
|
|
201
|
-
return
|
|
201
|
+
return ut(r);
|
|
202
202
|
}
|
|
203
|
-
} : /* @__PURE__ */
|
|
204
|
-
function
|
|
203
|
+
} : /* @__PURE__ */ Fe(/* @__PURE__ */ ct(6), /* @__PURE__ */ Me("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), /* @__PURE__ */ at(6), /* @__PURE__ */ qe("")), ht = /* @__NO_SIDE_EFFECTS__ */ (r) => /* @__PURE__ */ Fe(/* @__PURE__ */ it(58), /* @__PURE__ */ Me(r), /* @__PURE__ */ qe("")), ft = /* @__PURE__ */ ht("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
|
|
204
|
+
function Ke({ coder: r, ipfs: e }, t) {
|
|
205
205
|
return (n, o) => (t(n, o), r.decode(e && o ? n.substring(1) : n));
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Ye({ coder: r, ipfs: e }) {
|
|
208
208
|
return (t, n) => {
|
|
209
209
|
const o = r.encode(h(t));
|
|
210
210
|
return e && n ? `${e}${o}` : o;
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function We({
|
|
214
214
|
chars: r,
|
|
215
215
|
ipfs: e,
|
|
216
216
|
type: t,
|
|
@@ -243,19 +243,19 @@ function Ye({
|
|
|
243
243
|
}
|
|
244
244
|
const pe = {
|
|
245
245
|
chars: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",
|
|
246
|
-
coder:
|
|
246
|
+
coder: ft,
|
|
247
247
|
ipfs: "z",
|
|
248
248
|
type: "base58"
|
|
249
|
-
},
|
|
250
|
-
function
|
|
251
|
-
return (...e) =>
|
|
249
|
+
}, Je = /* @__PURE__ */ We(pe), Ze = /* @__PURE__ */ Ke(pe, Je), Ge = /* @__PURE__ */ Ye(pe);
|
|
250
|
+
function Xe(r) {
|
|
251
|
+
return (...e) => Kr(r(...e));
|
|
252
252
|
}
|
|
253
253
|
function K(r, e = 256, t, n) {
|
|
254
254
|
const o = Math.ceil(e / 8), s = h(r);
|
|
255
255
|
return t ? Ae(s, { dkLen: o, key: t }) : Ae(s, { dkLen: o });
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
function
|
|
257
|
+
const Qe = /* @__PURE__ */ Xe(K), pt = V("SS58PRE");
|
|
258
|
+
function er(r) {
|
|
259
259
|
return K(I(pt, r), 512);
|
|
260
260
|
}
|
|
261
261
|
function gt(r) {
|
|
@@ -265,10 +265,10 @@ function gt(r) {
|
|
|
265
265
|
throw new Error("Invalid address: second byte cannot be undefined");
|
|
266
266
|
const e = r[0] & 64 ? 2 : 1, t = e === 1 ? r[0] : (r[0] & 63) << 2 | r[1] >> 6 | (r[1] & 63) << 8, n = [34 + e, 35 + e].includes(
|
|
267
267
|
r.length
|
|
268
|
-
), o = r.length - (n ? 2 : 1), s =
|
|
268
|
+
), o = r.length - (n ? 2 : 1), s = er(r.subarray(0, o));
|
|
269
269
|
return [(r[0] & 128) === 0 && ![46, 47].includes(r[0]) && (n ? r[r.length - 2] === s[0] && r[r.length - 1] === s[1] : r[r.length - 1] === s[0]), o, e, t];
|
|
270
270
|
}
|
|
271
|
-
const
|
|
271
|
+
const H = {
|
|
272
272
|
allowedDecodedLengths: [1, 2, 4, 8, 32, 33],
|
|
273
273
|
// publicKey has prefix + 2 checksum bytes, short only prefix + 1 checksum byte
|
|
274
274
|
allowedEncodedLengths: [3, 4, 6, 10, 35, 36, 37, 38],
|
|
@@ -277,11 +277,11 @@ const L = {
|
|
|
277
277
|
function ge(r, e, t = -1) {
|
|
278
278
|
if (!r)
|
|
279
279
|
throw new Error("Invalid empty address passed");
|
|
280
|
-
if (
|
|
280
|
+
if (Ce(r) || He(r))
|
|
281
281
|
return h(r);
|
|
282
282
|
try {
|
|
283
|
-
const n =
|
|
284
|
-
if (!
|
|
283
|
+
const n = Ze(r);
|
|
284
|
+
if (!H.allowedEncodedLengths.includes(n.length))
|
|
285
285
|
throw new Error("Invalid decoded address length");
|
|
286
286
|
const [o, s, i, a] = gt(n);
|
|
287
287
|
if (!o && !e)
|
|
@@ -295,13 +295,13 @@ function ge(r, e, t = -1) {
|
|
|
295
295
|
throw new Error(`Decoding ${r}: ${n.message}`);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
function mt(r, e =
|
|
298
|
+
function mt(r, e = H.prefix) {
|
|
299
299
|
const t = ge(r);
|
|
300
300
|
if (e < 0 || e > 16383 || [46, 47].includes(e))
|
|
301
301
|
throw new Error("Out of range ss58Format specified");
|
|
302
|
-
if (!
|
|
302
|
+
if (!H.allowedDecodedLengths.includes(t.length))
|
|
303
303
|
throw new Error(
|
|
304
|
-
`Expected a valid key to convert, with length ${
|
|
304
|
+
`Expected a valid key to convert, with length ${H.allowedDecodedLengths.join(", ")}`
|
|
305
305
|
);
|
|
306
306
|
const n = I(
|
|
307
307
|
e < 64 ? [e] : [
|
|
@@ -310,19 +310,19 @@ function mt(r, e = L.prefix) {
|
|
|
310
310
|
],
|
|
311
311
|
t
|
|
312
312
|
);
|
|
313
|
-
return
|
|
313
|
+
return Ge(
|
|
314
314
|
I(
|
|
315
315
|
n,
|
|
316
|
-
|
|
316
|
+
er(n).subarray(0, [32, 33].includes(t.length) ? 2 : 1)
|
|
317
317
|
)
|
|
318
318
|
);
|
|
319
319
|
}
|
|
320
320
|
const me = {
|
|
321
321
|
chars: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
|
|
322
|
-
coder:
|
|
322
|
+
coder: dt,
|
|
323
323
|
type: "base64",
|
|
324
324
|
withPadding: !0
|
|
325
|
-
},
|
|
325
|
+
}, rr = /* @__PURE__ */ We(me), yt = /* @__PURE__ */ Ke(me, rr), tr = /* @__PURE__ */ Ye(me);
|
|
326
326
|
function z(r, e) {
|
|
327
327
|
return r << e | r >>> 32 - e;
|
|
328
328
|
}
|
|
@@ -423,7 +423,7 @@ const vt = new Uint32Array([
|
|
|
423
423
|
0,
|
|
424
424
|
252
|
|
425
425
|
]);
|
|
426
|
-
function
|
|
426
|
+
function nr(r, e, t, n, o, s) {
|
|
427
427
|
let i, a, l;
|
|
428
428
|
const c = new Uint32Array(17), u = new Uint32Array(17), d = new Uint32Array(17), p = new Uint32Array(17), b = new Uint32Array(17);
|
|
429
429
|
for (a = 0; a < 17; a++) u[a] = d[a] = 0;
|
|
@@ -451,11 +451,11 @@ function rr(r, e, t, n, o, s) {
|
|
|
451
451
|
}
|
|
452
452
|
function kt(r, e, t, n, o, s) {
|
|
453
453
|
const i = new Uint8Array(16);
|
|
454
|
-
return
|
|
454
|
+
return nr(i, 0, t, n, o, s), wt(r, e, i, 0, 16);
|
|
455
455
|
}
|
|
456
456
|
function Et(r, e, t, n, o) {
|
|
457
457
|
if (t < 32) return -1;
|
|
458
|
-
ae(r, 0, e, 0, t, n, o),
|
|
458
|
+
ae(r, 0, e, 0, t, n, o), nr(r, 16, r, 32, t - 32, r);
|
|
459
459
|
for (let s = 0; s < 16; s++) r[s] = 0;
|
|
460
460
|
return 0;
|
|
461
461
|
}
|
|
@@ -467,64 +467,64 @@ function xt(r, e, t, n, o) {
|
|
|
467
467
|
return 0;
|
|
468
468
|
}
|
|
469
469
|
const At = 32, Ut = 24, ie = 32, ce = 16;
|
|
470
|
-
function
|
|
470
|
+
function or(r, e) {
|
|
471
471
|
if (r.length !== At) throw new Error("bad key size");
|
|
472
472
|
if (e.length !== Ut)
|
|
473
473
|
throw new Error("bad nonce size");
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function sr(...r) {
|
|
476
476
|
for (let e = 0, t = r.length; e < t; e++)
|
|
477
477
|
if (!(r[e] instanceof Uint8Array))
|
|
478
478
|
throw new TypeError("unexpected type, use Uint8Array");
|
|
479
479
|
}
|
|
480
480
|
function St(r, e, t) {
|
|
481
|
-
|
|
481
|
+
sr(r, e, t), or(t, e);
|
|
482
482
|
const n = new Uint8Array(ie + r.length), o = new Uint8Array(n.length);
|
|
483
483
|
for (let s = 0; s < r.length; s++)
|
|
484
484
|
n[s + ie] = r[s];
|
|
485
485
|
return Et(o, n, n.length, e, t), o.subarray(ce);
|
|
486
486
|
}
|
|
487
487
|
function Bt(r, e, t) {
|
|
488
|
-
|
|
488
|
+
sr(r, e, t), or(t, e);
|
|
489
489
|
const n = new Uint8Array(ce + r.length), o = new Uint8Array(n.length);
|
|
490
490
|
for (let s = 0; s < r.length; s++)
|
|
491
491
|
n[s + ce] = r[s];
|
|
492
492
|
return n.length < 32 || xt(o, n, n.length, e, t) !== 0 ? null : o.subarray(ie);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function ar(r, e, t) {
|
|
495
495
|
return Bt(r, e, t);
|
|
496
496
|
}
|
|
497
|
-
const Rt =
|
|
497
|
+
const Rt = Yr.crypto;
|
|
498
498
|
function $t(r) {
|
|
499
499
|
return Rt.getRandomValues(r);
|
|
500
500
|
}
|
|
501
501
|
function _(r = 32) {
|
|
502
502
|
return $t(new Uint8Array(r));
|
|
503
503
|
}
|
|
504
|
-
const Nt = /* @__PURE__ */
|
|
504
|
+
const Nt = /* @__PURE__ */ Xe(_);
|
|
505
505
|
function Dt(r, e, t = _(24)) {
|
|
506
506
|
return {
|
|
507
507
|
encrypted: St(r, t, e),
|
|
508
508
|
nonce: t
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
|
-
const
|
|
511
|
+
const L = {
|
|
512
512
|
N: 32768,
|
|
513
513
|
p: 1,
|
|
514
514
|
r: 8
|
|
515
515
|
};
|
|
516
|
-
function
|
|
516
|
+
function ir(r, e = _(), t = L, n) {
|
|
517
517
|
const o = h(r);
|
|
518
518
|
return {
|
|
519
519
|
params: t,
|
|
520
|
-
password:
|
|
520
|
+
password: zr(o, e, Wr({ dkLen: 64 }, t)),
|
|
521
521
|
salt: e
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
524
|
const ee = { isLe: !0 }, re = { bitLength: 32, isLe: !0 }, It = { bitLength: 256, isLe: !0 };
|
|
525
|
-
function
|
|
525
|
+
function cr(r) {
|
|
526
526
|
const e = r.subarray(0, 32), t = Z(r.subarray(32, 36), ee).toNumber(), n = Z(r.subarray(36, 40), ee).toNumber(), o = Z(r.subarray(40, 44), ee).toNumber();
|
|
527
|
-
if (t !==
|
|
527
|
+
if (t !== L.N || n !== L.p || o !== L.r)
|
|
528
528
|
throw new Error("Invalid injected scrypt params found");
|
|
529
529
|
return { params: { N: t, p: n, r: o }, salt: e };
|
|
530
530
|
}
|
|
@@ -539,7 +539,7 @@ function Pt(r, { N: e, p: t, r: n }) {
|
|
|
539
539
|
const ye = [
|
|
540
540
|
"scrypt",
|
|
541
541
|
"xsalsa20-poly1305"
|
|
542
|
-
],
|
|
542
|
+
], lr = ["none"], ur = "3", le = 24, dr = 44;
|
|
543
543
|
function jt(r, e, t = ye) {
|
|
544
544
|
if (!r)
|
|
545
545
|
throw new Error("No encrypted data available to decode");
|
|
@@ -549,14 +549,14 @@ function jt(r, e, t = ye) {
|
|
|
549
549
|
if (e) {
|
|
550
550
|
let o;
|
|
551
551
|
if (t.includes("scrypt")) {
|
|
552
|
-
const { params: s, salt: i } =
|
|
553
|
-
o =
|
|
552
|
+
const { params: s, salt: i } = cr(r);
|
|
553
|
+
o = ir(e, i, s).password, r = r.subarray(dr);
|
|
554
554
|
} else
|
|
555
555
|
o = V(e);
|
|
556
|
-
n =
|
|
556
|
+
n = ar(
|
|
557
557
|
r.subarray(le),
|
|
558
558
|
r.subarray(0, le),
|
|
559
|
-
|
|
559
|
+
Jr(o, 256, !0)
|
|
560
560
|
);
|
|
561
561
|
}
|
|
562
562
|
if (!n)
|
|
@@ -565,11 +565,11 @@ function jt(r, e, t = ye) {
|
|
|
565
565
|
}
|
|
566
566
|
function Tt(r, e, t) {
|
|
567
567
|
return {
|
|
568
|
-
encoded:
|
|
568
|
+
encoded: tr(r),
|
|
569
569
|
encoding: {
|
|
570
570
|
content: e,
|
|
571
|
-
type: t ? ye :
|
|
572
|
-
version:
|
|
571
|
+
type: t ? ye : lr,
|
|
572
|
+
version: ur
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
575
|
}
|
|
@@ -582,7 +582,7 @@ const ke = class ke {
|
|
|
582
582
|
}
|
|
583
583
|
static from(e) {
|
|
584
584
|
const t = new ke(), [n, o] = e.startsWith("/") ? [e.substring(1), !0] : [e, !1];
|
|
585
|
-
return t.soft(_t.test(n) ? new
|
|
585
|
+
return t.soft(_t.test(n) ? new ot(n, 10) : n), o ? t.harden() : t;
|
|
586
586
|
}
|
|
587
587
|
get chainCode() {
|
|
588
588
|
return k(this, A);
|
|
@@ -600,7 +600,7 @@ const ke = class ke {
|
|
|
600
600
|
return J(this, v, !0), this;
|
|
601
601
|
}
|
|
602
602
|
soft(e) {
|
|
603
|
-
return
|
|
603
|
+
return Zr(e) || Gr(e) || Xr(e) ? this.soft(C(e, It)) : He(e) ? this.soft(Qr(e)) : et(e) ? this.soft(rt(V(e))) : e.length > zt ? this.soft(K(e)) : (k(this, A).fill(0), k(this, A).set(e, 0), this);
|
|
604
604
|
}
|
|
605
605
|
soften() {
|
|
606
606
|
return J(this, v, !1), this;
|
|
@@ -609,7 +609,7 @@ const ke = class ke {
|
|
|
609
609
|
A = new WeakMap(), v = new WeakMap();
|
|
610
610
|
let ue = ke;
|
|
611
611
|
const Ct = /\/(\/?)([^/]+)/g;
|
|
612
|
-
function
|
|
612
|
+
function hr(r) {
|
|
613
613
|
const e = r.match(Ct), t = [];
|
|
614
614
|
let n = "";
|
|
615
615
|
if (e) {
|
|
@@ -626,15 +626,15 @@ function ur(r) {
|
|
|
626
626
|
path: t
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
const
|
|
630
|
-
function
|
|
631
|
-
const e = r.match(
|
|
629
|
+
const Ht = /^(\w+( \w+)*)((\/\/?[^/]+)*)(\/\/\/(.*))?$/;
|
|
630
|
+
function Lt(r) {
|
|
631
|
+
const e = r.match(Ht);
|
|
632
632
|
if (e === null)
|
|
633
633
|
throw new Error("Unable to match provided value to a secret URI");
|
|
634
634
|
const [, t, , n, , , o] = e;
|
|
635
635
|
if (!t)
|
|
636
636
|
throw new Error("Unable to extract phrase from provided value");
|
|
637
|
-
const { path: s } =
|
|
637
|
+
const { path: s } = hr(n || "");
|
|
638
638
|
return {
|
|
639
639
|
derivePath: n || "",
|
|
640
640
|
password: o,
|
|
@@ -642,16 +642,16 @@ function Ht(r) {
|
|
|
642
642
|
phrase: t
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
|
-
const
|
|
645
|
+
const fr = BigInt(0), pr = BigInt(3);
|
|
646
646
|
function te(r) {
|
|
647
647
|
if (typeof r == "string")
|
|
648
648
|
return he(r);
|
|
649
|
-
if (
|
|
649
|
+
if (_e(r))
|
|
650
650
|
return r;
|
|
651
651
|
throw new Error("Wrong data");
|
|
652
652
|
}
|
|
653
653
|
function f(r, e, ...t) {
|
|
654
|
-
if (!
|
|
654
|
+
if (!_e(e))
|
|
655
655
|
throw new Error(`${r}: Uint8Array expected`);
|
|
656
656
|
if (t.length && !t.includes(e.length))
|
|
657
657
|
throw new Error(`${r}: Uint8Array expected of length ${t}, not of length=${e.length}`);
|
|
@@ -665,13 +665,13 @@ function B(...r) {
|
|
|
665
665
|
for (const e of r)
|
|
666
666
|
e.fill(0);
|
|
667
667
|
}
|
|
668
|
-
const x = Uint8Array.of(), we =
|
|
668
|
+
const x = Uint8Array.of(), we = Hr.CURVE.n;
|
|
669
669
|
function Re(r, e) {
|
|
670
670
|
f(r, e, 32);
|
|
671
671
|
const t = S(e);
|
|
672
|
-
return
|
|
672
|
+
return ze(r, t, fr, we), t;
|
|
673
673
|
}
|
|
674
|
-
const j = (r) =>
|
|
674
|
+
const j = (r) => Cr(r, we), N = 166, m = {
|
|
675
675
|
I: 1,
|
|
676
676
|
A: 2,
|
|
677
677
|
C: 4,
|
|
@@ -681,10 +681,10 @@ const j = (r) => _r(r, we), N = 166, m = {
|
|
|
681
681
|
};
|
|
682
682
|
class be {
|
|
683
683
|
constructor(e) {
|
|
684
|
-
this.state = new Uint8Array(200), this.pos = 0, this.posBegin = 0, this.curFlags = 0, this.state.set([1, N + 2, 1, 0, 1, 96], 0), this.state.set(he("STROBEv1.0.2"), 6), this.state32 =
|
|
684
|
+
this.state = new Uint8Array(200), this.pos = 0, this.posBegin = 0, this.curFlags = 0, this.state.set([1, N + 2, 1, 0, 1, 96], 0), this.state.set(he("STROBEv1.0.2"), 6), this.state32 = Lr(this.state), this.keccakF1600(), this.metaAD(e, !1);
|
|
685
685
|
}
|
|
686
686
|
keccakF1600() {
|
|
687
|
-
|
|
687
|
+
Or(this.state32);
|
|
688
688
|
}
|
|
689
689
|
runF() {
|
|
690
690
|
this.state[this.pos] ^= this.posBegin, this.state[this.pos + 1] ^= 4, this.state[N + 1] ^= 128, this.keccakF1600(), this.pos = 0, this.posBegin = 0;
|
|
@@ -783,24 +783,24 @@ class R extends Ot {
|
|
|
783
783
|
return o.metaAD("rng", !1), o.KEY(s, !1), o.metaAD(y(t, 4), !1), o.PRF(t, !1);
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
const Ft =
|
|
786
|
+
const Ft = Fr(256), gr = (r) => y(r << pr & Ft, 32), $ = (r) => S(r) >> pr;
|
|
787
787
|
function Y(r) {
|
|
788
788
|
f("secretKey", r, 64);
|
|
789
789
|
const e = $(r.subarray(0, 32));
|
|
790
790
|
return g.BASE.multiply(e).toRawBytes();
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function mr(r) {
|
|
793
793
|
f("seed", r, 32);
|
|
794
|
-
const e =
|
|
794
|
+
const e = Te(r);
|
|
795
795
|
e[0] &= 248, e[31] &= 63, e[31] |= 64;
|
|
796
|
-
const t =
|
|
796
|
+
const t = gr($(e.subarray(0, 32))), n = e.subarray(32, 64), o = D(t, n);
|
|
797
797
|
return B(t, n, e), o;
|
|
798
798
|
}
|
|
799
|
-
const
|
|
799
|
+
const yr = he("substrate");
|
|
800
800
|
function Mt(r, e, t = U) {
|
|
801
801
|
f("message", e), f("secretKey", r, 64);
|
|
802
802
|
const n = new R("SigningContext", t);
|
|
803
|
-
n.label(
|
|
803
|
+
n.label(yr), n.bytes(e);
|
|
804
804
|
const o = $(r.subarray(0, 32)), s = r.subarray(32, 64), i = g.fromHex(Y(r));
|
|
805
805
|
n.protoName("Schnorr-sig"), n.commitPoint("sign:pk", i);
|
|
806
806
|
const a = n.witnessScalar("signing", [s]), l = g.BASE.multiply(a);
|
|
@@ -814,9 +814,9 @@ function qt(r, e, t) {
|
|
|
814
814
|
const n = Uint8Array.from(e.subarray(32, 64));
|
|
815
815
|
n[31] &= 127;
|
|
816
816
|
const o = g.fromHex(e.subarray(0, 32)), s = S(n);
|
|
817
|
-
|
|
817
|
+
ze("s", s, fr, we);
|
|
818
818
|
const i = new R("SigningContext");
|
|
819
|
-
i.label(
|
|
819
|
+
i.label(yr), i.bytes(r);
|
|
820
820
|
const a = g.fromHex(t);
|
|
821
821
|
if (a.equals(g.ZERO))
|
|
822
822
|
return !1;
|
|
@@ -824,12 +824,12 @@ function qt(r, e, t) {
|
|
|
824
824
|
const l = i.challengeScalar("sign:c"), c = g.BASE.multiply(s), u = a.negate().multiply(l).add(c);
|
|
825
825
|
return i.clean(), B(n), u.equals(o);
|
|
826
826
|
}
|
|
827
|
-
const
|
|
827
|
+
const wr = {
|
|
828
828
|
secretSoft(r, e, t = U) {
|
|
829
829
|
f("secretKey", r, 64), f("chainCode", e, 32);
|
|
830
830
|
const n = $(r.subarray(0, 32)), o = r.subarray(32, 64), s = g.fromHex(Y(r)), i = new R("SchnorrRistrettoHDKD", t);
|
|
831
831
|
i.bytes(x), i.appendMessage("chain-code", e), i.commitPoint("public-key", s);
|
|
832
|
-
const a = i.challengeScalar("HDKD-scalar"), l = i.challengeBytes("HDKD-chaincode", 32), c = D(y(n, 32), o), u = i.witnessBytes("HDKD-nonce", 32, [o, c]), d =
|
|
832
|
+
const a = i.challengeScalar("HDKD-scalar"), l = i.challengeBytes("HDKD-chaincode", 32), c = D(y(n, 32), o), u = i.witnessBytes("HDKD-nonce", 32, [o, c]), d = gr(j(n + a)), p = D(d, u);
|
|
833
833
|
return B(d, u, c, l), i.clean(), p;
|
|
834
834
|
},
|
|
835
835
|
secretHard(r, e) {
|
|
@@ -838,7 +838,7 @@ const mr = {
|
|
|
838
838
|
n.bytes(x), n.appendMessage("chain-code", e), n.appendMessage("secret-key", t);
|
|
839
839
|
const o = n.challengeBytes("HDKD-hard", 32), s = n.challengeBytes("HDKD-chaincode", 32);
|
|
840
840
|
n.clean();
|
|
841
|
-
const i =
|
|
841
|
+
const i = mr(o);
|
|
842
842
|
return B(t, o, s), n.clean(), i;
|
|
843
843
|
}
|
|
844
844
|
}, $e = {
|
|
@@ -869,11 +869,11 @@ function Ne(r, e, t, n, o = U) {
|
|
|
869
869
|
const i = s.challengeBytes("VRFHash", 64), a = g.hashToCurve(i), l = new R("VRF", o);
|
|
870
870
|
return t.length && l.label(t), s.clean(), B(i), { input: a, t: l };
|
|
871
871
|
}
|
|
872
|
-
const
|
|
872
|
+
const br = {
|
|
873
873
|
sign(r, e, t = x, n = x, o = U) {
|
|
874
874
|
f("msg", r), f("secretKey", e, 64), f("ctx", t), f("extra", n);
|
|
875
|
-
const s = $(e.subarray(0, 32)), i = e.subarray(32, 64), a = g.fromHex(Y(e)), { input: l, t: c } = Ne(t, r, n, a, o), u = l.multiply(s), d = { output: u }, { proof: p } = $e.proove(s, i, a, c, l, u), b = y(p.c, 32), w = y(p.s, 32),
|
|
876
|
-
return B(i, b, w),
|
|
875
|
+
const s = $(e.subarray(0, 32)), i = e.subarray(32, 64), a = g.fromHex(Y(e)), { input: l, t: c } = Ne(t, r, n, a, o), u = l.multiply(s), d = { output: u }, { proof: p } = $e.proove(s, i, a, c, l, u), b = y(p.c, 32), w = y(p.s, 32), _r = D(d.output.toRawBytes(), b, w);
|
|
876
|
+
return B(i, b, w), _r;
|
|
877
877
|
},
|
|
878
878
|
verify(r, e, t, n = x, o = x, s = U) {
|
|
879
879
|
f("msg", r), f("signature", e, 96), f("pubkey", t, 32), f("ctx", n), f("extra", o);
|
|
@@ -900,20 +900,20 @@ function Kt(r) {
|
|
|
900
900
|
secretKey: e.slice(0, de)
|
|
901
901
|
};
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function vr(r) {
|
|
904
904
|
return (e, t) => {
|
|
905
|
-
if (!
|
|
905
|
+
if (!Ce(t) || t.length !== 32)
|
|
906
906
|
throw new Error("Invalid chainCode passed to derive");
|
|
907
907
|
const n = r(e.secretKey, t), o = Y(n);
|
|
908
908
|
return Kt(I(n, o));
|
|
909
909
|
};
|
|
910
910
|
}
|
|
911
|
-
const
|
|
912
|
-
function
|
|
913
|
-
return t ?
|
|
911
|
+
const kr = /* @__PURE__ */ vr(wr.secretHard), Er = /* @__PURE__ */ vr(wr.secretSoft);
|
|
912
|
+
function xr(r, { chainCode: e, isSoft: t }) {
|
|
913
|
+
return t ? Er(r, e) : kr(r, e);
|
|
914
914
|
}
|
|
915
915
|
const De = {
|
|
916
|
-
sr25519:
|
|
916
|
+
sr25519: xr,
|
|
917
917
|
ecdsa: () => {
|
|
918
918
|
throw new Error("ECDSA key derivation not implemented yet");
|
|
919
919
|
},
|
|
@@ -935,33 +935,33 @@ function Yt(r, e, t) {
|
|
|
935
935
|
o = n(o, s);
|
|
936
936
|
return o;
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function Ar(r, e = _(), t = 2048, n) {
|
|
939
939
|
const o = h(r), s = h(e);
|
|
940
940
|
return {
|
|
941
|
-
password:
|
|
941
|
+
password: Mr(Te, o, s, { c: t, dkLen: 64 }),
|
|
942
942
|
rounds: t,
|
|
943
943
|
salt: e
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
|
-
const xr = { 256: Mr }, Ar = xr[256], Ur = "abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split(
|
|
946
|
+
const Ur = { 256: qr }, Sr = Ur[256], Br = "abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split(
|
|
947
947
|
"|"
|
|
948
|
-
), Ie = "Invalid mnemonic",
|
|
948
|
+
), Ie = "Invalid mnemonic", Rr = "Invalid entropy", Wt = "Invalid mnemonic checksum";
|
|
949
949
|
function Jt(r) {
|
|
950
950
|
return (r || "").normalize("NFKD");
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function $r(r) {
|
|
953
953
|
return Number.parseInt(r, 2);
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function Nr(r) {
|
|
956
956
|
return r.map((e) => e.toString(2).padStart(8, "0")).join("");
|
|
957
957
|
}
|
|
958
|
-
function
|
|
959
|
-
return
|
|
958
|
+
function Dr(r) {
|
|
959
|
+
return Nr(Array.from(Sr(r))).slice(
|
|
960
960
|
0,
|
|
961
961
|
r.length * 8 / 32
|
|
962
962
|
);
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function Ir(r, e = Br) {
|
|
965
965
|
const t = Jt(r).split(" ");
|
|
966
966
|
if (t.length % 3 !== 0)
|
|
967
967
|
throw new Error(Ie);
|
|
@@ -970,50 +970,50 @@ function Nr(r, e = Ur) {
|
|
|
970
970
|
if (d === -1)
|
|
971
971
|
throw new Error(Ie);
|
|
972
972
|
return d.toString(2).padStart(11, "0");
|
|
973
|
-
}).join(""), o = Math.floor(n.length / 33) * 32, s = n.slice(0, o), i = n.slice(o), a = s.match(/(.{1,8})/g), l = a == null ? void 0 : a.map(
|
|
973
|
+
}).join(""), o = Math.floor(n.length / 33) * 32, s = n.slice(0, o), i = n.slice(o), a = s.match(/(.{1,8})/g), l = a == null ? void 0 : a.map($r);
|
|
974
974
|
if (!l || l.length % 4 !== 0 || l.length < 16 || l.length > 32)
|
|
975
|
-
throw new Error(
|
|
975
|
+
throw new Error(Rr);
|
|
976
976
|
const c = h(l);
|
|
977
|
-
if (
|
|
977
|
+
if (Dr(c) !== i)
|
|
978
978
|
throw new Error(Wt);
|
|
979
979
|
return c;
|
|
980
980
|
}
|
|
981
|
-
function Zt(r, e =
|
|
981
|
+
function Zt(r, e = Br) {
|
|
982
982
|
if (r.length % 4 !== 0 || r.length < 16 || r.length > 32)
|
|
983
|
-
throw new Error(
|
|
984
|
-
const t = `${
|
|
983
|
+
throw new Error(Rr);
|
|
984
|
+
const t = `${Nr(Array.from(r))}${Dr(r)}`.match(
|
|
985
985
|
/(.{1,11})/g
|
|
986
|
-
), n = t == null ? void 0 : t.map((o) => e[
|
|
986
|
+
), n = t == null ? void 0 : t.map((o) => e[$r(o)]);
|
|
987
987
|
if (!n || n.length < 12)
|
|
988
988
|
throw new Error("Unable to map entropy to mnemonic");
|
|
989
989
|
return n.join(" ");
|
|
990
990
|
}
|
|
991
991
|
function Gt(r, e) {
|
|
992
992
|
try {
|
|
993
|
-
|
|
993
|
+
Ir(r, e);
|
|
994
994
|
} catch {
|
|
995
995
|
return !1;
|
|
996
996
|
}
|
|
997
997
|
return !0;
|
|
998
998
|
}
|
|
999
|
-
function
|
|
1000
|
-
return
|
|
999
|
+
function Pr(r, e, t) {
|
|
1000
|
+
return Ir(r, e);
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function jr(r, e) {
|
|
1003
1003
|
return Gt(r, e);
|
|
1004
1004
|
}
|
|
1005
1005
|
function Xt(r, e = "", t, n) {
|
|
1006
|
-
if (!
|
|
1006
|
+
if (!jr(r, t))
|
|
1007
1007
|
throw new Error("Invalid bip39 mnemonic specified");
|
|
1008
|
-
const o =
|
|
1009
|
-
return
|
|
1008
|
+
const o = Pr(r, t), s = V(`mnemonic${e}`);
|
|
1009
|
+
return Ar(o, s).password.slice(0, 32);
|
|
1010
1010
|
}
|
|
1011
1011
|
function Qt(r, e) {
|
|
1012
1012
|
if (![33, 65].includes(r.length))
|
|
1013
1013
|
throw new Error(
|
|
1014
1014
|
`Invalid publicKey provided, received ${r.length} bytes input`
|
|
1015
1015
|
);
|
|
1016
|
-
return r.length === 33 ? r :
|
|
1016
|
+
return r.length === 33 ? r : Vr.ProjectivePoint.fromHex(r).toRawBytes(!0);
|
|
1017
1017
|
}
|
|
1018
1018
|
function ve(r, e, t) {
|
|
1019
1019
|
const n = h(r), o = h(e), s = h(t);
|
|
@@ -1112,13 +1112,13 @@ function an(r, e, t) {
|
|
|
1112
1112
|
isWrapped: Ue(s.message, !0),
|
|
1113
1113
|
publicKey: o
|
|
1114
1114
|
}, a = Ue(s.message, !1), l = sn(n);
|
|
1115
|
-
return l(i, s), i.crypto !== "none" || i.isWrapped && !a ? i : (s.message = a ?
|
|
1115
|
+
return l(i, s), i.crypto !== "none" || i.isWrapped && !a ? i : (s.message = a ? tt(s.message) : nt(s.message), l(i, s));
|
|
1116
1116
|
}
|
|
1117
1117
|
function cn(r) {
|
|
1118
1118
|
const e = h(r);
|
|
1119
1119
|
if (e.length !== 32)
|
|
1120
1120
|
throw new Error(`Expected a seed of 32 bytes, found ${e.length}`);
|
|
1121
|
-
const t =
|
|
1121
|
+
const t = mr(e), n = S(t.subarray(0, 32)) >> 3n, o = g.BASE.multiply(n).toRawBytes();
|
|
1122
1122
|
return {
|
|
1123
1123
|
publicKey: new Uint8Array(o),
|
|
1124
1124
|
secretKey: new Uint8Array(t)
|
|
@@ -1137,7 +1137,7 @@ function un(r, { secretKey: e }, t = Pe, n = Pe) {
|
|
|
1137
1137
|
const o = h(r), s = h(e), i = h(t), a = h(n);
|
|
1138
1138
|
if (s.length !== 64)
|
|
1139
1139
|
throw new Error("Invalid secretKey length, expected 64 bytes");
|
|
1140
|
-
return
|
|
1140
|
+
return br.sign(o, s, i, a);
|
|
1141
1141
|
}
|
|
1142
1142
|
const je = new Uint8Array();
|
|
1143
1143
|
function dn(r, e, t, n = je, o = je) {
|
|
@@ -1146,7 +1146,7 @@ function dn(r, e, t, n = je, o = je) {
|
|
|
1146
1146
|
throw new Error("Invalid publicKey length, expected 32 bytes");
|
|
1147
1147
|
if (i.length !== 96)
|
|
1148
1148
|
throw new Error("Invalid vrfSign output length, expected 96 bytes");
|
|
1149
|
-
return
|
|
1149
|
+
return br.verify(
|
|
1150
1150
|
s,
|
|
1151
1151
|
i,
|
|
1152
1152
|
a,
|
|
@@ -1154,47 +1154,55 @@ function dn(r, e, t, n = je, o = je) {
|
|
|
1154
1154
|
c
|
|
1155
1155
|
);
|
|
1156
1156
|
}
|
|
1157
|
-
|
|
1157
|
+
function Tr(r, e) {
|
|
1158
|
+
return Qe(r, e);
|
|
1159
|
+
}
|
|
1160
|
+
function hn(r) {
|
|
1161
|
+
return Tr(r.join(""));
|
|
1162
|
+
}
|
|
1163
|
+
const yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1158
1164
|
__proto__: null,
|
|
1159
1165
|
ENCODING: ye,
|
|
1160
|
-
ENCODING_NONE:
|
|
1161
|
-
ENCODING_VERSION:
|
|
1166
|
+
ENCODING_NONE: lr,
|
|
1167
|
+
ENCODING_VERSION: ur,
|
|
1162
1168
|
NONCE_LENGTH: le,
|
|
1163
|
-
SCRYPT_LENGTH:
|
|
1164
|
-
base58Decode:
|
|
1165
|
-
base58Encode:
|
|
1166
|
-
base58Validate:
|
|
1169
|
+
SCRYPT_LENGTH: dr,
|
|
1170
|
+
base58Decode: Ze,
|
|
1171
|
+
base58Encode: Ge,
|
|
1172
|
+
base58Validate: Je,
|
|
1167
1173
|
base64Decode: yt,
|
|
1168
|
-
base64Encode:
|
|
1169
|
-
base64Validate:
|
|
1170
|
-
blake2AsHex:
|
|
1174
|
+
base64Encode: tr,
|
|
1175
|
+
base64Validate: rr,
|
|
1176
|
+
blake2AsHex: Qe,
|
|
1171
1177
|
blake2AsU8a: K,
|
|
1172
1178
|
decodeAddress: ge,
|
|
1173
1179
|
encodeAddress: mt,
|
|
1174
1180
|
entropyToMnemonic: Zt,
|
|
1181
|
+
hexHash: Tr,
|
|
1182
|
+
hexHashArray: hn,
|
|
1175
1183
|
jsonDecryptData: jt,
|
|
1176
1184
|
jsonEncryptFormat: Tt,
|
|
1177
|
-
keyExtractPath:
|
|
1178
|
-
keyExtractSuri:
|
|
1185
|
+
keyExtractPath: hr,
|
|
1186
|
+
keyExtractSuri: Lt,
|
|
1179
1187
|
keyFromPath: Yt,
|
|
1180
|
-
keyHdkdSr25519:
|
|
1181
|
-
mnemonicToEntropy:
|
|
1188
|
+
keyHdkdSr25519: xr,
|
|
1189
|
+
mnemonicToEntropy: Pr,
|
|
1182
1190
|
mnemonicToMiniSecret: Xt,
|
|
1183
|
-
mnemonicValidate:
|
|
1184
|
-
naclDecrypt:
|
|
1191
|
+
mnemonicValidate: jr,
|
|
1192
|
+
naclDecrypt: ar,
|
|
1185
1193
|
naclEncrypt: Dt,
|
|
1186
|
-
pbkdf2Encode:
|
|
1194
|
+
pbkdf2Encode: Ar,
|
|
1187
1195
|
randomAsHex: Nt,
|
|
1188
1196
|
randomAsU8a: _,
|
|
1189
|
-
scryptEncode:
|
|
1190
|
-
scryptFromU8a:
|
|
1197
|
+
scryptEncode: ir,
|
|
1198
|
+
scryptFromU8a: cr,
|
|
1191
1199
|
scryptToU8a: Pt,
|
|
1192
1200
|
secp256k1Compress: Qt,
|
|
1193
|
-
sha256AsU8a:
|
|
1194
|
-
shaAsU8a:
|
|
1201
|
+
sha256AsU8a: Sr,
|
|
1202
|
+
shaAsU8a: Ur,
|
|
1195
1203
|
signatureVerify: an,
|
|
1196
|
-
sr25519DeriveHard:
|
|
1197
|
-
sr25519DeriveSoft:
|
|
1204
|
+
sr25519DeriveHard: kr,
|
|
1205
|
+
sr25519DeriveSoft: Er,
|
|
1198
1206
|
sr25519FromSeed: cn,
|
|
1199
1207
|
sr25519Sign: ln,
|
|
1200
1208
|
sr25519Verify: ve,
|
|
@@ -1203,25 +1211,26 @@ const mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1203
1211
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1204
1212
|
export {
|
|
1205
1213
|
Pt as a,
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
+
Tt as b,
|
|
1215
|
+
dn as c,
|
|
1216
|
+
un as d,
|
|
1217
|
+
an as e,
|
|
1218
|
+
Qt as f,
|
|
1219
|
+
ln as g,
|
|
1220
|
+
Yt as h,
|
|
1221
|
+
cn as i,
|
|
1214
1222
|
jt as j,
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1223
|
+
hr as k,
|
|
1224
|
+
ge as l,
|
|
1225
|
+
mt as m,
|
|
1218
1226
|
Dt as n,
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1227
|
+
yt as o,
|
|
1228
|
+
Lt as p,
|
|
1229
|
+
Xt as q,
|
|
1230
|
+
Tr as r,
|
|
1231
|
+
ir as s,
|
|
1224
1232
|
$t as t,
|
|
1225
|
-
|
|
1226
|
-
|
|
1233
|
+
hn as u,
|
|
1234
|
+
Nt as v,
|
|
1235
|
+
yn as w
|
|
1227
1236
|
};
|